// SampleModule.h // // This is part of the principal sample of how to use the ErrorLogger // mechanism in a realistic setting. // // The sample is meant to be taken as a starting point, and modified to // meet an experiment's needs. Or it can be viewed as a fairly complete // illustration of most of the commonly used features in ErrorLogger. // // The overall structure assumed is that some programmer(s) provide a // "framework" including the main program, various setups and event-flow // controls, and so forth. Then each group of physicists provide "modules" // (or in D0 language "packages") which do steps of physics calculation -- // the framework will pass an event from package to package. // // This sample is composed of five files: // SampleFramework // SampleModule holds the Module base class. This likely already is // part of the experiment framework, or it may be added // to define modules for error logging purposes. // SampleEvent // SampleModuleA // SampleModuleB // #ifndef SAMPLE_MODULE_H #define SAMPLE_MODULE_H #include "ErrorLogger/ErrorLog.h" class Event; class SampleModule { // This is a skeletal mock-up of the Module or Package base // classes in CDF or D0. Each module is derived from this. public: SampleModule( const std::string & name ); virtual ~SampleModule() = 0; virtual void invoke ( Event & e ) = 0; // do this module's processing! protected: // Note that this is the only line inserted ErrorLog errlog; // in the Module class because of the // ErrorLogger mechanism! }; // SampleModule #endif // SAMPLE_MODULE_H