te::dt::SimpleData< T, typeCode > Class Template Reference

A template for atomic data types (integers, floats, strings and others). More...

#include <SimpleData.h>

Inheritance diagram for te::dt::SimpleData< T, typeCode >:
te::dt::AbstractData

Public Member Functions

AbstractData * clone () const
 It returns a clone of this object. More...
 
virtual int getTypeCode () const
 It returns the data type code associated to the data value. More...
 
T getValue () const
 It returns the associated value. More...
 
SimpleData & operator= (const SimpleData &rhs)
 Copy constructor. More...
 
 SimpleData (T value)
 Constructor. More...
 
 SimpleData (const SimpleData &rhs)
 Copy constructor. More...
 
virtual std::string toString () const
 It returns the data value in a string representation. More...
 
virtual ~SimpleData ()
 Virtual destructor. More...
 

Private Attributes

T m_val
 The data value. More...
 

Detailed Description

template<class T, int typeCode = te::dt::UNKNOWN_TYPE>
class te::dt::SimpleData< T, typeCode >

A template for atomic data types (integers, floats, strings and others).

Requirements on type T:

  • T must be a copy constructible type.
  • T must be used with output streams via operator <<.
See also
AbstractData, CompositeData, DataType, DateTime, ByteArray

Definition at line 59 of file SimpleData.h.

Constructor & Destructor Documentation

template<class T, int typeCode = te::dt::UNKNOWN_TYPE>
te::dt::SimpleData< T, typeCode >::SimpleData ( T  value)
inline

Constructor.

Parameters
valueThe value associated.

Definition at line 68 of file SimpleData.h.

Referenced by te::dt::SimpleData< boost::int64_t, INT64_TYPE >::clone(), and te::dt::SimpleData< T *, typeCode >::clone().

template<class T, int typeCode = te::dt::UNKNOWN_TYPE>
te::dt::SimpleData< T, typeCode >::SimpleData ( const SimpleData< T, typeCode > &  rhs)
inline

Copy constructor.

Parameters
rhsThe right-hand-side data.

Definition at line 78 of file SimpleData.h.

template<class T, int typeCode = te::dt::UNKNOWN_TYPE>
virtual te::dt::SimpleData< T, typeCode >::~SimpleData ( )
inlinevirtual

Virtual destructor.

Definition at line 84 of file SimpleData.h.

Member Function Documentation

template<class T, int typeCode = te::dt::UNKNOWN_TYPE>
AbstractData* te::dt::SimpleData< T, typeCode >::clone ( ) const
inlinevirtual

It returns a clone of this object.

Returns
A clone of this object.

Implements te::dt::AbstractData.

Definition at line 106 of file SimpleData.h.

template<class T, int typeCode = te::dt::UNKNOWN_TYPE>
virtual int te::dt::SimpleData< T, typeCode >::getTypeCode ( ) const
inlinevirtual

It returns the data type code associated to the data value.

Returns
The data type code associated to the data value.

Implements te::dt::AbstractData.

Definition at line 116 of file SimpleData.h.

template<class T, int typeCode = te::dt::UNKNOWN_TYPE>
T te::dt::SimpleData< T, typeCode >::getValue ( ) const
inline

It returns the associated value.

Returns
The associated value.

Definition at line 139 of file SimpleData.h.

template<class T, int typeCode = te::dt::UNKNOWN_TYPE>
SimpleData& te::dt::SimpleData< T, typeCode >::operator= ( const SimpleData< T, typeCode > &  rhs)
inline

Copy constructor.

Parameters
rhsThe right-hand-side data.

Definition at line 91 of file SimpleData.h.

template<class T, int typeCode = te::dt::UNKNOWN_TYPE>
virtual std::string te::dt::SimpleData< T, typeCode >::toString ( void  ) const
inlinevirtual

It returns the data value in a string representation.

Returns
The data value in a string representation.

Implements te::dt::AbstractData.

Definition at line 126 of file SimpleData.h.

Member Data Documentation


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