![]() |
VR-Forces 4.0.4 Class Documentation
|
A model definition Interaction any number of named parameters, and also can be used to store cached data. More...

Classes | |
| class | SerializableParameterMap |
Public Types | |
| typedef std::map< std::string, std::string > | ParameterMap |
Public Member Functions | |
| DtModelDefinition (const std::string &modelName="") | |
| CTOR. | |
| DtModelDefinition (const DtModelDefinition ©) | |
| CCTOR. | |
| DtModelDefinition (const std::string &modelName, const DtModelDefinition ©) | |
| Create a copy but with a new name. | |
| ~DtModelDefinition () | |
| DTOR. | |
| DtModelDefinition & | operator= (const DtModelDefinition &) |
| Assignment operator. | |
| virtual void | getRecord (makArchives::DtModelDefinitionRecord &rec) |
| Fill out a record with the current info. | |
| virtual void | setFromRecord (const makArchives::DtModelDefinitionRecord &rec) |
| Populate from a record. | |
| DT_DECLARE_serialize_FUNCTIONS DT_DECLARE_PORTABLE_serialize_FUNCTIONS void | clearCache () |
| Declare serialize functions Call via serialize(Archive ar, unsigned int version); Where Archive can be any of : xml_oarchive,xml_iarchive,binary_oarchive, portable_binary_oarchive, binary_iarchive, portable_binary_iarchive,text_oarchive, or text_iarchive example: fstream fo("test.xml",std;:ios_base::out); xml_oarchive os(fo); DtModelDefinition aDef; aDef.serialize(os,0);. | |
| DtVirtualBaseClass * | findCachedData (const std::string &name) |
| Lookup cached data. | |
| void | setCachedData (const std::string &name, DtVirtualBaseClass *data) |
| Adds a data member to the cache. | |
| void | deleteCachedData (const std::string &name) |
| Helper function for deleting cache. | |
| void | setParameter (const std::string ¶meterName, const std::string ¶meterValue) |
| Set a parameter's value, if the parameter does not exist a new parameter will be created. | |
| bool | clearParameter (const std::string ¶meterName) |
| Completely remove a parameter. | |
| const std::string & | parameter (const std::string ¶meterName) const |
| Helper function for getting a parameter, not that if the parameter is not found an empty string is returned which is does not indicate if the parameter is found or is simply not set. | |
| const std::string * | findParameter (const std::string ¶meterName) const |
| Find a parameter. | |
| std::string * | findParameter (const std::string ¶meterName) |
| Find a parameter The parameter name is NOT case sensitive, ie Param == PARAM == param. | |
| const ParameterMap & | parameters () const |
| Get the parameters. | |
| const std::string & | name () const |
| Get the model name. | |
| const std::string & | schema () const |
| Get the schema string. | |
| void | setSchema (const std::string &schemaStr) |
| Set the schema string. | |
| void | setPersistent (bool persistent) |
| Set that the model definition is persistent aka it is saved to disk. | |
| bool | persistent () const |
| Is this a persistent definition (aka does it exist on disk). | |
| bool | modified () const |
| Has this definition been modified (after it was loaded from disk). | |
| void | setModified (bool) |
Static Public Attributes | |
| static const std::string | theEmptyString |
Protected Types | |
| typedef boost::unordered_map < std::string, DtVirtualBaseClass * > | CacheMap |
Protected Member Functions | |
| template<typename Archive > | |
| void | _serialize (Archive &ar, unsigned int version) |
Static Protected Member Functions | |
| static std::string | cleanName (const std::string &name) |
| Add a keyword. | |
Protected Attributes | |
| std::string | myName |
| std::string | mySchema |
| SerializableParameterMap | myParameters |
| CacheMap | myRuntimeCache |
| std::set<std::string> myKeywords; | |
| bool | myPersistentFlag |
| bool | myModifiedFlag |
A model definition Interaction any number of named parameters, and also can be used to store cached data.
The model definition will own all of it's cached data
| typedef std::map<std::string,std::string> makVrv::DtModelDefinition::ParameterMap |
typedef boost::unordered_map<std::string,DtVirtualBaseClass*> makVrv::DtModelDefinition::CacheMap [protected] |
| makVrv::DtModelDefinition::DtModelDefinition | ( | const std::string & | modelName = "" | ) |
CTOR.
| makVrv::DtModelDefinition::DtModelDefinition | ( | const DtModelDefinition & | copy | ) |
CCTOR.
| makVrv::DtModelDefinition::DtModelDefinition | ( | const std::string & | modelName, |
| const DtModelDefinition & | copy | ||
| ) |
Create a copy but with a new name.
| DtModelDefinition& makVrv::DtModelDefinition::operator= | ( | const DtModelDefinition & | ) |
Assignment operator.
| virtual void makVrv::DtModelDefinition::getRecord | ( | makArchives::DtModelDefinitionRecord & | rec | ) | [virtual] |
Fill out a record with the current info.
| virtual void makVrv::DtModelDefinition::setFromRecord | ( | const makArchives::DtModelDefinitionRecord & | rec | ) | [virtual] |
Populate from a record.
| DT_DECLARE_serialize_FUNCTIONS DT_DECLARE_PORTABLE_serialize_FUNCTIONS void makVrv::DtModelDefinition::clearCache | ( | ) |
Declare serialize functions Call via serialize(Archive ar, unsigned int version); Where Archive can be any of : xml_oarchive,xml_iarchive,binary_oarchive, portable_binary_oarchive, binary_iarchive, portable_binary_iarchive,text_oarchive, or text_iarchive example: fstream fo("test.xml",std;:ios_base::out); xml_oarchive os(fo); DtModelDefinition aDef; aDef.serialize(os,0);.
Clear the definition's cache. All cache data is deleted. This function is dangerous to call if there are Model Instance classes using the current cached data.
| DtVirtualBaseClass* makVrv::DtModelDefinition::findCachedData | ( | const std::string & | name | ) |
Lookup cached data.
The name is case sensitive.
| 0 | if no data is cached. |
| void makVrv::DtModelDefinition::setCachedData | ( | const std::string & | name, |
| DtVirtualBaseClass * | data | ||
| ) |
Adds a data member to the cache.
If an existing data pointer is stored with that name it is deleted. The name is case sensitive. To delete cached data, pass a null pointer.
| void makVrv::DtModelDefinition::deleteCachedData | ( | const std::string & | name | ) | [inline] |
Helper function for deleting cache.
| void makVrv::DtModelDefinition::setParameter | ( | const std::string & | parameterName, |
| const std::string & | parameterValue | ||
| ) |
Set a parameter's value, if the parameter does not exist a new parameter will be created.
The parameter name is NOT case sensitive, ie Param == PARAM == param. Setting a parameter to a null string does NOT remove the parameter all together i.e. calls to findParameter will return a valid pointer.
| bool makVrv::DtModelDefinition::clearParameter | ( | const std::string & | parameterName | ) |
Completely remove a parameter.
Calls to findParameter will return a null pointer. The parameter name is NOT case sensitive, ie Param == PARAM == param.
| const std::string& makVrv::DtModelDefinition::parameter | ( | const std::string & | parameterName | ) | const |
Helper function for getting a parameter, not that if the parameter is not found an empty string is returned which is does not indicate if the parameter is found or is simply not set.
The parameter name is NOT case sensitive, ie Param == PARAM == param.
| const std::string* makVrv::DtModelDefinition::findParameter | ( | const std::string & | parameterName | ) | const |
Find a parameter.
The parameter name is NOT case sensitive, ie Param == PARAM == param.
| 0 | if the parameter is not found. |
| std::string* makVrv::DtModelDefinition::findParameter | ( | const std::string & | parameterName | ) |
Find a parameter The parameter name is NOT case sensitive, ie Param == PARAM == param.
| 0 | if the parameter is not found. |
| const ParameterMap& makVrv::DtModelDefinition::parameters | ( | ) | const |
Get the parameters.
| const std::string& makVrv::DtModelDefinition::name | ( | ) | const |
Get the model name.
| const std::string& makVrv::DtModelDefinition::schema | ( | ) | const |
Get the schema string.
| void makVrv::DtModelDefinition::setSchema | ( | const std::string & | schemaStr | ) |
Set the schema string.
| void makVrv::DtModelDefinition::setPersistent | ( | bool | persistent | ) |
Set that the model definition is persistent aka it is saved to disk.
| bool makVrv::DtModelDefinition::persistent | ( | ) | const |
Is this a persistent definition (aka does it exist on disk).
| bool makVrv::DtModelDefinition::modified | ( | ) | const |
Has this definition been modified (after it was loaded from disk).
| static std::string makVrv::DtModelDefinition::cleanName | ( | const std::string & | name | ) | [static, protected] |
Add a keyword.
Remove a keyword. Get the keywords. Check to see if the model definition has any of the supplied keywords. For best performance sort the keywords (from most frequent to less frequent) and for keywords with the same frequency shortest to longest.
| void makVrv::DtModelDefinition::_serialize | ( | Archive & | ar, |
| unsigned int | version | ||
| ) | [inline, protected] |
References DT_SERIALIZE_MEMBER.
const std::string makVrv::DtModelDefinition::theEmptyString [static] |
std::string makVrv::DtModelDefinition::myName [protected] |
std::string makVrv::DtModelDefinition::mySchema [protected] |
CacheMap makVrv::DtModelDefinition::myRuntimeCache [protected] |
std::set<std::string> myKeywords;
Do not serialize these members:
bool makVrv::DtModelDefinition::myPersistentFlag [protected] |
bool makVrv::DtModelDefinition::myModifiedFlag [protected] |