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

Abstract base class for all simCommand executors. Every DtSimCommand should have a corresponding DtSimCommandExecutor subclass that implements the execution of that command.

Examples
Inheritance diagram for DtSimCommandExecutor:
Inheritance graph
[legend]

Public Member Functions

 DtSimCommandExecutor (DtSimulationServices *simManager)
 
virtual ~DtSimCommandExecutor ()
 
virtual bool executeAndDistribute (const DtSimCommand *command, DtSimCommandContextPtr &context, const DtPlan *plan=0)
 
virtual bool executeAndDistribute (const DtSimCommand *command, DtSimCommandContextPtr &context, const DtUUID &objectName, const DtPlan *plan=0)
 
virtual bool isSimCommandComplete (const DtSimCommand *command, const DtSimCommandContextPtr &context, const DtPlan *=0) const
 
virtual void distribute (const DtSimCommand *command, const DtPlan *plan=0)
 
virtual void distribute (const DtSimCommand *command, const DtUUID &objectName, const DtPlan *plan=0)
 

Static Public Member Functions

static void setFactory (DtSimCommandExecutorFactory *factory)
 
static DtSimCommandExecutorcreateSimCommandExecutor (const DtSimCommandMessageType &type, DtSimulationServices *simManager)
 

Protected Member Functions

virtual bool execute (const DtSimCommand *command, DtSimCommandContextPtr &context, const DtPlan *plan=0)=0
 
virtual bool execute (const DtSimCommand *command, DtSimCommandContextPtr &context, const DtUUID &objectName, const DtPlan *plan=0)
 

Protected Attributes

DtSimulationServicesmySimulationServices
 

Static Protected Attributes

static
DtSimCommandExecutorFactory
myFactory
 

Private Member Functions

 DtSimCommandExecutor ()
 
 DtSimCommandExecutor (const DtSimCommandExecutor &orig)
 
DtSimCommandExecutoroperator= (const DtSimCommandExecutor &orig)
 

Constructor & Destructor Documentation

DtSimCommandExecutor::DtSimCommandExecutor ( DtSimulationServices simManager)
virtual DtSimCommandExecutor::~DtSimCommandExecutor ( )
virtual
DtSimCommandExecutor::DtSimCommandExecutor ( )
private

Not implemented.

DtSimCommandExecutor::DtSimCommandExecutor ( const DtSimCommandExecutor orig)
private

Not implemented.

Member Function Documentation

virtual bool DtSimCommandExecutor::executeAndDistribute ( const DtSimCommand command,
DtSimCommandContextPtr context,
const DtPlan plan = 0 
)
virtual

Executes and then distributes the sim command by calling the execute and distribute functions in turn.

Returns
True if the execute command was successful.
virtual bool DtSimCommandExecutor::executeAndDistribute ( const DtSimCommand command,
DtSimCommandContextPtr context,
const DtUUID objectName,
const DtPlan plan = 0 
)
virtual

Executes and then distributes the sim command in the context of a specific entity by calling the execute and distribute functions in turn.

Returns
True if the execute command was successful.
virtual bool DtSimCommandExecutor::isSimCommandComplete ( const DtSimCommand command,
const DtSimCommandContextPtr context,
const DtPlan = 0 
) const
virtual

Will, by default, return true to indicate the sim command is complete. Override and provide context if you wish to delay the completion of the sim command. An example of this is when an entity wants to be created but the terrain is not paged in yet.

Reimplemented in DtCreateObjectCommandExecutor.

virtual void DtSimCommandExecutor::distribute ( const DtSimCommand command,
const DtPlan plan = 0 
)
virtual

Calls on the sim command distributor to distribute the command to registered callback functions.

virtual void DtSimCommandExecutor::distribute ( const DtSimCommand command,
const DtUUID objectName,
const DtPlan plan = 0 
)
virtual

Calls on the sim command distributor to distribute the command to registered callback functions, providing the context of a specific entity. The default implementation of this is to call distribute(command), and simply throw out the objectName. This method should be reimplemented by deriving classes if the command is executed differently when in in the context of an object. The default sim command distributor does not support specific entity contexts.

static void DtSimCommandExecutor::setFactory ( DtSimCommandExecutorFactory factory)
static

Sets the static factory member.

static DtSimCommandExecutor* DtSimCommandExecutor::createSimCommandExecutor ( const DtSimCommandMessageType type,
DtSimulationServices simManager 
)
static

Uses the static factory member to create a new executor of the specified type.

virtual bool DtSimCommandExecutor::execute ( const DtSimCommand command,
DtSimCommandContextPtr context,
const DtPlan plan = 0 
)
protectedpure virtual

Perform the actual execution of the DtSimCommand. Pure virtual function; must be overloaded by derived classes. This method executes the command in the global context. If the command should be executed differently when in the context of a specific entity (i.e. in that entity's plan), see execute() which takes an object name.

Returns
True if command was successfully carried out, false otherwise.

Implemented in DtSimCommandDistributionExecutor, DtCreateObjectCommandExecutor, DtDeleteObjectCommandExecutor, DtAbandonPlanCommandExecutor, DtLaunchGlobalPlanCommandExecutor, DtNoopCommandExecutor, DtRestartPlanCommandExecutor, DtChangeHostilityCommandExecutor, DtChangeTimeOfDayCommandExecutor, DtIssuePlanCommandExecutor, MySimCommandExecutor, DtFinishTestCommandExecutor, DtScenarioEventCommandExecutor, DtSendTextMessageCommandExecutor, DtChangeCloudLayerCommandExecutor, DtChangeWeatherCommandExecutor, DtSetDataCommandExecutor, DtStealthCommandExecutor, DtTaskCommandExecutor, DtConsoleMessageCommandExecutor, and DtCreateSensorFieldOfViewCommandExecutor.

virtual bool DtSimCommandExecutor::execute ( const DtSimCommand command,
DtSimCommandContextPtr context,
const DtUUID objectName,
const DtPlan plan = 0 
)
protectedvirtual

Performs the actual executor of the DtSimCommand in the context of a specific entity. The default implementation of this is to call execute(command), and simply throw out the objectName. This method should be reimplemented by deriving classes if the command is executed differently when in in the context of an object.

Reimplemented in DtDeleteObjectCommandExecutor, MySimCommandExecutor, DtSetDataCommandExecutor, DtTaskCommandExecutor, DtFinishTestCommandExecutor, DtLaunchGlobalPlanCommandExecutor, DtConsoleMessageCommandExecutor, DtStealthCommandExecutor, DtCreateSensorFieldOfViewCommandExecutor, and DtSendTextMessageCommandExecutor.

DtSimCommandExecutor& DtSimCommandExecutor::operator= ( const DtSimCommandExecutor orig)
private

Not implemented.

Member Data Documentation

DtSimulationServices* DtSimCommandExecutor::mySimulationServices
protected
DtSimCommandExecutorFactory* DtSimCommandExecutor::myFactory
staticprotected

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

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)