faudes::TaNameSet< Attr > Class Template Reference

Detailed Description

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

Set of indices with symbolic names and attributes.

This class is derived from NameSet and the interface TAttrMap.

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
TaNameSet< AttributeCFlags > Alphabet
Convenience typedef for event sets with controllability attributes.

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

Definition at line 564 of file cfl_nameset.h.

#include <cfl_nameset.h>

Public Member Functions

 TaNameSet (void)
 Constructor for NameSet referring to the static SymbolTable. More...
 
 TaNameSet (const TaNameSet &rOtherSet)
 Copy-constructor from other TaNameSet (incl attributes and symboltable) More...
 
 TaNameSet (const NameSet &rOtherSet)
 Constructor from NameSet (sets default attributes, same symboltable) More...
 
 TaNameSet (const std::string &rFilename, const std::string &rLabel="")
 Constructor from file. More...
 
virtual ~TaNameSet (void)
 Virtual destructor. More...
 
virtual TaNameSetAssign (const TBaseSet< Idx > &rSrc)
 Relaxed assignment method (uses base class to maintain attributes) More...
 
virtual TaNameSetoperator= (const NameSet &rSrc)
 Relaxed assignment operator (uses base class to maintain attributes) More...
 
virtual bool Insert (const Idx &rIndex)
 Add an element by index. More...
 
virtual bool Insert (const Idx &rIndex, const Attr &rAttr)
 Add an element by index incl. More...
 
virtual Idx Insert (const std::string &rName)
 Add an element by its symbolic name. More...
 
virtual Idx Insert (const std::string &rName, const Attr &rAttr)
 Add an element by its symbolic name. More...
 
virtual void InsertSet (const NameSet &rOtherSet)
 Inserts elements of rOtherSet. More...
 
virtual void InsertSet (const TBaseSet< Idx > &rOtherSet)
 Inserts all elements of rOtherSet. More...
 
virtual bool Erase (const Idx &rIndex)
 Delete element by index. More...
 
virtual bool Erase (const std::string &rName)
 Delete element by symbolic name. More...
 
virtual NameSet::Iterator Erase (const Iterator &pos)
 Delete element by iterator. More...
 
virtual void EraseSet (const NameSet &rOtherSet)
 Erase elements indicated by rOtherSet. More...
 
virtual void EraseSet (const TBaseSet< Idx > &rOtherSet)
 Erase elements specified by rOtherSet. More...
 
virtual void RestrictSet (const NameSet &rOtherSet)
 Restrict elements indicated by rOtherSet. More...
 
virtual void RestrictSet (const TBaseSet< Idx > &rOtherSet)
 Restrict to elements specified by rOtherSet. More...
 
virtual void Attributes (const TBaseSet< Idx > &rOtherSet)
 Set attributes. More...
 
std::string Str (const Idx &rIndex) const
 Return pretty printable symbolic name for index. More...
 
const Attr * AttributeType (void) const
 resolve ambiguities from attribute interface ("using" wont do the job) More...
 
Attr * Attributep (const Idx &rElem)
 
const Attr & Attribute (const Idx &rElem) const
 
void Attribute (const Idx &rElem, const Attr &rAttr)
 
void Attribute (const Idx &rElem, const Type &rAttr)
 
void AttributeTry (const Idx &rElem, const Type &rAttr)
 Attribute access. More...
 
- Public Member Functions inherited from faudes::NameSet
 NameSet (void)
 Constructor for NameSet referring to the static SymbolTable. More...
 
 NameSet (const NameSet &rOtherSet)
 Copy-constructor from other NameSet. More...
 
 NameSet (const std::string &rFilename, const std::string &rLabel="")
 Constructor from file. More...
 
virtual ~NameSet (void)
 Virtual destructor. More...
 
SymbolTableSymbolTablep (void) const
 Get Pointer mpSymbolTable. More...
 
void SymbolTablep (SymbolTable *pSymTab)
 Set SymbolTable reference. More...
 
bool Insert (const Idx &rIndex)
 Add an element by index. More...
 
Idx Insert (const std::string &rName)
 Add an element by its symbolic name. More...
 
void EraseSet (const NameSet &rOtherSet)
 Erase elements specified by rOtherSet. More...
 
