PhoenixFileParser
1.7.3
Set of tools to ease file parsing
Toggle main menu visibility
Loading...
Searching...
No Matches
ConfigCheck_impl.h
Go to the documentation of this file.
1
/***************************************
2
Auteur : Pierre Aubert
3
Mail : pierre.aubert@lapp.in2p3.fr
4
Licence : CeCILL-C
5
****************************************/
6
7
#ifndef __CONFIG_CHECK_IMPL_H__
8
#define __CONFIG_CHECK_IMPL_H__
9
10
#include "
GenericConfigCheck.h
"
11
13
20
template
<
typename
T>
21
ConfigCheckValue<T>::ConfigCheckValue
(
const
T* data,
const
T & minValue,
bool
isMinInclusive,
const
T & maxValue,
bool
isMaxInclusive)
22
:
p_data
(data),
p_minValue
(minValue),
p_isMinInclusive
(isMinInclusive),
p_maxValue
(maxValue),
p_isMaxInclusive
(isMaxInclusive)
23
{}
24
26
template
<
typename
T>
27
ConfigCheckValue<T>::~ConfigCheckValue
(){}
28
30
33
template
<
typename
T>
34
bool
ConfigCheckValue<T>::isOk
(std::ostream & out)
const
{
35
if
(
p_data
!= NULL){
36
if
(
configCheckValue
(*
p_data
,
p_minValue
,
p_isMinInclusive
,
p_maxValue
,
p_isMaxInclusive
)){
37
return
true
;
38
}
else
{
39
std::vector<std::string> vecMinBoundary{
"]"
,
"["
}, vecMaxBoundary{
"["
,
"]"
};
40
out <<
"ConfigCheckValue<T>::isOk : value ("
<<*
p_data
<<
") not in "
<<vecMinBoundary[
p_isMinInclusive
]<<
p_minValue
<<
", "
<<
p_maxValue
<<vecMaxBoundary[
p_isMaxInclusive
]<<
" in ConfigNode"
<< std::endl;
41
}
42
}
43
return
false
;
44
}
45
46
47
48
#endif
49
GenericConfigCheck.h
ConfigCheckValue::isOk
virtual bool isOk(std::ostream &out) const
Say if the check is OK or not.
Definition
ConfigCheck_impl.h:34
ConfigCheckValue::p_isMinInclusive
bool p_isMinInclusive
true if the minimum boundary is inclusive
Definition
ConfigCheck.h:28
ConfigCheckValue::ConfigCheckValue
ConfigCheckValue(const T *data, const T &minValue, bool isMinInclusive, const T &maxValue, bool isMaxInclusive)
Default constructor of the ConfigCheckValue.
Definition
ConfigCheck_impl.h:21
ConfigCheckValue::~ConfigCheckValue
virtual ~ConfigCheckValue()
Destructor of the ConfigCheckValue.
Definition
ConfigCheck_impl.h:27
ConfigCheckValue::p_data
const T * p_data
value to be checked
Definition
ConfigCheck.h:24
ConfigCheckValue::p_maxValue
T p_maxValue
maximum value boundary
Definition
ConfigCheck.h:30
ConfigCheckValue::p_minValue
T p_minValue
minimum value boundary
Definition
ConfigCheck.h:26
ConfigCheckValue::p_isMaxInclusive
bool p_isMaxInclusive
true if the maximum boundary is inclusive
Definition
ConfigCheck.h:32
configCheckValue
bool configCheckValue(T value, T minValue, bool isMinInclusive, T maxValue, bool isMaxInclusive)
Check if the given value is in the given boundaries.
Definition
configCheckValue_impl.h:21
src
ConfigCheck_impl.h
Generated by
1.17.0