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

inode_writer Struct Template Reference

#include <inode_writer.h>

List of all members.


Detailed Description

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

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

In addition to tree node representation, cttl::inode_writer class also behaves as STL bidirectional iterator.

PreviousLinkT
Template parameter specifying field for linkage with previous node. cttl::inode_reader can be moved to the previous node by prefix and postfix decrement operators.
NextLinkT
Template parameter specifying field for linkage with next node. cttl::inode_reader can be moved to the next node by prefix and postfix increment operators.
ContainerT
Template parameter specifying underlying sequence container type.
See also:

Definition at line 73 of file inode_writer.h.

Public Types

typedef ContainerT container_T
 Defines type container.
typedef ContainerT::value_type value_type
 Bidirectional iterator: value type of the node.
typedef inode_writer< PreviousLinkT,
NextLinkT, ContainerT > 
inode_T
 Defines node type.
typedef inode_writer< PreviousLinkT,
NextLinkT, ContainerT > 
iterator
 Defines iterator type.
typedef inode_writer< PreviousLinkT,
NextLinkT, ContainerT > 
const_iterator
 Defines const_iterator type.
typedef ContainerT::pointer pointer
 Bidirectional iterator: pointer type of the node.
typedef ContainerT::reference reference
 Bidirectional iterator: reference type of the node.
typedef ContainerT::const_reference const_reference
 Bidirectional iterator: const reference type of the node.
typedef ContainerT::size_type size_type
 Bidirectional iterator: size type of the node.
typedef ContainerT::difference_type 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_writer ()
 Bidirectional iterator: default constructor.
 inode_writer (inode_writer< PreviousLinkT, NextLinkT, ContainerT > const &other_)
 Bidirectional iterator: copy constructor.
 inode_writer (ContainerT &container_)
 Constructs new cttl::inode_writer and positions itself at the end.
 inode_writer (ContainerT &container_, size_type offset_)
 Constructs new cttl::inode_writer at specified position.
inode_writer< PreviousLinkT,
NextLinkT, ContainerT > & 
operator= (inode_writer< PreviousLinkT, NextLinkT, ContainerT > const &other_)
 Bidirectional iterator: assignment operator.
const_reference operator * () const
 Bidirectional iterator: dereference operator returns value at the current position.
reference operator * ()
 Bidirectional iterator: dereference operator returns value at the current position.
value_type const * operator-> () const
 Bidirectional iterator: pointer operator returns pointer to value at the current position of the syntax tree node.
value_typeoperator-> ()
 Bidirectional iterator: pointer operator returns pointer to value at the current position of the syntax tree node.
inode_writer< PreviousLinkT,
NextLinkT, ContainerT > & 
operator++ ()
 Bidirectional iterator: prefix increment operator of cttl::inode_writer increments current offset.
inode_writer< PreviousLinkT,
NextLinkT, ContainerT > 
operator++ (int)
 Bidirectional iterator: postfix increment operator of cttl::inode_writer increments current offset.
inode_writer< PreviousLinkT,
NextLinkT, ContainerT > & 
operator-- ()
 Bidirectional iterator: prefix decrement operator of cttl::inode_writer decrements current offset.
inode_writer< PreviousLinkT,
NextLinkT, ContainerT > 
operator-- (int)
 Bidirectional iterator: postfix decrement operator of cttl::inode_writer decrements current offset.
inode_writer< PreviousLinkT,
NextLinkT, ContainerT > 
begin () const
 Bidirectional iterator: returns copy of cttl::inode_writer with zero offset.
inode_writer< PreviousLinkT,
NextLinkT, ContainerT > 
begin (int offset_) const
 Returns copy of cttl::inode_writer at arbitrary position.
inode_writer< PreviousLinkT,
NextLinkT, ContainerT > 
end () const
 Bidirectional iterator: returns copy of cttl::inode_writer with offset at the end of the underlying container.
inode_writer< PreviousLinkT,
NextLinkT, ContainerT > & 
operator= (size_type size_)
 Assign new offset.
inode_writer< PreviousLinkT,
NextLinkT, ContainerT > & 
operator+= (size_type size_)
 Assign new offset.
inode_writer< PreviousLinkT,
NextLinkT, ContainerT > & 
operator-= (size_type size_)
 Assign new offset.
reference value (int field_)
 Returns mutable value stored at specific field of this node.
const_reference value (int field_) const
 Returns constant value at specific field of this node.
reference operator[] (int field_)
 Returns mutable value stored at specific field of this node.
const_reference operator[] (int field_) const
 Returns constant value at specific field of this node.
void offset (size_type offset_)
 Sets offset of the node.
size_type offset () const
 Returns node offset.
size_typeoffset ()
 Returns reference to node offset.
