Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
ExpiryDate Class Reference

#include <ored/marketdata/expiry.hpp>

+ Inheritance diagram for ExpiryDate:
+ Collaboration diagram for ExpiryDate:

Public Member Functions

 ExpiryDate ()
 Default constructor. More...
 
 ExpiryDate (const QuantLib::Date &expiryDate)
 Constructor with explicit expiry date. More...
 
const QuantLib::Date & expiryDate () const
 Return the expiry date. More...
 
void fromString (const std::string &strExpiryDate) override
 
std::string toString () const override
 
- Public Member Functions inherited from Expiry
virtual ~Expiry ()
 
virtual void fromString (const std::string &strExpiry)=0
 Populate the Expiry object from strExpiry. More...
 
virtual std::string toString () const =0
 Write the Expiry object to string. More...
 

Protected Member Functions

bool equal_to (const Expiry &other) const override
 Override in derived classes to compare specific expiries. More...
 
virtual bool equal_to (const Expiry &other) const =0
 Override in derived classes to compare specific expiries. More...
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

QuantLib::Date expiryDate_
 

Friends

class boost::serialization::access
 Serialization. More...
 

Detailed Description

Expiry consisting of an explicit expiry date

Definition at line 66 of file expiry.hpp.

Constructor & Destructor Documentation

◆ ExpiryDate() [1/2]

Default constructor.

Definition at line 37 of file expiry.cpp.

37{}

◆ ExpiryDate() [2/2]

ExpiryDate ( const QuantLib::Date &  expiryDate)

Constructor with explicit expiry date.

Member Function Documentation

◆ expiryDate()

const Date & expiryDate ( ) const

Return the expiry date.

Definition at line 41 of file expiry.cpp.

41{ return expiryDate_; }
QuantLib::Date expiryDate_
Definition: expiry.hpp:91
+ Here is the caller graph for this function:

◆ fromString()

void fromString ( const std::string &  strExpiryDate)
overridevirtual

Populate ExpiryDate object from strExpiryDate which should be a date. An exception is thrown if strExpiryDate cannot be parsed as a QuantLib::Date.

Implements Expiry.

Definition at line 43 of file expiry.cpp.

43{ expiryDate_ = parseDate(strExpiryDate); }
Date parseDate(const string &s)
Convert std::string to QuantLib::Date.
Definition: parsers.cpp:51
+ Here is the call graph for this function:

◆ toString()

string toString ( ) const
overridevirtual

Writes the ExpiryDate object to string. This returns the string representation of the expiry date.

Implements Expiry.

Definition at line 45 of file expiry.cpp.

45{ return to_string(expiryDate_); }
std::string to_string(const LocationInfo &l)
Definition: ast.cpp:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ equal_to()

bool equal_to ( const Expiry other) const
overrideprotectedvirtual

Override in derived classes to compare specific expiries.

Implements Expiry.

Definition at line 47 of file expiry.cpp.

47 {
48 if (const ExpiryDate* p = dynamic_cast<const ExpiryDate*>(&other)) {
49 return expiryDate_ == p->expiryDate();
50 } else {
51 return false;
52 }
53}
ExpiryDate()
Default constructor.
Definition: expiry.cpp:37

◆ serialize()

template void serialize ( Archive &  ar,
const unsigned int  version 
)
private

Definition at line 55 of file expiry.cpp.

55 {
56 ar& boost::serialization::base_object<Expiry>(*this);
57 ar& expiryDate_;
58}

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Serialization.

Definition at line 93 of file expiry.hpp.

Member Data Documentation

◆ expiryDate_

QuantLib::Date expiryDate_
private

Definition at line 91 of file expiry.hpp.