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/DataSource.h"
00027
00028 #include <boost/python.hpp>
00029
00030 using std::vector;
00031 using namespace boost::python;
00032
00033 namespace hippodraw {
00034 namespace Python {
00035
00036 void
00037 export_DataSource()
00038 {
00039 class_ < DataSource, bases<>,
00040 DataSource, boost::noncopyable >
00041 ( "DataSource",
00042 "This class is an abstract base class defining the data table,\n"
00043 "called an ntuple. That is a table with some number of columns and a\n"
00044 "perhaps large number of rows. It implements some of the\n"
00045 "but the actual data stroage is done in a derived class.",
00046 no_init )
00047
00048 .add_property ( "columns",
00049 &DataSource::columns )
00050
00051 .add_property ( "rows",
00052 &DataSource::rows )
00053
00054 .def ( "getTitle", &DataSource::title,
00055 return_value_policy < copy_const_reference > (),
00056 "getTitle () -> string\n"
00057 "\n"
00058 "Returns the title of the ntuple." )
00059
00060 .def ( "setName", &DataSource::setName,
00061 "setName ( string ) -> None\n"
00062 "\n"
00063 "Sets the name of the ntuple. The name should be a unique\n"
00064 "string withing a running application. It may appear in the\n"
00065 "Inspector." )
00066
00067 .def ( "setTitle", &DataSource::setTitle,
00068 "setTitle ( string ) -> None\n"
00069 "\n"
00070 "Sets the title of the ntuple. The title by default appears at\n"
00071 "the top of a Display." )
00072
00073 .def ( "getLabels", &DataSource::getLabels,
00074 return_value_policy < copy_const_reference > (),
00075 "getLabels () -> list\n"
00076 "\n"
00077 "Returns list of column labels." )
00078
00079 .def ( "getColumn",
00080 ( const std::vector < double > & (DataSource::* )
00081 ( unsigned int ) const)
00082 &DataSource::getColumn,
00083 return_value_policy < copy_const_reference> (),
00084 "getColumn ( label ) -> list\n"
00085 "getColumn ( index ) -> list\n"
00086 "\n"
00087 "Get a column by its label or index. Returns copy of the\n"
00088 "contents." )
00089
00090 .def ( "getColumn",
00091 ( const std::vector < double > & (DataSource::* )
00092 ( const std::string & ) const)
00093 &DataSource::getColumn,
00094 return_value_policy < copy_const_reference> () )
00095
00096 .def ( "clear",
00097 &DataSource::clear,
00098 "clear () -> None\n"
00099 "\n"
00100 "Clears the data elements of the DataSource. That is, remove\n"
00101 "all the rows while keeping the column labels." )
00102
00103 ;
00104 }
00105
00106 }
00107 }