ILS_R_ATTRIBUTE_XXX
Category
Dynamic view-related macros (server side)
Description
The macros ILS_R_ATTRIBUTE_xxx declare a read-only runtime attribute for a server object type so that it can be used in dynamic view type specifications. Unlike the ILS_DERIVED_xxx macros, these macros let you associate an accessor, a modification test and an update eagerness function with the runtime attribute.
The accessor is used by Server during the notification of a dynamic view to notify the value of a representation attribute to a component, or to evaluate a condition set on representation and/or propagation.
The modification test is used by Server to detect whether the attribute has changed since the latest notification cycle. For instance, if the runtime attribute is associated with an entry or a derived data member, the test function should call the function
isModified declared on the class template
IlsEntry or
IlsDerived respectively.
The update eagerness function is used by Server to declare that a new view is interested in knowing the attribute value or, conversely, that a view is no longer interested in this attribute. This update eagerness function is especially useful for a runtime attribute associated with a derived data member. In this case, it should call the
incrEagerness or
decrEagerness functions declared on the
IlsDerived class template.
These macros allow you to declare runtime attributes whose names do not correspond to any data member of the server object type. They can be enclosed only between the following pairs of macros:
or their derivatives.
Warning: Rogue Wave Server does not differentiate between the “integer” and “long” types, “int” being considered an equivalent of “long”, both on the server side and on the component side. |
Synopsis
ILS_R_ATTRIBUTE_CHAR
(objType,attrLabel,getValue,isModified,updEagerness)
ILS_R_ATTRIBUTE_BOOLEAN
(objType,attrLabel,getValue,isModified,updEagerness)
ILS_R_ATTRIBUTE_SHORT
(objType,attrLabel,getValue,isModified,updEagerness)
ILS_R_ATTRIBUTE_INT
(objType,attrLabel,getValue,isModified,updEagerness)
ILS_R_ATTRIBUTE_LONG
(objType,attrLabel,getValue,isModified,updEagerness)
ILS_R_ATTRIBUTE_FLOAT
(objType,attrLabel,getValue,isModified,updEagerness)
ILS_R_ATTRIBUTE_DOUBLE
(objType,attrLabel,getValue,isModified,updEagerness)
ILS_R_ATTRIBUTE_STRING
(objType,attrLabel,getValue,isModified,updEagerness)
ILS_R_ATTRIBUTE_MVVALUE
(objType,attrLabel,getValue,isModified,updEagerness)
ILS_R_ATTRIBUTE_ENUM
(objType,attrType,attrLabel,getValue,isModified,updEagerness)
ILS_R_ATTRIBUTE_USERTYPE
(objType,attrType,attrLabel,getValue,isModified,updEagerness)
Macros
ILS_R_ATTRIBUTE_CHAR(objType,attrLabel,getValue,isModified,updEagerness)
This macro declares attrLabel as a runtime attribute of the class objType.
This attribute is of type char and cannot be modified.
Its accessor,
getValue, has the following signature:
char objType::getValue();
This signature can vary under the following conditions:
The function is a member of the class or of a parent class.
Its result converts to
char.
It can be invoked without arguments.
Its modifier test function,
isModified, has the following signature:
IlsBoolean objType::isModified();
This signature can vary under the following conditions:
The function is a member of the class or of a parent class.
Its result converts to
IlsBoolean.
It can be invoked without arguments.
The update eagerness function has the following signature:
void objType::updEagerness(IlsBoolean increment);
When the increment argument is set to IlsTrue, this means that a new view is interested by the atttribute value. Conversely, IlsFalse means that a view is no longer interested in the attribute value.
The signature can be different under the following conditions:
It is a member of the class or of a derived class.
It can be invoked with a boolean as argument.
ILS_R_ATTRIBUTE_BOOLEAN(objType,attrLabel,getValue,isModified,updEagerness)
ILS_R_ATTRIBUTE_SHORT(objType,attrLabel,getValue,isModified,updEagerness)
ILS_R_ATTRIBUTE_INT(objType,attrLabel,getValue,isModified,updEagerness)
ILS_R_ATTRIBUTE_LONG(objType,attrLabel,getValue,isModified,updEagerness)
ILS_R_ATTRIBUTE_FLOAT(objType,attrLabel,getValue,isModified,updEagerness)
ILS_R_ATTRIBUTE_DOUBLE(objType,attrLabel,getValue,isModified,updEagerness)
ILS_R_ATTRIBUTE_STRING(objType,attrLabel,getValue,isModified,updEagerness)
ILS_R_ATTRIBUTE_MVVALUE(objType,attrLabel,getValue,isModified,updEagerness)
ILS_R_ATTRIBUTE_ENUM
(objType,attrType,attrLabel,getValue,isModified,updEagerness)
ILS_R_ATTRIBUTE_USERTYPE
(objType,attrType,attrLabel,getValue,isModified,updEagerness)
The macros in the above list follow the same rules as ILS_R_ATTRIBUTE_CHAR, except that their attribute type varies according to the following table:
See Also
Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.