ILS_OBJECT_BEGIN/ILS_OBJECT_END
 
ILS_OBJECT_BEGIN/ILS_OBJECT_END
Category 
Dynamic view-related macros (server side)
Description 
These macros declare a server object class deriving from IlsObject to the server model interpreter. It associates a runtime type to the C++ class. They must be used with the macro ILS_OBJECT_DECL. The server object types you declare using those macros can then be referred to in dynamic view type specifications. This macro also lets you declare runtime access to data members and member functions for the server object type.
You can use this macro to declare server object types that derive from IlsEntity if you do not want an implicit declaration of the runtime identifier to be performed, as it is the case with the macro ILS_ENTITY_DECL.
Header File 
<ilserver/rtmodel>
Synopsis 
ILS_OBJECT_BEGIN(objType)
ILS_OBJECT1_BEGIN(objType, parentType)
ILS_OBJECT2_BEGIN(objType,parentType1,parentType2)
ILS_OBJECT_WITH_ID_BEGIN(objType,idAttr)
ILS_OBJECT1_WITH_ID_BEGIN(objType,idAttr,parentType)
ILS_OBJECT2_WITH_ID_BEGIN(objType,idAttr,parentType1,parentType2)
ILS_OBJECT_END(objType)
Macros 
The macros ILS_OBJECT_BEGIN/ILS_OBJECT_END must be added to the source file that defines the member functions of the class objType. Only macros that let you declare runtime entries, derived data members and relations can be enclosed between these macros.
If objType derives from another server object type, you have to use the macro ILS_OBJECT1_BEGIN. In this case, the runtime type associated to objType dynamically inherits from the runtime access to data members and member functions of the parent type.
Note:  An attribute, relation or function of a runtime type hides any corresponding attribute, relation or function in parent types.
If objType derives from two other server object types, you have to use the macro ILS_OBJECT2_BEGIN. In this case, the runtime type associated to objType dynamically inherits from the runtime entries, derived data members and relations of the parent types. The pair of macro ILS_OBJECT2_BEGIN/ILS_OBJECT_END replaces the static view-related macro ILS_VIEWED2_DEF.
ILS_OBJECT_WITH_ID_BEGIN(objType,idAttr)
This macro is similar to ILS_OBJECT_BEGIN except that it declares the attribute idAttr as being the objType type identifier. idAttr must be declared as a runtime attribute of objType or of a parent type.
Moreover, this macro requires that objType have a constructor taking an IlsString argument:
objType::objType(IlsString identifier)
This argument is the identifier of the object. This constructor is called when a component creates a representation object using the second constructor of the class IlsRpObject and only if the model of this representation object is associated to objType.
As in entity construction, the argument passed to the objType constructor will be set to the value of the first representation object attribute that complies with the following conditions:
*The attribute is directly mapped to the entity identifier in the dynamic view specification (see Semantics of Dynamic View Type Specifications).
*The attribute value has been set just after the object has been created (see IlsRpObject::onUpdate).
*The creation of the new rp object and the attribute update occurs in the same representation transaction (see IlsRepresentation::beginC2STransaction and IlsRepresentation::commitC2STransaction).
If no representation object attribute complies with the above conditions, the argument is set to the null string.
Note: This macro can be used instead of one of the ILS_ENTITY_xxx macros to declare an entity —for example, if you need to redefine the accessor and modifier of the entity identifier.
ILS_OBJECT1_WITH_ID_BEGIN(objType,idAttr,parentType)
This macro is similar to ILS_OBJECT1_BEGIN subject to the same conditions as ILS_OBJECT_WITH_ID_BEGIN.
ILS_OBJECT2_WITH_ID_BEGIN(objType,idAttr,parentType1,parentType2)
This macro is similar to ILS_OBJECT2_BEGIN subject to the same conditions as ILS_OBJECT_WITH_ID_BEGIN.
See Also 
ILS_DERIVED_XXX, ILS_ENTITY_BEGIN/ILS_ENTITY_END, ILS_ENTITY_DECL, ILS_ENTRY_XXX, IlsObject, ILS_OBJECT_DECL, ILS_OBJECT_INIT, IlsRepresentation, IlsRpObject, ILS_R_RELATION_1, ILS_R_RELATION_N, ILS_RW_RELATION_1, ILS_RW_RELATION_N, ILS_W_RELATION_1, ILS_RW_RELATION_N

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