Detailed Description

template<class Cmp = TransSort::X1EvX2>
class faudes::TTransSet< Cmp >

Set of Transitions.

This container class provides similar functionality and interface as BaseSet, but for Transitions rather than indices. The additional feature is a template parameter that allows to specify alternative sorting. For algorithms that examine a transition relation by e.g. the successor state X2, it may be worthwhile to copy a given TTransRel<TransSort::X1EvX2> to a TTransRel<TransSort::X2EvX1>. Example, assuming some transition relation is given in default order

TransSet transrel; // transrel default order X1-Ev-X2
// ... some operation to set up transrel
TTransSet<TransSort::X2EvX1> transByX2; // alternative order X2-Ev-X1
transrel.ReSort(transByX2); // copy and re-order transrel
Iterator tit =transByX2.BeginByX2(x2) // begin iterator, X2 specified
Iterator tit_end=transByX2.EndByX2(x2) // end iterator, X2 specified
for(; tit!=tit_end; ++tit) { // loop over all transitions with specified x2
// ... code to examine tramsitions with specified x2
}
TBaseSet< Transition, Cmp >::Iterator Iterator
Iterator on transition.
Definition: cfl_transset.h:273
void ReSort(TTransSet< OtherCmp > &res) const
Get copy of trantision relation sorted by other compare operator, e.g.
TTransSet< TransSort::X1EvX2 > TransSet
Type definition for default sorted TTransSet.
Definition: cfl_transset.h:956

Note: it is the context of a Generator that actually allows to interpret a TTransSet as a set of transitions as opposed to a set of triples of indices. In particular, file IO of transitions is provided by the generator class (although TTransSet provides basic output functions for debugging)

Definition at line 242 of file cfl_transset.h.

#include <cfl_transset.h>

Public Types

typedef TBaseSet< Transition, Cmp >::Iterator Iterator
 Iterator on transition. More...
 
- Public Types inherited from faudes::TBaseSet< Transition, TransSort::X1EvX2 >
enum  DetachMode
 Detach from extern storage (incl allocation and true copy) More...
 

Public Member Functions

Constructors & Destructor
 TTransSet (void)
 Construct an empty TTransSet object. More...
 
 TTransSet (const TTransSet< Cmp > &rOtherSet)
 Copy-constructor. More...
 
template<class OtherCmp >
 TTransSet (const TTransSet< OtherCmp > &res)
 Re-Sort Copy-constructor. More...
 
virtual ~TTransSet ()
 Virtual destructor. More...
 
Accessing individual transitions
bool Insert (const Transition &rTransition)
 Add a Transition. More...
 
bool Insert (Idx x1, Idx ev, Idx x2)
 Add a Transition by indices. More...
 
Iterator Inject (const Iterator &pos, const Transition &rTransition)
 Add a Transition. More...
 
void Inject (const Transition &rTransition)
 Add a Transition. More...
 
bool Erase (const Transition &t)
 Remove a Transition. More...
 
bool Erase (Idx x1, Idx ev, Idx x2)
 Remove a Transition by x1, ev, x2. More...
 
Iterator Erase (const Iterator &it)
 Remove a Transition by iterator. More...
 
void EraseByX1 (Idx x1)
 Remove all transitions containing predecessor state x1. More...
 
void EraseByX1Ev (Idx x1, Idx ev)
 Remove all transitions containing predecessor state x1 and event ev. More...
 
void EraseByX2 (Idx x2)
 Remove all transitions containing successor state x2. More...
 
void EraseByEv (Idx ev)
 Remove all transitions containing event ev. More...
 
void EraseByX1OrX2 (Idx x)
 Remove all transitions containing state x, This function iterates over all transitions to work with any sorting. More...
 
void EraseByX1OrX2 (const StateSet &rStates)
 Remove all transitions containing a specified state. More...
 
void RestrictStates (const StateSet &rStateSet)
 Restrict to transitions with states as specified. More...
 
void RestrictEvents (const EventSet &rEventSet)
 Restrict to transitions with events as specified. More...
 
