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

#include <ored/configuration/reportconfig.hpp>

+ Inheritance diagram for ReportConfig:
+ Collaboration diagram for ReportConfig:

Public Member Functions

 ReportConfig ()
 
 ReportConfig (const boost::optional< bool > &reportOnDeltaGrid, const boost::optional< bool > &reportOnMoneynessGrid, const boost::optional< bool > &reportOnStrikeGrid, const boost::optional< bool > &reportOnStrikeSpreadGrid, const boost::optional< std::vector< std::string > > &deltas, const boost::optional< std::vector< Real > > &moneyness, const boost::optional< std::vector< Real > > &strikes, const boost::optional< std::vector< Real > > &strikeSpreads, const boost::optional< std::vector< Period > > &expiries, const boost::optional< std::vector< Period > > &underlyingTenors)
 
const boost::optional< boolreportOnDeltaGrid () const
 
const boost::optional< boolreportOnMoneynessGrid () const
 
const boost::optional< boolreportOnStrikeGrid () const
 
const boost::optional< boolreportOnStrikeSpreadGrid () const
 
const boost::optional< std::vector< std::string > > & deltas () const
 
const boost::optional< std::vector< Real > > & moneyness () const
 
const boost::optional< std::vector< Real > > & strikes () const
 
const boost::optional< std::vector< Real > > & strikeSpreads () const
 
const boost::optional< std::vector< Period > > & expiries () const
 
const boost::optional< std::vector< Period > > & underlyingTenors () const
 
void fromXML (XMLNode *node) override
 
XMLNodetoXML (XMLDocument &doc) const override
 
- Public Member Functions inherited from XMLSerializable
virtual ~XMLSerializable ()
 
virtual void fromXML (XMLNode *node)=0
 
virtual XMLNodetoXML (XMLDocument &doc) const =0
 
void fromFile (const std::string &filename)
 
void toFile (const std::string &filename) const
 
void fromXMLString (const std::string &xml)
 Parse from XML string. More...
 
std::string toXMLString () const
 Parse from XML string. More...
 

Private Attributes

boost::optional< boolreportOnDeltaGrid_
 
boost::optional< boolreportOnMoneynessGrid_
 
boost::optional< boolreportOnStrikeGrid_
 
boost::optional< boolreportOnStrikeSpreadGrid_
 
boost::optional< std::vector< std::string > > deltas_
 
boost::optional< std::vector< Real > > moneyness_
 
boost::optional< std::vector< Real > > strikes_
 
boost::optional< std::vector< Real > > strikeSpreads_
 
boost::optional< std::vector< Period > > expiries_
 
boost::optional< std::vector< Period > > underlyingTenors_
 

Detailed Description

Definition at line 33 of file reportconfig.hpp.

Constructor & Destructor Documentation

◆ ReportConfig() [1/2]

Definition at line 35 of file reportconfig.hpp.

35{}

◆ ReportConfig() [2/2]

ReportConfig ( const boost::optional< bool > &  reportOnDeltaGrid,
const boost::optional< bool > &  reportOnMoneynessGrid,
const boost::optional< bool > &  reportOnStrikeGrid,
const boost::optional< bool > &  reportOnStrikeSpreadGrid,
const boost::optional< std::vector< std::string > > &  deltas,
const boost::optional< std::vector< Real > > &  moneyness,
const boost::optional< std::vector< Real > > &  strikes,
const boost::optional< std::vector< Real > > &  strikeSpreads,
const boost::optional< std::vector< Period > > &  expiries,
const boost::optional< std::vector< Period > > &  underlyingTenors 
)

Definition at line 36 of file reportconfig.hpp.

boost::optional< std::vector< Real > > moneyness_
boost::optional< std::vector< Period > > expiries_
boost::optional< std::vector< std::string > > deltas_
const boost::optional< bool > reportOnDeltaGrid() const
const boost::optional< std::vector< Period > > & underlyingTenors() const
const boost::optional< std::vector< Real > > & strikes() const
boost::optional< bool > reportOnStrikeSpreadGrid_
boost::optional< bool > reportOnMoneynessGrid_
const boost::optional< std::vector< std::string > > & deltas() const
const boost::optional< bool > reportOnStrikeSpreadGrid() const
const boost::optional< bool > reportOnMoneynessGrid() const
const boost::optional< bool > reportOnStrikeGrid() const
const boost::optional< std::vector< Period > > & expiries() const
boost::optional< bool > reportOnStrikeGrid_
boost::optional< std::vector< Real > > strikes_
boost::optional< bool > reportOnDeltaGrid_
boost::optional< std::vector< Period > > underlyingTenors_
boost::optional< std::vector< Real > > strikeSpreads_
const boost::optional< std::vector< Real > > & moneyness() const
const boost::optional< std::vector< Real > > & strikeSpreads() const

Member Function Documentation

◆ reportOnDeltaGrid()

const boost::optional< bool > reportOnDeltaGrid ( ) const

Definition at line 48 of file reportconfig.hpp.

48{ return reportOnDeltaGrid_; }
+ Here is the caller graph for this function:

◆ reportOnMoneynessGrid()

const boost::optional< bool > reportOnMoneynessGrid ( ) const

Definition at line 49 of file reportconfig.hpp.

49{ return reportOnMoneynessGrid_; }
+ Here is the caller graph for this function:

◆ reportOnStrikeGrid()

const boost::optional< bool > reportOnStrikeGrid ( ) const

Definition at line 50 of file reportconfig.hpp.

50{ return reportOnStrikeGrid_; }
+ Here is the caller graph for this function:

◆ reportOnStrikeSpreadGrid()

const boost::optional< bool > reportOnStrikeSpreadGrid ( ) const

Definition at line 51 of file reportconfig.hpp.

+ Here is the caller graph for this function:

◆ deltas()

const boost::optional< std::vector< std::string > > & deltas ( ) const

Definition at line 52 of file reportconfig.hpp.

52{ return deltas_; }
+ Here is the caller graph for this function:

◆ moneyness()

const boost::optional< std::vector< Real > > & moneyness ( ) const

Definition at line 53 of file reportconfig.hpp.

53{ return moneyness_; }
+ Here is the caller graph for this function:

◆ strikes()

const boost::optional< std::vector< Real > > & strikes ( ) const

Definition at line 54 of file reportconfig.hpp.

54{ return strikes_; }
+ Here is the caller graph for this function:

◆ strikeSpreads()

const boost::optional< std::vector< Real > > & strikeSpreads ( ) const

Definition at line 55 of file reportconfig.hpp.

55{ return strikeSpreads_; }
+ Here is the caller graph for this function:

◆ expiries()

const boost::optional< std::vector< Period > > & expiries ( ) const

Definition at line 56 of file reportconfig.hpp.

56{ return expiries_; }
+ Here is the caller graph for this function:

◆ underlyingTenors()

const boost::optional< std::vector< Period > > & underlyingTenors ( ) const

Definition at line 57 of file reportconfig.hpp.

57{ return underlyingTenors_; }
+ Here is the caller graph for this function:

◆ fromXML()

void fromXML ( XMLNode node)
overridevirtual

Implements XMLSerializable.

Definition at line 28 of file reportconfig.cpp.

