Rogue Wave Server lets you invert a relation by maintaining a back pointer to the origin of that relation. More...
#include <ilserver/model.h>
Public Types | |
typedef IlsInvertedRelation< TargetType, OriginType > | Myself |
Myself is the type of the instantiated template class. | |
Public Member Functions | |
IlsInvertedRelation (TargetType &o, IlsActivity activity=IlsModel::GetDefaultActivity()) | |
Accessors | |
OriginType * | getValue () |
OriginType * | getPointer () |
TargetType & | getTarget () const |
Returns the target of the relation. | |
Operators | |
operator OriginType * () | |
OriginType * | getValueQuietly () const |
OriginType * | operator-> () |
This dereference operator returns the origin of the relation. | |
OriginType & | operator* () |
This indirection operator returns a reference to the origin of the relation. | |
IlsBoolean | operator! () |
IlsBoolean | operator== (OriginType *rhs) |
Checks whether the origin-type is equal to another origin-type. | |
IlsBoolean | operator!= (OriginType *rhs) |
IlsBoolean | operator== (Myself &rhs) |
IlsBoolean | operator!= (Myself &rhs) |
Myself & | operator= (OriginType *rhs) |
Assigns a new origin to the inverted relation. | |
Myself & | operator= (Myself &rhs) |
Assigns an inverted relation to the inverted relation. | |
IlsViewed & | getViewedHolder () |
virtual IlsBoolean | isUnary () const |
Modifiers | |
Myself & | set (OriginType *rhs, IlsBoolean avoid_notify=IlsFalse) |
Assigns a new origin to the inverted relation. | |
Myself & | clear () |
Sets the relation to zero. | |
Public Member Functions inherited from IlsViewedRel | |
virtual IlsViewed * | getIdentifiedElement (const IlsString &id) const |
This virtual member function is used to retrieve an identified object from the relation. More... | |
virtual IlsBoolean | hasElement (IlsViewed &) const |
This virtual member function returns IlsTrue if the element is a target of the relation or IlsFalse otherwise. | |
IlsBoolean | isViewed () |
This member function returns IlsTrue if at least one regular view (as opposed to a multithreaded view) subscribes to the relation. More... | |
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. | |
Notification | |
IlsBoolean | isModified () |
During a notification phase, this member function returns IlsTrue only if the relation has been modified since the last notification phase. | |
OriginType * | getOldValue () |
IlsBoolean | notify (IlsView *, IlsRelSubscribing *, ILS_NOTIFY_STATE=ILS_NOTIFY_DEFAULT) |
During a notification phase, this member function returns IlsTrue only if the relation has been modified since the last notification phase. | |
virtual unsigned int | getElementCount () |
During a notification phase, this member function returns IlsTrue only if the relation has been modified since the last notification phase. | |
virtual IlsBoolean | fillViewedTable (IlsPtrArray< IlsViewed > &) |
During a notification phase, this member function returns IlsTrue only if the relation has been modified since the last notification phase. | |
IlsViewed * | Ils2Viewed (OriginType *) |
During a notification phase, this member function returns IlsTrue only if the relation has been modified since the last notification phase. | |
Additional Inherited Members | |
Protected Member Functions inherited from IlsViewedRel | |
IlsViewedRel () | |
This is the protected constructor of the class. | |
Rogue Wave Server lets you invert a relation by maintaining a back pointer to the origin of that relation.
TargetType | Target class of the direct relation. |
OriginType | Class that contains the direct relation. |
Library: server
This pointer is declared as an instance of the class template IlsInvertedRelation
and maintained by means of the functions setContext()
and unsetContext()
. A relation of type IlsInvertedRelation
contains an entry. Modifying it may therefore trigger the recomputation of derived members or notification.
The IlsInvertedRelation
template makes a forward declaration of the function IlsViewed* Ils2Viewed(OriginType*)
and uses it in its implementation. This to avoid the compiler to require visibility on the class OriginType
when instantiating the inverted relation template. The implementation of the Ils2Viewed()
function is expanded by the macro ILS_OBJECT_DECL()
or its derivatives. If you do not want to use that macro because the type OriginType
is not notified by views, you can define your own function in a source of your application that has visibility on the class OriginType
, as follows:
Bridge
IlsEntity
, IlsEntry
, IlsObject
, IlsOwns
, IlsUses
, setContext()
, unsetContext()
. IlsInvertedRelation< TargetType, OriginType >::IlsInvertedRelation | ( | TargetType & | o, |
IlsActivity | activity = IlsModel::GetDefaultActivity() |
||
) |
As its first argument, this constructor takes a reference to the type in which the relation is declared. It initializes the back pointer to zero.
The argument activity
specifies whether the relation is active or not. A relation is active if its modification sets off the recomputation of derived data members. The default value is the one returned by the static member function IlsModel::GetDefaultActivity()
, which is ILS_INACTIVE
by default.
OriginType* IlsInvertedRelation< TargetType, OriginType >::getOldValue | ( | ) |
\short During a notification phase, this member function returns a smart pointer to the object that was the target of the relation before
the notification phase.
OriginType* IlsInvertedRelation< TargetType, OriginType >::getPointer | ( | ) |
\short Returns a pointer to the origin of the relation.
It is useful especially when the conversion operator cannot be used or when the compiler is likely to encounter multiple user-defined conversions.
OriginType* IlsInvertedRelation< TargetType, OriginType >::getValue | ( | ) |
\short Returns a pointer to the origin of the relation.
It is useful especially when the conversion operator cannot be used or when the compiler is likely to encounter multiple user-defined conversions.
OriginType* IlsInvertedRelation< TargetType, OriginType >::getValueQuietly | ( | ) | const |
\short Lets you use inverted relations as if they were pointers.
This operator converts the relation to a pointer to an object of the OriginType
. It is equivalent to the member function getValue()
(see above).
|
virtual |
\short Lets you use inverted relations as if they were pointers.
This operator converts the relation to a pointer to an object of the OriginType
. It is equivalent to the member function getValue()
(see above).
Implements IlsViewedRel.
|
virtual |
\short Lets you use inverted relations as if they were pointers.
This operator converts the relation to a pointer to an object of the OriginType
. It is equivalent to the member function getValue()
(see above).
Implements IlsViewedRel.
IlsInvertedRelation< TargetType, OriginType >::operator OriginType * | ( | ) |
\short Lets you use inverted relations as if they were pointers.
This operator converts the relation to a pointer to an object of the OriginType
. It is equivalent to the member function getValue()
(see above).
IlsBoolean IlsInvertedRelation< TargetType, OriginType >::operator! | ( | ) |
\short Returns \c IlsTrue if the inverted relation is
set to 0.
IlsBoolean IlsInvertedRelation< TargetType, OriginType >::operator!= | ( | Myself & | rhs | ) |
\short Checks whether the inverted relation is not equal
to another inverted relation.
IlsBoolean IlsInvertedRelation< TargetType, OriginType >::operator!= | ( | OriginType * | rhs | ) |
\short Checks whether the origin-type is not equal to
another origin-type.
IlsBoolean IlsInvertedRelation< TargetType, OriginType >::operator== | ( | Myself & | rhs | ) |
\short Checks whether the inverted relation is equal to
another inverted relation.