VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
DtVrfObjectPlanAdministrator Class Reference

The DtVrfObjectPlanAdministrator performs plan-related tasks that must be done in a centralized manner. This class reads and writes the plan file during scenario load and save. It centralizes communication between the DtVrfObjectRemoteController and a DtVrfObjectPlanManager by registering callbacks for the plan messages sent by the controller and forwarding them to the proper plan manager. This avoids callbacks from being fired off from every single plan manager. The DtVrfObjectPlanAdministrator also provides methods which allow the DtCgf to enable and disable the plan execution state for all the plans during scenario load and save.

See Also
The Plan Administrator

Public Types

typedef std::map< DtUUID, char * > CachedPlanMap
 

Public Member Functions

 DtVrfObjectPlanAdministrator (DtLocalObjectManager *vrfObjectManager)
 
virtual ~DtVrfObjectPlanAdministrator ()
 
virtual void cachePlan (const DtUUID &sObjName, DtlObjPtr planBlock)
 
virtual void clearCachedPlans ()
 
virtual bool init ()
 
virtual const charlookupCachedPlan (const DtUUID &sObjName)
 
virtual bool readPlanFile (const DtString &filename, DtlObjPtr *retArgs=0)
 
virtual bool readPlanFileFromZipFile (const DtString &scenarioZipFile, const DtString &filename, DtlObjPtr *retArgs=0)
 
virtual bool readPlanFile (const std::string &buffer, DtlObjPtr *retArgs=0)
 
virtual bool readPlanFile (DtlObjPtr &args)
 
virtual void writePlanFile (const DtString &filename) const
 
virtual void writePlanFile (std::string &planFile) const
 
virtual void ignoreThisUUIDOnPlanRead (const DtUUID &)
 
virtual void clearIgnoreUUIDsOnPleanRead ()
 
const std::set< DtUUID > & ignoreUUIDsOnPlanRead () const
 
virtual bool planExecutionEnabled () const
 
virtual void processSetPlan (DtSimMessage *msg)
 
virtual void processSetMultiplePlan (DtSimMessage *msg)
 
virtual void processRequestPlan (DtSimMessage *msg)
 
virtual void processRequestMultiPlan (DtSimMessage *msg)
 
virtual void processAbandonPlan (DtSimMessage *msg)
 
virtual void processRestartPlan (DtSimMessage *msg)
 
virtual void clearObjectManager ()
 
virtual void enablePlanExecutionState ()
 
virtual void disablePlanExecutionState ()
 

Static Public Member Functions

static void setPlanCallback (DtSimMessage *msg, void *usr)
 
static void setMultiplePlanCallback (DtSimMessage *msg, void *usr)
 
static void requestPlanCallback (DtSimMessage *msg, void *usr)
 
static void requestMultiPlanCallback (DtSimMessage *msg, void *usr)
 
static void abandonPlanCallback (DtSimMessage *msg, void *usr)
 
static void restartPlanCallback (DtSimMessage *msg, void *usr)
 

Protected Member Functions

virtual bool processPlanStream (DtlInputStream *, DtlObjPtr *retArgs=0)
 
 DtVrfObjectPlanAdministrator ()
 
 DtVrfObjectPlanAdministrator (const DtVrfObjectPlanAdministrator &orig)
 
DtVrfObjectPlanAdministratoroperator= (const DtVrfObjectPlanAdministrator &orig)
 

Protected Attributes

DtLocalObjectManagermyObjectManager
 
CachedPlanMap myCachedPlans
 
bool myExecuting
 
std::set< DtUUIDmyIgnoreUUIDsOnPlanRead
 

Static Protected Attributes

static PlanFileVersion planFileCurrentVersion
 

Member Typedef Documentation

Constructor & Destructor Documentation

DtVrfObjectPlanAdministrator::DtVrfObjectPlanAdministrator ( DtLocalObjectManager vrfObjectManager)

Constructor.

virtual DtVrfObjectPlanAdministrator::~DtVrfObjectPlanAdministrator ( )
virtual

Destructor. Unregisters requestPlanCallback, setPlanCallback, restartPlanCallback and abandonPlanCallback.

DtVrfObjectPlanAdministrator::DtVrfObjectPlanAdministrator ( )
protected

default constructor; not implemented

DtVrfObjectPlanAdministrator::DtVrfObjectPlanAdministrator ( const DtVrfObjectPlanAdministrator orig)
protected

copy constructor; not implemented

Member Function Documentation

virtual void DtVrfObjectPlanAdministrator::cachePlan ( const DtUUID sObjName,
DtlObjPtr  planBlock 
)
virtual

store the plan text in myCachedPlans Used when attaching VRF components to remote, non-VRF entities.

virtual void DtVrfObjectPlanAdministrator::clearCachedPlans ( )
virtual

empty myCachedPlans

virtual bool DtVrfObjectPlanAdministrator::init ( )
virtual

Registers requestPlanCallback, setPlanCallback restartPlanCallback, and abandonPlanCallback.

virtual const char* DtVrfObjectPlanAdministrator::lookupCachedPlan ( const DtUUID sObjName)
virtual

search myCachedPlans for an entry indexed by sObjName Used when attaching VRF components to remote, non-VRF entities. Returns NULL if nothing found.

virtual bool DtVrfObjectPlanAdministrator::readPlanFile ( const DtString filename,
DtlObjPtr *  retArgs = 0 
)
virtual

Reads the plan file, assigning the plans to the appropriate DtVrfObjectPlanManagers. If retArgs is specified will set to the arguments read rom the plan file.

