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

In This Package:

ElecPulseHeader.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 ElecEvent_ElecPulseHeader_H
00016 #define ElecEvent_ElecPulseHeader_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 ElecHeader;
00031   class ElecPulseCollection;
00032   
00033 
00043   class ElecPulseHeader
00044   {
00045   public:
00046 
00048     typedef std::map<DayaBay::Detector,DayaBay::ElecPulseCollection*> PulseCollectionMap;
00049   
00051   ElecPulseHeader(DayaBay::ElecHeader* header) : m_header(header),
00052                                                   m_pulseCollection() {}
00053   
00055     ElecPulseHeader() : m_header(0),
00056                         m_pulseCollection() {}
00057   
00059   ~ElecPulseHeader();
00060   
00062     void addPulseCollection(DayaBay::ElecPulseCollection* pc);
00063   
00065     std::ostream& fillStream(std::ostream& s) const;
00066   
00069   const DayaBay::ElecHeader* header() const;
00070   
00073   void setHeader(DayaBay::ElecHeader* value);
00074   
00077   const PulseCollectionMap& pulseCollection() const;
00078   
00079   
00080   #ifndef GOD_NOALLOC
00082     static void* operator new ( size_t size )
00083     {
00084       return ( sizeof(ElecPulseHeader) == size ? 
00085                boost::singleton_pool<ElecPulseHeader, sizeof(ElecPulseHeader)>::malloc() :
00086                ::operator new(size) );
00087     }
00088   
00092     static void* operator new ( size_t size, void* pObj )
00093     {
00094       return ::operator new (size,pObj);
00095     }
00096   
00098     static void operator delete ( void* p )
00099     {
00100       boost::singleton_pool<ElecPulseHeader, sizeof(ElecPulseHeader)>::is_from(p) ?
00101       boost::singleton_pool<ElecPulseHeader, sizeof(ElecPulseHeader)>::free(p) :
00102       ::operator delete(p);
00103     }
00104   
00107     static void operator delete ( void* p, void* pObj )
00108     {
00109       ::operator delete (p, pObj);
00110     }
00111   #endif
00112   protected:
00113 
00114   private:
00115 
00116     DayaBay::ElecHeader* m_header;          
00117     PulseCollectionMap   m_pulseCollection; 
00118   
00119   }; // class ElecPulseHeader
00120 
00121   inline std::ostream& operator<< (std::ostream& str, const ElecPulseHeader& obj)
00122   {
00123     return obj.fillStream(str);
00124   }
00125   
00126 } // namespace DayaBay;
00127 
00128 // -----------------------------------------------------------------------------
00129 // end of class
00130 // -----------------------------------------------------------------------------
00131 
00132 // Including forward declarations
00133 #include "ElecHeader.h"
00134 #include "ElecPulseCollection.h"
00135 
00136 
00137 inline DayaBay::ElecPulseHeader::~ElecPulseHeader() 
00138 {
00139 
00140            DayaBay::ElecPulseHeader::PulseCollectionMap::iterator pcIter = m_pulseCollection.begin();
00141            for(;pcIter != m_pulseCollection.end(); pcIter++) delete pcIter->second;
00142          
00143 }
00144 
00145 inline const DayaBay::ElecHeader* DayaBay::ElecPulseHeader::header() const 
00146 {
00147   return m_header;
00148 }
00149 
00150 inline void DayaBay::ElecPulseHeader::setHeader(DayaBay::ElecHeader* value) 
00151 {
00152   m_header = value;
00153 }
00154 
00155 inline const DayaBay::ElecPulseHeader::PulseCollectionMap& DayaBay::ElecPulseHeader::pulseCollection() const 
00156 {
00157   return m_pulseCollection;
00158 }
00159 
00160 
00161 #endif 
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:32:32 2011 for ElecEvent by doxygen 1.4.7