Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

export_NumArrayTuple.cxx

Go to the documentation of this file.
00001 
00012 #ifdef _MSC_VER
00013 // nonstandard extension used 'extern' before...
00014 # pragma warning(disable:4231)  
00015 
00016 // needs to have dll-interface used by client
00017 # pragma warning(disable:4251)  
00018 
00019 // non dll-interface struct
00020 # pragma warning(disable:4275)  
00021 
00022 // 'int' : forcing value to bool 'true' or 'false' (performance warning)
00023 # pragma warning(disable:4800)  
00024 #endif
00025 
00026 #define PY_ARRAY_UNIQUE_SYMBOL PyArrayHandle
00027 #include "num_util.h"
00028 
00029 #include "NumArrayTuple.h"
00030 
00031 using namespace boost::python;
00032 
00033 namespace hippodraw {
00034 namespace Python {
00035 
00036 void
00037 export_NumArrayTuple()
00038 {
00039   import_array();
00040 
00041 #ifdef HAVE_NUMERIC
00042   numeric::array::set_module_and_type 
00043     ( "Numeric",
00044       "ArrayType" );
00045 #else
00046   numeric::array::set_module_and_type (); // default numarray & NDarray
00047 #endif
00048 
00049   class_ < NumArrayTuple, bases < DataSource > > ( "NumArrayTuple",
00050                 "Interface to numarray Python extension module.",
00051                  init< > ( "Creates an empty NumArrayTuple" ) )
00052 
00053 //     .add_property ( "rows", &NumArrayTuple::rows )
00054 
00055     .def ( "setLabels", &NumArrayTuple::setLabels,
00056            args ( "[label, ...]" ), 
00057            "Sets the labels of the columns." )
00058 
00059     .def ( "getLabel", &NumArrayTuple::getLabelAt,
00060            return_value_policy < copy_const_reference > () )
00061 
00062 //     .def ( "getLabels", &NumArrayTuple::getLabels,
00063 //         return_value_policy < copy_const_reference > () )
00064 
00065     .def ( "addColumn", 
00066            &NumArrayTuple::addColumn,
00067            "Addes the array as a new column with label" )
00068 
00069     .def ( "replaceColumn",
00070            ( void ( NumArrayTuple:: * ) //function pointer
00071              ( unsigned int, numeric::array ) ) // signature
00072            &NumArrayTuple::replaceColumn,
00073            "Replaces existing column with new array\n"
00074            "Args:\n"
00075            "\t index\n"
00076            "\t numarray" )
00077 
00078     .def ( "replaceColumn",
00079            ( void ( NumArrayTuple:: * ) //function pointer
00080              ( const std::string &, numeric::array ) ) // signature
00081            &NumArrayTuple::replaceColumn,
00082            "Replaces existing column with new array\n"
00083            "Args:\n"
00084            "\t label\n"
00085            "\t numarray" )
00086 
00087     .def ( "notifyObservers",
00088            &NumArrayTuple::notifyObservers,
00089            "Sends update message to all observers." )
00090 
00091     ;
00092 }
00093 
00094 } // namespace Python
00095 } // namespace hippodraw

Generated for HippoDraw-1.14.8.5 by doxygen 1.4.3