| Line | Branch | Exec | Source |
|---|---|---|---|
| 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 | |||
| 12 | ///Default constructor of the ConfigCheckValue | ||
| 13 | /** @param data : pointer to the value to be checked | ||
| 14 | * @param minValue : minimum value boundary | ||
| 15 | * @param isMinInclusive : true if the minimum boundary is inclusive | ||
| 16 | * @param maxValue : maximum value boundary | ||
| 17 | * @param isMaxInclusive : true if the maximum boundary is inclusive | ||
| 18 | * @return true if the value is in the boundaries, false otherwise | ||
| 19 | */ | ||
| 20 | template<typename T> | ||
| 21 | 3 | ConfigCheckValue<T>::ConfigCheckValue(const T* data, const T & minValue, bool isMinInclusive, const T & maxValue, bool isMaxInclusive) | |
| 22 | 3 | :p_data(data), p_minValue(minValue), p_isMinInclusive(isMinInclusive), p_maxValue(maxValue), p_isMaxInclusive(isMaxInclusive) | |
| 23 | 3 | {} | |
| 24 | |||
| 25 | ///Destructor of the ConfigCheckValue | ||
| 26 | template<typename T> | ||
| 27 | 3 | ConfigCheckValue<T>::~ConfigCheckValue(){} | |
| 28 | |||
| 29 | ///Say if the check is OK or not | ||
| 30 | /** @param out : std::ostream to get the error message | ||
| 31 | * @return true if the check is OK, false otherwise | ||
| 32 | */ | ||
| 33 | template<typename T> | ||
| 34 | 4 | bool ConfigCheckValue<T>::isOk(std::ostream & out) const{ | |
| 35 |
1/2✓ Branch 0 (2→3) taken 4 times.
✗ Branch 1 (2→49) not taken.
|
4 | if(p_data != NULL){ |
| 36 |
2/2✓ Branch 0 (4→5) taken 3 times.
✓ Branch 1 (4→6) taken 1 times.
|
4 | if(configCheckValue(*p_data, p_minValue, p_isMinInclusive, p_maxValue, p_isMaxInclusive)){ |
| 37 | 3 | return true; | |
| 38 | }else{ | ||
| 39 |
12/24✓ Branch 0 (9→10) taken 2 times.
✓ Branch 2 (12→7) taken 2 times.
✓ Branch 3 (12→13) taken 1 times.
✓ Branch 4 (15→16) taken 1 times.
✓ Branch 6 (18→19) taken 2 times.
✓ Branch 7 (18→20) taken 1 times.
✓ Branch 8 (23→24) taken 2 times.
✓ Branch 10 (26→21) taken 2 times.
✓ Branch 11 (26→27) taken 1 times.
✓ Branch 12 (29→30) taken 1 times.
✓ Branch 14 (32→33) taken 2 times.
✓ Branch 15 (32→34) taken 1 times.
✗ Branch 16 (58→59) not taken.
✗ Branch 17 (58→60) not taken.
✗ Branch 18 (61→62) not taken.
✗ Branch 19 (61→65) not taken.
✗ Branch 20 (63→64) not taken.
✗ Branch 21 (63→65) not taken.
✗ Branch 22 (74→75) not taken.
✗ Branch 23 (74→76) not taken.
✗ Branch 24 (77→78) not taken.
✗ Branch 25 (77→81) not taken.
✗ Branch 26 (79→80) not taken.
✗ Branch 27 (79→81) not taken.
|
13 | std::vector<std::string> vecMinBoundary{"]", "["}, vecMaxBoundary{"[", "]"}; |
| 40 |
10/10✓ Branch 0 (34→35) taken 1 times.
✓ Branch 2 (35→36) taken 1 times.
✓ Branch 4 (36→37) taken 1 times.
✓ Branch 6 (38→39) taken 1 times.
✓ Branch 8 (39→40) taken 1 times.
✓ Branch 10 (40→41) taken 1 times.
✓ Branch 12 (41→42) taken 1 times.
✓ Branch 14 (43→44) taken 1 times.
✓ Branch 16 (44→45) taken 1 times.
✓ Branch 18 (45→46) taken 1 times.
|
1 | out << "ConfigCheckValue<T>::isOk : value ("<<*p_data<<") not in "<<vecMinBoundary[p_isMinInclusive]<<p_minValue<<", "<<p_maxValue<<vecMaxBoundary[p_isMaxInclusive]<<" in ConfigNode" << std::endl; |
| 41 | 1 | } | |
| 42 | } | ||
| 43 | 1 | return false; | |
| 44 | } | ||
| 45 | |||
| 46 | |||
| 47 | |||
| 48 | #endif | ||
| 49 | |||
| 50 |