29 #ifndef __StringInterface_H__
30 #define __StringInterface_H__
74 : name(newName), description(newDescription), paramType(newType) {}
82 virtual String doGet(
const void* target)
const = 0;
83 virtual void doSet(
void* target,
const String& val) = 0;
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;
250 virtual bool setParameter(
const String& name,
const String& value);
284 return cmd->
doGet(
this);
311 ParameterList::const_iterator i;
326 static void cleanupDictionary () ;
void addParameter(const ParameterDef ¶mDef, ParamCommand *paramCmd)
Method for adding a parameter definition for this class.
ParameterList mParamDefs
Definitions of parameters.
virtual bool setParameter(const String &name, const String &value)
Generic parameter setting method.
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
ParamCommand * getParamCommand(const String &name)
Retrieves the parameter command object for a named parameter.
ParamDictionary * getParamDictionary(void)
Retrieves the parameter dictionary for this class.
ParamCommandMap mParamCommands
Command objects to get/set.
const ParamCommand * getParamCommand(const String &name) const
bool createParamDictionary(const String &className)
Internal method for creating a parameter dictionary for the class, if it does not already exist...
Class defining the common interface which classes can use to present a reflection-style, self-defining parameter set to callers.
Definition of a parameter supported by a StringInterface class, for introspection.
const ParamDictionary * getParamDictionary(void) const
virtual ~StringInterface()
Virtual destructor, see Effective C++.
map< String, ParamCommand * >::type ParamCommandMap
String mParamDictName
Class name for this instance to be used as a lookup (must be initialised by subclasses) ...
map< String, ParamDictionary >::type ParamDictionaryMap
std::map< K, V, P, A > type
virtual String getParameter(const String &name) const
Generic parameter retrieval method.
ParameterType
List of parameter types available.
vector< ParameterDef >::type ParameterList
#define OGRE_STATIC_MUTEX(name)
ParameterDef(const String &newName, const String &newDescription, ParameterType newType)
const ParameterList & getParameters(void) const
Retrieves a list of parameters valid for this object.
static ParamDictionaryMap msDictionary
Dictionary of parameters.
virtual String doGet(const void *target) const =0
virtual void copyParametersTo(StringInterface *dest) const
Method for copying this object's parameters to another object.
ParamDictionary * mParamDict
Class to hold a dictionary of parameters for a single class.
#define OGRE_LOCK_MUTEX(name)
Abstract class which is command object which gets/sets parameters.