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

Altarica assignments like x:=y. More...

#include <Assignment.hh>

Public Types

typedef reference_wrapper< AssignmentReference
 
typedef reference_wrapper< Assignment const > ConstReference
 
typedef AssignmentPointer
 
typedef const AssignmentConstPointer
 

Public Member Functions

 Assignment ()
 
 Assignment (const NodeDecl &owner, const Expression &memberAccess, const Expression &assignedValue)
 
virtual ~Assignment ()
 
void setMemberAccess (const Expression &memberAccess)
 
void setValue (const Expression &assignedValue)
 
void setOwner (const NodeDecl &owner)
 
const ExpressionmemberAccess () const
 
const ExpressionassignedValue () const
 
const NodeDeclowner () const
 
bool operator== (const Assignment &assignment) const
 
bool valid () const
 

Private Attributes

Expression::ExprVector _memberAccess
 
Expression::ExprVector _assignedValue
 
vector< reference_wrapper< NodeDecl const > > _owner
 

Friends

ostream & operator<< (ostream &os, const Assignment &assignment)
 

Exception

Exception mechanism

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

Detailed Description

Altarica assignments like x:=y.

This class implements an Altarica assignment like x:=y. Both x and y are expressions. x characterises the variable to assign and y the value to assign to x.

Definition at line 38 of file Assignment.hh.

Member Typedef Documentation

◆ ConstPointer

Definition at line 44 of file Assignment.hh.

◆ ConstReference

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

Definition at line 42 of file Assignment.hh.

◆ Exception

Definition at line 56 of file Assignment.hh.

◆ Pointer

Definition at line 43 of file Assignment.hh.

◆ Reference

Definition at line 41 of file Assignment.hh.

Constructor & Destructor Documentation

◆ Assignment() [1/2]

Diades::Altarica::Assignment::Assignment ( )
inline

Default constructor

Definition at line 65 of file Assignment.hh.

References assignedValue(), memberAccess(), and owner().

◆ Assignment() [2/2]

Diades::Altarica::Assignment::Assignment ( const NodeDecl owner,
const Expression memberAccess,
const Expression assignedValue 
)

Constructor

Parameters
ownerthe node declaration containing this assignment
memberAccessthe variable to assign (an Expression whose scope is a VariableDecl to be assigned)
assignedValuethe value to assign to the variable (an Expression that will be evaluated to get the Value to assign to the Variable supported by the Expression memberAccess)
Precondition
memberAccess.category()==Expression::Var

◆ ~Assignment()

virtual Diades::Altarica::Assignment::~Assignment ( )
inlinevirtual

Destructor

Definition at line 82 of file Assignment.hh.

References setMemberAccess(), and setValue().

Member Function Documentation

◆ assignedValue()

const Expression& Diades::Altarica::Assignment::assignedValue ( ) const
inline
Returns
the Expression characterising the Value to assign to the Variable

Definition at line 129 of file Assignment.hh.

References require, and valid().

Referenced by Assignment().

◆ memberAccess()

const Expression& Diades::Altarica::Assignment::memberAccess ( ) const
inline
Returns
the expressioon characterising the Variable to be assigned

Definition at line 117 of file Assignment.hh.

References require, and valid().

Referenced by Assignment().

◆ operator==()

bool Diades::Altarica::Assignment::operator== ( const Assignment assignment) const

Equality operator

Parameters
assignmentthe Assignment to compare
Returns
true if both Assignments are equal

Referenced by owner().

◆ owner()

const NodeDecl& Diades::Altarica::Assignment::owner ( ) const
inline
Returns
the node declaration containing this Assignment

Definition at line 142 of file Assignment.hh.

References operator<<, operator==(), require, and valid().

Referenced by Diades::Altarica::NodeDecl::addInitialisation(), and Assignment().

◆ setMemberAccess()

void Diades::Altarica::Assignment::setMemberAccess ( const Expression memberAccess)

Set the assigned variable designed by the given Expression

Parameters
memberAccessthe Expression designing the Variable to assign
Precondition
memberAccess.category()==Expression::Var

Referenced by ~Assignment().

◆ setOwner()

void Diades::Altarica::Assignment::setOwner ( const NodeDecl owner)
inline
Parameters
ownerthe owner of the Assignment

Definition at line 105 of file Assignment.hh.

◆ setValue()

void Diades::Altarica::Assignment::setValue ( const Expression assignedValue)

Set the Value to assign to the Variable

Parameters
assignedValuethe value to assign (result of the Expression evaluations).

Referenced by ~Assignment().

◆ typeName()

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

Definition at line 57 of file Assignment.hh.

◆ valid()

bool Diades::Altarica::Assignment::valid ( ) const
Returns
true if the Assignment is valid. (Both underlying expression are valid.)

Referenced by Diades::Altarica::NodeDecl::addInitialisation(), assignedValue(), memberAccess(), and owner().

Friends And Related Function Documentation

◆ operator<<

ostream& operator<< ( ostream &  os,
const Assignment assignment 
)
friend

Stream operator

Parameters
osoutput stream
assignmentAssignment to assign
Returns
the update output stream

Referenced by owner().

Member Data Documentation

◆ _assignedValue

Expression::ExprVector Diades::Altarica::Assignment::_assignedValue
private

Definition at line 48 of file Assignment.hh.

◆ _memberAccess

Expression::ExprVector Diades::Altarica::Assignment::_memberAccess
private

Definition at line 47 of file Assignment.hh.

◆ _owner

vector< reference_wrapper<NodeDecl const> > Diades::Altarica::Assignment::_owner
private

Definition at line 49 of file Assignment.hh.


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