28 {
29 XMLUtils::checkNode(node, "Report");
30
31 if (auto tmp = XMLUtils::getChildNode(node, "ReportOnDeltaGrid")) {
33 } else {
34 reportOnDeltaGrid_ = boost::none;
35 }
36
37 if (auto tmp = XMLUtils::getChildNode(node, "ReportOnMoneynessGrid")) {
39 } else {
40 reportOnMoneynessGrid_ = boost::none;
41 }
42
43 if (auto tmp = XMLUtils::getChildNode(node, "ReportOnStrikeGrid")) {
45 } else {
46 reportOnStrikeGrid_ = boost::none;
47 }
48
49 if (auto tmp = XMLUtils::getChildNode(node, "ReportOnStrikeSpreadGrid")) {
51 } else {
52 reportOnStrikeGrid_ = boost::none;
53 }
54
55 if (auto tmp = XMLUtils::getChildNode(node, "Deltas")) {
57 } else {
58 deltas_ = boost::none;
59 }
60
61 if (auto tmp = XMLUtils::getChildNode(node, "Moneyness")) {
62 moneyness_ = parseListOfValues<Real>(XMLUtils::getNodeValue(tmp), &parseReal);
63 } else {
64 moneyness_ = boost::none;
65 }
66
67 if (auto tmp = XMLUtils::getChildNode(node, "Strikes")) {
68 strikes_ = parseListOfValues<Real>(XMLUtils::getNodeValue(tmp), &parseReal);
69 } else {
70 strikes_ = boost::none;
71 }
72
73 if (auto tmp = XMLUtils::getChildNode(node, "StrikeSpreads")) {
74 strikeSpreads_ = parseListOfValues<Real>(XMLUtils::getNodeValue(tmp), &parseReal);
75 } else {
76 strikeSpreads_ = boost::none;
77 }
78
79 if (auto tmp = XMLUtils::getChildNode(node, "Expiries")) {
80 expiries_ = parseListOfValues<Period>(XMLUtils::getNodeValue(tmp), &parsePeriod);
81 } else {
82 expiries_ = boost::none;
83 }
84
85 if (auto tmp = XMLUtils::getChildNode(node, "UnderlyingTenors")) {
86 underlyingTenors_ = parseListOfValues<Period>(XMLUtils::getNodeValue(tmp), &parsePeriod);
87 } else {
88 underlyingTenors_ = boost::none;
89 }
90}
static void checkNode(XMLNode *n, const string &expectedName)
Definition: xmlutils.cpp:175
static XMLNode * getChildNode(XMLNode *n, const string &name="")
Definition: xmlutils.cpp:387
static string getNodeValue(XMLNode *node)
Get a node's value.
Definition: xmlutils.cpp:489
Period parsePeriod(const string &s)
Convert text to QuantLib::Period.
Definition: parsers.cpp:171
bool parseBool(const string &s)
Convert text to bool.
Definition: parsers.cpp:144
std::vector< string > parseListOfValues(string s, const char escape, const char delim, const char quote)
Definition: parsers.cpp:639
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toXML()

XMLNode * toXML ( XMLDocument doc) const
overridevirtual

Implements XMLSerializable.

Definition at line 92 of file reportconfig.cpp.

92 {
93 XMLNode* node = doc.allocNode("Report");
95 XMLUtils::addChild(doc, node, "ReportOnDeltaGrid", *reportOnDeltaGrid_);
97 XMLUtils::addChild(doc, node, "ReportOnMoneynessGrid", *reportOnMoneynessGrid_);
98 if (deltas_)
99 XMLUtils::addGenericChildAsList(doc, node, "Deltas", *deltas_);
100 if (moneyness_)
101 XMLUtils::addGenericChildAsList(doc, node, "Moneyness", *moneyness_);
102 if (expiries_)
103 XMLUtils::addGenericChildAsList(doc, node, "Expiries", *expiries_);
105 XMLUtils::addGenericChildAsList(doc, node, "UnderlyingTenors", *underlyingTenors_);
106 return node;
107}
static void addGenericChildAsList(XMLDocument &doc, XMLNode *n, const string &name, const vector< T > &values, const string &attrName="", const string &attr="")
Definition: xmlutils.hpp:144
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
Definition: xmlutils.cpp:181
rapidxml::xml_node< char > XMLNode
Definition: xmlutils.hpp:60
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ reportOnDeltaGrid_

boost::optional<bool> reportOnDeltaGrid_
private

Definition at line 63 of file reportconfig.hpp.

◆ reportOnMoneynessGrid_

boost::optional<bool> reportOnMoneynessGrid_
private

Definition at line 64 of file reportconfig.hpp.

◆ reportOnStrikeGrid_

boost::optional<bool> reportOnStrikeGrid_
private

Definition at line 65 of file reportconfig.hpp.

◆ reportOnStrikeSpreadGrid_

boost::optional<bool> reportOnStrikeSpreadGrid_
private

Definition at line 66 of file reportconfig.hpp.

◆ deltas_

boost::optional<std::vector<std::string> > deltas_
private

Definition at line 68 of file reportconfig.hpp.

◆ moneyness_

boost::optional<std::vector<Real> > moneyness_
private

Definition at line 69 of file reportconfig.hpp.

◆ strikes_

boost::optional<std::vector<Real> > strikes_
private

Definition at line 70 of file reportconfig.hpp.

◆ strikeSpreads_

boost::optional<std::vector<Real> > strikeSpreads_
private

Definition at line 71 of file reportconfig.hpp.

◆ expiries_

boost::optional<std::vector<Period> > expiries_
private

Definition at line 72 of file reportconfig.hpp.

◆ underlyingTenors_

boost::optional<std::vector<Period> > underlyingTenors_
private

Definition at line 73 of file reportconfig.hpp.