VR-Forces 4.1.1 Class Documentation
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Friends
DtScriptedTaskMetaData Class Reference

A class for keeping track of meta data for scripted tasks. More...

Public Member Functions

 DtScriptedTaskMetaData ()
 default constructor
virtual ~DtScriptedTaskMetaData ()
 destructor
 DtScriptedTaskMetaData (const DtScriptedTaskMetaData &orig)
 copy constructor
DtScriptedTaskMetaDataoperator= (const DtScriptedTaskMetaData &orig)
 assignment operator
virtual bool load (const DtFilename &)
 Load data from specified file.
virtual bool load (const std::string &)
 Loads the object from the given xml string buffer.
virtual bool load (std::istream &)
 Loads the object from the given stream.
virtual bool save (const DtFilename &) const
 Save file to given location.
virtual bool save (std::string &) const
 Saves the value to the given string buffer.
virtual bool save (std::ostream &) const
 Saves the object to the given stream.
virtual bool save () const
 Saves to the last loaded filename. If not loaded will not save.
virtual const DtFilename & filename () const
 File where this was loaded from.
virtual const std::string & scriptId () const
 Accessor for script id.
virtual void setScriptId (const std::string &)
 Sets the script id. Use with care as this could effect related referencing items.
virtual void assignNewScriptId ()
 Assigns a new unique id to this meta data.
virtual bool supports (const DtEntityType &) const
 Returns true if this script supports the specific entity type.
bool operator== (const DtScriptedTaskMetaData &) const
 Equality operators.
bool operator!= (const DtScriptedTaskMetaData &rhs) const
virtual bool encrypt (const std::string &source, std::string &dest) const
 Return true if buffer was encrypted.
virtual bool encryptScript ()
 If there is an encryption routine, encrypt the script back into the myScript member.
virtual bool encryptSize (const std::string &source, int &size) const
 Return the size of the encrypted buffer'.
virtual bool decrypt (const std::string &source, std::string &dest) const
 Returns true if buffer successfully decrypted.
virtual bool decryptScript ()
 If the script is encrypted, decrypt into myScript.
virtual void setMenuText (const std::string &)
virtual const std::string & menuText () const
virtual void setToolTip (const std::string &)
virtual const std::string & toolTip () const
virtual void setMenuIcon (const std::string &)
virtual const std::string & menuIcon () const
virtual void setVersion (double)
virtual double version () const
virtual void setScriptEngine (const std::string &)
virtual const std::string & scriptEngine () const
virtual void setComments (const std::string &)
virtual const std::string & comments () const
virtual void setDescription (const std::string &)
virtual const std::string & description () const
virtual void setScriptLocation (const std::string &)
virtual const std::string & scriptLocation () const
virtual void setMenuLocations (const std::vector< std::string > &)
virtual void addMenuLocation (const std::string &)
virtual void removeMenuLocation (const std::string &)
virtual void removeMenuLocation (int)
virtual const std::vector
< std::string > & 
menuLocations () const
virtual void setShowInMenu (bool)
virtual bool showInMenu () const
virtual void setEntityTypes (const std::vector< DtEntityType > &)
virtual void addEntityType (const DtEntityType &)
virtual void removeEntityType (const DtEntityType &)
virtual void removeEntityType (int)
virtual std::vector< DtEntityType > entityTypes () const
virtual void setVariables (const std::vector< DtScriptedTaskVariable > &)
virtual void addVariable (const DtScriptedTaskVariable &)
virtual void insertVariableBefore (const DtScriptedTaskVariable &, const std::string &variable)
virtual void insertVariableBefore (const DtScriptedTaskVariable &, int i)
virtual void removeVariable (const std::string &)
virtual void removeVariable (int)
virtual std::vector
< DtScriptedTaskVariable
variables () const
virtual void setScript (const std::string &)
virtual const std::string & script () const
virtual bool loadScript ()
 Loads the script from the location of this meta data file or from the file defined in scriptLocation.
virtual bool loadScript (const std::string &)
 Loads the script from the specified file and replaces the existing script with it.
