Main Page | Namespace List | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

inode_reader Struct Template Reference

#include <inode_reader.h>

List of all members.


Detailed Description

template<int PreviousLinkT = 1, int NextLinkT = 0, typename ContainerT = std::vector< int >>
struct cttl::inode_reader< PreviousLinkT, NextLinkT, ContainerT >

Represents readable node of a syntax tree, modeled on top of STL sequence container.

While representing tree node, cttl::inode_reader behaves as bidirectional iterator.

PreviousLinkT
Template parameter specifying field pointing to the previous node. As bidirectional iterator, node can be moved to the previous node by prefix and postfix decrement operators. Syntax node stores offset of the previous node in the field described by PreviousLinkT.
NextLinkT
Template parameter specifying field pointing to the next node. As bidirectional iterator, node can be moved to the next node by prefix and postfix increment operators. Syntax node stores offset of the next node in the field described by NextLinkT.
ContainerT
Template parameter specifying underlying sequence container type.
See also:

Definition at line 75 of file inode_reader.h.

Public Types

typedef ContainerT container_T
 Defines type container.
typedef ContainerT::reference container_reference_T
 Defines reference type of the container.
typedef ContainerT::const_reference container_const_reference_T
 Defines constant reference type of the container.
typedef inode_reader< PreviousLinkT,
NextLinkT, ContainerT > 
iterator
 Defines iterator type.
typedef inode_reader< PreviousLinkT,
NextLinkT, ContainerT > 
const_iterator
 Defines const_iterator type.
typedef inode_reader< PreviousLinkT,
NextLinkT, ContainerT > 
value_type
 Bidirectional iterator: value type of the node.
typedef inode_reader< PreviousLinkT,
NextLinkT, ContainerT > * 
pointer
 Bidirectional iterator: pointer type of the node.
typedef inode_reader< PreviousLinkT,
NextLinkT, ContainerT > 
reference
 Bidirectional iterator: reference type of the node.
typedef inode_reader< PreviousLinkT,
NextLinkT, ContainerT > 
const_reference
 Bidirectional iterator: const reference type of the node.
typedef ContainerT::size_type size_type
 Bidirectional iterator: size type of the node.
typedef ptrdiff_t difference_type
 Bidirectional iterator: difference type of the node.
typedef std::bidirectional_iterator_tag iterator_category
 Bidirectional iterator: iterator category of the node.

Public Member Functions

 inode_reader ()
 Bidirectional iterator: default constructor.
 inode_reader (inode_reader< PreviousLinkT, NextLinkT, ContainerT > const &other_)
 Bidirectional iterator: copy constructor.
 inode_reader (ContainerT &container_)
 Constructs new cttl::inode_reader and positions itself at the end.
 inode_reader (ContainerT &container_, size_type offset_)
 Constructs new cttl::inode_reader at specified position.
inode_reader< PreviousLinkT,
NextLinkT, ContainerT > & 
operator= (inode_reader< PreviousLinkT, NextLinkT, ContainerT > const &other_)
 Bidirectional iterator: assignment operator.
const_reference operator * () const
 Bidirectional iterator: dereference operator of the integer node iterator.
reference operator * ()
 Bidirectional iterator: dereference operator of the integer node iterator.
value_type const * operator-> () const
 Bidirectional iterator: pointer operator of the integer node iterator.
value_typeoperator-> ()
 Bidirectional iterator: pointer operator of the integer node iterator.
inode_reader< PreviousLinkT,
NextLinkT, ContainerT > & 
operator++ ()
 Bidirectional iterator: prefix increment operator of the integer node iterator.
inode_reader< PreviousLinkT,
NextLinkT, ContainerT > 
operator++ (int)
 Bidirectional iterator: postfix increment operator of the integer node iterator.
inode_reader< PreviousLinkT,
NextLinkT, ContainerT > & 
operator-- ()
 Bidirectional iterator: prefix decrement operator of the integer node iterator.
inode_reader< PreviousLinkT,
NextLinkT, ContainerT > 
operator-- (int)
 Bidirectional iterator: postfix decrement operator of the integer node iterator.
bool operator== (inode_reader< PreviousLinkT, NextLinkT, ContainerT > const &other_) const
 Bidirectional iterator: inode_reader comparison returns true if positions of two nodes are equal, false otherwise.
bool operator!= (inode_reader< PreviousLinkT, NextLinkT, ContainerT > const &other_) const
 Bidirectional iterator: true if node positions are different nodes.
inode_reader< PreviousLinkT,
NextLinkT, ContainerT > 
begin () const
 Bidirectional iterator: returns first node of the container.
inode_reader< PreviousLinkT,
NextLinkT, ContainerT > 
begin (int offset_) const
 Returns arbitrary node of the container.
inode_reader< PreviousLinkT,
NextLinkT, ContainerT > 
end () const
 Bidirectional iterator: returns zero node of the container.
container_reference_T value (int field_)
 Returns mutable value stored at specific field of syntax tree node.
container_const_reference_T value (int field_) const
 Returns constant value at specific field of syntax tree node.
container_reference_T operator[] (int field_)
 Returns mutable value stored at specific field of syntax tree node.
container_const_reference_T operator[] (int field_) const
 Returns constant value at specific field of syntax tree node.
void offset (size_type offset_)
 Sets offset of syntax tree node.
size_type offset () const
 Returns current offset of the syntax tree node.
inode_reader< PreviousLinkT,
NextLinkT, ContainerT > 
operator() (int field_) const
 Returns instance of cttl::inode_reader pointing to a specific relative node.
int next_link () const
 Returns field pointing to next sibling node.
int previous_link () const
 Returns field pointing to previous sibling node.

Static Public Attributes

const int previous_link_field = PreviousLinkT
 Constant describing default field pointing to the previous node.
const int next_link_field = NextLinkT
 Constant describing default field pointing to the next node.

Protected Attributes

size_type m_offset
 Offset of the node.
ContainerT * m_ptr_container
 Pointer to STL sequence container providing physical storage of the syntax tree.


Member Typedef Documentation

typedef inode_reader< PreviousLinkT, NextLinkT, ContainerT > const_iterator
 

Defines const_iterator type.

Definition at line 97 of file inode_reader.h.

typedef inode_reader< PreviousLinkT, NextLinkT, ContainerT > const_reference
 

Bidirectional iterator: const reference type of the node.

Definition at line 109 of file inode_reader.h.

Referenced by inode_reader::operator *().

typedef ContainerT::const_reference container_const_reference_T
 

Defines constant reference type of the container.

Definition at line 91 of file inode_reader.h.

typedef ContainerT::reference container_reference_T
 

Defines reference type of the container.

Definition at line 88 of file inode_reader.h.

typedef ContainerT container_T
 

Defines type container.

Definition at line 85 of file inode_reader.h.

typedef ptrdiff_t difference_type
 

Bidirectional iterator: difference type of the node.

Definition at line 115 of file inode_reader.h.

typedef inode_reader< PreviousLinkT, NextLinkT, ContainerT > iterator
 

Defines iterator type.

Definition at line 94 of file inode_reader.h.

typedef std::bidirectional_iterator_tag iterator_category
 

Bidirectional iterator: iterator category of the node.

Definition at line 118 of file inode_reader.h.

typedef inode_reader< PreviousLinkT, NextLinkT, ContainerT >* pointer
 

Bidirectional iterator: pointer type of the node.

Definition at line 103 of file inode_reader.h.

typedef inode_reader< PreviousLinkT, NextLinkT, ContainerT > reference
 

Bidirectional iterator: reference type of the node.

Definition at line 106 of file inode_reader.h.

Referenced by inode_reader::operator *().

typedef ContainerT::size_type size_type
 

Bidirectional iterator: size type of the node.

Definition at line 112 of file inode_reader.h.

typedef inode_reader< PreviousLinkT, NextLinkT, ContainerT > value_type
 

Bidirectional iterator: value type of the node.

Definition at line 100 of file inode_reader.h.

Referenced by inode_reader::operator->().


Constructor & Destructor Documentation

inode_reader  )  [inline]
 

Bidirectional iterator: default constructor.

Definition at line 123 of file inode_reader.h.

inode_reader inode_reader< PreviousLinkT, NextLinkT, ContainerT > const &  other_  )  [inline]
 

Bidirectional iterator: copy constructor.

Definition at line 131 of file inode_reader.h.

inode_reader ContainerT &  container_  )  [inline]
 

Constructs new cttl::inode_reader and positions itself at the end.

Definition at line 139 of file inode_reader.h.

inode_reader ContainerT &  container_,
size_type  offset_
[inline]
 

Constructs new cttl::inode_reader at specified position.

Definition at line 147 of file inode_reader.h.


Member Function Documentation

inode_reader< PreviousLinkT, NextLinkT, ContainerT > begin int  offset_  )  const [inline]
 

Returns arbitrary node of the container.

Definition at line 238 of file inode_reader.h.

inode_reader< PreviousLinkT, NextLinkT, ContainerT > begin  )  const [inline]
 

Bidirectional iterator: returns first node of the container.

Definition at line 232 of file inode_reader.h.

inode_reader< PreviousLinkT, NextLinkT, ContainerT > end  )  const [inline]
 

Bidirectional iterator: returns zero node of the container.

Definition at line 244 of file inode_reader.h.

int next_link  )  const [inline]
 

Returns field pointing to next sibling node.

