PropertyMap Class Reference

Bare-bones map used throughout Milton for holding custom initialization parameters/options/information. More...

#include <PropertyMap.h>

Inheritance diagram for PropertyMap:

Camera DirectIllumination Filter< N, T > Filter< 2, double > Material Mesh MetaObject MultipleImportanceSampler Renderer RenderOutput SampleGenerator SceneLoader ShapeSet SpatialAccel

List of all members.

Public Member Functions

template<>
unsigned & getValue (const std::string &key, const unsigned &defaultValue)
template<>
real_tgetValue (const std::string &key, const real_t &defaultValue)
Constructors
 PropertyMap ()
 PropertyMap (const PropertyMap &copy)
virtual ~PropertyMap ()
Main usage interface
void clear ()
virtual void inherit (const PropertyMap &m, bool overwrite=true)
bool contains (const std::string &key) const
template<typename T>
void insert (const std::string &key, const T &value)
template<typename T>
T & getValue (const std::string &key)
template<typename T>
T & getValue (const std::string &key, const T &defaultValue)
boost::any & operator[] (const std::string &key)

Protected Member Functions

 DECLARE_STL_TYPEDEF2 (std::map< std::string, boost::any >, STLPropertyMap)

Protected Attributes

STLPropertyMap m_propertyMap
 Internal std::map.

Friends

std::ostream & operator<< (std::ostream &os, const PropertyMap &m)
 Prints a PropertyMap to an output stream for debugging purposes.


Detailed Description

Bare-bones map used throughout Milton for holding custom initialization parameters/options/information.

Author:
Travis Fischer (fisch0920@gmail.com)
Date:
Fall 2008
: Try using QHash instead of std::map for efficiency reasons?

Definition at line 21 of file PropertyMap.h.


Constructor & Destructor Documentation

PropertyMap::PropertyMap (  )  [inline]

Definition at line 29 of file PropertyMap.h.

PropertyMap::PropertyMap ( const PropertyMap copy  )  [inline]

Definition at line 32 of file PropertyMap.h.

virtual PropertyMap::~PropertyMap (  )  [inline, virtual]

Definition at line 41 of file PropertyMap.h.


Member Function Documentation

PropertyMap::DECLARE_STL_TYPEDEF2 ( std::map< std::string, boost::any >  ,
STLPropertyMap   
) [protected]

void PropertyMap::clear (  ) 

Resets all properties to their default values

Reimplemented in ShapeSet.

Definition at line 16 of file PropertyMap.cpp.

virtual void PropertyMap::inherit ( const PropertyMap m,
bool  overwrite = true 
) [inline, virtual]

Definition at line 54 of file PropertyMap.h.

bool PropertyMap::contains ( const std::string &  key  )  const [inline]

Returns:
whether or not this map contains a value for the given key

Definition at line 66 of file PropertyMap.h.

template<typename T>
void PropertyMap::insert ( const std::string &  key,
const T &  value 
) [inline]

Inserts the given key, value pair into this map

Definition at line 76 of file PropertyMap.h.

template<typename T>
T& PropertyMap::getValue ( const std::string &  key  )  [inline]

Returns:
a reference to the value associated with the given key

Definition at line 86 of file PropertyMap.h.

template<typename T>
T& PropertyMap::getValue ( const std::string &  key,
const T &  defaultValue 
) [inline]

Returns:
a reference to the value associated with the given key or the given defaultValue if no custom value exists

Definition at line 105 of file PropertyMap.h.

boost::any& PropertyMap::operator[] ( const std::string &  key  )  [inline]

Returns:
a reference to the variant wrapper around the value associated with the given key

Definition at line 116 of file PropertyMap.h.

template<>
unsigned& PropertyMap::getValue ( const std::string &  key,
const unsigned &  defaultValue 
) [inline]

Definition at line 131 of file PropertyMap.h.

template<>
real_t& PropertyMap::getValue ( const std::string &  key,
const real_t defaultValue 
) [inline]

Definition at line 147 of file PropertyMap.h.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const PropertyMap m 
) [friend]

Prints a PropertyMap to an output stream for debugging purposes.

Definition at line 21 of file PropertyMap.cpp.


Member Data Documentation

STLPropertyMap PropertyMap::m_propertyMap [protected]

Internal std::map.

Definition at line 125 of file PropertyMap.h.


The documentation for this class was generated from the following files:

Generated on 28 Feb 2009 for Milton by doxygen 1.5.6