VR-Forces 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
DtSimCommand Class Referenceabstract

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.

Related Examples
Inheritance diagram for DtSimCommand:
Inheritance graph
[legend]

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 DtSimCommandclone (const DtString &name, DtReaderWriterRegistry *parentRegistry=0) const =0
 
virtual DtSimCommandclone () 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 charnetRep ()
 
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 DtReaderWriteroperator= (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 aliasContaineraliases () 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 charreaderWriterType () const
 
virtual const charxmlType () 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 DtReaderWriterdefaultRWValue () const
 
virtual DtReaderWriterdefaultRWValue ()
 
virtual void setDefaultRWValue (DtReaderWriter *)
 
virtual bool checkAndSetDefaultRWValue (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference())
 
const DtReaderWriterRegistryregistry () const
 
DtReaderWriterRegistryregistry ()
 
virtual DtPropertyInterfaceproperty ()
 
virtual const DtPropertyInterfaceproperty () const
 
virtual DtString toXml () const
 
virtual DtRwVariableBindingsgenerateVariableBindings () 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)
 

Static Public Member Functions

static DtSimCommandcreateSimCommand (DtlObjPtr mtlStream)
 
static DtSimCommandcreateSimCommand (const DtSimCommandMessageType &simCommandType)
 
static DtSimCommandcreateFromFactory (const DtSimCommandMessageType &simCommandType)
 
static void addSimCommandCreatorFcn (const DtSimCommandMessageType &simCommandName, DtSimCommandCreatorFcn fcn)
 
static void setFactory (DtSimCommandFactory *factory)
 
static DtSimCommandFactoryfactory ()
 
- Static Public Member Functions inherited from DtReaderWriter
static void putIndent (std::string &fp, int indentLevel)
 
static const
DtVariableBindingsList
nullVariableReference ()
 
static void setPostGetSelfCallback (DtGetSelfCallbackFcn fcn, void *usrData)
 
static void setPrePutSelfCallback (DtPutSelfCallbackFcn fcn, void *usrData)
 
static void setPutIndent (bool)
 
static bool putIndent ()
 
static const chartheXmlType ()
 
static const DtFilename & appPath ()
 
static void setFactoryCreatorFunction (DtReaderWriterFactoryCreatorFcn fcn)
 
static void createReaderWriterFactory ()
 
static void cleanupFactory ()
 
static DtReaderWriterFactoryfactory ()
 
static void setOutputStream (DtOutputStream *stream)
 
static DtOutputStream & outputStream ()
 
static DtReaderWritercreateFromXmlFile (const DtFilename &, bool createAsProperty=false)
 
static DtReaderWritercreateFromXml (const DtString &, bool createAsProperty=false)
 
static DtReaderWritercreateFromEnvironment (DtEnvironmentSP, bool createAsProperty=false)
 
static DtString getAttribute (DtEnvironmentSP env, const DtString &name, DtEnvValueSP root)
 

Protected Member Functions

 DtSimCommand ()
 
 DtSimCommand (const DtString &writeName, DtReaderWriterRegistry *parentRegistry=0)
 
 DtSimCommand (const DtString &writeName, const DtSimCommand &orig, DtReaderWriterRegistry *parentRegistry=0)
 
const DtSimCommandoperator= (const DtSimCommand &orig)
 
virtual charcreateNetworkBuffer ()
 
virtual bool isTypeRegistered (const DtSimCommandMessageType &commandType)
 
- Protected Member Functions inherited from DtReaderWriter
virtual void bindToRwAsVariable (const DtReaderWriter *rw)
 

Protected Attributes

charmyNetRep
 
bool myLocalDelivery
 
- Protected Attributes inherited from DtReaderWriter
const DtSymbolString myName
 
DtReaderWriterRegistry myRegistry
 
DtReaderWriterRegistrymyParentRegistry
 
bool myValueSpecified
 
bool myReadOnlyFlag
 
bool myIsVariableReference
 
DtSymbolString myVariableName
 
bool myVariableIsBound
 
DtReaderWritermyDefaultValue
 
aliasContainer myAliases
 
bool myInvalid
 
