ILS_RW_ATTRIBUTE_XXX
Category
Dynamic view-related macros (server side)
Description
The macros ILS_RW_ATTRIBUTE_XXX declare a read/write runtime attribute for a server object type so that it can be used in view specifications. This attribute is defined by an accessor, a modifier and a modification test.
The accessor is used by Rogue Wave 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 to representation and/or propagation (see
Dynamic View Types and C++ View Types).
The modifier is used by Rogue Wave Server during a component-to-server transaction to modify the attribute value. When the modifier returns
IlsFalse and the rollback mode is enabled by the component, the current transaction is rolled back by the server and a rollback transaction is sent to the component that requested the modification. See the
“Transaction Control” sections in the
IlsMvComponent and
IlsMvServer class descriptions for more information.
Note: When the runtime attribute is not related to an entry or to a derived data member, it is your responsibility to force the modification state of the owning object by calling the member function IlsViewed::forceModify. |
The modification test is used by Rogue Wave Server to detect whether the attribute has changed since the latest notification cycle. For instance, if the runtime attribute is associated with an entry, the test function should call the function
isModified declared on the class template
IlsEntry.
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.
Important: 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
LS_RW_ATTRIBUTE_CHAR
(objType,attrLabel,getValue,setValue,isModified)
ILS_RW_ATTRIBUTE_BOOLEAN
(objType,attrLabel,getValue,setValue,isModified)
ILS_RW_ATTRIBUTE_SHORT
(objType,attrLabel,getValue,setValue,isModified)
ILS_RW_ATTRIBUTE_INT
(objType,attrLabel,getValue,setValue,isModified)
ILS_RW_ATTRIBUTE_LONG
(objType,attrLabel,getValue,setValue,isModified)
ILS_RW_ATTRIBUTE_FLOAT
(objType,attrLabel,getValue,setValue,isModified)
ILS_RW_ATTRIBUTE_DOUBLE
(objType,attrLabel,getValue,setValue,isModified)
ILS_RW_ATTRIBUTE_STRING
(objType,attrLabel,getValue,setValue,isModified)
ILS_RW_ATTRIBUTE_USERTYPE
(objType,userType,attrLabel,getValue,setValue,isModified)
Macros
ILS_RW_ATTRIBUTE_CHAR(objType,attrLabel,getValue,setValue,isModified)
This macro declares attrLabel as a runtime attribute of the class objType.
This attribute is of type char and can be modified.
Its accessor,
getValue, has the following signature:
char objType::getValue();
This signature can be different under the following conditions:
the function is a member of the class or of a parent class, and
its result converts to
char, and
it can be invoked without arguments.
Its modifier,
setValue, has the following signature:
IlsBoolean objType::setValue(char value)
When the function returns
IlsFalse, the attribute cannot be set to this value. In that case, the current transaction is rolled back by the server and a rollback transaction is sent to the component having requested the modification.
See section
Transaction Control in the
IlsMvComponent class description.
The signature of the function can be different under the following conditions:
it is a member of the class or of a derived class, and
its results converts implicitly to
IlsBoolean, and
it can be invoked with a char as argument.
Its modifier test function,
isModified, has the following signature:
IlsBoolean objType::isModified();
This signature can be different 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.
ILS_RW_ATTRIBUTE_BOOLEAN(holder,attrLabel,getValue,setValue,isModified)
ILS_RW_ATTRIBUTE_SHORT(holder,attrLabel,getValue,setValue,isModified)
ILS_RW_ATTRIBUTE_INT(holder,attrLabel,getValue,setValue,isModified)
ILS_RW_ATTRIBUTE_LONG(holder,attrLabel,getValue,setValue,isModified)
ILS_RW_ATTRIBUTE_FLOAT(holder,attrLabel,getValue,setValue,isModified)
ILS_RW_ATTRIBUTE_DOUBLE(holder,attrLabel,getValue,setValue,isModified)
ILS_RW_ATTRIBUTE_STRING(holder,attrLabel,getValue,setValue,isModified)
ILS_RW_ATTRIBUTE_MVVALUE(holder,attrLabel,getValue,setValue,isModified)
ILS_RW_ATTRIBUTE_USERTYPE(holder,attrType,attrLabel,getValue,setValue,
isModified)
ILS_RW_ATTRIBUTE_ENUM(holder,attrType,attrLabel,getValue,setValue,
isModified)
The macros in the above list follow the same rules as ILS_RW_INDEXED_ATTR_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.