26#include <ql/shared_ptr.hpp>
29#include <ql/time/date.hpp>
30#include <ql/types.hpp>
33#include <boost/serialization/base_object.hpp>
34#include <boost/serialization/export.hpp>
46 virtual void fromString(
const std::string& strExpiry) = 0;
61 template <
class Archive>
void serialize(Archive& ar,
const unsigned int version);
80 void fromString(
const std::string& strExpiryDate)
override;
85 std::string
toString()
const override;
94 template <
class Archive>
void serialize(Archive& ar,
const unsigned int version);
113 void fromString(
const std::string& strExpiryPeriod)
override;
118 std::string
toString()
const override;
127 template <
class Archive>
void serialize(Archive& ar,
const unsigned int version);
143 void fromString(
const std::string& strIndex)
override;
148 std::string
toString()
const override;
157 template <
class Archive>
void serialize(Archive& ar,
const unsigned int version);
164QuantLib::ext::shared_ptr<Expiry>
parseExpiry(
const std::string& strExpiry);
QuantLib::Date expiryDate_
const QuantLib::Date & expiryDate() const
Return the expiry date.
ExpiryDate()
Default constructor.
ExpiryDate(const QuantLib::Date &expiryDate)
Constructor with explicit expiry date.
friend class boost::serialization::access
Serialization.
std::string toString() const override
bool equal_to(const Expiry &other) const override
Override in derived classes to compare specific expiries.
void fromString(const std::string &strExpiryDate) override
void serialize(Archive &ar, const unsigned int version)
virtual std::string toString() const =0
Write the Expiry object to string.
friend class boost::serialization::access
Serialization.
virtual bool equal_to(const Expiry &other) const =0
Override in derived classes to compare specific expiries.
friend bool operator==(const Expiry &lhs, const Expiry &rhs)
Will be used for Expiry comparison.
void serialize(Archive &ar, const unsigned int version)
virtual void fromString(const std::string &strExpiry)=0
Populate the Expiry object from strExpiry.
const QuantLib::Period & expiryPeriod() const
Return the expiry period.
ExpiryPeriod(const QuantLib::Period &expiryPeriod)
Constructor with expiry period.
QuantLib::Period expiryPeriod_
friend class boost::serialization::access
Serialization.
std::string toString() const override
bool equal_to(const Expiry &other) const override
Override in derived classes to compare specific expiries.
void fromString(const std::string &strExpiryPeriod) override
void serialize(Archive &ar, const unsigned int version)
ExpiryPeriod()
Default constructor.
void fromString(const std::string &strIndex) override
QuantLib::Natural expiryIndex() const
Return the future continuation expiry index.
QuantLib::Natural expiryIndex_
friend class boost::serialization::access
Serialization.
std::string toString() const override
bool equal_to(const Expiry &other) const override
Override in derived classes to compare specific expiries.
void serialize(Archive &ar, const unsigned int version)
BOOST_CLASS_EXPORT_KEY(ore::data::ExpiryDate)
std::ostream & operator<<(std::ostream &out, EquityReturnType t)
QuantLib::ext::shared_ptr< Expiry > parseExpiry(const string &strExpiry)
Parse an Expiry from its string representation, strExpiry.
Serializable Credit Default Swap.
support for QuantLib::Date serialization
support for QuantLib::Period serialization