Public Member Functions | Private Attributes
xpath_node_set_raw Class Reference

List of all members.

Public Member Functions

 xpath_node_set_raw ()
xpath_node * begin () const
xpath_node * end () const
bool empty () const
size_t size () const
xpath_node first () const
void push_back (const xpath_node &node, xpath_allocator *alloc)
void append (const xpath_node *begin_, const xpath_node *end_, xpath_allocator *alloc)
void sort_do ()
void truncate (xpath_node *pos)
void remove_duplicates ()
xpath_node_set::type_t type () const
void set_type (xpath_node_set::type_t value)

Private Attributes

xpath_node_set::type_t _type
xpath_node * _begin
xpath_node * _end
xpath_node * _eos

Detailed Description

Definition at line 7339 of file pugixml.cpp.


Constructor & Destructor Documentation

Definition at line 7348 of file pugixml.cpp.

                                    : _type(xpath_node_set::type_unsorted), _begin(0), _end(0), _eos(0)
                {
                }

Member Function Documentation

void xpath_node_set_raw::append ( const xpath_node *  begin_,
const xpath_node *  end_,
xpath_allocator alloc 
) [inline]

Definition at line 7399 of file pugixml.cpp.

References _begin, _end, _eos, and xpath_allocator::reallocate().

Referenced by xpath_ast_node::eval_node_set().

                {
                        size_t size_ = static_cast<size_t>(_end - _begin);
                        size_t capacity = static_cast<size_t>(_eos - _begin);
                        size_t count = static_cast<size_t>(end_ - begin_);

                        if (size_ + count > capacity)
                        {
                                // reallocate the old array or allocate a new one
                                xpath_node* data = static_cast<xpath_node*>(alloc->reallocate(_begin, capacity * sizeof(xpath_node), (size_ + count) * sizeof(xpath_node)));
                                assert(data);

                                // finalize
                                _begin = data;
                                _end = data + size_;
                                _eos = data + size_ + count;
                        }

                        memcpy(_end, begin_, count * sizeof(xpath_node));
                        _end += count;
                }
xpath_node* xpath_node_set_raw::begin ( ) const [inline]
bool xpath_node_set_raw::empty ( ) const [inline]

Definition at line 7362 of file pugixml.cpp.

References _begin, and _end.

Referenced by xpath_ast_node::eval_boolean(), and xpath_ast_node::eval_string().

                {
                        return _begin == _end;
                }
xpath_node* xpath_node_set_raw::end ( ) const [inline]
xpath_node xpath_node_set_raw::first ( ) const [inline]

Definition at line 7372 of file pugixml.cpp.

References _begin, _end, _type, and xpath_first().

Referenced by xpath_ast_node::eval_string().

                {
                        return xpath_first(_begin, _end, _type);
                }
void xpath_node_set_raw::push_back ( const xpath_node &  node,
xpath_allocator alloc 
) [inline]

Definition at line 7377 of file pugixml.cpp.

References _begin, _end, _eos, and xpath_allocator::reallocate().

Referenced by xpath_ast_node::eval_node_set(), and xpath_ast_node::step_push().

                {
                        if (_end == _eos)
                        {
                                size_t capacity = static_cast<size_t>(_eos - _begin);

                                // get new capacity (1.5x rule)
                                size_t new_capacity = capacity + capacity / 2 + 1;

                                // reallocate the old array or allocate a new one
                                xpath_node* data = static_cast<xpath_node*>(alloc->reallocate(_begin, capacity * sizeof(xpath_node), new_capacity * sizeof(xpath_node)));
                                assert(data);

                                // finalize
                                _begin = data;
                                _end = data + capacity;
                                _eos = data + new_capacity;
                        }

                        *_end++ = node;
                }

Definition at line 7433 of file pugixml.cpp.

References _begin, _end, _type, sort(), and unique().

Referenced by xpath_ast_node::eval_node_set(), and xpath_ast_node::step_do().

                {
                        if (_type == xpath_node_set::type_unsorted)
                                sort(_begin, _end, duplicate_comparator());
                
                        _end = unique(_begin, _end);
                }
void xpath_node_set_raw::set_type ( xpath_node_set::type_t  value) [inline]

Definition at line 7446 of file pugixml.cpp.

References _type.

Referenced by xpath_ast_node::eval_node_set(), and xpath_ast_node::step_do().

                {
                        _type = value;
                }
size_t xpath_node_set_raw::size ( ) const [inline]

Definition at line 7367 of file pugixml.cpp.

References _begin, and _end.

Referenced by xpath_ast_node::apply_predicate(), xpath_ast_node::apply_predicates(), xpath_ast_node::eval_number(), and xpath_ast_node::step_do().

                {
                        return static_cast<size_t>(_end - _begin);
                }
void xpath_node_set_raw::sort_do ( ) [inline]

Definition at line 7421 of file pugixml.cpp.

References _begin, _end, _type, and xpath_sort().

Referenced by xpath_ast_node::eval_node_set().

                {
                        _type = xpath_sort(_begin, _end, _type, false);
                }
void xpath_node_set_raw::truncate ( xpath_node *  pos) [inline]

Definition at line 7426 of file pugixml.cpp.

References _begin, and _end.

Referenced by xpath_ast_node::apply_predicate().

                {
                        assert(_begin <= pos && pos <= _end);

                        _end = pos;
                }
xpath_node_set::type_t xpath_node_set_raw::type ( ) const [inline]

Definition at line 7441 of file pugixml.cpp.

References _type.

Referenced by xpath_ast_node::step_do().

                {
                        return _type;
                }

Member Data Documentation

xpath_node* xpath_node_set_raw::_begin [private]

Definition at line 7343 of file pugixml.cpp.

Referenced by append(), begin(), empty(), first(), push_back(), remove_duplicates(), size(), sort_do(), and truncate().

xpath_node* xpath_node_set_raw::_end [private]

Definition at line 7344 of file pugixml.cpp.

Referenced by append(), empty(), end(), first(), push_back(), remove_duplicates(), size(), sort_do(), and truncate().

xpath_node* xpath_node_set_raw::_eos [private]

Definition at line 7345 of file pugixml.cpp.

Referenced by append(), and push_back().

xpath_node_set::type_t xpath_node_set_raw::_type [private]

Definition at line 7341 of file pugixml.cpp.

Referenced by first(), remove_duplicates(), set_type(), sort_do(), and type().


The documentation for this class was generated from the following file:

Generated on Mon Sep 15 2014 01:23:56 for QuickFIX by doxygen 1.7.6.1 written by Dimitri van Heesch, © 1997-2001