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
AbsoluteStrike Class Reference

#include <ored/marketdata/strike.hpp>

+ Inheritance diagram for AbsoluteStrike:
+ Collaboration diagram for AbsoluteStrike:

Public Member Functions

 AbsoluteStrike ()
 Default constructor. More...
 
 AbsoluteStrike (QuantLib::Real strike)
 Constructor with explicit strike. More...
 
QuantLib::Real strike () const
 Return the absolute strike level. More...
 
void fromString (const std::string &strStrike) override
 
std::string toString () const override
 
- Public Member Functions inherited from BaseStrike
virtual ~BaseStrike ()
 
virtual void fromString (const std::string &strStrike)=0
 Populate the Strike object from strStrike. More...
 
virtual std::string toString () const =0
 Write the Strike object to string. More...
 

Protected Member Functions

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

Private Member Functions

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

Private Attributes

QuantLib::Real strike_
 

Friends

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

Detailed Description

Strike implementation where the strike is described by a single number that represents the absolute strike level.

Definition at line 68 of file strike.hpp.

Constructor & Destructor Documentation

◆ AbsoluteStrike() [1/2]

Default constructor.

Definition at line 40 of file strike.cpp.

40{}

◆ AbsoluteStrike() [2/2]

AbsoluteStrike ( QuantLib::Real  strike)

Constructor with explicit strike.

Member Function Documentation

◆ strike()

Real strike ( ) const

Return the absolute strike level.

Definition at line 44 of file strike.cpp.

44{ return strike_; }
QuantLib::Real strike_
Definition: strike.hpp:93
+ Here is the caller graph for this function:

◆ fromString()

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

Populate AbsoluteStrike object from strStrike which should be a number. An exception is thrown if strStrike cannot be parsed as a QuantLib::Real.

Implements BaseStrike.

Definition at line 46 of file strike.cpp.

46{ strike_ = parseReal(strStrike); }
Real parseReal(const string &s)
Convert text to Real.
Definition: parsers.cpp:112
+ Here is the call graph for this function:

◆ toString()

string toString ( ) const
overridevirtual

Writes the AbsoluteStrike object to string. This returns the string representation of the absolute strike number.

Implements BaseStrike.

Definition at line 48 of file strike.cpp.

48{ return to_string(strike_); }
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 BaseStrike other) const
overrideprotectedvirtual

Override in derived classes to compare specific Strikes.

Implements BaseStrike.

Definition at line 50 of file strike.cpp.

50 {
51 if (const AbsoluteStrike* p = dynamic_cast<const AbsoluteStrike*>(&other)) {
52 return close(strike_, p->strike());
53 } else {
54 return false;
55 }
56}
AbsoluteStrike()
Default constructor.
Definition: strike.cpp:40

◆ serialize()

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

Definition at line 291 of file strike.cpp.

291 {
292 ar& boost::serialization::base_object<BaseStrike>(*this);
293 ar& strike_;
294}

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Serialization.

Definition at line 95 of file strike.hpp.

Member Data Documentation

◆ strike_

QuantLib::Real strike_
private

Definition at line 93 of file strike.hpp.