sequence Class Reference

A sequence is a handle object that lets you create patterns in the tree You construct a sequence object given a Sequence_Map object. You then add members to the sequence. When you are done, you call the complete() function to see if this is a valid (complete) sequence or if you have mistakenly create a subsequence of an existing sequence. More...

#include <sequence_map.h>

Collaboration diagram for sequence:
Collaboration graph
[legend]

List of all members.

Public Types

typedef Sequence_Map< T, ID, H > seq_map

Public Member Functions

bool can_complete () const
bool complete () const
void operator+= (T const &new_item)
 sequence (seq_map &tree, ID const &v)
 ~sequence ()

Private Attributes

ID id_
 what sequence are we creating
nodescan_
 where in the sequence map are we currently sitting
seq_maptree_
 which Sequence_Map are we talking about

Detailed Description

template<class T, class ID, class H = Hasher<T>>
class cxxtls::Sequence_Map< T, ID, H >::sequence

A sequence is a handle object that lets you create patterns in the tree You construct a sequence object given a Sequence_Map object. You then add members to the sequence. When you are done, you call the complete() function to see if this is a valid (complete) sequence or if you have mistakenly create a subsequence of an existing sequence.

Definition at line 381 of file sequence_map.h.


Member Typedef Documentation

typedef Sequence_Map<T,ID,H> seq_map

Definition at line 391 of file sequence_map.h.


Constructor & Destructor Documentation

sequence ( seq_map tree,
ID const &  v 
)

Create a handle to a sequence in a specified tree

Definition at line 402 of file sequence_map.h.

~sequence (  ) 

Destroy the sequence handle, but not the sequence

Definition at line 412 of file sequence_map.h.


Member Function Documentation

bool can_complete (  )  const

Check to see if this sequence is complete at its current size. To complete a sequence you must call 'complete()' and the sequence must be unique.

Definition at line 485 of file sequence_map.h.

Here is the call graph for this function:

bool complete (  )  const

Assert that the sequence actually is complete -- ie that you have not specified a new sequence which is a subset of a smaller bigger sequence. This function should only be called when feel yourself to be complete with a sequence because it both performs the test AND marks the sequence as complete. Once a sequence is marked as complete, you can't add a new longer sequence with the same initial elements as an existing complete sequence -- nor can you create a new shorter sequence. The return code indicates that you have successfully created the sequence. A return value of false means that the sequence is empty or that it is a subsequence of a bigger sequence.

Definition at line 417 of file sequence_map.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void operator+= ( T const &  new_item  ) 

Extend the sequence with a new item. Warning: this is not meant to be a particularly robust interface. If you attempt to extend an existing complete sequence, you'll get a fatal error. The goal here is to provide a workable interface. If you want to make sure that you don't accidentally crash the program, -- say when users supply the sequence -- you should call is_complete() to see if you if the current sequence is already complete before adding an item to it -- and getting a crash.

Definition at line 439 of file sequence_map.h.

Here is the call graph for this function:


Member Data Documentation

ID id_ [private]

what sequence are we creating

Definition at line 396 of file sequence_map.h.

node* scan_ [private]

where in the sequence map are we currently sitting

Definition at line 397 of file sequence_map.h.

seq_map* tree_ [private]

which Sequence_Map are we talking about

Definition at line 395 of file sequence_map.h.


The documentation for this class was generated from the following file:
Generated on Wed Feb 29 22:56:32 2012 for CXXUtilities by  doxygen 1.6.3