Definition at line 300 of file inode_reader.h.

size_type offset  )  const [inline]
 

Returns current offset of the syntax tree node.

Definition at line 284 of file inode_reader.h.

void offset size_type  offset_  )  [inline]
 

Sets offset of syntax tree node.

Definition at line 278 of file inode_reader.h.

Referenced by inode_reader::operator!=(), and inode_reader::operator==().

reference operator *  )  [inline]
 

Bidirectional iterator: dereference operator of the integer node iterator.

Definition at line 172 of file inode_reader.h.

References inode_reader::reference.

const_reference operator *  )  const [inline]
 

Bidirectional iterator: dereference operator of the integer node iterator.

Definition at line 166 of file inode_reader.h.

References inode_reader::const_reference.

bool operator!= inode_reader< PreviousLinkT, NextLinkT, ContainerT > const &  other_  )  const [inline]
 

Bidirectional iterator: true if node positions are different nodes.

Definition at line 226 of file inode_reader.h.

References inode_reader::offset().

inode_reader< PreviousLinkT, NextLinkT, ContainerT > operator() int  field_  )  const [inline]
 

Returns instance of cttl::inode_reader pointing to a specific relative node.

Definition at line 294 of file inode_reader.h.

inode_reader< PreviousLinkT, NextLinkT, ContainerT > operator++ int   )  [inline]
 

Bidirectional iterator: postfix increment operator of the integer node iterator.

Definition at line 197 of file inode_reader.h.

inode_reader< PreviousLinkT, NextLinkT, ContainerT >& operator++  )  [inline]
 

Bidirectional iterator: prefix increment operator of the integer node iterator.

Definition at line 190 of file inode_reader.h.

inode_reader< PreviousLinkT, NextLinkT, ContainerT > operator-- int   )  [inline]
 

Bidirectional iterator: postfix decrement operator of the integer node iterator.

Definition at line 212 of file inode_reader.h.

inode_reader< PreviousLinkT, NextLinkT, ContainerT >& operator--  )  [inline]
 

Bidirectional iterator: prefix decrement operator of the integer node iterator.

Definition at line 205 of file inode_reader.h.

value_type* operator->  )  [inline]
 

Bidirectional iterator: pointer operator of the integer node iterator.

Definition at line 184 of file inode_reader.h.

References inode_reader::value_type.

value_type const* operator->  )  const [inline]
 

Bidirectional iterator: pointer operator of the integer node iterator.

Definition at line 178 of file inode_reader.h.

References inode_reader::value_type.

inode_reader< PreviousLinkT, NextLinkT, ContainerT >& operator= inode_reader< PreviousLinkT, NextLinkT, ContainerT > const &  other_  )  [inline]
 

Bidirectional iterator: assignment operator.

Definition at line 155 of file inode_reader.h.

References inode_reader::m_offset, and inode_reader::m_ptr_container.

bool operator== inode_reader< PreviousLinkT, NextLinkT, ContainerT > const &  other_  )  const [inline]
 

Bidirectional iterator: inode_reader comparison returns true if positions of two nodes are equal, false otherwise.

Definition at line 220 of file inode_reader.h.

References inode_reader::offset().

container_const_reference_T operator[] int  field_  )  const [inline]
 

Returns constant value at specific field of syntax tree node.

Definition at line 272 of file inode_reader.h.

container_reference_T operator[] int  field_  )  [inline]
 

Returns mutable value stored at specific field of syntax tree node.

Definition at line 266 of file inode_reader.h.

int previous_link  )  const [inline]
 

Returns field pointing to previous sibling node.

Definition at line 306 of file inode_reader.h.

container_const_reference_T value int  field_  )  const [inline]
 

Returns constant value at specific field of syntax tree node.

Definition at line 260 of file inode_reader.h.

container_reference_T value int  field_  )  [inline]
 

Returns mutable value stored at specific field of syntax tree node.

Definition at line 254 of file inode_reader.h.


Member Data Documentation

size_type m_offset [protected]
 

Offset of the node.

Definition at line 317 of file inode_reader.h.

Referenced by inode_reader::operator=().

ContainerT* m_ptr_container [protected]
 

Pointer to STL sequence container providing physical storage of the syntax tree.

Definition at line 320 of file inode_reader.h.

Referenced by inode_reader::operator=().

const int next_link_field = NextLinkT [static]
 

Constant describing default field pointing to the next node.

Definition at line 82 of file inode_reader.h.

const int previous_link_field = PreviousLinkT [static]
 

Constant describing default field pointing to the previous node.

Definition at line 79 of file inode_reader.h.


The documentation for this struct was generated from the following file:
Generated on Thu Nov 2 17:43:48 2006 for CTTL Utility Classes and Functions by  doxygen 1.3.9.1