Iterator Find (Idx x1, Idx ev, Idx x2) const
 Find transition given by x1, ev, x2. More...
 
Iterator Find (const Transition &t) const
 Find specified transition. More...
 
bool Exists (const Transition &t) const
 Test existence. More...
 
bool Exists (Idx x1, Idx ev, Idx x2) const
 Test existence. More...
 
bool ExistsByX1Ev (Idx x1, Idx ev) const
 Test existence. More...
 
bool ExistsByX1 (Idx x1) const
 Test existence. More...
 
bool ExistsByX1OrX2 (Idx x) const
 Tests if a transition with specified predecessor or successor state exists. More...
 
Transition iterators

A variaty of iterators are provided to examine specified segments of the transition relation, e.g.

all transitions starting from a given state. Note that implemetation of these iterators requires the transition set to be of sorted accordingly. Eg. scanning all transitions that are labled with a particular event requires a sorting TransSOrt::EvX1X2 orT ransSOrt::EvX2X1.

Iterator Begin (void) const
 Iterator to begin of set. More...
 
Iterator End (void) const
 Iterator to end of set. More...
 
Iterator Begin (Idx x1) const
 Iterator to first Transition specified by current state. More...
 
Iterator End (Idx x1) const
 Iterator to end or Transitions with specified current state. More...
 
Iterator Begin (Idx x1, Idx ev) const
 Iterator to first Transitions specified by current state and event. More...
 
Iterator End (Idx x1, Idx ev) const
 Iterator to first Transition after spcified current state and event. More...
 
Iterator BeginByEv (Idx ev) const
 Iterator to first Transition specified by event. More...
 
Iterator EndByEv (Idx ev) const
 Iterator to first Transition after specified by event. More...
 
Iterator BeginByEvX1 (Idx ev, Idx x1) const
 Iterator to first Transition specified by event and current state. More...
 
Iterator EndByEvX1 (Idx ev, Idx x1) const
 Iterator to first Transition after specified ev and current state. More...
 
Iterator BeginByEvX2 (Idx ev, Idx x2) const
 Iterator to first Transition specified by event and next state. More...
 
Iterator EndByEvX2 (Idx ev, Idx x2) const
 Iterator to first Transition after specified event and next state. More...
 
Iterator BeginByX2 (Idx x2) const
 Iterator to first Transition specified by successor state x2. More...
 
Iterator EndByX2 (Idx x2) const
 Iterator to first Transition after specified successor state x2. More...
 
Iterator BeginByX2Ev (Idx x2, Idx ev) const
 Iterator to first Transition specified by successor x2 and ev. More...
 
Iterator EndByX2Ev (Idx x2, Idx ev) const
 Iterator to first Transition after specified successor x2 and ev. More...
 
Set Operators

Reimplement boolean operators.

TTransSet< Cmp > operator+ (const TTransSet< Cmp > &rOtherSet) const
 Set union operator. More...
 
TTransSet< Cmp > operator- (const TTransSet< Cmp > &rOtherSet) const
 Set difference operator. More...
 
TTransSet< Cmp > operator* (const TTransSet< Cmp > &rOtherSet) const
 Set intersection operator. More...
 
Misc
template<class OtherCmp >
void ReSort (TTransSet< OtherCmp > &res) const
 Get copy of trantision relation sorted by other compare operator, e.g. More...
 
StateSet States (void) const
 Get state set covered by transition set. More...
 
StateSet SuccessorStates (Idx x1) const
 Get set of successor states for specified current state. More...
 
StateSet SuccessorStates (const StateSet &rX1Set) const
 Get set of successor states for specified current states. More...
 
StateSet SuccessorStates (Idx x1, Idx ev) const
 Get set of successor states for specified current state and event. More...
 
StateSet SuccessorStates (const StateSet &rX1Set, const EventSet &rEvSet) const
 Get set of successor states for specified current states and events. More...
 
EventSet ActiveEvents (Idx x1, SymbolTable *pSymTab=NULL) const
 Get set of events that are active for a specified current state Since a transition set does not refer to a SymbolTable, this function returns a set of plain indices. More...
 