virtual void setIsSystemScript (bool)
virtual bool isSystemScript () const
virtual void setActionCategories (const std::set< std::string > &)
virtual void addActionCategory (const std::string &)
virtual void removeActionCategory (const std::string &)
virtual bool hasActionCategory (const std::string &) const
virtual const std::set
< std::string > & 
actionCategories () const
virtual void setDirectoryPath (const std::string &)
virtual const std::string & directoryPath () const
virtual void setEncrypted (bool)
virtual bool encrypted () const

Static Public Member Functions

static void setEncryptDecryptFunction (DtEncryptDecryptFcn, void *usr)
 Sets encrypt/decrypt function.
static void getEncryptDecryptFunction (DtEncryptDecryptFcn &, void *&usr)

Public Attributes

std::string myScriptId
std::string myMenuText
std::string myToolTip
std::string myMenuIcon
std::string myScriptEngine
std::string myComments
std::string myDescription
std::string myScriptLocation
std::string myScript
std::string myDirectoryPath
std::vector< std::string > myMenuLocations
std::vector< std::string > myEntityTypes
std::vector< std::string > myVariables
std::string myActionCategories
bool myShowInMenu
std::set< std::string > myActionCategoriesSet
double myVersion
DtFilename myFile
bool myIsSystemScript
bool myEncrypted

Static Public Attributes

static DtEncryptDecryptFcn theEncryptDecryptFunction
static void * theEncryptDecryptUserData

Protected Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 When the class Archive corresponds to an output archive, the & operator is defined similar to <<.

Friends

class boost::serialization::access
 Serialization/Deserialization //.

Detailed Description

A class for keeping track of meta data for scripted tasks.

The information is currently stored in an XML format

Constructor & Destructor Documentation

DtScriptedTaskMetaData::DtScriptedTaskMetaData ( )

default constructor

virtual DtScriptedTaskMetaData::~DtScriptedTaskMetaData ( )
virtual

destructor

DtScriptedTaskMetaData::DtScriptedTaskMetaData ( const DtScriptedTaskMetaData orig)

copy constructor

Member Function Documentation

DtScriptedTaskMetaData& DtScriptedTaskMetaData::operator= ( const DtScriptedTaskMetaData orig)

assignment operator

virtual bool DtScriptedTaskMetaData::load ( const DtFilename &  )
virtual

Load data from specified file.

virtual bool DtScriptedTaskMetaData::load ( const std::string &  )
virtual

Loads the object from the given xml string buffer.

virtual bool DtScriptedTaskMetaData::load ( std::istream &  )
virtual

Loads the object from the given stream.

virtual bool DtScriptedTaskMetaData::save ( const DtFilename &  ) const
virtual

Save file to given location.

If no previously loaded filename will set filename to the supplied name

virtual bool DtScriptedTaskMetaData::save ( std::string &  ) const
virtual

Saves the value to the given string buffer.

virtual bool DtScriptedTaskMetaData::save ( std::ostream &  ) const
virtual

Saves the object to the given stream.

virtual bool DtScriptedTaskMetaData::save ( ) const
virtual

Saves to the last loaded filename. If not loaded will not save.

virtual const DtFilename& DtScriptedTaskMetaData::filename ( ) const
virtual

File where this was loaded from.

If saved to a different file will not change the location

virtual const std::string& DtScriptedTaskMetaData::scriptId ( ) const
virtual

Accessor for script id.

Set as part of the constructor and assigned in the copy/equivalence operator

virtual void DtScriptedTaskMetaData::setScriptId ( const std::string &  )
virtual

Sets the script id. Use with care as this could effect related referencing items.

virtual void DtScriptedTaskMetaData::setMenuText ( const std::string &  )
virtual

Accessor for menu text. This is the name that will appear on menus

virtual const std::string& DtScriptedTaskMetaData::menuText ( ) const
virtual

Accessor for menu text. This is the name that will appear on menus

virtual void DtScriptedTaskMetaData::setToolTip ( const std::string &  )
virtual

Accessors for menu tool-tip

virtual const std::string& DtScriptedTaskMetaData::toolTip ( ) const
virtual

