Dynamic View Services > Defining Runtime Access to the Server Model > Declaring Runtime Attributes > Basic Macros
 
Basic Macros
The basic macros used to declare a runtime attribute depend on its kind (entry or derived data member) and on the type of its value, which can be a primitive type (IlsBoolean, char, short, int, long, float, or double), a string (char* or IlsString), an untyped pointer (IlsAny), an enumerated type, or a user-defined subtype of IlsMvUserType.
Each macro takes the following arguments:
*the type of the attribute holder, which must be a runtime type;
*the attribute name.
The Company example, for instance, contains the following declarations (the macros for relations are omitted):
ILS_ENTITY_BEGIN(Company)
...
ILS_ENTRY_STRING(Company,name)
ILS_ENTITY_END(Company)
 
ILS_OBJECT_WITH_ID_BEGIN(Project,identifier)
...
ILS_DERIVED_INT(Project,cost)
ILS_OBJECT_END(Project)
 
ILS_OBJECT_BEGIN(Department)
...
ILS_ENTRY_STRING(Department,name)
ILS_OBJECT_END(Department)
 
ILS_OBJECT_BEGIN(Employee)
...
ILS_ENTRY_STRING(Employee,name)
ILS_ENTRY_INT(Employee,monthCost)
ILS_DERIVED_INT(Employee,nbMonths)
ILS_DERIVED_INT(Employee,cost)
ILS_OBJECT_END(Employee)
 
ILS_OBJECT_BEGIN(Contribution)
...
ILS_ENTRY_INT(Contribution,nbMonths)
ILS_DERIVED_INT(Contribution,cost)
ILS_OBJECT_END(Contribution)
Attributes related to entry data members are associated with their default accessor, modifier and modification test. Attributes related to derived data members are associated with their default accessor, modification test and subscription functions, and have no modifiers.

Version 6.3
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.