libFAUDES

Sections

Index

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

#include <transset.h>

Inherits faudes::TTransSet.

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)

Public Member Functions

Constructors & Destructor
 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 TaTransSetNew (void) const
 Construct on heap with same type.
virtual TaTransSetoperator= (const TaTransSet &rSrc)
 Assignment operator (uses copy).
virtual TaTransSetoperator= (const TransSet &rSrc)
 Assignment operator (uses copy).
virtual void Copy (TaTransSet< Attr > &rOtherSet) const
 Copy to other transition set with same attribute type.
virtual void Copy (TransSet &rOtherSet) const
 Copy to other transition set.
virtual ~TaTransSet ()
 Virtual destructor.
Basic maintenance
void Clear (void)
 Clear all transitions incl attributes.
virtual void ClearAttributes (void)
 clear all attributes
virtual Idx AttributesSize (void) const
 Get number of explicit (non-default) attributes.
virtual const Attr * Attributep (void) const
 Attribute typeinfo.
virtual const AttributeVoidAttribute (void) const
 Attribute typeinfo.
virtual bool AttributeTry (const Type &rAttr) const
 Attribute typeinfo.
Accessing individual transitions
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.
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.
virtual Attr * Attributep (const Transition &rTrans)
 Get attribute reference by transition.
virtual const Attr & Attribute (const Transition &rTrans) const
 Get const reference to attribute by transition.
virtual void Attribute (const Transition &rTrans, const Attr &rAttr)
 Set attribute.
virtual void Attribute (const Transition &rTrans, const Type &rAttr)
 Set attribute.
virtual void AttributeTry (const Transition &rTrans, const Type &rAttr)
 Set attribute.
virtual void Attributes (const TransSet &rOtherSet)
 Set attributes.
virtual void Attributes (const TaTransSet &rOtherSet)
 Set attributes.
virtual void ClrAttribute (const Transition &rTrans)
 Clear attribute to default.

Protected Attributes

std::map< Transition, Attr > mAttributeMap
 Stored attributes.

Static Protected Attributes

static Attr mDefAttribute
 default attribute

Friends

class TaTransSet
 We implement "protected privacy for template classes" by friendship.


Constructor & Destructor Documentation

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

Construct an empty TaTransSet object.

doxygen group

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

Copy-constructor (incl attributes).

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

Copy-Constructor (set attributes to default).

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

Virtual destructor.


Member Function Documentation

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

Construct on heap with same type.

Returns:
Pointer to new TTransSet

Reimplemented from faudes::TTransSet< Cmp >.

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

Assignment operator (uses copy).

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

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

Assignment operator (uses copy).

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

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

Copy to other transition set with same attribute type.

Parameters:
rOtherSet Destination set

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

Copy to other transition set.

This function maintains attributes if types can be casted.

Parameters:
rOtherSet Destination set

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

Clear all transitions incl attributes.

doxygen group

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

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

clear all attributes

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

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

Get number of explicit (non-default) attributes.

Returns:
Number of entries in mAttributeMap

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

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

Attribute typeinfo.

Returns:
Pointer to some attribute of this sets attribute type

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

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

Attribute typeinfo.

Returns:
Reference to some attribute of this sets attribute type

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

template<class Attr>
virtual bool faudes::TaTransSet< Attr >::AttributeTry ( const Type rAttr  )  const [inline, virtual]

Attribute typeinfo.

This set accepts all attributes that we can cast to our attribute type.

Parameters:
rAttr Attribute type to test.
Returns:
True, if attribute type is accepted.

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

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

Add a Transition by indices.

doxygen group

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

Reimplemented from faudes::TTransSet< Cmp >.

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

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

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

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

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::TTransSet< Cmp >.

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

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

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

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

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

template<class Attr>
Attr * faudes::TaTransSet< Attr >::Attributep ( const Transition rTrans  )  [inline, virtual]

Get attribute reference by transition.

Note that in order to produce a non-const reference this method will insert an explicit default attribute if necessary. If a const reference is sufficient, you should use Attribute(Idx) const instead.

Parameters:
rTrans Transition
Returns:
Transition attribute

template<class Attr>
const Attr & faudes::TaTransSet< Attr >::Attribute ( const Transition rTrans  )  const [inline, virtual]

Get const reference to attribute by transition.

Parameters:
rTrans Transition
Returns:
Transition attribute

template<class Attr>
void faudes::TaTransSet< Attr >::Attribute ( const Transition rTrans,
const Attr &  rAttr 
) [inline, virtual]

Set attribute.

Sets the attribute of the sepcified element to the given value.

Parameters:
rTrans Transition to specify element
rAttr Attribute value
Exceptions:
Exception 
  • Element does not exist (63)

template<class Attr>
void faudes::TaTransSet< Attr >::Attribute ( const Transition rTrans,
const Type rAttr 
) [inline, virtual]

Set attribute.

Sets the attribute of the sepcified element to the given value, provided that it can be dynamically casted. Throws an exception otherwise.

Parameters:
rTrans Transition to specify element
rAttr Attribute value
Exceptions:
Exception 
  • Element does not exist (63)
  • Cannot cast attribute type (63)

template<class Attr>
void faudes::TaTransSet< Attr >::AttributeTry ( const Transition rTrans,
const Type rAttr 
) [inline, virtual]

Set attribute.

Sets the attribute of the sepcified element to the given value, provided that it can be dynamically casted.

Parameters:
rTrans Transition to specify element
rAttr Attribute value
Exceptions:
Exception 
  • Element does not exist (63)

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)

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

template<class Attr>
void faudes::TaTransSet< Attr >::ClrAttribute ( const Transition rTrans  )  [inline, virtual]

Clear attribute to default.

Parameters:
rTrans Transition


Friends And Related Function Documentation

template<class Attr>
friend class TaTransSet [friend]

We implement "protected privacy for template classes" by friendship.

This is used for the pragmatic implemention conversion constructors.


Member Data Documentation

template<class Attr>
std::map<Transition,Attr> faudes::TaTransSet< Attr >::mAttributeMap [protected]

Stored attributes.


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

libFAUDES 2.13a c++ source docu by doxygen 1.5.6