00001 /* -*- c++ -*- */ 00002 00014 #ifndef FunctionWrap_H 00015 #define FunctionWrap_H 00016 00017 #ifndef BOOST_DEFECT 00018 #include "functions/FunctionBase.h" 00019 00020 #include <boost/python.hpp> 00021 00033 class FunctionWrap : public FunctionBase, 00034 public boost::python::wrapper < FunctionBase > 00035 { 00036 private: 00037 00040 boost::python::object invert_ownership; 00041 00044 template < class T > 00045 boost::python::object get_owner ( T * me ) const; 00046 00047 public: 00048 00051 FunctionWrap ( const FunctionBase & base ); 00052 00055 FunctionWrap ( const FunctionWrap & ); 00056 00059 FunctionWrap (); 00060 00063 virtual ~FunctionWrap (); 00064 00065 00068 void setName ( const std::string & name ); 00069 00073 void setParmNames ( const std::vector < std::string > & names ); 00074 double derivByParm ( int, double ) const; 00075 void initialize (); 00076 00079 FunctionBase * clone () const; 00080 00081 double operator () ( double ) const; 00082 double operator () ( const std::vector < double > & ) const; 00083 void initialParameters ( const FunctionHelper * ); 00084 }; 00085 00086 #endif // BOOST_DEFECT 00087 #endif // FunctionWrap_H