DiaDes
0.1
DIAgnosisofDiscrete-EventSystem
|
#include <AltaricaModel.hh>
Public Types | |
typedef reference_wrapper< AltaricaModel > | Reference |
typedef reference_wrapper< AltaricaModel const > | ConstReference |
typedef AltaricaModel * | Pointer |
typedef const AltaricaModel * | ConstPointer |
typedef vector< NodeDecl::Reference > | NodeDecls |
typedef NodeDecls::const_iterator | NodeDeclIterator |
typedef unordered_map< Identifier, Domain::ConstReference > | DomainDictionary |
typedef unordered_map< Identifier, Value::ConstReference > | ConstantDictionary |
typedef unordered_map< Identifier, NodeDecl::Reference > | NodeDeclDictionary |
Public Member Functions | |
Constants | |
const ConstantDictionary & | constants () const |
void | addConstant (const Identifier &name, const Value &value) |
const Value & | getConstant (const Identifier &name) const |
Constructors/Destructor | |
AltaricaModel (const Identifier &name) | |
~AltaricaModel () | |
BasicAccessors | |
Basic methods of AltaricaModel | |
const Identifier & | name () const |
bool | operator== (const AltaricaModel &model) const |
bool | operator!= (const AltaricaModel &model) const |
TypeAccessors | |
Methods to access the Type of the elements of the current model | |
const Type & | nullType () const |
const Type & | getBoolean () const |
const Type & | getIdentifier () const |
const Type & | getInteger () const |
const Type & | getStructureType (const Type::StructureFields &fields) const |
const Type & | getArrayType (const Type &type, unsigned size) const |
ValueAccessors | |
Methods to access the Value involved in the elements of the current model | |
const Value & | nullValue () const |
const Value & | getValue (const Identifier &value) const |
const Value & | getValue (bool value) const |
const Value & | getValue (int value) const |
const Value & | getValue (const Value::ArrayFields &array) const |
const Value & | getValue (const Value::StructureFields &structure) const |
DomainAccessors | |
Methods to access the Domains involved in the elements of the current model | |
const Domain & | getBooleans () const |
const Domain & | getIntegers () const |
const Domain & | newDomain (const Identifier &name, const Domain &associatedDomain, NodeDecl &node) |
const Domain & | newDomain (const Identifier &name, const Value &min, const Value &max, NodeDecl &node) |
const Domain & | newDomain (const Identifier &name, const ValueEnumeration &enumeration, NodeDecl &node) |
const Domain & | newDomain (const Identifier &name, const map< Identifier, Domain::ConstReference > &structure, NodeDecl &node) |
const Domain & | newDomain (const Identifier &name, const Domain &domain, unsigned size, NodeDecl &node) |
const Domain & | getDomain (const Identifier &name, NodeDecl &node) |
const Domain & | getDomain (const NodeDecl &node) |
const Domain & | nullDomain () const |
const vector< Domain::ConstReference > & | domains () const |
VariableDeclAccessors | |
VariableDecl & | getNodeVariableDecl (const Identifier &id, NodeDecl &node, const set< Identifier > &attributes, VariableDecl &scope) |
VariableDecl & | getVariableDecl (const Diades::Utils::Identifier &label, NodeDecl::VarType type, const Domain &domain, const set< Identifier > &attributes, VariableDecl &scope) |
const VariableDecl & | nullVariableDecl () const |
VariableDecl & | nullVariableDecl () |
const VariableDeclFactory & | variableDeclFactory () const |
NodeAccessors | |
Methods to access the Nodes involved in the elements of the current model | |
void | noMainNodeDecl () |
void | setMainNodeDecl (const Identifier &name) |
bool | containsNodeDecl (const Identifier &nodeName) const |
NodeDecl & | getNodeDecl (const Identifier &nodeName) |
NodeDecl & | nullNodeDecl () |
const NodeDecl & | nullNodeDecl () const |
unsigned | numberOfNodeDecls () const |
NodeDeclIterator | nodeDeclBegin () const |
NodeDeclIterator | nodeDeclEnd () const |
model construction methods | |
These methods are use to "fill" the declared nodes | |
EventDecl & | getEventDecl (const Identifier &id, NodeDecl &owner) |
const EventDecl & | getEventDecl (const Identifier &id, const NodeDecl &owner) const |
const EventDecl & | nullEventDecl () const |
EventDecl & | nullEventDecl () |
model instance methods | |
These methods are use to instanciate the declared model | |
const VariableDecl & | mainVariableDecl () const |
VariableDecl & | mainVariableDecl () |
const NodeDecl & | mainNodeDecl () const |
NodeDecl & | mainNodeDecl () |
parameter methods | |
These methods are use to instanciate the parameters | |
const ParameterDecl & | getParameterDecl (const Identifier &name, const Domain &domain, NodeDecl &node) |
const ParameterDecl & | nullParameterDecl () const |
Private Member Functions | |
unsigned | typeIndex (Domain::DomainType type) const |
Exception | |
typedef Utils::Exception< AltaricaModel > | Exception |
static string | typeName () |
Class that implements a internal representation of a model written in alatarca language. This is the fundamental class to use altarica models with Dialtarica.
Definition at line 28 of file AltaricaModel.hh.
typedef unordered_map<Identifier,Value::ConstReference> Diades::Altarica::AltaricaModel::ConstantDictionary |
ConstantDictionary
dictionary of the global domains
Definition at line 103 of file AltaricaModel.hh.
typedef const AltaricaModel* Diades::Altarica::AltaricaModel::ConstPointer |
Definition at line 35 of file AltaricaModel.hh.
typedef reference_wrapper<AltaricaModel const> Diades::Altarica::AltaricaModel::ConstReference |
Definition at line 33 of file AltaricaModel.hh.
typedef unordered_map<Identifier,Domain::ConstReference> Diades::Altarica::AltaricaModel::DomainDictionary |
DomainDictionary
dictionary of the global domains
Definition at line 99 of file AltaricaModel.hh.
Definition at line 162 of file AltaricaModel.hh.
ExprVector
vector of constant Expression references
Definition at line 817 of file AltaricaModel.hh.
typedef unordered_map<Identifier,NodeDecl::Reference> Diades::Altarica::AltaricaModel::NodeDeclDictionary |
NodeDeclDictionary
dictionary of the node declarations
Definition at line 107 of file AltaricaModel.hh.
typedef NodeDecls::const_iterator Diades::Altarica::AltaricaModel::NodeDeclIterator |
NodeDeclIterator
iterator of NodeDecls
Definition at line 95 of file AltaricaModel.hh.
typedef vector<NodeDecl::Reference> Diades::Altarica::AltaricaModel::NodeDecls |
NodeDecls
vector of node declarations
Definition at line 91 of file AltaricaModel.hh.
Definition at line 34 of file AltaricaModel.hh.
typedef reference_wrapper<AltaricaModel> Diades::Altarica::AltaricaModel::Reference |
Definition at line 32 of file AltaricaModel.hh.
Diades::Altarica::AltaricaModel::AltaricaModel | ( | const Identifier & | name | ) |
Parametrised constructor creation of a new altarica model.
name | the name of the new model |
Referenced by getConstant().
Diades::Altarica::AltaricaModel::~AltaricaModel | ( | ) |
Destructor.
Referenced by getConstant().
|
inline |
Definition at line 177 of file AltaricaModel.hh.
References always_require, and getConstant().
|
inline |
Definition at line 172 of file AltaricaModel.hh.
References _constantDictionary.
bool Diades::Altarica::AltaricaModel::containsNodeDecl | ( | const Identifier & | nodeName | ) | const |
nodeName | the identifier of a NodeDecl |
Referenced by setMainNodeDecl().
|
inline |
Definition at line 598 of file AltaricaModel.hh.
References _globalDomains.
|
inline |
type | Type of an element |
size | Size of the array |
Definition at line 351 of file AltaricaModel.hh.
References Diades::Altarica::TypeFactory::getArrayType(), and nullType().
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
node | the owner of the Expression |
category | Category of the expression (Binary categories like Or And Add etc) |
left | the left member |
right | the right member |
Definition at line 912 of file AltaricaModel.hh.
References Diades::Altarica::ExpressionFactory::getBinaryExpression().
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
Boolean type
Definition at line 295 of file AltaricaModel.hh.
References Diades::Altarica::TypeFactory::getBoolean().
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
category | the category (either True or False) |
Definition at line 853 of file AltaricaModel.hh.
References Diades::Altarica::ExpressionFactory::getBooleanExpression().
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
Definition at line 485 of file AltaricaModel.hh.
References Diades::Altarica::DomainFactory::getBooleans().
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
node | the owner of the Expression* |
choices | the set of cases |
expressions | the set of expressions (cases[i] associated with expressions[i]) plus the default case |
Definition at line 895 of file AltaricaModel.hh.
References Diades::Altarica::ExpressionFactory::getCaseExpression().
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
Definition at line 184 of file AltaricaModel.hh.
References AltaricaModel(), name(), nullValue(), and ~AltaricaModel().
Referenced by addConstant().
const Domain& Diades::Altarica::AltaricaModel::getDomain | ( | const Identifier & | name, |
NodeDecl & | node | ||
) |
Get the domain of the model with this name
name | the name of the resulting Domain |
nodeDecl | the nodeDecl where is the domain (NodelDecl() is it is the global one) |
Referenced by getIntegers().
|
inline |
Get an event declaration
label | the label of the event declaration |
nodeDecl | the owner of the event declaration |
Definition at line 970 of file AltaricaModel.hh.
References always_require, Diades::Altarica::EventDeclFactory::getEventDecl(), and Diades::Altarica::NodeDecl::owner().
|
inline |
Get an event declaration
label | the label of the event declaration |
nodeDecl | the owner of the event declaration |
Definition at line 982 of file AltaricaModel.hh.
References always_require, Diades::Altarica::EventDeclFactory::getEventDecl(), and Diades::Altarica::NodeDecl::owner().
|
inline |
Identifier type
Definition at line 305 of file AltaricaModel.hh.
References Diades::Altarica::TypeFactory::getIdentifier().
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
node | the owner of the identifer |
id | an Identifier |
Definition at line 841 of file AltaricaModel.hh.
References Diades::Altarica::ExpressionFactory::getIdentifierExpression().
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
Integer type
Definition at line 316 of file AltaricaModel.hh.
References Diades::Altarica::TypeFactory::getInteger().
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
value | a integer |
Definition at line 866 of file AltaricaModel.hh.
References Diades::Altarica::ExpressionFactory::getIntegerExpression().
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
Definition at line 494 of file AltaricaModel.hh.
References getDomain(), Diades::Altarica::DomainFactory::getIntegers(), and newDomain().
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
node | the owner of the Expression |
ifE | a boolean Expression |
thenE | an Expression |
elseE | an Expression |
Definition at line 881 of file AltaricaModel.hh.
References Diades::Altarica::ExpressionFactory::getIteExpression().
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
node | the owner of the Expression |
category | Category of the expression (categories made of expression list like min max array...) |
expressions | the list of expressions) |
Definition at line 938 of file AltaricaModel.hh.
References Diades::Altarica::ExpressionFactory::getListExpression().
Referenced by BOOST_AUTO_TEST_CASE().
NodeDecl& Diades::Altarica::AltaricaModel::getNodeDecl | ( | const Identifier & | nodeName | ) |
nodeName | the identifier of a NodeDecl |
Referenced by analyseComponent(), and setMainNodeDecl().
|
inline |
Get the VariableDecl associated to a NodeDecl
node | the given node |
attributes | the attributes of the Variable |
scope | the scope of the Variable. If the scope is VariableDecl(), it is the global scope |
Definition at line 624 of file AltaricaModel.hh.
References Diades::Altarica::VariableDeclFactory::getNodeVariableDecl(), and nullVariableDecl().
|
inline |
Parameter declaration
name | the identifier of the Parameter |
domain | the domain of the Parameter |
node | the NodeDec that owns the Parameter |
Definition at line 1086 of file AltaricaModel.hh.
References always_require, Diades::Altarica::ParameterDeclFactory::getParameterDecl(), Diades::Altarica::Domain::isNull(), and Diades::Utils::Identifier::str().
|
inline |
node | the owner of the Expression |
identifiers | a set of identifiers (the field names of the structure) |
expressions | a set of expressions (associated with each field name) |
Definition at line 952 of file AltaricaModel.hh.
References Diades::Altarica::ExpressionFactory::getStructExpression().
|
inline |
Get the structure type defined by fields
fields | a set of Type |
Definition at line 328 of file AltaricaModel.hh.
References Diades::Altarica::TypeFactory::getStructureType(), and nullType().
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
node | the owner of the Expression |
category | Category of the expression (Unary categories like Not Neg Paren etc) |
expr | the unique member |
Definition at line 925 of file AltaricaModel.hh.
References Diades::Altarica::ExpressionFactory::getUnaryExpression().
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
value | an Identifier |
Definition at line 392 of file AltaricaModel.hh.
References Diades::Altarica::ValueFactory::getValue(), and nullValue().
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
value | an boolean |
Definition at line 412 of file AltaricaModel.hh.
References Diades::Altarica::ValueFactory::getValue().
|
inline |
value | an integer |
Definition at line 424 of file AltaricaModel.hh.
References Diades::Altarica::ValueFactory::getValue().
|
inline |
array | an array of Value |
Definition at line 437 of file AltaricaModel.hh.
References Diades::Altarica::ValueFactory::getValue(), and nullValue().
|
inline |
structure | an set of Values indedex with field names |
Definition at line 459 of file AltaricaModel.hh.
References Diades::Altarica::ValueFactory::getValue(), and nullValue().
|
inline |
node | the owner of the VariableDecl |
var | a VariableDecl |
Definition at line 826 of file AltaricaModel.hh.
References Diades::Altarica::ExpressionFactory::getVarExpression().
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
Get the VariableDecl
label | the name of the Variable |
type | the type (flow.state,subnode) of the variable |
domain | the Domain of the Variable |
attributes | the attributes of the Variable |
scope | the scope of the Variable. If the scope is VariableDecl(), it is the global scope |
Definition at line 655 of file AltaricaModel.hh.
References Diades::Altarica::VariableDeclFactory::getVariableDecl(), and nullVariableDecl().
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
Definition at line 1056 of file AltaricaModel.hh.
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
Definition at line 1066 of file AltaricaModel.hh.
|
inline |
get the main Node of the model
Definition at line 1031 of file AltaricaModel.hh.
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
Definition at line 1042 of file AltaricaModel.hh.
|
inline |
Validity of an AltaricaModel
Name of the model
Definition at line 244 of file AltaricaModel.hh.
References _name.
Referenced by getConstant().
const Domain& Diades::Altarica::AltaricaModel::newDomain | ( | const Identifier & | name, |
const Domain & | associatedDomain, | ||
NodeDecl & | node | ||
) |
Reference Domain constructor
name | an Identifier that represents a Domain (if name is empty, it is considered as a shadow domain) |
associatedDomain | the Domain associated to the Identifier name |
nodeDecl | the NodeDecl where this Domain is declared |
Referenced by BOOST_AUTO_TEST_CASE(), and getIntegers().
const Domain& Diades::Altarica::AltaricaModel::newDomain | ( | const Identifier & | name, |
const Value & | min, | ||
const Value & | max, | ||
NodeDecl & | node | ||
) |
Integer Range Domain constructor
name | an Identifier that represents a Domain (if name is empty, it is considered as a shadow domain) |
min | the minimal integer bound |
max | the maximal integer bound |
nodeDecl | the NodeDecl where this Domain is declared |
const Domain& Diades::Altarica::AltaricaModel::newDomain | ( | const Identifier & | name, |
const ValueEnumeration & | enumeration, | ||
NodeDecl & | node | ||
) |
Finite Enumeration Domain constructor
name | an Identifier that represents a Domain (if name is empty, it is considered as a shadow domain) |
enumeration | the set of Value objects in the enumeration |
nodeDecl | the NodeDecl where this Domain is declared |
const Domain& Diades::Altarica::AltaricaModel::newDomain | ( | const Identifier & | name, |
const map< Identifier, Domain::ConstReference > & | structure, | ||
NodeDecl & | node | ||
) |
Structure Domain constructor
name | an Identifier that represents a Domain (if name is empty, it is considered as a shadow domain) |
structure | the underlying structure of this Domain |
nodeDecl | the NodeDecl where this Domain is declared |
const Domain& Diades::Altarica::AltaricaModel::newDomain | ( | const Identifier & | name, |
const Domain & | domain, | ||
unsigned | size, | ||
NodeDecl & | node | ||
) |
Array Domain constructor
name | an Identifier that represents a Domain (if name is empty, it is considered as a shadow domain) |
domain | the domain of any Variable contained in the array |
the | size of the array domain |
nodeDecl | the NodeDecl where this Domain is declared |
|
inline |
NodeDecl iterator (begin)
Definition at line 792 of file AltaricaModel.hh.
|
inline |
NodeDecl iterator (end)
Definition at line 801 of file AltaricaModel.hh.
|
inline |
Set the fact that the model has no main nodes
Definition at line 712 of file AltaricaModel.hh.
References nullNodeDecl().
|
inline |
Definition at line 586 of file AltaricaModel.hh.
References Diades::Altarica::DomainFactory::nullDomain().
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
Definition at line 994 of file AltaricaModel.hh.
References Diades::Altarica::EventDeclFactory::nullEventDecl().
|
inline |
Definition at line 1004 of file AltaricaModel.hh.
References Diades::Altarica::EventDeclFactory::nullEventDecl().
|
inline |
Definition at line 760 of file AltaricaModel.hh.
References Diades::Altarica::NodeDeclFactory::nullNodeDecl().
Referenced by noMainNodeDecl().
|
inline |
Definition at line 771 of file AltaricaModel.hh.
References Diades::Altarica::NodeDeclFactory::nullNodeDecl().
|
inline |
Definition at line 1101 of file AltaricaModel.hh.
References Diades::Altarica::ParameterDeclFactory::nullParameterDecl().
|
inline |
Not a Type
Definition at line 284 of file AltaricaModel.hh.
References Diades::Altarica::TypeFactory::nullType().
Referenced by BOOST_AUTO_TEST_CASE(), getArrayType(), and getStructureType().
|
inline |
Definition at line 378 of file AltaricaModel.hh.
References Diades::Altarica::ValueFactory::nullValue().
Referenced by BOOST_AUTO_TEST_CASE(), getConstant(), and getValue().
|
inline |
Definition at line 677 of file AltaricaModel.hh.
References Diades::Altarica::VariableDeclFactory::nullVariableDecl().
Referenced by getNodeVariableDecl(), and getVariableDecl().
|
inline |
Definition at line 688 of file AltaricaModel.hh.
References Diades::Altarica::VariableDeclFactory::nullVariableDecl().
|
inline |
Definition at line 782 of file AltaricaModel.hh.
|
inline |
Difference operator (reference equality)
model | the AltaricaModel to compare with |
Definition at line 269 of file AltaricaModel.hh.
|
inline |
Equality operator (reference equality)
model | the AltaricaModel to compare with |
Definition at line 257 of file AltaricaModel.hh.
|
inline |
Set the main node to the given name
name | the Identifier of the main node |
Definition at line 725 of file AltaricaModel.hh.
References containsNodeDecl(), getNodeDecl(), Diades::Altarica::ExpressionFactory::init(), and Diades::Altarica::EventDeclFactory::init().
Referenced by BOOST_AUTO_TEST_CASE().
|
private |
type | a Domain::DomainType |
|
inlinestatic |
Definition at line 163 of file AltaricaModel.hh.
|
inline |
|
private |
_constantDictionary
the set of declared constant
Definition at line 145 of file AltaricaModel.hh.
Referenced by constants().
|
private |
_domainDictionary
the dictionary of the global domains
Definition at line 114 of file AltaricaModel.hh.
|
private |
_domainFactory
factory to generate the domains
Definition at line 52 of file AltaricaModel.hh.
|
mutableprivate |
_eventFactory
factory to generate the events
Definition at line 73 of file AltaricaModel.hh.
|
private |
_expressionFactory
factory to generate the expressions
Definition at line 78 of file AltaricaModel.hh.
|
private |
_globalDomains
the set of global user defined domains
Definition at line 119 of file AltaricaModel.hh.
Referenced by domains().
|
private |
Definition at line 127 of file AltaricaModel.hh.
|
private |
_mainVariableDecl
the vector that will contain the global scope variable
Definition at line 64 of file AltaricaModel.hh.
|
private |
|
private |
_nodeDeclFactory
factory to generate the node declarations
Definition at line 69 of file AltaricaModel.hh.
|
private |
_nodeDeclOfLabel
the dictionary of node declarations.
Definition at line 133 of file AltaricaModel.hh.
|
private |
_nodeDecls
the set of node declarations
Definition at line 126 of file AltaricaModel.hh.
|
private |
_varFactory
factory to generate the variables (i.e. instances of an VariableDecl) _paramDeclFactory
factory to generate the parameters
Definition at line 86 of file AltaricaModel.hh.
|
mutableprivate |
_typeFactory
factory to generate the types
Definition at line 44 of file AltaricaModel.hh.
|
mutableprivate |
_valueFactory
factory to generate the values
Definition at line 48 of file AltaricaModel.hh.
|
private |
_varDeclFactory
factory to generate the variable declarations
Definition at line 56 of file AltaricaModel.hh.
Referenced by variableDeclFactory().