DiaDes
0.1
DIAgnosis of Discrete-Event System
|
#include <Variable.hh>
Public Types | |
typedef Utils::Exception< Variable > | Exception |
typedef std::reference_wrapper< Variable const > | ConstReference |
typedef std::reference_wrapper< Variable > | Reference |
typedef std::vector< Reference > | VariableVector |
typedef Variable * | Pointer |
Public Member Functions | |
~Variable () | |
const string & | name () const |
unsigned | id () const |
const VariableFactory & | owner () const |
VariableFactory & | owner () |
bool | isNull () const |
bool | operator== (const Variable &variable) const |
bool | operator!= (const Variable &variable) const |
const ValueVector & | domain () const |
void | setIndex (unsigned index) |
unsigned | index () const |
const Value & | addValue (const string &label) |
bool | containsValueOfLabel (const string &label) const |
bool | contains (const Value &val) const |
void | setDefault (const Value &val) |
void | setObservable () |
void | setUnObservable () |
bool | isObservable () const |
const Value & | getValue (const string &label) const |
const Value & | getValue (unsigned id) const |
const Value & | defaultValue () const |
const Value & | value () const |
void | assign (const Value &value) |
Static Public Member Functions | |
static string | typeName () |
Private Member Functions | |
Variable (VariableFactory &owner) | |
Variable (const string &name, unsigned id, VariableFactory &owner) | |
Private Attributes | |
string | _name |
unsigned | _id |
unsigned | _index |
VariableFactory & | _owner |
ValueFactory | _values |
ValueVector | _domain |
ValueVector | _default |
ValueVector | _current |
bool | _observable |
Friends | |
class | VariableFactory |
ostream & | operator<< (ostream &os, const Variable &variable) |
A Variable is an object to which it is possible to assign a finite set of Value. A Variable is created and is owned by a VariableFactory
Definition at line 24 of file Variable.hh.
typedef std::reference_wrapper<Variable const> Diades::Sdmdl::Variable::ConstReference |
Definition at line 31 of file Variable.hh.
Definition at line 27 of file Variable.hh.
typedef Variable* Diades::Sdmdl::Variable::Pointer |
Definition at line 34 of file Variable.hh.
typedef std::reference_wrapper<Variable> Diades::Sdmdl::Variable::Reference |
Definition at line 32 of file Variable.hh.
typedef std::vector<Reference> Diades::Sdmdl::Variable::VariableVector |
Definition at line 33 of file Variable.hh.
|
inlineprivate |
Creation of a Null Variable
owner | the VariableFactory that creates its null variable |
Definition at line 95 of file Variable.hh.
|
inlineprivate |
Creation of a Variable
name | the name of the Variable |
id | the id of the Variable |
owner | the VariableFactory that creates this Variable |
Definition at line 105 of file Variable.hh.
|
inline |
Desctructor
Definition at line 114 of file Variable.hh.
const Value& Diades::Sdmdl::Variable::addValue | ( | const string & | label | ) |
|
inline |
Assign a new Value to the current Variable
value | the new Value to assign |
Definition at line 371 of file Variable.hh.
References contains(), name(), operator<<, and require.
bool Diades::Sdmdl::Variable::contains | ( | const Value & | val | ) | const |
val | the Value to look for |
Referenced by assign(), index(), and setDefault().
bool Diades::Sdmdl::Variable::containsValueOfLabel | ( | const string & | label | ) | const |
const Value& Diades::Sdmdl::Variable::defaultValue | ( | ) | const |
Referenced by isObservable(), and Diades::Sdmdl::Experimental::Assignment::setVariable().
|
inline |
const Value& Diades::Sdmdl::Variable::getValue | ( | const string & | label | ) | const |
label | the label of the Value to look for |
Referenced by Diades::Sdmdl::Experimental::BddStateMachine::addEvent(), Diades::Sdmdl::Experimental::encodeInitialStates(), Diades::Sdmdl::Experimental::encodeTransitions(), isObservable(), and runGlobalDiagnosisProblem().
const Value& Diades::Sdmdl::Variable::getValue | ( | unsigned | id | ) | const |
|
inline |
|
inline |
Definition at line 232 of file Variable.hh.
References _index, addValue(), contains(), and containsValueOfLabel().
Referenced by setIndex().
bool Diades::Sdmdl::Variable::isNull | ( | ) | const |
Referenced by owner(), setObservable(), setUnObservable(), and Diades::Sdmdl::Experimental::Assignment::setVariable().
|
inline |
Definition at line 324 of file Variable.hh.
References _observable, defaultValue(), getValue(), and value().
|
inline |
Definition at line 124 of file Variable.hh.
References _name.
Referenced by assign(), Diades::Sdmdl::Experimental::StateInfoEncoder::getVariableId(), and setDefault().
|
inline |
variable | the Variable to compare |
Definition at line 195 of file Variable.hh.
|
inline |
variable | the Variable to compare |
Definition at line 181 of file Variable.hh.
|
inline |
|
inline |
Definition at line 159 of file Variable.hh.
|
inline |
Set the default Value of the Variable
val | the new default Value |
Definition at line 278 of file Variable.hh.
References contains(), Diades::Sdmdl::Value::isNull(), name(), and require.
|
inline |
Set the encoding index
index | the new encoding index |
Definition at line 221 of file Variable.hh.
References index().
|
inline |
|
inline |
|
inlinestatic |
Definition at line 28 of file Variable.hh.
const Value& Diades::Sdmdl::Variable::value | ( | ) | const |
Referenced by isObservable().
|
friend |
|
friend |
Definition at line 394 of file Variable.hh.
|
private |
_current
the current Value if it exists
Definition at line 80 of file Variable.hh.
|
private |
_default
the default Value if it exists
Definition at line 75 of file Variable.hh.
|
private |
_domain
the set of assignable Value objects
Definition at line 70 of file Variable.hh.
Referenced by domain().
|
private |
_id
the ID of the variable created by the associated VariableFactory
Definition at line 45 of file Variable.hh.
Referenced by id().
|
private |
_index
the index associated to the encoding of this Variable in the associated FormulaFactory
Definition at line 51 of file Variable.hh.
Referenced by index().
|
private |
|
private |
_observable
, is the Variable observable or not
Definition at line 85 of file Variable.hh.
Referenced by isObservable().
|
private |
_owner
the VariableFactory that created this Variable.
Definition at line 58 of file Variable.hh.
Referenced by owner().
|
private |
_values
the associated ValueFactory. Each Variable has its own ValueFactory
Definition at line 63 of file Variable.hh.