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 "ListTuple.h"
00030
00031 using namespace boost::python;
00032
00033 namespace hippodraw {
00034 namespace Python {
00035
00036 void
00037 export_ListTuple()
00038 {
00039 class_ < ListTuple, bases < DataSource > >
00040 ( "ListTuple",
00041 "A derived class from DataSource containing columns as references to\n"
00042 "Python list objects. This allows the data to be used without making\n"
00043 "a copy of it. However, access to the data is slower than for most\n"
00044 "of the other classes derived from DataSource",
00045 init< >
00046 ( "ListTuple ( None ) -> ListTuple\n"
00047 "\n"
00048 "Creates an empty ListTuple" ) )
00049
00050
00051
00052 .def ( "setLabels", &ListTuple::setLabels,
00053 "setLabels ( list or tuple ) -> None\n"
00054 "\n"
00055 "Sets the labels of the columns from list of string objects.\n"
00056 "For an empty ListTuple object, implicitly sets the number of\n"
00057 "columns." )
00058
00059 .def ( "getLabel", &ListTuple::getLabelAt,
00060 return_value_policy < copy_const_reference > (),
00061 "getLabel ( index ) -> string\n"
00062 "\n"
00063 "Returns label of column." )
00064
00065
00066
00067
00068 .def ( "addColumn",
00069 &ListTuple::addColumn,
00070 with_custodian_and_ward < 1, 2 > (),
00071 "addColumn ( string, list ) -> value\n"
00072 "\n"
00073 "Adds the array as a new column with label from the string.\n"
00074 "Returns the index of the new column." )
00075
00076 .def ( "replaceColumn",
00077 ( void ( ListTuple:: * )
00078 ( unsigned int, boost::python::list ) )
00079 &ListTuple::replaceColumn,
00080 with_custodian_and_ward < 1, 2 > (),
00081 "replaceColumn ( index, list ) -> None\n"
00082 "\n"
00083 "Replaces existing column with list\n" )
00084
00085 .def ( "replaceColumn",
00086 ( void ( ListTuple:: * )
00087 ( const std::string &, boost::python::list ) )
00088 &ListTuple::replaceColumn,
00089 with_custodian_and_ward < 1, 2 > (),
00090 "replaceColumn ( string, list ) -> None\n"
00091 "\n"
00092 "Replaces existing column with new array\n" )
00093
00094 .def ( "notifyObservers",
00095 &ListTuple::notifyObservers,
00096 "notifyObservers ( None ) -> None\n"
00097 "\n"
00098 "Sends update message to all observers. Use this member if the\n"
00099 "contents of the reference Python list has changed and Display\n"
00100 "objects bound to it require updating." )
00101
00102 ;
00103 }
00104
00105 }
00106 }