DiaDes  0.1
DIAgnosisofDiscrete-EventSystem
Public Types | Public Member Functions | Private Attributes | Friends | List of all members
Diades::Altarica::Transition Class Reference

Internal structure for an Altarica Transition. More...

#include <Transition.hh>

Public Types

typedef reference_wrapper< TransitionReference
 
typedef reference_wrapper< Transition const > ConstReference
 
typedef TransitionPointer
 
typedef const TransitionConstPointer
 

Public Member Functions

 Transition (NodeDecl &owner, const Expression &precondition)
 
 Transition (const Transition &transition)
 
 ~Transition ()
 
void setPrecondition (const Expression &expr)
 
const NodeDeclowner () const
 
bool valid () const
 
void addTarget (const list< EventDecl::ConstReference > &triggerEventDecls, const list< Assignment::ConstReference > &assignments)
 
const Expressionprecondition () const
 
unsigned numberOfTargets () const
 
unsigned firstTargetIndex () const
 
unsigned lastTargetIndex () const
 
const list< EventDecl::ConstReference > & getEventDeclsOfTargetAtIndex (unsigned index) const
 
const list< Assignment::ConstReference > & getPostConditionOfTargetAtIndex (unsigned index) const
 

Private Attributes

vector< list< EventDecl::ConstReference > > _triggerEventDecls
 
vector< list< Assignment::ConstReference > > _assignments
 
Expression::ConstReference _precondition
 
NodeDecl_owner
 

Friends

ostream & operator<< (ostream &os, const Transition &transition)
 

Exception

Exception mechanism

typedef Utils::Exception< TransitionException
 
static string typeName ()
 

Detailed Description

Internal structure for an Altarica Transition.

A Transition stores an altarica transition. (It is not an encoded version, just an raw internal storage of a Transition with of a set of Expression objects and EventDecl).

Definition at line 36 of file Transition.hh.

Member Typedef Documentation

◆ ConstPointer

Definition at line 42 of file Transition.hh.

◆ ConstReference

typedef reference_wrapper<Transition const> Diades::Altarica::Transition::ConstReference

Definition at line 40 of file Transition.hh.

◆ Exception

Definition at line 55 of file Transition.hh.

◆ Pointer

Definition at line 41 of file Transition.hh.

◆ Reference

Definition at line 39 of file Transition.hh.

Constructor & Destructor Documentation

◆ Transition() [1/2]

Diades::Altarica::Transition::Transition ( NodeDecl owner,
const Expression precondition 
)

Constructor

Parameters
ownerthe NodeDecl where the Transition is declared
preconditionthe precondition of the Transition

Referenced by typeName().

◆ Transition() [2/2]

Diades::Altarica::Transition::Transition ( const Transition transition)

Copy constructor

Parameters
transition

◆ ~Transition()

Diades::Altarica::Transition::~Transition ( )

Destructor

Referenced by typeName().

Member Function Documentation

◆ addTarget()

void Diades::Altarica::Transition::addTarget ( const list< EventDecl::ConstReference > &  triggerEventDecls,
const list< Assignment::ConstReference > &  assignments 
)

Add new targets of the given precondition

Parameters
triggerEventDeclsthe set of eventDecl that can be triggered
assignmentsthe common postcondition if one of the event is triggered

A target is a triple (precondition,{event1,...,eventn},postcondition). It also means that a target contains n effective transitions, namely:

(precondition,event1,postcondition) ... (precondition,eventn,postcondition).

Referenced by typeName().

◆ firstTargetIndex()

unsigned Diades::Altarica::Transition::firstTargetIndex ( ) const
inline
Returns
the index of the first target stored in Transition.

Definition at line 154 of file Transition.hh.

◆ getEventDeclsOfTargetAtIndex()

const list<EventDecl::ConstReference>& Diades::Altarica::Transition::getEventDeclsOfTargetAtIndex ( unsigned  index) const
inline
Parameters
indexindex of a target
Returns
the set of events belonging to the target of index 'index'

Definition at line 174 of file Transition.hh.

◆ getPostConditionOfTargetAtIndex()

const list<Assignment::ConstReference>& Diades::Altarica::Transition::getPostConditionOfTargetAtIndex ( unsigned  index) const
inline
Parameters
indexindex of a target
Returns
the set of Assignment objects that defines the postcondition of the target defined at index.

Definition at line 188 of file Transition.hh.

References operator<<.

◆ lastTargetIndex()

unsigned Diades::Altarica::Transition::lastTargetIndex ( ) const
inline
Returns
the index of the last target stored in Transition.

Definition at line 163 of file Transition.hh.

◆ numberOfTargets()

unsigned Diades::Altarica::Transition::numberOfTargets ( ) const
inline
Returns
the underlying number of targets that the current Transition stores. A target is a triple (precondition,{event1,...,eventn},postcondition). It also means that a target contains n effective transitions, namely:

(precondition,event1,postcondition) ... (precondition,eventn,postcondition).

Definition at line 146 of file Transition.hh.

◆ owner()

const NodeDecl& Diades::Altarica::Transition::owner ( ) const
Returns
the NodeDecl where the Transition is declared

Referenced by typeName().

◆ precondition()

const Expression& Diades::Altarica::Transition::precondition ( ) const
inline
Returns
the precondition of the Transition

Definition at line 133 of file Transition.hh.

References _precondition.

Referenced by typeName().

◆ setPrecondition()

void Diades::Altarica::Transition::setPrecondition ( const Expression expr)

Modify the precondition of the Transition

Parameters
exprthe new precondition

Referenced by typeName().

◆ typeName()

static string Diades::Altarica::Transition::typeName ( )
inlinestatic

◆ valid()

bool Diades::Altarica::Transition::valid ( ) const
Returns
true if the Transition is valid (i.e. a proper owner, precondition and a non-empty set of Events with the postcondition)

Referenced by typeName().

Friends And Related Function Documentation

◆ operator<<

ostream& operator<< ( ostream &  os,
const Transition transition 
)
friend

Output stream operator

Parameters
osoutput stream to update
transitionthe Transition to print out
Returns
the output stream

Referenced by getPostConditionOfTargetAtIndex().

Member Data Documentation

◆ _assignments

vector< list<Assignment::ConstReference> > Diades::Altarica::Transition::_assignments
private

Definition at line 47 of file Transition.hh.

◆ _owner

NodeDecl& Diades::Altarica::Transition::_owner
private

Definition at line 49 of file Transition.hh.

◆ _precondition

Expression::ConstReference Diades::Altarica::Transition::_precondition
private

Definition at line 48 of file Transition.hh.

Referenced by precondition().

◆ _triggerEventDecls

vector< list<EventDecl::ConstReference> > Diades::Altarica::Transition::_triggerEventDecls
private

Definition at line 46 of file Transition.hh.


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