std::string Str (const Transition &rTrans) const
 Return pretty printable string representation. More...
 
- Public Member Functions inherited from faudes::TBaseSet< Transition, TransSort::X1EvX2 >
 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 Transition &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 Transition &rElem) const
 Test validty of candidate element. More...
 
virtual bool Erase (const Transition &rElem)
 Erase element by reference. 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 Transition &rElem)
 Insert specified element. More...
 
virtual Iterator Inject (const Iterator &pos, const Transition &rElem)
 Insert specified element. More...
 
virtual void Inject (const Transition &rElem)
 Insert specified element. More...
 
virtual void InsertSet (const TBaseSet &rOtherSet)
 Insert elements given by rOtherSet. More...
 
bool Exists (const Transition &rElem) const
 Test existence of element. More...
 
Iterator Find (const Transition &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 const AttributeVoidAttributeType (void) const
 Attribute typeinfo. 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 Transition &rElem)
 Attribute access. More...
 
virtual const AttributeVoidAttribute (const Transition &rElem) const
 Attribute access. More...
 
virtual void Attribute (const Transition &rElem, const Type &rAttr)
 Attribute access. More...
 
virtual void AttributeTry (const Transition &rElem, const Type &rAttr)
 Attribute access. More...
 
virtual void ClrAttribute (const Transition &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...
 
Typeoperator= (const Type &rSrc)
 Assign configurationdata from other object. More...
 
bool operator== (const Type &rOther) const
 Test equality of configuration data. More...
 
bool operator!= (const Type &rOther) const
 Test equality of configuration data. 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...
 
Typeoperator= (const Type &rSrc)
 Assign configurationdata from other object. More...
 
virtual bool Equal (const Type &rOther) const
 Test equality of configuration data. More...
 
bool operator== (const Type &rOther) const
 Test equality of configuration data. More...
 
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...
 

Protected Member Functions

void DoAssign (const TTransSet &rSource)
 Assign my members. More...
 
virtual void DoWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write to TokenWriter, see Type::Write for public wrappers. More...
 
- Protected Member Functions inherited from faudes::TBaseSet< Transition, TransSort::X1EvX2 >
virtual const std::string & XElementTag (void) const
 Get name of elements (used for XML IO) More...
 
virtual void DoDWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Token output, debugging see Type::DWrite for public wrappers. More...
 
virtual void DoSWrite (TokenWriter &rTw) const
 Token output, see Type::SWrite for public wrappers. More...
 
virtual void DoRead (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
 Token input, see Type::Read 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 Transition &rElem, const Type *pAttr)
 set attribute in map (assume elem exists in set, NULL <=> set to default) More...
 
const AttributeVoidDoAttribute (const Transition &rElem) const
 get attribute from map (return null if elem does not exist in map) More...
 
AttributeVoidDoAttributeExplicit (const Transition &rElem)
 get attribute from map (insert explicit default if elem does not exist in map) More...
 
TBaseSet< Transition, TransSort::X1EvX2 >::Iterator ThisIterator (const typename std::set< Transition, TransSort::X1EvX2 >::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 void DoXWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data of this object to TokenWriter in XML format. More...
 
virtual Token XBeginTag (const std::string &rLabel="", const std::string &rFallbackLabel="") const
 

Additional Inherited Members

- Protected Types inherited from faudes::TBaseSet< Transition, TransSort::X1EvX2 >
typedef std::set< Transition, TransSort::X1EvX2 >::iterator iterator
 STL iterator, non-const version. More...
 
typedef std::set< Transition, TransSort::X1EvX2 >::const_iterator const_iterator
 STL iterator, const version. More...
 
typedef std::map< Transition, AttributeVoid * >::iterator aiterator
 STL attribute iterator, non-const version. More...
 
typedef std::map< Transition, AttributeVoid * >::const_iterator const_aiterator
 STL attribute iterator, const version. More...
 
- Protected Attributes inherited from faudes::TBaseSet< Transition, TransSort::X1EvX2 >
std::string mMyName
 Name of this BaseSet. More...
 
std::set< Transition, TransSort::X1EvX2 > * pSet
 Pointer on STL set to operate on. More...
 
std::set< Transition, TransSort::X1EvX2 > * mpSet
 STL set, if this object hosts data (else NULL) More...
 
std::map< Transition, AttributeVoid * > * pAttributes
 Pointer to attribute map to operate on. More...
 
std::map< Transition, AttributeVoid * > * mpAttributes
 Attribute map, if this object hosts data (else NULL). More...
 
TBaseSet< Transition, TransSort::X1EvX2 > * pHostSet
 Pointer on BaseSet that hosts our data (THIS if we host) More...
 
std::list< TBaseSet< Transition, TransSort::X1EvX2 > * >::iterator mClientRecord
 Iterator to the client list that hosts our data (maintained by host) More...
 
std::list< TBaseSet< Transition, TransSort::X1EvX2 > * > * 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...
 
- Static Protected Attributes inherited from faudes::TBaseSet< Transition, TransSort::X1EvX2 >
static std::set< Transition, TransSort::X1EvX2msEmptySet
 static empty STL set for default constructor More...
 
static std::map< Transition, AttributeVoid * > msEmptyAttributes
 static empty STL map for default constructor More...
 

Member Typedef Documentation

◆ Iterator

template<class Cmp = TransSort::X1EvX2>
typedef TBaseSet<Transition, Cmp>::Iterator faudes::TTransSet< Cmp >::Iterator

Iterator on transition.

Definition at line 280 of file cfl_transset.h.

Constructor & Destructor Documentation

◆ TTransSet() [1/3]

template<class Cmp >
faudes::TTransSet< Cmp >::TTransSet ( void  )

Construct an empty TTransSet object.

doxygen group

Definition at line 1237 of file cfl_transset.h.

◆ TTransSet() [2/3]

template<class Cmp >
faudes::TTransSet< Cmp >::TTransSet ( const TTransSet< Cmp > &  rOtherSet)

Copy-constructor.

Definition at line 1244 of file cfl_transset.h.

◆ TTransSet() [3/3]

template<class Cmp >
template<class OtherCmp >
faudes::TTransSet< Cmp >::TTransSet ( const TTransSet< OtherCmp > &  res)

Re-Sort Copy-constructor.

Definition at line 1253 of file cfl_transset.h.

◆ ~TTransSet()

template<class Cmp = TransSort::X1EvX2>
virtual faudes::TTransSet< Cmp >::~TTransSet ( )
inlinevirtual

Virtual destructor.

Definition at line 273 of file cfl_transset.h.

Member Function Documentation

◆ ActiveEvents()

template<class Cmp >
EventSet faudes::TTransSet< Cmp >::ActiveEvents ( Idx  x1,
SymbolTable pSymTab = NULL 
) const

Get set of events that are active for a specified current state Since a transition set does not refer to a SymbolTable, this function returns a set of plain indices.

In order to interpret the set as an EventSet, the relevant SymbolTable must be supplied as second argument. If obmitting the second argument, the defult SymbolTable is used.

Parameters
x1Current state
pSymTabSymbolTable to refer to
Returns
Set of events.

Definition at line 1827 of file cfl_transset.h.

◆ Begin() [1/3]

template<class Cmp >
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::Begin ( Idx  x1) const

Iterator to first Transition specified by current state.

Parameters
x1Predecessor state index
Returns
TTransSet<Cmp>::Iterator
Exceptions
Exception
  • Sorting mismatch (id 68)

Definition at line 1285 of file cfl_transset.h.

◆ Begin() [2/3]

template<class Cmp >
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::Begin ( Idx  x1,
Idx  ev 
) const

Iterator to first Transitions specified by current state and event.

Parameters
x1Predecessor state index
evEvent index
Returns
TTransSet<Cmp>::Iterator
Exceptions
Exception
  • Sorting mismatch (id 68)

Definition at line 1307 of file cfl_transset.h.

◆ Begin() [3/3]

template<class Cmp >
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::Begin ( void  ) const

Iterator to begin of set.

doxygen group: iterators

Returns
TTransSet<Cmp>::Iterator

Definition at line 1268 of file cfl_transset.h.

◆ BeginByEv()

template<class Cmp >
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::BeginByEv ( Idx  ev) const

Iterator to first Transition specified by event.

This function requires sorting TransSort::EvX1X2 or TransSort::EvX2X1.

Parameters
evEvent index
Returns
TTransSet<Cmp>::iterator
Exceptions
Exception
  • sorting mismatch (id 68)

Definition at line 1327 of file cfl_transset.h.

◆ BeginByEvX1()

template<class Cmp >
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::BeginByEvX1 ( Idx  ev,
Idx  x1 
) const

Iterator to first Transition specified by event and current state.

This function requires sorting TransSort::EvX1X2.

Parameters
evEvent index
x1Predecessor state index
Returns
TTransSet<Cmp>::iterator
Exceptions
Exception
  • sorting mismatch (id 68)

Definition at line 1349 of file cfl_transset.h.

◆ BeginByEvX2()

template<class Cmp >
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::BeginByEvX2 ( Idx  ev,
Idx  x2 
) const

Iterator to first Transition specified by event and next state.

This function requires sorting TransSort::EvX2X1.

Parameters
evEvent index
x2Predecessor state index
Returns
TTransSet<Cmp>::Iterator
Exceptions
Exception
  • sorting mismatch (id 68)

Definition at line 1369 of file cfl_transset.h.

◆ BeginByX2()

template<class Cmp >
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::BeginByX2 ( Idx  x2) const

Iterator to first Transition specified by successor state x2.

This function requires sorting TransSort::X2EvX1 or TransSort::X2X1Ev.

Parameters
x2Predecessor state index
Returns
TTransSet<Cmp>::iterator
Exceptions
Exception
  • sorting mismatch (id 68)

Definition at line 1389 of file cfl_transset.h.

◆ BeginByX2Ev()

template<class Cmp >
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::BeginByX2Ev ( Idx  x2,
Idx  ev 
) const

Iterator to first Transition specified by successor x2 and ev.

This function requires sorting TransSort::X2EvX1.

Parameters
x2Predecessor state index
evEvent index
Returns
TTransSet<Cmp>::Iterator
Exceptions
Exception
  • sorting mismatch (id 68)

Definition at line 1411 of file cfl_transset.h.

◆ DoAssign()

template<class Cmp >
void faudes::TTransSet< Cmp >::DoAssign ( const TTransSet< Cmp > &  rSource)
protected

Assign my members.

Parameters
rSourceSource to copy from

Definition at line 1261 of file cfl_transset.h.

◆ DoWrite()

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

Write to TokenWriter, see Type::Write for public wrappers.

Parameters
rTwReference to TokenWriter
rLabelLabel of section to write, defaults to name of set
pContextWrite context eg symboltables
Exceptions
Exception
  • IO errors (id 2)

Reimplemented from faudes::TBaseSet< Transition, TransSort::X1EvX2 >.

Definition at line 1454 of file cfl_transset.h.

◆ End() [1/3]

template<class Cmp >
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::End ( Idx  x1) const

Iterator to end or Transitions with specified current state.

Parameters
x1Predecessor state index
Returns
TTransSet<Cmp>::Iterator
Exceptions
Exception
  • Sorting mismatch (id 68)

Definition at line 1296 of file cfl_transset.h.

◆ End() [2/3]

template<class Cmp >
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::End ( Idx  x1,
Idx  ev 
) const

Iterator to first Transition after spcified current state and event.

Parameters
x1Predecessor state index
evEvent index
Returns
TTransSet<Cmp>::Iterator
Exceptions
Exception
  • sorting mismatch (id 68)

Definition at line 1317 of file cfl_transset.h.

◆ End() [3/3]

template<class Cmp >
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::End ( void  ) const

Iterator to end of set.

Returns
TTransSet<Cmp>::Iterator

Definition at line 1273 of file cfl_transset.h.

◆ EndByEv()

template<class Cmp >
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::EndByEv ( Idx  ev) const

Iterator to first Transition after specified by event.

This function requires sorting TransSort::EvX1X2 or TransSort::EvX2X1

Parameters
evPredecessor state index
Returns
TTransSet<Cmp>::Iterator
Exceptions
Exception
  • sorting mismatch (id 68)

Definition at line 1338 of file cfl_transset.h.

◆ EndByEvX1()

template<class Cmp >
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::EndByEvX1 ( Idx  ev,
Idx  x1 
) const

Iterator to first Transition after specified ev and current state.

This function requires sorting TransSort::EvX1X2.

Parameters
evEvent index
x1Predecessor state index
Returns
TTransSet<Cmp>::Iterator
Exceptions
Exception
  • sorting mismatch (id 68)

Definition at line 1359 of file cfl_transset.h.

◆ EndByEvX2()

template<class Cmp >
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::EndByEvX2 ( Idx  ev,
Idx  x2 
) const

Iterator to first Transition after specified event and next state.

This function requires sorting TransSort::EvX2X1.

Parameters
evEvent index
x2Predecessor state index
Returns
TTransSet<Cmp>::Iterator
Exceptions
Exception
  • sorting mismatch (id 68)

Definition at line 1379 of file cfl_transset.h.

◆ EndByX2()

template<class Cmp >
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::EndByX2 ( Idx  x2) const

Iterator to first Transition after specified successor state x2.

This function requires sorting TransSort::X2EvX1 or TransSort::X2X1Ev

Parameters
x2Predecessor state index
Returns
TTransSet<Cmp>::Iterator
Exceptions
Exception
  • sorting mismatch (id 68)

Definition at line 1400 of file cfl_transset.h.

◆ EndByX2Ev()

template<class Cmp >
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::EndByX2Ev ( Idx  x2,
Idx  ev 
) const

Iterator to first Transition after specified successor x2 and ev.

This function requires sorting TransSort::X2EvX1.

Parameters
x2Predecessor state index
evEvent index
Returns
TTransSet<Cmp>::Iterator
Exceptions
Exception
  • sorting mismatch (id 68)

Definition at line 1421 of file cfl_transset.h.

◆ Erase() [1/3]

template<class Cmp >
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::Erase ( const Iterator it)
virtual

Remove a Transition by iterator.

Returns
Iterator to next transition

Reimplemented from faudes::TBaseSet< Transition, TransSort::X1EvX2 >.

Definition at line 1508 of file cfl_transset.h.

◆ Erase() [2/3]

template<class Cmp >
bool faudes::TTransSet< Cmp >::Erase ( const Transition t)

Remove a Transition.

Returns
True if transition did exist

Definition at line 1496 of file cfl_transset.h.

◆ Erase() [3/3]

template<class Cmp >
bool faudes::TTransSet< Cmp >::Erase ( Idx  x1,
Idx  ev,
Idx  x2 
)

Remove a Transition by x1, ev, x2.

Returns
True if transition did exist

Definition at line 1502 of file cfl_transset.h.

◆ EraseByEv()

template<class Cmp >
void faudes::TTransSet< Cmp >::EraseByEv ( Idx  ev)

Remove all transitions containing event ev.

This function iterates over all transitions to work with any sorting.

Parameters
evEvent index

Definition at line 1569 of file cfl_transset.h.

◆ EraseByX1()

template<class Cmp >
void faudes::TTransSet< Cmp >::EraseByX1 ( Idx  x1)

Remove all transitions containing predecessor state x1.

Parameters
x1State index
Exceptions
Exception
  • sorting mismatch (id 68)

Definition at line 1514 of file cfl_transset.h.

◆ EraseByX1Ev()

template<class Cmp >
void faudes::TTransSet< Cmp >::EraseByX1Ev ( Idx  x1,
Idx  ev 
)

Remove all transitions containing predecessor state x1 and event ev.

Parameters
x1State index
evEvent index
Exceptions
Exception
  • sorting mismatch (id 68)

Definition at line 1534 of file cfl_transset.h.

◆ EraseByX1OrX2() [1/2]

template<class Cmp >
void faudes::TTransSet< Cmp >::EraseByX1OrX2 ( const StateSet rStates)

Remove all transitions containing a specified state.

This function iterates over all transitions to work with any sorting.

Parameters
rStatesSet of states to remore

Definition at line 1604 of file cfl_transset.h.

◆ EraseByX1OrX2() [2/2]

template<class Cmp >
void faudes::TTransSet< Cmp >::EraseByX1OrX2 ( Idx  x)

Remove all transitions containing state x, This function iterates over all transitions to work with any sorting.

Parameters
xState index

Definition at line 1586 of file cfl_transset.h.

◆ EraseByX2()

template<class Cmp >
void faudes::TTransSet< Cmp >::EraseByX2 ( Idx  x2)

Remove all transitions containing successor state x2.

This function iterates over all transitions to work with any sorting.

Parameters
x2State index

Definition at line 1553 of file cfl_transset.h.

◆ Exists() [1/2]

template<class Cmp >
bool faudes::TTransSet< Cmp >::Exists ( const Transition t) const

Test existence.

Parameters
tTransition
Returns
bool

Definition at line 1662 of file cfl_transset.h.

◆ Exists() [2/2]

template<class Cmp >
bool faudes::TTransSet< Cmp >::Exists ( Idx  x1,
Idx  ev,
Idx  x2 
) const

Test existence.

Parameters
x1Predecessor state Idx
evEvent Idx
x2Successor state Idx
Returns
bool

Definition at line 1667 of file cfl_transset.h.

◆ ExistsByX1()

template<class Cmp >
bool faudes::TTransSet< Cmp >::ExistsByX1 ( Idx  x1) const

Test existence.

Parameters
x1Predecessor state Idx
Returns
bool

Definition at line 1699 of file cfl_transset.h.

◆ ExistsByX1Ev()

template<class Cmp >
bool faudes::TTransSet< Cmp >::ExistsByX1Ev ( Idx  x1,
Idx  ev 
) const

Test existence.

Parameters
x1Predecessor state Idx
evEvent Idx
Returns
bool

Definition at line 1683 of file cfl_transset.h.

◆ ExistsByX1OrX2()

template<class Cmp >
bool faudes::TTransSet< Cmp >::ExistsByX1OrX2 ( Idx  x) const

Tests if a transition with specified predecessor or successor state exists.

Parameters
xState Idx
Returns
bool

Definition at line 1672 of file cfl_transset.h.

◆ Find() [1/2]

template<class Cmp >
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::Find ( const Transition t) const

Find specified transition.

Parameters
tTransition
Returns
Iterator to transition or End() if not exists

Definition at line 1657 of file cfl_transset.h.

◆ Find() [2/2]

template<class Cmp >
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::Find ( Idx  x1,
Idx  ev,
Idx  x2 
) const

Find transition given by x1, ev, x2.

Parameters
x1Predecessor state
evEvent
x2Successor state
Returns
Iterator to transition or End() if not exists

Definition at line 1651 of file cfl_transset.h.

◆ Inject() [1/2]

template<class Cmp >
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::Inject ( const Iterator pos,
const Transition rTransition 
)

Add a Transition.

Parameters
posInsertion hint passed to STL
rTransitionReference to transition object
Returns
Insertion position

Definition at line 1485 of file cfl_transset.h.

◆ Inject() [2/2]

template<class Cmp >
void faudes::TTransSet< Cmp >::Inject ( const Transition rTransition)

Add a Transition.

Parameters
rTransitionReference to transition object
Returns
Insertion position

Definition at line 1490 of file cfl_transset.h.

◆ Insert() [1/2]

template<class Cmp >
bool faudes::TTransSet< Cmp >::Insert ( const Transition rTransition)

Add a Transition.

doxygen group

Parameters
rTransitionReference to transition object
Returns
True if the transition was new to the set

Definition at line 1474 of file cfl_transset.h.

◆ Insert() [2/2]

template<class Cmp >
bool faudes::TTransSet< Cmp >::Insert ( Idx  x1,
Idx  ev,
Idx  x2 
)

Add a Transition by indices.

Parameters
x1Predecessor state
evEvent
x2Successor state
Returns
True if the transition was new to the set

Definition at line 1479 of file cfl_transset.h.

◆ operator*()

template<class Cmp >
TTransSet< Cmp > faudes::TTransSet< Cmp >::operator* ( const TTransSet< Cmp > &  rOtherSet) const

Set intersection operator.

Returns
Set Intersection

Definition at line 1446 of file cfl_transset.h.

◆ operator+()

template<class Cmp >
TTransSet< Cmp > faudes::TTransSet< Cmp >::operator+ ( const TTransSet< Cmp > &  rOtherSet) const

Set union operator.

doxygen group: operators

Returns
Union Set

Definition at line 1431 of file cfl_transset.h.

◆ operator-()

template<class Cmp >
TTransSet< Cmp > faudes::TTransSet< Cmp >::operator- ( const TTransSet< Cmp > &  rOtherSet) const

Set difference operator.

Returns
Set Difference NameSet

Definition at line 1438 of file cfl_transset.h.

◆ ReSort()

template<class Cmp >
template<class OtherCmp >
void faudes::TTransSet< Cmp >::ReSort ( TTransSet< OtherCmp > &  res) const

Get copy of trantision relation sorted by other compare operator, e.g.

doxygen group TSort::X2EvX1

Returns
Transition relation

Definition at line 1718 of file cfl_transset.h.

◆ RestrictEvents()

template<class Cmp >
void faudes::TTransSet< Cmp >::RestrictEvents ( const EventSet rEventSet)

Restrict to transitions with events as specified.

Erases any transition with event not in the specified state set.

Parameters
rEventSetSet of events to keep.

Definition at line 1635 of file cfl_transset.h.

◆ RestrictStates()

template<class Cmp >
void faudes::TTransSet< Cmp >::RestrictStates ( const StateSet rStateSet)

Restrict to transitions with states as specified.

Erases any transition with X1 or X2 not in the specified state set.

Parameters
rStateSetSet of states to keep.

Definition at line 1619 of file cfl_transset.h.

◆ States()

template<class Cmp >
StateSet faudes::TTransSet< Cmp >::States ( void  ) const

Get state set covered by transition set.

Returns
Set of state indices used by some transition

Definition at line 1727 of file cfl_transset.h.

◆ Str()

template<class Cmp >
std::string faudes::TTransSet< Cmp >::Str ( const Transition rTrans) const

Return pretty printable string representation.

Primary meant for debugging messages.

Parameters
rTransTransition to print
Returns
String

Definition at line 1839 of file cfl_transset.h.

◆ SuccessorStates() [1/4]

template<class Cmp >
StateSet faudes::TTransSet< Cmp >::SuccessorStates ( const StateSet rX1Set) const

Get set of successor states for specified current states.

Parameters
rX1SetCurrent state
Returns
Set of state indices

Definition at line 1755 of file cfl_transset.h.

◆ SuccessorStates() [2/4]

template<class Cmp >
StateSet faudes::TTransSet< Cmp >::SuccessorStates ( const StateSet rX1Set,
const EventSet rEvSet 
) const

Get set of successor states for specified current states and events.

Parameters
rX1SetCurrent states
rEvSetEvents
Returns
Set of state indices

Definition at line 1792 of file cfl_transset.h.

◆ SuccessorStates() [3/4]

template<class Cmp >
StateSet faudes::TTransSet< Cmp >::SuccessorStates ( Idx  x1) const

Get set of successor states for specified current state.

Parameters
x1Current state
Returns
Set of state indices

Definition at line 1738 of file cfl_transset.h.

◆ SuccessorStates() [4/4]

template<class Cmp >
StateSet faudes::TTransSet< Cmp >::SuccessorStates ( Idx  x1,
Idx  ev 
) const

Get set of successor states for specified current state and event.

Parameters
x1Current state
evEvent
Returns
Set of state indices

Definition at line 1776 of file cfl_transset.h.


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

libFAUDES 2.32f --- 2024.12.22 --- c++ api documentaion by doxygen