00001 /* -*- c++ -*- */ 00002 00014 #ifndef FunctionWrap_H 00015 #define FunctionWrap_H 00016 00017 #include "functions/FunctionBase.h" 00018 00019 namespace hippodraw { 00020 00030 class FunctionWrap : public FunctionBase, 00031 public boost::python::wrapper < FunctionBase > 00032 { 00033 private: 00034 00037 boost::python::object invert_ownership; 00038 00041 template < class T > 00042 boost::python::object get_owner ( T * me ) const; 00043 00044 public: 00045 00048 FunctionWrap ( const FunctionBase & base ); 00049 00052 FunctionWrap ( const FunctionWrap & ); 00053 00056 FunctionWrap (); 00057 00060 virtual ~FunctionWrap (); 00061 00062 00065 void setName ( const std::string & name ); 00066 00070 void setParmNames ( const std::vector < std::string > & names ); 00071 double derivByParm ( int, double ) const; 00072 void initialize (); 00073 00088 FunctionBase * clone () const; 00089 00090 double operator () ( double ) const; 00091 double operator () ( const std::vector < double > & ) const; 00092 void initialParameters ( const FunctionHelper * ); 00093 00094 unsigned int dimensions () const; 00095 00099 virtual bool hasDerivatives () const; 00100 00101 }; 00102 00103 } // namespace hippodraw 00104 00105 00106 #endif // FunctionWrap_H