Accessors for menu tool-tip

virtual void DtScriptedTaskMetaData::setMenuIcon ( const std::string &  )
virtual

Accessors for menu icon

virtual const std::string& DtScriptedTaskMetaData::menuIcon ( ) const
virtual

Accessors for menu icon

virtual void DtScriptedTaskMetaData::setVersion ( double  )
virtual

Accessors for version. When the task is sent to the back-end for processing, the version will be packaged as part of the variables available for the task

virtual double DtScriptedTaskMetaData::version ( ) const
virtual

Accessors for version. When the task is sent to the back-end for processing, the version will be packaged as part of the variables available for the task

virtual void DtScriptedTaskMetaData::setScriptEngine ( const std::string &  )
virtual

Accessor for script engine to use when evaluating script. Default is LUA

virtual const std::string& DtScriptedTaskMetaData::scriptEngine ( ) const
virtual

Accessor for script engine to use when evaluating script. Default is LUA

virtual void DtScriptedTaskMetaData::setComments ( const std::string &  )
virtual

Accessor for comments that can be used to describe this task. Will not be displayed to the user

virtual const std::string& DtScriptedTaskMetaData::comments ( ) const
virtual

Accessor for comments that can be used to describe this task. Will not be displayed to the user

virtual void DtScriptedTaskMetaData::setDescription ( const std::string &  )
virtual

Accessor for comments that can be used to describe this task. Will be displayed to the user on the task data entry form

virtual const std::string& DtScriptedTaskMetaData::description ( ) const
virtual

Accessor for comments that can be used to describe this task. Will be displayed to the user on the task data entry form

virtual void DtScriptedTaskMetaData::setScriptLocation ( const std::string &  )
virtual

Location where to find the script file to execute. If blank (default) assumes same location as meta-data file

virtual const std::string& DtScriptedTaskMetaData::scriptLocation ( ) const
virtual

Location where to find the script file to execute. If blank (default) assumes same location as meta-data file

virtual void DtScriptedTaskMetaData::setMenuLocations ( const std::vector< std::string > &  )
virtual

Accessor for locations where on the task menu this script should show up. Currently assumed to only be on task menu

virtual void DtScriptedTaskMetaData::addMenuLocation ( const std::string &  )
virtual

Accessor for locations where on the task menu this script should show up. Currently assumed to only be on task menu

virtual void DtScriptedTaskMetaData::removeMenuLocation ( const std::string &  )
virtual

Accessor for locations where on the task menu this script should show up. Currently assumed to only be on task menu

virtual void DtScriptedTaskMetaData::removeMenuLocation ( int  )
virtual

Accessor for locations where on the task menu this script should show up. Currently assumed to only be on task menu

virtual const std::vector<std::string>& DtScriptedTaskMetaData::menuLocations ( ) const
virtual

Accessor for locations where on the task menu this script should show up. Currently assumed to only be on task menu

virtual void DtScriptedTaskMetaData::setShowInMenu ( bool  )
virtual

Accessor for locations where on the task menu this script should show up. Currently assumed to only be on task menu

virtual bool DtScriptedTaskMetaData::showInMenu ( ) const
virtual

Accessor for locations where on the task menu this script should show up. Currently assumed to only be on task menu

virtual void DtScriptedTaskMetaData::setEntityTypes ( const std::vector< DtEntityType > &  )
virtual

Accessor for entity types that this task is valid for. An empty list will make the assumption it is valid for all entity types (default)

virtual void DtScriptedTaskMetaData::addEntityType ( const DtEntityType &  )
virtual

Accessor for entity types that this task is valid for. An empty list will make the assumption it is valid for all entity types (default)

virtual void DtScriptedTaskMetaData::removeEntityType ( const DtEntityType &  )
virtual

Accessor for entity types that this task is valid for. An empty list will make the assumption it is valid for all entity types (default)

virtual void DtScriptedTaskMetaData::removeEntityType ( int  )
virtual

Accessor for entity types that this task is valid for. An empty list will make the assumption it is valid for all entity types (default)

