00001 00002 #ifndef SystemAlg_H 00003 #define SystemAlg_H 00004 00005 //#include "HecRunHeader2001v0.h" 00006 #include "Headers.h" 00007 //#include "HecEvent.h" 00008 #include "Event.h" 00009 #include "Geometry.h" 00010 00011 00012 00013 00014 00015 00016 /*! -Class: SystemAlg 00017 - Author: Ian Gable (igable@uvic.ca) 00018 - Date: 06/04/2002 00019 - Description: SystemAlg is the base class for all UserAlg and all other algorithms. Each new 00020 Algorithm created should inherit from this class. In the UserAlg class the SystemAlg 00021 methods corresponding to those methods should also be called. i.e. call 00022 SystemAlg::initialize() in UserAlg::initialize(). 00023 */ 00024 class SystemAlg { 00025 public: 00026 00027 /** The user should never need to use this contructor 00028 * @param event A pointer in the event. Information contained in the event 00029 * gets refreshed before the execute method is run 00030 * @param hecGeom Pointer to the singleton Geometry object 00031 * @param runHeader Pointer to the singleton HecRunHeader2001v0 object 00032 */ 00033 00034 SystemAlg(Event* event, Geometry* hecGeom, Headers* runHeader); 00035 00036 virtual ~SystemAlg(); 00037 00038 //! Should be called inside UserAlg::initialize() 00039 virtual bool initialize(); 00040 00041 //! Should be called inside UserAlg::execute() 00042 virtual bool execute(); 00043 00044 //! Should be called inside UserAlg::finalize(); 00045 virtual bool finalize(); 00046 00047 /** Before proceeding with your own class you should call this method from 00048 * the constructor of UserAlg 00049 * @param algs A standard C++ STL Vector containing a list of SystemAlg 00050 * Derived Objects that will be run. 00051 */ 00052 void setAlgs(vector<SystemAlg*> algs); 00053 00054 protected: 00055 void buildAlgList(vector<string> algList); 00056 00057 private: 00058 Event* m_event; 00059 Geometry* m_geo; 00060 Headers* m_runHeader; 00061 vector<SystemAlg*> m_algVector; 00062 00063 }; 00064 00065 #endif