CEventSink

Name

CEventSink -- Base class for event sink pipeline elements

Synopsis


#include <EventSink.h>

class CEventSink {
 public:
  CEventSink();
  virtual ~CEventSink();
  CEventSink(const CEventSink& aCEventSink);
  CEventSink& operator=(const CEventSink& aCEventSink);
  int operator==(const CEventSink& aCEventSink);
  virtual void OnAttach(CAnalyzer& rAnalyzer);
  virtual void OnDetach(CAnalyzer& rAnalyzer);

  virtual void operator()(CEventList& rEvents) = 0;
};

DESCRIPTION

SpecTcl's event sink pipeline is passed events once the event processing pipeline has created and filled in the CEvent for the raw event. It consists of instances of classes derived fromt he abstract base class CEventSink.

The most interesting element of the pipeline for most SpecTcl users is the CHistogrammer instance. That object does the heavy lifting of determining which channels of which spectra should be incremented for each CEvent instance. Other event sink pipeline elements can be created and added dynamically. Of special interest are event filters which write out subsets of decoded events that satisfy some gate in a specific format.

Similarly the 5.0 root integration classes allow Root trees to be produced by objects derived from CEventSink.

METHODS

virtual void OnAttach(CAnalyzer& rAnalyzer);

This method has a empty implementation making its for derived classes. It is invoked when an instance is added to the event sink pipeline. The rAnalyzer parameter refers to the SpecTcl analyzer.

virtual void OnDetach(CAnalyzer& rAnalyzer);

This method has an empty base class implementation. Therefore its implementation in derived classes is optional. It is invoked whenever an instance is removed from the event sink pipeline. rAnalyzer refers to the analyzer in operating at the time of the removal.

virtual =0 void operator()(CEventList& rEvents);

This pure virtual method must be implemented by concrete event sink classes. It is invoked whenever the event processing pipeline delivers a list of events to the event sink pipeline. Note that lists of events are delivered in order to promote referential locality in SpecTcl (hopefully improving cache hit rates).

rEvents is the event list the sink should process.