libFAUDES

Sections

Index

faudes::TTransSet< Cmp > Class Template Reference
[State, Event and Transition Set]

Set of Transitions. More...

#include <cfl_transset.h>

List of all members.

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 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 void 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.

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

 }

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 235 of file cfl_transset.h.


Member Typedef Documentation

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

Iterator on transition.

Reimplemented in faudes::TaTransSet< Attr >.

Definition at line 260 of file cfl_transset.h.


Constructor & Destructor Documentation

template<class Cmp >
faudes::TTransSet< Cmp >::TTransSet ( void   )  [inline]

Construct an empty TTransSet object.

doxygen group

Definition at line 1108 of file cfl_transset.h.

template<class Cmp>
faudes::TTransSet< Cmp >::TTransSet ( const TBaseSet< Transition, Cmp > &  rOtherSet  )  [inline]

Copy-constructor.

Definition at line 1114 of file cfl_transset.h.

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

Re-Sort Copy-constructor.

Definition at line 1122 of file cfl_transset.h.

template<class Cmp = TransSort::X1EvX2>
virtual faudes::TTransSet< Cmp >::~TTransSet (  )  [inline, virtual]

Virtual destructor.

Definition at line 260 of file cfl_transset.h.


Member Function Documentation

template<class Cmp >
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.

Parameters:
x1 Current state
pSymTab SymbolTable to refer to
Returns:
Set of events.

Definition at line 1517 of file cfl_transset.h.

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

Iterator to first Transitions specified by current state and event.

Parameters:
x1 Predecessor state index
ev Event index
Returns:
TTransSet<Cmp>::Iterator
Exceptions:
Exception 
  • Sorting mismatch (id 68)

Definition at line 1176 of file cfl_transset.h.

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

Iterator to first Transition specified by current state.

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

Definition at line 1154 of file cfl_transset.h.

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

Iterator to begin of set.

doxygen group: iterators

Returns:
TTransSet<Cmp>::Iterator

Reimplemented from faudes::TBaseSet< Transition, Cmp >.

Definition at line 1137 of file cfl_transset.h.

template<class Cmp >
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.

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

Definition at line 1196 of file cfl_transset.h.

template<class Cmp >
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.

Parameters:
ev Event index
x1 Predecessor state index
Returns:
TTransSet<Cmp>::iterator
Exceptions:
Exception 
  • sorting mismatch (id 68)

Definition at line 1218 of file cfl_transset.h.

template<class Cmp >
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.

Parameters:
ev Event index
x2 Predecessor state index
Returns:
TTransSet<Cmp>::Iterator
Exceptions:
Exception 
  • sorting mismatch (id 68)

Definition at line 1238 of file cfl_transset.h.

template<class Cmp >
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.

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

Definition at line 1258 of file cfl_transset.h.

template<class Cmp >
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.

Parameters:
x2 Predecessor state index
ev Event index
Returns:
TTransSet<Cmp>::Iterator
Exceptions:
Exception 
  • sorting mismatch (id 68)

Definition at line 1280 of file cfl_transset.h.

template<class Cmp >
void faudes::TTransSet< Cmp >::DoAssign ( const TTransSet< Cmp > &  rSource  )  [inline, protected, virtual]

Assign my members.

Parameters:
rSource Source to copy from
Returns:
Ref to this set

Definition at line 1130 of file cfl_transset.h.

template<class Cmp >
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.

Parameters:
rTw Reference to TokenWriter
rLabel Label of section to write, defaults to name of set
pContext Write context eg symboltables
Exceptions:
Exception 
  • IO errors (id 2)

Reimplemented from faudes::TBaseSet< Transition, Cmp >.

Definition at line 1302 of file cfl_transset.h.

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

Iterator to first Transition after spcified current state and event.

Parameters:
x1 Predecessor state index
ev Event index
Returns:
TTransSet<Cmp>::Iterator
Exceptions:
Exception 
  • sorting mismatch (id 68)

Definition at line 1186 of file cfl_transset.h.

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

Iterator to end or Transitions with specified current state.

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

Definition at line 1165 of file cfl_transset.h.

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

Iterator to end of set.

Returns:
TTransSet<Cmp>::Iterator

Reimplemented from faudes::TBaseSet< Transition, Cmp >.

Definition at line 1142 of file cfl_transset.h.

template<class Cmp >
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

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

Definition at line 1207 of file cfl_transset.h.

template<class Cmp >
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.

Parameters:
ev Event index
x1 Predecessor state index
Returns:
TTransSet<Cmp>::Iterator
Exceptions:
Exception 
  • sorting mismatch (id 68)

Definition at line 1228 of file cfl_transset.h.

template<class Cmp >
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.

Parameters:
ev Event index
x2 Predecessor state index
Returns:
TTransSet<Cmp>::Iterator
Exceptions:
Exception 
  • sorting mismatch (id 68)

Definition at line 1248 of file cfl_transset.h.

template<class Cmp >
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

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

Definition at line 1269 of file cfl_transset.h.

template<class Cmp >
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.

Parameters:
x2 Predecessor state index
ev Event index
Returns:
TTransSet<Cmp>::Iterator
Exceptions:
Exception 
  • sorting mismatch (id 68)

