export_PyNTuple.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 
27 // include first to avoid _POSIX_C_SOURCE warning.
28 #include <boost/python.hpp>
29 
30 
31 using namespace boost::python;
32 
33 #include "PyNTuple.h"
34 
35 namespace hippodraw {
36 namespace Python {
37 
38 
39 void
41 {
42  class_ < PyNTuple, bases < NTuple > >
43  ( "NTuple",
44  "A derived class of DataSource that stores its tabular data vectors of\n"
45  "double precision numbers in C++. An NTuple object can be created in\n"
46  "a number of ways including reading from a file using the\n"
47  "NTupleController",
48  init<>
49  ( "NTuple ( None ) -> NTuple\n"
50  "NTuple ( value ) -> NTuple\n"
51  "NTuple ( sequence ) -> NTuple\n"
52  "NTuple ( NTuple ) -> NTuple\n"
53  "\n"
54  "The form with no arguments creates an empty NTuple with no rows\n"
55  "or columns. The form with one value argument creates an empty\n"
56  "NTuple with `value' number of columns. The form with a sequence\n"
57  "argument creates an empty NTuple with the number of columns equal\n"
58  "to size of the sequence. The sequence should contain string which\n"
59  "are used as the column labels. The last form form creates an\n"
60  "NTuple\n whose contents is a copy of an existing one." ) )
61 
62  .def ( init < unsigned int > ( ) )
63 
64  .def ( init < const std::vector < std::string > & > ( ) )
65 
66  .def ( init < const PyNTuple & > () )
67 
68  .def ( "setTitle", &PyNTuple::setTitle,
69  "setTitle ( string ) -> None\n"
70  "\n"
71  "Sets the title of the ntuple. The title by default appears at\n"
72  "the top of a Display." )
73 
74 // .def ( "addColumn",
75 // ( int ( PyNTuple::* ) // function pointer cast
76 // ( const std::string &,
77 // const std::vector < float > & ) )
78 // &PyNTuple::addColumn,
79 // "addColumn ( label, sequence<float> ) -> index\n"
80 // "\n"
81 // "Adds a new column with label." )
82 
83  .def ( "addColumn",
84  ( int ( PyNTuple::* ) // function pointer cast
85  ( const std::string &,
86  const std::vector < double > & ) )
87  &PyNTuple::addColumn,
88  "addColumn ( label, sequence<double> ) -> index\n"
89  "\n"
90  "Adds a new column with label." )
91 
92  .def ( "append", &PyNTuple::append,
93  "append ( DataSource ) -> None\n"
94  "\n"
95  "Appends the contents of the DataSource to the NTuple." )
96 
97  .def ( "replaceColumn",
98  ( void ( PyNTuple::* ) // function pointer cast
99  ( unsigned int,
100  const std::vector < double > & ) )
101  &PyNTuple::replaceColumn,
102  "replaceColumn ( index, sequence ) -> None\n"
103  "\n"
104  "Replaces the indexed column." )
105 
106  .def ( "replaceColumn",
107  ( void ( PyNTuple::* ) // function pointer cast
108  ( const std::string &, const std::vector < double > & ) )
109  &PyNTuple::replaceColumn,
110  "replaceColumn ( label, sequence ) -> None\n"
111  "\n"
112  "Replaces the labeled column." )
113 
114  .def ( "addRow",
115  &PyNTuple::addRow,
116  "addRow ( sequence ) -> None\n"
117  "\n"
118  "Append a row at the end." )
119 
120  .def ( "clear",
121  &PyNTuple::clear,
122  "clear () -> None\n"
123  "\n"
124  "Clears the data elements of the DataSource. That is, remove\n"
125  "all the rows while keeping the column labels." )
126 
127  ;
128 }
129 } // namespace Python
130 } // namespace hippodraw
hippodraw::PyNTuple class interface.
void export_PyNTuple()
Exports the PyNTuple class to Python.
A wrapper for NTuple, so that when NTuple is used in Qt based application, the application object can...
Definition: PyNTuple.h:28

Generated for HippoDraw Class Library by doxygen