Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

algorithmConditional.h

Go to the documentation of this file.
00001 #ifndef algorithmConditional_h
00002 #define algorithmConditional_h
00003 
00004 #include "Event/algorithmVI.h"
00005 #include "Event/cutVI.h"
00006 
00008 
00017 //--------------------------------
00018 // JA Hernando, Santa Cruz, CA, 06/16/00
00019 //--------------------------------
00020 
00021 //################################
00022 class algorithmConditional : public algorithmVI
00023 //################################
00024 {
00025 public:
00026 
00028         algorithmConditional() {m_cut=0;m_alg=0;}
00030         virtual ~algorithmConditional() {};
00031 
00033         virtual void setCut(cutVI* cut) {m_cut=cut;}
00035         virtual void setAlgorithm(algorithmVI* alg) {m_alg= alg;}
00036 
00038         virtual void initialize() {if (condition()) m_alg->initialize();}
00040         virtual void execute()    {if (condition()) m_alg->execute();}
00042         virtual void finalize()   {if (condition()) m_alg->finalize();}
00043 
00044 protected:
00045 
00047         virtual bool condition() {return m_cut->apply();}
00048 
00049 private:
00050 
00052         cutVI* m_cut;
00054         algorithmVI* m_alg;
00055 };
00056 #endif

Generated at Fri Aug 18 12:57:37 2000 for centella framework by doxygen 1.1.3 written by Dimitri van Heesch, © 1997-2000