| 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 "wrapper_convertType.h" | ||
| 9 | |||
| 10 | ///Gets the python API str type of the correcponding numpy C/C++ type | ||
| 11 | /** @param typeStr : C/C++ type | ||
| 12 | * @return python str type of the correcponding C/C++ type | ||
| 13 | * See documentation : https://docs.python.org/3/c-api/structures.html | ||
| 14 | */ | ||
| 15 | 3 | PString getPythonStrForPythonApiType(const PString & typeStr){ | |
| 16 |
1/2✗ Branch 0 (3→4) not taken.
✓ Branch 1 (3→5) taken 3 times.
|
3 | if(typeStr == "char") return "T_CHAR"; |
| 17 |
1/2✗ Branch 0 (6→7) not taken.
✓ Branch 1 (6→8) taken 3 times.
|
3 | else if(typeStr == "bool") return "T_BOOL"; |
| 18 |
1/2✗ Branch 0 (9→10) not taken.
✓ Branch 1 (9→11) taken 3 times.
|
3 | else if(typeStr == "short") return "T_SHORT"; |
| 19 |
1/2✗ Branch 0 (12→13) not taken.
✓ Branch 1 (12→14) taken 3 times.
|
3 | else if(typeStr == "unsigned short") return "T_USHORT"; |
| 20 |
2/2✓ Branch 0 (15→16) taken 2 times.
✓ Branch 1 (15→17) taken 1 times.
|
3 | else if(typeStr == "int") return "T_INT"; |
| 21 |
1/2✗ Branch 0 (18→19) not taken.
✓ Branch 1 (18→20) taken 1 times.
|
1 | else if(typeStr == "unsigned int") return "T_UINT"; |
| 22 |
3/6✓ Branch 0 (21→22) taken 1 times.
✗ Branch 1 (21→24) not taken.
✗ Branch 2 (23→24) not taken.
✓ Branch 3 (23→25) taken 1 times.
✗ Branch 4 (26→27) not taken.
✓ Branch 5 (26→28) taken 1 times.
|
1 | else if(typeStr == "ssize_t" || typeStr == "long int") return "T_LONG"; |
| 23 |
3/6✓ Branch 0 (29→30) taken 1 times.
✗ Branch 1 (29→32) not taken.
✗ Branch 2 (31→32) not taken.
✓ Branch 3 (31→33) taken 1 times.
✗ Branch 4 (34→35) not taken.
✓ Branch 5 (34→36) taken 1 times.
|
1 | else if(typeStr == "size_t" || typeStr == "long unsigned int") return "T_ULONG"; |
| 24 |
1/2✓ Branch 0 (37→38) taken 1 times.
✗ Branch 1 (37→39) not taken.
|
1 | else if(typeStr == "float") return "T_FLOAT"; |
| 25 | ✗ | else if(typeStr == "double") return "T_DOUBLE"; | |
| 26 | ✗ | else return ""; | |
| 27 | } | ||
| 28 | |||
| 29 | |||
| 30 | |||
| 31 |