bool myChangedFlag
 

Static Protected Attributes

static DtSimCommandFactorymyFactory
 
- Static Protected Attributes inherited from DtReaderWriter
static DtString theUnspecifiedValue
 
static DtGetSelfCallbackInfo thePostGetSelfCallback
 
static DtPutSelfCallbackInfo thePrePutSelfCallback
 
static const DtVariableBindingsList theEmptyVariableBindingsList
 
static bool theCreatorFcnSet
 
static DtReaderWriterFactorytheFactory
 
static
DtReaderWriterFactoryCreatorFcn 
theFactoryCreatorFcn
 
static bool thePutIndent
 
static DtOutputStream * theOutputStream
 

Member Typedef Documentation

Common definition of the type used for factory lookups, for use with DtRwFactoryItemList.

Constructor & Destructor Documentation

DtSimCommand::DtSimCommand ( )
protected

Constructors are protected because no one should instantiate the base class, just derived versions.

default constructor

DtSimCommand::DtSimCommand ( const DtString writeName,
DtReaderWriterRegistry parentRegistry = 0 
)
protected

constructor If you have a command 'put' itself, the write name will preface the command.

DtSimCommand::DtSimCommand ( const DtString writeName,
const DtSimCommand orig,
DtReaderWriterRegistry parentRegistry = 0 
)
protected

copy constructor

virtual DtSimCommand::~DtSimCommand ( )
virtual

destructor

Member Function Documentation

const DtSimCommand& DtSimCommand::operator= ( const DtSimCommand orig)
protected

assignment operator; same as copy constructor

virtual bool DtSimCommand::init ( )
virtual

Base class init does nothing, but this will be called by create, in case any other deriving class needs to do virtual allocation.

virtual const DtSimCommandMessageType& DtSimCommand::type ( ) const
pure virtual
virtual DtSimCommand* DtSimCommand::clone ( const DtString name,
DtReaderWriterRegistry parentRegistry = 0 
) const
pure virtual
virtual DtSimCommand* DtSimCommand::clone ( ) const
virtual

Version of clone that preserves the existing name, and assigns a null parent registry.

virtual DtString DtSimCommand::stringRep ( ) const
pure virtual
virtual void DtSimCommand::putData ( std::string &  fp,
int  indentLevel = 0 
)
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 DtlObjPtr DtSimCommand::getData ( DtlObjPtr  args,
const DtReaderWriter::SearchPaths searchPaths,
const DtVariableBindingsList variableBindings 
)
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 char* DtSimCommand::netRep ( )
virtual
virtual int DtSimCommand::netRepSize ( ) const
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.

virtual bool DtSimCommand::setFromNet ( const char contentBuffer,
unsigned  contentSize 
)
virtual
virtual bool DtSimCommand::setToNet ( )
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 void DtSimCommand::setLocalDelivery ( bool  )
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 bool DtSimCommand::localDelivery ( ) const
virtual
static DtSimCommand* DtSimCommand::createSimCommand ( DtlObjPtr  mtlStream)
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 DtSimCommand* DtSimCommand::createSimCommand ( const DtSimCommandMessageType simCommandType)
static
static DtSimCommand* DtSimCommand::createFromFactory ( const DtSimCommandMessageType simCommandType)
inlinestatic

Common definition of the factory method, for use with DtRwFactoryItemList.

static void DtSimCommand::addSimCommandCreatorFcn ( const DtSimCommandMessageType simCommandName,
DtSimCommandCreatorFcn  fcn 
)
static

Adds a simCommand creator member function to the simCommand factory.

static void DtSimCommand::setFactory ( DtSimCommandFactory factory)
static
static DtSimCommandFactory* DtSimCommand::factory ( )
static
virtual char* DtSimCommand::createNetworkBuffer ( )
protectedvirtual
virtual bool DtSimCommand::isTypeRegistered ( const DtSimCommandMessageType commandType)
protectedvirtual

Member Data Documentation

char* DtSimCommand::myNetRep
protected
DtSimCommandFactory* DtSimCommand::myFactory
staticprotected
bool DtSimCommand::myLocalDelivery
protected

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

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)