33 lines
691 B
C++
33 lines
691 B
C++
#pragma once
|
|
#include <ostream>
|
|
#include <string>
|
|
|
|
namespace bts::md {
|
|
|
|
class MarketDataError {
|
|
public:
|
|
enum Type { DISCONNECTION };
|
|
Type type = Type::DISCONNECTION;
|
|
std::string message = {};
|
|
|
|
constexpr const char *type_name() const noexcept;
|
|
};
|
|
|
|
std::ostream &operator<<(
|
|
std::ostream &out, const MarketDataError &value) noexcept;
|
|
|
|
//////////////////////////////////////////////////
|
|
// Definition
|
|
//////////////////////////////////////////////////
|
|
|
|
constexpr const char *MarketDataError::type_name() const noexcept {
|
|
switch (type) {
|
|
case MarketDataError::DISCONNECTION:
|
|
return "DISCONNECTION";
|
|
default:
|
|
return "UNKNOWN";
|
|
}
|
|
}
|
|
|
|
} // namespace bts::md
|