Go to the documentation of this file.
29 #ifndef __StringInterface_H__
30 #define __StringInterface_H__
74 : name(newName), description(newDescription), paramType(newType) {}
103 ParamCommandMap::iterator i = mParamCommands.find(name);
104 if (i != mParamCommands.end())
116 ParamCommandMap::const_iterator i = mParamCommands.find(name);
117 if (i != mParamCommands.end())
136 mParamDefs.push_back(paramDef);
137 mParamCommands[paramDef.
name] = paramCmd;
190 ParamDictionaryMap::iterator it = msDictionary.find(className);
192 if ( it == msDictionary.end() )
194 mParamDict = &msDictionary.insert( std::make_pair( className,
ParamDictionary() ) ).first->second;
195 mParamDictName = className;
200 mParamDict = &it->second;
201 mParamDictName = className;
284 return cmd->
doGet(
this);
311 ParameterList::const_iterator i;
ParameterType
List of parameter types available.
#define OGRE_LOCK_MUTEX(name)
virtual bool setParameter(const String &name, const String &value)
Generic parameter setting method.
void addParameter(const ParameterDef ¶mDef, ParamCommand *paramCmd)
Method for adding a parameter definition for this class.
static void cleanupDictionary()
Cleans up the static 'msDictionary' required to reset Ogre, otherwise the containers are left with in...
ParameterList mParamDefs
Definitions of parameters.
const ParameterList & getParameters(void) const
Retrieves a list of parameters valid for this object.
virtual void copyParametersTo(StringInterface *dest) const
Method for copying this object's parameters to another object.
map< String, ParamDictionary >::type ParamDictionaryMap
ParamCommand * getParamCommand(const String &name)
Retrieves the parameter command object for a named parameter.
virtual void doSet(void *target, const String &val)=0
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
Definition of a parameter supported by a StringInterface class, for introspection.
virtual ~StringInterface()
Virtual destructor, see Effective C++.
virtual String doGet(const void *target) const =0
Abstract class which is command object which gets/sets parameters.
virtual void setParameterList(const NameValuePairList ¶mList)
Generic multiple parameter setting method.
ParameterDef(const String &newName, const String &newDescription, ParameterType newType)
Class defining the common interface which classes can use to present a reflection-style,...
const ParamDictionary * getParamDictionary(void) const
std::map< K, V, P, A > type
map< String, ParamCommand * >::type ParamCommandMap
vector< ParameterDef >::type ParameterList
static ParamDictionaryMap msDictionary
Dictionary of parameters.
ParamDictionary * getParamDictionary(void)
Retrieves the parameter dictionary for this class.
virtual String getParameter(const String &name) const
Generic parameter retrieval method.
String mParamDictName
Class name for this instance to be used as a lookup (must be initialised by subclasses)
bool createParamDictionary(const String &className)
Internal method for creating a parameter dictionary for the class, if it does not already exist.
ParamCommandMap mParamCommands
Command objects to get/set.
ParamDictionary * mParamDict
const ParamCommand * getParamCommand(const String &name) const
const ParameterList & getParameters(void) const
Retrieves a list of parameters valid for this object.
OGRE_STATIC_MUTEX(msDictionaryMutex)
Class to hold a dictionary of parameters for a single class.
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.