LLVM API Documentation

Public Member Functions | Protected Member Functions | Friends
llvm::Registry< T, U >::listener Class Reference

#include <Registry.h>

Inheritance diagram for llvm::Registry< T, U >::listener:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 listener ()
virtual ~listener ()

Protected Member Functions

virtual void registered (const entry &)=0
void init ()

Friends

void Registry::Announce (const entry &E)

Detailed Description

template<typename T, typename U = RegistryTraits<T>>
class llvm::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;

Definition at line 141 of file Registry.h.


Constructor & Destructor Documentation

template<typename T , typename U = RegistryTraits<T>>
llvm::Registry< T, U >::listener::listener ( ) [inline]

Definition at line 159 of file Registry.h.

template<typename T , typename U = RegistryTraits<T>>
virtual llvm::Registry< T, U >::listener::~listener ( ) [inline, virtual]

Definition at line 167 of file Registry.h.


Member Function Documentation

template<typename T , typename U = RegistryTraits<T>>
void llvm::Registry< T, U >::listener::init ( ) [inline, protected]

Calls 'registered' for each pre-existing entry.

Definition at line 153 of file Registry.h.

References llvm::Registry< T, U >::begin(), llvm::Registry< T, U >::end(), I, and llvm::Registry< T, U >::listener::registered().

Referenced by llvm::RegistryParser< T, U >::initialize().

template<typename T , typename U = RegistryTraits<T>>
virtual void llvm::Registry< T, U >::listener::registered ( const entry ) [protected, pure virtual]

Called when an entry is added to the registry.

Implemented in llvm::RegistryParser< T, U >.

Referenced by llvm::Registry< T, U >::listener::init().


Friends And Related Function Documentation

template<typename T , typename U = RegistryTraits<T>>
void Registry::Announce ( const entry E) [friend]

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