PhoenixFileParser  1.5.1
Set of tools to ease file parsing
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
20template<typename T>
21ConfigCheckValue<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
26template<typename T>
28
30
33template<typename T>
34bool ConfigCheckValue<T>::isOk(std::ostream & out) const{
35 if(p_data != NULL){
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
virtual bool isOk(std::ostream &out) const
Say if the check is OK or not.
bool p_isMinInclusive
true if the minimum boundary is inclusive
Definition ConfigCheck.h:28
ConfigCheckValue(const T *data, const T &minValue, bool isMinInclusive, const T &maxValue, bool isMaxInclusive)
Default constructor of the ConfigCheckValue.
virtual ~ConfigCheckValue()
Destructor of the ConfigCheckValue.
const T * p_data
value to be checked
Definition ConfigCheck.h:24
T p_maxValue
maximum value boundary
Definition ConfigCheck.h:30
T p_minValue
minimum value boundary
Definition ConfigCheck.h:26
bool p_isMaxInclusive
true if the maximum boundary is inclusive
Definition ConfigCheck.h:32
bool configCheckValue(T value, T minValue, bool isMinInclusive, T maxValue, bool isMaxInclusive)
Check if the given value is in the given boundaries.