HyperspaceExplorer 0.7.1
Classes | Public Member Functions | Private Types | Private Member Functions

A class to store and manage FunctionParameter s. More...

#include <ParameterMap.h>

Inheritance diagram for ParameterMap:
Inheritance graph
[legend]
Collaboration diagram for ParameterMap:
Collaboration graph
[legend]

List of all members.

Classes

class  NonexistentParameterAccessed
 Exception that is thrown when a key is accessed that is not present in a ParameterMap. More...

Public Member Functions

template<typename T >
 ParameterMap (const std::string &name, const T &value)
 Create a ParameterMap containing one parameter.
template<typename T >
void insertByValue (const std::string name, const T &value)
 Insert a parameter with a name and an actual value.
template<typename T >
void insertByDefault (const std::string name, const T &defaultValue)
 Insert a parameter with a name and a default value.
FunctionParameter::parameter_ptr_type getParameter (const std::string &name)
FunctionParameter::value_ptr_type getValue (const std::string &name)
template<typename T >
void set (const std::string &name, const T &value)
 Sets the value of the parameter stored under the key name to value.
std::string toString () const
template<>
void set (const std::string &name, const double &value)
 Specialization for type double, which has no toString() method.
template<>
void set (const std::string &name, const unsigned &value)
 Specialization for type unsigned, which has no toString() method.
template<>
void set (const std::string &name, const int &value)
 Specialization for type int, which has no toString() method.
template<>
void set (const std::string &name, const std::string &value)
 Specialization for type std::string, which has no toString() method.

Private Types

typedef std::map< std::string,
FunctionParameter::parameter_ptr_type
map_type
 Type of the container used to actually store the FunctionParameter s.

Private Member Functions

ParameterMap::iterator findOrThrow (const std::string &name)

Detailed Description

A class to store and manage FunctionParameter s.

Author:
Helge Preuss <lene.preuss@gmail.com>

Constructor & Destructor Documentation

template<typename T >
ParameterMap::ParameterMap ( const std::string name,
const T &  value 
) [inline]

Create a ParameterMap containing one parameter.

Template Parameters:
TThe type of the parameter that is in the map.

References insertByValue().

Here is the call graph for this function:


Member Function Documentation

ParameterMap::iterator ParameterMap::findOrThrow ( const std::string name) [private]
Returns:
iterator pointing to the element with key name.
Exceptions:
NonexistentParameterAccessedif name is not a key.

References std::map< std::string, FunctionParameter::parameter_ptr_type >::end(), and std::map< std::string, FunctionParameter::parameter_ptr_type >::find().

Referenced by getParameter().

Here is the call graph for this function:

Here is the caller graph for this function:

FunctionParameter::parameter_ptr_type ParameterMap::getParameter ( const std::string name)
Returns:
The FunctionParameter * that is stored under the key name.
Exceptions:
NonexistentParameterAccessedif name is not a key.

References findOrThrow().

Referenced by UI::Dialogs::ValuesDialogImpl::accept(), ParametricFunction< 4, 2 >::getParameter(), Displayable::getParameter(), getValue(), and set().

Here is the call graph for this function:

Here is the caller graph for this function:

FunctionParameter::value_ptr_type ParameterMap::getValue ( const std::string name)
Returns:
The FunctionParameterValue * that is stored under the key name.
Exceptions:
NonexistentParameterAccessedif name is not a key.

References getParameter().

Referenced by ParametricFunction< 4, 2 >::getParameterValue(), and Displayable::getParameterValue().

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T >
void ParameterMap::insertByDefault ( const std::string  name,
const T &  defaultValue 
) [inline]

Insert a parameter with a name and a default value.

Template Parameters:
TThe type of the parameter that is inserted.

References std::map< std::string, FunctionParameter::parameter_ptr_type >::insert(), Loki::SingletonHolder< T, CreationPolicy >::Instance(), and std::make_pair().

Here is the call graph for this function:

template<typename T >
void ParameterMap::insertByValue ( const std::string  name,
const T &  value 
) [inline]

Insert a parameter with a name and an actual value.

Template Parameters:
TThe type of the parameter that is inserted.

References std::map< std::string, FunctionParameter::parameter_ptr_type >::insert(), Loki::SingletonHolder< T, CreationPolicy >::Instance(), and std::make_pair().

Referenced by ParameterMap().

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T >
void ParameterMap::set ( const std::string name,
const T &  value 
) [inline]

Sets the value of the parameter stored under the key name to value.

Template Parameters:
TThe type of parameter that is to be changed. T must be either of a class that has the toString() method, or one of the primitive types for which explicit specializations are listed below.
Parameters:
nameKey of the parameter that is to be set.
valueThe new value for parameter name.
Exceptions:
NonexistentParameterAccessedif name is not a key.

References getParameter(), and value().

Here is the call graph for this function:

std::string ParameterMap::toString ( ) const
Returns:
String representation for debugging purposes

References std::map< std::string, FunctionParameter::parameter_ptr_type >::begin(), std::map< std::string, FunctionParameter::parameter_ptr_type >::end(), and std::endl().

Referenced by C4DView::ApplyChanges(), AltSponge::SetParameters(), and Sponge::SetParameters().

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends

Generated on Mon Apr 9 2012 20:25:18 for HyperspaceExplorer 0.7.1 by doxygen 1.7.4  -  Hosted bySourceForge.net Logo