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
00074 unsigned int static getSize ( const boost::python::list & sequence );
00075
00079 virtual void copy ( const DataSource & );
00080
00084 virtual void notifyObservers ( ) const;
00085
00088 virtual unsigned int rows () const;
00089
00092 virtual bool empty () const;
00093
00094 virtual double valueAt ( unsigned int row, unsigned int column ) const;
00095
00104 int addColumn ( const std::string & label,
00105 boost::python::list seq );
00106
00112 void replaceColumn ( unsigned int index,
00113 boost::python::list array );
00114
00120 void replaceColumn ( const std::string & label,
00121 boost::python::list array );
00122
00125 virtual const std::vector < double > & getRow ( unsigned int index ) const;
00126
00133 virtual void setShape ( std::vector < unsigned int > & shape );
00134
00137 const std::vector < unsigned int > & getShape () const;
00138
00142 virtual void clear ();
00143
00147 virtual void reserve ( unsigned int count );
00148
00151 virtual double
00152 operator [] ( std::vector < unsigned int > & indices ) const;
00153
00154 private:
00155
00159 bool isAcceptable ( const boost::python::list & seq );
00160
00161 };
00162
00163 }
00164
00165 #endif // ListTuple_H