DiaDes  0.1
DIAgnosis of Discrete-Event System
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | Friends | List of all members
Diades::Sdmdl::Assignment Class Reference

#include <Assignment.hh>

Public Types

typedef Diades::Utils::Exception< AssignmentException
 

Public Member Functions

 Assignment ()
 
bool valid () const
 
 Assignment (const Variable &var, const Value &val)
 
 Assignment (const Assignment &assignment)
 
virtual ~Assignment ()
 
void setVariable (const Variable &var)
 
void setValue (const Value &val)
 
const Variablevariable () const
 
const Valuevalue () const
 
Assignmentoperator= (const Assignment &assign)
 
bool operator== (const Assignment &assignment) const
 
bool operator< (const Assignment &assignment) const
 
void unvalidate ()
 

Static Public Member Functions

static string typeName ()
 

Private Attributes

Variable _variable
 
Value _value
 

Friends

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

Detailed Description

An assignment var = val where var is a Variable and val is a Value

Definition at line 23 of file Assignment.hh.

Member Typedef Documentation

◆ Exception

Definition at line 26 of file Assignment.hh.

Constructor & Destructor Documentation

◆ Assignment() [1/3]

Diades::Sdmdl::Assignment::Assignment ( )
inline

Definition at line 39 of file Assignment.hh.

Referenced by valid().

◆ Assignment() [2/3]

Diades::Sdmdl::Assignment::Assignment ( const Variable var,
const Value val 
)

Constructor of an Assignment.

Create an assignment (var = val) if both parameters are valid and var.containsValue(val), the created assignement is invalid otherwise.

Parameters
vara Variable
vala Value

◆ Assignment() [3/3]

Diades::Sdmdl::Assignment::Assignment ( const Assignment assignment)
inline

Copy constructor

Parameters
assignmentan Assignment

Definition at line 66 of file Assignment.hh.

◆ ~Assignment()

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

Destructor

Definition at line 75 of file Assignment.hh.

References setValue(), and setVariable().

Member Function Documentation

◆ operator<()

bool Diades::Sdmdl::Assignment::operator< ( const Assignment assignment) const
Parameters
assignment
Returns

Referenced by operator==().

◆ operator=()

Assignment& Diades::Sdmdl::Assignment::operator= ( const Assignment assign)
inline
Parameters
assign
Returns

Definition at line 129 of file Assignment.hh.

References _value, and _variable.

◆ operator==()

bool Diades::Sdmdl::Assignment::operator== ( const Assignment assignment) const
inline
Parameters
assignment
Returns

Definition at line 146 of file Assignment.hh.

References _value, _variable, operator<(), and valid().

◆ setValue()

void Diades::Sdmdl::Assignment::setValue ( const Value val)

Set the Value of the current Assignment. If the Value is valid and is a possible Value of the variable(), set the Assignment to (variable() = val). The Assignment is invalid otherwise

Parameters
valthe Value to assign

Referenced by ~Assignment().

◆ setVariable()

void Diades::Sdmdl::Assignment::setVariable ( const Variable var)

Set the Variable of the current Assignment. If the Variable is valid, and a default Value is available for this Variable, set the Assignment to (var = var.defaultValue). The Assignment is invalid otherwise

Parameters
vara Variable

Referenced by ~Assignment().

◆ typeName()

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

Definition at line 27 of file Assignment.hh.

◆ unvalidate()

void Diades::Sdmdl::Assignment::unvalidate ( )
inline

Definition at line 165 of file Assignment.hh.

References operator<<.

◆ valid()

bool Diades::Sdmdl::Assignment::valid ( ) const
inline
Returns

Definition at line 47 of file Assignment.hh.

References Assignment().

Referenced by operator==().

◆ value()

const Value& Diades::Sdmdl::Assignment::value ( ) const
inline
Returns
the underlying Value of the Assignment

Definition at line 116 of file Assignment.hh.

References _value.

◆ variable()

const Variable& Diades::Sdmdl::Assignment::variable ( ) const
inline
Returns
the underlying Variable of the Assignment

Definition at line 104 of file Assignment.hh.

References _variable.

Friends And Related Function Documentation

◆ operator<<

ostream& operator<< ( ostream &  os,
const Assignment assign 
)
friend
Parameters
os
assign
Returns

Referenced by unvalidate().

Member Data Documentation

◆ _value

Value Diades::Sdmdl::Assignment::_value
private

Definition at line 31 of file Assignment.hh.

Referenced by operator=(), operator==(), and value().

◆ _variable

Variable Diades::Sdmdl::Assignment::_variable
private

Definition at line 30 of file Assignment.hh.

Referenced by operator=(), operator==(), and variable().


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