void RestrictSet (const NameSet &rOtherSet)
 Restrict to elements specified by rOtherSet. More...
 
void SymbolicName (Idx index, const std::string &rName)
 Set new name for existing index. More...
 
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. More...
 
std::string SymbolicName (Idx index) const
 Name lookup. More...
 
Idx Index (const std::string &rName) const
 Index lookup. More...
 
bool Exists (const Idx &rIndex) const
 Test existence of index. More...
 
bool Exists (const std::string &rName) const
 Test existence of name. More...
 
NameSet::Iterator Find (const Idx &rIndex) const
 Find iterator for index. More...
 
NameSet::Iterator Find (const std::string &rName) const
 Find iterator for name. More...
 
NameSet operator+ (const NameSet &rOtherSet) const
 Set union operator. More...
 
NameSet operator- (const NameSet &rOtherSet) const
 Set difference operator. More...
 
NameSet operator* (const NameSet &rOtherSet) const
 Set intersection operator. More...
 
bool operator<= (const NameSet &rOtherSet) const
 Test for subset
More...
 
bool operator>= (const NameSet &rOtherSet) const
 Test for superset. More...
 
std::string Str (const Idx &rIndex) const
 Return pretty printable symbolic name for index. More...
 
- Public Member Functions inherited from faudes::TBaseSet< Idx >
 TBaseSet (void)
 Constructor. More...
 
 TBaseSet (const TBaseSet &rOtherSet)
 Copy-constructor. More...
 
 TBaseSet (const std::string &rFilename, const std::string &rLabel="BaseSet")
 Constructor from file. More...
 
virtual ~TBaseSet (void)
 Virtual destructor. More...
 
const std::string & Name (void) const
 Return name of TBaseSet. More...
 
void Name (const std::string &rName)
 Set name of TBaseSet. More...
 
virtual void Clear (void)
 Clear all set. More...
 
Idx Size (void) const
 Get Size of TBaseSet. More...
 
bool Empty (void) const
 Test whether if the TBaseSet is Empty. More...
 
virtual std::string Str (const Idx &rElem) const
 Return pretty printable element. More...
 
Iterator Begin (void) const
 Iterator to the begin of set. More...
 
Iterator End (void) const
 Iterator to the end of set. More...
 
virtual bool Valid (const Idx &rElem) const
 Test validty of candidate element. More...
 
virtual bool Erase (const Idx &rElem)
 Erase element by reference. More...
 
virtual Iterator Erase (const Iterator &pos)
 Erase element by iterator. More...
 
virtual void EraseSet (const TBaseSet &rOtherSet)
 Erase elements given by other set. More...
 
virtual void RestrictSet (const TBaseSet &rOtherSet)
 Restrict elements given by other set. More...
 
virtual bool Disjoint (const TBaseSet &rOtherSet) const
 Test for this set to be disjoint witg other set. More...
 
virtual bool Insert (const Idx &rElem)
 Insert specified element. More...
 
virtual Iterator Inject (const Iterator &pos, const Idx &rElem)
 Insert specified element. More...
 
virtual void Inject (const Idx &rElem)
 Insert specified element. More...
 
virtual void InsertSet (const TBaseSet &rOtherSet)
 Insert elements given by rOtherSet. More...
 
bool Exists (const Idx &rElem) const
 Test existence of element. More...
 
Iterator Find (const Idx &rElem) const
 Find element and return iterator. More...
 
TBaseSet operator+ (const TBaseSet &rOtherSet) const
 Set union operator. More...
 
TBaseSet operator- (const TBaseSet &rOtherSet) const
 Set difference operator. More...
 
TBaseSet operator* (const TBaseSet &rOtherSet) const
 Set intersection operator. More...
 
bool operator<= (const TBaseSet &rOtherSet) const
 Test for subset
More...
 
bool operator>= (const TBaseSet &rOtherSet) const
 Test for superset. More...
 
bool operator< (const TBaseSet &rOtherSet) const
 Order for sorting containers of TBaseSet. More...
 
void DValid (const std::string &rMessage="") const
 Some validation of deferred copy mechanism (provoke abort) More...
 
void Detach (DetachMode flag=AttrIncl) const
 
void Lock (void) const
 Detach and lock any further reallocation. More...
 
virtual bool AttributeTest (const Type &rAttr) const
 Attribute typeinfo. More...
 
