sofa::core::objectmodel::DataPtr< T > Class Template Reference

Pointer to data, readable and writable from/to a string. More...

#include <DataPtr.h>

Inheritance diagram for sofa::core::objectmodel::DataPtr< T >:

Inheritance graph
[legend]
Collaboration diagram for sofa::core::objectmodel::DataPtr< T >:

Collaboration graph
[legend]

Public Member Functions

 DataPtr (T *t, const char *h, bool isDisplayed=true)
 Constructor.
virtual ~DataPtr ()
void printValue (std::ostream &out) const
 General case for printing default value.
std::string getValueString () const
 General case for printing default value.
std::string getValueTypeString () const
 Print the value type of the associated variable.
T * beginEdit ()
void endEdit ()
void setPointer (T *p)
void setValue (const T &value)
const T & getValue () const
virtual bool read (std::string &s)
 Try to read argument value from an input stream.
template<>
bool read (std::string &str)
 Read the command line.
template<>
bool read (std::string &str)
 Read the command line.

Protected Attributes

T * ptr
 Pointer to the parameter.

Detailed Description

template<class T = void*>
class sofa::core::objectmodel::DataPtr< T >

Pointer to data, readable and writable from/to a string.

Definition at line 58 of file DataPtr.h.


Constructor & Destructor Documentation

template<class T = void*>
sofa::core::objectmodel::DataPtr< T >::DataPtr ( T *  t,
const char *  h,
bool  isDisplayed = true 
) [inline]

Constructor.

Parameters:
t a pointer to the value
h help on the field

Definition at line 65 of file DataPtr.h.

template<class T = void*>
virtual sofa::core::objectmodel::DataPtr< T >::~DataPtr (  )  [inline, virtual]

Definition at line 72 of file DataPtr.h.


Member Function Documentation

template<class T = void*>
T* sofa::core::objectmodel::DataPtr< T >::beginEdit (  )  [inline]

template<class T = void*>
void sofa::core::objectmodel::DataPtr< T >::endEdit (  )  [inline]

template<class T = void*>
const T& sofa::core::objectmodel::DataPtr< T >::getValue (  )  const [inline]

template<class T >
std::string sofa::core::objectmodel::DataPtr< T >::getValueString (  )  const [inline, virtual]

General case for printing default value.

Implements sofa::core::objectmodel::BaseData.

Definition at line 167 of file DataPtr.h.

References sofa::core::objectmodel::DataPtr< T >::ptr.

template<class T >
std::string sofa::core::objectmodel::DataPtr< T >::getValueTypeString (  )  const [inline, virtual]

Print the value type of the associated variable.

Implements sofa::core::objectmodel::BaseData.

Definition at line 176 of file DataPtr.h.

References sofa::core::objectmodel::DataPtr< T >::ptr, and sofa::core::objectmodel::BaseData::typeName().

template<class T >
void sofa::core::objectmodel::DataPtr< T >::printValue ( std::ostream &  out = std::cout  )  const [inline, virtual]

General case for printing default value.

Implements sofa::core::objectmodel::BaseData.

Definition at line 159 of file DataPtr.h.

References sofa::core::objectmodel::DataPtr< T >::ptr.

template<>
bool sofa::core::objectmodel::DataPtr< bool >::read ( std::string &  str  )  [inline, virtual]

Read the command line.

Implements sofa::core::objectmodel::BaseData.

Definition at line 141 of file DataPtr.h.

template<>
bool sofa::core::objectmodel::DataPtr< std::string >::read ( std::string &  str  )  [inline, virtual]

Read the command line.

Implements sofa::core::objectmodel::BaseData.

Definition at line 131 of file DataPtr.h.

References sofa::core::objectmodel::BaseData::m_isSet, and sofa::core::objectmodel::DataPtr< T >::ptr.

template<class T = void*>
virtual bool sofa::core::objectmodel::DataPtr< T >::read ( std::string &  s  )  [inline, virtual]

Try to read argument value from an input stream.

Return false if failed

Implements sofa::core::objectmodel::BaseData.

Definition at line 102 of file DataPtr.h.

template<class T = void*>
void sofa::core::objectmodel::DataPtr< T >::setPointer ( T *  p  )  [inline]

Definition at line 85 of file DataPtr.h.

template<class T = void*>
void sofa::core::objectmodel::DataPtr< T >::setValue ( const T &  value  )  [inline]


Field Documentation

template<class T = void*>
T* sofa::core::objectmodel::DataPtr< T >::ptr [protected]


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

Generated on Sun Nov 23 04:23:44 2008 for Sofa by  doxygen 1.5.7.1