Dynamic Relations
A dynamic object has a set of dynamic relations as declared to the server model interpreter. Server instantiates a subclass of IlsDynRelation according to:
-
the relation type (ownership, use or inverse);
-
the multiplicity (unary or n-ary);
-
the implementation (pointer, list, set, or sorted list).
Set-relations can only store identified objects whose identifier is non-null.
Sorted Relations
Dynamic relations can be implemented as sorted lists. This implementation can be used for aggregation or utilization relations to store objects sorted on their identifier.
To implement this feature, use the ilog.server.implementation="sortedList" property in the XMI description of the corresponding role.
The class IlsDynRelation provides the necessary API to manipulate the relation.
Example
void EditionFunction(IlsViewed& obj)
{
IlsDynObject* dynObj = IlsDynObject::Narrow("Domain", &obj);
if (dynObj) {
IlsDynRelation* nodes = dynObj->getDynRelation("nodes");
if (nodes) {
IlsDynRelationIterator i(*nodes);
IlsViewed* target = 0;
while (i>>target) {
IlsDynObject* node = IlsDynObject::Narrow("Node", *target);
...
}
}
}
}






