PropertyTypeTraits.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_PROPTRAITS_H
2 #define GAUDIKERNEL_PROPTRAITS_H 1
3 // ============================================================================
4 // Include files
5 // ============================================================================
6 // STD & STL
7 // ============================================================================
8 #include <algorithm>
9 // ============================================================================
10 namespace Gaudi
11 {
12  // ==========================================================================
13  namespace Utils
14  {
15  // ========================================================================
43  template <class TYPE>
44  struct PropertyTypeTraits
45  {
46  // =======================================================================
47  typedef TYPE Type ;
48  typedef const TYPE& PRef ;
49  typedef TYPE* PVal ;
50  typedef const TYPE* CVal ;
51  // =======================================================================
53  static PVal new_ () { return new Type( ) ; }
55  static PVal new_ ( const Type& right ) { return new Type(right) ; }
57  static void dele ( PVal right , const bool own )
58  { if ( own ) { delete right ; } }
60  static PVal copy ( PVal* right , const bool own )
61  {
62  if ( !own ) { return right ; }
63  return new_ ( *right ) ;
64  }
66  static void assign ( Type& v1 , PRef v2 ) { v1 = v2 ; }
68  static bool less ( const Type& v1 , const Type& v2 )
69  { return v1 < v2 ; }
70  // ======================================================================
71  } ;
72  // ========================================================================
73  } // end of namespace Gaudi::Utils
74  // ==========================================================================
75 } // end of namespace Gaudi
76 // ============================================================================
77 // The END
78 // ============================================================================
79 #endif // GAUDIKERNEL_PROPTRAITS_H
80 // ============================================================================
static PVal new_()
some kind of default constructor
static void assign(Type &v1, PRef v2)
assignment
static bool less(const Type &v1, const Type &v2)
comparison (needed for bounded verifier)
static void dele(PVal right, const bool own)
"smart" destructor
static PVal copy(PVal *right, const bool own)
"smart" copy-constructor
Helper functions to set/get the application return code.
Definition: __init__.py:1