inode_writer< PreviousLinkT,
NextLinkT, ContainerT > 
operator() (int field_) const
 Returns instance of inode_writer 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.
inode_writer< PreviousLinkT,
NextLinkT, ContainerT > & 
operator<<= (int size_)
 Inserts N copies of value_type() at the end of container, and establishes new node position.
template<typename RhsT>
inode_writer< PreviousLinkT,
NextLinkT, ContainerT > & 
operator+= (RhsT rhs_)
 Positive link with another node.
template<typename RhsT>
inode_writer< PreviousLinkT,
NextLinkT, ContainerT > & 
operator-= (RhsT rhs_)
 Negative link with another node.
template<typename RhsT>
inode_writer< PreviousLinkT,
NextLinkT, ContainerT > & 
operator^= (RhsT rhs_)
 Bidirectional link between two nodes.
template<typename RhsT>
inode_writer< PreviousLinkT,
NextLinkT, ContainerT > & 
operator *= (RhsT child_)
 Negative many-to-one link from children to parent.
ContainerT & container ()
 Returns mutable reference to the underlying STL container.
ContainerT const & container () const
 Returns constant reference to the underlying STL container.

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 container for data storage.


Member Typedef Documentation

typedef inode_writer< PreviousLinkT, NextLinkT, ContainerT > const_iterator
 

Defines const_iterator type.

Definition at line 95 of file inode_writer.h.

typedef ContainerT::const_reference const_reference
 

Bidirectional iterator: const reference type of the node.

Definition at line 104 of file inode_writer.h.

typedef ContainerT container_T
 

Defines type container.

Definition at line 83 of file inode_writer.h.

typedef ContainerT::difference_type difference_type
 

Bidirectional iterator: difference type of the node.

Definition at line 110 of file inode_writer.h.

typedef inode_writer< PreviousLinkT, NextLinkT, ContainerT > inode_T
 

Defines node type.

Definition at line 89 of file inode_writer.h.

typedef inode_writer< PreviousLinkT, NextLinkT, ContainerT > iterator
 

Defines iterator type.

Definition at line 92 of file inode_writer.h.

typedef std::bidirectional_iterator_tag iterator_category
 

Bidirectional iterator: iterator category of the node.

Definition at line 113 of file inode_writer.h.

typedef ContainerT::pointer pointer
 

Bidirectional iterator: pointer type of the node.

Definition at line 98 of file inode_writer.h.

typedef ContainerT::reference reference
 

Bidirectional iterator: reference type of the node.

Definition at line 101 of file inode_writer.h.

typedef ContainerT::size_type size_type
 

Bidirectional iterator: size type of the node.

Definition at line 107 of file inode_writer.h.

typedef ContainerT::value_type value_type
 

Bidirectional iterator: value type of the node.

Definition at line 86 of file inode_writer.h.


Constructor & Destructor Documentation

inode_writer  )  [inline]
 

Bidirectional iterator: default constructor.

Definition at line 118 of file inode_writer.h.

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

Bidirectional iterator: copy constructor.

Definition at line 126 of file inode_writer.h.

inode_writer ContainerT &  container_  )  [inline]
 

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

Definition at line 134 of file inode_writer.h.

inode_writer ContainerT &  container_,
size_type  offset_
[inline]
 

Constructs new cttl::inode_writer at specified position.

Definition at line 142 of file inode_writer.h.


Member Function Documentation

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

Returns copy of cttl::inode_writer at arbitrary position.

Definition at line 233 of file inode_writer.h.

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

Bidirectional iterator: returns copy of cttl::inode_writer with zero offset.

Definition at line 227 of file inode_writer.h.

ContainerT const& container  )  const [inline]
 

Returns constant reference to the underlying STL container.

Definition at line 455 of file inode_writer.h.

ContainerT& container  )  [inline]
 

Returns mutable reference to the underlying STL container.

Definition at line 449 of file inode_writer.h.

Referenced by cttl::operator<<().

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

Bidirectional iterator: returns copy of cttl::inode_writer with offset at the end of the underlying container.

Definition at line 241 of file inode_writer.h.

int next_link  )  const [inline]
 

Returns field pointing to next sibling node.

Definition at line 322 of file inode_writer.h.

size_type& offset  )  [inline]
 

Returns reference to node offset.

Definition at line 306 of file inode_writer.h.

size_type offset  )  const [inline]
 

Returns node offset.

Definition at line 300 of file inode_writer.h.

void offset size_type  offset_  )  [inline]
 

Sets offset of the node.

Definition at line 294 of file inode_writer.h.

Referenced by inode_writer::operator *=(), cttl::operator!(), cttl::operator!=(), inode_writer::operator+=(), cttl::operator<(), cttl::operator<<(), cttl::operator<=(), cttl::operator==(), cttl::operator>(), and cttl::operator>=().

