State, Event and Transition Set

Detailed Description

This module collects all basic container classes aka state- event- and transition-sets, e.g.,.

  • TBaseSet base class for all libFaudes containers,
  • IndexSet set of plain indices,
  • TaIndexSet set of indices with attributes,
  • NameSet set of indices with symbolic names,
  • TaNameSet set of indices with attributes and symbolic names,
  • TTransSet set of transitions in a sepcific order.

All libFAUDES container classes share the same basic API similar to the one known from STL containers. In addition, they implement file IO via faudes token streams and/or XML. Most commonly used is the plain faudes::EventSet and the faudes::Alphabet. Plug-ins introduce specialized sets for their purposes.

Classes

class  faudes::TAttrMap< T, Attr, Cmp >
 Attribute interface for TBaseSet. More...
 
class  faudes::TBaseSet< T, Cmp >
 STL style set template. More...
 
class  faudes::vBaseVector
 Vector bass class. More...
 
class  faudes::TBaseVector< T >
 Vector template. More...
 
class  faudes::TaIndexSet< Attr >
 Set of indices with attributes. More...
 
class  faudes::IndexSet
 Set of indices. More...
 
class  faudes::SymbolSet
 Set of symbols. More...
 
class  faudes::Transition
 Triple (X1,Ev,X2) to represent current state, event and next state. More...
 
class  faudes::TransSort
 Alternative ordering of Transitions. More...
 
class  faudes::TTransSet< Cmp >
 Set of Transitions. More...
 
class  faudes::TaTransSet< Attr >
 Set of Transitions with attributes. More...
 

Macros

#define THIS   TBaseSet<T,Cmp>
 
#define TEMP   template<class T, class Cmp>
 
#define BASE   Type
 
#define TaStateSet   TaIndexSet
 Convenience Macro. More...
 

Typedefs

typedef TaNameSet< AttributeCFlagsfaudes::Alphabet
 Convenience typedef for event sets with controllability attributes. More...
 
typedef IndexSet faudes::StateSet
 
typedef NameSet faudes::EventSet
 Convenience typedef for plain event sets. More...
 
typedef TTransSet< TransSort::X1EvX2faudes::TransSet
 Type definition for default sorted TTransSet. More...
 
typedef TTransSet< TransSort::X1EvX2faudes::TransSetX1EvX2
 Type definition for default sorted TTransSet. More...
 
typedef TTransSet< TransSort::EvX1X2faudes::TransSetEvX1X2
 Type definition for ev, x1, x2 sorted TTransSet. More...
 
typedef TTransSet< TransSort::EvX2X1faudes::TransSetEvX2X1
 Type definition for ev, x2, x1 sorted TTransSet. More...
 
typedef TTransSet< TransSort::X2EvX1faudes::TransSetX2EvX1
 Type definition for x2, ev, x1 sorted TTransSet. More...
 
typedef TTransSet< TransSort::X2X1Evfaudes::TransSetX2X1Ev
 Type definition for x2, x1, ev sorted TTransSet. More...
 
typedef TTransSet< TransSort::X1X2Evfaudes::TransSetX1X2Ev
 Type definition for x1, x2, ev sorted TTransSet. More...
 

Functions

template<class T , class Cmp >
void faudes::SetUnion (const TBaseSet< T, Cmp > &rSetA, const TBaseSet< T, Cmp > &rSetB, TBaseSet< T, Cmp > &rRes)
 
template<class T , class Cmp >
void faudes::SetIntersection (const TBaseSet< T, Cmp > &rSetA, const TBaseSet< T, Cmp > &rSetB, TBaseSet< T, Cmp > &rRes)
 
template<class T , class Cmp >
void faudes::SetDifference (const TBaseSet< T, Cmp > &rSetA, const TBaseSet< T, Cmp > &rSetB, TBaseSet< T, Cmp > &rRes)
 
template<class T , class Cmp >
bool faudes::SetEquality (const TBaseSet< T, Cmp > &rSetA, const TBaseSet< T, Cmp > &rSetB)
 
template<class T , class Cmp >
bool faudes::SetInclusion (const TBaseSet< T, Cmp > &rSetA, const TBaseSet< T, Cmp > &rSetB)
 
 faudes::TBaseSet< T, Cmp >::TBaseSet (void)
 Constructor. More...
 
 faudes::TBaseSet< T, Cmp >::TBaseSet (const std::string &rFilename, const std::string &rLabel="BaseSet")
 Constructor from file. More...
 
 faudes::TBaseSet< T, Cmp >::TBaseSet (const TBaseSet &rOtherSet)
 Copy-constructor. More...
 
virtual faudes::TBaseSet< T, Cmp >::~TBaseSet (void)
 Virtual destructor. More...
 
void faudes::TBaseSet< T, Cmp >::DoAssign (const TBaseSet &rSourceSet)
 assign my members More...
 
void faudes::TBaseSet< T, Cmp >::Detach (DetachMode flag=AttrIncl) const
 
void faudes::TBaseSet< T, Cmp >::Lock (void) const
 Detach and lock any further reallocation. More...
 
void faudes::TBaseSet< T, Cmp >::RelinkClients (void)
 Ensure that we do not host contents to anyone else. More...
 
void faudes::TBaseSet< T, Cmp >::AttachClient (TBaseSet *pRef) const
 Record that we provide contents to some other BaseSet. More...
 
void faudes::TBaseSet< T, Cmp >::DetachClient (TBaseSet *pRef) const
 Record that we stop providing data for some TBaseSet. More...
 
void faudes::TBaseSet< T, Cmp >::AttachIterator (Iterator *pFit) const
 Record that an iterator refers to this TBaseSet. More...
 
void faudes::TBaseSet< T, Cmp >::DetachIterator (Iterator *pFit) const
 Record that an iterator stops to refer to this TBaseSet. More...
 
void faudes::TBaseSet< T, Cmp >::DValid (const std::string &rMessage="") const
 Some validation of deferred copy mechanism (provoke abort) More...
 
const std::string & faudes::TBaseSet< T, Cmp >::Name (void) const
 Return name of TBaseSet. More...
 
void faudes::TBaseSet< T, Cmp >::Name (const std::string &rName)
 Set name of TBaseSet. More...
 
virtual const TypeDefinitionfaudes::TBaseSet< T, Cmp >::TypeDefinitionp (void) const
 Reimplment from type to use chache. More...
 
virtual const std::string & faudes::TBaseSet< T, Cmp >::XElementTag (void) const
 Get name of elements (used for XML IO) More...
 
virtual void faudes::TBaseSet< T, Cmp >::XElementTag (const std::string &rTag)
 Configure the element name tag. More...
 
virtual const std::string & faudes::TBaseSet< T, Cmp >::TypeName (void) const
 Get objects's type name. More...
 
virtual void faudes::TBaseSet< T, Cmp >::TypeName (const std::string &rType)
 Overwrite faudes-type name. More...
 
virtual std::string faudes::TBaseSet< T, Cmp >::Str (const T &rElem) const
 Return pretty printable element. More...
 
Idx faudes::TBaseSet< T, Cmp >::Size (void) const
 Get Size of TBaseSet. More...
 
bool faudes::TBaseSet< T, Cmp >::Empty (void) const
 Test whether if the TBaseSet is Empty. More...
 
virtual void faudes::TBaseSet< T, Cmp >::DoWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Token output, see Type::DWrite for public wrappers. More...
 
virtual void faudes::TBaseSet< T, Cmp >::DoDWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Token output, debugging see Type::DWrite for public wrappers. More...
 
virtual void faudes::TBaseSet< T, Cmp >::DoSWrite (TokenWriter &rTw) const
 Token output, see Type::SWrite for public wrappers. More...
 
