MAK RTIspy API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
11 - Accessing RID File Parameters

RID file parameters are made available to RTI code and to plug-ins through an instance of the DtRIDParameters class (RIDparams.h).

When a federate instantiates an RTI::RTIambassador, one of the first things that RTI::RTIambassador does is to create an instance of DtRIDParameters and fill in its member data by reading the RID file. The DtRIDParameters object is passed to each of the RTI's managers as it is constructed, so that the parameters can be used during construction. If you derive your own subclasses from one or more managers, you can access the RID parameters by calling the appropriate inspector functions on DtRIDParameters.

You can also add your own custom RID parameters, so that you can configure some of the custom functionality that you have added to the RTI in your plug-in. The following example assumes that you want to add an integer parameter called MyParam to the RID file. RID file writers would add a line like this to the RID file:

(setq MyParam 10)

Note
The RID parameters implemented by MAK begin with setqb. User-defined parameters should begin with setq. For details, please see "MAK Technologies Lisp (MTL) Files," in MAK RTI Developers Guide.

From within your plug-in code, you can obtain the value of MyParam as follows, assuming that params is a DtRIDParameters object that has been passed to one of your derived managers:

int val;
DtlObjPtr value;
value = params->mtlEnvironment().lookup("MyParam");
if(!value.null())
{
val = value->fixnum();
}

If your parameter value is a string, use string() instead of fixnum(). For floats, use flonum(). This technique relies on the MTL library, a utility library that is actually part of VR-Link. You must include mtlInc.h and link with libmtl to use DtlObjPtr. You do not need to use rid.mtl and its accompanying lisp-like interpretation system to configure your plug-ins. Custom configuration mechanisms will not harm the RTI.

[<< rtiexec Plug-ins] [Home] [Top of Page] [Compiling and Linking >>]


Document ID: Generated on Mon Sep 7 15:40:32 EDT 2020 from SVN revision 217499
Copyright © 2005-2020 MAK Technologies Inc. All Rights Reserved (www.mak.com)