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
00027 #include <boost/python.hpp>
00028
00029 #include "root/QtRootController.h"
00030 #include "root/RootController.h"
00031 #include "root/QtRootNTuple.h"
00032
00033 #include "python/PyDataSource.h"
00034
00035 using std::vector;
00036 using namespace boost::python;
00037
00038 namespace hippodraw {
00039 namespace Python {
00040
00041 void
00042 export_RootController()
00043 {
00044 class_ < QtRootController, bases<>,
00045 QtRootController, boost::noncopyable >
00046 ( "RootController",
00047 "The RootController class provides interface to ROOT ntuple files.",
00048 no_init )
00049
00050 .def ( "instance", &QtRootController::instance,
00051 return_value_policy < reference_existing_object > (),
00052 "instance () -> RootController\n"
00053 "\n"
00054 "Returns the singleton instance of the controller." )
00055
00056 .staticmethod( "instance" )
00057
00058 .def ( "getNTupleNames",
00059 &QtRootController::getNTupleNames,
00060 return_value_policy < copy_const_reference > (),
00061 "getNTupleNames ( filename ) -> list\n"
00062 "\n"
00063 "Returns a list of names of the possible DataSource objects in\n"
00064 "the ROOT file. That is, the top level TTree names." )
00065
00066 .def ( "createNTuple",
00067 &QtRootController::createNTuple,
00068 return_value_policy < manage_new_object > (),
00069 "createNTuple ( filename, treename ) -> RootNTuple\n"
00070 "\n"
00071 "Creates a RootNTuple from the named file and named tree. Python\n"
00072 "take possession of the object.\n"
00073 "Consider createDataArray() instead, if the hippo module was \n"
00074 "configured with numerical array support." )
00075
00076 .def ( "createDataArray",
00077 &QtRootController::createDataArray,
00078 return_value_policy < manage_new_object > (),
00079 "createDataArray ( filename, treename ) -> DataArray\n"
00080 "\n"
00081 "Creates a DataArray object containing a RootNTuple from the\n"
00082 "named ROOT file and named tree. Returns a reference to it." )
00083 ;
00084
00085 }
00086
00087 }
00088 }