46 lines
991 B
C++
46 lines
991 B
C++
#pragma once
|
|
|
|
#include <sstream>
|
|
#include <string>
|
|
|
|
namespace bts::md::py_interop {
|
|
|
|
/**
|
|
* @brief Defines the expiration for a Future contract.
|
|
*/
|
|
class PyFuture {
|
|
public:
|
|
const std::string &expiration() const;
|
|
void set_expiration(std::string value);
|
|
|
|
std::string to_string() const;
|
|
|
|
private:
|
|
std::string expiration_;
|
|
};
|
|
|
|
std::ostream &operator<<(std::ostream &out, const PyFuture &fut) noexcept;
|
|
|
|
//////////////////////////////////////////////////
|
|
// Definition
|
|
//////////////////////////////////////////////////
|
|
|
|
inline const std::string &PyFuture::expiration() const { return expiration_; }
|
|
inline void PyFuture::set_expiration(std::string value) {
|
|
expiration_ = std::move(value);
|
|
}
|
|
|
|
inline std::string PyFuture::to_string() const {
|
|
std::stringstream str;
|
|
str << *this;
|
|
return str.str();
|
|
}
|
|
|
|
inline std::ostream &operator<<(
|
|
std::ostream &out, const PyFuture &fut) noexcept {
|
|
out << fut.expiration();
|
|
return out;
|
|
}
|
|
|
|
} // namespace bts::md::py_interop
|