|
Gaudi Framework, version v21r8 |
| Home | Generated: 17 Mar 2010 |
00001 // $Id: $ 00002 // ============================================================================ 00003 #ifndef GAUDIKERNEL_PROPTRAITS_H 00004 #define GAUDIKERNEL_PROPTRAITS_H 1 00005 // ============================================================================ 00006 // Include files 00007 // ============================================================================ 00008 // STD & STL 00009 // ============================================================================ 00010 #include <algorithm> 00011 // ============================================================================ 00012 namespace Gaudi 00013 { 00014 // ========================================================================== 00015 namespace Utils 00016 { 00017 // ======================================================================== 00045 template <class TYPE> 00046 struct PropertyTypeTraits 00047 { 00048 // ======================================================================= 00049 typedef TYPE Type ; 00050 typedef const TYPE& PRef ; 00051 typedef TYPE* PVal ; 00052 typedef const TYPE* CVal ; 00053 // ======================================================================= 00055 static PVal new_ () { return new Type( ) ; } 00057 static PVal new_ ( const Type& right ) { return new Type(right) ; } 00059 static void dele ( PVal right , const bool own ) 00060 { if ( own ) { delete right ; } } 00062 static PVal copy ( PVal* right , const bool own ) 00063 { 00064 if ( !own ) { return right ; } 00065 return new_ ( *right ) ; 00066 } 00068 static void assign ( Type& v1 , PRef v2 ) { v1 = v2 ; } 00070 static bool less ( const Type& v1 , const Type& v2 ) 00071 { return v1 < v2 ; } 00072 // ====================================================================== 00073 } ; 00074 // ======================================================================== 00075 } // end of namespace Gaudi::Utils 00076 // ========================================================================== 00077 } // end of namespace Gaudi 00078 // ============================================================================ 00079 // The END 00080 // ============================================================================ 00081 #endif // GAUDIKERNEL_PROPTRAITS_H 00082 // ============================================================================