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

#include <ored/configuration/volatilityconfig.hpp>

+ Inheritance diagram for VolatilityConfig:
+ Collaboration diagram for VolatilityConfig:

Public Member Functions

 VolatilityConfig (std::string calendarStr=std::string(), QuantLib::Natural priority=0)
 
void fromXMLNode (ore::data::XMLNode *node)
 
void toXMLNode (XMLDocument &doc, XMLNode *node) const
 
QuantLib::Natural priority () const
 
Calendar calendar () const
 
- 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

Calendar calendar_
 
string calendarStr_
 
QuantLib::Natural priority_
 

Detailed Description

Shared volatility configurations

Definition at line 36 of file volatilityconfig.hpp.

Constructor & Destructor Documentation

◆ VolatilityConfig()

VolatilityConfig ( std::string  calendarStr = std::string(),
QuantLib::Natural  priority = 0 
)

Definition at line 35 of file volatilityconfig.cpp.

36 : calendarStr_(calendarStr), priority_(priority) {
37 calendar_ = calendarStr_.empty() ? Calendar() : parseCalendar(calendarStr_);
38}
QuantLib::Natural priority() const
Calendar parseCalendar(const string &s)
Convert text to QuantLib::Calendar.
Definition: parsers.cpp:157
+ Here is the call graph for this function:

Member Function Documentation

◆ fromXMLNode()

void fromXMLNode ( ore::data::XMLNode node)

Definition at line 40 of file volatilityconfig.cpp.

40 {
41 string attr = XMLUtils::getAttribute(node, "priority");
42 priority_ = attr.empty() ? 0 : parseInteger(attr);
43
44 calendarStr_ = XMLUtils::getChildValue(node, "Calendar", false);
45 calendar_ = calendarStr_.empty() ? Calendar() : parseCalendar(calendarStr_);
46}
static string getAttribute(XMLNode *node, const string &attrName)
Definition: xmlutils.cpp:419
static string getChildValue(XMLNode *node, const string &name, bool mandatory=false, const string &defaultValue=string())
Definition: xmlutils.cpp:277
Integer parseInteger(const string &s)
Convert text to QuantLib::Integer.
Definition: parsers.cpp:136
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toXMLNode()

void toXMLNode ( XMLDocument doc,
XMLNode node 
) const

Definition at line 48 of file volatilityconfig.cpp.

48 {
49 XMLUtils::addAttribute(doc, node, "priority", std::to_string(priority_));
50 if (!calendarStr_.empty())
51 XMLUtils::addChild(doc, node, "Calendar", calendarStr_);
52}
static void addAttribute(XMLDocument &doc, XMLNode *node, const string &attrName, const string &attrValue)
Definition: xmlutils.cpp:412
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
Definition: xmlutils.cpp:181
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ priority()

QuantLib::Natural priority ( ) const

Definition at line 43 of file volatilityconfig.hpp.

43{ return priority_; };
+ Here is the caller graph for this function:

◆ calendar()

Calendar calendar ( ) const

Definition at line 44 of file volatilityconfig.hpp.

44{ return calendar_; };

Member Data Documentation

◆ calendar_

Calendar calendar_
private

Definition at line 47 of file volatilityconfig.hpp.

◆ calendarStr_

string calendarStr_
private

Definition at line 48 of file volatilityconfig.hpp.

◆ priority_

QuantLib::Natural priority_
private

Definition at line 49 of file volatilityconfig.hpp.