| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

SimTrigCommandHeader.h

Go to the documentation of this file.
00001 
00002 //   **************************************************************************
00003 //   *                                                                        *
00004 //   *                      ! ! ! A T T E N T I O N ! ! !                     *
00005 //   *                                                                        *
00006 //   *  This file was created automatically by GaudiObjDesc, please do not    *
00007 //   *  delete it or edit it by hand.                                         *
00008 //   *                                                                        *
00009 //   *  If you want to change this file, first change the corresponding       *
00010 //   *  xml-file and rerun the tools from GaudiObjDesc (or run make if you    *
00011 //   *  are using it from inside a Gaudi-package).                            *
00012 //   *                                                                        *
00013 //   **************************************************************************
00014 
00015 #ifndef SimTrigEvent_SimTrigCommandHeader_H
00016 #define SimTrigEvent_SimTrigCommandHeader_H 1
00017 
00018 // Include files
00019 #include "Conventions/Electronics.h"
00020 #include "GaudiKernel/boost_allocator.h"
00021 #include <map>
00022 #include <ostream>
00023 
00024 // Forward declarations
00025 
00026 namespace DayaBay 
00027 {
00028 
00029   // Forward declarations
00030   class SimTrigHeader;
00031   class SimTrigCommand;
00032   class SimTrigCommandCollection;
00033   
00034 
00044   class SimTrigCommandHeader
00045   {
00046   public:
00047 
00049     typedef std::map<DayaBay::Detector,DayaBay::SimTrigCommandCollection*> detCollMap;
00050   
00052   SimTrigCommandHeader(DayaBay::SimTrigHeader* header) : m_header(header),
00053                                                           m_collections() {}
00054   
00056     SimTrigCommandHeader() : m_header(0),
00057                              m_detector(),
00058                              m_collections() {}
00059   
00061   ~SimTrigCommandHeader();
00062   
00064     std::ostream& fillStream(std::ostream& s) const;
00065   
00067     void addCommand(DayaBay::SimTrigCommand* tc);
00068   
00070     void addCollection(DayaBay::SimTrigCommandCollection* tcc);
00071   
00074   const DayaBay::SimTrigHeader* header() const;
00075   
00078   void setHeader(DayaBay::SimTrigHeader* value);
00079   
00082   const DayaBay::Detector& detector() const;
00083   
00086   void setDetector(const DayaBay::Detector& value);
00087   
00090   const detCollMap& collections() const;
00091   
00092   
00093   #ifndef GOD_NOALLOC
00095     static void* operator new ( size_t size )
00096     {
00097       return ( sizeof(SimTrigCommandHeader) == size ? 
00098                boost::singleton_pool<SimTrigCommandHeader, sizeof(SimTrigCommandHeader)>::malloc() :
00099                ::operator new(size) );
00100     }
00101   
00105     static void* operator new ( size_t size, void* pObj )
00106     {
00107       return ::operator new (size,pObj);
00108     }
00109   
00111     static void operator delete ( void* p )
00112     {
00113       boost::singleton_pool<SimTrigCommandHeader, sizeof(SimTrigCommandHeader)>::is_from(p) ?
00114       boost::singleton_pool<SimTrigCommandHeader, sizeof(SimTrigCommandHeader)>::free(p) :
00115       ::operator delete(p);
00116     }
00117   
00120     static void operator delete ( void* p, void* pObj )
00121     {
00122       ::operator delete (p, pObj);
00123     }
00124   #endif
00125   protected:
00126 
00127   private:
00128 
00129     DayaBay::SimTrigHeader* m_header;      
00130     DayaBay::Detector       m_detector;    
00131     detCollMap              m_collections; 
00132   
00133   }; // class SimTrigCommandHeader
00134 
00135   inline std::ostream& operator<< (std::ostream& str, const SimTrigCommandHeader& obj)
00136   {
00137     return obj.fillStream(str);
00138   }
00139   
00140 } // namespace DayaBay;
00141 
00142 // -----------------------------------------------------------------------------
00143 // end of class
00144 // -----------------------------------------------------------------------------
00145 
00146 // Including forward declarations
00147 #include "SimTrigHeader.h"
00148 #include "SimTrigCommand.h"
00149 #include "SimTrigCommandCollection.h"
00150 
00151 
00152 inline DayaBay::SimTrigCommandHeader::~SimTrigCommandHeader() 
00153 {
00154 
00155           DayaBay::SimTrigCommandHeader::detCollMap::iterator it;
00156           for(it=m_collections.begin();
00157               it!=m_collections.end();
00158               ++it){
00159                 delete it->second;
00160            }
00161         
00162 }
00163 
00164 inline const DayaBay::SimTrigHeader* DayaBay::SimTrigCommandHeader::header() const 
00165 {
00166   return m_header;
00167 }
00168 
00169 inline void DayaBay::SimTrigCommandHeader::setHeader(DayaBay::SimTrigHeader* value) 
00170 {
00171   m_header = value;
00172 }
00173 
00174 inline const DayaBay::Detector& DayaBay::SimTrigCommandHeader::detector() const 
00175 {
00176   return m_detector;
00177 }
00178 
00179 inline void DayaBay::SimTrigCommandHeader::setDetector(const DayaBay::Detector& value) 
00180 {
00181   m_detector = value;
00182 }
00183 
00184 inline const DayaBay::SimTrigCommandHeader::detCollMap& DayaBay::SimTrigCommandHeader::collections() const 
00185 {
00186   return m_collections;
00187 }
00188 
00189 
00190 #endif 
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:30:57 2011 for SimTrigEvent by doxygen 1.4.7