virtual void faudes::TBaseSet< T, Cmp >::DoRead (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
 Token input, see Type::Read for public wrappers. More...
 
TBaseSet< T, Cmp >::Iterator faudes::TBaseSet< T, Cmp >::ThisIterator (const typename std::set< T, Cmp >::const_iterator &sit) const
 Convert STL iterator to API iterator. More...
 
Iterator faudes::TBaseSet< T, Cmp >::Begin (void) const
 Iterator to the begin of set. More...
 
Iterator faudes::TBaseSet< T, Cmp >::End (void) const
 Iterator to the end of set. More...
 
virtual void faudes::TBaseSet< T, Cmp >::Clear (void)
 Clear all set. More...
 
virtual bool faudes::TBaseSet< T, Cmp >::Valid (const T &rElem) const
 Test validty of candidate element. More...
 
virtual bool faudes::TBaseSet< T, Cmp >::Insert (const T &rElem)
 Insert specified element. More...
 
virtual Iterator faudes::TBaseSet< T, Cmp >::Inject (const Iterator &pos, const T &rElem)
 Insert specified element. More...
 
virtual void faudes::TBaseSet< T, Cmp >::Inject (const T &rElem)
 Insert specified element. More...
 
virtual void faudes::TBaseSet< T, Cmp >::InsertSet (const TBaseSet &rOtherSet)
 Insert elements given by rOtherSet. More...
 
virtual bool faudes::TBaseSet< T, Cmp >::Erase (const T &rElem)
 Erase element by reference. More...
 
virtual Iterator faudes::TBaseSet< T, Cmp >::Erase (const Iterator &pos)
 Erase element by iterator. More...
 
virtual void faudes::TBaseSet< T, Cmp >::EraseSet (const TBaseSet &rOtherSet)
 Erase elements given by other set. More...
 
virtual void faudes::TBaseSet< T, Cmp >::RestrictSet (const TBaseSet &rOtherSet)
 Restrict elements given by other set. More...
 
virtual bool faudes::TBaseSet< T, Cmp >::Disjoint (const TBaseSet &rOtherSet) const
 Test for this set to be disjoint witg other set. More...
 
Iterator faudes::TBaseSet< T, Cmp >::Find (const T &rElem) const
 Find element and return iterator. More...
 
bool faudes::TBaseSet< T, Cmp >::Exists (const T &rElem) const
 Test existence of element. More...
 
TBaseSet faudes::TBaseSet< T, Cmp >::operator+ (const TBaseSet &rOtherSet) const
 Set union operator. More...
 
TBaseSet faudes::TBaseSet< T, Cmp >::operator- (const TBaseSet &rOtherSet) const
 Set difference operator. More...
 
TBaseSet faudes::TBaseSet< T, Cmp >::operator* (const TBaseSet &rOtherSet) const
 Set intersection operator. More...
 
bool faudes::TBaseSet< T, Cmp >::DoEqual (const TBaseSet &rOtherSet) const
 test equality More...
 
bool faudes::TBaseSet< T, Cmp >::operator<= (const TBaseSet &rOtherSet) const
 Test for subset
More...
 
bool faudes::TBaseSet< T, Cmp >::operator>= (const TBaseSet &rOtherSet) const
 Test for superset. More...
 
bool faudes::TBaseSet< T, Cmp >::operator< (const TBaseSet &rOtherSet) const
 Order for sorting containers of TBaseSet. More...
 
virtual const AttributeVoidfaudes::TBaseSet< T, Cmp >::AttributeType (void) const
 Attribute typeinfo. More...
 
virtual bool faudes::TBaseSet< T, Cmp >::AttributeTest (const Type &rAttr) const
 Attribute typeinfo. More...
 
Idx faudes::TBaseSet< T, Cmp >::AttributesSize (void) const
 Attribute access. More...
 
void faudes::TBaseSet< T, Cmp >::ClearAttributes (void)
 Attribute access. More...
 
bool faudes::TBaseSet< T, Cmp >::EqualAttributes (const TBaseSet &rOtherSet) const
 Attribute access. More...
 
virtual TBaseSetfaudes::TBaseSet< T, Cmp >::AssignWithoutAttributes (const TBaseSet &rSourceSet)
 Attribute access. More...
 
virtual void faudes::TBaseSet< T, Cmp >::Attributes (const TBaseSet &rOtherSet)
 Attributes access. More...
 
virtual AttributeVoidfaudes::TBaseSet< T, Cmp >::Attributep (const T &rElem)
 Attribute access. More...
 
virtual const AttributeVoidfaudes::TBaseSet< T, Cmp >::Attribute (const T &rElem) const
 Attribute access. More...
 
virtual void faudes::TBaseSet< T, Cmp >::Attribute (const T &rElem, const Type &rAttr)
 Attribute access. More...
 
virtual void faudes::TBaseSet< T, Cmp >::ClrAttribute (const T &rElem)
 Attribute access. More...
 
const AttributeVoidfaudes::TBaseSet< T, Cmp >::DoAttribute (const T &rElem) const
 get attribute from map (return null if elem does not exist in map) More...
 
AttributeVoidfaudes::TBaseSet< T, Cmp >::DoAttributeExplicit (const T &rElem)
 get attribute from map (insert explicit default if elem does not exist in map) More...
 
void faudes::TBaseSet< T, Cmp >::DoAttribute (const T &rElem, const Type *pAttr)
 set attribute in map (assume elem exists in set, NULL <=> set to default) More...
 

Variables

static std::set< T, Cmp > faudes::TBaseSet< T, Cmp >::msEmptySet =std::set<T,Cmp>()
 static empty STL set for default constructor More...
 
static std::map< T, AttributeVoid * > faudes::TBaseSet< T, Cmp >::msEmptyAttributes =std::map<T,AttributeVoid*>()
 static empty STL map for default constructor More...
 

Macro Definition Documentation

◆ BASE

#define BASE   Type

Definition at line 1153 of file cfl_baseset.h.

◆ TaStateSet

#define TaStateSet   TaIndexSet

Convenience Macro.

Definition at line 551 of file cfl_indexset.h.

◆ TEMP

#define TEMP   template<class T, class Cmp>

Definition at line 1152 of file cfl_baseset.h.

◆ THIS

#define THIS   TBaseSet<T,Cmp>

Definition at line 1151 of file cfl_baseset.h.

Typedef Documentation

◆ Alphabet

Convenience typedef for event sets with controllability attributes.

Definition at line 240 of file cfl_cgenerator.h.

◆ EventSet

Convenience typedef for plain event sets.

Definition at line 531 of file cfl_nameset.h.

◆ StateSet

Definition at line 271 of file cfl_indexset.h.

◆ TransSet

Type definition for default sorted TTransSet.

Definition at line 954 of file cfl_transset.h.

◆ TransSetEvX1X2

Type definition for ev, x1, x2 sorted TTransSet.

Definition at line 960 of file cfl_transset.h.

◆ TransSetEvX2X1

Type definition for ev, x2, x1 sorted TTransSet.

Definition at line 963 of file cfl_transset.h.

◆ TransSetX1EvX2

Type definition for default sorted TTransSet.

Definition at line 957 of file cfl_transset.h.

◆ TransSetX1X2Ev

Type definition for x1, x2, ev sorted TTransSet.

Definition at line 972 of file cfl_transset.h.

◆ TransSetX2EvX1

Type definition for x2, ev, x1 sorted TTransSet.

Definition at line 966 of file cfl_transset.h.

◆ TransSetX2X1Ev

Type definition for x2, x1, ev sorted TTransSet.

Definition at line 969 of file cfl_transset.h.

Function Documentation

◆ AssignWithoutAttributes()

template<class T , class Cmp >
TBaseSet< T, Cmp > & faudes::TBaseSet< T, Cmp >::AssignWithoutAttributes ( const TBaseSet< T, Cmp > &  rSourceSet)
virtual

Attribute access.

This virtual function provides an interface for derived classes with attributes eg TaIndexSet. The current implementation uses the DoAssign method and clears any attributes afterwards. Future implementations may be more efficient.

Parameters
rSourceSetSet to copy from

Definition at line 2237 of file cfl_baseset.h.

◆ AttachClient()

template<class T , class Cmp >
void faudes::TBaseSet< T, Cmp >::AttachClient ( TBaseSet< T, Cmp > *  pRef) const
inlineprotected

Record that we provide contents to some other BaseSet.

Definition at line 1542 of file cfl_baseset.h.

◆ AttachIterator()

template<class T , class Cmp >
void faudes::TBaseSet< T, Cmp >::AttachIterator ( Iterator pFit) const
inlineprotected

Record that an iterator refers to this TBaseSet.

Definition at line 1592 of file cfl_baseset.h.

◆ Attribute() [1/2]

template<class T , class Cmp >
const AttributeVoid & faudes::TBaseSet< T, Cmp >::Attribute ( const T &  rElem) const
virtual

Attribute access.

This virtual function provides an interface for derived classes with attributes eg TaIndexSet. The TBaseSet has no attributes and thus returns a void attribute. Derived classes that provide attributes are meant to return the attribute specified by rElem.

Parameters
rElemElement of which the attribute is requested
Returns
Attribute of specified element

Definition at line 2290 of file cfl_baseset.h.

◆ Attribute() [2/2]

template<class T , class Cmp >
void faudes::TBaseSet< T, Cmp >::Attribute ( const T &  rElem,
const Type rAttr 
)
virtual

Attribute access.

This virtual function provides an interface for derived classes with attributes eg TaIndexSet. The TBaseSet itself has void attributes and thus formally accepts any nontrivial attribute, however, ignoring any value. Derived classes that provide attributes are meant to set the attribute as specified. Only if the required cast to the actual attribute type fails an exception is thrown.

Parameters
rElemElement of which the attribute is to be set
rAttrAttribute value to set.
Exceptions
Exception
  • Element does not exist (60)
  • Cannot cast attribute type (63)

Definition at line 2297 of file cfl_baseset.h.

◆ Attributep()

template<class T , class Cmp >
AttributeVoid * faudes::TBaseSet< T, Cmp >::Attributep ( const T &  rElem)
virtual

Attribute access.

This virtual function provides an interface for derived classes with attributes eg TaIndexSet. The TBaseSet has no attributes and thus throws an exception. Derived classes that provide attributes are meant to return a pointer to the attribute specified by rElem.

Parameters
rElemElement of which the attribute is requested
Returns
Attribute of specified element
Exceptions
Exception
  • No attributes provided (id 63)

Definition at line 2279 of file cfl_baseset.h.

◆ Attributes()

template<class T , class Cmp >
void faudes::TBaseSet< T, Cmp >::Attributes ( const TBaseSet< T, Cmp > &  rOtherSet)
virtual

Attributes access.

This virtual function provides an interface for derived classes with attributes eg TaIndexSet. It copies attributes from the specified set, provided that they can be casted appropriately. Elements of this set which are not in rOtherSet maintain their attribute.

Parameters
rOtherSetOther BaseSet
Exceptions
Exception
  • Cannot cast attribute type (63)

Definition at line 2246 of file cfl_baseset.h.

◆ AttributesSize()

template<class T , class Cmp >
Idx faudes::TBaseSet< T, Cmp >::AttributesSize ( void  ) const

Attribute access.

This virtual function provides an interface for derived classes with attributes eg TaIndexSet. Provide the number of explicit attributes. The TBaseSet itself has no attributes and thus this function returns 0.

Definition at line 2182 of file cfl_baseset.h.

◆ AttributeTest()

template<class T , class Cmp >
bool faudes::TBaseSet< T, Cmp >::AttributeTest ( const Type rAttr) const
virtual

Attribute typeinfo.

This virtual function provides an interface for derived classes with attributes eg TaIndexSet. It tests whether this set accepts the specified attribute type ie whether it can be casted. The test is performned by the Cast function of the attribute type returned by AttributeType().

Parameters
rAttrAttribute type to test.
Returns
True, if attribute type is accepted.

Definition at line 2177 of file cfl_baseset.h.

◆ AttributeType()

template<class T , class Cmp >
const AttributeVoid * faudes::TBaseSet< T, Cmp >::AttributeType ( void  ) const
virtual

◆ Begin()

template<class T , class Cmp >
TBaseSet< T, Cmp >::Iterator faudes::TBaseSet< T, Cmp >::Begin ( void  ) const
inline

Iterator to the begin of set.

Returns
Iterator

Definition at line 1891 of file cfl_baseset.h.

◆ Clear()

template<class T , class Cmp >
void faudes::TBaseSet< T, Cmp >::Clear ( void  )
virtual

Clear all set.

Reimplemented from faudes::Type.

Definition at line 1902 of file cfl_baseset.h.

◆ ClearAttributes()

template<class T , class Cmp >
void faudes::TBaseSet< T, Cmp >::ClearAttributes ( void  )

Attribute access.

This virtual function provides an interface for derived classes with attributes eg TaIndexSet. The TBaseSet itself has no attributes and thus this function does nothing.

Definition at line 2187 of file cfl_baseset.h.

◆ ClrAttribute()

template<class T , class Cmp >
void faudes::TBaseSet< T, Cmp >::ClrAttribute ( const T &  rElem)
virtual

Attribute access.

Cleras an explicit attribute associated with the specified element if sucht attribute exists. The TBaseSet itself has no attributes and thus this function will do nothing.

Parameters
rElemElement of which the attribute is to be cleared

Definition at line 2317 of file cfl_baseset.h.

◆ Detach()

template<class T , class Cmp >
void faudes::TBaseSet< T, Cmp >::Detach ( DetachMode  flag = AttrIncl) const

Definition at line 1331 of file cfl_baseset.h.

◆ DetachClient()

template<class T , class Cmp >
void faudes::TBaseSet< T, Cmp >::DetachClient ( TBaseSet< T, Cmp > *  pRef) const
inlineprotected

Record that we stop providing data for some TBaseSet.

Definition at line 1550 of file cfl_baseset.h.

◆ DetachIterator()

template<class T , class Cmp >
void faudes::TBaseSet< T, Cmp >::DetachIterator ( Iterator pFit) const
inlineprotected

Record that an iterator stops to refer to this TBaseSet.

Definition at line 1599 of file cfl_baseset.h.

◆ Disjoint()

template<class T , class Cmp >
bool faudes::TBaseSet< T, Cmp >::Disjoint ( const TBaseSet< T, Cmp > &  rOtherSet) const
virtual

Test for this set to be disjoint witg other set.

Parameters
rOtherSetSet of elements to keep

Definition at line 2089 of file cfl_baseset.h.

◆ DoAssign()

template<class T , class Cmp >
void faudes::TBaseSet< T, Cmp >::DoAssign ( const TBaseSet< T, Cmp > &  rSourceSet)
protected

assign my members

Definition at line 1261 of file cfl_baseset.h.

◆ DoAttribute() [1/2]

template<class T , class Cmp >
const AttributeVoid * faudes::TBaseSet< T, Cmp >::DoAttribute ( const T &  rElem) const
protected

get attribute from map (return null if elem does not exist in map)

Definition at line 2324 of file cfl_baseset.h.

◆ DoAttribute() [2/2]

template<class T , class Cmp >
void faudes::TBaseSet< T, Cmp >::DoAttribute ( const T &  rElem,
const Type pAttr 
)
protected

set attribute in map (assume elem exists in set, NULL <=> set to default)

Definition at line 2352 of file cfl_baseset.h.

◆ DoAttributeExplicit()

template<class T , class Cmp >
AttributeVoid * faudes::TBaseSet< T, Cmp >::DoAttributeExplicit ( const T &  rElem)
protected

get attribute from map (insert explicit default if elem does not exist in map)

Definition at line 2332 of file cfl_baseset.h.

◆ DoDWrite()

template<class T , class Cmp >
void faudes::TBaseSet< T, Cmp >::DoDWrite ( TokenWriter rTw,
const std::string &  rLabel = "",
const Type pContext = 0 
) const
protectedvirtual

Token output, debugging see Type::DWrite for public wrappers.

Reimplement this function in derived classes for specific specific template parameters.

Parameters
rTwReference to TokenWriter
rLabelLabel of section to write, defaults to name of set
pContextWrite context to provide contextual information

Reimplemented from faudes::Type.

Reimplemented in faudes::NameSet.

Definition at line 1842 of file cfl_baseset.h.

◆ DoEqual()

template<class T , class Cmp >
bool faudes::TBaseSet< T, Cmp >::DoEqual ( const TBaseSet< T, Cmp > &  rOtherSet) const
protected

test equality

Definition at line 2144 of file cfl_baseset.h.

◆ DoRead()

template<class T , class Cmp >
void faudes::TBaseSet< T, Cmp >::DoRead ( TokenReader rTr,
const std::string &  rLabel = "",
const Type pContext = 0 
)
protectedvirtual

Token input, see Type::Read for public wrappers.

Reimplement this function in derived classes for specific specific template parameters. By convention, the default label "" should be translated to some meaningful default, eg "IndexSet" for a set of indices". The pContext pointer can de type-checked and interpreted, ie as a symboltable to provide symbolic names. It is also passed on to attributes.

Parameters
rTrReference to TokenReader
rLabelLabel of section to read, defaults to name of set
pContextRead context to provide contextual information

Reimplemented from faudes::Type.

Reimplemented in faudes::NameSet, faudes::SymbolSet, and faudes::IndexSet.

Definition at line 1875 of file cfl_baseset.h.

◆ DoSWrite()

template<class T , class Cmp >
void faudes::TBaseSet< T, Cmp >::DoSWrite ( TokenWriter rTw) const
protectedvirtual

Token output, see Type::SWrite for public wrappers.

Statistics include size, name and attributey type. The latter is retrieved from the RTI, if initialized. Dereived sets may reimplement this method.

Parameters
rTwReference to TokenWriter

Reimplemented from faudes::Type.

Definition at line 1860 of file cfl_baseset.h.

◆ DoWrite()

template<class T , class Cmp >
void faudes::TBaseSet< T, Cmp >::DoWrite ( TokenWriter rTw,
const std::string &  rLabel = "",
const Type pContext = 0 
) const
protectedvirtual

Token output, see Type::DWrite for public wrappers.

Reimplement this function in derived classes for specific specific template parameters. By convention, the default label "" should be translated to a) the name of the set or b) some meaningful default, eg "IndexSet" for a set of indices. The pContext pointer can de type-checked and interpreted, ie as a symboltable to provide symbolic names. It is also passed on to attributes.

