#include <DetDesc/Param.h>
Inheritance diagram for Param< T >:
Public Types | |
typedef T | value_type |
Public Member Functions | |
Param () | |
Standard constructor. | |
Param (const value_type &val) | |
Constructor by value. | |
virtual | ~Param () |
Destructor. | |
template<class T1> | |
void | set (const T1 &val) |
Setter (with automatic conversion). | |
value_type & | get () |
Getter. | |
const value_type & | get () const |
Getter (const version). | |
virtual std::string | toStr () const |
String representation for printout. | |
virtual std::string | toXMLStr (const std::string &name, const std::string &comment="", int precision=16) const |
String representation for printout. | |
virtual const std::type_info & | type () const |
TypeId of the datum. | |
virtual BasicParam * | new_copy () const |
Create a copy of this object on the heap (generic copy). | |
template<> | |
std::string | toStr () const |
String representation for printout. | |
template<> | |
std::string | toXMLStr (const std::string &name, const std::string &comment, int precision) const |
String representation for XML format. | |
template<> | |
std::string | toXMLStr (const std::string &name, const std::string &comment, int precision) const |
String representation for XML format. | |
template<> | |
std::string | toXMLStr (const std::string &name, const std::string &comment, int precision) const |
String representation for XML format. | |
template<> | |
std::string | toXMLStr (const std::string &name, const std::string &comment, int precision) const |
String representation for XML format. | |
template<> | |
std::string | toXMLStr (const std::string &name, const std::string &comment, int precision) const |
String representation for XML format. | |
template<> | |
std::string | toXMLStr (const std::string &name, const std::string &comment, int precision) const |
String representation for XML format. | |
template<> | |
std::string | toXMLStr (const std::string &name, const std::string &comment, int precision) const |
String representation for XML format. | |
template<> | |
std::string | toXMLStr (const std::string &name, const std::string &comment, int precision) const |
String representation for XML format. | |
template<> | |
std::string | toXMLStr (const std::string &name, const std::string &comment, int precision) const |
String representation for XML format. | |
template<> | |
std::string | toXMLStr (const std::string &name, const std::string &comment, int precision) const |
String representation for XML format. | |
template<> | |
std::string | toXMLStr (const std::string &name, const std::string &comment, int precision) const |
String representation for XML format. | |
template<> | |
std::string | toXMLStr (const std::string &name, const std::string &comment, int precision) const |
String representation for XML format. | |
template<class T> | |
void | set (const T &val) |
Generic setter. Same cosideration as for the getters. | |
Private Member Functions | |
virtual void * | _get_ptr () |
Void pointer to the datum (used by BasicParam). | |
virtual const void * | _get_ptr () const |
Void pointer to the datum (used by BasicParam), const version. | |
Private Attributes | |
value_type | m_val |
Where the datum is stored. |
Definition at line 23 of file Param.h.
typedef T Param< T >::value_type |
Param< T >::Param | ( | const value_type & | val | ) | [inline] |
value_type& Param< T >::get | ( | ) | [inline] |
Getter.
Reimplemented from BasicParam.
Definition at line 40 of file Param.h.
00040 { return m_val; }
const value_type& Param< T >::get | ( | ) | const [inline] |
Getter (const version).
Reimplemented from BasicParam.
Definition at line 43 of file Param.h.
00043 { return m_val; }
std::string Param< T >::toStr | ( | ) | const [inline, virtual] |
String representation for printout.
Implements BasicParam.
Definition at line 74 of file Param.h.
00074 { 00075 using namespace GaudiUtils; 00076 std::ostringstream o; 00077 o << m_val; 00078 return o.str(); 00079 }
std::string Param< T >::toXMLStr | ( | const std::string & | name, | |
const std::string & | comment = "" , |
|||
int | precision = 16 | |||
) | const [virtual] |
String representation for printout.
Only a limited number of types are allowed in the XML representation of a ParamValidDataObject
Implements BasicParam.
Definition at line 91 of file Param.h.
00091 { 00092 throw GaudiException(std::string("Cannot convert parameter of type ") + typeid(m_val).name() + " to XML", 00093 "Param<T>::toXMLStr()", StatusCode::FAILURE ); 00094 return ""; 00095 }
virtual const std::type_info& Param< T >::type | ( | ) | const [inline, virtual] |
virtual BasicParam* Param< T >::new_copy | ( | ) | const [inline, virtual] |
Create a copy of this object on the heap (generic copy).
Implements BasicParam.
Definition at line 57 of file Param.h.
virtual void* Param< T >::_get_ptr | ( | ) | [inline, private, virtual] |
Void pointer to the datum (used by BasicParam).
Implements BasicParam.
Definition at line 63 of file Param.h.
00063 { return (void*)&m_val;}
virtual const void* Param< T >::_get_ptr | ( | ) | const [inline, private, virtual] |
Void pointer to the datum (used by BasicParam), const version.
Implements BasicParam.
Definition at line 65 of file Param.h.
00065 { return (void*)&m_val;}
std::string Param< double >::toStr | ( | ) | const [inline, virtual] |
String representation for printout.
Implements BasicParam.
Definition at line 81 of file Param.h.
00081 { 00082 std::ostringstream o; 00083 o.precision(16); 00084 o << m_val; 00085 return o.str(); 00086 }
std::string Param< int >::toXMLStr | ( | const std::string & | name, | |
const std::string & | comment, | |||
int | precision | |||
) | const [virtual] |
std::string Param< double >::toXMLStr | ( | const std::string & | name, | |
const std::string & | comment, | |||
int | precision | |||
) | const [virtual] |
std::string Param< std::string >::toXMLStr | ( | const std::string & | name, | |
const std::string & | comment, | |||
int | precision | |||
) | const [virtual] |
std::string Param< std::vector< int > >::toXMLStr | ( | const std::string & | name, | |
const std::string & | comment, | |||
int | precision | |||
) | const [virtual] |
std::string Param< std::vector< double > >::toXMLStr | ( | const std::string & | name, | |
const std::string & | comment, | |||
int | precision | |||
) | const [virtual] |
std::string Param< std::vector< std::string > >::toXMLStr | ( | const std::string & | name, | |
const std::string & | comment, | |||
int | precision | |||
) | const [virtual] |
void BasicParam::set | ( | const T & | val | ) | [inline, inherited] |
Generic setter. Same cosideration as for the getters.
Definition at line 37 of file BasicParam.h.
00037 { 00038 if (type() != typeid(T)) { throw std::bad_cast(); } 00039 *(T*)_get_ptr() = val; 00040 }
value_type Param< T >::m_val [private] |