Definition at line 1290 of file cfl_transset.h.

template<class Cmp >
TTransSet< Cmp >::Iterator faudes::TTransSet< Cmp >::Erase ( const Iterator it  )  [inline]

Remove a Transition by iterator.

Returns:
Iterator to next transition

Reimplemented in faudes::TaTransSet< Attr >.

Definition at line 1344 of file cfl_transset.h.

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

Remove a Transition by x1, ev, x2.

Returns:
True if transition did exist

Reimplemented in faudes::TaTransSet< Attr >.

Definition at line 1338 of file cfl_transset.h.

template<class Cmp >
bool faudes::TTransSet< Cmp >::Erase ( const Transition t  )  [inline, virtual]

Remove a Transition.

Returns:
True if transition did exist

Reimplemented from faudes::TBaseSet< Transition, Cmp >.

Reimplemented in faudes::TaTransSet< Attr >.

Definition at line 1333 of file cfl_transset.h.

template<class Cmp >
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.

Parameters:
ev Event index

Reimplemented in faudes::TaTransSet< Attr >.

Definition at line 1384 of file cfl_transset.h.

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

Remove all transitions containing predecessor state x1.

Parameters:
x1 State index
Exceptions:
Exception 
  • sorting mismatch (id 68)

Reimplemented in faudes::TaTransSet< Attr >.

Definition at line 1351 of file cfl_transset.h.

template<class Cmp >
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.

Parameters:
rStates Set of states to remore

Reimplemented in faudes::TaTransSet< Attr >.

Definition at line 1420 of file cfl_transset.h.

template<class Cmp >
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.

Parameters:
x State index

Reimplemented in faudes::TaTransSet< Attr >.

Definition at line 1402 of file cfl_transset.h.

template<class Cmp >
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.

Parameters:
x2 State index

Reimplemented in faudes::TaTransSet< Attr >.

Definition at line 1368 of file cfl_transset.h.

template<class Cmp >
bool faudes::TTransSet< Cmp >::Exists ( Idx  x  )  const [inline]

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

Parameters:
x State Idx
Returns:
bool

Definition at line 1459 of file cfl_transset.h.

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

Test existence.

Parameters:
x1 Predecessor state Idx
ev Event Idx
x2 Successor state Idx
Returns:
bool

Definition at line 1454 of file cfl_transset.h.

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

Test existence.

Parameters:
t Transition
Returns:
bool

Reimplemented from faudes::TBaseSet< Transition, Cmp >.

Definition at line 1449 of file cfl_transset.h.

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

Find specified transition.

Parameters:
t Transition
Returns:
Iterator to transition or End() if not exists

Reimplemented from faudes::TBaseSet< Transition, Cmp >.

Definition at line 1444 of file cfl_transset.h.

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

Find transition given by x1, ev, x2.

Parameters:
x1 Predecessor state
ev Event
x2 Successor state
Returns:
Iterator to transition or End() if not exists

Definition at line 1438 of file cfl_transset.h.

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

Add a Transition by indices.

Parameters:
x1 Predecessor state
ev Event
x2 Successor state
Returns:
True if the transition was new to the set

Reimplemented in faudes::TaTransSet< Attr >.

Definition at line 1327 of file cfl_transset.h.

template<class Cmp >
bool faudes::TTransSet< Cmp >::Insert ( const Transition rTransition  )  [inline, virtual]

Add a Transition.

doxygen group

Parameters:
rTransition Reference to transition object
Returns:
True if the transition was new to the set

Reimplemented from faudes::TBaseSet< Transition, Cmp >.

Reimplemented in faudes::TaTransSet< Attr >.

Definition at line 1322 of file cfl_transset.h.

template<class Cmp >
template<class OtherCmp >
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

Returns:
Transition relation

Definition at line 1473 of file cfl_transset.h.

template<class Cmp >
StateSet faudes::TTransSet< Cmp >::StateSpace ( void   )  const [inline]

Get state space covered by transition set.

Returns:
Set of state indices used by some transition

Definition at line 1482 of file cfl_transset.h.

template<class Cmp >
StateSet faudes::TTransSet< Cmp >::StateSpaceX2 ( Idx  x1,
Idx  ev 
) const [inline]

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

Parameters:
x1 Current state
ev Event
Returns:
Set of state indices

Definition at line 1505 of file cfl_transset.h.

template<class Cmp >
StateSet faudes::TTransSet< Cmp >::StateSpaceX2 ( Idx  x1  )  const [inline]

Get set of successor states for specified current state.

Parameters:
x1 Current state
Returns:
Set of state indices

Definition at line 1493 of file cfl_transset.h.

template<class Cmp = TransSort::X1EvX2>
std::string faudes::TTransSet< Cmp >::Str ( const Transition rTrans  )  const [inline, virtual]

Return pretty printable string representation.

Primary meant for debugging messages.

Parameters:
rTrans Transition to print
Returns:
String

Reimplemented from faudes::TBaseSet< Transition, Cmp >.

Definition at line 767 of file cfl_transset.h.


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

libFAUDES 2.18b --- 2010-12-17 --- c++ source docu by doxygen 1.6.3