Sirikata
|
A class that holds a particular option value, readable by other parts of the program as well as settable by those parts. More...
#include <OptionValue.hpp>
Public Member Functions | |
const Any * | operator-> () const |
Any * | operator-> () |
const Any * | get () const |
Any * | get () |
template<class T > | |
T & | as () |
template<class T > | |
const T & | as () const |
template<class T > | |
T & | unsafeAs () |
template<class T > | |
const T & | unsafeAs () const |
const char * | description () const |
const char * | defaultValue () const |
OptionValue & | operator= (const OptionValue &other) |
changes the option value and invokes mChangeFunction message | |
OptionValue () | |
template<class T > | |
OptionValue (const char *option, const std::string &defaultValue, T type, const char *description, OptionValue **pointer=NULL) | |
Invoke an option, setting its default value with a particular lexiccal cast function, a description and optionally a pointer to set to the result. | |
template<class T > | |
OptionValue (const char *option, const std::string &defaultValue, T xtype, const char *description, std::tr1::function< void(const std::string &, Any, Any)> &changeFunction, OptionValue **pointer=NULL) | |
Invoke an option, setting its default value with a particular lexiccal cast function, a description and optionally a pointer to set to the result. | |
OptionValue (const char *option, const std::string &defaultValue, const char *description, const std::tr1::function< Any(std::string)> &parser, OptionValue **pointer=NULL) | |
Invoke an option, setting its default value with a particular lexiccal cast function, a description and optionally a pointer to set to the result. | |
OptionValue (const char *option, const std::string &defaultValue, const char *description, const std::tr1::function< Any(std::string)> &parser, const std::tr1::function< void(const std::string &, Any, Any)> &changeFunction, OptionValue **pointer=NULL) | |
Invoke an option, setting its default value with a particular lexiccal cast function, a description and optionally a pointer to set to the result. | |
template<class T > | |
OptionValue (const char *option, const char *defaultValue, T type, const char *description, OptionValue **pointer=NULL) | |
Invoke an option, setting its default value with a particular lexiccal cast function, a description and optionally a pointer to set to the result. | |
template<class T > | |
OptionValue (const char *option, const char *defaultValue, T xtype, const char *description, std::tr1::function< void(const std::string &, Any, Any)> &changeFunction, OptionValue **pointer=NULL) | |
Invoke an option, setting its default value with a particular lexiccal cast function, a description and optionally a pointer to set to the result. | |
OptionValue (const char *option, const char *defaultValue, const char *description, const std::tr1::function< Any(std::string)> &parser, OptionValue **pointer=NULL) | |
Invoke an option, setting its default value with a particular lexiccal cast function, a description and optionally a pointer to set to the result. | |
OptionValue (const char *option, const char *defaultValue, const char *description, const std::tr1::function< Any(std::string)> &parser, const std::tr1::function< void(const std::string &, Any, Any)> &changeFunction, OptionValue **pointer=NULL) | |
Invoke an option, setting its default value with a particular lexiccal cast function, a description and optionally a pointer to set to the result. | |
Static Private Member Functions | |
static void | noop (const std::string &, Any, Any) |
Private Attributes | |
Any | mValue |
std::string | mDefaultValue |
const char * | mDefaultChar |
const char * | mDescription |
std::tr1::function< Any(std::string)> | mParser |
std::tr1::function< void(const std::string &, Any, Any)> | mChangeFunction |
const char * | mName |
Friends | |
class | OptionRegistration |
Option Registration needs to have access to mValue to set it for the very first time without triggering event. | |
class | OptionSet |
OptionSet needs to have access to the members directly to return them. |
A class that holds a particular option value, readable by other parts of the program as well as settable by those parts.
Sirikata::OptionValue::OptionValue | ( | ) | [inline] |
References mChangeFunction, mDefaultChar, mDescription, mName, and mParser.
Sirikata::OptionValue::OptionValue | ( | const char * | option, |
const std::string & | defaultValue, | ||
T | type, | ||
const char * | description, | ||
OptionValue ** | pointer = NULL |
||
) | [inline] |
Invoke an option, setting its default value with a particular lexiccal cast function, a description and optionally a pointer to set to the result.
option | is the name of the option in the config or text files |
defaultValue | is the string representation of the default value as if a user typed it in |
type | is a class that contains a static lexical_cast function that transforms a string into an Sirikata::Any of the appropirate type |
description | is the textual description for the user when looking through the command line help |
pointer | holds a pointer to an OptionValue that will get set to the newly constructed class |
References defaultValue(), description(), mChangeFunction, mDefaultValue, mDescription, mName, mParser, and noop().
Sirikata::OptionValue::OptionValue | ( | const char * | option, |
const std::string & | defaultValue, | ||
T | xtype, | ||
const char * | description, | ||
std::tr1::function< void(const std::string &, Any, Any)> & | changeFunction, | ||
OptionValue ** | pointer = NULL |
||
) | [inline] |
Invoke an option, setting its default value with a particular lexiccal cast function, a description and optionally a pointer to set to the result.
option | is the name of the option in the config or text files |
defaultValue | is the string representation of the default value as if a user typed it in |
xtype | is a class that contains a static lexical_cast function that transforms a string into an Sirikata::Any of the appropirate type |
description | is the textual description for the user when looking through the command line help |
changeFunction | is the function that will be invoked if someone atomically changes the OptionValue type by invoking = |
pointer | holds a pointer to an OptionValue that will get set to the newly constructed class |
References defaultValue(), description(), mChangeFunction, mDefaultValue, mDescription, mName, mParser, and noop().
Sirikata::OptionValue::OptionValue | ( | const char * | option, |
const std::string & | defaultValue, | ||
const char * | description, | ||
const std::tr1::function< Any(std::string)> & | parser, | ||
OptionValue ** | pointer = NULL |
||
) | [inline] |
Invoke an option, setting its default value with a particular lexiccal cast function, a description and optionally a pointer to set to the result.
option | is the name of the option in the config or text files |
defaultValue | is the string representation of the default value as if a user typed it in |
description | is the textual description for the user when looking through the command line help |
parser | is the function that can convert a string to the Sirikata::Any of the appropriate type |
pointer | holds a pointer to an OptionValue that will get set to the newly constructed class |
References defaultValue(), description(), mChangeFunction, mDefaultValue, mDescription, mName, mParser, and noop().
Sirikata::OptionValue::OptionValue | ( | const char * | option, |
const std::string & | defaultValue, | ||
const char * | description, | ||
const std::tr1::function< Any(std::string)> & | parser, | ||
const std::tr1::function< void(const std::string &, Any, Any)> & | changeFunction, | ||
OptionValue ** | pointer = NULL |
||
) | [inline] |
Invoke an option, setting its default value with a particular lexiccal cast function, a description and optionally a pointer to set to the result.
option | is the name of the option in the config or text files |
defaultValue | is the string representation of the default value as if a user typed it in |
description | is the textual description for the user when looking through the command line help |
parser | is the function that can convert a string to the Sirikata::Any of the appropriate type |
changeFunction | is the function that will be invoked if someone atomically changes the OptionValue type by invoking = |
pointer | holds a pointer to an OptionValue that will get set to the newly constructed class |
References defaultValue(), description(), mChangeFunction, mDefaultValue, mDescription, mName, and mParser.
Sirikata::OptionValue::OptionValue | ( | const char * | option, |
const char * | defaultValue, | ||
T | type, | ||
const char * | description, | ||
OptionValue ** | pointer = NULL |
||
) | [inline] |
Invoke an option, setting its default value with a particular lexiccal cast function, a description and optionally a pointer to set to the result.
option | is the name of the option in the config or text files |
defaultValue | is the string representation of the default value as if a user typed it in |
type | is a class that contains a static lexical_cast function that transforms a string into an Sirikata::Any of the appropirate type |
description | is the textual description for the user when looking through the command line help |
pointer | holds a pointer to an OptionValue that will get set to the newly constructed class |
References defaultValue(), description(), mChangeFunction, mDefaultChar, mDescription, mName, mParser, and noop().
Sirikata::OptionValue::OptionValue | ( | const char * | option, |
const char * | defaultValue, | ||
T | xtype, | ||
const char * | description, | ||
std::tr1::function< void(const std::string &, Any, Any)> & | changeFunction, | ||
OptionValue ** | pointer = NULL |
||
) | [inline] |
Invoke an option, setting its default value with a particular lexiccal cast function, a description and optionally a pointer to set to the result.
option | is the name of the option in the config or text files |
defaultValue | is the string representation of the default value as if a user typed it in |
xtype | is a class that contains a static lexical_cast function that transforms a string into an Sirikata::Any of the appropirate type |
description | is the textual description for the user when looking through the command line help |
changeFunction | is the function that will be invoked if someone atomically changes the OptionValue type by invoking = |
pointer | holds a pointer to an OptionValue that will get set to the newly constructed class |
References defaultValue(), description(), mChangeFunction, mDefaultChar, mDescription, mName, mParser, and noop().
Sirikata::OptionValue::OptionValue | ( | const char * | option, |
const char * | defaultValue, | ||
const char * | description, | ||
const std::tr1::function< Any(std::string)> & | parser, | ||
OptionValue ** | pointer = NULL |
||
) | [inline] |
Invoke an option, setting its default value with a particular lexiccal cast function, a description and optionally a pointer to set to the result.
option | is the name of the option in the config or text files |
defaultValue | is the string representation of the default value as if a user typed it in |
description | is the textual description for the user when looking through the command line help |
parser | is the function that can convert a string to the Sirikata::Any of the appropriate type |
pointer | holds a pointer to an OptionValue that will get set to the newly constructed class |
References defaultValue(), description(), mChangeFunction, mDefaultChar, mDescription, mName, mParser, and noop().
Sirikata::OptionValue::OptionValue | ( | const char * | option, |
const char * | defaultValue, | ||
const char * | description, | ||
const std::tr1::function< Any(std::string)> & | parser, | ||
const std::tr1::function< void(const std::string &, Any, Any)> & | changeFunction, | ||
OptionValue ** | pointer = NULL |
||
) | [inline] |
Invoke an option, setting its default value with a particular lexiccal cast function, a description and optionally a pointer to set to the result.
option | is the name of the option in the config or text files |
defaultValue | is the string representation of the default value as if a user typed it in |
description | is the textual description for the user when looking through the command line help |
parser | is the function that can convert a string to the Sirikata::Any of the appropriate type |
changeFunction | is the function that will be invoked if someone atomically changes the OptionValue type by invoking = |
pointer | holds a pointer to an OptionValue that will get set to the newly constructed class |
References defaultValue(), description(), mChangeFunction, mDefaultChar, mDescription, mName, and mParser.
T& Sirikata::OptionValue::as | ( | ) | [inline] |
References Sirikata::Any::as(), and mValue.
Referenced by Sirikata::MasterPintoServerQuerierBase::connect(), Sirikata::Graphics::OgreRenderer::createRenderTarget(), Sirikata::Input::SDLInputManager::dragDeadBand(), Sirikata::JS::EmersonScript::EmersonScript(), Sirikata::Graphics::OgreRenderer::farPlane(), Sirikata::GetOptionValue(), Sirikata::Graphics::OgreRenderer::initialize(), Sirikata::Input::SDLInputManager::joyBallToAxis(), Sirikata::JS::JSObjectScriptManager::JSObjectScriptManager(), Sirikata::Graphics::OgreRenderer::loadBuiltinPlugins(), Sirikata::MasterPintoServerQuerierBase::MasterPintoServerQuerierBase(), Sirikata::Graphics::OgreRenderer::nearPlane(), Sirikata::ObjectHost::ObjectHost(), Sirikata::Graphics::OgreRenderer::parallaxShadowSteps(), Sirikata::Graphics::OgreRenderer::parallaxSteps(), Sirikata::Input::SDLInputManager::relativeMouseToAxis(), Sirikata::JS::JSObjectScript::resolveImport(), Sirikata::Mesh::SaveFilter::SaveFilter(), Sirikata::Network::TCPStream::TCPStream(), Sirikata::Network::TCPStreamListener::TCPStreamListener(), Sirikata::Graphics::OgreRenderer::useModelLights(), and Sirikata::Input::SDLInputManager::wheelToAxis().
const T& Sirikata::OptionValue::as | ( | ) | const [inline] |
References Sirikata::Any::as(), and mValue.
const char* Sirikata::OptionValue::defaultValue | ( | ) | const [inline] |
References mDefaultChar, and mDefaultValue.
Referenced by OptionValue().
const char* Sirikata::OptionValue::description | ( | ) | const [inline] |
References mDescription.
Referenced by OptionValue().
const Any* Sirikata::OptionValue::get | ( | ) | const [inline] |
References mValue.
Referenced by Sirikata::Graphics::OgreRenderer::initialize().
static void Sirikata::OptionValue::noop | ( | const std::string & | , |
Any | , | ||
Any | |||
) | [inline, static, private] |
Referenced by OptionValue().
OptionValue & Sirikata::OptionValue::operator= | ( | const OptionValue & | other | ) |
changes the option value and invokes mChangeFunction message
References mChangeFunction, mDefaultChar, mDefaultValue, mDescription, mName, mParser, and mValue.
const T& Sirikata::OptionValue::unsafeAs | ( | ) | const [inline] |
References mValue, and Sirikata::Any::unsafeAs().
T& Sirikata::OptionValue::unsafeAs | ( | ) | [inline] |
References mValue, and Sirikata::Any::unsafeAs().
Referenced by Sirikata::GetOptionValue(), Sirikata::GetOptionValueUnsafe(), and Sirikata::QueryHandlerFactory().
friend class OptionRegistration [friend] |
Option Registration needs to have access to mValue to set it for the very first time without triggering event.
friend class OptionSet [friend] |
OptionSet needs to have access to the members directly to return them.
std::tr1::function<void(const std::string&,Any,Any)> Sirikata::OptionValue::mChangeFunction [private] |
Referenced by Sirikata::OptionSet::initializationSet(), operator=(), and OptionValue().
const char* Sirikata::OptionValue::mDefaultChar [private] |
Referenced by defaultValue(), Sirikata::OptionSet::initializationSet(), operator=(), and OptionValue().
std::string Sirikata::OptionValue::mDefaultValue [private] |
Referenced by defaultValue(), Sirikata::OptionSet::initializationSet(), operator=(), and OptionValue().
const char* Sirikata::OptionValue::mDescription [private] |
Referenced by description(), Sirikata::OptionSet::initializationSet(), operator=(), and OptionValue().
const char* Sirikata::OptionValue::mName [private] |
std::tr1::function<Any(std::string)> Sirikata::OptionValue::mParser [private] |
Referenced by Sirikata::OptionSet::initializationSet(), operator=(), and OptionValue().
Any Sirikata::OptionValue::mValue [private] |
Referenced by as(), get(), Sirikata::OptionSet::initializationSet(), operator->(), operator=(), and unsafeAs().