support for scoped enums and operators in Python

This commit is contained in:
Erik Frojdh
2021-07-16 14:48:22 +02:00
parent 1b348f9b3a
commit 09391b767a
9 changed files with 138 additions and 21 deletions

View File

@ -395,7 +395,7 @@ typedef struct {
enum timingSourceType { TIMING_INTERNAL, TIMING_EXTERNAL };
#ifdef __cplusplus
enum class EthernetInterface : int32_t {
enum class EthernetInterface {
#else
enum EthernetInterface {
#endif
@ -497,15 +497,15 @@ typedef struct {
#ifdef __cplusplus
};
inline slsDetectorDefs::EthernetInterface
operator|(const slsDetectorDefs::EthernetInterface &a,
const slsDetectorDefs::EthernetInterface &b) {
operator|( const slsDetectorDefs::EthernetInterface &a,
const slsDetectorDefs::EthernetInterface &b) {
return slsDetectorDefs::EthernetInterface(static_cast<int32_t>(a) |
static_cast<int32_t>(b));
};
inline bool operator&(const slsDetectorDefs::EthernetInterface &a,
const slsDetectorDefs::EthernetInterface &b) {
return (static_cast<int32_t>(a) & static_cast<int32_t>(b));
inline slsDetectorDefs::EthernetInterface operator&( const slsDetectorDefs::EthernetInterface &a,
const slsDetectorDefs::EthernetInterface &b) {
return slsDetectorDefs::EthernetInterface(static_cast<int32_t>(a) & static_cast<int32_t>(b));
};
#endif
@ -653,3 +653,4 @@ using Positions = const std::vector<int> &;
using defs = slsDetectorDefs;
} // namespace sls
#endif