virtual TBaseSetAssignWithoutAttributes (const TBaseSet &rSourceSet)
 Attribute access. More...
 
virtual void Attributes (const TBaseSet &rOtherSet)
 Attributes access. More...
 
Idx AttributesSize (void) const
 Attribute access. More...
 
void ClearAttributes (void)
 Attribute access. More...
 
bool EqualAttributes (const TBaseSet &rOtherSet) const
 Attribute access. More...
 
virtual AttributeVoidAttributep (const Idx &rElem)
 Attribute access. More...
 
virtual const AttributeVoidAttribute (const Idx &rElem) const
 Attribute access. More...
 
virtual void Attribute (const Idx &rElem, const Type &rAttr)
 Attribute access. More...
 
virtual void ClrAttribute (const Idx &rElem)
 Attribute access. More...
 
virtual void XElementTag (const std::string &rTag)
 Configure the element name tag. More...
 
virtual const std::string & TypeName (void) const
 Get objects's type name. More...
 
virtual void TypeName (const std::string &rType)
 Overwrite faudes-type name. More...
 
- Public Member Functions inherited from faudes::Type
 Type (void)
 Constructor. More...
 
 Type (const Type &rType)
 Copy constructor. More...
 
virtual ~Type (void)
 Destructor. More...
 
virtual TypeNew (void) const
 Construct on heap. More...
 
virtual TypeCopy (void) const
 Construct on heap. More...
 
virtual const TypeCast (const Type *pOther) const
 Cast other object to this type. More...
 
virtual TypeAssign (const Type &rSrc)
 Assign configuration data from other object. More...
 
virtual Typeoperator= (const Type &rSrc)
 Assign configurationdata from other object. More...
 
virtual bool Equal (const Type &rOther) const
 Test equality of configuration data. More...
 
virtual bool operator== (const Type &rOther) const
 Test equality of configuration data. More...
 
virtual bool operator!= (const Type &rOther) const
 Test equality of configuration data. More...
 
void Write (const Type *pContext=0) const
 Write configuration data to console. More...
 
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. More...
 
void Write (const std::string &pFileName, std::ios::openmode openmode) const
 Write configuration data to a file. More...
 
