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>
32 using namespace boost::python;
40 class_ < DataSource, bases<>,
43 "This class is an abstract base class defining the data table,\n"
44 "called an ntuple. That is a table with some number of columns and a\n"
45 "perhaps large number of rows. It implements some of the\n"
46 "but the actual data storage is done in a derived class.",
49 .add_property (
"columns",
50 &DataSource::columns )
52 .add_property (
"rows",
55 .def (
"getTitle", &DataSource::title,
56 return_value_policy < copy_const_reference > (),
57 "getTitle () -> string\n"
59 "Returns the title of the ntuple." )
61 .def (
"setName", &DataSource::setName,
62 "setName ( string ) -> None\n"
64 "Sets the name of the ntuple. The name should be a unique\n"
65 "string withing a running application. It may appear in the\n"
68 .def (
"setTitle", &DataSource::setTitle,
69 "setTitle ( string ) -> None\n"
71 "Sets the title of the ntuple. The title by default appears at\n"
72 "the top of a Display." )
74 .def (
"getLabels", &DataSource::getLabels,
75 return_value_policy < copy_const_reference > (),
76 "getLabels () -> list\n"
78 "Returns list of column labels." )
81 (
const std::vector < double > & (DataSource::* )
82 (
unsigned int )
const)
83 &DataSource::getColumn,
84 return_value_policy < copy_const_reference> (),
85 "getColumn ( label ) -> list\n"
86 "getColumn ( index ) -> list\n"
88 "Get a column by its label or index. Returns copy of the\n"
92 (
const std::vector < double > & (DataSource::* )
93 (
const std::string & )
const)
94 &DataSource::getColumn,
95 return_value_policy < copy_const_reference> () )
97 .def (
"replaceColumn",
98 (
void ( DataSource::* )
99 (
const std::string &,
100 const std::vector < double > & ) )
101 &DataSource::replaceColumn,
102 "replaceColumn ( label, list ) -> None\n"
104 "Replaces the column of data by abel." )
110 "Clears the data elements of the DataSource. That is, remove\n"
111 "all the rows while keeping the column labels." )