PLaSK library
Loading...
Searching...
No Matches
plask::Provider Struct Reference

Base class for all Providers. More...

#include <plask/provider/provider.hpp>

Inheritance diagram for plask::Provider:
[legend]
Collaboration diagram for plask::Provider:
[legend]

Public Member Functions

virtual const charname () const
 
Provideroperator= (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 charNAME = "undefined"
 

Detailed Description

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.

See also
Providers and receivers

Definition at line 190 of file provider.hpp.

Constructor & Destructor Documentation

◆ Provider() [1/2]

plask::Provider::Provider ( const Provider )
delete

◆ Provider() [2/2]

plask::Provider::Provider ( )
default

◆ ~Provider()

virtual plask::Provider::~Provider ( )
inlinevirtual

Call onDisconnect for all listeners in listeners set.

Definition at line 206 of file provider.hpp.

Member Function Documentation

◆ fireChanged()

void plask::Provider::fireChanged ( )
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.

◆ name()

◆ operator=()

Provider & plask::Provider::operator= ( const Provider )
delete

Member Data Documentation

◆ changed

boost::signals2::signal<void(Provider&, bool)> plask::Provider::changed

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.

◆ NAME

constexpr const char* plask::Provider::NAME = "undefined"
staticconstexpr

Definition at line 192 of file provider.hpp.


The documentation for this struct was generated from the following file: