3 #ifndef GAUDIKERNEL_CARRAYASPROPERTY_H
4 #define GAUDIKERNEL_CARRAYASPROPERTY_H 1
14 #include "GaudiKernel/PropertyTypeTraits.h"
15 #include "GaudiKernel/PropertyVerifier.h"
45 template <
class T,
unsigned int N>
46 struct PropertyTypeTraits<T(&)[
N]>
49 typedef T(&
Type) [
N] ;
50 typedef T(&PRef) [
N] ;
51 typedef T(*PVal) [
N] ;
52 typedef const T(&CRef) [
N] ;
53 typedef const T(*CVal) [
N] ;
58 static PVal new_ () {
return new T[
N] ; }
60 static PVal new_ (
Type right )
63 assign ( tmp , right ) ;
67 static PVal copy ( PVal* right ,
const bool own )
69 if ( !own ) {
return right ; }
70 return new_ ( *right ) ;
73 static void dele ( PVal right ,
const bool own )
74 {
if ( own ) {
delete[] right ; } }
77 static void assign (
Type v1 , PRef v2 ) { std::copy ( v2 , v2 +
N , v1 ) ; }
78 static void assign (
Type v1 , CRef v2 ) { std::copy ( v2 , v2 +
N , v1 ) ; }
80 static bool less (
Type v1 ,
Type v2 )
81 {
return std::lexicographical_compare ( v1 , v1 +
N , v2 , v2 +
N ) ; }
82 static bool less (
Type v1 , CRef v2 )
83 {
return std::lexicographical_compare ( v1 , v1 +
N , v2 , v2 +
N ) ; }
84 static bool less ( CRef v1 , CRef v2 )
85 {
return std::lexicographical_compare ( v1 , v1 +
N , v2 , v2 +
N ) ; }
86 static bool less ( CRef v1 ,
Type v2 )
87 {
return std::lexicographical_compare ( v1 , v1 +
N , v2 , v2 +
N ) ; }
92 template <
class T,
unsigned int N>
93 struct PropertyTypeTraits<T[
N]> :
public PropertyTypeTraits<T(&)[N]>
97 template <
class T,
unsigned int N>
98 struct PropertyTypeTraits< const T(&)[
N]>
101 template <
unsigned int N>
102 struct PropertyTypeTraits<char(&)[
N]>
112 template<
class T,
unsigned int N>
129 bool isValid (
const typename Traits::CVal
value )
const
181 #endif // GAUDIKERNEL_CARRAYASPROPERTY_H
Templated Verifier base class.
helper structure to define the types for properties
void clearLower()
Clear lower bound value.
bool m_hasLowerBound
Data and Function Members for This Class Implementation.
void setLower(const T &value)
Set lower bound value.
bool hasLower() const
Return if it has a lower bound.
virtual ~BoundedVerifier()
Destructor.
void clearUpper()
Clear upper bound value.
void setBounds(const T &lower, const T &upper)
Set both bounds (lower and upper) at the same time.
const T & lower() const
Return the lower bound value.
bool hasUpper() const
Return if it has a lower bound.
bool isValid(const typename Gaudi::Utils::PropertyTypeTraits< T >::CVal value) const
Check if the value is within bounds.
const T & upper() const
Return the upper bound value.
void setUpper(const T &value)
Set upper bound value.
void clearBounds()
Clear both bounds (lower and upper) at the same time.
Type
the list of available types for ntuples
Helper functions to set/get the application return code.
BoundedVerifier()
Constructors.