| |
libFAUDES
Sections
Index
|
faudes::TTransSet< Cmp > Class Template Reference |
Public Types | |
typedef TBaseSet< Transition, Cmp >::Iterator | Iterator |
Iterator on transition. | |
Public Member Functions | |
virtual TTransSet * | New (void) const |
Construct on heap. | |
virtual TTransSet * | Copy (void) const |
Construct on heap. | |
virtual const TTransSet * | Cast (const Type *pOther) const |
Cast other object to this type. | |
virtual TTransSet & | Assign (const Type &rSrc) |
Assign configuration data from other object. | |
virtual bool | Equal (const Type &rOther) const |
Test equality of configuration data. | |
virtual TTransSet & | operator= (const TTransSet &rSrc) |
virtual bool | operator== (const TTransSet &rOther) const |
virtual bool | operator!= (const TTransSet &rOther) const |
Constructors & Destructor | |
TTransSet (void) | |
Construct an empty TTransSet object. | |
TTransSet (const TBaseSet< Transition, Cmp > &rOtherSet) | |
Copy-constructor. | |
template<class OtherCmp> | |
TTransSet (const TTransSet< OtherCmp > &res) | |
Re-Sort 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. | |
void | EraseByX1OrX2 (Idx x) |
Remove all transitions containing state x, This function iterates over all transitions to work with any sorting. | |
void | EraseByX1OrX2 (const StateSet &rStates) |
Remove all transitions containing a specified state. | |
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. | |
std::string | Str (const Transition &rTrans) const |
Return pretty printable string representation. | |
Protected Member Functions | |
virtual TTransSet & | DoAssign (const TTransSet &rSource) |
Assign my members. | |
virtual void | DoWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
Write to TokenWriter, see Type::Write for public wrappers. |
typedef TBaseSet<Transition, Cmp>::Iterator faudes::TTransSet< Cmp >::Iterator |
Iterator on transition.
Reimplemented in faudes::TaTransSet< Attr >.
Definition at line 260 of file transset.h.
faudes::TTransSet< Cmp >::TTransSet | ( | void | ) | [inline] |
faudes::TTransSet< Cmp >::TTransSet | ( | const TBaseSet< Transition, Cmp > & | rOtherSet | ) | [inline] |
faudes::TTransSet< Cmp >::TTransSet | ( | const TTransSet< OtherCmp > & | res | ) | [inline] |
virtual faudes::TTransSet< Cmp >::~TTransSet | ( | ) | [inline, virtual] |
TTransSet< Cmp > * faudes::TTransSet< Cmp >::New | ( | void | ) | const [inline, virtual] |
Construct on heap.
Technically not a constructor, this function creates an object with the same type Type. New() is defined as a virtual function and derived classes are meant to re-implement with the appropiate constructor. This can be done via the provided macros FAUDES_TYPE_DECLARATION and FAUDES_TYPE_IMPLEMENTATION. As with new, it is the callers reponsabilty to delete the object when no longer needed.
Reimplemented from faudes::TBaseSet< T, Cmp >.
Reimplemented in faudes::TaTransSet< Attr >.
Definition at line 1110 of file transset.h.
TTransSet< Cmp > * faudes::TTransSet< Cmp >::Copy | ( | void | ) | const [inline, virtual] |
Construct on heap.
Technically not a constructor, this function creates an object with the same type Type and the same configuration. Copy() is defined as a virtual function and derived classes are meant to re-implement with the appropiate copy constructor. This can be done via the provided macros FAUDES_TYPE_DECLARATION and FAUDES_TYPE_IMPLEMENTATION. As with new, it is the callers reponsabilty to delete the object when no longer needed.
Reimplemented from faudes::TBaseSet< T, Cmp >.
Reimplemented in faudes::TaTransSet< Attr >.
Definition at line 1110 of file transset.h.
const TTransSet< Cmp > * faudes::TTransSet< Cmp >::Cast | ( | const Type * | pOther | ) | const [inline, virtual] |
Cast other object to this type.
Enables the run-time interface to test whether pObject is derived from this object. This feature is used e.g. in the faudes container classes to test attributes. Derived classes must reimplement this function using the appropriate dynamic cast.
Re-implementation can be done via the convenience macros FAUDES_TYPE_DECLARATION and FAUDES_TYPE_IMPLEMENTATION.
Reimplemented from faudes::TBaseSet< T, Cmp >.
Reimplemented in faudes::TaTransSet< Attr >.
Definition at line 1110 of file transset.h.
TTransSet< Cmp > & faudes::TTransSet< Cmp >::Assign | ( | const Type & | rSrc | ) | [inline, virtual] |
Assign configuration data from other object.
Derived classes should reimplement this method to first try to cast the source to the respective class. If successful, the protected function DoAssign is invoked to perform the actual assignment. If the cast fails, the Assign method of the parent class is called. Thus, faudes objects are up- and downcatsted for assignment, maintaining as much of the source data as digestable by the destination object. On the downside, there is no sensible typechecking at compile-time.
Re-implementation can be done via the convenience macros FAUDES_TYPE_DECLARATION and FAUDES_TYPE_IMPLEMENTATION.
rSrc | Source to copy from |
Reimplemented from faudes::TBaseSet< T, Cmp >.
Reimplemented in faudes::TaTransSet< Attr >.
Definition at line 1110 of file transset.h.
bool faudes::TTransSet< Cmp >::Equal | ( | const Type & | rOther | ) | const [inline, virtual] |
Test equality of configuration data.
Derived classes should reimplement this method to return true if both actual types and configuration data match. The object name is not consired in the test.
This method calls the virtual method DoEqual(). Re-implementation can be done via the convenience macros FAUDES_TYPE_DECLARATION and FAUDES_TYPE_IMPLEMENTATION.
rOther | Other objevt to compare with. |
Reimplemented from faudes::TBaseSet< T, Cmp >.
Reimplemented in faudes::TaTransSet< Attr >.
Definition at line 1110 of file transset.h.
TTransSet< Cmp > & faudes::TTransSet< Cmp >::operator= | ( | const TTransSet< Cmp > & | rSrc | ) | [inline, virtual] |
Definition at line 1110 of file transset.h.
bool faudes::TTransSet< Cmp >::operator== | ( | const TTransSet< Cmp > & | rOther | ) | const [inline, virtual] |
Definition at line 1110 of file transset.h.
bool faudes::TTransSet< Cmp >::operator!= | ( | const TTransSet< Cmp > & | rOther | ) | const [inline, virtual] |
Definition at line 1110 of file transset.h.
bool faudes::TTransSet< Cmp >::Insert | ( | const Transition & | rTransition | ) | [inline] |
Add a Transition.
doxygen group
rTransition | Reference to transition object |
Reimplemented in faudes::TaTransSet< Attr >.
Definition at line 1329 of file transset.h.
bool faudes::TTransSet< Cmp >::Insert | ( | Idx | x1, | |
Idx | ev, | |||
Idx | x2 | |||
) | [inline] |
Add a Transition by indices.
x1 | Predecessor state | |
ev | Event | |
x2 | Successor state |
Reimplemented in faudes::TaTransSet< Attr >.
Definition at line 1334 of file transset.h.
bool faudes::TTransSet< Cmp >::Erase | ( | const Transition & | t | ) | [inline] |
Remove a Transition.
Reimplemented in faudes::TaTransSet< Attr >.
Definition at line 1340 of file transset.h.
bool faudes::TTransSet< Cmp >::Erase | ( | Idx | x1, | |
Idx | ev, | |||
Idx | x2 | |||
) | [inline] |
Remove a Transition by x1, ev, x2.
Reimplemented in faudes::TaTransSet< Attr >.
Definition at line 1345 of file transset.h.
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::Erase | ( | const Iterator & | it | ) | [inline, virtual] |
Remove a Transition by iterator.
Reimplemented from faudes::TBaseSet< T, Cmp >.
Reimplemented in faudes::TaTransSet< Attr >.
Definition at line 1351 of file transset.h.
void faudes::TTransSet< Cmp >::EraseByX1 | ( | Idx | x1 | ) | [inline] |
Remove all transitions containing predecessor state x1.
x1 | State index |
Exception |
|
Reimplemented in faudes::TaTransSet< Attr >.
Definition at line 1358 of file transset.h.
void faudes::TTransSet< Cmp >::EraseByX2 | ( | Idx | x2 | ) | [inline] |
Remove all transitions containing successor state x2.
This function iterates over all transitions to work with any sorting.
x2 | State index |
Reimplemented in faudes::TaTransSet< Attr >.
Definition at line 1375 of file transset.h.
void faudes::TTransSet< Cmp >::EraseByEv | ( | Idx | ev | ) | [inline] |
Remove all transitions containing event ev.
This function iterates over all transitions to work with any sorting.
ev | Event index |
Reimplemented in faudes::TaTransSet< Attr >.
Definition at line 1391 of file transset.h.
void faudes::TTransSet< Cmp >::EraseByX1OrX2 | ( | Idx | x | ) | [inline] |
Remove all transitions containing state x, This function iterates over all transitions to work with any sorting.
x | State index |
Reimplemented in faudes::TaTransSet< Attr >.
Definition at line 1409 of file transset.h.
void faudes::TTransSet< Cmp >::EraseByX1OrX2 | ( | const StateSet & | rStates | ) | [inline] |
Remove all transitions containing a specified state.
This function iterates over all transitions to work with any sorting.
rStates | Set of states to remore |
Reimplemented in faudes::TaTransSet< Attr >.
Definition at line 1427 of file transset.h.
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::Find | ( | Idx | x1, | |
Idx | ev, | |||
Idx | x2 | |||
) | const [inline] |
Find transition given by x1, ev, x2.
x1 | Predecessor state | |
ev | Event | |
x2 | Successor state |
Definition at line 1445 of file transset.h.
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::Find | ( | const Transition & | t | ) | const [inline] |
Find specified transition.
t | Transition |
Definition at line 1451 of file transset.h.
bool faudes::TTransSet< Cmp >::Exists | ( | const Transition & | t | ) | const [inline] |
bool faudes::TTransSet< Cmp >::Exists | ( | Idx | x1, | |
Idx | ev, | |||
Idx | x2 | |||
) | const [inline] |
Test existence.
x1 | Predecessor state Idx | |
ev | Event Idx | |
x2 | Successor state Idx |
Definition at line 1461 of file transset.h.
bool faudes::TTransSet< Cmp >::Exists | ( | Idx | x | ) | const [inline] |
Tests if a transition with specified predecessor or successor state exists.
x | State Idx |
Definition at line 1466 of file transset.h.
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::Begin | ( | void | ) | const [inline] |
Iterator to begin of set.
doxygen group: iterators
Reimplemented from faudes::TBaseSet< T, Cmp >.
Definition at line 1144 of file transset.h.
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::End | ( | void | ) | const [inline] |
Iterator to end of set.
Reimplemented from faudes::TBaseSet< T, Cmp >.
Definition at line 1149 of file transset.h.
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::Begin | ( | Idx | x1 | ) | const [inline] |
Iterator to first Transition specified by current state.
x1 | Predecessor state index |
Exception |
|
Definition at line 1161 of file transset.h.
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::End | ( | Idx | x1 | ) | const [inline] |
Iterator to end or Transitions with specified current state.
x1 | Predecessor state index |
Exception |
|
Definition at line 1172 of file transset.h.
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::Begin | ( | Idx | x1, | |
Idx | ev | |||
) | const [inline] |
Iterator to first Transitions specified by current state and event.
x1 | Predecessor state index | |
ev | Event index |
Exception |
|
Definition at line 1183 of file transset.h.
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::End | ( | Idx | x1, | |
Idx | ev | |||
) | const [inline] |
Iterator to first Transition after spcified current state and event.
x1 | Predecessor state index | |
ev | Event index |
Exception |
|
Definition at line 1193 of file transset.h.
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::BeginByEv | ( | Idx | ev | ) | const [inline] |
Iterator to first Transition specified by event.
This function requires sorting TransSort::EvX1X2 or TransSort::EvX2X1.
ev | Event index |
Exception |
|
Definition at line 1203 of file transset.h.
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::EndByEv | ( | Idx | ev | ) | const [inline] |
Iterator to first Transition after specified by event.
This function requires sorting TransSort::EvX1X2 or TransSort::EvX2X1
ev | Predecessor state index |
Exception |
|
Definition at line 1214 of file transset.h.
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::BeginByEvX1 | ( | Idx | ev, | |
Idx | x1 | |||
) | const [inline] |
Iterator to first Transition specified by event and current state.
This function requires sorting TransSort::EvX1X2.
ev | Event index | |
x1 | Predecessor state index |
Exception |
|
Definition at line 1225 of file transset.h.
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::EndByEvX1 | ( | Idx | ev, | |
Idx | x1 | |||
) | const [inline] |
Iterator to first Transition after specified ev and current state.
This function requires sorting TransSort::EvX1X2.
ev | Event index | |
x1 | Predecessor state index |
Exception |
|
Definition at line 1235 of file transset.h.
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::BeginByEvX2 | ( | Idx | ev, | |
Idx | x2 | |||
) | const [inline] |
Iterator to first Transition specified by event and next state.
This function requires sorting TransSort::EvX2X1.
ev | Event index | |
x2 | Predecessor state index |
Exception |
|
Definition at line 1245 of file transset.h.
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::EndByEvX2 | ( | Idx | ev, | |
Idx | x2 | |||
) | const [inline] |
Iterator to first Transition after specified event and next state.
This function requires sorting TransSort::EvX2X1.
ev | Event index | |
x2 | Predecessor state index |
Exception |
|
Definition at line 1255 of file transset.h.
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::BeginByX2 | ( | Idx | x2 | ) | const [inline] |
Iterator to first Transition specified by successor state x2.
This function requires sorting TransSort::X2EvX1 or TransSort::X2X1Ev.
x2 | Predecessor state index |
Exception |
|
Definition at line 1265 of file transset.h.
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::EndByX2 | ( | Idx | x2 | ) | const [inline] |
Iterator to first Transition after specified successor state x2.
This function requires sorting TransSort::X2EvX1 or TransSort::X2X1Ev
x2 | Predecessor state index |
Exception |
|
Definition at line 1276 of file transset.h.
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::BeginByX2Ev | ( | Idx | x2, | |
Idx | ev | |||
) | const [inline] |
Iterator to first Transition specified by successor x2 and ev.
This function requires sorting TransSort::X2EvX1.
x2 | Predecessor state index | |
ev | Event index |
Exception |
|
Definition at line 1287 of file transset.h.
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::EndByX2Ev | ( | Idx | x2, | |
Idx | ev | |||
) | const [inline] |
Iterator to first Transition after specified successor x2 and ev.
This function requires sorting TransSort::X2EvX1.
x2 | Predecessor state index | |
ev | Event index |
Exception |
|
Definition at line 1297 of file transset.h.
void faudes::TTransSet< Cmp >::ReSort | ( | TTransSet< OtherCmp > & | res | ) | const [inline] |
Get copy of trantision relation sorted by other compare operator, e.g.
doxygen group TSort::X2EvX1
Definition at line 1480 of file transset.h.
StateSet faudes::TTransSet< Cmp >::StateSpace | ( | void | ) | const [inline] |
Get state space covered by transition set.
Definition at line 1489 of file transset.h.
StateSet faudes::TTransSet< Cmp >::StateSpaceX2 | ( | Idx | x1 | ) | const [inline] |
Get set of successor states for specified current state.
x1 | Current state |
Definition at line 1500 of file transset.h.
StateSet faudes::TTransSet< Cmp >::StateSpaceX2 | ( | Idx | x1, | |
Idx | ev | |||
) | const [inline] |
Get set of successor states for specified current state and event.
x1 | Current state | |
ev | Event |
Definition at line 1512 of file transset.h.
EventSet faudes::TTransSet< Cmp >::ActiveEvents | ( | Idx | x1, | |
SymbolTable * | pSymTab = NULL | |||
) | const [inline] |
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.
x1 | Current state | |
pSymTab | SymbolTable to refer to |
Definition at line 1524 of file transset.h.
std::string faudes::TTransSet< Cmp >::Str | ( | const Transition & | rTrans | ) | const [inline] |
Return pretty printable string representation.
Primary meant for debugging messages.
rTrans | Transition to print |
Definition at line 767 of file transset.h.
TTransSet< Cmp > & faudes::TTransSet< Cmp >::DoAssign | ( | const TTransSet< Cmp > & | rSource | ) | [inline, protected, virtual] |
Assign my members.
rSource | Source to copy from |
Definition at line 1135 of file transset.h.
void faudes::TTransSet< Cmp >::DoWrite | ( | TokenWriter & | rTw, | |
const std::string & | rLabel = "" , |
|||
const Type * | pContext = 0 | |||
) | const [inline, protected, virtual] |
Write to TokenWriter, see Type::Write for public wrappers.
rTw | Reference to TokenWriter | |
rLabel | Label of section to write, defaults to name of set | |
pContext | Write context eg symboltables |
Exception |
|
Reimplemented from faudes::TBaseSet< T, Cmp >.
Definition at line 1309 of file transset.h.
libFAUDES 2.14g --- 2009-12-3 --- c++ source docu by doxygen 1.5.6