-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenum.h
46 lines (41 loc) · 800 Bytes
/
enum.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef ENUM_H
#define ENUM_H
#ifdef __cplusplus
#include <string>
namespace sls
{
#endif
#ifdef __cplusplus
enum class detectorType
#else
enum detectorType
#endif
{
EIGER,
JUNGFRAU,
GOTTHARD
};
#ifdef __cplusplus
constexpr auto EIGER = detectorType::EIGER;
constexpr auto JUNGFRAU = detectorType::JUNGFRAU;
constexpr auto GOTTHARD = detectorType::GOTTHARD;
std::string detectorTypeToString(detectorType type){
#else
const char* detectorTypeToString(enum detectorType type){
#endif
switch (type)
{
case EIGER:
return "Eiger";
case JUNGFRAU:
return "Jungfrau";
case GOTTHARD:
return "Gotthard";
default:
return "Undefined";
}
}
#ifdef __cplusplus
} //namespace sls
#endif
#endif //ENUM_H