ILS_RP_ATTR_XXX
Category
Dynamic view-related macro (component side)
Description
The macros ILS_RP_ATTR_XXX let you associate editing functions with representation attributes referenced in dynamic view type specifications.
If a representation attribute is related to a representation object type —
IlsRpObject—these macros must be enclosed between the macros
ILS_RP_OBJECT_BEGIN/ILS_RP_OBJECT_END or their derivatives.
The same representation attribute can be associated with different editing functions for different types of values.
The association between the name of a representation attribute and an editing function is established by the representation model interpreter, which is implemented in the Rogue Wave Server component library. Using this association, Rogue Wave Server will call the appropriate editing function whenever the value of an attribute must be updated.
Note: It is not necessary to have a runtime representation attribute designate a data member declared on the underlying representation (object) type, because Rogue Wave Server only needs to execute its associated editing function. |
Let us consider the following view specification:
view NetworkTree:
...
subscribe Network:
represent TreeGadget tree:...
string label=name;
Here is how you associate the function setLabel with the runtime attribute label:
ILS_RP_OBJECT_BEGIN(TreeGadget)
ILS_RP_ATTR_STRING(TreeGadget, label, setLabel)
ILS_RP_OBJECT_END(TreeGadget)
Assuming that a network object of type Network is represented by a tree object of type TreeGadget, any modifications of the attribute network.name required by the server will execute the function tree.setLabel.
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
ILS_RP_ATTR_CHAR(rpType,attrLabel,modifier)
Macros
ILS_RP_ATTR_BOOLEAN(rpType,attrLabel,modifier)
This macro associates the member function rpType::modifier with the Boolean runtime attribute attrLabel.
The signature of the editing function should be the following:
void rpType::modifier(IlsBoolean);
This function can have other parameters provided they have a default value.
The type of the first parameter can be changed provided the type IlsBoolean can be implicitly converted to that new type.
ILS_RP_ATTR_CHAR(rpType,attrLabel,modifier)
This macro associates the member function rpType::modifier with the runtime attribute attrLabel of type char.
The signature of the editing function should be the following:
void rpType::modifier(char);
This function can have other parameters provided they have a default value.
The type of the first parameter can be changed provided the type char can be implicitly converted to that new type.
ILS_RP_ATTR_INT(rpType,attrLabel,modifier)
ILS_RP_ATTR_LONG(rpType,attrLabel,modifier)
This macro associates the member function rpType::modifier with the runtime attribute attrLabel of type long.
The signature of the editing function should be the following:
void rpType::modifier(long);
This function can have other parameters provided they have a default value.
The type of the first parameter can be changed provided the type int can be implicitly converted to that new type.
ILS_RP_ATTR_FLOAT(rpType,attrLabel,modifier)
This macro associates the member function rpType::modifier with the runtime attribute attrLabel of type float.
The signature of the editing function should be the following:
void rpType::modifier(float);
This function can have other parameters provided they have a default value.
The type of the first parameter can be changed provided the type float can be implicitly converted to that new type.
ILS_RP_ATTR_DOUBLE(rpType,attrLabel,modifier)
This macro associates the member function rpType::modifier with the runtime attribute attrLabel of type double.
The signature of the editing function should be the following:
void rpType::modifier(double)
This function can have other parameters provided they have a default value.
The type of the first parameter can be changed provided the type double can be implicitly converted to that new type.
ILS_RP_ATTR_STRING(rpType,attrLabel,modifier)
This macro associates the member function rpType::modifier with the runtime attribute attrLabel of type string.
The signature of the editing function should be the following:
void rpType::modifier(IlsString);
This function can have other parameters provided they have a default value.
The type of the first parameter can be changed if the type
IlsString can be implicitly converted to that new type (
char*, for example).
ILS_RP_ATTR_USERTYPE(rpType,userType,attrLabel,modifier)
This macro associates the member function rpType::modifier with the runtime attribute attrLabel, which is a user-defined type.
The signature of the editing function should be the following:
void rpType::modifier(userType);
This function can have other parameters provided they have a default value.
The type of the first parameter can be changed if the user-defined type can be implicitly converted to that new type.
ILS_RP_ATTR_HREF(rpType,attrLabel,modifier)
This macro associates the member function rpType::modifier with the runtime attribute attrLabel, which is a hyper-reference. At the representation level, a hyper-reference is defined by its label, which is of type IlsString.
The signature of the editing function should be the following:
void rpType::modifier(IlsString);
This function can have other parameters provided they have a default value.
The type of the first parameter can be changed provided the type
IlsString can be implicitly converted to that new type (
char*, for example).
ILS_RP_ATTR_REF(rpType,attrLabel,modifier,refType)
This macro associates the member function rpType::modifier with the runtime attribute attrLabel, which is a reference to a representation object of type refType.
The editing function takes a pointer to the target object as its argument. Its signature should be the following:
void rpType::modifier(refType*);
This function can have other parameters provided they have a default value.
The type of the first parameter can be changed provided the type refType* can be implicitly converted to that new type.
ILS_RP_ATTR_FILE(rpType,attrLabel,modifier)
This macro associates the member function
rpType::modifier with the runtime attribute
attrLabel of type
IlsMvFile.
The signature of the editing function should be the following:
void rpType::modifier(IlsMvFile);
This function can have other parameters provided they have a default value.
The type of the first parameter can be changed provided the type
IlsMvFile can be implicitly converted to that new types.
ILS_RP_ATTR_MVVALUE(rpType,attrLabel,modifier)
This macro associates the member function rpType::modifier with the runtime attribute attrLabel, which is a reference to a representation object of type IlsMvValue.
The editing function takes a pointer to the target object as its argument. Its signature should be the following:
void rpType::modifier(IlsMvValue&);
This function can have other parameters provided they have a default value.
The type of the first parameter can be changed provided the type IlsMvValue can be implicitly converted to that new type.
See Also
Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.