![]() |
VR-Forces Developer's Guide
|
DtSimResource is a class which will define a SISO Enumeration to use as a resource and the quantity of that resource that it represents.

Classes | |
| class | RwMunitionOrEntityType |
Public Types | |
| typedef void(* | UpdateCallback )(DtSimResource *, void *) |
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 | |
| DtSimResource () | |
| DtSimResource (const DtString &resourceName, DtReaderWriterRegistry *parentRegistry=NULL) | |
| DtSimResource (const DtSymbolString &resourceName, DtReaderWriterRegistry *parentRegistry=NULL) | |
| DtSimResource (const DtSimResource &orig) | |
| DtSimResource & | operator= (const DtSimResource &orig) |
| virtual | ~DtSimResource () override |
| virtual const char * | readerWriterType () const override |
| virtual const char * | xmlType () const override |
| bool | operator!= (const DtSimResource &orig) const |
| bool | operator== (const DtSimResource &orig) const |
| virtual void | deplete (double d=1) |
| virtual bool | matches (const std::vector< DtEntityType > &) const |
| virtual void | setResourceType (const DtEntityType &) |
| const DtEntityType & | resourceType () const |
| virtual void | setCurrentAmount (double amount) |
| void | setAmount (double a) |
| double | currentAmount () const |
| double | amount () const |
| virtual void | setValueIsInteger (bool) |
| bool | valueIsInteger () const |
| virtual void | setFullAmount (double amount) |
| double | fullAmount () const |
| virtual void | setRestore (bool) |
| bool | shouldRestore () const |
| virtual void | restore () |
| virtual int | netRepSize () const |
| virtual const char * | setFromNet (const char *contentBuffer) |
| virtual void | addUpdateCallback (UpdateCallback fcn, void *usrData) |
| virtual void | removeUpdateCallback (UpdateCallback fcn, void *usrData) |
| virtual void | callUpdateCallbacks () |
| virtual char * | setToNet (char *contentBuffer) const |
| virtual double | percentageFull () const |
| const DtRwReal & | currentAmountVariable () const |
| DtRwReal & | currentAmountVariable () |
| const DtRwReal & | fullAmountVariable () const |
| DtRwReal & | fullAmountVariable () |
| const DtRwBoolean & | restoreVariable () const |
| DtRwBoolean & | restoreVariable () |
| const DtRwInt & | binVariable () const |
| DtRwInt & | binVariable () |
| int | bin () const |
| virtual void | setBin (int) |
| virtual void | clearFullAmount () |
| virtual void | getSelf (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings) override |
| virtual DtString | prettyPrint () const override |
| virtual void | setDisplayName (const DtString &) |
| const DtString & | displayName () 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 | 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 &) |
| 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 | putData (std::string &fp, int indentLevel=0) |
| virtual DtlObjPtr | getData (DtlObjPtr args, const SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings) |
| 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) |
Static Public Member Functions | |
| static const char * | theXmlType () |
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 char * | theXmlType () |
| static const DtFilename & | appPath () |
| static void | setFactoryCreatorFunction (DtReaderWriterFactoryCreatorFcn fcn) |
| static void | createReaderWriterFactory () |
| static void | cleanupFactory () |
| static DtReaderWriterFactory * | factory () |
| static void | setOutputStream (DtOutputStream *stream) |
| static DtOutputStream & | outputStream () |
| static DtReaderWriter * | createFromXmlFile (const DtFilename &, bool createAsProperty=false) |
| static DtReaderWriter * | createFromXml (const DtString &, bool createAsProperty=false) |
| static DtReaderWriter * | createFromEnvironment (DtEnvironmentSP, bool createAsProperty=false) |
| static DtString | getAttribute (DtEnvironmentSP env, const DtString &name, DtEnvValueSP root) |
Protected Member Functions | |
| virtual void | postGetSelf () override |
Protected Member Functions inherited from DtReaderWriter | |
| virtual void | bindToRwAsVariable (const DtReaderWriter *rw) |
Additional Inherited Members | |
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 |
| typedef void(* DtSimResource::UpdateCallback)(DtSimResource *, void *) |
| DtSimResource::DtSimResource | ( | ) |
default constructor
| DtSimResource::DtSimResource | ( | const DtString & | resourceName, |
| DtReaderWriterRegistry * | parentRegistry = NULL |
||
| ) |
real constructor
The resource name is the name that will be used to look up the resource in the resource manager.
| DtSimResource::DtSimResource | ( | const DtSymbolString & | resourceName, |
| DtReaderWriterRegistry * | parentRegistry = NULL |
||
| ) |
| DtSimResource::DtSimResource | ( | const DtSimResource & | orig | ) |
copy constructor
|
overridevirtual |
destructor
| DtSimResource& DtSimResource::operator= | ( | const DtSimResource & | orig | ) |
assignment operator
|
overridevirtual |
Used to supply a string type that this reader writer type is. This can be used in place of dynamic-casting. Also used by the opd editor to determine which type of control to create.
Reimplemented from DtReaderWriter.
|
static |
The type that is used when archiving to an XML stream.
|
inlineoverridevirtual |
Reimplemented from DtReaderWriter.
References DtReaderWriter::theXmlType().
|
inline |
Expects subclasses to implement isEqual method. Default returns false.
| bool DtSimResource::operator== | ( | const DtSimResource & | orig | ) | const |
|
virtual |
Removes from current amount.
|
virtual |
Returns true if this is a munition resource (based on resource type)
|
virtual |
|
inline |
|
virtual |
|
inline |
| double DtSimResource::currentAmount | ( | ) | const |
|
inline |
|
virtual |
|
inline |
|
virtual |
| double DtSimResource::fullAmount | ( | ) | const |
|
virtual |
|
inline |
|
virtual |
|
virtual |
Fills in the task from the network buffer. Content size is not used.
|
virtual |
Add a callback to be called when the value of this resource changes.
|
virtual |
Remove a callback to be called when the value of this resource changes.
|
virtual |
Calls all of the update callbacks. Must be called by subclasses when values change.
Fills in the network buffer with the task contents. Buffer must be allocated by the caller, with size netRepSize.
|
virtual |
Current amount / full amount.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
virtual |
|
virtual |
|
overridevirtual |
Top level to read itself from an input stream. searchPath is passed down to all DtReaderWriter members in its DtReaderWriterRegistry (collection of child DtReaderWriter nodes). If a given member in the registry is of type DtReaderWriterFile, and the searchPath is specified with a non-NULL string, then file to be read in is searched for in the given path.
Reimplemented from DtReaderWriter.
|
overridevirtual |
Routine to return a human readable form of the reader/writer variable. Not all reader/writer classes implement this feature. Default is to return an empty string.
Reimplemented from DtReaderWriter.
|
virtual |
This is only used locally in the GUI. It is not sent over the network nor saved anywhere. If creating this resource in code in the GUI and you want to display this name rather than a name based on the entity type, set this here. Set to the empty string to revert to using the name returned by the enumerations dictionary.
|
inline |
This is only used locally in the GUI. It is not sent over the network nor saved anywhere. If creating this resource in code in the GUI and you want to display this name rather than a name based on the entity type, set this here. Set to the empty string to revert to using the name returned by the enumerations dictionary.
|
overrideprotectedvirtual |
Called after either version of getSelf (mtl or environment). Default is no-op.
Reimplemented from DtReaderWriter.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |