ADC 400F Handbuch Seite 23

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 74
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 22
Chapter 2. Setting up the software
class CAnalyzer; //
class CBufferDecoder;
class CEvent;
class MyEventProcessor : public CEventProcessor //
{
private:
CTreeParameterArray& m_rawData; //
int m_nId; //
int m_nSlot; //
public:
MyEventProcessor(int ourId,
int ourSlot, //
const char* baseParameterName);
~MyEventProcessor(); // (10)
virtual Bool_t operator()(const Address_t pEvent,
CEvent& rEvent, // (11)
CAnalyzer& rAnalyzer,
CBufferDecoder& rDecoder);
private:
void unpackPacket(TranslatorPointer<UShort_t> p); // (12)
};
#endif
The numbers in the discussion below refer to the numbers in the example above.
Ê All event processors must be derived from the base class CEventProcessor. To do this requires
that we include the header for that class.
Ë The TranslatorPointer class creates pointer-like objects that will do any byte order
transformations required between the system that created the event files and the system running
SpecTcl. This class is a template class, therefore it is necessary to include the header for it as one of
the parameters to a member function of ours is a TranslatorPointer<UShort_t>.
Ì The histotypes.h header defines types that insulate SpecTcl from differences in the data types in
each system. We use these extensively in the header and therefore must include the header here.
Í Where the compiler does not need to know the internal definitions of a class in a header it is a good
idea to create forward references to those classes. This can be done when all objects of a class are
pointers or references. Doing this decreases the likelyhood that we wind up with a system that has
circular include references.
18
Seitenansicht 22
1 2 ... 18 19 20 21 22 23 24 25 26 27 28 ... 73 74

Kommentare zu diesen Handbüchern

Keine Kommentare