#ifndef EXITANDINT_H #define EXITANDINT_H // exitAndInt.h -- Test of space after int and of setExitTreshold // // based on BasicUsage // ------------------------------------- // Headers for files making up Framework // ------------------------------------- // // Event.h // // This is a rather lame mock-up of what an Event looks like. // The framework will pass an Event from one module to the next. class Event { public: int data; inline Event( int d ) : data(d) { } }; // Event // --------------------- // // Module.h -- the base class for all physicist modules // // Normally this would include framework.h. // In this illustration that content is in this same file. #ifndef ZMENVIRONMENT_H #include "ZMutility/ZMenvironment.h" #endif #include #include "ErrorLogger/ErrorLog.h" class Module { public: Module( const std::string & name ); virtual void operator()( Event & e ) = 0; // do this module's processing! protected: // Note that this is the only line in Module ErrorLog errlog; // inserted because of the ErrorLogger // mechanism! }; // Module // ----------------------------- // Header for Physicsists' Code // ----------------------------- // // DoPhysics.h -- Many physicists can supply this sort of class // // Normally one would include framework.h. // In this illustration that content is in this same file. // The following are defined in that framework: // class Event; // class Module; // For all these examples, we suppose the physicist will provide code in // the form of a class with an operator() method taking an Event. // That is, the physicist provides a class (DoPhysics in this case) // rather than a global function. // Normally one would include but it is included above in this file. class DoPhysics : public Module { public: inline DoPhysics( const std::string & name ) : Module(name) {} void operator()( Event & event ); // THIS IS WHERE ALL THE PHYSICS // CODE WILL GO. }; // DoPhysics #endif /* EXITANDINT_H */