Albert
Loading...
Searching...
No Matches
albert::ExtensionWatcher< T > Class Template Reference

#include <albert/extensionwatcher.h>

Detailed Description

template<class T>
class albert::ExtensionWatcher< T >

Non-QObject extension registry observer.

Convenient tool to observe the extension registry for types you are interested in. Rationale: QObject does neither support templates nor abstract classes also each object must inherit only one QObject. Therefore this class does not use QObject.

See also
ExtensionRegistry

Public Member Functions

 ExtensionWatcher (ExtensionRegistry *registry=nullptr)
 ExtensionWatcher constructor.
 
void setExtensionRegistry (ExtensionRegistry *registry)
 Sets the extension registry to track.
 

Protected Member Functions

virtual void onAdd (T *)
 Called when an extension has been registered.
 
virtual void onRem (T *)
 Called when an extension has been deregistered.
 
virtual ~ExtensionWatcher ()
 Destructor must not be called though this interface.
 

Constructor & Destructor Documentation

◆ ExtensionWatcher()

template<class T >
albert::ExtensionWatcher< T >::ExtensionWatcher ( ExtensionRegistry registry = nullptr)
inlineexplicit

ExtensionWatcher constructor.

Parameters
registryThe extension registry to track. May be set later.

◆ ~ExtensionWatcher()

template<class T >
virtual albert::ExtensionWatcher< T >::~ExtensionWatcher ( )
inlineprotectedvirtual

Destructor must not be called though this interface.

Member Function Documentation

◆ onAdd()

template<class T >
virtual void albert::ExtensionWatcher< T >::onAdd ( T *  )
inlineprotectedvirtual

Called when an extension has been registered.

◆ onRem()

template<class T >
virtual void albert::ExtensionWatcher< T >::onRem ( T *  )
inlineprotectedvirtual

Called when an extension has been deregistered.

◆ setExtensionRegistry()

template<class T >
void albert::ExtensionWatcher< T >::setExtensionRegistry ( ExtensionRegistry registry)
inline

Sets the extension registry to track.

Parameters
registryThe extension registry to track

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