ListTuple.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 
14 #ifndef ListTuple_H
15 #define ListTuple_H
16 
17 #include "datasrcs/DataSource.h"
18 
19 namespace boost {
20  namespace python {
21  class list;
22  }
23 }
24 
25 namespace hippodraw {
26 
40 class ListTuple : public DataSource
41 {
42 
43 private:
44 
47  std::vector < boost::python::list > m_data;
48 
53  mutable std::vector < double > m_row;
54 
55 public:
56 
59  ListTuple ();
60 
63  virtual ~ListTuple();
64 
74  unsigned int static getSize ( const boost::python::list & sequence );
75 
79  virtual void copy ( const DataSource & );
80 
84  virtual void notifyObservers ( ) const;
85 
88  virtual unsigned int rows () const;
89 
92  virtual bool empty () const;
93 
94  virtual double valueAt ( unsigned int row, unsigned int column ) const;
95 
104  int addColumn ( const std::string & label,
105  boost::python::list seq );
106 
112  void replaceColumn ( unsigned int index,
113  boost::python::list array );
114 
120  void replaceColumn ( const std::string & label,
121  boost::python::list array );
122 
125  virtual const std::vector < double > & getRow ( unsigned int index ) const;
126 
133  virtual void setShape ( std::vector < unsigned int > & shape );
134 
137  const std::vector < unsigned int > & getShape () const;
138 
142  virtual void clear ();
143 
147  virtual void reserve ( unsigned int count );
148 
151  virtual double
152  operator [] ( std::vector < unsigned int > & indices ) const;
153 
154 private:
155 
159  bool isAcceptable ( const boost::python::list & seq );
160 
161 };
162 
163 } // namespace hippodraw
164 
165 #endif // ListTuple_H

Generated for HippoDraw Class Library by doxygen