19#ifndef RTC_CONFIGURATIONLISTENER_H
20#define RTC_CONFIGURATIONLISTENER_H
22#include <coil/Properties.h>
104 static const char*
const typeString[] =
106 "ON_UPDATE_CONFIG_PARAM",
107 "CONFIG_PARAM_LISTENER_NUM"
109 return typeString[
static_cast<uint8_t
>(type)];
139 const char* config_param_name) = 0;
221 static const char*
const typeString[] =
225 "CONFIG_SET_LISTENER_NUM"
227 return typeString[
static_cast<uint8_t
>(type)];
256 virtual void operator()(
const coil::Properties& config_set) = 0;
334 static const char*
const typeString[] =
336 "ON_UPDATE_CONFIG_SET",
337 "ON_REMOVE_CONFIG_SET",
338 "ON_ACTIVATE_CONFIG_SET",
339 "CONFIG_SET_NAME_LISTENER_NUM"
341 return typeString[
static_cast<uint8_t
>(type)];
392 using Entry = std::pair<ConfigurationParamListener*, bool>;
472 void notify(
const char* config_set_name,
const char* config_param_name);
475 std::vector<Entry> m_listeners;
499 using Entry = std::pair<ConfigurationSetListener*, bool>;
579 void notify(
const coil::Properties& config_set);
582 std::vector<Entry> m_listeners;
606 using Entry = std::pair<ConfigurationSetNameListener*, bool>;
685 void notify(
const char* config_set_name);
688 std::vector<Entry> m_listeners;
886 if (
static_cast<uint8_t
>(type) < configparam_.size())
888 configparam_[
static_cast<uint8_t
>(type)].
notify(config_set_name, config_param_name);
915 if (
static_cast<uint8_t
>(type) < configset_.size())
917 configset_[
static_cast<uint8_t
>(type)].
notify(config_set);
944 if (
static_cast<uint8_t
>(type) < configsetname_.size())
946 configsetname_[
static_cast<uint8_t
>(type)].
notify(config_set_name);
Definition ConfigurationListener.h:707
bool removeListener(ConfigurationSetNameListenerType type, ConfigurationSetNameListener *listener)
Remove the listener.
bool notify(ConfigurationParamListenerType type, const char *config_set_name, const char *config_param_name)
Definition ConfigurationListener.h:884
bool removeListener(ConfigurationParamListenerType type, ConfigurationParamListener *listener)
Remove the listener.
bool notify(ConfigurationSetNameListenerType type, const char *config_set_name)
Definition ConfigurationListener.h:942
bool addListener(ConfigurationParamListenerType type, ConfigurationParamListener *listener, bool autoclean=true)
Add the listener.
bool addListener(ConfigurationSetListenerType type, ConfigurationSetListener *listener, bool autoclean=true)
Add the listener.
bool notify(ConfigurationSetListenerType type, const coil::Properties &config_set)
Definition ConfigurationListener.h:913
~ConfigurationListeners()
Destructor .
bool addListener(ConfigurationSetNameListenerType type, ConfigurationSetNameListener *listener, bool autoclean=true)
Add the listener.
bool removeListener(ConfigurationSetListenerType type, ConfigurationSetListener *listener)
Remove the listener.
ConfigurationParamListener holder class.
Definition ConfigurationListener.h:391
void notify(const char *config_set_name, const char *config_param_name)
Notify listeners.
ConfigurationParamListenerHolder()
Constructor .
void removeListener(ConfigurationParamListener *listener)
Remove the listener.
virtual ~ConfigurationParamListenerHolder()
Destructor .
void addListener(ConfigurationParamListener *listener, bool autoclean)
Add the listener.
ConfigurationParamListener class.
Definition ConfigurationListener.h:75
virtual void operator()(const char *config_set_name, const char *config_param_name)=0
Virtual Callback function.
static const char * toString(ConfigurationParamListenerType type)
Convert ConfigurationParamListenerType into the string.
Definition ConfigurationListener.h:100
virtual ~ConfigurationParamListener()
Destructor .
ConfigurationSetListener holder class.
Definition ConfigurationListener.h:498
void notify(const coil::Properties &config_set)
Notify listeners.
void removeListener(ConfigurationSetListener *listener)
Remove the listener.
void addListener(ConfigurationSetListener *listener, bool autoclean)
Add the listener.
ConfigurationSetListenerHolder()
Constructor .
virtual ~ConfigurationSetListenerHolder()
Destructor .
ConfigurationSetListener class.
Definition ConfigurationListener.h:191
virtual ~ConfigurationSetListener()
Destructor .
static const char * toString(ConfigurationSetListenerType type)
Convert ConfigurationSetNameListenerType into the string.
Definition ConfigurationListener.h:217
virtual void operator()(const coil::Properties &config_set)=0
Virtual Callback function.
ConfigurationSetNameListener holder class.
Definition ConfigurationListener.h:605
void addListener(ConfigurationSetNameListener *listener, bool autoclean)
Add the listener.
void removeListener(ConfigurationSetNameListener *listener)
Remove the listener.
virtual ~ConfigurationSetNameListenerHolder()
Destructor .
void notify(const char *config_set_name)
Notify listeners.
ConfigurationSetNameListenerHolder()
Constructor .
ConfigurationSetNameListener class.
Definition ConfigurationListener.h:304
static const char * toString(ConfigurationSetNameListenerType type)
Convert ConfigurationSetNameListenerType into the string.
Definition ConfigurationListener.h:330
virtual void operator()(const char *config_set_name)=0
Virtual Callback function.
virtual ~ConfigurationSetNameListener()
Destructor .
ConfigurationSetNameListenerType
The types of ConfigurationSetNameListener.
Definition ConfigurationListener.h:272
@ CONFIG_SET_NAME_LISTENER_NUM
ConfigurationSetListenerType
The types of ConfigurationSetListener.
Definition ConfigurationListener.h:161
@ CONFIG_SET_LISTENER_NUM
ConfigurationParamListenerType
The types of ConnectorDataListener.
Definition ConfigurationListener.h:46
@ CONFIG_PARAM_LISTENER_NUM