36 lines
1.0 KiB
C++
36 lines
1.0 KiB
C++
#include "PlatformOption.h"
|
|
#include "lib/md/protos/co2.pb.h"
|
|
|
|
namespace bts::cmds::md {
|
|
|
|
#define NAME_PAIR(val) \
|
|
{ name(val), val }
|
|
|
|
EnumOptionNames<bts::co2::Platform> PlatformOption::names() {
|
|
return {
|
|
NAME_PAIR(co2::PLATFORM_CELOXICA), NAME_PAIR(co2::PLATFORM_ICEONIXS),
|
|
NAME_PAIR(co2::PLATFORM_MDP3EMUMBA), NAME_PAIR(co2::PLATFORM_MDP3ONIXS),
|
|
NAME_PAIR(co2::PLATFORM_SIM), NAME_PAIR(co2::PLATFORM_DERIBIT)};
|
|
}
|
|
|
|
std::string PlatformOption::name(bts::co2::Platform platform) {
|
|
switch (platform) {
|
|
case co2::PLATFORM_CELOXICA:
|
|
return "celoxica";
|
|
case co2::PLATFORM_ICEONIXS:
|
|
return "iceonixs";
|
|
case co2::PLATFORM_MDP3EMUMBA:
|
|
return "mdp3emumba";
|
|
case co2::PLATFORM_MDP3ONIXS:
|
|
return "mdp3onixs";
|
|
case co2::PLATFORM_SIM:
|
|
return "sim";
|
|
case co2::PLATFORM_DERIBIT:
|
|
return "deribit";
|
|
default:
|
|
return std::to_string(static_cast<int32_t>(platform));
|
|
}
|
|
}
|
|
|
|
} // namespace bts::cmds::md
|