virtual std::vector<DtEntityType> DtScriptedTaskMetaData::entityTypes ( ) const
virtual

Accessor for entity types that this task is valid for. An empty list will make the assumption it is valid for all entity types (default)

virtual void DtScriptedTaskMetaData::setVariables ( const std::vector< DtScriptedTaskVariable > &  )
virtual

Accessor for the variables that are part of this scripted task. The variables will be referenced by their bound name. The order in which they appear in the UI will be the order in which they appear in the variables list

virtual void DtScriptedTaskMetaData::addVariable ( const DtScriptedTaskVariable )
virtual

Accessor for the variables that are part of this scripted task. The variables will be referenced by their bound name. The order in which they appear in the UI will be the order in which they appear in the variables list

virtual void DtScriptedTaskMetaData::insertVariableBefore ( const DtScriptedTaskVariable ,
const std::string &  variable 
)
virtual

Accessor for the variables that are part of this scripted task. The variables will be referenced by their bound name. The order in which they appear in the UI will be the order in which they appear in the variables list

virtual void DtScriptedTaskMetaData::insertVariableBefore ( const DtScriptedTaskVariable ,
int  i 
)
virtual

Accessor for the variables that are part of this scripted task. The variables will be referenced by their bound name. The order in which they appear in the UI will be the order in which they appear in the variables list

virtual void DtScriptedTaskMetaData::removeVariable ( const std::string &  )
virtual

Accessor for the variables that are part of this scripted task. The variables will be referenced by their bound name. The order in which they appear in the UI will be the order in which they appear in the variables list

virtual void DtScriptedTaskMetaData::removeVariable ( int  )
virtual

Accessor for the variables that are part of this scripted task. The variables will be referenced by their bound name. The order in which they appear in the UI will be the order in which they appear in the variables list

virtual std::vector<DtScriptedTaskVariable> DtScriptedTaskMetaData::variables ( ) const
virtual

Accessor for the variables that are part of this scripted task. The variables will be referenced by their bound name. The order in which they appear in the UI will be the order in which they appear in the variables list

virtual void DtScriptedTaskMetaData::setScript ( const std::string &  )
virtual

The actual script code loaded from disk or saved with the meta data

virtual const std::string& DtScriptedTaskMetaData::script ( ) const
virtual

The actual script code loaded from disk or saved with the meta data

virtual bool DtScriptedTaskMetaData::loadScript ( )
virtual

Loads the script from the location of this meta data file or from the file defined in scriptLocation.

virtual bool DtScriptedTaskMetaData::loadScript ( const std::string &  )
virtual

Loads the script from the specified file and replaces the existing script with it.

virtual void DtScriptedTaskMetaData::setIsSystemScript ( bool  )
virtual

Accessor for whether or not this is a system vs. scenario level script

virtual bool DtScriptedTaskMetaData::isSystemScript ( ) const
virtual

The actual script code loaded from disk or saved with the meta data

virtual void DtScriptedTaskMetaData::setActionCategories ( const std::set< std::string > &  )
virtual

Keeps list of action categories that this script is part of

virtual void DtScriptedTaskMetaData::addActionCategory ( const std::string &  )
virtual

Keeps list of action categories that this script is part of

virtual void DtScriptedTaskMetaData::removeActionCategory ( const std::string &  )
virtual

Keeps list of action categories that this script is part of

virtual bool DtScriptedTaskMetaData::hasActionCategory ( const std::string &  ) const
virtual

Keeps list of action categories that this script is part of

virtual const std::set<std::string>& DtScriptedTaskMetaData::actionCategories ( ) const
virtual

Keeps list of action categories that this script is part of

virtual void DtScriptedTaskMetaData::setDirectoryPath ( const std::string &  )
virtual

Accessor for the directory location. The directory location is a path separated by the / marker. A blank directory path means this script is a top-level script.

virtual const std::string& DtScriptedTaskMetaData::directoryPath ( ) const
virtual

Accessor for the directory location. The directory location is a path separated by the / marker. A blank directory path means this script is a top-level script.

virtual void DtScriptedTaskMetaData::assignNewScriptId ( )
virtual

