faudes::TaNameSet< Attr > Class Template Reference

Set of indices with symbolic names and attributes. More...

#include <cfl_nameset.h>

Public Member Functions

 TaNameSet (void)
 Constructor for NameSet referring to the static SymbolTable.
 TaNameSet (const TaNameSet &rOtherSet)
 Copy-constructor from other TaNameSet (incl attributes and symboltable)
 TaNameSet (const NameSet &rOtherSet)
 Constructor from NameSet (sets default attributes, same symboltable)
 TaNameSet (const std::string &rFilename, const std::string &rLabel="")
 Constructor from file.
virtual ~TaNameSet (void)
 Virtual destructor.
TaNameSet NewN () const
 Return a NameSet with same symboltable as this set.
virtual TaNameSetAssign (const NameSet &rSrc)
 Relaxed assignment method (uses base class to maintain attributes)
virtual TaNameSetoperator= (const NameSet &rSrc)
 Relaxed assignment operator (uses base class to maintain attributes)
bool Insert (const Idx &rIndex)
 Add an element by index.
bool Insert (const Idx &rIndex, const Attr &rAttr)
 Add an element by index incl.
Idx Insert (const std::string &rName)
 Add an element by its symbolic name.
Idx Insert (const std::string &rName, const Attr &rAttr)
 Add an element by its symbolic name.
void InsertSet (const NameSet &rOtherSet)
 Inserts elements of rOtherSet.
void InsertSet (const TaNameSet &rOtherSet)
 Inserts elements of rOtherSet incl attributes Attributes of this set are maintained, new elements are inserted with attribute.
virtual bool Erase (const Idx &rIndex)
 Delete element by index.
virtual bool Erase (const std::string &rName)
 Delete element by symbolic name.
virtual NameSet::Iterator Erase (const Iterator &pos)
 Delete element by iterator.
void EraseSet (const NameSet &rOtherSet)
 Erase elements indicated by rOtherSet.
void EraseSet (const TaNameSet &rOtherSet)
 Erase elements indicated by rOtherSet.
void RestrictSet (const NameSet &rOtherSet)
 Restrict elements indicated by rOtherSet.
void RestrictSet (const TaNameSet &rOtherSet)
 Restrict elements indicated by rOtherSet.
virtual void Attributes (const NameSet &rOtherSet)
 Set attributes.
virtual void Attributes (const TaNameSet &rOtherSet)
 Set attributes.
std::string Str (const Idx &rIndex) const
 Return pretty printable symbolic name for index.
- Public Member Functions inherited from faudes::NameSet
 NameSet (void)
 Constructor for NameSet referring to the static SymbolTable.
 NameSet (const NameSet &rOtherSet)
 Copy-constructor from other NameSet.
 NameSet (const std::string &rFilename, const std::string &rLabel="")
 Constructor from file.
virtual ~NameSet (void)
 Virtual destructor.
SymbolTableSymbolTablep (void) const
 Get Pointer mpSymbolTable.
void SymbolTablep (SymbolTable *pSymTab)
 Set SymbolTable reference.
virtual NameSet::Iterator Erase (const Iterator &pos)
 Delete element by iterator.
void SymbolicName (Idx index, const std::string &rName)
 Set new name for existing index.
void SymbolicName (const std::string &rName, const std::string &rNewName)
 Set new name for existing name FAUDES_CHECKED checks if the specified name exists in NameSet.
std::string SymbolicName (Idx index) const
 Name lookup.
Idx Index (const std::string &rName) const
 Index lookup.
bool Exists (const Idx &rIndex) const
 Test existence of index.
bool Exists (const std::string &rName) const
 Test existence of name.
NameSet::Iterator Find (const Idx &rIndex) const
 Find iterator for index.
NameSet::Iterator Find (const std::string &rName) const
 Find iterator for name.
NameSet operator+ (const NameSet &rOtherSet) const
 Set union operator.
NameSet operator- (const NameSet &rOtherSet) const
 Set difference operator.
NameSet operator* (const NameSet &rOtherSet) const
 Set intersection operator.
bool operator<= (const NameSet &rOtherSet) const
 Test for subset.
bool operator>= (const NameSet &rOtherSet) const
 Test for superset.
- Public Member Functions inherited from faudes::TBaseSet< Idx >
 TBaseSet (void)
 Constructor.
 TBaseSet (const TBaseSet &rOtherSet)
 Copy-constructor.
 TBaseSet (const std::string &rFilename, const std::string &rLabel="BaseSet")
 Constructor from file.
virtual ~TBaseSet (void)
 Virtual destructor.
const std::string & Name (void) const
 Return name of TBaseSet.
void Name (const std::string &rName)
 Set name of TBaseSet.
virtual void Clear (void)
 Clear all set.
Idx Size (void) const
 Get Size of TBaseSet.
bool Empty (void) const
 Test whether if the TBaseSet is Empty.
Iterator Begin (void) const
 Iterator to the begin of set.
Iterator End (void) const
 Iterator to the end of set.
virtual bool Valid (const Idx &rElem) const
 Test validty of candidate element.
virtual void EraseSet (const TBaseSet &rOtherSet)
 Erase elements given by other set.
virtual void RestrictSet (const TBaseSet &rOtherSet)
 Restrict elements given by other set.
virtual Iterator Inject (const Iterator &pos, const Idx &rElem)
 Insert specified element.
virtual void Inject (const Idx &rElem)
 Insert specified element.
virtual void InsertSet (const TBaseSet &rOtherSet)
 Insert elements given by rOtherSet.
virtual void SetUnion (const TBaseSet &rOtherSet)
 Set Union, result is accumulated in this set.
virtual void SetIntersection (const TBaseSet &rOtherSet)
 Set Intersection, result is stored in this set.
TBaseSet operator+ (const TBaseSet &rOtherSet) const
 Set union operator.
TBaseSet operator- (const TBaseSet &rOtherSet) const
 Set difference operator.
TBaseSet operator* (const TBaseSet &rOtherSet) const
 Set intersection operator.
bool operator<= (const TBaseSet &rOtherSet) const
 Test for subset.
bool operator>= (const TBaseSet &rOtherSet) const
 Test for superset.
bool operator< (const TBaseSet &rOtherSet) const
 Order for sorting containers of TBaseSet.
void DValid (const std::string &rMessage="") const
 Some validation of deferred copy mechanism (provoke abort)
virtual void Detach (void) const
 Detach from extern storage (incl allocation and true copy)
virtual void Lock (void) const
 Detach and lock any further reallocation.
virtual const AttributeVoidAttributep (void) const
 Attribute typeinfo.
virtual AttributeVoidAttributep (const Idx &rElem)
 Attribute access.
virtual const AttributeVoidAttribute (void) const
 Attribute typeinfo.
virtual const AttributeVoidAttribute (const Idx &rElem) const
 Attribute access.
virtual void Attribute (const Idx &rElem, const Type &rAttr)
 Attribute access.
virtual bool AttributeTry (const Type &rAttr) const
 Attribute typeinfo.
virtual void AttributeTry (const Idx &rElem, const Type &rAttr)
 Attribute access.
virtual TBaseSetAssignWithoutAttributes (const TBaseSet &rSourceSet)
 Attribute access.
virtual void Attributes (const TBaseSet &rOtherSet)
 Attributes access.
virtual Idx AttributesSize (void) const
 Attribute access.
virtual void ClearAttributes (void)
 Attribute access.
virtual bool EqualAttributes (const TBaseSet &rOtherSet) const
 Attribute access.
virtual void ClrAttribute (const Idx &rElem)
 Attribute access.
virtual void XElementTag (const std::string &rTag)
 Configure the element name tag.
virtual const std::string & TypeName (void) const
 Get objects's type name.
virtual void TypeName (const std::string &rType)
 Overwrite faudes-type name.
- Public Member Functions inherited from faudes::Type
 Type (void)
 Constructor.
 Type (const Type &rType)
 Copy constructor.
virtual ~Type (void)
 Destructor.
virtual TypeAssign (const Type &rSrc)
 Assign configuration data from other object.
virtual Typeoperator= (const Type &rSrc)
 Assign configurationdata from other object.
virtual bool Equal (const Type &rOther) const
 Test equality of configuration data.
virtual bool operator== (const Type &rOther) const
 Test equality of configuration data.
virtual bool operator!= (const Type &rOther) const
 Test equality of configuration data.
void Write (const Type *pContext=0) const
 Write configuration data to console.
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
 Write configuration data to a file.
void Write (const std::string &pFileName, std::ios::openmode openmode) const
 Write configuration data to a file.
