21#include <boost/python.hpp>
38 virtual boost::python::object
get() = 0;
41 virtual void set(boost::python::object
const & val) = 0;
44 virtual void setCallback(boost::python::object
const & cb) = 0;
47 virtual std::shared_ptr<jevois::ParameterBase>
par()
const = 0;
63 static std::shared_ptr<jevois::python::PyParHelperBase>
75 boost::python::object
get()
override;
78 void set(boost::python::object
const & val)
override;
84 std::shared_ptr<jevois::ParameterBase>
par()
const override;
87 std::shared_ptr<jevois::DynamicParameter<T>>
itsParam;
101 PythonParameter(boost::python::object & pyinst, std::string
const &
name, std::string
const & typ,
102 std::string
const & description, boost::python::object
const & defaultValue,
109 std::string
const &
name()
const;
115 boost::python::object
get()
const;
119 void set(boost::python::object
const & newVal);
122 std::string
const strget()
const;
127 void strset(std::string
const & valstring);
151 void setCallback(boost::python::object
const & cb);
154 std::shared_ptr<jevois::python::PyParHelperBase> itsPyPar;
162#include <jevois/Core/details/PythonParameterImpl.H>
A component of a model hierarchy.
Wrapper for jevois Parameter in python.
std::string const & name() const
Get the parameter name.
void set(boost::python::object const &newVal)
Set the value of this Parameter.
std::string const strget() const
Get the value as a string.
void strset(std::string const &valstring)
Set the value from a string representation of it.
void reset()
Reset this parameter to its default value.
bool frozen() const
Returns whether parameter is frozen.
boost::python::object get() const
Get the value of this Parameter.
void freeze(bool doit)
Freeze/unfreeze this parameter, it becomes read-only and will not show up in the help message.
void setCallback(boost::python::object const &cb)
Set the parameter's callback.
~PythonParameter()
Destructor. Removes the dynamic parameter from the associated Component.
std::string descriptor() const
Get the parameter fully-qualified name, aka descriptor, including names of owning Component and all p...
Base helper class to allow creation of Parameter in python.
jevois::Component * comp() const
Access the associated C++ Component.
virtual void setCallback(boost::python::object const &cb)=0
Set the parameter's callback.
virtual std::shared_ptr< jevois::ParameterBase > par() const =0
Access the associated C++ base Parameter.
virtual ~PyParHelperBase()
Remove param from component.
virtual void set(boost::python::object const &val)=0
Set the value from python object that should contain a value of the correct type.
virtual boost::python::object get()=0
Get the value, typed, then wrapped into python object.
Typed class to allow creation of Parameter in Python.
virtual ~PyParHelper()
Remove param from component.
std::shared_ptr< jevois::DynamicParameter< T > > itsParam
boost::python::object get() override
Get the value, typed, then wrapped into python object.
void setCallback(boost::python::object const &cb) override
Set the parameter's callback.
void set(boost::python::object const &val) override
Set the value from python object.
PyParHelper(jevois::Component *comp, std::string const &name, std::string const &description, boost::python::object const &defaultValue, jevois::ParameterCategory const &category)
Create and add the parameter to the component.
static std::shared_ptr< jevois::python::PyParHelperBase > create(jevois::Component *comp, std::string const &name, std::string const &description, boost::python::object const &defaultValue, jevois::ParameterCategory const &category)
Create and add the parameter to the component.
boost::python::object itsPyCallback
std::shared_ptr< jevois::ParameterBase > par() const override
Access the associated C++ base parameter, used to forward strget(), strset(), freeze(),...
Main namespace for all JeVois classes and functions.
A category to which multiple ParameterDef definitions can belong.