29#ifndef __StringInterface_H__
30#define __StringInterface_H__
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())
190 ParamDictionaryMap::iterator
it = msDictionary.find(
className);
192 if (
it == msDictionary.end() )
200 mParamDict = &
it->second;
284 return cmd->doGet(
this);
311 ParameterList::const_iterator
i;
313 for (
i =
dict->mParamDefs.begin();
314 i !=
dict->mParamDefs.end(); ++
i)
316 dest->setParameter(
i->name, getParameter(
i->name));
#define OGRE_LOCK_MUTEX(name)
Abstract class which is command object which gets/sets parameters.
virtual void doSet(void *target, const String &val)=0
virtual String doGet(const void *target) const =0
Class to hold a dictionary of parameters for a single class.
ParamCommandMap mParamCommands
Command objects to get/set.
ParameterList mParamDefs
Definitions of parameters.
void addParameter(const ParameterDef ¶mDef, ParamCommand *paramCmd)
Method for adding a parameter definition for this class.
const ParameterList & getParameters(void) const
Retrieves a list of parameters valid for this object.
const ParamCommand * getParamCommand(const String &name) const
ParamCommand * getParamCommand(const String &name)
Retrieves the parameter command object for a named parameter.
Definition of a parameter supported by a StringInterface class, for introspection.
ParameterDef(const String &newName, const String &newDescription, ParameterType newType)
Reference-counted shared pointer, used for objects where implicit destruction is required.
Class defining the common interface which classes can use to present a reflection-style,...
virtual String getParameter(const String &name) const
Generic parameter retrieval method.
static void cleanupDictionary()
Cleans up the static 'msDictionary' required to reset Ogre, otherwise the containers are left with in...
OGRE_STATIC_MUTEX(msDictionaryMutex)
virtual void copyParametersTo(StringInterface *dest) const
Method for copying this object's parameters to another object.
const ParamDictionary * getParamDictionary(void) const
ParamDictionary * mParamDict
static ParamDictionaryMap msDictionary
Dictionary of parameters.
bool createParamDictionary(const String &className)
Internal method for creating a parameter dictionary for the class, if it does not already exist.
ParamDictionary * getParamDictionary(void)
Retrieves the parameter dictionary for this class.
virtual ~StringInterface()
Virtual destructor, see Effective C++.
String mParamDictName
Class name for this instance to be used as a lookup (must be initialised by subclasses)
const ParameterList & getParameters(void) const
Retrieves a list of parameters valid for this object.
virtual bool setParameter(const String &name, const String &value)
Generic parameter setting method.
virtual void setParameterList(const NameValuePairList ¶mList)
Generic multiple parameter setting method.
ParameterType
List of parameter types available.
map< String, ParamCommand * >::type ParamCommandMap
map< String, ParamDictionary >::type ParamDictionaryMap
vector< ParameterDef >::type ParameterList
std::map< K, V, P, A > type