5void AttributeRegistry::add(
Attribute* attribute) {
7 throw std::runtime_error(
"AttributeRegistry: duplicate attribute name '" + attribute->
name +
"'");
24 std::map< std::string, Attribute*>::const_iterator it;
41 throw std::runtime_error(
"AttributeRegistry: cannot find attribute with name '" + name +
"'");
53 assert(attribute->
index < status.size());
54 return status[attribute->
index];
57 assert(attribute->
index < data.size());
58 return data[attribute->
index];
61 assert(attribute->
index < globals.size());
62 return globals[attribute->
index];
68 assert(attribute->
index < status.size());
69 return status[attribute->
index];
72 assert(attribute->
index < data.size());
73 return data[attribute->
index].get();
76 assert(attribute->
index < globals.size());
77 return globals[attribute->
index];
83 assert(attribute->
index < status.size());
84 status[attribute->
index] = value;
87 assert(attribute->
index < data.size());
88 data[attribute->
index] = value;
91 assert(attribute->
index < globals.size());
92 globals[attribute->
index] = value;
98 assert(attribute->
index < status.size());
99 status[attribute->
index] = value;
102 assert(attribute->
index < data.size());
103 data[attribute->
index].get() = value;
106 assert(attribute->
index < globals.size());
107 globals[attribute->
index] = value;
bool contains(const std::string &name) const
void setValue(const Attribute *attribute, Values &status, Values &data, Values &globals, std::optional< BPMNOS::number > value) const
Attribute * operator[](const std::string &name) const
std::map< std::string, Attribute * > dataAttributes
std::map< std::string, Attribute * > globalAttributes
std::map< std::string, Attribute * > statusAttributes
std::optional< BPMNOS::number > getValue(const Attribute *attribute, const Values &status, const Values &data, const Values &globals) const
const std::string name
Name of attribute and optial initial assignment.
size_t index
Index of attribute (is automatically set by attribute registry).