15{
18
21
22
23 unsigned int fromIndex, toIndex;
25 int otherIndex = -1;
27 B2FATAL("RelationVectorBase points to object not in DataStore?");
28
29 if (
m_name == rel.getFromAccessorParams().first and entry->
name == rel.getToAccessorParams().first) {
31 toIndex = otherIndex;
32 }
else if (entry->
name == rel.getFromAccessorParams().first and
m_name == rel.getToAccessorParams().first) {
34 fromIndex = otherIndex;
35 } else {
36 continue;
37 }
38
39
40 for (int i = 0; i < rel.getEntries(); i++) {
41 if (rel[i].getFromIndex() == fromIndex) {
42 auto& toIndices = const_cast<std::vector<RelationElement::index_type>&>(rel[i].getToIndices());
43 auto& toWeights = const_cast<std::vector<RelationElement::weight_type>&>(rel[i].getWeights());
44 for (size_t j = 0; j < toIndices.size(); j++) {
45
46 if (toIndices[j] == toIndex and toWeights[j] == objweight) {
47 f(toIndices, toWeights, j);
48 rel.setModified(true);
49 return;
50 }
51 }
52 }
53 }
54 }
55
56 B2FATAL("RelationVectorBase and DataStore differ!??");
57}
@ c_Event
Different object in each event, all objects/arrays are invalidated after event() function has been ca...
static DataStore & Instance()
Instance of singleton Store.
Low-level class to create/modify relations between StoreArrays.
Wraps a stored array/object, stored under unique (name, durability) key.
std::string name
Name of the entry.