22#include <boost/thread.hpp>
25#include <jevois/Component/details/ParameterHelpers.H>
135 virtual std::string
const &
name()
const = 0;
143 virtual void strset(std::string
const & valstring) = 0;
146 virtual std::string
const strget()
const = 0;
179 virtual void callbackInitCall() = 0;
183#ifndef JEVOIS_DOXYGEN
202 template <
typename T>
214 virtual std::string
const &
name()
const override;
225 void set(T
const & newVal);
229 virtual void strset(std::string
const & valstring)
override;
232 virtual std::string
const strget()
const override;
269 void callbackInitCall()
override;
271 std::function<void(T
const &)> itsCallback;
413 template <
class Param,
class ... Tail>
414 class Parameter<Param, Tail ...> :
public Param,
public Parameter<Tail ...>
416 static_assert(std::is_base_of<jevois::ParameterBase, Param>::value,
417 "jevois::Parameter<...> template arguments must all be parameters "
418 "(derive from jevois::ParameterBase");
427 template <
typename T>
A component of a model hierarchy.
Dynamic parameter added to a component at runtime.
DynamicParameter(Component *comp, ParameterDef< T > const &pdef)
Constructor.
DynamicParameter< T > type
Our type.
virtual Component const * owner() const override
Handle to owning component.
virtual ~DynamicParameter()
Destructor.
Base class for Parameter.
virtual std::string const & name() const =0
Get the parameter name.
volatile bool itsFrozen
When true, parameter is frozen (read-only)
virtual void reset()=0
Reset this parameter to its default value.
virtual std::string descriptor() const =0
Get the parameter fully-qualified name, aka descriptor, including names of owning Component and all p...
virtual void strset(std::string const &valstring)=0
Set the value from a string representation of it.
volatile bool itsHidden
When true, parameter is hidden (not visible in GUI or help message)
bool itsVirgin
Param has not yet been explicitly set, need to call the callback (if any) at init time.
boost::shared_mutex itsMutex
Mutex to protect the parameter value.
void hide(bool doit)
Hide or un-hide a parameter; hidden params will not show up in GUI or help message,...
virtual ~ParameterBase()
Destructor, will remove the parameter from its owner component.
bool hidden() const
Returns whether parameter is hidden.
virtual ParameterSummary const summary() const =0
Get summary info about this parameter.
virtual std::string const strget() const =0
Get the value as a string.
bool frozen() const
Returns whether parameter is frozen.
void freeze(bool doit)
Freeze or un-freeze a parameter; frozen parameters cannot be set(), but get() is still allowed.
ParameterBase()
Constructor.
A changeable parameter for a Component, core class.
virtual std::string const strget() const override
Get the value as a string representation of it.
virtual void strset(std::string const &valstring) override
Set the value from a string representation of it.
ParameterCore(ParameterDef< T > const &def)
Constructor.
ParameterDef< T > const & def() const
Access to our parameter def.
void set(T const &newVal)
Set the value of this Parameter.
virtual ~ParameterCore()
Destructor.
void changeParameterDef(ParameterDef< T > const &def)
Change the ParameterDef of this parameter.
virtual std::string const & name() const override
Get the parameter name.
virtual std::string descriptor() const override
Get the parameter fully-qualified name, aka descriptor.
virtual void reset() override
Reset this parameter to its default value.
T get() const
Get the value of this Parameter.
virtual ParameterSummary const summary() const override
Get summary info about this parameter.
virtual Component const * owner() const =0
Get the Component to which this Parameter is attached, or nullptr (individual parameters must overrid...
void setCallback(std::function< void(T const &)> cb)
Set the parameter's callback.
A simple registry of all parameters associated with a Component.
ParameterSummary provides a summary about a parameter.
std::string name
Plain name of the parameter.
std::string category
Category of the parameter, as a string.
std::string categorydescription
Category description.
std::string descriptor
Descriptor. This is the name of the parameter, qualified by a chain of component names.
std::string valuetype
Parameter value type, as a string.
std::string value
Current value of the parameter, as a string.
std::string validvalues
Description of the parameter's valid values specification, as a string.
std::string defaultvalue
Default value of the parameter, as a string.
bool frozen
Flag that indicates whether parameter is frozen.
bool hidden
Flag that indicates whether parameter is hidden.
std::string description
Description of the parameter.
Main namespace for all JeVois classes and functions.