cgma
VariableArray< T > Class Template Reference

#include <VariableArray.hpp>

List of all members.

Public Member Functions

 VariableArray (size_t rowWidth)
 ~VariableArray ()
T & getItem (size_t rowNumber, size_t columnNumber)
void addRow (const std::vector< T > &newRow)
std::pair< int, int > getSize ()

Private Member Functions

 VariableArray ()
 VariableArray (VariableArray const &)

Private Attributes

size_t _rowWidth
mNan

Detailed Description

template<class T>
class VariableArray< T >

Definition at line 18 of file VariableArray.hpp.


Constructor & Destructor Documentation

template<class T >
VariableArray< T >::VariableArray ( size_t  rowWidth) [inline]

Definition at line 21 of file VariableArray.hpp.

                                      : _rowWidth(rowWidth),
                                        mNan(std::numeric_limits<T>::quiet_NaN()) {}
template<class T >
VariableArray< T >::~VariableArray ( ) [inline]

Definition at line 23 of file VariableArray.hpp.

{}
template<class T >
VariableArray< T >::VariableArray ( ) [private]
template<class T >
VariableArray< T >::VariableArray ( VariableArray< T > const &  ) [private]

Member Function Documentation

template<class T >
void VariableArray< T >::addRow ( const std::vector< T > &  newRow) [inline]

Definition at line 33 of file VariableArray.hpp.

      {
         this->push_back(newRow) ;
      }
template<class T >
T& VariableArray< T >::getItem ( size_t  rowNumber,
size_t  columnNumber 
) [inline]

Definition at line 25 of file VariableArray.hpp.

      {
         if (rowNumber < this->size() && columnNumber < _rowWidth)
            return (*this)[rowNumber][columnNumber] ;
         else 
            return mNan ;
      }
template<class T >
std::pair<int, int> VariableArray< T >::getSize ( ) [inline]

Definition at line 38 of file VariableArray.hpp.

      {
         return std::make_pair(this->size(), _rowWidth) ;
      }

Member Data Documentation

template<class T >
size_t VariableArray< T >::_rowWidth [private]

Definition at line 48 of file VariableArray.hpp.

template<class T >
T VariableArray< T >::mNan [private]

Definition at line 49 of file VariableArray.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines