libFAUDES

Sections

Index

faudes::TaTransSet< Attr > Class Template Reference
[State, Event and Transition Set]

#include <transset.h>

Inherits faudes::TTransSet, and faudes::TaBaseSet< faudes::Transition, Attr, faudes::TransSort::X1EvX2 >.

List of all members.


Detailed Description

template<class Attr>
class faudes::TaTransSet< Attr >

Set of Transitions with attributes.

This container class is derived from TTransSet to provide attributes as an additional feature. As with TaBaseSet, the template parameter specifies the attribute class, which in turn must provide some basic funtionality. In contrast to the TTransSet, the TaTransSet is restricted to standard ordering.

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

Definition at line 842 of file transset.h.


Accessing individual transitions

typedef TTransSet
< TransSort::X1EvX2 >
::Iterator 
Iterator
 Iterator on transition.
void Clear (void)
 Clear all transitions incl attributes.
bool Insert (Idx x1, Idx ev, Idx x2)
 Add a Transition by indices.
bool Insert (const Transition &rTransition)
 Add a Transition directly.
bool Insert (const Transition &rTransition, const Attr &rAttr)
 Add a Transition with attribute.
virtual void InsertSet (const TransSet &rOtherSet)
 Inserts transitions of rOtherSet.
virtual void InsertSet (const TaTransSet &rOtherSet)
 Inserts transitions of rOtherSet.
bool Erase (const Transition &t)
 Remove a Transition.
bool Erase (Idx x1, Idx ev, Idx x2)
 Remove a Transition.
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.
void EraseByX1OrX2 (const StateSet &rStateSet)
 Remove all transitions containing a specified state.
void EraseSet (const TransSet &rOtherSet)
 Erase elements given by other set.
void RestrictSet (const TransSet &rOtherSet)
 Restrict to specified subset.
virtual void Attributes (const TransSet &rOtherSet)
 Set attributes.
virtual void Attributes (const TaTransSet &rOtherSet)
 Set attributes.

Public Member Functions

virtual TaTransSetNew (void) const
 Faudes Type interface.
virtual TaTransSetCopy (void) const
 Faudes Type interface.
virtual const TaTransSetCast (const Type *pOther) const
 Faudes Type interface.
virtual TaTransSetAssign (const Type &rSrc)
 Assign configuration data from other object.
virtual bool Equal (const Type &rOther) const
 Test equality of configuration data.
virtual TaTransSetoperator= (const TaTransSet &rSrc)
virtual bool operator== (const TaTransSet &rOther) const
virtual bool operator!= (const TaTransSet &rOther) const
Constructors & Destructor
We implement "protected privacy for template classes" by friendship.

This is used for the pragmatic implemention conversion constructors.

 TaTransSet (void)
 Construct an empty TaTransSet object.
 TaTransSet (const TaTransSet &rOtherSet)
 Copy-constructor (incl attributes).
 TaTransSet (const TTransSet< TransSort::X1EvX2 > &rOtherSet)
 Copy-Constructor (set attributes to default).
virtual ~TaTransSet ()
 Virtual destructor.
virtual TaTransSetAssign (const TransSet &rSrc)
 Relaxed assignment method.
virtual TaTransSetoperator= (const TransSet &rSrc)
 Relaxed assignment operator.

Protected Member Functions

virtual TaTransSetDoAssign (const TaTransSet &rSource)
 Assign my members.

Member Typedef Documentation

template<class Attr>
typedef TTransSet<TransSort::X1EvX2>::Iterator faudes::TaTransSet< Attr >::Iterator

Iterator on transition.

Reimplemented from faudes::TaBaseSet< T, Attr, Cmp >.

Definition at line 902 of file transset.h.


Constructor & Destructor Documentation

template<class Attr>
faudes::TaTransSet< Attr >::TaTransSet ( void   )  [inline]

Construct an empty TaTransSet object.

doxygen group

Definition at line 1560 of file transset.h.

template<class Attr>
faudes::TaTransSet< Attr >::TaTransSet ( const TaTransSet< Attr > &  rOtherSet  )  [inline]

Copy-constructor (incl attributes).

Definition at line 1569 of file transset.h.

template<class Attr>
faudes::TaTransSet< Attr >::TaTransSet ( const TTransSet< TransSort::X1EvX2 > &  rOtherSet  )  [inline]

Copy-Constructor (set attributes to default).

Definition at line 1580 of file transset.h.

template<class Attr>
virtual faudes::TaTransSet< Attr >::~TaTransSet (  )  [inline, virtual]

Virtual destructor.

Definition at line 871 of file transset.h.


Member Function Documentation

template<class Attr>
TaTransSet< Attr > * faudes::TaTransSet< Attr >::New ( void   )  const [inline, virtual]

Faudes Type interface.

Construct object of same type on heap.

Reimplemented from faudes::TaBaseSet< T, Attr, Cmp >.

Definition at line 1557 of file transset.h.

template<class Attr>
TaTransSet< Attr > * faudes::TaTransSet< Attr >::Copy ( void   )  const [inline, virtual]

Faudes Type interface.

Construct copy on heap.

Reimplemented from faudes::TaBaseSet< T, Attr, Cmp >.

Definition at line 1557 of file transset.h.

template<class Attr>
const TaTransSet< Attr > * faudes::TaTransSet< Attr >::Cast ( const Type pType  )  const [inline, virtual]

Faudes Type interface.

Cast object to my type.

Reimplemented from faudes::TaBaseSet< T, Attr, Cmp >.

Definition at line 1557 of file transset.h.

template<class Attr>
TaTransSet< Attr > & faudes::TaTransSet< Attr >::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.

Parameters:
rSrc Source to copy from
Returns:
Reference to this object.

Reimplemented from faudes::TTransSet< Cmp >.

Definition at line 1557 of file transset.h.

template<class Attr>
bool faudes::TaTransSet< Attr >::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.

Parameters:
rOther Other objevt to compare with.
Returns:
True on match.

Reimplemented from faudes::TTransSet< Cmp >.

Definition at line 1557 of file transset.h.

template<class Attr>
TaTransSet< Attr > & faudes::TaTransSet< Attr >::operator= ( const TaTransSet< Attr > &  rSrc  )  [inline, virtual]

Definition at line 1557 of file transset.h.

template<class Attr>
bool faudes::TaTransSet< Attr >::operator== ( const TaTransSet< Attr > &  rOther  )  const [inline, virtual]

Definition at line 1557 of file transset.h.

template<class Attr>
bool faudes::TaTransSet< Attr >::operator!= ( const TaTransSet< Attr > &  rOther  )  const [inline, virtual]

Definition at line 1557 of file transset.h.

template<class Attr>
TaTransSet< Attr > & faudes::TaTransSet< Attr >::Assign ( const TransSet rSrc  )  [inline, virtual]

Relaxed assignment method.

Maintains attributes provided they can be casted.

Parameters:
rSrc Source from which to assign
Returns:
Ref to this set

Definition at line 1599 of file transset.h.

template<class Attr>
TaTransSet< Attr > & faudes::TaTransSet< Attr >::operator= ( const TransSet rSrc  )  [inline, virtual]

Relaxed assignment operator.

Maintains attributes provided they can be casted.

Parameters:
rSrc Source from which to assign
Returns:
Ref to this set

Definition at line 1610 of file transset.h.

template<class Attr>
void faudes::TaTransSet< Attr >::Clear ( void   )  [inline, virtual]

Clear all transitions incl attributes.

doxygen group

Reimplemented from faudes::TaBaseSet< T, Attr, Cmp >.

Definition at line 1615 of file transset.h.

template<class Attr>
bool faudes::TaTransSet< Attr >::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 from faudes::TTransSet< Cmp >.

Definition at line 1627 of file transset.h.

template<class Attr>
bool faudes::TaTransSet< Attr >::Insert ( const Transition rTransition  )  [inline]

Add a Transition directly.

If the transition already exists, the attribute is maintained. Otherwise, the transition is inserted with default attribute.

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

Reimplemented from faudes::TTransSet< Cmp >.

Definition at line 1621 of file transset.h.

template<class Attr>
bool faudes::TaTransSet< Attr >::Insert ( const Transition rTransition,
const Attr &  rAttr 
) [inline]

Add a Transition with attribute.

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

Definition at line 1634 of file transset.h.

template<class Attr>
void faudes::TaTransSet< Attr >::InsertSet ( const TransSet rOtherSet  )  [inline, virtual]

Inserts transitions of rOtherSet.

Attributes of this set are maintained, newly inserted transitions have default attribute.

Parameters:
rOtherSet Other IndexSet

Definition at line 1645 of file transset.h.

template<class Attr>
void faudes::TaTransSet< Attr >::InsertSet ( const TaTransSet< Attr > &  rOtherSet  )  [inline, virtual]

Inserts transitions of rOtherSet.

Attributes of this set are maintained, new transitions are inserted with attribute.

Parameters:
rOtherSet Other IndexSet

Definition at line 1639 of file transset.h.

template<class Attr>
bool faudes::TaTransSet< Attr >::Erase ( const Transition t  )  [inline]

Remove a Transition.

Returns:
True if transition did exist

Reimplemented from faudes::TTransSet< Cmp >.

Definition at line 1652 of file transset.h.

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

Remove a Transition.

Returns:
True if transition did exist

Reimplemented from faudes::TTransSet< Cmp >.

Definition at line 1657 of file transset.h.

template<class Attr>
TaTransSet< Attr >::Iterator faudes::TaTransSet< Attr >::Erase ( const Iterator it  )  [inline, virtual]

Remove a Transition by iterator.

Returns:
Iterator to next transition

Reimplemented from faudes::TaBaseSet< T, Attr, Cmp >.

Definition at line 1664 of file transset.h.

template<class Attr>
void faudes::TaTransSet< Attr >::EraseByX1 ( Idx  x1  )  [inline]

Remove all transitions containing predecessor state x1.

Parameters:
x1 State index

Reimplemented from faudes::TTransSet< Cmp >.

Definition at line 1676 of file transset.h.

template<class Attr>
void faudes::TaTransSet< Attr >::EraseByX2 ( Idx  x2  )  [inline]

Remove all transitions containing successor state x2.

Parameters:
x2 State index

Reimplemented from faudes::TTransSet< Cmp >.

Definition at line 1691 of file transset.h.

template<class Attr>
void faudes::TaTransSet< Attr >::EraseByEv ( Idx  ev  )  [inline]

Remove all transitions containing event ev.

Parameters:
ev Event index

Reimplemented from faudes::TTransSet< Cmp >.

Definition at line 1708 of file transset.h.

template<class Attr>
void faudes::TaTransSet< Attr >::EraseByX1OrX2 ( Idx  x  )  [inline]

Remove all transitions containing state x.

Parameters:
x State index

Reimplemented from faudes::TTransSet< Cmp >.

Definition at line 1726 of file transset.h.

template<class Attr>
void faudes::TaTransSet< Attr >::EraseByX1OrX2 ( const StateSet rStateSet  )  [inline]

Remove all transitions containing a specified state.

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

Parameters:
rStateSet Set of states to remore

Reimplemented from faudes::TTransSet< Cmp >.

Definition at line 1744 of file transset.h.

template<class Attr>
void faudes::TaTransSet< Attr >::EraseSet ( const TransSet rOtherSet  ) 

Erase elements given by other set.

This function ignores the attributes of the other set and maintains the attributes of the remaining elements in this set.

Parameters:
rOtherSet Elements to erase

template<class Attr>
void faudes::TaTransSet< Attr >::RestrictSet ( const TransSet rOtherSet  ) 

Restrict to specified subset.

Erases any elements no in the specified set. This function ignores the attributes of the other set and maintains the attributes of the remaining elements in this set.

Parameters:
rOtherSet Elements to erase

template<class Attr>
void faudes::TaTransSet< Attr >::Attributes ( const TransSet rOtherSet  )  [inline, virtual]

Set attributes.

Provided that rOtherSet has attributes that can be casted to the appropriate type, attributes are copied per element from rOtherSet. Elements of this set which are not in rOtherSet maintain their attribute.

Parameters:
rOtherSet Other IndexSet
Exceptions:
Exception 
  • Element does not exist (63)
  • Cannot cast attribute type (63)

Definition at line 1768 of file transset.h.

template<class Attr>
void faudes::TaTransSet< Attr >::Attributes ( const TaTransSet< Attr > &  rOtherSet  )  [inline, virtual]

Set attributes.

Attributes are copied per element from rOtherSet. Elements of this set which are not in rOtherSet maintain their attribute.

Parameters:
rOtherSet Other IndexSet

Definition at line 1762 of file transset.h.

template<class Attr>
TaTransSet< Attr > & faudes::TaTransSet< Attr >::DoAssign ( const TaTransSet< Attr > &  rSource  )  [inline, protected, virtual]

Assign my members.

Maintain attributes.

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

Definition at line 1591 of file transset.h.


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

libFAUDES 2.14g --- 2009-12-3 --- c++ source docu by doxygen 1.5.6