reference operator *  )  [inline]
 

Bidirectional iterator: dereference operator returns value at the current position.

Definition at line 167 of file inode_writer.h.

const_reference operator *  )  const [inline]
 

Bidirectional iterator: dereference operator returns value at the current position.

Definition at line 161 of file inode_writer.h.

inode_writer< PreviousLinkT, NextLinkT, ContainerT >& operator *= RhsT  child_  )  [inline]
 

Negative many-to-one link from children to parent.

Definition at line 437 of file inode_writer.h.

References inode_writer::offset().

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

Returns instance of inode_writer pointing to a specific relative node.

Definition at line 316 of file inode_writer.h.

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

Bidirectional iterator: postfix increment operator of cttl::inode_writer increments current offset.

Definition at line 200 of file inode_writer.h.

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

Bidirectional iterator: prefix increment operator of cttl::inode_writer increments current offset.

Definition at line 191 of file inode_writer.h.

inode_writer< PreviousLinkT, NextLinkT, ContainerT >& operator+= RhsT  rhs_  )  [inline]
 

Positive link with another node.

Definition at line 412 of file inode_writer.h.

References inode_writer::offset().

inode_writer< PreviousLinkT, NextLinkT, ContainerT >& operator+= size_type  size_  )  [inline]
 

Assign new offset.

Definition at line 257 of file inode_writer.h.

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

Bidirectional iterator: postfix decrement operator of cttl::inode_writer decrements current offset.

Definition at line 219 of file inode_writer.h.

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

Bidirectional iterator: prefix decrement operator of cttl::inode_writer decrements current offset.

Definition at line 210 of file inode_writer.h.

inode_writer< PreviousLinkT, NextLinkT, ContainerT >& operator-= RhsT  rhs_  )  [inline]
 

Negative link with another node.

Definition at line 420 of file inode_writer.h.

References inode_writer::value().

inode_writer< PreviousLinkT, NextLinkT, ContainerT >& operator-= size_type  size_  )  [inline]
 

Assign new offset.

Definition at line 263 of file inode_writer.h.

value_type* operator->  )  [inline]
 

Bidirectional iterator: pointer operator returns pointer to value at the current position of the syntax tree node.

Definition at line 183 of file inode_writer.h.

value_type const* operator->  )  const [inline]
 

Bidirectional iterator: pointer operator returns pointer to value at the current position of the syntax tree node.

Definition at line 175 of file inode_writer.h.

inode_writer< PreviousLinkT, NextLinkT, ContainerT >& operator<<= int  size_  )  [inline]
 

Inserts N copies of value_type() at the end of container, and establishes new node position.

Definition at line 338 of file inode_writer.h.

inode_writer< PreviousLinkT, NextLinkT, ContainerT >& operator= size_type  size_  )  [inline]
 

Assign new offset.

Definition at line 251 of file inode_writer.h.

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

Bidirectional iterator: assignment operator.

Definition at line 150 of file inode_writer.h.

References inode_writer::m_offset, and inode_writer::m_ptr_container.

const_reference operator[] int  field_  )  const [inline]
 

Returns constant value at specific field of this node.

Definition at line 288 of file inode_writer.h.

reference operator[] int  field_  )  [inline]
 

Returns mutable value stored at specific field of this node.

Definition at line 282 of file inode_writer.h.

inode_writer< PreviousLinkT, NextLinkT, ContainerT >& operator^= RhsT  rhs_  )  [inline]
 

Bidirectional link between two nodes.

Definition at line 428 of file inode_writer.h.

int previous_link  )  const [inline]
 

Returns field pointing to previous sibling node.

Definition at line 328 of file inode_writer.h.

const_reference value int  field_  )  const [inline]
 

Returns constant value at specific field of this node.

Definition at line 276 of file inode_writer.h.

reference value int  field_  )  [inline]
 

Returns mutable value stored at specific field of this node.

Definition at line 270 of file inode_writer.h.

Referenced by inode_writer::operator-=().


Member Data Documentation

size_type m_offset [protected]
 

Offset of the node.

Definition at line 466 of file inode_writer.h.

Referenced by inode_writer::operator=().

ContainerT* m_ptr_container [protected]
 

Pointer to STL container for data storage.

Definition at line 469 of file inode_writer.h.

Referenced by inode_writer::operator=().

const int next_link_field = NextLinkT [static]
 

Constant describing default field pointing to the next node.

Definition at line 80 of file inode_writer.h.

const int previous_link_field = PreviousLinkT [static]
 

Constant describing default field pointing to the previous node.

Definition at line 77 of file inode_writer.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