feat: Add support for python md plugins
This commit is contained in:
1 parent
9a49767b75
commit
32fe2533c7
47 files changed
+2276
-10
No files matched your search
@@ -0,0 +1,42 @@
|
||||
#pragma once
|
||||
|
||||
#include <limits>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
namespace bts::md::py_interop {
|
||||
|
||||
class PyBookLevel {
|
||||
public:
|
||||
constexpr PyBookLevel() = default;
|
||||
|
||||
constexpr double price() const;
|
||||
void set_price(double value);
|
||||
|
||||
constexpr double quantity() const;
|
||||
void set_quantity(double value);
|
||||
|
||||
std::string to_string() const;
|
||||
|
||||
private:
|
||||
double price_{std::numeric_limits<double>::quiet_NaN()};
|
||||
double quantity_{0};
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// Definition
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
constexpr double PyBookLevel::price() const { return price_; }
|
||||
inline void PyBookLevel::set_price(double value) { price_ = value; }
|
||||
|
||||
constexpr double PyBookLevel::quantity() const { return quantity_; }
|
||||
inline void PyBookLevel::set_quantity(double value) { quantity_ = value; }
|
||||
|
||||
inline std::string PyBookLevel::to_string() const {
|
||||
std::stringstream str;
|
||||
str << price_ << " (" << quantity_ << ")";
|
||||
return str.str();
|
||||
}
|
||||
|
||||
} // namespace bts::md::py_interop
|
||||
Reference in new issue
Block a user