GOG GALAXY SDK Documentation
SelfRegisteringListener< _TypeAwareListener, _Registrar > Class Template Reference

The class that is inherited by the self-registering versions of all specific callback listeners. More...

#include <IListenerRegistrar.h>

Inheritance diagram for SelfRegisteringListener< _TypeAwareListener, _Registrar >:
[legend]

Public Member Functions

 SelfRegisteringListener ()
 Creates an instance of SelfRegisteringListener and registers it with the IListenerRegistrar provided by Galaxy Peer. More...
 
 ~SelfRegisteringListener ()
 Destroys the instance of SelfRegisteringListener and unregisters it with the instance of IListenerRegistrar that was used to register the listener when it was created.
 

Detailed Description

template<typename _TypeAwareListener, IListenerRegistrar *(*)() _Registrar = ListenerRegistrar>
class galaxy::api::SelfRegisteringListener< _TypeAwareListener, _Registrar >

The class that is inherited by the self-registering versions of all specific callback listeners.

An instance of a listener that derives from it automatically globally registers itself for proper callback notifications, and unregisters when destroyed, which is done with IListenerRegistrar.

Remarks
You can provide a custom IListenerRegistrar, yet that would not make the listener visible for Galaxy Peer. For that the listener needs to be registered with the IListenerRegistrar of Galaxy Peer.
Parameters
[in]_RegistrarThe instance of IListenerRegistrar to use for registering and unregistering. Defaults to the one provided by Galaxy Peer.

Constructor & Destructor Documentation

◆ SelfRegisteringListener()

Creates an instance of SelfRegisteringListener and registers it with the IListenerRegistrar provided by Galaxy Peer.

Remarks
Delete all registered listeners before calling Shutdown().