ROSE 0.11.145.147
Protected Member Functions | List of all members
Rose::Registry< T, U >::listener Class Referenceabstract

Description

template<typename T, typename U = RegistryTraits<T>>
class Rose::Registry< T, U >::listener

Abstract base class for registry listeners, which are informed when new entries are added to the registry.

Simply subclass and instantiate:

class CollectorPrinter : public Registry<Collector>::listener {
protected:
void registered(const Registry<Collector>::entry &e) {
cerr << "collector now available: " << e->getName() << "\n";
}
public:
CollectorPrinter() { init(); } // Print those already registered.
};
CollectorPrinter Printer;
A global registry used in conjunction with static constructors to make pluggable components (like tar...
Definition plugin.h:165

Definition at line 248 of file plugin.h.

#include <midend/astProcessing/plugin.h>

Protected Member Functions

virtual void registered (const entry &)=0
 Called when an entry is added to the registry.
 
void init ()
 Calls 'registered' for each pre-existing entry.
 

Constructor & Destructor Documentation

◆ listener()

template<typename T , typename U = RegistryTraits<T>>
Rose::Registry< T, U >::listener::listener ( )
inline

Definition at line 266 of file plugin.h.

◆ ~listener()

template<typename T , typename U = RegistryTraits<T>>
virtual Rose::Registry< T, U >::listener::~listener ( )
inlinevirtual

Definition at line 274 of file plugin.h.

Member Function Documentation

◆ init()

template<typename T , typename U = RegistryTraits<T>>
void Rose::Registry< T, U >::listener::init ( )
inlineprotected

Calls 'registered' for each pre-existing entry.

Definition at line 260 of file plugin.h.

References Rose::Registry< T, U >::listener::registered().


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