diag: Add output op & fmt impl for SecurityMarketDataStatistics
This commit is contained in:
1 parent
38a5d95df9
commit
4304d7f786
1 file changed
+27
@@ -2,6 +2,9 @@
|
||||
#include "Price.h"
|
||||
#include "Quantity.h"
|
||||
#include "Security.h"
|
||||
#include "lib/core/FMT_IMPL.h"
|
||||
#include <fmt/format.h>
|
||||
#include <ostream>
|
||||
|
||||
namespace bts::domain {
|
||||
|
||||
@@ -15,4 +18,28 @@ class SecurityMarketDataStatistics {
|
||||
Quantity volume;
|
||||
};
|
||||
|
||||
std::ostream &operator<<(
|
||||
std::ostream &out, const SecurityMarketDataStatistics &s) noexcept;
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// Definition
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
inline std::ostream &operator<<(
|
||||
std::ostream &out, const SecurityMarketDataStatistics &s) noexcept {
|
||||
out << fmt::format("{}", s);
|
||||
return out;
|
||||
}
|
||||
|
||||
} // namespace bts::domain
|
||||
|
||||
FMT_IMPL(
|
||||
bts::domain::SecurityMarketDataStatistics,
|
||||
s,
|
||||
"id: {}; low: {}; high: {}; open: {}; settle: {}; volume: {}",
|
||||
s.security_id,
|
||||
s.low,
|
||||
s.high,
|
||||
s.open,
|
||||
s.settle,
|
||||
s.volume);
|
||||
Reference in new issue
Block a user