#include <transset.h>
Inheritance diagram for faudes::TTransSet< Cmp >:
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 }
Note that 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 232 of file transset.h.
Public Types | |
typedef TBaseSet< Transition, Cmp >::Iterator | Iterator |
Iterator on transition. | |
Public Member Functions | |
Constructors & Destructor | |
TTransSet (void) | |
Construct an empty TTransSet object. | |
TTransSet (const TTransSet &rOtherSet) | |
Copy-constructor. | |
virtual | ~TTransSet () |
Virtual destructor. | |
Accessing individual transitions | |
bool | Insert (const Transition &rTransition) |
Add a Transition. | |
bool | Insert (Idx x1, Idx ev, Idx x2) |
Add a Transition by indices. | |
bool | Erase (const Transition &t) |
Remove a Transition. | |
bool | Erase (Idx x1, Idx ev, Idx x2) |
Remove a Transition by x1, ev, x2. | |
Iterator | Erase (const Iterator &it) |
Remove a Transition by iterator. | |
void | EraseByX1 (Idx x1) |
Remove all transitions containing predecessor state x1. | |
void | EraseByX2 (Idx x2) |
Remove all transitions containing successor state x2. | |
void | EraseByEv (Idx ev) |
Remove all transitions containing event ev This function iterates over all transitions to work with any sorting. | |
void | EraseByX1OrX2 (Idx x) |
Remove all transitions containing state x This function iterates over all transitions to work with any sorting. | |
Iterator | Find (Idx x1, Idx ev, Idx x2) const |
Find transition given by x1, ev, x2. | |
Iterator | Find (const Transition &t) const |
Find specified transition. | |
bool | Exists (const Transition &t) const |
Test existence. | |
bool | Exists (Idx x1, Idx ev, Idx x2) const |
Test existence. | |
bool | Exists (Idx x) const |
Tests if a transition with specified predecessor or successor state exists. | |
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. | |
Iterator | End (void) const |
Iterator to end of set. | |
Iterator | Begin (Idx x1) const |
Iterator to first Transition specified by current state. | |
Iterator | End (Idx x1) const |
Iterator to end or Transitions with specified current state. | |
Iterator | Begin (Idx x1, Idx ev) const |
Iterator to first Transitions specified by current state and event. | |
Iterator | End (Idx x1, Idx ev) const |
Iterator to first Transition after spcified current state and event. | |
Iterator | BeginByEv (Idx ev) const |
Iterator to first Transition specified by event. | |
Iterator | EndByEv (Idx ev) const |
Iterator to first Transition after specified by event. | |
Iterator | BeginByEvX1 (Idx ev, Idx x1) const |
Iterator to first Transition specified by event and current state. | |
Iterator | EndByEvX1 (Idx ev, Idx x1) const |
Iterator to first Transition after specified ev and current state. | |
Iterator | BeginByEvX2 (Idx ev, Idx x2) const |
Iterator to first Transition specified by event and next state. | |
Iterator | EndByEvX2 (Idx ev, Idx x2) const |
Iterator to first Transition after specified event and next state. | |
Iterator | BeginByX2 (Idx x2) const |
Iterator to first Transition specified by successor state x2. | |
Iterator | EndByX2 (Idx x2) const |
Iterator to first Transition after specified successor state x2. | |
Iterator | BeginByX2Ev (Idx x2, Idx ev) const |
Iterator to first Transition specified by successor x2 and ev. | |
Iterator | EndByX2Ev (Idx x2, Idx ev) const |
Iterator to first Transition after specified successor x2 and ev. | |
Misc | |
template<class OtherCmp> | |
void | ReSort (TTransSet< OtherCmp > &res) const |
Get copy of trantision relation sorted by other compare operator, e.g. | |
StateSet | StateSpace (void) const |
Get state space covered by transition set. | |
StateSet | StateSpaceX2 (Idx x1) const |
Get set of successor states for specified current state. | |
StateSet | StateSpaceX2 (Idx x1, Idx ev) const |
Get set of successor states for specified current state and event. | |
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. | |
Protected Member Functions | |
virtual void | DoWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
Write to TokenWriter, see TBaseSet for public wrappers. |
|
Iterator on transition.
Definition at line 248 of file transset.h. |
|
Construct an empty TTransSet object.
Definition at line 1043 of file transset.h. |
|
Copy-constructor.
Definition at line 1048 of file transset.h. |
|
Virtual destructor.
Definition at line 248 of file transset.h. |
|
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.
Definition at line 1415 of file transset.h. |
|
Iterator to first Transitions specified by current state and event.
Definition at line 1092 of file transset.h. |
|
Iterator to first Transition specified by current state.
Definition at line 1070 of file transset.h. |
|
Iterator to begin of set.
Reimplemented from faudes::TBaseSet< Transition, Cmp >. Definition at line 1053 of file transset.h. |
|
Iterator to first Transition specified by event. This function requires sorting TransSort::EvX1X2 or TransSort::EvX2X1.
Definition at line 1112 of file transset.h. |
|
Iterator to first Transition specified by event and current state. This function requires sorting TransSort::EvX1X2.
Definition at line 1134 of file transset.h. |
|
Iterator to first Transition specified by event and next state. This function requires sorting TransSort::EvX2X1.
Definition at line 1154 of file transset.h. |
|
Iterator to first Transition specified by successor state x2. This function requires sorting TransSort::X2EvX1 or TransSort::X2X1Ev.
Definition at line 1174 of file transset.h. |
|
Iterator to first Transition specified by successor x2 and ev. This function requires sorting TransSort::X2EvX1.
Definition at line 1196 of file transset.h. |
|
Write to TokenWriter, see TBaseSet for public wrappers.
Reimplemented from faudes::TBaseSet< Transition, Cmp >. Definition at line 1218 of file transset.h. |
|
Iterator to first Transition after spcified current state and event.
Definition at line 1102 of file transset.h. |
|
Iterator to end or Transitions with specified current state.
Definition at line 1081 of file transset.h. |
|
Iterator to end of set.
Reimplemented from faudes::TBaseSet< Transition, Cmp >. Definition at line 1058 of file transset.h. |
|
Iterator to first Transition after specified by event. This function requires sorting TransSort::EvX1X2 or TransSort::EvX2X1
Definition at line 1123 of file transset.h. |
|
Iterator to first Transition after specified ev and current state. This function requires sorting TransSort::EvX1X2.
Definition at line 1144 of file transset.h. |
|
Iterator to first Transition after specified event and next state. This function requires sorting TransSort::EvX2X1.
Definition at line 1164 of file transset.h. |
|
Iterator to first Transition after specified successor state x2. This function requires sorting TransSort::X2EvX1 or TransSort::X2X1Ev
Definition at line 1185 of file transset.h. |
|
Iterator to first Transition after specified successor x2 and ev. This function requires sorting TransSort::X2EvX1.
Definition at line 1206 of file transset.h. |
|
Remove a Transition by iterator.
Definition at line 1261 of file transset.h. |
|
Remove a Transition by x1, ev, x2.
Reimplemented in faudes::TaTransSet< Attr >. Definition at line 1255 of file transset.h. |
|
Remove a Transition.
Reimplemented from faudes::TBaseSet< Transition, Cmp >. Reimplemented in faudes::TaTransSet< Attr >. Definition at line 1250 of file transset.h. |
|
Remove all transitions containing event ev This function iterates over all transitions to work with any sorting.
Reimplemented in faudes::TaTransSet< Attr >. Definition at line 1301 of file transset.h. |
|
Remove all transitions containing predecessor state x1.
Reimplemented in faudes::TaTransSet< Attr >. Definition at line 1268 of file transset.h. |
|
Remove all transitions containing state x This function iterates over all transitions to work with any sorting.
Reimplemented in faudes::TaTransSet< Attr >. Definition at line 1319 of file transset.h. |
|
Remove all transitions containing successor state x2. This function iterates over all transitions to work with any sorting.
Reimplemented in faudes::TaTransSet< Attr >. Definition at line 1285 of file transset.h. |
|
Tests if a transition with specified predecessor or successor state exists.
Definition at line 1357 of file transset.h. |
|
Test existence.
Definition at line 1352 of file transset.h. |
|
Test existence.
Reimplemented from faudes::TBaseSet< Transition, Cmp >. Definition at line 1347 of file transset.h. |
|
Find specified transition.
Reimplemented from faudes::TBaseSet< Transition, Cmp >. Definition at line 1342 of file transset.h. |
|
Find transition given by x1, ev, x2.
Definition at line 1336 of file transset.h. |
|
Add a Transition by indices.
Reimplemented in faudes::TaTransSet< Attr >. Definition at line 1244 of file transset.h. |
|
Add a Transition.
Reimplemented from faudes::TBaseSet< Transition, Cmp >. Reimplemented in faudes::TaTransSet< Attr >. Definition at line 1239 of file transset.h. |
|
Get copy of trantision relation sorted by other compare operator, e.g. TSort::X2EvX1
Definition at line 1371 of file transset.h. |
|
Get state space covered by transition set.
Definition at line 1380 of file transset.h. |
|
Get set of successor states for specified current state and event.
Definition at line 1403 of file transset.h. |
|
Get set of successor states for specified current state.
Definition at line 1391 of file transset.h. |