Parameters
rTwReference to TokenWriter
rLabelLabel of section to write, defaults to name of set
pContextWrite context to provide contextual information

Reimplemented from faudes::Type.

Reimplemented in faudes::SymbolSet, faudes::NameSet, faudes::IndexSet, faudes::TTransSet< Cmp >, and faudes::TTransSet< TransSort::X1EvX2 >.

Definition at line 1830 of file cfl_baseset.h.

◆ DValid()

template<class T , class Cmp >
void faudes::TBaseSet< T, Cmp >::DValid ( const std::string &  rMessage = "") const

Some validation of deferred copy mechanism (provoke abort)

Definition at line 1606 of file cfl_baseset.h.

◆ Empty()

template<class T , class Cmp >
bool faudes::TBaseSet< T, Cmp >::Empty ( void  ) const

Test whether if the TBaseSet is Empty.

Returns
True if empty

Definition at line 1824 of file cfl_baseset.h.

◆ End()

template<class T , class Cmp >
TBaseSet< T, Cmp >::Iterator faudes::TBaseSet< T, Cmp >::End ( void  ) const
inline

Iterator to the end of set.

Returns
Iterator

Definition at line 1896 of file cfl_baseset.h.

◆ EqualAttributes()

template<class T , class Cmp >
bool faudes::TBaseSet< T, Cmp >::EqualAttributes ( const TBaseSet< T, Cmp > &  rOtherSet) const

