IlsEntry
Category
Modeling class template
Inheritance Path
IlsEntry
Description
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.
Library
Synopsis
template <class EntryType>
class IlsEntry:
{
public:
IlsActivity activity=IlsModel::GetDefaultActivity());
EntryType value,
IlsActivity activity=IlsModel::GetDefaultActivity());
Myself&
set(EntryType value);
};
Constructors
IlsEntry(HolderType& holder,
IlsActivity activity=IlsModel::GetDefaultActivity());
As its first argument, this constructor takes a reference to the object that contains the entry. The argument 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.
This constructor leaves the value of
EntryType uninitialized.
IlsEntry(HolderType& holder,
EntryType value,
IlsActivity activity=IlsModel::GetDefaultActivity());
This constructor lets you specify an initial value for EntryType.
Member Functions
Myself& set(EntryType value);
This member function assigns a new value to
EntryType without checking for equality.
This function throws the exception
IlsUpdateForbidden if the function
isUpdateAllowed returns
IlsFalse for the
HolderType.
Accessors
IlsActivity getActivity() const;
This member function returns
ILS_ACTIVE if the entry has been set as active. Otherwise, it returns
ILS_INACTIVE. For details, see the constructor.
EntryType getValue();
This member function returns the value of 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 getValueQuietly() const;
This member function 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.
Notification
Myself& touch();
This member function tells Rogue Wave Server that the entry has been modified. This function is seldom used, but it is useful for notification and must be used when EntryType has been modified other than by an assignment.
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. The result of this function is significant only if the function
isModified returns
IlsTrue for this attribute.
Operators
Myself& operator=(EntryType value);
This operator is equivalent to the set function described earlier.
Myself& operator=(Myself& rhs);
This operator assigns a new entry to IlsEntry.
operator EntryType();
This operator 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.
Implementation
If you decide to compile with a program that was written for Rogue Wave Server 2.X/3.0, it is necessary to remove the first parameter from the declaration of the IlsEntry data member. It is possible to compile older programs by setting the compilation flag ILS_COMPATIBILITY to 300. Example:
Unix:
-DILS_COMPATIBILITY=300 PC:
/D ILS_COMPATIBILITY=300See Also
Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.