ADC 400F Handbuch Seite 63

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 74
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 62
Chapter 5. Complete program listings.
Example 5-8. MySpecTclApp.cpp
static const char* Copyright = "(C) Copyright Michigan State University 2008, All rights reserved";
// Class: CMySpecTclApp
////////////////////////// FILE_NAME.cpp /////////////////////////////////////////////////////
#include <config.h>
#include "MySpecTclApp.h"
#include "EventProcessor.h"
#include "TCLAnalyzer.h"
#include <Event.h>
#include <TreeParameter.h>
#include "MyEventProcessor.h"
#ifdef HAVE_STD_NAMESPACE
using namespace std;
#endif
// Local Class definitions:
// This is a sample tree parameter event structure:
// It defines an array of 10 raw parameters that will
// be unpacked from the data and a weighted sum
// that will be computed.
//
typedef
struct {
CTreeParameterArray& raw;
CTreeParameter& sum;
} MyEvent;
// Having created the struct we must make an instance
// that constructs the appropriate objects:
MyEvent event = {
*(new CTreeParameterArray("event.raw", "channels", 10, 0)),
*(new CTreeParameter("event.sum", "arbitrary"))
};
// Here’s a sample tree variable structure
// that defines the weights for the weighted
// sum so that they can be varied from the command line:
// An array is also declared for testing purposes but not used.
typedef
struct {
CTreeVariable& w1;
58
Seitenansicht 62
1 2 ... 58 59 60 61 62 63 64 65 66 67 68 ... 73 74

Kommentare zu diesen Handbüchern

Keine Kommentare