Information about a Service Listener. More...
Public Member Functions | |
ListenerInfo () | |
ListenerInfo (const ListenerInfo &other) | |
~ListenerInfo () | |
ListenerInfo & | operator= (const ListenerInfo &other) |
bool | IsNull () const |
Can be used to check if this ListenerInfo instance is valid, or if it has been constructed using the default constructor. More... | |
ModuleContext * | GetModuleContext () const |
Return the context of the module which added the listener. More... | |
std::string | GetFilter () const |
Return the filter string with which the listener was added. More... | |
bool | IsRemoved () const |
Return the state of the listener for this addition and removal life cycle. More... | |
bool | operator== (const ListenerInfo &other) const |
Compares this ListenerInfo to another ListenerInfo . More... | |
Information about a Service Listener.
This class describes the module which added the Service Listener and the filter with which it was added.
ServiceListenerHook::ListenerInfo::ListenerInfo | ( | ) |
ServiceListenerHook::ListenerInfo::ListenerInfo | ( | const ListenerInfo & | other | ) |
ServiceListenerHook::ListenerInfo::~ListenerInfo | ( | ) |
std::string ServiceListenerHook::ListenerInfo::GetFilter | ( | ) | const |
Return the filter string with which the listener was added.
ModuleContext* ServiceListenerHook::ListenerInfo::GetModuleContext | ( | ) | const |
Return the context of the module which added the listener.
bool ServiceListenerHook::ListenerInfo::IsNull | ( | ) | const |
Can be used to check if this ListenerInfo instance is valid, or if it has been constructed using the default constructor.
true
if this listener object is valid, false
otherwise. bool ServiceListenerHook::ListenerInfo::IsRemoved | ( | ) | const |
Return the state of the listener for this addition and removal life cycle.
Initially this method will return false
indicating the listener has been added but has not been removed. After the listener has been removed, this method must always returns true
.
There is an extremely rare case in which removed notification to ServiceListenerHooks can be made before added notification if two threads are racing to add and remove the same service listener. Because ServiceListenerHooks are called synchronously during service listener addition and removal, the CppMicroServices library cannot guarantee in-order delivery of added and removed notification for a given service listener. This method can be used to detect this rare occurrence.
false
if the listener has not been been removed, true
otherwise. ListenerInfo& ServiceListenerHook::ListenerInfo::operator= | ( | const ListenerInfo & | other | ) |
bool ServiceListenerHook::ListenerInfo::operator== | ( | const ListenerInfo & | other | ) | const |
Compares this ListenerInfo
to another ListenerInfo
.
Two
s are equal if they refer to the same listener for a given addition and removal life cycle. If the same listener is added again, it will have a different ListenerInfo
which is not equal to this ListenerInfo
.
other | The object to compare against this ListenerInfo . |
true
if the other object is a ListenerInfo
object and both objects refer to the same listener for a given addition and removal life cycle.