14 # pragma warning(disable:4231)
17 # pragma warning(disable:4251)
20 # pragma warning(disable:4275)
23 # pragma warning(disable:4800)
27 #include <boost/python.hpp>
35 using namespace boost::python;
43 class_ < PyNTupleController, bases<>,
46 "A singleton object to manage NTuple objects.",
49 .def (
"instance", &PyNTupleController::instance,
50 return_value_policy < reference_existing_object > (),
51 "instance () -> NTupleController\n"
53 "Returns the single instance of the controller" )
55 .staticmethod(
"instance" )
57 .def (
"createDataArray",
58 &PyNTupleController::createDataArray,
59 return_value_policy < manage_new_object > (),
60 "createDataArray ( filename ) -> DataArray\n"
62 "Creates a DataArray from file." )
64 .def (
"createNTuple",
65 (
NTuple * ( PyNTupleController::* )
67 &PyNTupleController::createNTuple,
68 return_value_policy < manage_new_object > (),
69 "Creates an empty NTuple" )
71 .def (
"createNTuple",
73 (
const std::string & ) )
74 &PyNTupleController::createNTuple,
75 return_value_policy < manage_new_object > (),
76 "createNTuple () -> NTuple\n"
77 "createNTuple ( string ) -> NTuple\n"
79 "Creates and registers an NTuple. The first method creates an\n"
80 "empty NTuple object. The second method creates one from a\n"
81 "file. Both methods return ownership of the created object to\n"
84 .def (
"createCircularBuffer",
87 & PyNTupleController::createCircularBuffer,
88 return_value_policy < manage_new_object > (),
89 "createCircularBuffer ( value ) -> CircularBuffer\n"
91 "Creates and registers a CircularBuffer object with set number of\n"
94 .def (
"registerNTuple",
95 ( std::string ( PyNTupleController:: * )
97 & PyNTupleController::registerNTuple,
98 "Register an NTuple to make it visible to the application" )
100 .def (
"registerNTuple",
101 (
void ( PyNTupleController:: * )
103 & PyNTupleController::registerNTuple,
104 "registerNTuple ( DataSource ) -> None\n"
105 "registerNTuple ( string, DataSource ) -> None\n"
107 "Register an NTuple to make it visible to the application. The\n"
108 "first form takes the name from the DataSource object, if it has\n"
109 "one, otherwise generates a unique name. The second form takes\n"
110 "string argument for the name." )
112 .def (
"writeToFile",
113 (
int ( PyNTupleController:: * )
115 & PyNTupleController::writeNTupleToFile,
116 "writeToFile ( DataSource, string ) -> value\n"
118 "Writes the NTuple to a file as ASCII text. Returns 0 if\n"
123 (
const std::string & )
const )
124 & PyNTupleController::findDataSource,
125 return_value_policy < reference_existing_object > (),
126 "findNTuple ( string ) -> DataSource\n"
128 "Find an registered NTuple by its name and returns a reference to\n"
129 "it. If the DataSource can not be found, an exception is thrown.\n"
131 "Warning: if more than one DataSource has the same name,\n"
132 "the first one found is returned." )
135 (
void ( PyNTupleController:: * )
137 & PyNTupleController::changeName,
138 "changeName ( DataSource, string ) -> None\n"
140 "Change the name of an NTuple.\n"
141 "This method is deprecated, there's not need to do this" )