unsetSetContext > Semantics of Dynamic View Type Specifications > Representation Attributes
 
Representation Attributes
Representations are specified with a list of typed attributes, called representation attributes, which can be of a basic type —such as boolean, char, string, int, float or any— or of a user-defined type. A representation attribute can also be a reference to another representation, a hyper-reference, or a collector (see “References”., “Hyper-References”. and “Collectors”. for details).
*A representation attribute can be simple, as in the following example:
subscribe Node:
represent TreeItem item:
string label=...;
The item representation that corresponds to the Server class Node contains a simple attribute of type string, which is named label.
*A representation attribute can also be indexed, as in the following example:
subscribe Line:
represent MatrixItem matrixItem:
string column[1]=...;
string column[2]=...;
int column[3]=...;
The matrixItem representation, which corresponds to the Server class Line, contains three indexed attributes of type string and int named column.
There is no direct connection between representation attributes and the data members of the underlying representation object type. However, a representation attribute must reference an editing function that must be a member function of the representation object type. Using the macros ILS_RP_ATTR_XXX, ILS_RP_DEFAULT_XXX, and other dynamic-view related macros that associate editing functions with runtime representation attributes, you can associate the name of a representation attribute with an editing function. In that case, Rogue Wave Server calls the associated function to set the attribute value each time the server notifies a modification of this value to the component. By default, a virtual update function specific to the attribute type is called on the base class IlsRpObject. For details, see the attribute editing functions of the class IlsRpObject.

Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.