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

In This Package:

IntLink.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 EventBase_IntLink_H
00016 #define EventBase_IntLink_H 1
00017 
00018 // Include files
00019 #include "GaudiKernel/DataObject.h"
00020 #include "GaudiKernel/boost_allocator.h"
00021 #include "GaudiKernel/SerializeSTL.h"
00022 #include <map>
00023 #include <ostream>
00024 
00025 // Forward declarations
00026 
00027 namespace LHCb 
00028 {
00029 
00030   // Forward declarations
00031   using GaudiUtils::operator<<;
00032   
00033   
00034   // Class ID definition
00035   static const CLID CLID_IntLink = 500;
00036   
00037 
00047   class IntLink: public DataObject
00048   {
00049   public:
00050 
00052     IntLink() : m_link() {}
00053   
00055     virtual ~IntLink() {}
00056   
00057     // Retrieve pointer to class definition structure
00058     virtual const CLID& clID() const;
00059     static const CLID& classID();
00060   
00062    virtual std::ostream& fillStream(std::ostream& s) const;
00063   
00065     void setLink(int key,
00066                  int value);
00067   
00069     int link(int key) const;
00070   
00072     bool hasKey(int key) const;
00073   
00076   const std::map<int,int>& link() const;
00077   
00080   void setLink(const std::map<int,int>& value);
00081   
00082   
00083   #ifndef GOD_NOALLOC
00085     static void* operator new ( size_t size )
00086     {
00087       return ( sizeof(IntLink) == size ? 
00088                boost::singleton_pool<IntLink, sizeof(IntLink)>::malloc() :
00089                ::operator new(size) );
00090     }
00091   
00095     static void* operator new ( size_t size, void* pObj )
00096     {
00097       return ::operator new (size,pObj);
00098     }
00099   
00101     static void operator delete ( void* p )
00102     {
00103       boost::singleton_pool<IntLink, sizeof(IntLink)>::is_from(p) ?
00104       boost::singleton_pool<IntLink, sizeof(IntLink)>::free(p) :
00105       ::operator delete(p);
00106     }
00107   
00110     static void operator delete ( void* p, void* pObj )
00111     {
00112       ::operator delete (p, pObj);
00113     }
00114   #endif
00115   protected:
00116 
00117   private:
00118 
00119     std::map<int,int> m_link; 
00120   
00121   }; // class IntLink
00122 
00123   inline std::ostream& operator<< (std::ostream& str, const IntLink& obj)
00124   {
00125     return obj.fillStream(str);
00126   }
00127   
00128 } // namespace LHCb;
00129 
00130 // -----------------------------------------------------------------------------
00131 // end of class
00132 // -----------------------------------------------------------------------------
00133 
00134 // Including forward declarations
00135 
00136 inline const CLID& LHCb::IntLink::clID() const
00137 {
00138   return LHCb::IntLink::classID();
00139 }
00140 
00141 inline const CLID& LHCb::IntLink::classID()
00142 {
00143   return CLID_IntLink;
00144 }
00145 
00146 inline std::ostream& LHCb::IntLink::fillStream(std::ostream& s) const
00147 {
00148   s << "{ " << "link :  " << m_link << std::endl << " }";
00149   return s;
00150 }
00151 
00152 
00153 inline const std::map<int,int>& LHCb::IntLink::link() const 
00154 {
00155   return m_link;
00156 }
00157 
00158 inline void LHCb::IntLink::setLink(const std::map<int,int>& value) 
00159 {
00160   m_link = value;
00161 }
00162 
00163 inline void LHCb::IntLink::setLink(int key,
00164                                    int value) 
00165 {
00166 
00167           m_link[key] = value;
00168         
00169 }
00170 
00171 inline int LHCb::IntLink::link(int key) const 
00172 {
00173 
00174           if (m_link.find(key) == m_link.end()) return 0;
00175           return m_link.find(key)->second;
00176         
00177 }
00178 
00179 inline bool LHCb::IntLink::hasKey(int key) const 
00180 {
00181 
00182           return (m_link.find(key) != m_link.end());
00183         
00184 }
00185 
00186 
00187 #endif 
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:03:25 2011 for EventBase by doxygen 1.4.7