/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

UserData.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 UserData_UserData_H
00016 #define UserData_UserData_H 1
00017 
00018 // Include files
00019 #include "GaudiKernel/boost_allocator.h"
00020 #include "GaudiKernel/SerializeSTL.h"
00021 #include <string>
00022 #include <ostream>
00023 
00024 // Forward declarations
00025 
00026 namespace DayaBay 
00027 {
00028 
00029   // Forward declarations
00030   using GaudiUtils::operator<<;
00031   
00032 
00042   class UserData
00043   {
00044   public:
00045 
00047     enum DataType{ Unknown = 0,    // Undefined, indicates error
00048                    Float = 1,      // Floating-point value
00049                    FloatArray = 2, // Array of floating-point values
00050                    Int = 3,        // Integer value
00051                    IntArray = 4    // Array of integer values
00052       };
00053   
00055   UserData(const std::string& name) : m_name(name) {}
00056   
00058     UserData() : m_name() {}
00059   
00061   virtual ~UserData();
00062   
00064    virtual std::ostream& fillStream(std::ostream& s) const;
00065   
00067     virtual UserData::DataType type() const;
00068   
00071   const std::string& name() const;
00072   
00075   void setName(const std::string& value);
00076   
00077   
00078   #ifndef GOD_NOALLOC
00079 
00080     static void* operator new ( size_t size )
00081     {
00082       return ( sizeof(UserData) == size ? 
00083                boost::singleton_pool<UserData, sizeof(UserData)>::malloc() :
00084                ::operator new(size) );
00085     }
00086   
00090     static void* operator new ( size_t size, void* pObj )
00091     {
00092       return ::operator new (size,pObj);
00093     }
00094   
00096     static void operator delete ( void* p )
00097     {
00098       boost::singleton_pool<UserData, sizeof(UserData)>::is_from(p) ?
00099       boost::singleton_pool<UserData, sizeof(UserData)>::free(p) :
00100       ::operator delete(p);
00101     }
00102   
00105     static void operator delete ( void* p, void* pObj )
00106     {
00107       ::operator delete (p, pObj);
00108     }
00109   #endif
00110   protected:
00111 
00112   private:
00113 
00114     std::string m_name; 
00115   
00116   }; // class UserData
00117 
00118   inline std::ostream& operator<< (std::ostream& str, const UserData& obj)
00119   {
00120     return obj.fillStream(str);
00121   }
00122   
00123   inline std::ostream & operator << (std::ostream & s, DayaBay::UserData::DataType e) {
00124     switch (e) {
00125       case DayaBay::UserData::Unknown    : return s << "Unknown";
00126       case DayaBay::UserData::Float      : return s << "Float";
00127       case DayaBay::UserData::FloatArray : return s << "FloatArray";
00128       case DayaBay::UserData::Int        : return s << "Int";
00129       case DayaBay::UserData::IntArray   : return s << "IntArray";
00130       default : return s << "ERROR wrong value for enum DayaBay::UserData::DataType";
00131     }
00132   }
00133   
00134   
00135 } // namespace DayaBay;
00136 
00137 // -----------------------------------------------------------------------------
00138 // end of class
00139 // -----------------------------------------------------------------------------
00140 
00141 // Including forward declarations
00142 
00143 inline std::ostream& DayaBay::UserData::fillStream(std::ostream& s) const
00144 {
00145   s << "{ " << "name :  " << m_name << std::endl << " }";
00146   return s;
00147 }
00148 
00149 
00150 inline const std::string& DayaBay::UserData::name() const 
00151 {
00152   return m_name;
00153 }
00154 
00155 inline void DayaBay::UserData::setName(const std::string& value) 
00156 {
00157   m_name = value;
00158 }
00159 
00160 inline DayaBay::UserData::DataType DayaBay::UserData::type() const 
00161 {
00162 return DayaBay::UserData::Unknown;
00163 }
00164 
00165 
00166 #endif ///UserData_UserData_H
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:58:45 for UserData by doxygen 1.7.4