Class for notifiable data members. More...
#include <ilserver/model.h>
Public Types | |
typedef IlsEntry< EntryType > | Myself |
Myself is the type of the instantiated template class. | |
Public Member Functions | |
IlsEntry (HolderType &holder, EntryType value, IlsActivity activity=IlsModel::GetDefaultActivity()) | |
This constructor lets you specify an initial value for EntryType . More... | |
IlsEntry (HolderType &holder, IlsActivity activity=IlsModel::GetDefaultActivity()) | |
Constructor. More... | |
Myself & | set (EntryType value) |
Accessors | |
IlsActivity | getActivity () const |
EntryType | getValue () |
EntryType | getValueQuietly () const |
Notification | |
Myself & | touch () |
IlsBoolean | isModified () |
During a notification phase, this member function returns IlsTrue only if the entry data member has been modified since the last notification phase. | |
EntryType | getOldValue () |
During a notification phase, this member function returns the value of the entry data member before it has been edited in the last action phase. More... | |
Operators | |
Myself & | operator= (EntryType value) |
Equivalent to the set function described earlier. | |
Myself & | operator= (Myself &rhs) |
Assigns a new entry to IlsEntry . | |
operator EntryType () | |
Class for notifiable data members.
Library: server
EntryType | The type of the handled value. |
Rogue Wave Server lets you declare special data members called entry data members. Entries are data members whose update triggers notification, as well as the re-evaluation of derived data members whose evaluation function depends on modified entries.
Entry data members are instances of the class template IlsEntry
. This class template takes the type of the entry data member (EntryType
) as its parameter. The type of the holder class (HolderType
) is used in the constructor of IlsEntry
.
The HolderType
must derive directly or transitively from the class IlsEntity
or IlsObject
. Derivation must be public. The EntryType
must have a valid default and copy constructor, as well as an assignment operator.
IlsDerived
, IlsEntity
, IlsObject
. IlsEntry< EntryType >::IlsEntry | ( | HolderType & | holder, |
IlsActivity | activity = IlsModel::GetDefaultActivity() |
||
) |
Constructor.
This constructor leaves the value of EntryType
uninitialized.
holder | a reference to the object that contains the entry. |
activity | specifies whether the entry is active or not. An entry is active if its modification sets off the recomputation of derived data members. The default value is the one returned by the static function IlsModel::GetDefaultActivity() , which is ILS_INACTIVE by default. |
IlsEntry< EntryType >::IlsEntry | ( | HolderType & | holder, |
EntryType | value, | ||
IlsActivity | activity = IlsModel::GetDefaultActivity() |
||
) |
This constructor lets you specify an initial value for EntryType
.
holder | a reference to the object that contains the entry. |
value | Initial value for EntryType . |
activity | specifies whether the entry is active or not. An entry is active if its modification sets off the recomputation of derived data members. The default value is the one returned by the static function IlsModel::GetDefaultActivity() , which is ILS_INACTIVE by default. |
IlsActivity IlsEntry< EntryType >::getActivity | ( | ) | const |
\short Returns \c ILS_ACTIVE if the entry has been
set as active. Otherwise, it returns ILS_INACTIVE
.
For details, see the constructor.
EntryType IlsEntry< EntryType >::getOldValue | ( | ) |
During a notification phase, this member function returns the value of the entry data member before it has been edited in the last action phase.
The result of this function is significant only if the function isModified()
returns IlsTrue
for this attribute.
EntryType IlsEntry< EntryType >::getValue | ( | ) |
\short Returns the value of \c EntryType.
It is useful especially when the conversion operator cannot be used or when the compiler is likely to encounter multiple user-defined conversions.
EntryType IlsEntry< EntryType >::getValueQuietly | ( | ) | const |
\short Provides a quick access to the value of the entry.
It should not be used to evaluate a derived data member or to retrieve a value when using Rogue Wave Server transactions.
IlsEntry< EntryType >::operator EntryType | ( | ) |
\short Lets you manipulate an entry data member as if
it were the entry type.
This operator is not const
, since it can update the entry internal data. It is equivalent to the function getValue()
described above.
\short Assigns a new value to \c EntryType without
checking for equality.
IlsUpdateForbidden | If the function isUpdateAllowed() returns IlsFalse for the HolderType . |