JeVois
1.20
JeVois Smart Embedded Machine Vision Toolkit
|
Share this page: |
|
|
|
|
|
|
Go to the documentation of this file.
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;
81 void setCallback(boost::python::object
const & cb)
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);
148 void setCallback(boost::python::object
const & cb);
151 std::shared_ptr<jevois::python::PyParHelperBase> itsPyPar;
159 #include <jevois/Core/details/PythonParameterImpl.H>
Base helper class to allow creation of Parameter in python.
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.
virtual void set(boost::python::object const &val)=0
Set the value from python object that should contain a value of the correct type.
std::shared_ptr< jevois::ParameterBase > par() const override
Access the associated C++ base parameter, used to forward strget(), strset(), freeze(),...
const std::string strget() const
Get the value as a string.
void set(boost::python::object const &newVal)
Set the value of this Parameter.
PyParHelperBase(jevois::Component *comp)
Constructor.
PythonParameter(boost::python::object &pyinst, std::string const &name, std::string const &typ, std::string const &description, boost::python::object const &defaultValue, jevois::ParameterCategory const &category)
Constructor. Adds a dynamic parameter to the Component associated with pyinst.
const std::string & name() const
Get the parameter name.
void setCallback(boost::python::object const &cb) override
Set the parameter's callback.
A component of a model hierarchy.
void freeze(bool doit)
Freeze/unfreeze this parameter, it becomes read-only and will not show up in the help message.
~PythonParameter()
Destructor. Removes the dynamic parameter from the associated Component.
boost::python::object itsPyCallback
A category to which multiple ParameterDef definitions can belong.
virtual ~PyParHelper()
Remove param from component.
void strset(std::string const &valstring)
Set the value from a string representation of it.
jevois::Component * comp() const
Access the associated C++ Component.
boost::python::object get() const
Get the value of this Parameter.
void setCallback(boost::python::object const &cb)
Set the parameter's callback.
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.
virtual boost::python::object get()=0
Get the value, typed, then wrapped into python object.
void reset()
Reset this parameter to its default value.
std::shared_ptr< jevois::DynamicParameter< T > > itsParam
virtual void setCallback(boost::python::object const &cb)=0
Set the parameter's callback.
virtual ~PyParHelperBase()
Remove param from component.
boost::python::object get() override
Get the value, typed, then wrapped into python object.
Wrapper for jevois Parameter in python.
void set(boost::python::object const &val) override
Set the value from python object.
std::string descriptor() const
Get the parameter fully-qualified name, aka descriptor, including names of owning Component and all p...
Typed class to allow creation of Parameter in Python.
virtual std::shared_ptr< jevois::ParameterBase > par() const =0
Access the associated C++ base Parameter.