IlsViewedRel
 
IlsViewedRel
Category 
Static view-related class
Inheritance Path 
IlsViewedRel
Description 
IlsViewedRel is the parent class for all classes that declare relations. It is used as an argument in some member functions of the class IlsMvView.
Library 
<server>
Header File 
#include <ilserver/viewed.h>
Synopsis 
class ILSIMPORT IlsViewedRel
{
protected:
IlsViewedRel();
public:
virtual void onSubscribe(IlsView&){}
virtual void onUnsubscribe(IlsView&){}
IlsBoolean isViewed();
virtual IlsViewed* getIdentifiedElement
(const IlsString& id) const;
virtual IlsBoolean hasElement(IlsViewed& element) const;
};
Constructor 
IlsViewedRel();
This is the protected constructor of the class.
Member Functions 
[virtual] void onSubscribe(IlsView&);
This empty virtual member function is called each time a view subscribes to the relation.
[virtual] void onUnsubscribe(IlsView&);
This empty virtual member function is called each time the subscription of a view to the relation is canceled.
IlsBoolean isViewed();
This member function returns IlsTrue if at least one regular view (as opposed to a multithreaded view) subscribes to the relation. This function is supplied to maintain upward compatibility. For efficiency reasons, multithreaded views do not update this information. However, you can have it updated by overriding the virtual member functions onSubscribe and onUnsubscribe.
[virtual] IlsViewed* getIdentifiedElement(const IlsString& id) const;
This virtual member function is used to retrieve an identified object from the relation. the member function IlsViewed::getKeyIdentifier is used to retrieve the identifier of the relation element. Note that on all subclasses of this class, the complexity of this method is always linear, in terms of the number of elements in the relation, even for set relations.
[virtual] IlsBoolean hasElement(IlsViewed& element) const;
This virtual member function returns IlsTrue if the element is a target of the relation or IlsFalse otherwise.
See Also 
IlsMvView, IlsOwns, IlsOwnsDynamicArray, IlsOwnsFixedArray, IlsOwnsList, IlsUses, IlsUsesDynamicArray, IlsUsesFixedArray, IlsUsesList

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