ListTuple.h
Go to the documentation of this file.00001
00002
00014 #ifndef ListTuple_H
00015 #define ListTuple_H
00016
00017 #include "datasrcs/DataSource.h"
00018
00019 namespace boost {
00020 namespace python {
00021 class list;
00022 }
00023 }
00024
00025 namespace hippodraw {
00026
00040 class ListTuple : public DataSource
00041 {
00042
00043 private:
00044
00047 std::vector < boost::python::list > m_data;
00048
00053 mutable std::vector < double > m_row;
00054
00055 public:
00056
00059 ListTuple ();
00060
00063 virtual ~ListTuple();
00064
00068 virtual void copy ( const DataSource & );
00069
00073 virtual void notifyObservers ( ) const;
00074
00077 virtual unsigned int rows () const;
00078
00081 virtual bool empty () const;
00082
00083 virtual double valueAt ( unsigned int row, unsigned int column ) const;
00084
00093 int addColumn ( const std::string & label,
00094 boost::python::list seq );
00095
00101 void replaceColumn ( unsigned int index,
00102 boost::python::list array );
00103
00109 void replaceColumn ( const std::string & label,
00110 boost::python::list array );
00111
00114 virtual const std::vector < double > & getRow ( unsigned int index ) const;
00115
00122 virtual void setShape ( std::vector < unsigned int > & shape );
00123
00126 const std::vector < unsigned int > & getShape () const;
00127
00131 virtual void clear ();
00132
00136 virtual void reserve ( unsigned int count );
00137
00140 virtual double
00141 operator [] ( std::vector < unsigned int > & indices ) const;
00142
00143 private:
00144
00148 bool isAcceptable ( const boost::python::list & seq );
00149
00150 };
00151
00152 }
00153
00154 #endif // ListTuple_H