IlsModelInterpreter
 
IlsModelInterpreter
Category 
Dynamic view-related class (server side)
Inheritance Path 
IlsModelInterpreter
Description 
This class implements the runtime interpreter of server object models.
A server object model defines object types with their attributes, relations, and functions. It is implicitly declared to the interpreter via the initialization of data encapsulated in macros such as ILS_OBJECT_BEGIN/ILS_OBJECT_END, ILS_ENTITY_BEGIN/ILS_ENTITY_END, ILS_OWNS_X, ILS_USES_X, ILS_INVERTED_X, ILS_ENTRY_XXX, ILS_DERIVED_XXX, etc.
The interpreter is used internally by Rogue Wave Server to check and pre-process dynamic view types. It is transparent to the developer. However, it can be used when an application needs to introspect the server model at runtime.
Library 
<mvserver>
Header File 
#include <ilserver/rtmodel.h>
Synopsis 
class IlsModelInterpreter{
public:
static const IlsObjectType* GetType(const IlsString& typeNm);
static const IlsObjectType** GetObjectTypes(int& dim);
static const IlsFunctionDef* GetGlobalFunction
(const IlsString& funName);
static IlsFunctionDef const** GetGlobalFunctions(int& dim);
static IlsBoolean DeclFunImplementation(const IlsString& typeNm,
const IlsString& funNm,
IlsRTFunctionPtr f);
static IlsBoolean DeclFunParameter(const IlsString& typeNm,
const IlsString& cbNm,
const IlsString& paramType);
static IlsBoolean DeclIdxAttributeMap(const IlsString& typeNm,
const IlsString& attributeNm,
const IlsString& label,
int idxValue);
static IlsBoolean UndeclIdxAttributeMap
(const IlsString& typeNm,
const IlsString& attributeNm,
const IlsString& label);
static int GetIdxAttributeMap(const IlsString& typeNm,
const IlsString& attributeNm,
const IlsString& ’label’);
static IlsBoolean DeclDerivedEvaluator
(const IlsString& typeNm,
const IlsString& attributeNm,
IlsDerivedEvaluatorFunction f);
};
Member Functions 
[static] const IlsObjectType* GetType(const IlsString& typeNm);
This static member function returns a pointer to the server object type named typeNm, or the null pointer if this type has not been declared as accessible at runtime.
[static] const IlsObjectType** GetObjectTypes(int& dim);
This static member function returns an array of constant pointers to the server object types for which runtime access has been declared. The reference argument dim is assigned to the dimension of the array. It is up to the caller to delete the returned array.
[static] const IlsFunctionDef* GetGlobalFunction(const IlsString& funName);
This static member function returns a pointer to the runtime definition of the global function named funName, or a null pointer if no such function is declared in the interpreter (see the macros ILS_GLOBAL_FUNCTION).
[static] IlsFunctionDef const** GetGlobalFunctions(int& dim);
This static member function returns an array of the global functions declared in the server.
[static] IlsBoolean DeclFunImplementation(const IlsString& typeNm,
const IlsString& funNm,
IlsRTFunctionPtr f);
This static member function assigns a new implementation function to the function funNm declared to the server model interpreter for the class typeNm. If the typeNm argument is empty, the implementation of the global function funNm is assigned. When this method is called, the function f is invoked.
Use this member function when you choose to work with dynamic modeling services to assign a C++ function to a dynamic member function declared to the server model interpreter.
[static] IlsBoolean DeclFunParameter(const IlsString& typeNm,
const IlsString& cbNm,
const IlsString& paramType);
This static member function declares a new parameter of type paramType for the method cbNm of type tpNm. If typeNm is null, the parameter is added to the global function cbNm. The new parameter is added to the list of parameters for the corresponding function. Use this function if you have declared a new dynamic member function using the IlsDynModelInterpreter API.
[static] IlsBoolean DeclIdxAttributeMap(const IlsString& typeNm,
const IlsString& attributeNm,
const IlsString& label,
int idxValue);
This static member function associates the string label with the numeric index value idxValue of the indexed attribute attributeNm of the server object type named typeNm. This label can be used instead of the numeric value in dynamic view type specifications. Thus, if an association is declared between the string “second” and the index value “2” for the Server attribute attr, the following two expressions:
attr[2]
and
attr[second]
refer to the same Server indexed attribute value in a dynamic view type specification.
Note: The look up for an index associated with “second” is performed only the first time the expression is evaluated. If no index is found, the value of the expression is set to the void value (see the class IlsMvValue).
The function returns IlsFalse if:
*typeNm does not refer to any server object class in the server model interpreter.
*attributeNm does not refer to any attribute declared on the server object type typeNm.
*label is already associated with an index value.
Otherwise it returns IlsTrue.
[static] IlsBoolean UndeclIdxAttributeMap(const IlsString& typeNm,
const IlsString& attributeNm,
const IlsString& label);
This static member function retracts the association declared between the string label and the indexed attribute attributeNm of the server object type named typeNm. It returns IlsFalse if no such association was previously declared. Otherwise, it returns IlsTrue.
[static] int GetIdxAttributeMap(const IlsString& typeNm,
const IlsString& attributeNm,
const IlsString& ’label’);
This static member function returns the index value associated between the string label and the indexed attribute attributeNm of the server object type named typeNm. It returns -1 if no such association was previously declared. Otherwise, it returns IlsTrue.
[static] IlsBoolean DeclDerivedEvaluator(const IlsString& typeNm,
const IlsString& attributeNm,
IlsDerivedEvaluatorFunction f);
This static member function allows you to assign an evaluation function to a derived dynamic attribute.
See Also 
ILS_GLOBAL_FUNCTION, ILS_DERIVED_XXX, ILS_ENTITY_BEGIN/ILS_ENTITY_END, ILS_ENTRY_XXX, ILS_INVERTED_1, ILS_INVERTED_N, ILS_OBJECT_BEGIN/ILS_OBJECT_END, ILS_OWNS_1, ILS_OWNS_N, ILS_USES_1, ILS_USES_N

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