Data member whose value depends on other data. More...
#include <ilserver/model.h>
Inherits IlsDerivedBase.
Public Types | |
typedef IlsDerived< HolderType, DerivedType, Evaluator > | Myself |
Myself is the type of the instantiated template class. | |
Public Member Functions | |
IlsDerived (HolderType &holder) | |
Calculating Values | |
DerivedType | getValue () |
DerivedType | accessValue () |
IlsBoolean | wasEverSet () |
Eagerness | |
IlsEagerness | getEagerness () |
Returns the value of the eagerness counter. | |
IlsBoolean | isEager () |
void | incrEagerness () |
Increments the counter managing the eagerness of the derived member. | |
void | decrEagerness () |
Decrements the counter managing the eagerness of the derived member. | |
Notification | |
HolderType & | _holder |
DerivedType | _value |
operator DerivedType () | |
IlsBoolean | isModified () |
DerivedType | getOldValue () |
During a notification phase, this function returns the value of the derived data member before the last recomputation if the attribute has been recomputed since the last notification cycle. | |
void | setValue (DerivedType) |
COMPUTATION | compute () |
IlsDerived (const Myself &) | |
void | operator= (const Myself &) |
Data member whose value depends on other data.
Library: server
.
HolderType | The name of the class where the derived member is declared. The HolderType must derive directly or transitively from the class IlsEntity or IlsObject . Derivation must be public. |
DerivedType | The type of the derived member. The DerivedType must contain a valid default and copy constructor, as well as an assignment and a comparison operator (== ). |
Evaluator | The class Evaluator must contain one public static function with the following signature: static DerivedType Evaluate(HolderType&);
|
Rogue Wave Server lets you declare special data members called derived data members. Derived data members are associated with a function whose value is recalculated each time the derived data member is out-of-date. A derived data member can be marked as eager. An eager data member is recomputed each time the function IlsReevaluate()
is explicitly called or during each re-evaluation phase of an interaction cycle. If a derived data member is not marked as eager, then it is recalculated only when it is accessed.
Derived data members are instances of the class template IlsDerived
.
ILS_DERIVED_XXX()
, IlsEntity
, IlsEntry
, IlsObject
, IlsReevaluate()
. IlsDerived< HolderType, DerivedType, Evaluator >::IlsDerived | ( | HolderType & | holder | ) |
\short Constructor. The first argument
is a reference to the object that contains the derived member.
|
protected |
\short Lets you manipulate a derived member as if it were
the derived type.
This operator is not const
, since it can trigger an evaluation when called. It is equivalent to the function getValue()
.
DerivedType IlsDerived< HolderType, DerivedType, Evaluator >::accessValue | ( | ) |
\short Returns the value of the most recent evaluation
of a derived data member.
Before you call this function, the derived data member must have been calculated at least once.
|
protected |
\short Lets you manipulate a derived member as if it were
the derived type.
This operator is not const
, since it can trigger an evaluation when called. It is equivalent to the function getValue()
.
DerivedType IlsDerived< HolderType, DerivedType, Evaluator >::getValue | ( | ) |
\short Recalculates the derived data member if necessary
and returns its value.
It is useful when the conversion operator described below cannot be used or when the compiler is likely to encounter multiple user-defined conversions.
This function throws the exception IlsCycle
if a dependence cycle is detected among derived data members.
IlsBoolean IlsDerived< HolderType, DerivedType, Evaluator >::isEager | ( | ) |
\short Returns \c IlsTrue if the derived member is marked
as eager (that is, if the value of the eagerness counter is greater than 0). Otherwise, it returns IlsFalse
.
IlsBoolean IlsDerived< HolderType, DerivedType, Evaluator >::isModified | ( | ) |
\short During a notification phase, this member function returns \c IlsTrue only if the derived data member has been modified since
the last notification phase.
IlsDerived< HolderType, DerivedType, Evaluator >::operator DerivedType | ( | ) |
\short Lets you manipulate a derived member as if it were
the derived type.
This operator is not const
, since it can trigger an evaluation when called. It is equivalent to the function getValue()
.
|
protected |
\short Lets you manipulate a derived member as if it were
the derived type.
This operator is not const
, since it can trigger an evaluation when called. It is equivalent to the function getValue()
.
|
protected |
\short Lets you manipulate a derived member as if it were
the derived type.
This operator is not const
, since it can trigger an evaluation when called. It is equivalent to the function getValue()
.
IlsBoolean IlsDerived< HolderType, DerivedType, Evaluator >::wasEverSet | ( | ) |
\short Returns \c IlsTrue if the derived data member has
been calculated at least once. Otherwise, it returns IlsFalse
.
|
protected |
\short Lets you manipulate a derived member as if it were
the derived type.
This operator is not const
, since it can trigger an evaluation when called. It is equivalent to the function getValue()
.
|
protected |
\short Lets you manipulate a derived member as if it were
the derived type.
This operator is not const
, since it can trigger an evaluation when called. It is equivalent to the function getValue()
.