Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

AlgSnarl.h

Go to the documentation of this file.
00001 #ifndef ANP_ALGSNARL_H
00002 #define ANP_ALGSNARL_H
00003 
00004 //
00005 // ABC for snarl based algorithm
00006 // 
00007 // This algorithm is executed once for each snarl
00008 //
00009 //
00010 // Five virtual functions
00011 //
00012 // Run() is executed on every snarl
00013 //
00014 // Config() is called after algorithm is created
00015 //          it passed registry with configuration parameters
00016 //
00017 // Set() is called after Config()
00018 //       it provides a pointer to TDirectory in ROOT file
00019 //       TDirectory pointer can be NULL
00020 //
00021 // Init() is called once before Run() but after
00022 //        Config() and Set()
00023 //
00024 // End() is called after processing is complete
00025 //       after this call there no more snarls to Run()
00026 //
00027 
00028 // C++
00029 #include <string>
00030 
00031 // Local
00032 #include "PhysicsNtuple/Handle.h"
00033 #include "PhysicsNtuple/Record.h"
00034 
00035 class DataBlock;
00036 class Registry;
00037 class TDirectory;
00038 
00039 namespace Anp
00040 {
00041    class AlgSnarl: public virtual Base
00042    {      
00043    public:      
00044       
00045       AlgSnarl();
00046       virtual ~AlgSnarl();
00047 
00048       virtual bool Run(Record &) = 0;
00049 
00050       virtual void Config(const Registry &);
00051 
00052       virtual void Set(TDirectory *);
00053 
00054       virtual bool Init(const Header &);
00055 
00056       virtual void End(const DataBlock &);
00057 
00058       void Name(const std::string &value);
00059       const std::string& Name() const;
00060 
00061    private:
00062       
00063       AlgSnarl(const AlgSnarl &);
00064       AlgSnarl& operator=(const AlgSnarl &);
00065     
00066    private:
00067 
00068       std::string fName;
00069 
00070    };
00071 
00072    typedef Anp::Handle<Anp::AlgSnarl> AlgSnarlPtr;
00073 
00074    //
00075    // Inlined member functions
00076    //
00077 
00078    inline AlgSnarl::AlgSnarl() : fName("generic")
00079    {
00080    }
00081 
00082    inline AlgSnarl::~AlgSnarl()
00083    {
00084    }
00085 
00086    inline void AlgSnarl::Config(const Registry &)
00087    {
00088    }
00089 
00090    inline void AlgSnarl::Set(TDirectory *)
00091    { 
00092    }
00093 
00094    inline bool AlgSnarl::Init(const Header &)
00095    {
00096       return true;
00097    }
00098 
00099    inline void AlgSnarl::End(const DataBlock &)
00100    { 
00101    }
00102 
00103    inline void AlgSnarl::Name(const std::string &value)
00104    { 
00105       fName = value;
00106    }
00107 
00108    inline const std::string& AlgSnarl::Name() const
00109    {
00110       return fName;
00111    }
00112 }
00113 
00114 #endif

Generated on Mon Feb 15 11:06:20 2010 for loon by  doxygen 1.3.9.1