From 395ca20a5cd6740fea2dbe9a978ada6bc19cc057 Mon Sep 17 00:00:00 2001 From: maartenkeijzer Date: Tue, 14 Jan 2003 10:09:28 +0000 Subject: [PATCH] added missing valueparm.h" --- eo/src/pyeo/valueParam.h | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 eo/src/pyeo/valueParam.h diff --git a/eo/src/pyeo/valueParam.h b/eo/src/pyeo/valueParam.h new file mode 100644 index 00000000..4ca7f61b --- /dev/null +++ b/eo/src/pyeo/valueParam.h @@ -0,0 +1,43 @@ +#ifndef VALUEPARAM_H +#define VALUEPARAM_H + +#include +#include + +class ValueParam : public eoParam // ValueParam containing python object +{ + boost::python::object obj; + + public: + + ValueParam() : eoParam(), obj() {} + + ValueParam(boost::python::object o, + std::string longName, + std::string d = "No Description", + char s = 0, + bool r = false) : eoParam(longName, "", d, s, r) + { + std::cerr << "HI" << std::endl; + obj = o; + eoParam::defValue(getValue()); + } + + + std::string getValue() const + { + boost::python::str s = boost::python::str(obj); + return std::string(boost::python::extract(s)); + } + + void setValue(std::string v) + { + std::cerr << "not implemented yet" << std::endl; + } + + boost::python::object getObj() const { return obj;} + void setObj(boost::python::object o) { obj = o; } + +}; + +#endif