|
#include <cfl_baseset.h>
|
| TBaseSet (void) |
|
| TBaseSet (const TBaseSet &rOtherSet) |
|
| TBaseSet (const std::string &rFilename, const std::string &rLabel="BaseSet") |
|
virtual | ~TBaseSet (void) |
|
const std::string & | Name (void) const |
|
void | Name (const std::string &rName) |
|
virtual void | Clear (void) |
|
Idx | Size (void) const |
|
bool | Empty (void) const |
|
virtual std::string | Str (const T &rElem) const |
|
Iterator | Begin (void) const |
|
Iterator | End (void) const |
|
virtual bool | Valid (const T &rElem) const |
|
virtual bool | Erase (const T &rElem) |
|
virtual Iterator | Erase (const Iterator &pos) |
|
virtual void | EraseSet (const TBaseSet &rOtherSet) |
|
virtual void | RestrictSet (const TBaseSet &rOtherSet) |
|
virtual bool | Disjoint (const TBaseSet &rOtherSet) const |
|
virtual bool | Insert (const T &rElem) |
|
virtual Iterator | Inject (const Iterator &pos, const T &rElem) |
|
virtual void | Inject (const T &rElem) |
|
virtual void | InsertSet (const TBaseSet &rOtherSet) |
|
bool | Exists (const T &rElem) const |
|
Iterator | Find (const T &rElem) const |
|
TBaseSet | operator+ (const TBaseSet &rOtherSet) const |
|
TBaseSet | operator- (const TBaseSet &rOtherSet) const |
|
TBaseSet | operator* (const TBaseSet &rOtherSet) const |
|
bool | operator<= (const TBaseSet &rOtherSet) const |
|
bool | operator>= (const TBaseSet &rOtherSet) const |
|
bool | operator< (const TBaseSet &rOtherSet) const |
|
void | DValid (const std::string &rMessage="") const |
|
void | Detach (DetachMode flag=AttrIncl) const |
|
void | Lock (void) const |
|
virtual const AttributeVoid * | AttributeType (void) const |
|
virtual bool | AttributeTest (const Type &rAttr) const |
|
virtual TBaseSet & | AssignWithoutAttributes (const TBaseSet &rSourceSet) |
|
virtual void | Attributes (const TBaseSet &rOtherSet) |
|
Idx | AttributesSize (void) const |
|
void | ClearAttributes (void) |
|
bool | EqualAttributes (const TBaseSet &rOtherSet) const |
|
virtual AttributeVoid * | Attributep (const T &rElem) |
|
virtual const AttributeVoid & | Attribute (const T &rElem) const |
|
virtual void | Attribute (const T &rElem, const Type &rAttr) |
|
virtual void | AttributeTry (const T &rElem, const Type &rAttr) |
|
virtual void | ClrAttribute (const T &rElem) |
|
virtual void | XElementTag (const std::string &rTag) |
|
virtual const std::string & | TypeName (void) const |
|
virtual void | TypeName (const std::string &rType) |
|
Type & | operator= (const Type &rSrc) |
|
bool | operator== (const Type &rOther) const |
|
bool | operator!= (const Type &rOther) const |
|
| Type (void) |
|
| Type (const Type &rType) |
|
virtual | ~Type (void) |
|
virtual Type * | New (void) const |
|
virtual Type * | Copy (void) const |
|
virtual const Type * | Cast (const Type *pOther) const |
|
virtual Type & | Assign (const Type &rSrc) |
|
Type & | operator= (const Type &rSrc) |
|
virtual bool | Equal (const Type &rOther) const |
|
bool | operator== (const Type &rOther) const |
|
bool | operator!= (const Type &rOther) const |
|
void | Write (const Type *pContext=0) const |
|
void | Write (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0, std::ios::openmode openmode=std::ios::out|std::ios::trunc) const |
|
void | Write (const std::string &pFileName, std::ios::openmode openmode) const |
|
void | Write (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
|
virtual void | XWrite (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0) const |
|
void | XWrite (const Type *pContext=0) const |
|
void | XWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
|
std::string | ToString (const std::string &rLabel="", const Type *pContext=0) const |
|
std::string | ToText (const std::string &rLabel="", const Type *pContext=0) const |
|
void | DWrite (const Type *pContext=0) const |
|
void | DWrite (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0, std::ios::openmode openmode=std::ios::out|std::ios::trunc) const |
|
void | DWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
|
void | SWrite (TokenWriter &rTw) const |
|
void | SWrite (void) const |
|
std::string | ToSText (void) const |
|
void | Read (const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0) |
|
void | FromString (const std::string &rString, const std::string &rLabel="", const Type *pContext=0) |
|
void | Read (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0) |
|
|
virtual void | DoWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
|
virtual void | DoDWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
|
virtual void | DoSWrite (TokenWriter &rTw) const |
|
virtual void | DoRead (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0) |
|
void | DoAssign (const TBaseSet &rSourceSet) |
|
bool | DoEqual (const TBaseSet &rOtherSet) const |
|
void | DoAttribute (const T &rElem, const Type *pAttr) |
|
const AttributeVoid * | DoAttribute (const T &rElem) const |
|
AttributeVoid * | DoAttributeExplicit (const T &rElem) |
|
TBaseSet< T, Cmp >::Iterator | ThisIterator (const typename std::set< T, Cmp >::const_iterator &sit) const |
|
void | RelinkClients (void) |
|
void | AttachClient (TBaseSet *pRef) const |
|
void | DetachClient (TBaseSet *pRef) const |
|
void | AttachIterator (Iterator *pFit) const |
|
void | DetachIterator (Iterator *pFit) const |
|
virtual const TypeDefinition * | TypeDefinitionp (void) const |
|
virtual const std::string & | XElementTag (void) const |
|
void | DoAssign (const Type &rSrc) |
|
bool | DoEqual (const Type &rOther) const |
|
virtual void | DoXWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
|
virtual Token | XBeginTag (const std::string &rLabel="", const std::string &rFallbackLabel="") const |
|
|
template<class TP , class AP , class CP > |
class | TAttrMap |
|
template<class T, class Cmp = std::less<T>>
class faudes::TBaseSet< T, Cmp >
STL style set template. This class template is built on top of the STL set template. It provides essentials of the STL interface relevant to libFAUDES plus a deferred copy mechanism, aka copy-on-write. TBaseSet serves as a base class for all libFaudes containers:
The public functions of a TBaseSet provide the high-level api, with the intention to organize the deferred copy machanism in a transparent manner. Since STL iterators refer to a particular STL container, they become invalid when the internal container is copied. Therefor, TBaseSet tracks iterators and fixes them when the actual copy takes place. This introduces some runtime overhead, in particular when your application represents subsets as sets of iterators. You may use the public method Lock() to enforce a full copy and to prevent any further re-allocation.
Alternatively to the high-level api, a protected low-level api is provided with direct access to the internal STL set. When using this api, it is up to the derived class to ensure that the BaseSet gets detached from its refernces befor write operations can take place.
The virtual function TBaseSet<T>::Valid() is used to indicate whether a candidate element is valid as a set member. If the macro FAUDES_CHECKED is defined, the attempt to insert an invalid element triggers an exception (id 61). Invalid iterators throw an exception (id 62) when used as an argument to a BaseSet function.
The TBaseSet also hosts a container to associate an attribute with each set element. However, in the plain TBAseSey the attribute type is set to void and member methods only deal with attributes when this does not invilve too much overhead. To make effective use of attributes, one is meant to derive a class from TBaseSet that encodes the actual attribute type and that provides appropriate access methods. This is facilitated by the class TAttrMap.
Note on a boring technical detail: since STL sets are sorted, effectively all set iterators should be const. However, there is a minor issue whether or not the erase function should use a const iterator as argument. SGI derived STL implementations (as used on most GNU systems) avoid this issue by defining const and non-const iterators on sets as identical types. MS implementation (used in VS C++ by default, as of 2006) differ in this aspect. The class TBaseSet::Iterator hides the issue from the faudes API but it is still present internaly.
Definition at line 98 of file cfl_baseset.h.
◆ aiterator
template<class T , class Cmp = std::less<T>>
STL attribute iterator, non-const version
Definition at line 942 of file cfl_baseset.h.
◆ const_aiterator
template<class T , class Cmp = std::less<T>>
STL attribute iterator, const version
Definition at line 945 of file cfl_baseset.h.
◆ const_iterator
template<class T , class Cmp = std::less<T>>
◆ iterator
template<class T , class Cmp = std::less<T>>
◆ DetachMode
template<class T , class Cmp = std::less<T>>
Detach from extern storage (incl allocation and true copy)
Enumerator |
---|
SetOnly | |
AttrIncl | |
Definition at line 376 of file cfl_baseset.h.
◆ AttributeTry()
template<class T , class Cmp = std::less<T>>
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
-
rElem | Element of which the attribute is to be set |
rAttr | Attribute value to set. |
Reimplemented in faudes::TaTransSet< Attr >, faudes::TaNameSet< Attr >, faudes::TaNameSet< faudes::AttributeFailureEvents >, faudes::TaNameSet< AttributeSimCondition >, faudes::TaNameSet< faudes::AttributeSignalEvent >, faudes::TaNameSet< faudes::AttributeSimplenetEvent >, faudes::TaNameSet< EventAttr >, faudes::TaNameSet< SimEventAttribute >, faudes::TaIndexSet< Attr >, faudes::TaIndexSet< StateAttr >, and faudes::TaIndexSet< faudes::DiagLabelSet >.
Definition at line 787 of file cfl_baseset.h.
◆ operator!=()
template<class T , class Cmp = std::less<T>>
bool faudes::Type::operator!= |
Test equality of configuration data. See operator==(const Type&).
This method calls the virtual method DoEqual(). Re-implementation can be done via the convenience macros FAUDES_TYPE_DECLARATION and FAUDES_TYPE_IMPLEMENTATION.
- Parameters
-
rOther | Other objevt to compare with. |
- Returns
- True on mismatch.
Definition at line 391 of file cfl_types.cpp.
◆ operator=()
template<class T , class Cmp = std::less<T>>
Type & faudes::Type::operator= |
Assign configurationdata from other object. Derived classes should implement the operator form for the assignment for each source type which allows for a non-trivial assignment. This includes the particular case were the source and destination types match exactly. In the latter case the DoAssign method should be invoked. In contrast to the Assign function, the operator form must not be reimplemented for missmatched source types: the operator form only accepts sensible source types. This allows for compiletime typeckecking. However, the downside is that when the type is not known at compiletime, configuration is not properly assigned.
Re-implementation can be done via the convenience macros FAUDES_TYPE_DECLARATION and FAUDES_TYPE_IMPLEMENTATION.
- Parameters
-
- Returns
- Reference to this object.
Definition at line 340 of file cfl_types.cpp.
◆ operator==()
template<class T , class Cmp = std::less<T>>
bool faudes::Type::operator== |
Test equality of configuration data. The operator form of the equality test is only defined for matching types, no cast will be performed. Thus, the test will be optimistic if the type is not known at compiletime. The object name or id is not considered in the test.
This methoc calls the virtual method DoEqual(). Re-implementation can be done via the convenience macros FAUDES_TYPE_DECLARATION and FAUDES_TYPE_IMPLEMENTATION.
- Parameters
-
rOther | Other object to compare with. |
- Returns
- True on match.
Definition at line 375 of file cfl_types.cpp.
◆ TAttrMap
template<class T , class Cmp = std::less<T>>
template<class TP , class AP , class CP >
allow access to attribute interface class
Definition at line 109 of file cfl_baseset.h.
◆ mClientRecord
template<class T , class Cmp = std::less<T>>
◆ mDetached
template<class T , class Cmp = std::less<T>>
Indicate "hosts data to myself only"
Definition at line 960 of file cfl_baseset.h.
◆ mFaudesTypeName
template<class T , class Cmp = std::less<T>>
◆ mIterators
template<class T , class Cmp = std::less<T>>
◆ mLocked
template<class T , class Cmp = std::less<T>>
Indicate "dont re-allocate the STL set ever again"
Definition at line 963 of file cfl_baseset.h.
◆ mMyName
template<class T , class Cmp = std::less<T>>
◆ mpAttributes
template<class T , class Cmp = std::less<T>>
Attribute map, if this object hosts data (else NULL).
Definition at line 939 of file cfl_baseset.h.
◆ mpClients
template<class T , class Cmp = std::less<T>>
BaseSets, that use data hosted by us (NULL if we dont host data, emptyset if we host to ourself excl.)
Definition at line 957 of file cfl_baseset.h.
◆ mpSet
template<class T , class Cmp = std::less<T>>
STL set, if this object hosts data (else NULL)
Definition at line 922 of file cfl_baseset.h.
◆ mXElementTag
template<class T , class Cmp = std::less<T>>
Current/cached name of elements (use protected accessor methods for caching)
Definition at line 1009 of file cfl_baseset.h.
◆ mXElementTagDef
template<class T , class Cmp = std::less<T>>
Defauft name of elements (if not over written by registry)
Definition at line 1014 of file cfl_baseset.h.
◆ pAttributes
template<class T , class Cmp = std::less<T>>
Pointer to attribute map to operate on
Definition at line 936 of file cfl_baseset.h.
◆ pHostSet
template<class T , class Cmp = std::less<T>>
Pointer on BaseSet that hosts our data (THIS if we host)
Definition at line 951 of file cfl_baseset.h.
◆ pSet
template<class T , class Cmp = std::less<T>>
◆ pTypeDefinition
template<class T , class Cmp = std::less<T>>
The documentation for this class was generated from the following file:
libFAUDES 2.33c
--- 2025.05.15
--- c++ api documentaion by doxygen
|