Attribute access.

Test whether attributes match with other set, and return true if attributes match for shared elements. It uses the equality test of individual attributes and, hence, requires the attribute type match too.

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

Definition at line 2196 of file cfl_baseset.h.

◆ Erase() [1/2]

template<class T , class Cmp >
TBaseSet< T, Cmp >::Iterator faudes::TBaseSet< T, Cmp >::Erase ( const Iterator pos)
virtual

Erase element by iterator.

Parameters
posIterator to specify element
Returns
Iterator to next element (or End if no such)

Reimplemented in faudes::TTransSet< Cmp >, and faudes::TTransSet< TransSort::X1EvX2 >.

Definition at line 2026 of file cfl_baseset.h.

◆ Erase() [2/2]

template<class T , class Cmp >
bool faudes::TBaseSet< T, Cmp >::Erase ( const T &  rElem)
virtual

Erase element by reference.

Parameters
rElemElement to erase
Returns
True if element used to exist

Definition at line 2019 of file cfl_baseset.h.

◆ EraseSet()

template<class T , class Cmp >
void faudes::TBaseSet< T, Cmp >::EraseSet ( const TBaseSet< T, Cmp > &  rOtherSet)
virtual

Erase elements given by other set.

Parameters
rOtherSetSet of elements to erase

Definition at line 2042 of file cfl_baseset.h.

◆ Exists()

template<class T , class Cmp >
bool faudes::TBaseSet< T, Cmp >::Exists ( const T &  rElem) const

Test existence of element.

Parameters
rElemElement to test
Returns
True if element exists in set

Definition at line 2115 of file cfl_baseset.h.

◆ Find()

template<class T , class Cmp >
TBaseSet< T, Cmp >::Iterator faudes::TBaseSet< T, Cmp >::Find ( const T &  rElem) const

Find element and return iterator.

Parameters
rElemElement to find
Returns
Iterator to element or End() if nonexistent

Definition at line 2110 of file cfl_baseset.h.

◆ Inject() [1/2]

template<class T , class Cmp >
TBaseSet< T, Cmp >::Iterator faudes::TBaseSet< T, Cmp >::Inject ( const Iterator pos,
const T &  rElem 
)
virtual

Insert specified element.

Parameters
posInsertion hint passed to STL
rElemElement to insert
Returns
Insertion position

Definition at line 1973 of file cfl_baseset.h.

◆ Inject() [2/2]

template<class T , class Cmp >
void faudes::TBaseSet< T, Cmp >::Inject ( const T &  rElem)
virtual

Insert specified element.

Parameters
rElemElement to insert

Definition at line 1981 of file cfl_baseset.h.

