6 : limexHandle(limexHandle)
10void AttributeRegistry::add(
Attribute* attribute) {
12 throw std::runtime_error(
"AttributeRegistry: duplicate attribute name '" + attribute->
name +
"'");
32 std::unordered_map< std::string, Attribute*>::const_iterator it;
38 else if ( it =
dataMap.find(name);
49 throw std::runtime_error(
"AttributeRegistry: cannot find attribute with name '" + name +
"'");
76 assert(attribute->
index < status.size());
77 return status[attribute->
index];
80 assert(attribute->
index < data.size());
81 return data[attribute->
index];
84 assert(attribute->
index < globals.size());
85 return globals[attribute->
index];
91 assert(attribute->
index < status.size());
92 return status[attribute->
index];
95 assert(attribute->
index < data.size());
96 return data[attribute->
index].get();
99 assert(attribute->
index < globals.size());
100 return globals[attribute->
index];
106 assert(attribute->
index < status.size());
107 status[attribute->
index] = value;
110 assert(attribute->
index < data.size());
111 data[attribute->
index] = value;
114 assert(attribute->
index < globals.size());
115 globals[attribute->
index] = value;
121 assert(attribute->
index < status.size());
122 status[attribute->
index] = value;
125 assert(attribute->
index < data.size());
126 data[attribute->
index].get() = value;
129 assert(attribute->
index < globals.size());
130 globals[attribute->
index] = value;
bool contains(const std::string &name) const
std::unordered_map< std::string, Attribute * > dataMap
void setValue(const Attribute *attribute, Values &status, Values &data, Values &globals, std::optional< BPMNOS::number > value) const
AttributeRegistry(const LIMEX::Handle< double > &limexHandle)
std::unordered_map< std::string, Attribute * > globalMap
Attribute * operator[](const std::string &name) const
std::vector< Attribute * > statusAttributes
std::vector< Attribute * > dataAttributes
std::unordered_map< std::string, Attribute * > statusMap
std::vector< Attribute * > globalAttributes
std::optional< BPMNOS::number > getValue(const Attribute *attribute, const Values &status, const Values &data, const Values &globals) const
size_t index
Index of attribute (is automatically set by attribute registry).