22#include <boost/thread.hpp>
25#include <jevois/Component/details/ParameterHelpers.H>
132 virtual std::string
const &
name()
const = 0;
140 virtual void strset(std::string
const & valstring) = 0;
143 virtual std::string
const strget()
const = 0;
169 virtual void callbackInitCall() = 0;
173#ifndef JEVOIS_DOXYGEN
192 template <
typename T>
204 virtual std::string
const &
name()
const override;
215 void set(T
const & newVal);
219 virtual void strset(std::string
const & valstring)
override;
222 virtual std::string
const strget()
const override;
259 void callbackInitCall()
override;
261 std::function<void(T
const &)> itsCallback;
403 template <
class Param,
class ... Tail>
404 class Parameter<Param, Tail ...> :
public Param,
public Parameter<Tail ...>
406 static_assert(std::is_base_of<jevois::ParameterBase, Param>::value,
407 "jevois::Parameter<...> template arguments must all be parameters "
408 "(derive from jevois::ParameterBase");
417 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, does not show up in help message)
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.
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.
virtual ~ParameterBase()
Destructor, will remove the parameter from its owner component.
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.
std::string description
Description of the parameter.
Main namespace for all JeVois classes and functions.