Server
API Reference Guide
Product Documentation:

Rogue Wave Server
Documentation Home
List of all members | Static Public Member Functions
IlsModelInterpreter Class Reference

This class implements the runtime interpreter of server object models. More...

#include <ilserver/rtmodel.h>

Static Public Member Functions

static IlsBoolean DeclDerivedEvaluator (const IlsString &typeNm, const IlsString &attributeNm, IlsDerivedEvaluatorFunction f)
 Assigns an evaluation function f to a derived dynamic attribute attributeNm of the server object type typeNm.
 
static IlsBoolean DeclFunImplementation (const IlsString &typeNm, const IlsString &cbNm, IlsRTFunctionPtr f)
 Assigns a new implementation function to the function funNm declared to the server model interpreter for the class typeNm. More...
 
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. More...
 
static IlsBoolean DeclIdxAttributeMap (const IlsString &typeNm, const IlsString &attributeNm, const IlsString &strIdx, int numIdx)
 Associates the string strIdx with the numeric index value numIdx of the indexed attribute attributeNm of the server object type named typeNm. More...
 
static const IlsFunctionDefGetGlobalFunction (const IlsString &name)
 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. More...
 
static IlsFunctionDef const ** GetGlobalFunctions (int &dim)
 Returns an array of the global functions declared in the server.
 
static int GetIdxAttributeMap (const IlsString &typeNm, const IlsString &attributeNm, const IlsString &strIdx)
 Returns the index value associated between the string strIdx and the indexed attribute attributeNm of the server object type named typeNm. More...
 
static const IlsObjectType ** GetObjectTypes (int &dim)
 Returns an array of constant pointers to the server object types for which runtime access has been declared. More...
 
static const IlsObjectTypeGetType (const IlsString &typeNm)
 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 IlsBoolean UndeclIdxAttributeMap (const IlsString &typeNm, const IlsString &attributeNm, const IlsString &strIdx)
 Retracts the association declared between the string strIdx and the indexed attribute attributeNm of the server object type named typeNm. More...
 

Detailed Description

This class implements the runtime interpreter of server object models.

Library: mvserver

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_XXX(),ILS_USES_XXX(),ILS_INVERTED_XXX(),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.

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().

Member Function Documentation

◆ DeclFunImplementation()

static IlsBoolean IlsModelInterpreter::DeclFunImplementation ( const IlsString typeNm,
const IlsString cbNm,
IlsRTFunctionPtr  f 
)
static

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.

◆ DeclFunParameter()

static IlsBoolean IlsModelInterpreter::DeclFunParameter ( const IlsString typeNm,
const IlsString cbNm,
const IlsString paramType 
)
static

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.

◆ DeclIdxAttributeMap()

static IlsBoolean IlsModelInterpreter::DeclIdxAttributeMap ( const IlsString typeNm,
const IlsString attributeNm,
const IlsString strIdx,
int  numIdx 
)
static

Associates the string strIdx with the numeric index value numIdx 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.
  • strIdx is already associated with an index value.

Otherwise it returns IlsTrue.

◆ GetGlobalFunction()

static const IlsFunctionDef* IlsModelInterpreter::GetGlobalFunction ( const IlsString name)
static

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 also
ILS_GLOBAL_FUNCTION().

◆ GetIdxAttributeMap()

static int IlsModelInterpreter::GetIdxAttributeMap ( const IlsString typeNm,
const IlsString attributeNm,
const IlsString strIdx 
)
static

Returns the index value associated between the string strIdx 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 the mapped index value.

◆ GetObjectTypes()

static const IlsObjectType** IlsModelInterpreter::GetObjectTypes ( int &  dim)
static

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.

◆ UndeclIdxAttributeMap()

static IlsBoolean IlsModelInterpreter::UndeclIdxAttributeMap ( const IlsString typeNm,
const IlsString attributeNm,
const IlsString strIdx 
)
static

Retracts the association declared between the string strIdx 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.