| Directory: | ./ |
|---|---|
| File: | src/phoenix_composeType_impl.h |
| Date: | 2024-12-09 11:00:39 |
| Exec | Total | Coverage | |
|---|---|---|---|
| Lines: | 11 | 13 | 84.6% |
| Branches: | 3 | 3 | 100.0% |
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*************************************** | ||
| 2 | Auteur : Pierre Aubert | ||
| 3 | Mail : pierre.aubert@lapp.in2p3.fr | ||
| 4 | Licence : CeCILL-C | ||
| 5 | ****************************************/ | ||
| 6 | |||
| 7 | #ifndef __PHOENIX_COMPOSETYPE_IMPL_H__ | ||
| 8 | #define __PHOENIX_COMPOSETYPE_IMPL_H__ | ||
| 9 | |||
| 10 | #include "phoenix_composeType.h" | ||
| 11 | |||
| 12 | ///Get the corresponding type of a string | ||
| 13 | /** @return corresponding string | ||
| 14 | */ | ||
| 15 | template<typename T> | ||
| 16 | 1 | std::string phoenix_getTypeToStr(){ | |
| 17 | 1 | return TypeStream<T >::getTypeToStr(); | |
| 18 | } | ||
| 19 | |||
| 20 | ///Get the corresponding type of a string | ||
| 21 | /** @param data : parameter used to get its type | ||
| 22 | * @return corresponding string | ||
| 23 | */ | ||
| 24 | template<typename T> | ||
| 25 | ✗ | std::string phoenix_getTypeToStr(const T & data){ | |
| 26 | ✗ | return TypeStream<T >::getTypeToStr(); | |
| 27 | } | ||
| 28 | |||
| 29 | ///Get the corresponding compose type of a template type | ||
| 30 | /** @return corresponding compose type of a template type | ||
| 31 | */ | ||
| 32 | template<typename T> | ||
| 33 | 70 | PComposeType phoenix_getComposeType(){ | |
| 34 | 70 | return TypeStream<T>::getType(); | |
| 35 | } | ||
| 36 | |||
| 37 | ///Get the corresponding compose type of a template type | ||
| 38 | /** @param data : parameter used to be get its type | ||
| 39 | * @return corresponding compose type of a template type | ||
| 40 | */ | ||
| 41 | template<typename T> | ||
| 42 | 43 | PComposeType phoenix_getComposeType(const T & data){ | |
| 43 | 43 | return TypeStream<T>::getType(); | |
| 44 | } | ||
| 45 | |||
| 46 | ///Get the corresponding compose var of a template type | ||
| 47 | /** @param name : name of the PComposeVar to be created | ||
| 48 | * @return corresponding PComposeVar | ||
| 49 | */ | ||
| 50 | template<typename T> | ||
| 51 | 55 | PComposeVar phoenix_getComposeVar(const std::string & name){ | |
| 52 | 55 | PComposeVar var; | |
| 53 |
1/1✓ Branch 1 taken 55 times.
|
55 | var.setName(name); |
| 54 |
2/2✓ Branch 1 taken 55 times.
✓ Branch 4 taken 55 times.
|
55 | var.setType(phoenix_getComposeType<T>()); |
| 55 | 55 | return var; | |
| 56 | } | ||
| 57 | |||
| 58 | #endif | ||
| 59 |