![]() |
VR-Forces 5.0.3 Developer's Guide
|
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.

Classes | |
| class | SerializableParameterMap |
Public Types | |
| typedef std::map< std::string, std::string > | ParameterMap |
Public Member Functions | |
| DtModelDefinition (const std::string &modelName="") | |
| DtModelDefinition (const DtModelDefinition ©) | |
| DtModelDefinition (const std::string &modelName, const DtModelDefinition ©) | |
| virtual | ~DtModelDefinition () |
| DtModelDefinition & | operator= (const DtModelDefinition &) |
| bool | operator== (const DtModelDefinition &) const |
| bool | operator!= (const DtModelDefinition &) const |
| virtual void | getRecord (makArchives::DtModelDefinitionRecord &rec) |
| virtual void | setFromRecord (const makArchives::DtModelDefinitionRecord &rec) |
| DT_DECLARE_serialize_FUNCTIONS DT_DECLARE_PORTABLE_serialize_FUNCTIONS void | clearCache () |
| DtVirtualBaseClass * | findCachedData (const std::string &name) const |
| void | setCachedData (const std::string &name, DtVirtualBaseClass *data) |
| void | deleteCachedData (const std::string &name) |
| void | setParameter (const std::string ¶meterName, const std::string ¶meterValue) |
| bool | clearParameter (const std::string ¶meterName) |
| const std::string & | parameter (const std::string ¶meterName) const |
| const std::string * | findParameter (const std::string ¶meterName) const |
| const ParameterMap & | parameters () const |
| const std::string & | name () const |
| const std::string & | fileName () const |
| const std::string & | schema () const |
| const std::vector< std::string > & | listOfSharedFiles () const |
| void | addToListOfSharedFiles (const std::string &sharedFile) |
| void | setSchema (const std::string &schemaStr) |
| void | setFileName (const std::string &fileNameStr) |
| void | setPersistent (bool persistent) |
| bool | persistent () const |
| bool | modified () const |
| void | setModified (bool) |
| bool | duplicate () const |
| void | setDuplicate (bool) |
| const void | getVectorParameter (const std::string ¶meterName, DtVector ¶meterVector) const |
| boost::recursive_mutex & | modelLoadingMutex () |
| virtual bool | replaceParameter (const std::string &findWhat, const std::string &replaceWith) |
Public Member Functions inherited from makVrv::DtKeywordMixin | |
| DtKeywordMixin () | |
| virtual | ~DtKeywordMixin () |
| virtual void | addKeyword (const std::string &keyword) |
| virtual void | removeKeyword (const std::string &keyword) |
| virtual void | clearKeywords () |
| virtual const std::set < std::string > & | keywords () const |
| virtual bool | findKeywords (const std::set< std::string > &) const |
| virtual bool | findKeyword (const std::string &word) const |
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) |
Protected Attributes | |
| std::string | myName |
| std::string | myFileName |
| std::string | mySchema |
| std::vector< std::string > | myListOfSharedFiles |
| SerializableParameterMap | myParameters |
| CacheMap | myRuntimeCache |
| bool | myPersistentFlag |
| bool | myModifiedFlag |
| bool | myDuplicateFlag |
| boost::recursive_mutex | myModelLoadingMutex |
Protected Attributes inherited from makVrv::DtKeywordMixin | |
| std::set< std::string > | myKeywords |
| 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 | ) | const |
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. |
| 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::fileName | ( | ) | const |
Get the model definition's file name.
| const std::string& makVrv::DtModelDefinition::schema | ( | ) | const |
Get the schema string.
| const std::vector<std::string>& makVrv::DtModelDefinition::listOfSharedFiles | ( | ) | const |
if this definition is a duplicate of another, this list holds all the other files this def duplicates from
| void makVrv::DtModelDefinition::addToListOfSharedFiles | ( | const std::string & | sharedFile | ) |
if this definition is a duplicate of another, the other files this duplicates from will be added to this list
| void makVrv::DtModelDefinition::setSchema | ( | const std::string & | schemaStr | ) |
Set the schema string.
| void makVrv::DtModelDefinition::setFileName | ( | const std::string & | fileNameStr | ) |
Set FileName 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 | ) |
| bool makVrv::DtModelDefinition::duplicate | ( | ) | const |
| void makVrv::DtModelDefinition::setDuplicate | ( | bool | ) |
| const void makVrv::DtModelDefinition::getVectorParameter | ( | const std::string & | parameterName, |
| DtVector & | parameterVector | ||
| ) | const |
Get a DtVector from the parameter name.
| boost::recursive_mutex& makVrv::DtModelDefinition::modelLoadingMutex | ( | ) |
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. mutex for protecting the model definition cache when loading a model
|
virtual |
find a parameter, and if it exists, replace it with another one
|
staticprotected |
|
inlineprotected |
References DT_SERIALIZE_MEMBER.
|
static |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
std::set<std::string> myKeywords;
Do not serialize these members:
|
protected |
|
protected |
|
protected |
|
protected |