IlsDynRelation
 
IlsDynRelation
Category 
Dynamic modeling class
Inheritance Path 
IlsDynRelation
Description 
This abstract class defines the interface of dynamic relations. The various subclasses implement the methods according to their semantics.
This class includes the following list of predefined subtypes, used to provide a Server implementation of dynamic relations:
*IlsOwnsServerRelation: encapsulates a simple ownership relation.
*IlsOwnsNServerRelation: encapsulates a multiple ownership relation.
*IlsOwnsSetServerRelation: encapsulates a multiple ownership relation implemented as a set relation.
*IlsUsesServerRelation: encapsulates a simple use relation.
*IlsUsesNServerRelation: encapsulates a multiple use relation.
*IlsUsesSetServerRelation: encapsulates a multiple use relation implemented as a set relation.
*IlsInvertedServerRelation: encapsulates a simple inverse relation.
*IlsInvertedNServerRelation: encapsulates a n-m inverse relation.
Library 
<dynmvsvr>
Header File 
#include <ilserver/dynobj.h>
Synopsis 
class IlsDynRelation
{
public:
IlsDynRelation(IlsDynObject& owner,
const IlsRelationDef& relDef,
IlsRelationId id=IlsDefaultRelationId);
 
virtual IlsBoolean isUnary() const;
virtual IlsBoolean isOwnership() const;
virtual IlsBoolean isInverse() const;
virtual IlsViewedRel* getRelation();
virtual IlsViewed* getElement(const IlsString& id) const;
 
virtual IlsBoolean setTarget(IlsViewed*);
virtual IlsViewed* getTarget() const;
virtual IlsBoolean hasTarget(IlsViewed& target);
virtual IlsBoolean addTarget(IlsViewed*);
virtual void removeTarget(IlsViewed*);
};
Constructor 
IlsDynRelation(IlsDynObject& owner,
const IlsRelationDef& relDef,
IlsRelationId id=IlsDefaultRelationId);
This constructor creates an instance of a dynamic relation.
Member Functions 
[virtual] IlsBoolean isUnary() const;
[virtual] IlsBoolean isOwnership() const;
[virtual] IlsBoolean isInverse() const;
These virtual member functions return IlsTrue if the unary, ownership, or inverse property, respectively, is true for the dynamic relation.
[virtual] IlsViewedRel* getRelation();
This virtual member function returns the relation implementation.
[virtual] IlsViewed* getElement(const IlsString& id) const;
This virtual member function retrieves an identified element from the n-ary relation. The identifier of the element is read by the IlsDynObject::getKeyIdentifier. This method provides direct access if the underlying relation is a set relation.
[virtual] IlsBoolean setTarget(IlsViewed*);
[virtual] IlsViewed* getTarget() const;
These virtual member functions are used respectively to set or get the target of the dynamic relation (relevant only for unary relations). The function setTarget should return IlsFalse if assignment is not possible.
[virtual] IlsBoolean hasTarget(IlsViewed& target);
This virtual member function returns IlsTrue if the the target is an element of the relation. By default, this method returns IlsFalse. You must override it in your subclasses.
[virtual] IlsBoolean addTarget(IlsViewed*);
[virtual] IlsBoolean removeTarget(IlsViewed*);
These virtual member functions are used respectively to add or remove a target of the dynamic relation (relevant only for n-ary relations). They should return IlsFalse if, respectively, assignment or removal is not possible.
See Also 
IlsDynModelInterpreter, IlsDynObject, IlsDynAttribute

Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.