export_ListTuple.cxx
Go to the documentation of this file.
1 
12 #ifdef _MSC_VER
13 // nonstandard extension used 'extern' before...
14 # pragma warning(disable:4231)
15 
16 // needs to have dll-interface used by client
17 # pragma warning(disable:4251)
18 
19 // non dll-interface struct
20 # pragma warning(disable:4275)
21 
22 // 'int' : forcing value to bool 'true' or 'false' (performance warning)
23 # pragma warning(disable:4800)
24 #endif
25 
26 // include first to avoid _POSIX_C_SOURCE warning.
27 #include <boost/python.hpp>
28 
29 #include "ListTuple.h"
30 
31 using namespace boost::python;
32 
33 namespace hippodraw {
34 namespace Python {
35 
36 void
38 {
39  class_ < ListTuple, bases < DataSource > >
40  ( "ListTuple",
41  "A derived class from DataSource containing columns as references to\n"
42  "Python list objects. This allows the data to be used without making\n"
43  "a copy of it. However, access to the data is slower than for most\n"
44  "of the other classes derived from DataSource",
45  init< >
46  ( "ListTuple ( None ) -> ListTuple\n"
47  "\n"
48  "Creates an empty ListTuple" ) )
49 
50 // .add_property ( "rows", &ListTuple::rows )
51 
52  .def ( "setLabels", &ListTuple::setLabels,
53  "setLabels ( list or tuple ) -> None\n"
54  "\n"
55  "Sets the labels of the columns from list of string objects.\n"
56  "For an empty ListTuple object, implicitly sets the number of\n"
57  "columns." )
58 
59  .def ( "getLabel", &ListTuple::getLabelAt,
60  return_value_policy < copy_const_reference > (),
61  "getLabel ( index ) -> string\n"
62  "\n"
63  "Returns label of column." )
64 
65 // .def ( "getLabels", &ListTuple::getLabels,
66 // return_value_policy < copy_const_reference > () )
67 
68  .def ( "addColumn",
69  &ListTuple::addColumn,
70  with_custodian_and_ward < 1, 2 > (),
71  "addColumn ( string, list ) -> value\n"
72  "\n"
73  "Adds the array as a new column with label from the string.\n"
74  "Returns the index of the new column." )
75 
76  .def ( "replaceColumn",
77  ( void ( ListTuple:: * ) //function pointer
78  ( unsigned int, boost::python::list ) ) // signature
79  &ListTuple::replaceColumn,
80  with_custodian_and_ward < 1, 2 > (),
81  "replaceColumn ( index, list ) -> None\n"
82  "\n"
83  "Replaces existing column with list\n" )
84 
85  .def ( "replaceColumn",
86  ( void ( ListTuple:: * ) //function pointer
87  ( const std::string &, boost::python::list ) ) // signature
88  &ListTuple::replaceColumn,
89  with_custodian_and_ward < 1, 2 > (),
90  "replaceColumn ( string, list ) -> None\n"
91  "\n"
92  "Replaces existing column with new array\n" )
93 
94  .def ( "notifyObservers",
95  &ListTuple::notifyObservers,
96  "notifyObservers ( None ) -> None\n"
97  "\n"
98  "Sends update message to all observers. Use this member if the\n"
99  "contents of the reference Python list has changed and Display\n"
100  "objects bound to it require updating." )
101 
102  ;
103 }
104 
105 } // namespace Python
106 } // namespace hippodraw

Generated for HippoDraw Class Library by doxygen