This repository has been archived on 2026-03-28. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
eodev/eo/src/pyeo/valueParam.h
2006-01-23 15:12:49 +00:00

43 lines
925 B
C++

#ifndef VALUEPARAM_H
#define VALUEPARAM_H
#include <string>
#include <boost/python.hpp>
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<const char*>(s));
}
void setValue(const 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