PLaSK library
|
Base class for all Providers. More...
#include <plask/provider/provider.hpp>
Public Member Functions | |
virtual const char * | name () const |
Provider & | operator= (const Provider &)=delete |
Provider (const Provider &)=delete | |
Provider ()=default | |
virtual | ~Provider () |
Call onDisconnect for all listeners in listeners set. | |
void | fireChanged () |
Call onChange for all listeners. | |
Public Attributes | |
boost::signals2::signal< void(Provider &, bool)> | changed |
Signal called when providers value has been changed or provider is being deleted. | |
Static Public Attributes | |
static constexpr const char * | NAME = "undefined" |
Base class for all Providers.
It implements listener (observer) pattern (can be observed by Receiver).
Subclasses should only implement operator()(...) which returns provided value, or throw NoValue exception. Receiver (for given provider type) can be easy implemented by inherit Receiver class template.
Definition at line 190 of file provider.hpp.
|
default |
|
inlinevirtual |
Call onDisconnect for all listeners in listeners set.
Definition at line 206 of file provider.hpp.
|
inline |
Call onChange for all listeners.
Should be called after change of value represented by this provider.
Definition at line 214 of file provider.hpp.
Reimplemented in plask::SingleValueProvider< ValueT, ArgsT >, plask::SingleValueProvider< PropertyAt< PropertyT, SpaceT >::ValueType, _ExtraParams... >, plask::MultiValueProvider< ValueT, EnumT, ArgsT >, plask::MultiValueProvider< PropertyAt< PropertyT, SpaceT >::ValueType, PropertyT::EnumType, _ExtraParams... >, plask::FieldProvider< ValueT, SpaceT, ExtraArgs >, plask::FieldProvider< PropertyAt< PropertyT, SpaceT >::ValueType, SpaceT, _ExtraParams... >, plask::MultiFieldProvider< ValueT, SpaceT, EnumT, ExtraArgs >, plask::MultiFieldProvider< PropertyAt< PropertyT, SpaceT >::ValueType, SpaceT, PropertyT::EnumType, _ExtraParams... >, plask::ProviderImpl< PropertyT, SINGLE_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >, plask::ProviderImpl< PropertyT, MULTI_VALUE_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >, plask::ProviderImpl< PropertyT, FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >, and plask::ProviderImpl< PropertyT, MULTI_FIELD_PROPERTY, SpaceT, VariadicTemplateTypesHolder< _ExtraParams... > >.
Definition at line 193 of file provider.hpp.
Signal called when providers value has been changed or provider is being deleted.
Only in second case second parameter is true
.
Definition at line 203 of file provider.hpp.
Definition at line 192 of file provider.hpp.