export_NTuple.cxx
Go to the documentation of this file.
1 
13 #ifdef _MSC_VER
14 // nonstandard extension used 'extern' before...
15 # pragma warning(disable:4231)
16 
17 // needs to have dll-interface used by client
18 # pragma warning(disable:4251)
19 
20 // non dll-interface struct
21 # pragma warning(disable:4275)
22 
23 // 'int' : forcing value to bool 'true' or 'false' (performance warning)
24 # pragma warning(disable:4800)
25 #endif
26 
27 // include first to avoid _POSIX_C_SOURCE warning.
28 #include <boost/python.hpp>
29 
30 #include "datasrcs/NTuple.h"
31 
32 using std::vector;
33 using namespace boost::python;
34 
35 namespace hippodraw {
36 namespace Python {
37 
38 void
40 {
41  class_ < NTuple, bases < DataSource > >
42  ( "NTupleInternal",
43  "A derived class of DataSource that stores its tabular data vectors of\n"
44  "double precision numbers in C++. An NTuple object can be created in\n"
45  "a number of ways including reading from a file using the\n"
46  "NTupleController",
47  init<>
48  ( "NTuple ( None ) -> NTuple\n"
49  "NTuple ( value ) -> NTuple\n"
50  "NTuple ( sequence ) -> NTuple\n"
51  "NTuple ( NTuple ) -> NTuple\n"
52  "\n"
53  "The form with no arguments creates an empty NTuple with no rows\n"
54  "or columns. The form with one value argument creates an empty\n"
55  "NTuple with `value' number of columns. The form with a sequence\n"
56  "argument creates an empty NTuple with the number of columns equal\n"
57  "to size of the sequence. The sequence should contain string which\n"
58  "are used as the column labels. The last form form creates an\n"
59  "NTuple\n whose contents is a copy of an existing one." ) )
60 
61  .def ( init < unsigned int > ( ) )
62 
63  .def ( init < const std::vector < std::string > & > ( ) )
64 
65  .def ( init < const NTuple & > () )
66 
67  .def ( "setLabels", &NTuple::setLabels,
68  "setLabels ( sequence ) -> None\n"
69  "\n"
70  "Sets the labels of the columns from the list of strings. If the\n"
71  "NTuple is empty, then also sets the number of columns to be the\n"
72  "size of the list. If the number of columns has already been\n"
73  "set, the the size of the list should be the same, otherwise\n"
74  "a RuntimeError exception is thrown." )
75 
76  .def ( "getLabel", &NTuple::getLabelAt,
77  return_value_policy < copy_const_reference > (),
78  "getLabel ( index ) -> string\n"
79  "\n"
80  "Returns the label at column index." )
81 
82  .def ( "getRow", &NTuple::getRow,
83  return_value_policy < copy_const_reference> (),
84  "getRow ( index ) -> list\n"
85  "\n"
86  "Returns the index row as list floats." )
87 
88  .def ( "setIntervalCount", &NTuple::setIntervalCount,
89  "setIntervalCount ( count ) -> None\n"
90  "\n"
91  "Sets the interval count between updates to the observers." )
92 
93  .def ( "setIntervalEnabled", &NTuple::setIntervalEnabled,
94  "setIntervalEnable ( Boolean ) -> None\n"
95  "\n"
96  "Sets the interval counting on or off" )
97 
98  ;
99 }
100 
101 } // namespace Python
102 } // namespace hippodraw
hippodraw::NTuple class interface.
void export_NTuple()
Exports the NTuple class to Python.

Generated for HippoDraw Class Library by doxygen