Public Types | Public Member Functions | Static Public Member Functions

opennwa::details::SymbolStorage Class Reference

List of all members.

Public Types

typedef Symbol Sym
typedef std::set< Sym >
::const_iterator 
const_iterator

Public Member Functions

 SymbolStorage ()
 SymbolStorage (const SymbolStorage &other)
SymbolStorageoperator= (const SymbolStorage &other)
const std::set< Sym > & getSymbols () const
 provides access to all symbols
bool isSymbol (Sym sym) const
 tests whether the given symbol is a valid symbol
bool addSymbol (Sym sym)
 add the given symbol
void addAllSymbols (SymbolStorage symSet)
 add all the symbols in the given collection to this collection
bool removeSymbol (Sym sym)
 remove the given symbol
void removeAll (SymbolStorage symSet)
 remove all the symbols in the given collection from this collection
void clearSymbols ()
 removes all symbols
std::ostream & print (std::ostream &o) const
 print the collection of symbols
bool operator== (const SymbolStorage &other) const
 tests whether this collection of symbols is equivalent to the collection of symbols 'other'
const_iterator beginSymbols () const
 provides access to the symbols in the collection
const_iterator endSymbols () const
 provides access to the symbols in the collection
size_t sizeSymbols () const
 returns the number of symbols in this collection

Static Public Member Functions

static std::string const & XMLSymbolTag ()
static std::string const & XMLNameAttr ()

Member Typedef Documentation


Constructor & Destructor Documentation

opennwa::details::SymbolStorage::SymbolStorage (  ) 

References addSymbol(), and opennwa::EPSILON.

opennwa::details::SymbolStorage::SymbolStorage ( const SymbolStorage other  ) 

Member Function Documentation

static std::string const& opennwa::details::SymbolStorage::XMLSymbolTag (  )  [static]

Referenced by opennwa::Nwa::marshall().

static std::string const& opennwa::details::SymbolStorage::XMLNameAttr (  )  [static]

Referenced by opennwa::Nwa::marshall().

SymbolStorage & opennwa::details::SymbolStorage::operator= ( const SymbolStorage other  ) 
const std::set< SymbolStorage::Sym > & opennwa::details::SymbolStorage::getSymbols (  )  const

provides access to all symbols

This method provides access to all symbols in the form of a set of symbols.

Returns:
a set containing all symbols
a set containing all symbols

Referenced by opennwa::Nwa::getSymbols().

bool opennwa::details::SymbolStorage::isSymbol ( Sym  sym  )  const

tests whether the given symbol is a valid symbol

This method determines whether the given symbol is a valid symbol in the symbol pool. If it is, true is returned, otherwise, false is returned.

Parameters:
- sym: the symbol to test
Returns:
true if the given symbol is a valid symbol
Parameters:
- sym: the symbol to test
Returns:
true if the given symbol is a valid symbol

Referenced by opennwa::Nwa::isSymbol().

bool opennwa::details::SymbolStorage::addSymbol ( Sym  sym  ) 

add the given symbol

This method adds the given symbol. If the symbol already exists, false is returned. Otherwise, true is returned.

Parameters:
- sym: the symbol to add
Returns:
false if the symbol already exists, true otherwise
Parameters:
- sym: the symbol to add
Returns:
false if the symbol already exists, true otherwise

References opennwa::EPSILON, and opennwa::WILD.

Referenced by opennwa::Nwa::addSymbol(), clearSymbols(), and SymbolStorage().

void opennwa::details::SymbolStorage::addAllSymbols ( SymbolStorage  symSet  ) 

add all the symbols in the given collection to this collection

This method adds all of the symbols in the given collection of symbols to this collection of symbols.

Parameters:
- symSet: the collection of symbols to add to this collection of symbols
- symSet: the collection of symbols to add to this collection of symbols

Referenced by opennwa::Nwa::addAllSymbols().

bool opennwa::details::SymbolStorage::removeSymbol ( Sym  sym  ) 

remove the given symbol

This method removes the given symbol. If the symbol does not exist, false is returned. Otherwise, true is returned.

Parameters:
- sym: the symbol to remove
Returns:
false if the symbol does not exist, true otherwise
Parameters:
- sym: the symbol to remove
Returns:
false if the symbol does not exist, true otherwise

Referenced by opennwa::Nwa::removeSymbol().

void opennwa::details::SymbolStorage::removeAll ( SymbolStorage  symSet  ) 

remove all the symbols in the given collection from this collection

This method removes all of the symbols in the given collection of symbols from this collection of symbols.

Parameters:
- symSet: the collection of symbols to remove from this collection
- symSet: the collection of symbols to remove from this collection
void opennwa::details::SymbolStorage::clearSymbols (  ) 

removes all symbols

This method removes all symbols from this collection.

References addSymbol(), and opennwa::EPSILON.

Referenced by opennwa::Nwa::clearSymbols().

std::ostream & opennwa::details::SymbolStorage::print ( std::ostream &  o  )  const [virtual]

print the collection of symbols

This method prints out the symbol set to the output stream provided.

Parameters:
- o: the output stream to print to
Returns:
the output stream that was printed to
Parameters:
- o: the output stream to print to
Returns:
the output stream that was printed to

Implements wali::Printable.

References opennwa::EPSILON, and wali::printKey().

Referenced by opennwa::Nwa::print().

bool opennwa::details::SymbolStorage::operator== ( const SymbolStorage other  )  const

tests whether this collection of symbols is equivalent to the collection of symbols 'other'

This method tests the equivalence of this set of symbols and the set of symbols 'other'.

Parameters:
- other: the SymbolStorage to which to compare this SymbolStorage
Returns:
true if this SymbolStorage is equivalent to the SymbolStorage 'other'
Parameters:
- other: the SymbolStorage to which to compare this SymbolStorage
Returns:
true if this SymbolStorage is equivalent to the SymbolStorage 'other'
SymbolStorage::const_iterator opennwa::details::SymbolStorage::beginSymbols (  )  const

provides access to the symbols in the collection

This method provides access to the symbols in this collection through an iterator.

Returns:
the starting point of an iterator through the symbols
the starting point of an iterator through the symbols

Referenced by opennwa::Nwa::_private_isDeterministic_(), opennwa::details::Label::addAll(), opennwa::Nwa::beginSymbols(), opennwa::details::Label::getAnySymbol(), opennwa::details::Label::getSymbolsIn(), opennwa::details::Label::getSymbolsNotIn(), opennwa::details::Label::isAbsent(), opennwa::details::Label::isWild(), and opennwa::details::Label::removeAll().

SymbolStorage::const_iterator opennwa::details::SymbolStorage::endSymbols (  )  const

provides access to the symbols in the collection

This method provides access to the symbols in the collection through an iterator.

Returns:
one place past the exit point of an iterator through the symbols
one place past the exit point of an iterator through the symbols

Referenced by opennwa::Nwa::_private_isDeterministic_(), opennwa::details::Label::addAll(), opennwa::Nwa::endSymbols(), opennwa::details::Label::getAnySymbol(), opennwa::details::Label::getSymbolsIn(), opennwa::details::Label::getSymbolsNotIn(), opennwa::details::Label::isAbsent(), opennwa::details::Label::isWild(), and opennwa::details::Label::removeAll().

size_t opennwa::details::SymbolStorage::sizeSymbols (  )  const

returns the number of symbols in this collection

This method returns the number of symbols in this collection.

Returns:
the number of symbols in this collection
the number of symbols in this collection

Referenced by opennwa::Nwa::sizeSymbols(), opennwa::details::Label::sizeSymbolsIn(), and opennwa::details::Label::sizeSymbolsNotIn().


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