| Directory: | ./ | 
|---|---|
| File: | build/src/type_stream_get_type.cpp | 
| Date: | 2024-12-09 11:00:39 | 
| Exec | Total | Coverage | |
|---|---|---|---|
| Lines: | 44 | 44 | 100.0% | 
| Branches: | 11 | 11 | 100.0% | 
| Line | Branch | Exec | Source | 
|---|---|---|---|
| 1 | |||
| 2 | /*************************************** | ||
| 3 | Auteur : Pierre Aubert | ||
| 4 | Mail : pierre.aubert@lapp.in2p3.fr | ||
| 5 | Licence : CeCILL-C | ||
| 6 | ****************************************/ | ||
| 7 | |||
| 8 | |||
| 9 | #include "type_stream_get_type.h" | ||
| 10 | |||
| 11 | ///Get the corresponding type of given type char | ||
| 12 | /** @return corresponding type : PType | ||
| 13 | */ | ||
| 14 | template<> | ||
| 15 | 1 | PType ts_getType<char>(){ | |
| 16 | 1 | return TYPE_STREAM_CHAR; | |
| 17 | } | ||
| 18 | |||
| 19 | ///Get the corresponding string to describe char type | ||
| 20 | /** @return corresponding string to describe char type | ||
| 21 | */ | ||
| 22 | template<> | ||
| 23 | 2 | std::string ts_getTypeToStr<char>(){ | |
| 24 | 1/1✓ Branch 2 taken 2 times. | 2 | return "char"; | 
| 25 | } | ||
| 26 | |||
| 27 | |||
| 28 | ///Get the corresponding type of given type short | ||
| 29 | /** @return corresponding type : PType | ||
| 30 | */ | ||
| 31 | template<> | ||
| 32 | 1 | PType ts_getType<short>(){ | |
| 33 | 1 | return TYPE_STREAM_SHORT; | |
| 34 | } | ||
| 35 | |||
| 36 | ///Get the corresponding string to describe short type | ||
| 37 | /** @return corresponding string to describe short type | ||
| 38 | */ | ||
| 39 | template<> | ||
| 40 | 2 | std::string ts_getTypeToStr<short>(){ | |
| 41 | 1/1✓ Branch 2 taken 2 times. | 2 | return "short"; | 
| 42 | } | ||
| 43 | |||
| 44 | |||
| 45 | ///Get the corresponding type of given type int | ||
| 46 | /** @return corresponding type : PType | ||
| 47 | */ | ||
| 48 | template<> | ||
| 49 | 26 | PType ts_getType<int>(){ | |
| 50 | 26 | return TYPE_STREAM_INT; | |
| 51 | } | ||
| 52 | |||
| 53 | ///Get the corresponding string to describe int type | ||
| 54 | /** @return corresponding string to describe int type | ||
| 55 | */ | ||
| 56 | template<> | ||
| 57 | 14 | std::string ts_getTypeToStr<int>(){ | |
| 58 | 1/1✓ Branch 2 taken 14 times. | 14 | return "int"; | 
| 59 | } | ||
| 60 | |||
| 61 | |||
| 62 | ///Get the corresponding type of given type long | ||
| 63 | /** @return corresponding type : PType | ||
| 64 | */ | ||
| 65 | template<> | ||
| 66 | 1 | PType ts_getType<long>(){ | |
| 67 | 1 | return TYPE_STREAM_LONG; | |
| 68 | } | ||
| 69 | |||
| 70 | ///Get the corresponding string to describe long type | ||
| 71 | /** @return corresponding string to describe long type | ||
| 72 | */ | ||
| 73 | template<> | ||
| 74 | 2 | std::string ts_getTypeToStr<long>(){ | |
| 75 | 1/1✓ Branch 2 taken 2 times. | 2 | return "long"; | 
| 76 | } | ||
| 77 | |||
| 78 | |||
| 79 | ///Get the corresponding type of given type unsigned char | ||
| 80 | /** @return corresponding type : PType | ||
| 81 | */ | ||
| 82 | template<> | ||
| 83 | 1 | PType ts_getType<unsigned char>(){ | |
| 84 | 1 | return TYPE_STREAM_UNSIGNED_CHAR; | |
| 85 | } | ||
| 86 | |||
| 87 | ///Get the corresponding string to describe unsigned char type | ||
| 88 | /** @return corresponding string to describe unsigned char type | ||
| 89 | */ | ||
| 90 | template<> | ||
| 91 | 2 | std::string ts_getTypeToStr<unsigned char>(){ | |
| 92 | 1/1✓ Branch 2 taken 2 times. | 2 | return "unsigned char"; | 
| 93 | } | ||
| 94 | |||
| 95 | |||
| 96 | ///Get the corresponding type of given type unsigned short | ||
| 97 | /** @return corresponding type : PType | ||
| 98 | */ | ||
| 99 | template<> | ||
| 100 | 1 | PType ts_getType<unsigned short>(){ | |
| 101 | 1 | return TYPE_STREAM_UNSIGNED_SHORT; | |
| 102 | } | ||
| 103 | |||
| 104 | ///Get the corresponding string to describe unsigned short type | ||
| 105 | /** @return corresponding string to describe unsigned short type | ||
| 106 | */ | ||
| 107 | template<> | ||
| 108 | 2 | std::string ts_getTypeToStr<unsigned short>(){ | |
| 109 | 1/1✓ Branch 2 taken 2 times. | 2 | return "unsigned short"; | 
| 110 | } | ||
| 111 | |||
| 112 | |||
| 113 | ///Get the corresponding type of given type unsigned int | ||
| 114 | /** @return corresponding type : PType | ||
| 115 | */ | ||
| 116 | template<> | ||
| 117 | 1 | PType ts_getType<unsigned int>(){ | |
| 118 | 1 | return TYPE_STREAM_UNSIGNED_INT; | |
| 119 | } | ||
| 120 | |||
| 121 | ///Get the corresponding string to describe unsigned int type | ||
| 122 | /** @return corresponding string to describe unsigned int type | ||
| 123 | */ | ||
| 124 | template<> | ||
| 125 | 2 | std::string ts_getTypeToStr<unsigned int>(){ | |
| 126 | 1/1✓ Branch 2 taken 2 times. | 2 | return "unsigned int"; | 
| 127 | } | ||
| 128 | |||
| 129 | |||
| 130 | ///Get the corresponding type of given type unsigned long | ||
| 131 | /** @return corresponding type : PType | ||
| 132 | */ | ||
| 133 | template<> | ||
| 134 | 81 | PType ts_getType<unsigned long>(){ | |
| 135 | 81 | return TYPE_STREAM_UNSIGNED_LONG; | |
| 136 | } | ||
| 137 | |||
| 138 | ///Get the corresponding string to describe unsigned long type | ||
| 139 | /** @return corresponding string to describe unsigned long type | ||
| 140 | */ | ||
| 141 | template<> | ||
| 142 | 110 | std::string ts_getTypeToStr<unsigned long>(){ | |
| 143 | 1/1✓ Branch 2 taken 110 times. | 110 | return "unsigned long"; | 
| 144 | } | ||
| 145 | |||
| 146 | |||
| 147 | ///Get the corresponding type of given type bool | ||
| 148 | /** @return corresponding type : PType | ||
| 149 | */ | ||
| 150 | template<> | ||
| 151 | 5 | PType ts_getType<bool>(){ | |
| 152 | 5 | return TYPE_STREAM_BOOL; | |
| 153 | } | ||
| 154 | |||
| 155 | ///Get the corresponding string to describe bool type | ||
| 156 | /** @return corresponding string to describe bool type | ||
| 157 | */ | ||
| 158 | template<> | ||
| 159 | 6 | std::string ts_getTypeToStr<bool>(){ | |
| 160 | 1/1✓ Branch 2 taken 6 times. | 6 | return "bool"; | 
| 161 | } | ||
| 162 | |||
| 163 | |||
| 164 | ///Get the corresponding type of given type float | ||
| 165 | /** @return corresponding type : PType | ||
| 166 | */ | ||
| 167 | template<> | ||
| 168 | 4 | PType ts_getType<float>(){ | |
| 169 | 4 | return TYPE_STREAM_FLOAT; | |
| 170 | } | ||
| 171 | |||
| 172 | ///Get the corresponding string to describe float type | ||
| 173 | /** @return corresponding string to describe float type | ||
| 174 | */ | ||
| 175 | template<> | ||
| 176 | 9 | std::string ts_getTypeToStr<float>(){ | |
| 177 | 1/1✓ Branch 2 taken 9 times. | 9 | return "float"; | 
| 178 | } | ||
| 179 | |||
| 180 | |||
| 181 | ///Get the corresponding type of given type double | ||
| 182 | /** @return corresponding type : PType | ||
| 183 | */ | ||
| 184 | template<> | ||
| 185 | 1 | PType ts_getType<double>(){ | |
| 186 | 1 | return TYPE_STREAM_DOUBLE; | |
| 187 | } | ||
| 188 | |||
| 189 | ///Get the corresponding string to describe double type | ||
| 190 | /** @return corresponding string to describe double type | ||
| 191 | */ | ||
| 192 | template<> | ||
| 193 | 2 | std::string ts_getTypeToStr<double>(){ | |
| 194 | 1/1✓ Branch 2 taken 2 times. | 2 | return "double"; | 
| 195 | } | ||
| 196 | |||
| 197 | |||
| 198 | |||
| 199 | |||
| 200 |