void Write (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data to TokenWriter. More...
 
virtual void XWrite (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data to an XML file. More...
 
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. More...
 
void XWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data in XML format to TokenWriter. More...
 
std::string ToString (const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data to a string. More...
 
std::string ToText (const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data to a formated string. More...
 
void DWrite (const Type *pContext=0) const
 Write configuration data to console, debugging format. More...
 
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. More...
 
void DWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data in debug format to TokenWriter. More...
 
void SWrite (TokenWriter &rTw) const
 Write statistics comment to TokenWriter. More...
 
void SWrite (void) const
 Write statistics comment to console. More...
 
std::string ToSText (void) const
 Write statistics to a string. More...
 
void Read (const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0)
 Read configuration data from file with label specified. More...
 
void FromString (const std::string &rString, const std::string &rLabel="", const Type *pContext=0)
 Read configuration data from a string. More...
 
void Read (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
 Read configuration data from TokenReader with label sepcified. More...
 
- Public Member Functions inherited from faudes::TAttrMap< Idx, Attr >
 TAttrMap (TBaseSet< Idx, std::less< Idx > > *pBaseSetRef)
 Constructor. More...
 
virtual ~TAttrMap (void)
 Virtual destructor. More...
 
void AssignWithAttributes (const TBaseSet< Idx, std::less< Idx > > &rSourceSet)
 Copy from a TBaseSet to the associated TBaseSet, with attributes, provided that they can be casted accordingly. More...
 
const Attr * AttributeType (void) const
 Attribute typeinfo. More...
 
Attr * Attributep (const Idx &rElem)
 Get attribute reference by element. More...
 
const Attr & Attribute (const Idx &rElem) const
 Get attribute by element. More...
 
void Attribute (const Idx &rElem, const Type &attr)
 Set attribute. More...
 
void Attribute (const Idx &rElem, const Attr &attr)
 Set attribute. More...
 
void AttributeTry (const Idx &rElem, const Type &attr)
 Set attribute. More...
 
bool Insert (const Idx &rElem)
 Insert element. More...
 
bool Insert (const Idx &rElem, const Attr &attr)
 Insert element with attribute. More...
 
void InsertSet (const TBaseSet< Idx, std::less< Idx > > &rOtherSet)
 Inserts elements from rOtherSet. More...
 
bool Erase (const Idx &rElem)
 Erase Element (incl its attribute) More...
 
TBaseSet< Idx, std::less< Idx > >::Iterator Erase (const typename TBaseSet< Idx, std::less< Idx > >::Iterator &pos)
 Erase element by iterator (incl attribute) More...
 
void EraseSet (const TBaseSet< Idx, std::less< Idx > > &rOtherSet)
 Erase elements given by other set. More...
 
void RestrictSet (const TBaseSet< Idx, std::less< Idx > > &rOtherSet)
 Restrict to specified subset. More...
 

Protected Member Functions

void DoAssign (const TaNameSet &rSourceSet)
 Assign to other name set. More...
 
bool DoEqual (const NameSet &rOtherSet) const
 Test equality of configuration data, ignore attributes Ignore name of the set, insist in matching symboltables. More...
 
- Protected Member Functions inherited from faudes::NameSet
void DoAssign (const NameSet &rSourceSet)
 Assign from other name set. More...
 
bool DoEqual (const NameSet &rOtherSet) const
 Test equality of configuration data. More...
 
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. More...
 
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. More...
 
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. More...
 
virtual void DoRead (TokenReader &tr, const std::string &rLabel="", const Type *pContext=0)
 Read from TokenReader, see Type::Read for public wrappers. More...
 
- Protected Member Functions inherited from faudes::TBaseSet< Idx >
virtual const std::string & XElementTag (void) const
 Get name of elements (used for XML IO) More...
 
virtual void DoSWrite (TokenWriter &rTw) const
 Token output, see Type::SWrite for public wrappers. More...
 
void DoAssign (const TBaseSet &rSourceSet)
 assign my members More...
 
bool DoEqual (const TBaseSet &rOtherSet) const
 test equality More...
 
void DoAttribute (const Idx &rElem, const Type *pAttr)
 set attribute in map (assume elem exists in set, NULL <=> set to default) More...
 
const AttributeVoidDoAttribute (const Idx &rElem) const
 get attribute from map (return null if elem does not exist in map) More...
 
AttributeVoidDoAttributeExplicit (const Idx &rElem)
 get attribute from map (insert explicit default if elem does not exist in map) More...
 
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. More...
 
void RelinkClients (void)
 Ensure that we do not host contents to anyone else. More...
 
void AttachClient (TBaseSet *pRef) const
 Record that we provide contents to some other BaseSet. More...
 
void DetachClient (TBaseSet *pRef) const
 Record that we stop providing data for some TBaseSet. More...
 
void AttachIterator (Iterator *pFit) const
 Record that an iterator refers to this TBaseSet. More...
 
void DetachIterator (Iterator *pFit) const
 Record that an iterator stops to refer to this TBaseSet. More...
 
virtual const TypeDefinitionTypeDefinitionp (void) const
 Reimplment from type to use chache. More...
 
- Protected Member Functions inherited from faudes::Type
void DoAssign (const Type &rSrc)
 Assign configuration data from other object. More...
 
bool DoEqual (const Type &rOther) const
 Test equality of configuration data. More...
 
virtual Token XBeginTag (const std::string &rLabel="", const std::string &rFallbackLabel="") const
 

Friends

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

Additional Inherited Members

- Public Types inherited from faudes::TBaseSet< Idx >
enum  DetachMode
 Detach from extern storage (incl allocation and true copy) More...
 
- Protected Types inherited from faudes::TBaseSet< Idx >
typedef std::set< Idx, std::less< Idx > >::iterator iterator
 STL iterator, non-const version. More...
 
typedef std::set< Idx, std::less< Idx > >::const_iterator const_iterator
 STL iterator, const version. More...
 
typedef std::map< Idx, AttributeVoid * >::iterator aiterator
 STL attribute iterator, non-const version. More...
 
typedef std::map< Idx, AttributeVoid * >::const_iterator const_aiterator
 STL attribute iterator, const version. More...
 
- Protected Types inherited from faudes::TAttrMap< Idx, Attr >
typedef TBaseSet< Idx, std::less< Idx > >::iterator iterator
 use TBaseSet STL iterators More...
 
typedef TBaseSet< Idx, std::less< Idx > >::const_iterator const_iterator
 use TBaseSet STL iterators More...
 
typedef TBaseSet< Idx, std::less< Idx > >::aiterator aiterator
 use TBaseSet STL iterators More...
 
typedef TBaseSet< Idx, std::less< Idx > >::const_aiterator const_aiterator
 use TBaseSet STL iterators More...
 
- Protected Attributes inherited from faudes::NameSet
SymbolTablempSymbolTable
 Pointer to local SymbolTable. More...
 
- Protected Attributes inherited from faudes::TBaseSet< Idx >
std::string mMyName
 Name of this BaseSet. More...
 
std::set< Idx, std::less< Idx > > * pSet
 Pointer on STL set to operate on. More...
 
std::set< Idx, std::less< Idx > > * mpSet
 STL set, if this object hosts data (else NULL) More...
 
std::map< Idx, AttributeVoid * > * pAttributes
 Pointer to attribute map to operate on. More...
 
std::map< Idx, AttributeVoid * > * mpAttributes
 Attribute map, if this object hosts data (else NULL). More...
 
TBaseSet< Idx, std::less< Idx > > * pHostSet
 Pointer on BaseSet that hosts our data (THIS if we host) More...
 
std::list< TBaseSet< Idx, std::less< Idx > > * >::iterator mClientRecord
 Iterator to the client list that hosts our data (maintained by host) More...
 
std::list< TBaseSet< Idx, std::less< Idx > > * > * mpClients
 BaseSets, that use data hosted by us (NULL if we dont host data, emptyset if we host to ourself excl.) More...
 
bool mDetached
 Indicate "hosts data to myself only". More...
 
bool mLocked
 Indicate "dont re-allocate the STL set ever again". More...
 
std::set< Iterator * > mIterators
 Iterators that refer to this TBaseSet. More...
 
- Protected Attributes inherited from faudes::TAttrMap< Idx, Attr >
TBaseSet< Idx, std::less< Idx > > * pBaseSet
 reference to associated TBaseSet More...
 
- Static Protected Attributes inherited from faudes::TBaseSet< Idx >
static std::set< Idx, std::less< Idx > > msEmptySet
 static empty STL set for default constructor More...
 
static std::map< Idx, AttributeVoid * > msEmptyAttributes
 static empty STL map for default constructor More...
 

Constructor & Destructor Documentation

◆ TaNameSet() [1/4]

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

Constructor for NameSet referring to the static SymbolTable.

Definition at line 901 of file cfl_nameset.h.

◆ TaNameSet() [2/4]

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 912 of file cfl_nameset.h.

◆ TaNameSet() [3/4]

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 922 of file cfl_nameset.h.

◆ TaNameSet() [4/4]

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 933 of file cfl_nameset.h.

◆ ~TaNameSet()

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

Virtual destructor.

Definition at line 612 of file cfl_nameset.h.

Member Function Documentation

◆ Assign()

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

Relaxed assignment method (uses base class to maintain attributes)

Runtimetype check for TransSet, maintains attributes provided they can be casted.

Parameters
rSrcSource from which to assign
Returns
Ref to this set

Definition at line 968 of file cfl_nameset.h.

◆ Attribute() [1/3]

template<class Attr >
const Attr& faudes::TaNameSet< Attr >::Attribute ( const Idx rElem) const
inline

Definition at line 844 of file cfl_nameset.h.

◆ Attribute() [2/3]

template<class Attr >
void faudes::TaNameSet< Attr >::Attribute ( const Idx rElem,
const Attr &  rAttr 
)
inline

Definition at line 845 of file cfl_nameset.h.

◆ Attribute() [3/3]

template<class Attr >
void faudes::TaNameSet< Attr >::Attribute ( const Idx rElem,
const Type rAttr 
)
inline

Definition at line 846 of file cfl_nameset.h.

◆ Attributep()

template<class Attr >
Attr* faudes::TaNameSet< Attr >::Attributep ( const Idx rElem)
inline

Definition at line 843 of file cfl_nameset.h.

◆ Attributes()

template<class Attr >
void faudes::TaNameSet< Attr >::Attributes ( const TBaseSet< Idx > &  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)
  • Cannot cast to NameSet (63)

Definition at line 1164 of file cfl_nameset.h.

◆ AttributeTry()

template<class Attr >
void faudes::TaNameSet< Attr >::AttributeTry ( const Idx rElem,
const Type rAttr 
)
inlinevirtual

Attribute access.

This virtual function provides an interface for derived classes with attributes eg TaIndexSet. It is meant to try to set the attribute as specified if the type can be casted. Otherwise it does nothing.

Parameters
rElemElement of which the attribute is to be set
rAttrAttribute value to set.

Reimplemented from faudes::TBaseSet< Idx >.

Definition at line 847 of file cfl_nameset.h.

◆ AttributeType()

template<class Attr >
const Attr* faudes::TaNameSet< Attr >::AttributeType ( void  ) const
inlinevirtual

resolve ambiguities from attribute interface ("using" wont do the job)

Reimplemented from faudes::TBaseSet< Idx >.

Definition at line 842 of file cfl_nameset.h.

◆ DoAssign()

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

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 952 of file cfl_nameset.h.

◆ DoEqual()

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

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.

Definition at line 960 of file cfl_nameset.h.

◆ Erase() [1/3]

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 1067 of file cfl_nameset.h.

◆ Erase() [2/3]

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::NameSet.

Definition at line 1089 of file cfl_nameset.h.

◆ Erase() [3/3]

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 1074 of file cfl_nameset.h.

◆ EraseSet() [1/2]

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

Erase elements indicated by rOtherSet.

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

Definition at line 1095 of file cfl_nameset.h.

◆ EraseSet() [2/2]

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

Erase elements specified by rOtherSet.

This function requires a runtime cast to access the synboltable. An expection is thrown if the cast fails.

Parameters
rOtherSetOther NameSet
Exceptions
Exception
  • symboltable mismatch (id 67)
  • cast to nameset failed (id 67)

Reimplemented from faudes::NameSet.

Definition at line 1110 of file cfl_nameset.h.

◆ Insert() [1/4]

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)

Definition at line 988 of file cfl_nameset.h.

◆ Insert() [2/4]

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

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)

Definition at line 1002 of file cfl_nameset.h.

◆ Insert() [3/4]

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

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

Definition at line 1016 of file cfl_nameset.h.

◆ Insert() [4/4]

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

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 1024 of file cfl_nameset.h.

◆ InsertSet() [1/2]

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 obtain the attribute from rOtherSet provided they can be casted appropriately.

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

Reimplemented from faudes::NameSet.

Definition at line 1033 of file cfl_nameset.h.

◆ InsertSet() [2/2]

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

Inserts all elements of rOtherSet.

This variant requires a runtime cast to access the synboltable. An expection is thrown if the cast fails.

Parameters
rOtherSetOther NameSet
Exceptions
Exception
  • symboltable mismatch (id 67)
  • cast to nameset failed (id 67)

Reimplemented from faudes::NameSet.

Definition at line 1047 of file cfl_nameset.h.

◆ operator=()

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

Relaxed assignment operator (uses base class to maintain attributes)

 @param rSrc 
    Source from which to assign
 @return
    Ref to this set

Definition at line 633 of file cfl_nameset.h.

◆ RestrictSet() [1/2]

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

Restrict elements indicated by rOtherSet.

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

Definition at line 1130 of file cfl_nameset.h.

◆ RestrictSet() [2/2]

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

Restrict to elements specified by rOtherSet.

This function requires a runtime cast to access the synboltable. An expection is thrown if the cast fails.

Parameters
rOtherSetOther NameSet
Exceptions
Exception
  • symboltable mismatch (id 67)
  • cast to nameset failed (id 67)

Reimplemented from faudes::NameSet.

Definition at line 1144 of file cfl_nameset.h.

◆ Str()

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

Return pretty printable symbolic name for index.

Primary meant for debugging messages.

Parameters
rIndexIndex to print
Returns
String

Definition at line 1185 of file cfl_nameset.h.

Friends And Related Function Documentation

◆ NameSet

template<class Attr >
friend class NameSet ( void  )
friend

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

This is used for the pragmatic implemention conversion constructors.

Definition at line 572 of file cfl_nameset.h.


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

libFAUDES 2.32b --- 2024.03.01 --- c++ api documentaion by doxygen