3 #ifndef GAUDIKERNEL_CARRAYASPROPERTY_H
4 #define GAUDIKERNEL_CARRAYASPROPERTY_H 1
45 template <
class T,
unsigned int 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] ; }
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 ) ; }
81 {
return std::lexicographical_compare ( v1 , v1 +
N , v2 , v2 +
N ) ; }
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 ) ; }
87 {
return std::lexicographical_compare ( v1 , v1 +
N , v2 , v2 +
N ) ; }
92 template <
class T,
unsigned int N>
97 template <
class T,
unsigned int N>
101 template <
unsigned int N>
112 template<
class T,
unsigned int N>
181 #endif // GAUDIKERNEL_CARRAYASPROPERTY_H
static void dele(PVal right, const bool own)
"smart" pseudo-destructor
Templated Verifier base class.
helper structure to define the types for properties
static bool less(Type v1, CRef v2)
bool m_hasLowerBound
Data and Function Members for This Class Implementation.
void clearBounds()
Clear both bounds (lower and upper) at the same time.
void clearLower()
Clear lower bound value.
static bool less(Type v1, Type v2)
comparison (needed for bounded verifier)
void clearUpper()
Clear upper bound value.
void clearLower()
Clear lower bound value.
Traits::CRef upper() const
Return the upper bound value.
const T & lower() const
Return the lower bound value.
virtual ~BoundedVerifier()
Destructor.
void setBounds(typename Traits::CRef lower, typename Traits::CRef upper)
Set both bounds (lower and upper) at the same time.
static PVal new_(Type right)
some kind of "copy" constructor
static void assign(Type v1, CRef v2)
void setUpper(const T &value)
Set upper bound value.
static void assign(Type v1, PRef v2)
const T & upper() const
Return the upper bound value.
void setLower(typename Traits::CRef value)
Set lower bound value.
static PVal new_()
some kind of "default" constructor
bool isValid(const typename Traits::CVal value) const
Check if the value is within bounds.
static bool less(CRef v1, CRef v2)
static PVal copy(PVal *right, const bool own)
some kind of "smart"-pseudo-constructor
bool hasLower() const
Return if it has a lower bound.
bool m_hasLowerBound
Data and Function Members for This Class Implementation.
bool hasUpper() const
Return if it has a lower bound.
void setLower(const T &value)
Set lower bound value.
This is a number of static methods for bootstrapping the Gaudi framework.
Gaudi::Utils::PropertyTypeTraits< T[N]> Traits
Type
the list of available types for ntuples
void setUpper(typename Traits::CRef value)
Set upper bound value.
void clearUpper()
Clear upper bound value.
Traits::CRef lower() const
Return the lower bound value.
BoundedVerifier()
Constructors.
static bool less(CRef v1, Type v2)