cttl_impl::xtl_edge_offset_guard< EdgeT > Class Template Reference

Models behavior of a repository for logical positions of nodes representing substring boundaries. More...

#include <xtl_edge_trait.h>

List of all members.

Public Member Functions

void restore (EdgeT &edge_)
 Restores preserved posiotions.
void save (EdgeT &edge_)
 Updates stored substring positons.
void swap (EdgeT &edge_)
 Swaps preserved positions with boundaries of another substring.
 xtl_edge_offset_guard (EdgeT &edge_)
 Constructs new objects and initializes storage guards corresponding to the encapsulated offset boundaries.

Public Attributes

EdgeT::offset_guard_T first
 Stores logical position of the upper substring boundary, cttl::const_edge::first.
EdgeT::offset_guard_T second
 Stores logical position of the lower substring boundary, cttl::const_edge::second.


Detailed Description

template<typename EdgeT>
class cttl_impl::xtl_edge_offset_guard< EdgeT >

Models behavior of a repository for logical positions of nodes representing substring boundaries.

Template Parameters:
EdgeT specifies CTTL substring type, either cttl::const_edge, or cttl::edge template class.

Definition at line 172 of file xtl_edge_trait.h.


Constructor & Destructor Documentation

template<typename EdgeT>
cttl_impl::xtl_edge_offset_guard< EdgeT >::xtl_edge_offset_guard ( EdgeT &  edge_  ) 

Constructs new objects and initializes storage guards corresponding to the encapsulated offset boundaries.

Parameters:
edge_ Reference to CTTL substring, either cttl::const_edge or cttl::edge.

Definition at line 195 of file xtl_edge_trait.h.

00196             :
00197         first( edge_.first ),
00198             second( edge_.second )
00199         {
00200         }


Member Function Documentation

template<typename EdgeT>
void cttl_impl::xtl_edge_offset_guard< EdgeT >::restore ( EdgeT &  edge_  ) 

Restores preserved posiotions.

Parameters:
edge_ Reference to mutable CTTL substring, either cttl::const_edge or cttl::edge.

Definition at line 243 of file xtl_edge_trait.h.

00244         {
00245             edge_.first.offset( first );
00246             edge_.second.offset( second );
00247         }

template<typename EdgeT>
void cttl_impl::xtl_edge_offset_guard< EdgeT >::save ( EdgeT &  edge_  ) 

Updates stored substring positons.

Parameters:
edge_ Reference to CTTL substring, either cttl::const_edge or cttl::edge.

Definition at line 210 of file xtl_edge_trait.h.

00211         {
00212             first = edge_.first.offset();
00213             second = edge_.second.offset();
00214         }

template<typename EdgeT>
void cttl_impl::xtl_edge_offset_guard< EdgeT >::swap ( EdgeT &  edge_  ) 

Swaps preserved positions with boundaries of another substring.

Parameters:
edge_ Reference to CTTL substring, either cttl::const_edge or cttl::edge.

Definition at line 224 of file xtl_edge_trait.h.

00225         {
00226             size_t temp = first;
00227             first = edge_.first.offset();
00228             edge_.first.offset( temp );
00229 
00230             temp = second;
00231             second = edge_.second.offset();
00232             edge_.second.offset( temp );
00233         }


Member Data Documentation

template<typename EdgeT>
EdgeT::offset_guard_T cttl_impl::xtl_edge_offset_guard< EdgeT >::first

Stores logical position of the upper substring boundary, cttl::const_edge::first.

Definition at line 178 of file xtl_edge_trait.h.

template<typename EdgeT>
EdgeT::offset_guard_T cttl_impl::xtl_edge_offset_guard< EdgeT >::second

Stores logical position of the lower substring boundary, cttl::const_edge::second.

Definition at line 184 of file xtl_edge_trait.h.


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

Generated on Sun Aug 23 13:43:45 2009 for Common Text Transformation Library by  doxygen 1.5.9