Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
us::ServiceListenerHook::ListenerInfo Struct Reference

Information about a Service Listener. This class describes the module which added the Service Listener and the filter with which it was added. More...

#include <usServiceListenerHook.h>

Public Member Functions

 ListenerInfo ()
 Default constructor. Creates an invalid ListenerInfo instance. More...
 
 ListenerInfo (const ListenerInfo &other)
 Copy constructor. More...
 
 ~ListenerInfo ()
 Destructor. More...
 
ListenerInfo & operator= (const ListenerInfo &other)
 Copy assignment operator. More...
 
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. 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. More...
 
bool operator== (const ListenerInfo &other) const
 Compares this ListenerInfo to another ListenerInfo. Two. More...
 

Detailed Description

Information about a Service Listener. This class describes the module which added the Service Listener and the filter with which it was added.

Remarks
This class is not intended to be implemented by clients.

Definition at line 49 of file usServiceListenerHook.h.

Constructor & Destructor Documentation

◆ ListenerInfo() [1/2]

us::ServiceListenerHook::ListenerInfo::ListenerInfo ( )

Default constructor. Creates an invalid ListenerInfo instance.

◆ ListenerInfo() [2/2]

us::ServiceListenerHook::ListenerInfo::ListenerInfo ( const ListenerInfo &  other)

Copy constructor.

◆ ~ListenerInfo()

us::ServiceListenerHook::ListenerInfo::~ListenerInfo ( )

Destructor.

Member Function Documentation

◆ GetFilter()

std::string us::ServiceListenerHook::ListenerInfo::GetFilter ( ) const

Return the filter string with which the listener was added.

Precondition
IsNull() returns false.
Returns
The filter string with which the listener was added. This may be empty if the listener was added without a filter.

◆ GetModuleContext()

ModuleContext* us::ServiceListenerHook::ListenerInfo::GetModuleContext ( ) const

Return the context of the module which added the listener.

Precondition
IsNull() returns false.
Returns
The context of the module which added the listener.

◆ IsNull()

bool us::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.

Returns
true if this listener object is valid, false otherwise.

◆ IsRemoved()

bool us::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.

Returns
false if the listener has not been been removed, true otherwise.

◆ operator=()

ListenerInfo& us::ServiceListenerHook::ListenerInfo::operator= ( const ListenerInfo &  other)

Copy assignment operator.

◆ operator==()

bool us::ServiceListenerHook::ListenerInfo::operator== ( const ListenerInfo &  other) const

Compares this ListenerInfo to another ListenerInfo. Two.

ListenerInfo()
Default constructor. Creates an invalid ListenerInfo instance.

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.

Parameters
[in]otherThe object to compare against this ListenerInfo.
Returns
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.

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