Class Registry::listener#

Nested Relationships#

This class is a nested type of Template Class Registry.

Class Documentation#

class 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;

Public Functions

inline listener()#
inline virtual ~listener()#

Protected Functions

virtual void registered(const entry&) = 0#

Called when an entry is added to the registry.

inline void init()#

Calls ‘registered’ for each pre-existing entry.