00001
00012 #ifdef _MSC_VER
00013
00014 # pragma warning(disable:4231)
00015
00016
00017 # pragma warning(disable:4251)
00018
00019
00020 # pragma warning(disable:4275)
00021
00022
00023 # pragma warning(disable:4800)
00024 #endif
00025
00026 #include "datasrcs/CircularBuffer.h"
00027 #include "datasrcs/NTupleController.h"
00028
00029 #include <boost/python.hpp>
00030
00031 using std::vector;
00032 using namespace boost::python;
00033
00034 namespace hippodraw {
00035 namespace Python {
00036
00039 void
00040 export_NTupleController()
00041 {
00042 class_ < NTupleController, bases<>,
00043 NTupleController, boost::noncopyable >
00044 ( "NTupleController",
00045 "A singleton object to manage NTuple objects.",
00046 no_init )
00047
00048 .def ( "instance", &NTupleController::instance,
00049 return_value_policy < reference_existing_object > (),
00050 "instance () -> NTupleController\n"
00051 "\n"
00052 "Returns the single instance of the controller" )
00053
00054 .staticmethod( "instance" )
00055
00056 .def ( "createNTuple",
00057 ( NTuple * ( NTupleController::* )
00058 ( ) )
00059 &NTupleController::createNTuple,
00060 return_value_policy < manage_new_object > (),
00061 "Creates an empty NTuple" )
00062
00063 .def ( "createNTuple",
00064 ( DataSource * ( NTupleController::* )
00065 ( const std::string & ) )
00066 &NTupleController::createNTuple,
00067 return_value_policy < manage_new_object > (),
00068 "createNTuple () -> NTuple\n"
00069 "createNTuple ( string ) -> NTuple\n"
00070 "\n"
00071 "Creates and registers an NTuple. The first method creates an\n"
00072 "empty NTuple object. The second method creates one from a\n"
00073 "file. Both methods return ownership of the created object to\n"
00074 "Python." )
00075
00076 .def ( "createCircularBuffer",
00077 ( CircularBuffer * ( NTupleController::* )
00078 ( unsigned int ) )
00079 & NTupleController::createCircularBuffer,
00080 return_value_policy < manage_new_object > (),
00081 "createCircularBuffer ( value ) -> CircularBuffer\n"
00082 "\n"
00083 "Creates and registers a CircularBuffer object with set number of\n"
00084 "columns." )
00085
00086 .def ( "registerNTuple",
00087 ( std::string ( NTupleController:: * )
00088 ( DataSource * ) )
00089 & NTupleController::registerNTuple,
00090 "Register an NTuple to make it visible to the application" )
00091
00092 .def ( "registerNTuple",
00093 ( void ( NTupleController:: * )
00094 ( const std::string &, DataSource * ) )
00095 & NTupleController::registerNTuple,
00096 "registerNTuple ( DataSource ) -> None\n"
00097 "registerNTuple ( string, DataSource ) -> None\n"
00098 "\n"
00099 "Register an NTuple to make it visible to the application. The\n"
00100 "first form takes the name from the DataSource object, if it has\n"
00101 "one, otherwise generates a unique name. The second form takes\n"
00102 "string argument for the name." )
00103
00104 .def ( "writeToFile",
00105 ( int ( NTupleController:: * )
00106 ( DataSource *, const std::string & ) )
00107 & NTupleController::writeNTupleToFile,
00108 "writeToFile ( DataSource, string ) -> value\n"
00109 "\n"
00110 "Writes the NTuple to a file as ASCII text. Returns 0 if\n"
00111 "successful." )
00112
00113 .def ( "findNTuple",
00114 ( DataSource * ( NTupleController:: * )
00115 ( const std::string & ) const )
00116 & NTupleController::findDataSource,
00117 return_value_policy < reference_existing_object > (),
00118 "findNTuple ( string ) -> DataSource\n"
00119 "\n"
00120 "Find an registered NTuple by its name and returns it." )
00121
00122 .def ( "changeName",
00123 ( void ( NTupleController:: * )
00124 ( DataSource *, const std::string & ) )
00125 & NTupleController::changeName,
00126 "changeName ( DataSource, string ) -> None\n"
00127 "\n"
00128 "Change the name of an NTuple.\n"
00129 "This method is deprecated, there's not need to do this" )
00130
00131 ;
00132
00133 }
00134
00135 }
00136 }