Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

StateSet Class Reference

Holds a set of states for the pattern match algorithm. More...

#include <pattern.hpp>

Inheritance diagram for StateSet:

usv List of all members.

Public Methods

bool Put (unsigned short new_state)
 Put a state into the set if it isn't already there
Returns:
true if new_state is 0.
More...


void clear ()
 override the standard one because it gives back the current vector. More...


Detailed Description

Holds a set of states for the pattern match algorithm.

Definition at line 14 of file pattern.hpp.


Member Function Documentation

bool StateSet::Put ( unsigned short new_state ) [inline]
 

Put a state into the set if it isn't already there

Returns:
true if new_state is 0.

Parameters:
new_state   new state to put in set

Definition at line 21 of file pattern.hpp.

Referenced by Pattern::operator()().

00022       {
00023         //! we only put in 'non-zero' states
00024         if (new_state)
00025           {
00026             //! if find doesn't, it returns end()
00027             if (usv::end() == std::find(usv::begin(), usv::end(), new_state))
00028               usv::push_back(new_state);
00029           }
00030 
00031         //! let caller know if we tried to put a 'zero' in
00032         return !new_state;
00033       }

void StateSet::clear ( ) [inline]
 

override the standard one because it gives back the current vector.

Definition at line 36 of file pattern.hpp.

Referenced by Pattern::operator()().

00037       {
00038         erase(begin(), end());
00039       }


The documentation for this class was generated from the following file:
Generated at Wed Dec 6 21:25:05 2000 for NewGrep by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000