Assigns a new unique id to this meta data.

virtual bool DtScriptedTaskMetaData::supports ( const DtEntityType &  ) const
virtual

Returns true if this script supports the specific entity type.

bool DtScriptedTaskMetaData::operator== ( const DtScriptedTaskMetaData ) const

Equality operators.

bool DtScriptedTaskMetaData::operator!= ( const DtScriptedTaskMetaData rhs) const
inline
static void DtScriptedTaskMetaData::setEncryptDecryptFunction ( DtEncryptDecryptFcn  ,
void *  usr 
)
static

Sets encrypt/decrypt function.

static void DtScriptedTaskMetaData::getEncryptDecryptFunction ( DtEncryptDecryptFcn ,
void *&  usr 
)
static
virtual bool DtScriptedTaskMetaData::encrypt ( const std::string &  source,
std::string &  dest 
) const
virtual

Return true if buffer was encrypted.

virtual bool DtScriptedTaskMetaData::encryptScript ( )
virtual

If there is an encryption routine, encrypt the script back into the myScript member.

virtual bool DtScriptedTaskMetaData::encryptSize ( const std::string &  source,
int &  size 
) const
virtual

Return the size of the encrypted buffer'.

virtual bool DtScriptedTaskMetaData::decrypt ( const std::string &  source,
std::string &  dest 
) const
virtual

Returns true if buffer successfully decrypted.

virtual bool DtScriptedTaskMetaData::decryptScript ( )
virtual

If the script is encrypted, decrypt into myScript.

Note that calling decryptScript on a script that is already decrypted will have unexpected results

virtual void DtScriptedTaskMetaData::setEncrypted ( bool  )
virtual

Sets/gets whether or not buffer should be encrypted/decrypted. If there is an encrypt/decrypt function set that will be used when saving the scripted task to a scenario to determine if the buffer should be encrypted. If a system script, set as to whether or not the file on disk is encrypted

virtual bool DtScriptedTaskMetaData::encrypted ( ) const
virtual

Sets/gets whether or not buffer should be encrypted/decrypted. If there is an encrypt/decrypt function set that will be used when saving the scripted task to a scenario to determine if the buffer should be encrypted. If a system script, set as to whether or not the file on disk is encrypted

template<class Archive >
void DtScriptedTaskMetaData::serialize ( Archive &  ar,
const unsigned int  version 
)
inlineprotected

When the class Archive corresponds to an output archive, the & operator is defined similar to <<.

Likewise, when the class Archive is a type of input archive the & operator is defined similar to >>.

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Serialization/Deserialization //.

Member Data Documentation

std::string DtScriptedTaskMetaData::myScriptId
std::string DtScriptedTaskMetaData::myMenuText
std::string DtScriptedTaskMetaData::myToolTip
std::string DtScriptedTaskMetaData::myMenuIcon
std::string DtScriptedTaskMetaData::myScriptEngine
std::string DtScriptedTaskMetaData::myComments
std::string DtScriptedTaskMetaData::myDescription
std::string DtScriptedTaskMetaData::myScriptLocation
std::string DtScriptedTaskMetaData::myScript
mutable
std::string DtScriptedTaskMetaData::myDirectoryPath
std::vector<std::string> DtScriptedTaskMetaData::myMenuLocations
std::vector<std::string> DtScriptedTaskMetaData::myEntityTypes
std::vector<std::string> DtScriptedTaskMetaData::myVariables
std::string DtScriptedTaskMetaData::myActionCategories
bool DtScriptedTaskMetaData::myShowInMenu
std::set<std::string> DtScriptedTaskMetaData::myActionCategoriesSet
mutable
double DtScriptedTaskMetaData::myVersion
DtFilename DtScriptedTaskMetaData::myFile
mutable
bool DtScriptedTaskMetaData::myIsSystemScript
bool DtScriptedTaskMetaData::myEncrypted
mutable
DtEncryptDecryptFcn DtScriptedTaskMetaData::theEncryptDecryptFunction
static
void* DtScriptedTaskMetaData::theEncryptDecryptUserData
static

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

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)