1 #ifndef __DIADES__ALTARICA__VARIABLE__HH
2 #define __DIADES__ALTARICA__VARIABLE__HH
55 void createStructureVariables(
const set<Identifier> & attributes,
const StructureDomainData * domainData);
62 void createArrayVariables(
const set<Identifier> & attributes,
const ArrayDomainData * domainData);
74 const set<Identifier> & attributes,
85 const set<Variable> & variables,
98 const set<Identifier> & attributes,
112 const set<Variable> & variables,
113 const set<Identifier> & attributes,
128 const set<Identifier> & attributes,
227 if(
this != &variable)
229 _data = variable.
_data;
241 return _data == variable.
_data;
251 return !( *
this == variable);
261 return _data < variable.
_data;
271 return ((*
this) == variable) || ((*this) < variable);
296 Type type()
const {
if(valid()) {
return domain().type(); }
return Type(); }
305 return valid() && domain().type().isBasic();
314 return valid() && domain().type().isStructure();
323 return valid() && domain().type().isArray();
331 unsigned size()
const;
360 bool setValue(
const Value & value);
381 if(!valid()) {
return ""; }
return _data->
_label;
388 AttributeIterator attributeBegin()
const;
394 AttributeIterator attributeEnd()
const;
403 Variable getField(
unsigned index)
const;
409 FieldNameIterator fieldBegin()
const;
414 FieldNameIterator fieldEnd()
const;
440 Node nodeScope()
const;
461 return os << var.
label();
504 const set<Identifier> & attributes);
519 const set<Identifier> & attributes,
534 const set<Identifier> & attributes,
548 const set<Identifier> & attributes);
561 const set<Variable> & variables,
Node node);
576 const set<Identifier> & attributes,
591 const set<Identifier> & attributes,
605 const set<Identifier> & attributes);
619 const set<Identifier> & attributes,
633 const set<Identifier> & attributes,
656 return _emptyAttributes;
663 return _emptyAttributes;
677 const set<Identifier> & attributes);
689 const set<Identifier> & attributes,
719 const set<Identifier> & attributes,
734 const set<Identifier> & attributes);
746 const set<Identifier> & attributes,
776 const set<Identifier> & attributes,
friend ostream & operator<<(ostream &os, const Variable &var)
DomainCategory category() const
Value _value
The scope type of the variable.
set< Identifier >::const_iterator FieldNameIterator
iterator on the attributes
const set< Identifier > & emptyFields() const
bool operator==(const Variable &variable) const
vector< Variable > _internalVariables
set< Identifier > _attrib
Fieldnames of the Variable if the Variable is a structure.
set< Identifier > _fieldName
void * _scope
attributes of the Variable
static VariableFactory * _variableFactory
VariableScope _scopeType
The scope of the variable.
unsigned _id
The current Value of the Variable.
Variable(VariableData *data)
internal data of a Variable
Domain _domain
label of the Variable
bool _isFree
The id of the Variable.
bool operator!=(const Variable &variable) const
Variable variableScope() const
set< Identifier >::const_iterator AttributeIterator
const set< Identifier > & emptyAttributes() const
vector< Variable > _modelVariables
bool operator<=(const Variable &variable) const
Namespace of the Diades project.
bool operator<(const Variable &variable) const
vector< unordered_map< Identifier, Variable > > _nodeVariables
set< Identifier > _emptyAttributes
Variable newVariable(const Identifier &label, Domain domain, const set< Identifier > &attributes, Variable variable)
Variable & operator=(const Variable &variable)
set< Identifier > _emptyFields
map< Identifier, Variable > * _structure
unordered_map< Identifier, Variable > _modelVariableOfLabel
vector< Variable > * _array
Fields of the Variable if the Variable is a structure.
Variable(const Variable &variable)
VariableScope scopeType() const