VR-Forces 4.2 Class Documentation
Route Parameter Entry

This DtRouteParametersBuilder creates the entry for the route object


Header file:

/*******************************************************************************
** Copyright (c) 2005 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
/*******************************************************************************
** $RCSfile: routeParametersBuilder.h,v $ $Revision: 1.2 $ $State: Exp $
*******************************************************************************/
#ifndef DtRouteParametersBuilder_H_
#define DtRouteParametersBuilder_H_
//class DtRouteParametersBuilder:
//
//Instances of DtRouteParametersBuilder are used to create and configure a
//DtVrfObjectParameters object for a route. The parameters object returned
//should fully specify the necessary parameters to create a route.
{
public:
//default constructor
//destructor
//Creates and configures parameters for a route.
protected:
//copy constructor - not implemented
//assignment operator - not implemented
};
#endif

Implementation:

/*******************************************************************************
** Copyright (c) 2005 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
/*******************************************************************************
** $RCSfile: routeParametersBuilder.cxx,v $ $Revision: 1.2 $ $State: Exp $
*******************************************************************************/
#include <vlutil/vlPrint.h>
#include <vlpi/disEnums.h>
#include <vrfExtProtocol/objTypeEnums.h>
{
}
{
}
{
//Routes (and control/overlay objects in general) only need to be
//have a base DtVrfObjectParameters parameters type.
DtVrfObjectParameters* parameters =
new DtVrfObjectParameters("vrf-object-param");
if(!parameters)
{
DtWarn("DtParameterDbEntryFactory::createRoute() : "
"Can't create parameters.\n"
"No parameters for factory key vrf-object-param.\n");
return NULL;
}
parameters->init();
//Set the state repository user extention and type (required). For this
//example, just create the default (we're not extending the state repository
//in any special way).
DtVrfStateRepositoryUserExtension stateRepositoryUserExtension(0);
parameters->setStateRepositoryUserExtension(stateRepositoryUserExtension);
//By default, we use an extended DtEntityType in our represention of
//route object type in VR-Forces.
//See objTypeEnums.h for the complete set of extended types.
DtRwObjectType objectType("object-type",
DtObjectTypeIndividual,
DtLinearObjectKind,
-1,
-1,
DtLinearObjectCategoryRoute,
-1,
-1,
-1);
parameters->setObjectType(objectType);
parameters->setForceType(DtForceOther);
parameters->setCategory("Route");
parameters->setEchelonLevel("");
parameters->setOrganized(false);
//Set up local and remote sub component types for the entry. These types
//are used to direct what kinds of state repositories and network interfaces
//should be created for local and remote objects of this kind ('local'
//means simulated within our VR-Forces back-end and 'remote' means
//simulated from some other application, which may or may not be a VR-Forces
//back-end).
local->setSimStateRepositoryType("vrf-overlay-object-state-repository");
local->setNetworkInterfaceType("local-environmental-net-interface");
remote->setSimStateRepositoryType("vrf-moving-object-state-repository");
remote->setNetworkInterfaceType("vrf-remote-environmental-net-interface");
return parameters;
}

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)