PropertyTypeTraits.h
Go to the documentation of this file.
1 // $Id: $
2 // ============================================================================
3 #ifndef GAUDIKERNEL_PROPTRAITS_H
4 #define GAUDIKERNEL_PROPTRAITS_H 1
5 // ============================================================================
6 // Include files
7 // ============================================================================
8 // STD & STL
9 // ============================================================================
10 #include <algorithm>
11 // ============================================================================
12 namespace Gaudi
13 {
14  // ==========================================================================
15  namespace Utils
16  {
17  // ========================================================================
45  template <class TYPE>
47  {
48  // =======================================================================
49  typedef TYPE Type ;
50  typedef const TYPE& PRef ;
51  typedef TYPE* PVal ;
52  typedef const TYPE* CVal ;
53  // =======================================================================
55  static PVal new_ () { return new Type( ) ; }
57  static PVal new_ ( const Type& right ) { return new Type(right) ; }
59  static void dele ( PVal right , const bool own )
60  { if ( own ) { delete right ; } }
62  static PVal copy ( PVal* right , const bool own )
63  {
64  if ( !own ) { return right ; }
65  return new_ ( *right ) ;
66  }
68  static void assign ( Type& v1 , PRef v2 ) { v1 = v2 ; }
70  static bool less ( const Type& v1 , const Type& v2 )
71  { return v1 < v2 ; }
72  // ======================================================================
73  } ;
74  // ========================================================================
75  } // end of namespace Gaudi::Utils
76  // ==========================================================================
77 } // end of namespace Gaudi
78 // ============================================================================
79 // The END
80 // ============================================================================
81 #endif // GAUDIKERNEL_PROPTRAITS_H
82 // ============================================================================
helper structure to define the types for properties
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
static PVal new_(const Type &right)
some kind of copy constructor