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>
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 | |
node * | scan_ |
where in the sequence map are we currently sitting | |
seq_map * | tree_ |
which Sequence_Map are we talking about |
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.
typedef Sequence_Map<T,ID,H> seq_map |
Definition at line 391 of file sequence_map.h.
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.
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.
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.
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.
ID id_ [private] |
what sequence are we creating
Definition at line 396 of file sequence_map.h.
where in the sequence map are we currently sitting
Definition at line 397 of file sequence_map.h.
which Sequence_Map are we talking about
Definition at line 395 of file sequence_map.h.