![]() |
VR-Forces 4.6.1 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. | |
| virtual | ~DtModelDefinition () |
| DTOR. | |
| DtModelDefinition & | operator= (const DtModelDefinition &) |
| Assignment operator. | |
| bool | operator== (const DtModelDefinition &) const |
| Equal operator. | |
| bool | operator!= (const DtModelDefinition &) const |
| Inequal 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) |
Public Member Functions inherited from makVrv::DtKeywordMixin | |
| DtKeywordMixin () | |
| CTOR. | |
| virtual | ~DtKeywordMixin () |
| DTOR. | |
| virtual void | addKeyword (const std::string &keyword) |
| Add a keyword. | |
| virtual void | removeKeyword (const std::string &keyword) |
| Remove a keyword. | |
| virtual void | clearKeywords () |
| Clear the keywords. | |
| virtual const std::set < std::string > & | keywords () const |
| Get the keywords. | |
| virtual bool | findKeywords (const std::set< std::string > &) const |
| Check to see if the class 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. | |
| virtual bool | findKeyword (const std::string &word) const |
| Check to see if a single keyword is in the set. | |
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 |
Protected Attributes inherited from makVrv::DtKeywordMixin | |
| std::set< std::string > | myKeywords |
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 |
|
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.
|
virtual |
DTOR.
| DtModelDefinition& makVrv::DtModelDefinition::operator= | ( | const DtModelDefinition & | ) |
Assignment operator.
| bool makVrv::DtModelDefinition::operator== | ( | const DtModelDefinition & | ) | const |
Equal operator.
| bool makVrv::DtModelDefinition::operator!= | ( | const DtModelDefinition & | ) | const |
Inequal operator.
|
virtual |
Fill out a record with the current info.
|
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.
|
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).
| void makVrv::DtModelDefinition::setModified | ( | bool | ) |
|
staticprotected |
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.
|
inlineprotected |
References DT_SERIALIZE_MEMBER.
|
static |
|
protected |
|
protected |
|
protected |
|
protected |
std::set<std::string> myKeywords;
Do not serialize these members:
|
protected |
|
protected |