◆ Insert()

template<class T , class Cmp >
bool faudes::TBaseSet< T, Cmp >::Insert ( const T &  rElem)
virtual

Insert specified element.

Parameters
rElemElement to insert
Returns
True if index was new to set

Definition at line 1960 of file cfl_baseset.h.

◆ InsertSet()

template<class T , class Cmp >
void faudes::TBaseSet< T, Cmp >::InsertSet ( const TBaseSet< T, Cmp > &  rOtherSet)
virtual

Insert elements given by rOtherSet.

Parameters
rOtherSetSet of elements to insert

Definition at line 1987 of file cfl_baseset.h.

◆ Lock()

template<class T , class Cmp >
void faudes::TBaseSet< T, Cmp >::Lock ( void  ) const

Detach and lock any further reallocation.

Definition at line 1462 of file cfl_baseset.h.

◆ Name() [1/2]

template<class T , class Cmp >
void faudes::TBaseSet< T, Cmp >::Name ( const std::string &  rName)
virtual

Set name of TBaseSet.

Parameters
rNameName to set

Reimplemented from faudes::Type.

Definition at line 1760 of file cfl_baseset.h.

◆ Name() [2/2]

template<class T , class Cmp >
const std::string & faudes::TBaseSet< T, Cmp >::Name ( void  ) const
virtual

Return name of TBaseSet.

Returns
Name of TBaseSet

Reimplemented from faudes::Type.

Definition at line 1755 of file cfl_baseset.h.

◆ operator*()

template<class T , class Cmp >
TBaseSet< T, Cmp > faudes::TBaseSet< T, Cmp >::operator* ( const TBaseSet< T, Cmp > &  rOtherSet) const

Set intersection operator.

Returns
Intersection Set

Definition at line 2136 of file cfl_baseset.h.

◆ operator+()

template<class T , class Cmp >
TBaseSet< T, Cmp > faudes::TBaseSet< T, Cmp >::operator+ ( const TBaseSet< T, Cmp > &  rOtherSet) const

Set union operator.

Returns
Union Set

Definition at line 2121 of file cfl_baseset.h.

◆ operator-()

template<class T , class Cmp >
TBaseSet< T, Cmp > faudes::TBaseSet< T, Cmp >::operator- ( const TBaseSet< T, Cmp > &  rOtherSet) const

Set difference operator.

Returns
Difference Set

Definition at line 2128 of file cfl_baseset.h.

◆ operator<()

template<class T , class Cmp >
bool faudes::TBaseSet< T, Cmp >::operator< ( const TBaseSet< T, Cmp > &  rOtherSet) const

Order for sorting containers of TBaseSet.

Definition at line 2165 of file cfl_baseset.h.

◆ operator<=()

template<class T , class Cmp >
bool faudes::TBaseSet< T, Cmp >::operator<= ( const TBaseSet< T, Cmp > &  rOtherSet) const

Test for subset

Definition at line 2153 of file cfl_baseset.h.

◆ operator>=()

template<class T , class Cmp >
bool faudes::TBaseSet< T, Cmp >::operator>= ( const TBaseSet< T, Cmp > &  rOtherSet) const

Test for superset.

Definition at line 2159 of file cfl_baseset.h.

◆ RelinkClients()

template<class T , class Cmp >
void faudes::TBaseSet< T, Cmp >::RelinkClients ( void  )
inlineprotected

Ensure that we do not host contents to anyone else.

Definition at line 1493 of file cfl_baseset.h.

◆ RestrictSet()

template<class T , class Cmp >
void faudes::TBaseSet< T, Cmp >::RestrictSet ( const TBaseSet< T, Cmp > &  rOtherSet)
virtual

Restrict elements given by other set.

Parameters
rOtherSetSet of elements to keep

Definition at line 2064 of file cfl_baseset.h.

◆ SetDifference()

template<class T , class Cmp >
void faudes::SetDifference ( const TBaseSet< T, Cmp > &  rSetA,
const TBaseSet< T, Cmp > &  rSetB,
TBaseSet< T, Cmp > &  rRes 
)

Definition at line 1078 of file cfl_baseset.h.

◆ SetEquality()

template<class T , class Cmp >
bool faudes::SetEquality ( const TBaseSet< T, Cmp > &  rSetA,
const TBaseSet< T, Cmp > &  rSetB 
)

Definition at line 1112 of file cfl_baseset.h.

◆ SetInclusion()

template<class T , class Cmp >
bool faudes::SetInclusion ( const TBaseSet< T, Cmp > &  rSetA,
const TBaseSet< T, Cmp > &  rSetB 
)

Definition at line 1128 of file cfl_baseset.h.

◆ SetIntersection()

template<class T , class Cmp >
void faudes::SetIntersection ( const TBaseSet< T, Cmp > &  rSetA,
const TBaseSet< T, Cmp > &  rSetB,
TBaseSet< T, Cmp > &  rRes 
)

Definition at line 1049 of file cfl_baseset.h.

◆ SetUnion()

template<class T , class Cmp >
void faudes::SetUnion ( const TBaseSet< T, Cmp > &  rSetA,
const TBaseSet< T, Cmp > &  rSetB,
TBaseSet< T, Cmp > &  rRes 
)

Definition at line 1019 of file cfl_baseset.h.

◆ Size()

template<class T , class Cmp >
Idx faudes::TBaseSet< T, Cmp >::Size ( void  ) const

Get Size of TBaseSet.

Returns
Number of indices in TBaseSet

Definition at line 1819 of file cfl_baseset.h.

◆ Str()

template<class T , class Cmp >
std::string faudes::TBaseSet< T, Cmp >::Str ( const T &  rElem) const
virtual

Return pretty printable element.

Reimplement this method for derived classes.

Parameters
rElemElement to print
Returns
String

Definition at line 1812 of file cfl_baseset.h.

◆ TBaseSet() [1/3]

template<class T , class Cmp >
faudes::TBaseSet< T, Cmp >::TBaseSet ( const std::string &  rFilename,
const std::string &  rLabel = "BaseSet" 
)

Constructor from file.

This constructor indicates the intended interface for derived classes. The base set itself cannot read from token streams.

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

Definition at line 1194 of file cfl_baseset.h.

◆ TBaseSet() [2/3]

template<class T , class Cmp >
faudes::TBaseSet< T, Cmp >::TBaseSet ( const TBaseSet< T, Cmp > &  rOtherSet)

Copy-constructor.

Parameters
rOtherSetSource to copy from

Definition at line 1215 of file cfl_baseset.h.

◆ TBaseSet() [3/3]

template<class T , class Cmp >
faudes::TBaseSet< T, Cmp >::TBaseSet ( void  )

Constructor.

Definition at line 1175 of file cfl_baseset.h.

◆ ThisIterator()

template<class T , class Cmp >
TBaseSet< T, Cmp >::Iterator faudes::TBaseSet< T, Cmp >::ThisIterator ( const typename std::set< T, Cmp >::const_iterator sit) const
protected

Convert STL iterator to API iterator.

Definition at line 1886 of file cfl_baseset.h.

◆ TypeDefinitionp()

template<class T , class Cmp >
const TypeDefinition * faudes::TBaseSet< T, Cmp >::TypeDefinitionp ( void  ) const
protectedvirtual

Reimplment from type to use chache.

Reimplemented from faudes::Type.

Definition at line 1767 of file cfl_baseset.h.

◆ TypeName() [1/2]

template<class T , class Cmp >
void faudes::TBaseSet< T, Cmp >::TypeName ( const std::string &  rType)
virtual

Overwrite faudes-type name.

This method is used to overwrite the faudes-type identifyer.

Parameters
rTypeFaudes-type name to set

Definition at line 1806 of file cfl_baseset.h.

◆ TypeName() [2/2]

template<class T , class Cmp >
const std::string & faudes::TBaseSet< T, Cmp >::TypeName ( void  ) const
virtual

Get objects's type name.

Retrieve the faudes-type name from the type registry. Sets allow to overwrite the faudes-type identifier. This is allows for light-weight derived classes that do not need to be registered.

Returns
Faudes-type name or empty string.

Reimplemented from faudes::Type.

Definition at line 1795 of file cfl_baseset.h.

◆ Valid()

template<class T , class Cmp >
bool faudes::TBaseSet< T, Cmp >::Valid ( const T &  rElem) const
inlinevirtual

Test validty of candidate element.

Reimplement this function for particular type T of elements, eg for an index set with T=Idx indicate 0 an invalid index.

Parameters
rElemCandidate to test
Returns
True if element is valid

Definition at line 1954 of file cfl_baseset.h.

◆ XElementTag() [1/2]

template<class T , class Cmp >
void faudes::TBaseSet< T, Cmp >::XElementTag ( const std::string &  rTag)
virtual

Configure the element name tag.

This method allows to overwrite the tag used for elements in XML IO. For usual, you will register derived class with the run-time-interface and set the elemen tag for XML IO.

Parameters
rTagName to set

Definition at line 1789 of file cfl_baseset.h.

◆ XElementTag() [2/2]

template<class T , class Cmp >
const std::string & faudes::TBaseSet< T, Cmp >::XElementTag ( void  ) const
protectedvirtual

Get name of elements (used for XML IO)

Definition at line 1777 of file cfl_baseset.h.

◆ ~TBaseSet()

template<class T , class Cmp >
faudes::TBaseSet< T, Cmp >::~TBaseSet ( void  )
virtual

Virtual destructor.

Definition at line 1237 of file cfl_baseset.h.

Variable Documentation

◆ msEmptyAttributes

template<class T , class Cmp >
std::map< T, AttributeVoid * > faudes::TBaseSet< T, Cmp >::msEmptyAttributes =std::map<T,AttributeVoid*>()
staticprotected

static empty STL map for default constructor

Definition at line 986 of file cfl_baseset.h.

◆ msEmptySet

template<class T , class Cmp >
std::set< T, Cmp > faudes::TBaseSet< T, Cmp >::msEmptySet =std::set<T,Cmp>()
staticprotected

static empty STL set for default constructor

Definition at line 983 of file cfl_baseset.h.

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