#include <cfl_symbolset.h>

Public Types

typedef TBaseSet< std::string >::Iterator Iterator
 
- Public Types inherited from faudes::TBaseSet< std::string >
enum  DetachMode
 

Public Member Functions

 SymbolSet (void)
 
 SymbolSet (const TBaseSet< std::string > &rOtherSet)
 
 SymbolSet (const std::string &rFilename, const std::string &rLabel="SymbolSet")
 
virtual ~SymbolSet (void)
 
bool Valid (const std::string &symbol) const
 
bool Insert (const std::string &symbol)
 
Idx Signature (void) const
 
std::string Str (const std::string &symbol) const
 
- Public Member Functions inherited from faudes::TBaseSet< std::string >
 TBaseSet (void)
 
 TBaseSet (const TBaseSet &rOtherSet)
 
 TBaseSet (const std::string &rFilename, const std::string &rLabel="BaseSet")
 
virtual ~TBaseSet (void)
 
const std::string & Name (void) const
 
void Name (const std::string &rName)
 
virtual void Clear (void)
 
Idx Size (void) const
 
bool Empty (void) const
 
virtual std::string Str (const std::string &rElem) const
 
Iterator Begin (void) const
 
Iterator End (void) const
 
virtual bool Valid (const std::string &rElem) const
 
virtual bool Erase (const std::string &rElem)
 
virtual Iterator Erase (const Iterator &pos)
 
virtual void EraseSet (const TBaseSet &rOtherSet)
 
virtual void RestrictSet (const TBaseSet &rOtherSet)
 
virtual bool Disjoint (const TBaseSet &rOtherSet) const
 
virtual bool Insert (const std::string &rElem)
 
virtual Iterator Inject (const Iterator &pos, const std::string &rElem)
 
virtual void Inject (const std::string &rElem)
 
virtual void InsertSet (const TBaseSet &rOtherSet)
 
bool Exists (const std::string &rElem) const
 
Iterator Find (const std::string &rElem) const
 
TBaseSet operator+ (const TBaseSet &rOtherSet) const
 
TBaseSet operator- (const TBaseSet &rOtherSet) const
 
TBaseSet operator* (const TBaseSet &rOtherSet) const
 
bool operator<= (const TBaseSet &rOtherSet) const
 
bool operator>= (const TBaseSet &rOtherSet) const
 
bool operator< (const TBaseSet &rOtherSet) const
 
void DValid (const std::string &rMessage="") const
 
void Detach (DetachMode flag=AttrIncl) const
 
void Lock (void) const
 
virtual const AttributeVoidAttributeType (void) const
 
virtual bool AttributeTest (const Type &rAttr) const
 
virtual TBaseSetAssignWithoutAttributes (const TBaseSet &rSourceSet)
 
virtual void Attributes (const TBaseSet &rOtherSet)
 
Idx AttributesSize (void) const
 
void ClearAttributes (void)
 
bool EqualAttributes (const TBaseSet &rOtherSet) const
 
virtual AttributeVoidAttributep (const std::string &rElem)
 
virtual const AttributeVoidAttribute (const std::string &rElem) const
 
virtual void Attribute (const std::string &rElem, const Type &rAttr)
 
virtual void AttributeTry (const std::string &rElem, const Type &rAttr)
 
virtual void ClrAttribute (const std::string &rElem)
 
virtual void XElementTag (const std::string &rTag)
 
virtual const std::string & TypeName (void) const
 
virtual void TypeName (const std::string &rType)
 
Typeoperator= (const Type &rSrc)
 
bool operator== (const Type &rOther) const
 
bool operator!= (const Type &rOther) const
 
- Public Member Functions inherited from faudes::Type
 Type (void)
 
 Type (const Type &rType)
 
virtual ~Type (void)
 
virtual TypeNew (void) const
 
virtual TypeCopy (void) const
 
virtual const TypeCast (const Type *pOther) const
 
virtual TypeAssign (const Type &rSrc)
 
Typeoperator= (const Type &rSrc)
 
virtual bool Equal (const Type &rOther) const
 
bool operator== (const Type &rOther) const
 
bool operator!= (const Type &rOther) const
 
void Write (const Type *pContext=0) const
 