virtual bool DtVrfObjectPlanAdministrator::readPlanFileFromZipFile ( const DtString scenarioZipFile,
const DtString filename,
DtlObjPtr *  retArgs = 0 
)
virtual
virtual bool DtVrfObjectPlanAdministrator::readPlanFile ( const std::string &  buffer,
DtlObjPtr *  retArgs = 0 
)
virtual
virtual bool DtVrfObjectPlanAdministrator::readPlanFile ( DtlObjPtr &  args)
virtual
virtual void DtVrfObjectPlanAdministrator::writePlanFile ( const DtString filename) const
virtual

Saves the plans of each entity into the plan file.

virtual void DtVrfObjectPlanAdministrator::writePlanFile ( std::string &  planFile) const
virtual
virtual void DtVrfObjectPlanAdministrator::enablePlanExecutionState ( )
virtual

Set the plan execution state for all objects. Plans will not start or advance through statements unless execution state is enabled.

virtual void DtVrfObjectPlanAdministrator::disablePlanExecutionState ( )
virtual

Set the plan execution state for all objects. Plans will not start or advance through statements unless execution state is enabled.

virtual void DtVrfObjectPlanAdministrator::ignoreThisUUIDOnPlanRead ( const DtUUID )
virtual

Adds a UUID to ignore on the next read of the plan file. If this is called after a read, unless cleared, will be used on the next read. When the read is done the UUIDs will be cleared.

virtual void DtVrfObjectPlanAdministrator::clearIgnoreUUIDsOnPleanRead ( )
virtual
const std::set<DtUUID>& DtVrfObjectPlanAdministrator::ignoreUUIDsOnPlanRead ( ) const
inline
virtual bool DtVrfObjectPlanAdministrator::planExecutionEnabled ( ) const
virtual
Returns
myExecuting
static void DtVrfObjectPlanAdministrator::setPlanCallback ( DtSimMessage msg,
void *  usr 
)
static

Calls processSetPlan upon receipt of a DtIfPlan message.

virtual void DtVrfObjectPlanAdministrator::processSetPlan ( DtSimMessage msg)
virtual

Forwards the DtIfPlan message to the proper DtVrfObjectPlanManager.

static void DtVrfObjectPlanAdministrator::setMultiplePlanCallback ( DtSimMessage msg,
void *  usr 
)
static

Calls processSetMultiplePlan upon receipt of a DtIfMultiplePlanSet message.

virtual void DtVrfObjectPlanAdministrator::processSetMultiplePlan ( DtSimMessage msg)
virtual

Forwards the DtIfMultiplePlanSet message to the proper DtVrfObjectPlanManager.

static void DtVrfObjectPlanAdministrator::requestPlanCallback ( DtSimMessage msg,
void *  usr 
)
static

Calls processRequestPlan upon receipt of a DtIfRequestPlan message.

virtual void DtVrfObjectPlanAdministrator::processRequestPlan ( DtSimMessage msg)
virtual

Forwards the DtIfRequestPlan message to the proper DtVrfObjectPlanManager.

static void DtVrfObjectPlanAdministrator::requestMultiPlanCallback ( DtSimMessage msg,
void *  usr 
)
static

Calls processRequestMultiPlan upon receipt of a DtIfMultiplePlanRequest message.

virtual void DtVrfObjectPlanAdministrator::processRequestMultiPlan ( DtSimMessage msg)
virtual

Handles the request by seeing what entities are local then asking them for their plans. If they have them, and they are all the same, sends a response with that plan, else sends that they have no plans. If they all have empty plans, the response will send an empty plan.

static void DtVrfObjectPlanAdministrator::abandonPlanCallback ( DtSimMessage msg,
void *  usr 
)
static

Calls processAbandonPlan upon receipt of a DtIfAbandonPlan message.

virtual void DtVrfObjectPlanAdministrator::processAbandonPlan ( DtSimMessage msg)
virtual

Forwards the DtIfAbandonPlan message to the proper DtVrfObjectPlanManager.

static void DtVrfObjectPlanAdministrator::restartPlanCallback ( DtSimMessage msg,
void *  usr 
)
static

Calls processRestartPlan upon receipt of a DtIfRestartPlan message.

virtual void DtVrfObjectPlanAdministrator::processRestartPlan ( DtSimMessage msg)
virtual

Forwards the DtIfRestartPlan message to the proper DtVrfObjectPlanManager.

virtual void DtVrfObjectPlanAdministrator::clearObjectManager ( )
virtual
virtual bool DtVrfObjectPlanAdministrator::processPlanStream ( DtlInputStream *  ,
DtlObjPtr *  retArgs = 0 
)
protectedvirtual
DtVrfObjectPlanAdministrator& DtVrfObjectPlanAdministrator::operator= ( const DtVrfObjectPlanAdministrator orig)
protected

assignment operator; not implemented

Member Data Documentation

DtLocalObjectManager* DtVrfObjectPlanAdministrator::myObjectManager
protected
CachedPlanMap DtVrfObjectPlanAdministrator::myCachedPlans
protected

Plan scripts for non-VRF entities Used during scenario load. If a plan exists, but the intended entity does not, cache the text of the plan. Used for attaching components to remotely simulated non-VRF entities. Indexed by VRF object name.

bool DtVrfObjectPlanAdministrator::myExecuting
protected
PlanFileVersion DtVrfObjectPlanAdministrator::planFileCurrentVersion
staticprotected

The current plan file version.

std::set<DtUUID> DtVrfObjectPlanAdministrator::myIgnoreUUIDsOnPlanRead
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)