GCC Code Coverage Report


Directory: ./
File: src/Representation/PWrapperTraitBackendManager.cpp
Date: 2025-12-15 11:32:44
Exec Total Coverage
Lines: 45 49 91.8%
Functions: 12 14 85.7%
Branches: 28 32 87.5%

Line Branch Exec Source
1 /***************************************
2 Auteur : Pierre Aubert
3 Mail : pierre.aubert@lapp.in2p3.fr
4 Licence : CeCILL-C
5 ****************************************/
6
7
8 #include "PWrapperTraitBackendManager.h"
9
10 ///Default constructor of PWrapperTraitBackendManager
11 2 PWrapperTraitBackendManager::PWrapperTraitBackendManager(){
12
1/1
✓ Branch 0 (3→4) taken 2 times.
2 initialisationPWrapperTraitBackendManager();
13 2 }
14
15 ///Destructor of PWrapperTraitBackendManager
16 2 PWrapperTraitBackendManager::~PWrapperTraitBackendManager(){
17 2 clear();
18 2 }
19
20 ///Add extra include on the header
21 /** @param[out] fs : file to be completed
22 * @param mode : mode of the generator
23 */
24 3 void PWrapperTraitBackendManager::headerExtraInclude(std::ofstream & fs, const GeneratorMode & mode) const{
25
2/2
✓ Branch 0 (16→3) taken 9 times.
✓ Branch 1 (16→17) taken 3 times.
24 for(PVecWrapperTraitBackend::const_iterator it(p_vecTrait.begin()); it != p_vecTrait.end(); ++it){
26
1/1
✓ Branch 0 (5→6) taken 9 times.
9 (*it)->headerExtraInclude(fs, mode);
27 }
28 3 }
29
30 ///Declaration of class method
31 /** @param[out] fs : file to be completed
32 * @param classConfig : PClassConfig to be used
33 * @param mode : mode of the generator
34 */
35 3 void PWrapperTraitBackendManager::classMethodDeclaration(std::ofstream & fs, const PClassConfig & classConfig, const GeneratorMode & mode) const{
36
2/2
✓ Branch 0 (16→3) taken 9 times.
✓ Branch 1 (16→17) taken 3 times.
24 for(PVecWrapperTraitBackend::const_iterator it(p_vecTrait.begin()); it != p_vecTrait.end(); ++it){
37
1/1
✓ Branch 0 (5→6) taken 9 times.
9 (*it)->classMethodDeclaration(fs, classConfig, mode);
38 }
39 3 }
40
41 ///Implementation of class method
42 /** @param[out] fs : file to be completed
43 * @param classConfig : PClassConfig to be used
44 * @param mode : mode of the generator
45 */
46 3 void PWrapperTraitBackendManager::classMethodImplementation(std::ofstream & fs, const PClassConfig & classConfig, const GeneratorMode & mode) const{
47
2/2
✓ Branch 0 (16→3) taken 9 times.
✓ Branch 1 (16→17) taken 3 times.
24 for(PVecWrapperTraitBackend::const_iterator it(p_vecTrait.begin()); it != p_vecTrait.end(); ++it){
48
1/1
✓ Branch 0 (5→6) taken 9 times.
9 (*it)->classMethodImplementation(fs, classConfig, mode);
49 }
50 3 }
51
52 ///Register class member
53 /** @param[out] fs : file to be completed
54 * @param classConfig : PClassConfig to be used
55 * @param mode : mode of the generator
56 */
57 3 void PWrapperTraitBackendManager::registerClassMember(std::ofstream & fs, const PClassConfig & classConfig, const GeneratorMode & mode) const{
58
2/2
✓ Branch 0 (16→3) taken 9 times.
✓ Branch 1 (16→17) taken 3 times.
24 for(PVecWrapperTraitBackend::const_iterator it(p_vecTrait.begin()); it != p_vecTrait.end(); ++it){
59
1/1
✓ Branch 0 (5→6) taken 9 times.
9 (*it)->registerClassMember(fs, classConfig, mode);
60 }
61 3 }
62
63 ///Register class getter and setter
64 /** @param[out] fs : file to be completed
65 * @param classConfig : PClassConfig to be used
66 * @param mode : mode of the generator
67 */
68 3 void PWrapperTraitBackendManager::registerClassGetterSetter(std::ofstream & fs, const PClassConfig & classConfig, const GeneratorMode & mode) const{
69
2/2
✓ Branch 0 (16→3) taken 9 times.
✓ Branch 1 (16→17) taken 3 times.
24 for(PVecWrapperTraitBackend::const_iterator it(p_vecTrait.begin()); it != p_vecTrait.end(); ++it){
70
1/1
✓ Branch 0 (5→6) taken 9 times.
9 (*it)->registerClassGetterSetter(fs, classConfig, mode);
71 }
72 3 }
73
74 ///Register class method
75 /** @param[out] fs : file to be completed
76 * @param classConfig : PClassConfig to be used
77 * @param mode : mode of the generator
78 */
79 3 void PWrapperTraitBackendManager::registerClassMethod(std::ofstream & fs, const PClassConfig & classConfig, const GeneratorMode & mode) const{
80
2/2
✓ Branch 0 (16→3) taken 9 times.
✓ Branch 1 (16→17) taken 3 times.
24 for(PVecWrapperTraitBackend::const_iterator it(p_vecTrait.begin()); it != p_vecTrait.end(); ++it){
81
1/1
✓ Branch 0 (5→6) taken 9 times.
9 (*it)->registerClassMethod(fs, classConfig, mode);
82 }
83 3 }
84
85 ///Implementation of test function
86 /** @param[out] fs : file to be completed
87 * @param classConfig : PClassConfig to be used
88 * @param mode : mode of the generator
89 */
90 5 void PWrapperTraitBackendManager::testFunction(std::ofstream & fs, const PClassConfig & classConfig, const GeneratorMode & mode) const{
91
2/2
✓ Branch 0 (16→3) taken 15 times.
✓ Branch 1 (16→17) taken 5 times.
40 for(PVecWrapperTraitBackend::const_iterator it(p_vecTrait.begin()); it != p_vecTrait.end(); ++it){
92
1/1
✓ Branch 0 (5→6) taken 15 times.
15 (*it)->testFunction(fs, classConfig, mode);
93 }
94 5 }
95
96 ///Call of the test function
97 /** @param[out] fs : file to be completed
98 * @param classConfig : PClassConfig to be used
99 * @param mode : mode of the generator
100 */
101 void PWrapperTraitBackendManager::testCallFunction(std::ofstream & fs, const PClassConfig & classConfig, const GeneratorMode & mode) const{
102 for(PVecWrapperTraitBackend::const_iterator it(p_vecTrait.begin()); it != p_vecTrait.end(); ++it){
103 (*it)->testCallFunction(fs, classConfig, mode);
104 }
105 }
106
107 ///Add dependency in the setup.py
108 /** @param[out] fs : file to be completed
109 * @param mode : mode of the generator
110 */
111 2 void PWrapperTraitBackendManager::setupAddDependency(std::ofstream & fs, const GeneratorMode & mode) const{
112
2/2
✓ Branch 0 (16→3) taken 6 times.
✓ Branch 1 (16→17) taken 2 times.
16 for(PVecWrapperTraitBackend::const_iterator it(p_vecTrait.begin()); it != p_vecTrait.end(); ++it){
113
1/1
✓ Branch 0 (5→6) taken 6 times.
6 (*it)->setupAddDependency(fs, mode);
114 }
115 2 }
116
117 ///Clear the PWrapperTraitBackendManager
118 2 void PWrapperTraitBackendManager::clear(){
119
2/2
✓ Branch 0 (21→7) taken 6 times.
✓ Branch 1 (21→22) taken 2 times.
18 for(PVecWrapperTraitBackend::const_iterator it(p_vecTrait.begin()); it != p_vecTrait.end(); ++it){
120
1/2
✓ Branch 0 (9→10) taken 6 times.
✗ Branch 1 (9→11) not taken.
6 delete *it;
121 }
122 2 p_vecTrait.clear();
123 2 }
124
125 ///Initialisation function of the class PWrapperTraitBackendManager
126 2 void PWrapperTraitBackendManager::initialisationPWrapperTraitBackendManager(){
127
128 2 }
129
130
131
132
133
134