void Write (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data to TokenWriter.
virtual void XWrite (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data to an XML file.
void XWrite (const Type *pContext=0) const
 Write configuration data in XML format to concole Note: this write function uses the virtual function DoXWrite(), to be reimplemented by derived classes.
void XWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data in XML format to TokenWriter.
std::string ToString (const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data to a string.
std::string ToText (const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data to a formated string.
void DWrite (const Type *pContext=0) const
 Write configuration data to console, debugging format.
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
 Write configuration data to a file, debugging format.
void DWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data in debug format to TokenWriter.
void SWrite (TokenWriter &rTw) const
 Write statistics comment to TokenWriter.
void SWrite (void) const
 Write statistics comment to console.
std::string ToSText (void) const
 Write statistics to a string.
void Read (const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0)
 Read configuration data from file with label specified.
void FromString (const std::string &rString, const std::string &rLabel="", const Type *pContext=0)
 Read configuration data from a string.
void Read (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
 Read configuration data from TokenReader with label sepcified.
- Public Member Functions inherited from faudes::TaBaseSet< Idx, Attr >
 TaBaseSet (void)
 Constructor.
 TaBaseSet (const TaBaseSet &rOtherSet)
 Copy-constructor.
 TaBaseSet (const TBaseSet< Idx, std::less< Idx > > &rOtherSet)
 Copy-constructor.
 TaBaseSet (const std::string &rFilename, const std::string &rLabel="BaseSet")
 Constructor from file.
virtual ~TaBaseSet (void)
 Virtual destructor.
virtual TaBaseSetNew (void) const
 Faudes Type interface.
virtual TaBaseSetCopy (void) const
 Faudes Type interface.
virtual const TypeCast (const Type *pType) const
 Faudes Type interface.
virtual TaBaseSetAssign (const TaBaseSet &rSourceSet)
 Copy from a TaBaseSet with matching attributes.
virtual TaBaseSetAssign (const TBaseSet< Idx, std::less< Idx > > &rSourceSet)
 Copy from a TBaseSet with attributes, provided that they can be casted acciordingly.
virtual TaBaseSetAssignWithoutAttributes (const TBaseSet< Idx, std::less< Idx > > &rSourceSet)
 Copy from a TBaseSet without attributes.
virtual TaBaseSetoperator= (const TaBaseSet &rSource)
 Faudes Type interface.
virtual TaBaseSetoperator= (const TBaseSet< Idx, std::less< Idx > > &rSource)
 Faudes Type interface (extension).
virtual void Clear (void)
 Clear all set.
const Attr * Attributep (void) const
 Attribute typeinfo.
virtual Attr * Attributep (const Idx &rElem)
 Get attribute reference by element.
const Attr & Attribute (void) const
 Attribute typeinfo.
virtual const Attr & Attribute (const Idx &rElem) const
 Get attribute by element.
virtual void Attribute (const Idx &rElem, const Type &attr)
 Set attribute.
virtual void Attribute (const Idx &rElem, const Attr &attr)
 Set attribute.
virtual bool AttributeTry (const Type &rAttr) const
 Attribute typeinfo.
virtual void AttributeTry (const Idx &rElem, const Type &attr)
 Set attribute.
virtual Idx AttributesSize (void) const
 Get number of explicit (aka non-default) attributes.
virtual void ClearAttributes (void)
 Clear all attributes to default value.
virtual bool EqualAttributes (const TBaseSet< Idx, std::less< Idx > > &rOtherSet) const
 Test whether attributes match with other set, Return true if attributes match for shared elements.
virtual bool EqualAttributes (const TaBaseSet &rOtherSet) const
 Test whether attributes match with other set, Return true if attributes match for shared elements.
virtual bool operator== (const TBaseSet< Idx, std::less< Idx > > &rOtherSet) const
 Test set equality.
virtual void Attributes (const TBaseSet< Idx, std::less< Idx > > &rOtherSet)
 Set attributes.
virtual void Attributes (const TaBaseSet &rOtherSet)
 Set attributes.
virtual void ClrAttribute (const Idx &rElem)
 Clear attribute to default value.
void InsertSet (const TBaseSet< Idx, std::less< Idx > > &rOtherSet)
 Inserts elements of rOtherSet.
void InsertSet (const TaBaseSet &rOtherSet)
 Inserts elements of rOtherSet.
void EraseSet (const TBaseSet< Idx, std::less< Idx > > &rOtherSet)
 Erase elements given by other set.
void RestrictSet (const TBaseSet< Idx, std::less< Idx > > &rOtherSet)
 Restrict to specified subset.
void SetUnion (const TBaseSet< Idx, std::less< Idx > > &rOtherSet)
 Set union.
void SetIntersection (const TBaseSet< Idx, std::less< Idx > > &rOtherSet)
 Set intersection.
virtual void Detach (void) const
 Detach from extern storage (reimplement base)
- Public Member Functions inherited from faudes::TBaseSet< T, Cmp >
 TBaseSet (void)
 Constructor.
 TBaseSet (const TBaseSet &rOtherSet)
 Copy-constructor.
 TBaseSet (const std::string &rFilename, const std::string &rLabel="BaseSet")
 Constructor from file.
virtual ~TBaseSet (void)
 Virtual destructor.
const std::string & Name (void) const
 Return name of TBaseSet.
void Name (const std::string &rName)
 Set name of TBaseSet.
Idx Size (void) const
 Get Size of TBaseSet.
bool Empty (void) const
 Test whether if the TBaseSet is Empty.
Iterator Begin (void) const
 Iterator to the begin of set.
Iterator End (void) const
 Iterator to the end of set.
virtual bool Valid (const T &rElem) const
 Test validty of candidate element.
virtual void EraseSet (const TBaseSet &rOtherSet)
 Erase elements given by other set.
virtual void RestrictSet (const TBaseSet &rOtherSet)
 Restrict elements given by other set.
virtual Iterator Inject (const Iterator &pos, const T &rElem)
 Insert specified element.
virtual void Inject (const T &rElem)
 Insert specified element.
virtual void InsertSet (const TBaseSet &rOtherSet)
 Insert elements given by rOtherSet.
virtual void SetUnion (const TBaseSet &rOtherSet)
 Set Union, result is accumulated in this set.
virtual void SetIntersection (const TBaseSet &rOtherSet)
 Set Intersection, result is stored in this set.
TBaseSet operator+ (const TBaseSet &rOtherSet) const
 Set union operator.
TBaseSet operator- (const TBaseSet &rOtherSet) const
 Set difference operator.
TBaseSet operator* (const TBaseSet &rOtherSet) const
 Set intersection operator.
bool operator<= (const TBaseSet &rOtherSet) const
 Test for subset.
bool operator>= (const TBaseSet &rOtherSet) const
 Test for superset.
bool operator< (const TBaseSet &rOtherSet) const
 Order for sorting containers of TBaseSet.
void DValid (const std::string &rMessage="") const
 Some validation of deferred copy mechanism (provoke abort)
virtual void Lock (void) const
 Detach and lock any further reallocation.
virtual TBaseSetAssignWithoutAttributes (const TBaseSet &rSourceSet)
 Attribute access.
virtual void Attributes (const TBaseSet &rOtherSet)
 Attributes access.
virtual bool EqualAttributes (const TBaseSet &rOtherSet) const
 Attribute access.
virtual AttributeVoidAttributep (const T &rElem)
 Attribute access.
virtual const AttributeVoidAttribute (const T &rElem) const
 Attribute access.
virtual void Attribute (const T &rElem, const Type &rAttr)
 Attribute access.
virtual void AttributeTry (const T &rElem, const Type &rAttr)
 Attribute access.
virtual void ClrAttribute (const T &rElem)
 Attribute access.
virtual void XElementTag (const std::string &rTag)
 Configure the element name tag.
virtual const std::string & TypeName (void) const
 Get objects's type name.
virtual void TypeName (const std::string &rType)
 Overwrite faudes-type name.

Protected Member Functions

virtual void DoAssign (const TaNameSet &rSourceSet)
 Assign to other name set.
virtual bool DoEqual (const NameSet &rOtherSet) const
 Test equality of configuration data, ignore attributes Ignore name of the set, insist in matching symboltables.
- Protected Member Functions inherited from faudes::NameSet
virtual void DoAssign (const NameSet &rSourceSet)
 Assign from other name set.
virtual void DoWrite (TokenWriter &tw, const std::string &rLabel="", const Type *pContext=0) const
 Write to TokenWriter, see Type::Write for public wrappers This function will also do the token IO of attributes in derived classes.
virtual void DoDWrite (TokenWriter &tw, const std::string &rLabel="", const Type *pContext=0) const
 Write debug info to TokenWriter, see Type::DWrite for public wrapper.
virtual void DoXWrite (TokenWriter &tw, const std::string &rLabel="", const Type *pContext=0) const
 Write to TokenWriter XML format, see Type::XWrite for public wrappers This function will also do the token IO of attributes in derived classes.
virtual void DoRead (TokenReader &tr, const std::string &rLabel="", const Type *pContext=0)
 Read from TokenReader, see Type::Read for public wrappers.
- Protected Member Functions inherited from faudes::TBaseSet< Idx >
virtual const std::string & XElementTag (void) const
 Get name of elements (used for XML IO)
virtual void DoSWrite (TokenWriter &rTw) const
 Token output, see Type::SWrite for public wrappers.
virtual void DoAssign (const TBaseSet &rSourceSet)
 assign my members
virtual bool DoEqual (const TBaseSet &rOtherSet) const
 test equality
TBaseSet< Idx, std::less< Idx >
>::Iterator 
ThisIterator (const typename std::set< Idx, std::less< Idx > >::const_iterator &sit) const
 Convert STL iterator to API iterator.
void RelinkClients (void)
 Ensure that we do not host contents to anyone else.
void AttachClient (TBaseSet *pRef) const
 Record that we provide contents to some other BaseSet.
void DetachClient (TBaseSet *pRef) const
 Record that we stop providing data for some TBaseSet.
void AttachIterator (Iterator *pFit) const
 Record that an iterator refers to this TBaseSet.
void DetachIterator (Iterator *pFit) const
 Record that an iterator stops to refer to this TBaseSet.
virtual const TypeDefinitionTypeDefinitionp (void) const
 Reimplment from type to use chache.
void FnctUnion (const TBaseSet &rOtherSet, TBaseSet &rRes) const
 static empty STL client list
void FnctDifference (const TBaseSet &rOtherSet, TBaseSet &rRes) const
 Implementation of difference.
void FnctIntersection (const TBaseSet &rOtherSet, TBaseSet &rRes) const
 Implementation of intersection.
- Protected Member Functions inherited from faudes::Type
virtual void DoAssign (const Type &rSrc)
 Assign configuration data from other object.
virtual bool DoEqual (const Type &rOther) const
 Test equality of configuration data.
virtual Token XBeginTag (const std::string &rLabel="", const std::string &rFallbackLabel="") const
- Protected Member Functions inherited from faudes::TaBaseSet< Idx, Attr >
virtual void DoAssign (const TaBaseSet &rSourceSet)
 assignment from source with matching attributes
virtual bool DoEqual (const TBaseSet< Idx, std::less< Idx > > &rOtherSet) const
 test equality, ignore attributes
virtual void DoAttributep (const Idx &rElem, const Type *pAttr)
 set attribute in map (assume elem exists in set, NULL <=> set to default)
virtual void DoAttributep (const Idx &rElem, const Attr *pAttr)
 set attribute in map (assume elem exists in set, NULL <=> set to default)
virtual const Attr * DoAttributep (const Idx &rElem) const
 get attribute from map (return null if elem does not exist in map)
virtual Attr * DoAttributep (const Idx &rElem)
 get attribute from map (insert explicit default if elem does not exist in map)
- Protected Member Functions inherited from faudes::TBaseSet< T, Cmp >
virtual void DoSWrite (TokenWriter &rTw) const
 Token output, see Type::SWrite for public wrappers.
virtual void DoAssign (const TBaseSet &rSourceSet)
 assign my members
virtual bool DoEqual (const TBaseSet &rOtherSet) const
 test equality
TBaseSet< T, Cmp >::Iterator ThisIterator (const typename std::set< T, Cmp >::const_iterator &sit) const
 Convert STL iterator to API iterator.
void RelinkClients (void)
 Ensure that we do not host contents to anyone else.
void AttachClient (TBaseSet *pRef) const
 Record that we provide contents to some other BaseSet.
void DetachClient (TBaseSet *pRef) const
 Record that we stop providing data for some TBaseSet.
void AttachIterator (Iterator *pFit) const
 Record that an iterator refers to this TBaseSet.
void DetachIterator (Iterator *pFit) const
 Record that an iterator stops to refer to this TBaseSet.
virtual const TypeDefinitionTypeDefinitionp (void) const
 Reimplment from type to use chache.
virtual const std::string & XElementTag (void) const
 Get name of elements (used for XML IO)
void FnctUnion (const TBaseSet &rOtherSet, TBaseSet &rRes) const
 static empty STL client list
void FnctDifference (const TBaseSet &rOtherSet, TBaseSet &rRes) const
 Implementation of difference.
void FnctIntersection (const TBaseSet &rOtherSet, TBaseSet &rRes) const
 Implementation of intersection.

Friends

class NameSet
 We implement "protected privacy for template classes" by friendship.

Additional Inherited Members

- Protected Types inherited from faudes::TBaseSet< Idx >
typedef std::set< Idx,
std::less< Idx > >::iterator 
iterator
 STL iterator, non-const version.
typedef std::set< Idx,
std::less< Idx >
>::const_iterator 
const_iterator
 STL iterator, const version.
typedef std::map< Idx,
AttributeVoid * >::iterator 
aiterator
 STL attribute iterator, non-const version.
typedef std::map< Idx,
AttributeVoid * >
::const_iterator 
const_aiterator
 STL attribute iterator, const version.
- Protected Types inherited from faudes::TaBaseSet< Idx, Attr >
typedef TBaseSet< Idx,
std::less< Idx > >::iterator 
iterator
 use TBaseSet STL iterators
typedef TBaseSet< Idx,
std::less< Idx >
>::const_iterator 
const_iterator
 use TBaseSet STL iterators
typedef TBaseSet< Idx,
std::less< Idx > >::aiterator 
aiterator
 use TBaseSet STL iterators
typedef TBaseSet< Idx,
std::less< Idx >
>::const_aiterator 
const_aiterator
 use TBaseSet STL iterators
- Protected Attributes inherited from faudes::NameSet
SymbolTablempSymbolTable
 Pointer to local SymbolTable.
- Protected Attributes inherited from faudes::TaBaseSet< Idx, Attr >
Attr * mpDefAttribute
 default attribute
- Static Protected Attributes inherited from faudes::TBaseSet< Idx >
static std::set< Idx,
std::less< Idx > > 
msEmptySet
 static empty STL set for default constructor
static std::map< Idx,
AttributeVoid * > 
msEmptyAttributes
 static empty STL map for default constructor
- Static Protected Attributes inherited from faudes::TBaseSet< T, Cmp >
static std::set< T, Cmp > msEmptySet = std::set<T,Cmp>()
 static empty STL set for default constructor
static std::map< T,
AttributeVoid * > 
msEmptyAttributes = std::map<T,AttributeVoid*>()
 static empty STL map for default constructor

Detailed Description

template<class Attr>
class faudes::TaNameSet< Attr >

Set of indices with symbolic names and attributes.

This class is derived from NameSet and TaBaseSet.

The file format is demonstrated by the following example of a set "Alphabet" consisting of events "alpha", "beta" and "gamma" with "gamma" having some attribute (see eg AtributeFlags)

"alpha"
"beta"
"gamma" 0x0f
<\Alphabet>

As with TaBaseSet, reading a file ignores unknown attributes. Thus, the above example may also be read as NameSet.

Definition at line 544 of file cfl_nameset.h.

Constructor & Destructor Documentation

template<class Attr >
faudes::TaNameSet< Attr >::TaNameSet ( void  )

Constructor for NameSet referring to the static SymbolTable.

Definition at line 871 of file cfl_nameset.h.

template<class Attr >
faudes::TaNameSet< Attr >::TaNameSet ( const TaNameSet< Attr > &  rOtherSet)

Copy-constructor from other TaNameSet (incl attributes and symboltable)

Parameters
rOtherSetSet to copy

Definition at line 883 of file cfl_nameset.h.

template<class Attr >
faudes::TaNameSet< Attr >::TaNameSet ( const NameSet rOtherSet)

Constructor from NameSet (sets default attributes, same symboltable)

Parameters
rOtherSetSet to copy

Definition at line 895 of file cfl_nameset.h.

template<class Attr >
faudes::TaNameSet< Attr >::TaNameSet ( const std::string &  rFilename,
const std::string &  rLabel = "" 
)

Constructor from file.

This constructor reads a NameSet from a file using the DoRead(TokenReader&, const std::String&) function. The section is specified by rLabel and the static SymbolTable is used.

Parameters
rFilenameName of File
rLabelSection for the set in the file;

Definition at line 907 of file cfl_nameset.h.

template<class Attr>
virtual faudes::TaNameSet< Attr >::~TaNameSet ( void  )
inlinevirtual

Virtual destructor.

Definition at line 592 of file cfl_nameset.h.

Member Function Documentation

template<class Attr >
TaNameSet< Attr > & faudes::TaNameSet< Attr >::Assign ( const NameSet rSrc)
virtual

Relaxed assignment method (uses base class to maintain attributes)

Parameters
rSrcSource from which to assign
Returns
Ref to this set

Definition at line 955 of file cfl_nameset.h.

template<class Attr >
void faudes::TaNameSet< Attr >::Attributes ( const NameSet rOtherSet)
virtual

Set attributes.

Provided that rOtherSet has attributes that can be casted to the appropriate type, attributes are copied per element from rOtherSet. Elements of this set which are not in rOtherSet maintain their attribute.

Parameters
rOtherSetOther IndexSet
Exceptions
Exception
  • Element does not exist (63)
  • Cannot cast attribute type (63)

Reimplemented from faudes::NameSet.

Definition at line 1138 of file cfl_nameset.h.

template<class Attr >
void faudes::TaNameSet< Attr >::Attributes ( const TaNameSet< Attr > &  rOtherSet)
virtual

Set attributes.

Attributes are copied per element from rOtherSet. Elements of this set which are not in rOtherSet maintain their attribute.

Parameters
rOtherSetOther IndexSet

Definition at line 1124 of file cfl_nameset.h.

template<class Attr >
void faudes::TaNameSet< Attr >::DoAssign ( const TaNameSet< Attr > &  rSourceSet)
protectedvirtual

Assign to other name set.

Performs a fake copy, see TBaseSet. This function maintains attributes.

Parameters
rSourceSetDestination to copy from
Returns
ref to this set

Definition at line 935 of file cfl_nameset.h.

template<class Attr >
bool faudes::TaNameSet< Attr >::DoEqual ( const NameSet rOtherSet) const
protectedvirtual

Test equality of configuration data, ignore attributes Ignore name of the set, insist in matching symboltables.

Parameters
rOtherSetOther object to compare with.
Returns
True on match.

Reimplemented from faudes::NameSet.

Definition at line 945 of file cfl_nameset.h.

template<class Attr >
bool faudes::TaNameSet< Attr >::Erase ( const Idx rIndex)
virtual

Delete element by index.

Symbolic name is not removed from SymbolTable.

Parameters
rIndexIndex to delete
Returns
True if element did exist

Reimplemented from faudes::NameSet.

Definition at line 1040 of file cfl_nameset.h.

template<class Attr >
bool faudes::TaNameSet< Attr >::Erase ( const std::string &  rName)
virtual

Delete element by symbolic name.

Symbolic name is not removed from SymbolTable

Parameters
rNameSymbolic name of element to dlete
Returns
True if element did exist
Exceptions
Exception
  • name not found in Symboltable (id 66)

Reimplemented from faudes::NameSet.

Definition at line 1047 of file cfl_nameset.h.

template<class Attr >
NameSet::Iterator faudes::TaNameSet< Attr >::Erase ( const Iterator pos)
virtual

Delete element by iterator.

Symbolic name is not removed from SymbolTable.

Parameters
posTaNameSet::iterator
Returns
Iterator to next element
Exceptions
Exception
  • invalid iterator (id 62)

Reimplemented from faudes::TaBaseSet< Idx, Attr >.

Definition at line 1062 of file cfl_nameset.h.

template<class Attr >
void faudes::TaNameSet< Attr >::EraseSet ( const NameSet rOtherSet)

Erase elements indicated by rOtherSet.

Exceptions
Exception
  • symboltable mismatch (id 67)
Parameters
rOtherSetOther StateSet

Reimplemented from faudes::NameSet.

Definition at line 1068 of file cfl_nameset.h.

template<class Attr >
void faudes::TaNameSet< Attr >::EraseSet ( const TaNameSet< Attr > &  rOtherSet)

Erase elements indicated by rOtherSet.

Exceptions
Exception
  • symboltable mismatch (id 67)
Parameters
rOtherSetOther StateSet

Definition at line 1082 of file cfl_nameset.h.

template<class Attr >
bool faudes::TaNameSet< Attr >::Insert ( const Idx rIndex)
virtual

Add an element by index.

Index must be already known to the global SymbolTable. If the element already exists in the set, the attribute is maintained. Otherwise, the element is inserted with default attribute.

Parameters
rIndexIndex to add
Returns
True, if element was new to set
Exceptions
Exception
  • no symbolic name for index (id 65)

Reimplemented from faudes::NameSet.

Definition at line 967 of file cfl_nameset.h.

template<class Attr>
bool faudes::TaNameSet< Attr >::Insert ( const Idx rIndex,
const Attr &  rAttr 
)

Add an element by index incl.

attribute

Parameters
rIndexIndex to add
rAttrAttribute to add
Returns
True, if index was new to set
Exceptions
Exception
  • no symbolic name for index (id 65)

Reimplemented from faudes::TaBaseSet< Idx, Attr >.

Definition at line 981 of file cfl_nameset.h.

template<class Attr>
Idx faudes::TaNameSet< Attr >::Insert ( const std::string &  rName)

Add an element by its symbolic name.

If the name is unknown, a new index will be generated and recorded in the symboltable. If the name is known, the corresponding index will be added to the set. If the element already exists in the set, the attribute is maintained. Otherwise, the element is inserted with default attribute.

Parameters
rNamesymbolic name of element to add
Returns
Index of (new) element

Reimplemented from faudes::NameSet.

Definition at line 995 of file cfl_nameset.h.

template<class Attr>
Idx faudes::TaNameSet< Attr >::Insert ( const std::string &  rName,
const Attr &  rAttr 
)

Add an element by its symbolic name.

If the name is unknown, a new index will be generated and recorded in the symboltable. If the name is known, the corresponding index will be added to the set.

Parameters
rNamesymbolic name of element to add
rAttrAttribute
Returns
Index of (new) element

Definition at line 1003 of file cfl_nameset.h.

template<class Attr >
void faudes::TaNameSet< Attr >::InsertSet ( const NameSet rOtherSet)
virtual

Inserts elements of rOtherSet.

Attributes of this set are maintained, newly inserted elements have default attribute.

Parameters
rOtherSetOther StateSet
Exceptions
Exception
  • symboltable mismatch (id 67)

Reimplemented from faudes::NameSet.

Definition at line 1012 of file cfl_nameset.h.

template<class Attr >
void faudes::TaNameSet< Attr >::InsertSet ( const TaNameSet< Attr > &  rOtherSet)

Inserts elements of rOtherSet incl attributes Attributes of this set are maintained, new elements are inserted with attribute.

Parameters
rOtherSetOther StateSet

Definition at line 1026 of file cfl_nameset.h.

template<class Attr >
TaNameSet< Attr > faudes::TaNameSet< Attr >::NewN ( void  ) const

Return a NameSet with same symboltable as this set.

Returns
New empty TaNameSet

Reimplemented from faudes::NameSet.

Definition at line 927 of file cfl_nameset.h.

template<class Attr>
virtual TaNameSet& faudes::TaNameSet< Attr >::operator= ( const NameSet rSrc)
inlinevirtual

Relaxed assignment operator (uses base class to maintain attributes)

Parameters
rSrcSource from which to assign
Returns
Ref to this set

Definition at line 618 of file cfl_nameset.h.

template<class Attr >
void faudes::TaNameSet< Attr >::RestrictSet ( const NameSet rOtherSet)

Restrict elements indicated by rOtherSet.

Exceptions
Exception
  • symboltable mismatch (id 67)
Parameters
rOtherSetOther EventSet

Reimplemented from faudes::NameSet.

Definition at line 1096 of file cfl_nameset.h.

template<class Attr >
void faudes::TaNameSet< Attr >::RestrictSet ( const TaNameSet< Attr > &  rOtherSet)

Restrict elements indicated by rOtherSet.

Exceptions
Exception
  • symboltable mismatch (id 67)
Parameters
rOtherSetOther StateSet

Definition at line 1110 of file cfl_nameset.h.

template<class Attr >
std::string faudes::TaNameSet< Attr >::Str ( const Idx rIndex) const
virtual

Return pretty printable symbolic name for index.

Primary meant for debugging messages.

Parameters
rIndexIndex to print
Returns
String

Reimplemented from faudes::NameSet.

Definition at line 1153 of file cfl_nameset.h.

Friends And Related Function Documentation

template<class Attr>
friend class NameSet
friend

We implement "protected privacy for template classes" by friendship.

This is used for the pragmatic implemention conversion constructors.

Definition at line 552 of file cfl_nameset.h.


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

libFAUDES 2.24g --- 2014.09.15 --- c++ api documentaion by doxygen