| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*************************************** | ||
| 2 | Auteur : Thibaut Oprinsen | ||
| 3 | Mail : thibaut.oprinsen@lapp.in2p3.fr | ||
| 4 | Licence : CeCILL-C | ||
| 5 | ****************************************/ | ||
| 6 | |||
| 7 | #include "PNanobindTraitBackendManager.h" | ||
| 8 | |||
| 9 | ///Default constructor of PNanobindTraitBackendManager | ||
| 10 | 1 | PNanobindTraitBackendManager::PNanobindTraitBackendManager(){ | |
| 11 |
1/1✓ Branch 0 (3→4) taken 1 times.
|
1 | initialisationPNanobindTraitBackendManager(); |
| 12 | 1 | } | |
| 13 | |||
| 14 | ///Destructor of PNanobindTraitBackendManager | ||
| 15 | 1 | PNanobindTraitBackendManager::~PNanobindTraitBackendManager(){ | |
| 16 | 1 | clear(); | |
| 17 | 1 | } | |
| 18 | |||
| 19 | ///Add extra include on the header | ||
| 20 | /** @param[out] setInclude : set of all includes | ||
| 21 | * @param[out] fs : file to be completed | ||
| 22 | * @param mode : mode of the generator | ||
| 23 | */ | ||
| 24 | 2 | void PNanobindTraitBackendManager::headerExtraInclude(std::set<std::string> & setInclude, const PClassConfig & classConfig, const GeneratorMode & mode) const{ | |
| 25 |
2/2✓ Branch 0 (16→3) taken 14 times.
✓ Branch 1 (16→17) taken 2 times.
|
32 | for(PVecNanobindTraitBackend::const_iterator it(p_vecTrait.begin()); it != p_vecTrait.end(); ++it){ |
| 26 |
1/1✓ Branch 0 (5→6) taken 14 times.
|
14 | (*it)->headerExtraInclude(setInclude, classConfig, mode); |
| 27 | } | ||
| 28 | 2 | } | |
| 29 | |||
| 30 | ///Add extra include on the test header | ||
| 31 | /** @param[out] fs : file to be completed | ||
| 32 | * @param mode : mode of the generator | ||
| 33 | */ | ||
| 34 | 2 | void PNanobindTraitBackendManager::headerTestInclude(std::ofstream & fs, const GeneratorMode & mode, const PString & baseFileName) const{ | |
| 35 |
2/2✓ Branch 0 (16→3) taken 14 times.
✓ Branch 1 (16→17) taken 2 times.
|
32 | for(PVecNanobindTraitBackend::const_iterator it(p_vecTrait.begin()); it != p_vecTrait.end(); ++it){ |
| 36 |
1/1✓ Branch 0 (5→6) taken 14 times.
|
14 | (*it)->headerTestInclude(fs, mode, baseFileName); |
| 37 | } | ||
| 38 | 2 | } | |
| 39 | |||
| 40 | ///Registration of property | ||
| 41 | /** @param[out] fs : file to be completed | ||
| 42 | * @param classConfig : PClassConfig to be used | ||
| 43 | * @param mode : mode of the generator | ||
| 44 | */ | ||
| 45 | 2 | void PNanobindTraitBackendManager::registerProperty(std::ofstream & fs, const PClassConfig & classConfig, const GeneratorMode & mode) const{ | |
| 46 |
2/2✓ Branch 0 (16→3) taken 14 times.
✓ Branch 1 (16→17) taken 2 times.
|
32 | for(PVecNanobindTraitBackend::const_iterator it(p_vecTrait.begin()); it != p_vecTrait.end(); ++it){ |
| 47 |
1/1✓ Branch 0 (5→6) taken 14 times.
|
14 | (*it)->registerProperty(fs, classConfig, mode);; |
| 48 | } | ||
| 49 | 2 | } | |
| 50 | |||
| 51 | ///Registration of method | ||
| 52 | /** @param[out] fs : file to be completed | ||
| 53 | * @param classConfig : PClassConfig to be used | ||
| 54 | * @param mode : mode of the generator | ||
| 55 | */ | ||
| 56 | 2 | void PNanobindTraitBackendManager::registerMethod(std::ofstream & fs, const PClassConfig & classConfig, const GeneratorMode & mode) const{ | |
| 57 |
2/2✓ Branch 0 (16→3) taken 14 times.
✓ Branch 1 (16→17) taken 2 times.
|
32 | for(PVecNanobindTraitBackend::const_iterator it(p_vecTrait.begin()); it != p_vecTrait.end(); ++it){ |
| 58 |
1/1✓ Branch 0 (5→6) taken 14 times.
|
14 | (*it)->registerMethod(fs, classConfig, mode);; |
| 59 | } | ||
| 60 | 2 | } | |
| 61 | |||
| 62 | ///Registration of static method | ||
| 63 | /** @param[out] fs : file to be completed | ||
| 64 | * @param classConfig : PClassConfig to be used | ||
| 65 | * @param mode : mode of the generator | ||
| 66 | */ | ||
| 67 | 2 | void PNanobindTraitBackendManager::registerStaticMethod(std::ofstream & fs, const PClassConfig & classConfig, const GeneratorMode & mode) const{ | |
| 68 |
2/2✓ Branch 0 (16→3) taken 14 times.
✓ Branch 1 (16→17) taken 2 times.
|
32 | for(PVecNanobindTraitBackend::const_iterator it(p_vecTrait.begin()); it != p_vecTrait.end(); ++it){ |
| 69 |
1/1✓ Branch 0 (5→6) taken 14 times.
|
14 | (*it)->registerStaticMethod(fs, classConfig, mode);; |
| 70 | } | ||
| 71 | 2 | } | |
| 72 | |||
| 73 | ///Registration of constructor | ||
| 74 | /** @param[out] fs : file to be completed | ||
| 75 | * @param classConfig : PClassConfig to be used | ||
| 76 | * @param mode : mode of the generator | ||
| 77 | */ | ||
| 78 | 2 | void PNanobindTraitBackendManager::registerConstructor(std::ofstream & fs, const PClassConfig & classConfig, const GeneratorMode & mode) const{ | |
| 79 |
2/2✓ Branch 0 (16→3) taken 14 times.
✓ Branch 1 (16→17) taken 2 times.
|
32 | for(PVecNanobindTraitBackend::const_iterator it(p_vecTrait.begin()); it != p_vecTrait.end(); ++it){ |
| 80 |
1/1✓ Branch 0 (5→6) taken 14 times.
|
14 | (*it)->registerConstructor(fs, classConfig, mode);; |
| 81 | } | ||
| 82 | 2 | } | |
| 83 | |||
| 84 | ///Implementation of test function | ||
| 85 | /** @param[out] fs : file to be completed | ||
| 86 | * @param classConfig : PClassConfig to be used | ||
| 87 | * @param mode : mode of the generator | ||
| 88 | */ | ||
| 89 | 2 | void PNanobindTraitBackendManager::testFunction(std::ofstream & fs, const PClassConfig & classConfig, const GeneratorMode & mode, const PString & baseFileName) const{ | |
| 90 |
2/2✓ Branch 0 (16→3) taken 14 times.
✓ Branch 1 (16→17) taken 2 times.
|
32 | for(PVecNanobindTraitBackend::const_iterator it(p_vecTrait.begin()); it != p_vecTrait.end(); ++it){ |
| 91 |
1/1✓ Branch 0 (5→6) taken 14 times.
|
14 | (*it)->testFunction(fs, classConfig, mode, baseFileName);; |
| 92 | } | ||
| 93 | 2 | } | |
| 94 | |||
| 95 | ///Call of the test function | ||
| 96 | /** @param[out] fs : file to be completed | ||
| 97 | * @param classConfig : PClassConfig to be used | ||
| 98 | * @param mode : mode of the generator | ||
| 99 | */ | ||
| 100 | ✗ | void PNanobindTraitBackendManager::testCallFunction(std::ofstream & fs, const PClassConfig & classConfig, const GeneratorMode & mode) const{ | |
| 101 | ✗ | for(PVecNanobindTraitBackend::const_iterator it(p_vecTrait.begin()); it != p_vecTrait.end(); ++it){ | |
| 102 | ✗ | (*it)->testCallFunction(fs, classConfig, mode);; | |
| 103 | } | ||
| 104 | ✗ | } | |
| 105 | |||
| 106 | ///Clear the PNanobindTraitBackendManager | ||
| 107 | 1 | void PNanobindTraitBackendManager::clear(){ | |
| 108 |
2/2✓ Branch 0 (21→7) taken 7 times.
✓ Branch 1 (21→22) taken 1 times.
|
17 | for(PVecNanobindTraitBackend::const_iterator it(p_vecTrait.begin()); it != p_vecTrait.end(); ++it){ |
| 109 |
1/2✓ Branch 0 (9→10) taken 7 times.
✗ Branch 1 (9→11) not taken.
|
7 | delete *it; |
| 110 | } | ||
| 111 | 1 | p_vecTrait.clear(); | |
| 112 | 1 | } | |
| 113 | |||
| 114 | ///Initialisation function of the class PNanobindTraitBackendManager | ||
| 115 | 1 | void PNanobindTraitBackendManager::initialisationPNanobindTraitBackendManager(){ | |
| 116 | |||
| 117 | 1 | } | |
| 118 |