1 #ifndef GAUDIKERNEL_CARRAYASPROPERTY_H
2 #define GAUDIKERNEL_CARRAYASPROPERTY_H 1
12 #include "GaudiKernel/PropertyTypeTraits.h"
13 #include "GaudiKernel/PropertyVerifier.h"
43 template <
class T,
unsigned int N>
44 struct PropertyTypeTraits<T(&)[
N]>
47 typedef T(&
Type) [
N] ;
48 typedef T(&PRef) [
N] ;
49 typedef T(*PVal) [
N] ;
50 typedef const T(&CRef) [
N] ;
51 typedef const T(*CVal) [
N] ;
56 static PVal new_ () {
return new T[
N] ; }
58 static PVal new_ (
Type right )
61 assign ( tmp , right ) ;
65 static PVal copy ( PVal* right ,
const bool own )
67 if ( !own ) {
return right ; }
68 return new_ ( *right ) ;
71 static void dele ( PVal right ,
const bool own )
72 {
if ( own ) {
delete[] right ; } }
75 static void assign (
Type v1 , PRef v2 ) { std::copy ( v2 , v2 +
N , v1 ) ; }
76 static void assign (
Type v1 , CRef v2 ) { std::copy ( v2 , v2 +
N , v1 ) ; }
78 static bool less (
Type v1 ,
Type v2 )
79 {
return std::lexicographical_compare ( v1 , v1 +
N , v2 , v2 +
N ) ; }
80 static bool less (
Type v1 , CRef v2 )
81 {
return std::lexicographical_compare ( v1 , v1 +
N , v2 , v2 +
N ) ; }
82 static bool less ( CRef v1 , CRef v2 )
83 {
return std::lexicographical_compare ( v1 , v1 +
N , v2 , v2 +
N ) ; }
84 static bool less ( CRef v1 ,
Type v2 )
85 {
return std::lexicographical_compare ( v1 , v1 +
N , v2 , v2 +
N ) ; }
90 template <
class T,
unsigned int N>
91 struct PropertyTypeTraits<T[
N]> :
public PropertyTypeTraits<T(&)[N]>
95 template <
class T,
unsigned int N>
96 struct PropertyTypeTraits< const T(&)[
N]>
99 template <
unsigned int N>
100 struct PropertyTypeTraits<char(&)[
N]>
110 template<
class T,
unsigned int N>
127 bool isValid (
const typename Traits::CVal
value )
const
179 #endif // GAUDIKERNEL_CARRAYASPROPERTY_H
bool isValid(const typename Gaudi::Utils::PropertyTypeTraits< T >::CVal value) const override
Check if the value is within bounds.
Templated Verifier base class.
helper structure to define the types for properties
~BoundedVerifier() override=default
Destructor.
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.
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.
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.