MRPT logo

mrpt::utils::TParameters< T > Struct Template Reference

For usage when passing a dynamic number of (numeric) arguments to a function, by name. More...

#include <mrpt/utils/types.h>

Inherits std::map< std::string, T >.

List of all members.

Public Member Functions

 TParameters ()
virtual ~TParameters ()
bool has (const std::string &s) const
operator[] (const std::string &s) const
 A const version of the [] operator, for usage as read-only.
double & operator[] (const std::string &s)
 The write (non-const) version of the [] operator.

Detailed Description

template<typename T>
struct mrpt::utils::TParameters< T >

For usage when passing a dynamic number of (numeric) arguments to a function, by name.

    TParameters p;
    p["v_max"] = 1.0;  // Write
    ...
    cout << p["w_max"]; // Read, even if "p" is const.

Definition at line 219 of file types.h.


Constructor & Destructor Documentation

template<typename T>
mrpt::utils::TParameters< T >::TParameters (  )  [inline]

Definition at line 221 of file types.h.

template<typename T>
virtual mrpt::utils::TParameters< T >::~TParameters (  )  [inline, virtual]

Definition at line 222 of file types.h.


Member Function Documentation

template<typename T>
bool mrpt::utils::TParameters< T >::has ( const std::string &  s  )  const [inline]

Definition at line 223 of file types.h.

template<typename T>
double& mrpt::utils::TParameters< T >::operator[] ( const std::string &  s  )  [inline]

The write (non-const) version of the [] operator.

Definition at line 236 of file types.h.

References mrpt::utils::TParameters< T >::operator[]().

template<typename T>
T mrpt::utils::TParameters< T >::operator[] ( const std::string &  s  )  const [inline]

A const version of the [] operator, for usage as read-only.

Exceptions:
std::logic_error On parameter not present. Please, check existence with "has" before reading.

Definition at line 229 of file types.h.

Referenced by mrpt::utils::TParameters< T >::operator[]().




Page generated by Doxygen 1.6.1 for MRPT 0.7.1 SVN: at Tue Dec 22 08:29:35 CET 2009