![]() |
VR-Forces Developer's Guide
|
DtSimCommand is an abstract base class from which commands can derive. It manages the read/write capability; derived classes need only use and register read/writable data types for derived information.

Public Types | |
| typedef DtSimCommandMessageType | FactoryKeyType |
Public Types inherited from DtReaderWriter | |
| typedef std::vector < DtSymbolString > | aliasContainer |
| typedef std::vector < DtSymbolString >::iterator | aliasIter |
| typedef std::vector < DtSymbolString > ::const_iterator | aliasConstIter |
| typedef std::vector< DtFilename > | SearchPaths |
| typedef std::pair < DtSymbolString, DtString > | DtVariableNameType |
| typedef DtReaderWriterFactory *(* | DtReaderWriterFactoryCreatorFcn )() |
Public Member Functions | |
| virtual | ~DtSimCommand () |
| virtual bool | init () |
| virtual const DtSimCommandMessageType & | type () const =0 |
| virtual DtSimCommand * | clone (const DtString &name, DtReaderWriterRegistry *parentRegistry=0) const =0 |
| virtual DtSimCommand * | clone () const |
| virtual DtString | stringRep () const =0 |
| virtual void | putData (std::string &fp, int indentLevel=0) |
| virtual DtlObjPtr | getData (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings) |
| virtual char * | netRep () |
| virtual int | netRepSize () const |
| virtual bool | setFromNet (const char *contentBuffer, unsigned contentSize) |
| virtual bool | setToNet () |
| virtual void | setLocalDelivery (bool) |
| virtual bool | localDelivery () const |
Public Member Functions inherited from DtReaderWriter | |
| DtReaderWriter () | |
| DtReaderWriter (const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false) | |
| DtReaderWriter (const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false) | |
| DtReaderWriter (const DtString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL) | |
| DtReaderWriter (const DtSymbolString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL) | |
| DtReaderWriter (const DtReaderWriter &, DtReaderWriterRegistry *parentRegistry=NULL) | |
| const DtReaderWriter & | operator= (const DtReaderWriter &orig) |
| bool | operator== (const DtReaderWriter &) const |
| bool | operator!= (const DtReaderWriter &rhs) const |
| virtual | ~DtReaderWriter () |
| virtual void | putSelf (std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename()) |
| virtual void | postPutSelf () |
| virtual void | prePutSelf () |
| virtual void | getSelf (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference()) |
| virtual void | postGetSelf () |
| virtual void | preGetSelf () |
| virtual void | writeSelf (std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename()) |
| virtual DtSymbolString | name () const |
| virtual void | addAlias (const DtSymbolString &alias) |
| virtual void | addAlias (const DtString &alias) |
| virtual bool | hasAlias (const DtSymbolString &alias) |
| virtual const aliasContainer & | aliases () const |
| virtual void | setReadonly (bool flag) |
| bool | isReadonly () const |
| virtual void | reset () |
| virtual int | alignment () const |
| virtual bool | variableIsBound () const |
| virtual void | unbindVariable () |
| virtual void | setName (const DtString &) |
| virtual const char * | readerWriterType () const |
| virtual const char * | xmlType () const |
| virtual DtString | prettyPrint () const |
| std::string | debugText () const |
| virtual void | bindVariables (DtVariableBindingsList variableBindings) |
| virtual std::list < DtVariableNameType > | unboundVariables () const |
| bool | invalid () const |
| virtual bool | hasChild (const DtReaderWriter *p) const |
| virtual bool | hasVariableReference () const |
| virtual void | bindLocalVariables (const DtVariableBindingsList &variableBindings) |
| virtual void | recordUpdateTime () const |
| virtual bool | changedSinceLastChecked () |
| virtual bool | peekChangedSinceLastChecked () const |
| virtual void | setValueSpecified (bool specified, bool recurse=false) |
| virtual bool | valueSpecified () const |
| virtual bool | isVariableReference () const |
| virtual void | setIsVariableReference (bool value) |
| virtual void | clearAllVariableReferenceFlags () |
| virtual DtSymbolString | variableName () const |
| virtual void | setVariableName (const DtSymbolString variableName) |
| virtual const DtReaderWriter * | defaultRWValue () const |
| virtual DtReaderWriter * | defaultRWValue () |
| virtual void | setDefaultRWValue (DtReaderWriter *) |
| virtual bool | checkAndSetDefaultRWValue (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference()) |
| const DtReaderWriterRegistry & | registry () const |
| DtReaderWriterRegistry & | registry () |
| virtual DtPropertyInterface * | property () |
| virtual const DtPropertyInterface * | property () const |
| virtual DtString | toXml () const |
| virtual DtRwVariableBindings * | generateVariableBindings () const |
| virtual bool | toXml (const DtFilename &) const |
| virtual bool | fromXml (const DtString &) |
| virtual bool | fromXmlFile (const DtFilename &) |
| virtual void | putSelf (DtEnvironmentSP, DtEnvValueSP parent) const |
| virtual void | putData (DtEnvironmentSP, DtEnvValueSP value) const |
| virtual void | putVariableReference (DtEnvironmentSP, DtEnvValueSP value) const |
| virtual void | getSelf (const DtEnvironmentSP, const DtEnvValueSP root, const SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &bindings=DtVariableBindingsList()) |
| virtual void | getData (const DtEnvironmentSP, const DtEnvValueSP, const SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &bindings=DtVariableBindingsList()) |
| virtual void | unrecognizedItem (const DtEnvironmentSP env, const DtEnvValueSP root, const SearchPaths &searchPaths, const DtVariableBindingsList &varBindings) |
| virtual void | getVariableReference (DtEnvironmentSP, DtEnvValueSP value) |
Protected Member Functions | |
| DtSimCommand () | |
| DtSimCommand (const DtString &writeName, DtReaderWriterRegistry *parentRegistry=0) | |
| DtSimCommand (const DtString &writeName, const DtSimCommand &orig, DtReaderWriterRegistry *parentRegistry=0) | |
| const DtSimCommand & | operator= (const DtSimCommand &orig) |
| virtual char * | createNetworkBuffer () |
| virtual bool | isTypeRegistered (const DtSimCommandMessageType &commandType) |
Protected Member Functions inherited from DtReaderWriter | |
| virtual void | bindToRwAsVariable (const DtReaderWriter *rw) |
Protected Attributes | |
| char * | myNetRep |
| bool | myLocalDelivery |
Protected Attributes inherited from DtReaderWriter | |
| const DtSymbolString | myName |
| DtReaderWriterRegistry | myRegistry |
| DtReaderWriterRegistry * | myParentRegistry |
| bool | myValueSpecified |
| bool | myReadOnlyFlag |
| bool | myIsVariableReference |
| DtSymbolString | myVariableName |
| bool | myVariableIsBound |
| DtReaderWriter * | myDefaultValue |
| aliasContainer | myAliases |
| bool | myInvalid |
| bool | myChangedFlag |
Static Protected Attributes | |
| static DtSimCommandFactory * | myFactory |
Static Protected Attributes inherited from DtReaderWriter | |
| static DtString | theUnspecifiedValue |
| static DtGetSelfCallbackInfo | thePostGetSelfCallback |
| static DtPutSelfCallbackInfo | thePrePutSelfCallback |
| static const DtVariableBindingsList | theEmptyVariableBindingsList |
| static bool | theCreatorFcnSet |
| static DtReaderWriterFactory * | theFactory |
| static DtReaderWriterFactoryCreatorFcn | theFactoryCreatorFcn |
| static bool | thePutIndent |
| static DtOutputStream * | theOutputStream |
Common definition of the type used for factory lookups, for use with DtRwFactoryItemList.
|
protected |
Constructors are protected because no one should instantiate the base class, just derived versions.
default constructor
|
protected |
constructor If you have a command 'put' itself, the write name will preface the command.
|
protected |
copy constructor
|
virtual |
destructor
|
protected |
assignment operator; same as copy constructor
|
virtual |
Base class init does nothing, but this will be called by create, in case any other deriving class needs to do virtual allocation.
|
pure virtual |
Implemented in DtRemoveDynamicTerrainDamageCommand, DtResetAllDynamicTerrainChangesCommand, DtRemovePersistentTracksCommand, DtResetDynamicTerrainChangesCommand, DtAddPersistentTracksCommand, DtAddDynamicTerrainChangesCommand, DtSwitchDynamicTerrainAtPointCommand, DtCreateObjectCommand, DtScenarioEventCommand, DtStealthCommandCommand, DtAbandonPlanCommand, DtChangeWeatherCommand, DtRestartPlanCommand, DtCreateSensorFieldOfViewCommand, DtFinishTestCommand, DtIssuePlanCommand, DtConsoleMessageCommand, DtChangeGlobalWeatherCommand, DtSetDataCommand, DtTaskCommand, DtChangeHostilityCommand, DtDeleteObjectCommand, DtLaunchGlobalPlanCommand, MySimCommand, DtChangeTimeOfDayCommand, DtChangeAirportLightingCommand, DtSendTextMessageCommand, and DtNoopCommand.
|
pure virtual |
Make a copy of this sim command. Returns a newly allocated instance of a DtSimCommand. Override this member function to return a pointer to a newly allocated instance of the derived class.
Implemented in DtRemoveDynamicTerrainDamageCommand, DtResetAllDynamicTerrainChangesCommand, DtRemovePersistentTracksCommand, DtResetDynamicTerrainChangesCommand, DtAddPersistentTracksCommand, DtAddDynamicTerrainChangesCommand, DtSwitchDynamicTerrainAtPointCommand, DtCreateObjectCommand, DtScenarioEventCommand, DtStealthCommandCommand, DtAbandonPlanCommand, DtChangeWeatherCommand, DtRestartPlanCommand, DtCreateSensorFieldOfViewCommand, DtFinishTestCommand, DtIssuePlanCommand, DtConsoleMessageCommand, DtChangeGlobalWeatherCommand, DtSetDataCommand, DtTaskCommand, DtChangeHostilityCommand, DtDeleteObjectCommand, DtLaunchGlobalPlanCommand, MySimCommand, DtChangeTimeOfDayCommand, DtSendTextMessageCommand, DtNoopCommand, and DtChangeAirportLightingCommand.
|
virtual |
Version of clone that preserves the existing name, and assigns a null parent registry.
|
pure virtual |
Returns a human-readable string representation of the command. This string representation is used to display information about the command in the plan editor and viewer. The type and parameters for the command are typically encoded in the string. The format of the string is up to you.
Implemented in DtChangeWeatherCommand, DtRemovePersistentTracksCommand, DtCreateObjectCommand, DtAddPersistentTracksCommand, DtSwitchDynamicTerrainAtPointCommand, DtChangeTimeOfDayCommand, DtDynamicTerrainCommand, DtScenarioEventCommand, DtIssuePlanCommand, DtChangeAirportLightingCommand, DtAbandonPlanCommand, DtChangeHostilityCommand, DtRestartPlanCommand, DtConsoleMessageCommand, DtFinishTestCommand, DtDeleteObjectCommand, DtSetDataCommand, DtTaskCommand, DtSendTextMessageCommand, DtLaunchGlobalPlanCommand, MySimCommand, DtStealthCommandCommand, DtNoopCommand, DtCreateSensorFieldOfViewCommand, and DtPersistentTracksCommand.
|
virtual |
putData writes our type, which is provided by the virtual type accessor of the deriving class.
Reimplemented from DtReaderWriter.
Reimplemented in DtSetDataCommand, and DtTaskCommand.
|
virtual |
getData is just used to get us past the type in the data stream, since it's not actually stored.
Reimplemented from DtReaderWriter.
Reimplemented in DtSetDataCommand, and DtTaskCommand.
|
virtual |
|
virtual |
Returns the size in bytes of the network representation of the class. This is the size in bytes of the DtNetSimSimCommand structure. Derived classes should take into acount the size returned by this class when overriding (they should call down to this class and add the result to their additional size).
Reimplemented in DtCreateObjectCommand, DtAddPersistentTracksCommand, DtSwitchDynamicTerrainAtPointCommand, DtDynamicTerrainCommand, DtChangeAirportLightingCommand, DtScenarioEventCommand, DtChangeHostilityCommand, DtConsoleMessageCommand, DtFinishTestCommand, DtDeleteObjectCommand, DtIssuePlanCommand, DtSetDataCommand, DtTaskCommand, DtAbandonPlanCommand, DtRestartPlanCommand, DtSendTextMessageCommand, DtStealthCommandCommand, DtLaunchGlobalPlanCommand, MySimCommand, DtChangeWeatherCommand, DtCreateSensorFieldOfViewCommand, DtChangeTimeOfDayCommand, DtNoopCommand, and DtPersistentTracksCommand.
Sets mySubsimCommand member from the incoming contentBuffer (cast to type DtNetSimSimCommand). Derived classes should call down to this function first, and then extract their own data starting at the location contentBuffer + DtSimCommand::netRepSize().
Reimplemented in DtCreateObjectCommand, DtAddPersistentTracksCommand, DtSwitchDynamicTerrainAtPointCommand, DtDynamicTerrainCommand, DtChangeAirportLightingCommand, DtChangeHostilityCommand, DtConsoleMessageCommand, DtFinishTestCommand, DtScenarioEventCommand, DtDeleteObjectCommand, DtSetDataCommand, DtTaskCommand, DtIssuePlanCommand, DtSendTextMessageCommand, DtAbandonPlanCommand, DtRestartPlanCommand, DtLaunchGlobalPlanCommand, MySimCommand, DtStealthCommandCommand, DtChangeWeatherCommand, DtCreateSensorFieldOfViewCommand, DtNoopCommand, DtChangeTimeOfDayCommand, and DtPersistentTracksCommand.
|
virtual |
Calls netRep() to create the network buffer. Casts the resulting myNetRep to type DtNetSimSimCommand*, and then sets the mySubsimCommand member in the DtNetSimSimCommand from mySubsimCommand. Derived classes should call down to the base class version of setToNet() at the start of the function (before doing any processing on the network representation) They can then start to fill in their network data, starting at the location myNetRep + DtSimCommand::netRepSize().
Reimplemented in DtCreateObjectCommand, DtAddPersistentTracksCommand, DtSwitchDynamicTerrainAtPointCommand, DtDynamicTerrainCommand, DtChangeAirportLightingCommand, DtChangeHostilityCommand, DtConsoleMessageCommand, DtFinishTestCommand, DtScenarioEventCommand, DtDeleteObjectCommand, DtSetDataCommand, DtTaskCommand, DtSendTextMessageCommand, DtIssuePlanCommand, DtAbandonPlanCommand, DtLaunchGlobalPlanCommand, MySimCommand, DtRestartPlanCommand, DtStealthCommandCommand, DtChangeWeatherCommand, DtCreateSensorFieldOfViewCommand, DtNoopCommand, DtChangeTimeOfDayCommand, and DtPersistentTracksCommand.
|
virtual |
If you know this command can be delivered and processed locally, then set this flag to true and it will not be sent over the network. Default is false.
|
virtual |
|
static |
Static functions.
Creates a new simCommand, given a pointer to a MAK Technologies LISP (MTL) stream. It first parses the stream to extract the type of simCommand to create. Then it calls the simCommand factory's create() member function with the given simCommand type. This returns a new instance of the particular simCommand type. The simCommand's getData() member function is then called to retrieve the simCommand parameters from the stream. The pointer to the new simCommand is returned.
|
static |
|
inlinestatic |
Common definition of the factory method, for use with DtRwFactoryItemList.
|
static |
Adds a simCommand creator member function to the simCommand factory.
|
static |
|
static |
|
protectedvirtual |
|
protectedvirtual |
|
protected |
|
staticprotected |
|
protected |