STK++ 1.0

STK::ExportToArray2D< TYPE > Class Template Reference

The ExportToArray2D class allow to export the data of some TYPE stored in a DataFrame to be exported in an Array2D container. More...

#include <STK_ExportToArray2D.h>

List of all members.

Public Member Functions

 ExportToArray2D (DataFrame const &df)
 Constructor.
virtual ~ExportToArray2D ()
 virtual destructor
Array2D< TYPE > *const & array2D () const
 Accesor.
void release ()
 release the ReadWriteCsv.

Private Attributes

Array2D< TYPE > * p_data_
 ptr on the Array2D the class will export.

Detailed Description

template<class TYPE>
class STK::ExportToArray2D< TYPE >

The ExportToArray2D class allow to export the data of some TYPE stored in a DataFrame to be exported in an Array2D container.

Definition at line 50 of file STK_ExportToArray2D.h.


Constructor & Destructor Documentation

template<class TYPE >
STK::ExportToArray2D< TYPE >::ExportToArray2D ( DataFrame const &  df) [inline]

Constructor.

Parameters:
dfthe DataFrame to export

Definition at line 56 of file STK_ExportToArray2D.h.

References STK::DataFrame::elt(), STK::IContainer2D::firstCol(), STK::IVariable::getType(), STK::IContainer2D::lastCol(), and STK::ExportToArray2D< TYPE >::p_data_.

                   : p_data_(0)
    {
      // create an empty Array2D
      p_data_ = new Array2D<TYPE>();

      // for each field Try a type conversion
      for(Integer iVar = df.firstCol(); iVar<=df.lastCol(); iVar++)
      {
        IVariable *const p_var = df.elt(iVar);
        // if there is a variable
        if (p_var)
        {
          // check the type of the variable
          if (p_var->getType() == IdTypeImpl<TYPE>::returnType())
          {
            Variable<TYPE>* p_variable = static_cast<Variable<TYPE>* >(p_var);
            p_data_->pushBackCol(*p_variable);
          }
        }
      }
    }
template<class TYPE >
virtual STK::ExportToArray2D< TYPE >::~ExportToArray2D ( ) [inline, virtual]

virtual destructor

Definition at line 80 of file STK_ExportToArray2D.h.

References STK::ExportToArray2D< TYPE >::p_data_.

    { if (p_data_) delete p_data_;}

Member Function Documentation

template<class TYPE >
Array2D<TYPE>* const& STK::ExportToArray2D< TYPE >::array2D ( ) const [inline]

Accesor.

Return a ptr on the the Array2D.

Definition at line 84 of file STK_ExportToArray2D.h.

References STK::ExportToArray2D< TYPE >::p_data_.

    { return p_data_;}
template<class TYPE >
void STK::ExportToArray2D< TYPE >::release ( ) [inline]

release the ReadWriteCsv.

It will be freed by the user.

Definition at line 88 of file STK_ExportToArray2D.h.

References STK::ExportToArray2D< TYPE >::p_data_.

{ p_data_ =0;}

Member Data Documentation


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