void Write (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0, std::ios::openmode openmode=std::ios::out|std::ios::trunc) const
 
void Write (const std::string &pFileName, std::ios::openmode openmode) const
 
void Write (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
virtual void XWrite (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0) const
 
void XWrite (const Type *pContext=0) const
 
void XWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
std::string ToString (const std::string &rLabel="", const Type *pContext=0) const
 
std::string ToText (const std::string &rLabel="", const Type *pContext=0) const
 
void DWrite (const Type *pContext=0) const
 
void DWrite (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0, std::ios::openmode openmode=std::ios::out|std::ios::trunc) const
 
void DWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
void SWrite (TokenWriter &rTw) const
 
void SWrite (void) const
 
std::string ToSText (void) const
 
void Read (const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0)
 
void FromString (const std::string &rString, const std::string &rLabel="", const Type *pContext=0)
 
void Read (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
 

Protected Member Functions

void DoAssign (const SymbolSet &rSource)
 
void DoWrite (TokenWriter &tw, const std::string &rLabel="", const Type *pContext=0) const
 
void DoRead (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
 
- Protected Member Functions inherited from faudes::TBaseSet< std::string >
virtual const std::string & XElementTag (void) const
 
virtual void DoDWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
virtual void DoSWrite (TokenWriter &rTw) const
 
void DoAssign (const TBaseSet &rSourceSet)
 
bool DoEqual (const TBaseSet &rOtherSet) const
 
void DoAttribute (const std::string &rElem, const Type *pAttr)
 
const AttributeVoidDoAttribute (const std::string &rElem) const
 
AttributeVoidDoAttributeExplicit (const std::string &rElem)
 
TBaseSet< std::string, std::less< std::string > >::Iterator ThisIterator (const typename std::set< std::string, std::less< std::string > >::const_iterator &sit) const
 
void RelinkClients (void)
 
void AttachClient (TBaseSet *pRef) const
 
void DetachClient (TBaseSet *pRef) const
 
void AttachIterator (Iterator *pFit) const
 
void DetachIterator (Iterator *pFit) const
 
virtual const TypeDefinitionTypeDefinitionp (void) const
 
- Protected Member Functions inherited from faudes::Type
void DoAssign (const Type &rSrc)
 
bool DoEqual (const Type &rOther) const
 
virtual void DoXWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
virtual Token XBeginTag (const std::string &rLabel="", const std::string &rFallbackLabel="") const
 

Additional Inherited Members

- Protected Types inherited from faudes::TBaseSet< std::string >
typedef std::set< std::string, std::less< std::string > >::iterator iterator
 
typedef std::set< std::string, std::less< std::string > >::const_iterator const_iterator
 
typedef std::map< std::string, AttributeVoid * >::iterator aiterator
 
typedef std::map< std::string, AttributeVoid * >::const_iterator const_aiterator
 
- Protected Attributes inherited from faudes::TBaseSet< std::string >
std::string mMyName
 
std::set< std::string, std::less< std::string > > * pSet
 
std::set< std::string, std::less< std::string > > * mpSet
 
std::map< std::string, AttributeVoid * > * pAttributes
 
std::map< std::string, AttributeVoid * > * mpAttributes
 
TBaseSet< std::string, std::less< std::string > > * pHostSet
 
std::list< TBaseSet< std::string, std::less< std::string > > * >::iterator mClientRecord
 
std::list< TBaseSet< std::string, std::less< std::string > > * > * mpClients
 
bool mDetached
 
bool mLocked
 
std::set< Iterator * > mIterators
 
std::string mXElementTagDef
 
- Static Protected Attributes inherited from faudes::TBaseSet< std::string >
static std::set< std::string, std::less< std::string > > msEmptySet
 
static std::map< std::string, AttributeVoid * > msEmptyAttributes
 

Detailed Description

Set of symbols.

The class is built on top of the faudes version TBaseSet of STL sets. It provides the essentials of the STL interface and plus token based file IO. Invalid iterators throw an exception (id 62) when used as an argument to a SymbolSet function. If the macro FAUDES_CHECKED is defined, the attempt to insert an invalid symbol an exception (id 61).

Note that a symbol set holds a plain set of valid faudes symbols with no indices or symboltable associated. If you are looking for a set of items with mandatory symbolic names you most likely are better of with a NameSet or a TaNameSet. Currently, there is no attributed version of a SymbolSet.

The token IO format is demonstrated by the following example of a set with name "MySymbols"

<MySymbols>
"ASymbol"
"AnotherSymbol"
</MySymbols>

Note that you can read SymbolSet files to NameSets and vice versa.

Definition at line 70 of file cfl_symbolset.h.

Member Typedef Documentation

◆ Iterator

Iterators on indexset.

Definition at line 122 of file cfl_symbolset.h.

Constructor & Destructor Documentation

◆ SymbolSet() [1/3]

faudes::SymbolSet::SymbolSet ( void  )

Constructor.

Definition at line 32 of file cfl_symbolset.cpp.

◆ SymbolSet() [2/3]

faudes::SymbolSet::SymbolSet ( const TBaseSet< std::string > &  rOtherSet)

Copy-constructor.

Definition at line 40 of file cfl_symbolset.cpp.

◆ SymbolSet() [3/3]

faudes::SymbolSet::SymbolSet ( const std::string &  rFilename,
const std::string &  rLabel = "SymbolSet" 
)

Construct from file. Uses the Read(TokenReader&, const std::string&) function to read. a SymbolSet from section rLabel in file rFilename.

Parameters
rFilenameName of file to read
rLabelSection to read
Exceptions
Exception
  • IO Errors (id 1)
  • token musmatch (id 50, 51, 52)

Definition at line 47 of file cfl_symbolset.cpp.

◆ ~SymbolSet()

virtual faudes::SymbolSet::~SymbolSet ( void  )
inlinevirtual

Virtual destructor

Definition at line 108 of file cfl_symbolset.h.

Member Function Documentation

◆ DoAssign()

void faudes::SymbolSet::DoAssign ( const SymbolSet rSource)
protected

Assign my members. This method calls the base class to assign its members.

Parameters
rSourceSource to copy from

Definition at line 55 of file cfl_symbolset.cpp.

◆ DoRead()

void faudes::SymbolSet::DoRead ( TokenReader rTr,
const std::string &  rLabel = "",
const Type pContext = 0 
)
protectedvirtual

Read from TokenReader, see TBaseSet for public wrappers.

Parameters
rTrReference to tokenreader
rLabelSection to read
pContextRead context for contextual information
Exceptions
Exception
  • IO errors (id 1)
  • token mismatch (id 50, 51, 52)

Reimplemented from faudes::TBaseSet< std::string >.

Definition at line 76 of file cfl_symbolset.cpp.

◆ DoWrite()

void faudes::SymbolSet::DoWrite ( TokenWriter tw,
const std::string &  rLabel = "",
const Type pContext = 0 
) const
protectedvirtual

Write to TokenWriter, see TBaseSet for public wrappers.

Parameters
twReference to TokenWriter
rLabelLabel of section to write, defaults to name of set
pContextWrite context for contextual information
Exceptions
Exception
  • IO errors (id 2)

Reimplemented from faudes::TBaseSet< std::string >.

Definition at line 61 of file cfl_symbolset.cpp.

◆ Insert()

bool faudes::SymbolSet::Insert ( const std::string &  symbol)

Insert specified symbol

Parameters
symbolSymbol to insert
Returns
True if symbol was new to set

Definition at line 101 of file cfl_symbolset.cpp.

◆ Signature()

Idx faudes::SymbolSet::Signature ( void  ) const
inline

Compute an Idx type signature for a Set. This method is currently not implemented.

Returns
Idx type set signature

Definition at line 141 of file cfl_symbolset.h.

◆ Str()

std::string faudes::SymbolSet::Str ( const std::string &  symbol) const
inline

Return pretty printable symbol.

Parameters
symbolSymbol to print
Returns
String

Definition at line 152 of file cfl_symbolset.h.

◆ Valid()

bool faudes::SymbolSet::Valid ( const std::string &  symbol) const

Test whether the given string is a valid faudes symbol

Parameters
symbolSymbol to test
Returns
True if valid

Definition at line 107 of file cfl_symbolset.cpp.


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

libFAUDES 2.33c --- 2025.05.15 --- c++ api documentaion by doxygen