export_FunctionFactory.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 // include first to avoid _POSIX_C_SOURCE warning.
00027 #include <boost/python.hpp>
00028 
00029 #include "functions/FunctionBase.h"
00030 #include "functions/FunctionFactory.h"
00031 
00032 using std::vector;
00033 using namespace boost::python;
00034 
00035 namespace hippodraw {
00036 namespace Python {
00037 
00038 void 
00039 export_FunctionFactory()
00040 {
00041   class_ < FunctionFactory, bases<>,
00042     FunctionFactory, boost::noncopyable >
00043     ( "FunctionFactory",
00044       "The factory for creating derived classes of FunctionBase.",
00045       no_init )
00046 
00047     .def ( "instance",  &FunctionFactory::instance,
00048            return_value_policy < reference_existing_object >  (),
00049            "instance () -> FunctionFactory\n"
00050            "\n"
00051            "Returns the single instance of the FunctionFactory." )
00052 
00053     .staticmethod( "instance" )
00054 
00055     .def ( "names", &FunctionFactory::names,
00056            return_value_policy < copy_const_reference > (),
00057            "names () -> sequence\n"
00058            "\n"
00059            "Returns the names of the available FunctinBase derived classes." )
00060 
00061     .def ( "create", &FunctionFactory::create,
00062            return_value_policy < reference_existing_object > (),
00063            "create ( string ) -> FunctionBase\n"
00064            "\n"
00065            "Returns the newly created object derived from FunctionBase." )
00066 
00067     .def ( "add", &FunctionFactory::add,
00068            with_custodian_and_ward_postcall < 1, 2 > (),
00069            "add ( FunctionBase ) -> None\n"
00070            "\n"
00071            "Adds the function to the factory." )
00072 
00073     ;
00074 
00075 }
00076 
00077 } // namespace Python
00078 } // namespace hippodraw

Generated for HippoDraw Class Library by doxygen