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

Serializable object holding indexing data. More...

#include <ored/portfolio/indexing.hpp>

+ Inheritance diagram for Indexing:
+ Collaboration diagram for Indexing:

Public Member Functions

 Indexing ()
 
 Indexing (const std::string &index, const string &indexFixingCalendar="", const bool indexIsDirty=false, const bool indexIsRelative=true, const bool indexIsConditionalOnSurvival=true, const Real quantity=1.0, const Real initialFixing=Null< Real >(), const Real initialNotionalFixing=Null< Real >(), const ScheduleData &valuationSchedule=ScheduleData(), const Size fixingDays=0, const string &fixingCalendar="", const string &fixingConvention="", const bool inArrearsFixing=false)
 
Inspectors
bool hasData () const
 
Real quantity () const
 
const string & index () const
 
const string & indexFixingCalendar () const
 
bool indexIsDirty () const
 
bool indexIsRelative () const
 
bool indexIsConditionalOnSurvival () const
 
Real initialFixing () const
 
Real initialNotionalFixing () const
 
const ScheduleDatavaluationSchedule () const
 
Size fixingDays () const
 
const string & fixingCalendar () const
 
const string & fixingConvention () const
 
bool inArrearsFixing () const
 
Modifiers
Real & quantity ()
 
string & index ()
 
string & indexFixingCalendar ()
 
boolindexIsDirty ()
 
boolindexIsRelative ()
 
boolindexIsConditionalOnSurvival ()
 
Real & initialFixing ()
 
Real & initialNotionalFixing ()
 
ScheduleDatavaluationSchedule ()
 
Size & fixingDays ()
 
string & fixingCalendar ()
 
string & fixingConvention ()
 
boolinArrearsFixing ()
 
- 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...
 

Serialisation

bool hasData_
 
Real quantity_
 
string index_
 
string indexFixingCalendar_
 
bool indexIsDirty_
 
bool indexIsRelative_
 
bool indexIsConditionalOnSurvival_
 
Real initialFixing_
 
Real initialNotionalFixing_
 
ScheduleData valuationSchedule_
 
Size fixingDays_
 
string fixingCalendar_
 
string fixingConvention_
 
bool inArrearsFixing_
 
virtual void fromXML (XMLNode *node) override
 
virtual XMLNodetoXML (XMLDocument &doc) const override
 

Detailed Description

Serializable object holding indexing data.

Definition at line 39 of file indexing.hpp.

Constructor & Destructor Documentation

◆ Indexing() [1/2]

Indexing ( )

Definition at line 41 of file indexing.hpp.

42 : hasData_(false), quantity_(1.0), initialFixing_(Null<Real>()), fixingDays_(0), inArrearsFixing_(false) {}

◆ Indexing() [2/2]

Indexing ( const std::string &  index,
const string &  indexFixingCalendar = "",
const bool  indexIsDirty = false,
const bool  indexIsRelative = true,
const bool  indexIsConditionalOnSurvival = true,
const Real  quantity = 1.0,
const Real  initialFixing = Null<Real>(),
const Real  initialNotionalFixing = Null<Real>(),
const ScheduleData valuationSchedule = ScheduleData(),
const Size  fixingDays = 0,
const string &  fixingCalendar = "",
const string &  fixingConvention = "",
const bool  inArrearsFixing = false 
)
explicit

Definition at line 43 of file indexing.hpp.

Real initialFixing() const
Definition: indexing.hpp:68
bool inArrearsFixing() const
Definition: indexing.hpp:74
ScheduleData valuationSchedule_
Definition: indexing.hpp:112
const string & fixingCalendar() const
Definition: indexing.hpp:72
const ScheduleData & valuationSchedule() const
Definition: indexing.hpp:70
const string & index() const
Definition: indexing.hpp:60
string fixingConvention_
Definition: indexing.hpp:115
Size fixingDays() const
Definition: indexing.hpp:71
Real initialNotionalFixing() const
Definition: indexing.hpp:69
const string & indexFixingCalendar() const
Definition: indexing.hpp:62
string indexFixingCalendar_
Definition: indexing.hpp:106
bool indexIsRelative() const
Definition: indexing.hpp:65
const string & fixingConvention() const
Definition: indexing.hpp:73
bool indexIsDirty() const
Definition: indexing.hpp:64
Real quantity() const
Definition: indexing.hpp:59
bool indexIsConditionalOnSurvival_
Definition: indexing.hpp:109
bool indexIsConditionalOnSurvival() const
Definition: indexing.hpp:66

Member Function Documentation

◆ hasData()

bool hasData ( ) const

Definition at line 58 of file indexing.hpp.

58{ return hasData_; }

◆ quantity() [1/2]

Real quantity ( ) const

Definition at line 59 of file indexing.hpp.

59{ return quantity_; }

◆ index() [1/2]

const string & index ( ) const

Definition at line 60 of file indexing.hpp.

60{ return index_; }
+ Here is the caller graph for this function:

◆ indexFixingCalendar() [1/2]

const string & indexFixingCalendar ( ) const

Definition at line 62 of file indexing.hpp.

62{ return indexFixingCalendar_; }

◆ indexIsDirty() [1/2]

bool indexIsDirty ( ) const

Definition at line 64 of file indexing.hpp.

64{ return indexIsDirty_; }

◆ indexIsRelative() [1/2]

bool indexIsRelative ( ) const

Definition at line 65 of file indexing.hpp.

65{ return indexIsRelative_; }

◆ indexIsConditionalOnSurvival() [1/2]

bool indexIsConditionalOnSurvival ( ) const

Definition at line 66 of file indexing.hpp.

◆ initialFixing() [1/2]

Real initialFixing ( ) const

Definition at line 68 of file indexing.hpp.

68{ return initialFixing_; }

◆ initialNotionalFixing() [1/2]

Real initialNotionalFixing ( ) const

Definition at line 69 of file indexing.hpp.

69{ return initialNotionalFixing_; }

◆ valuationSchedule() [1/2]

const ScheduleData & valuationSchedule ( ) const

Definition at line 70 of file indexing.hpp.

70{ return valuationSchedule_; }

◆ fixingDays() [1/2]

Size fixingDays ( ) const

Definition at line 71 of file indexing.hpp.

71{ return fixingDays_; }

◆ fixingCalendar() [1/2]

const string & fixingCalendar ( ) const

Definition at line 72 of file indexing.hpp.

72{ return fixingCalendar_; }

◆ fixingConvention() [1/2]

const string & fixingConvention ( ) const

Definition at line 73 of file indexing.hpp.

73{ return fixingConvention_; }

◆ inArrearsFixing() [1/2]

bool inArrearsFixing ( ) const

Definition at line 74 of file indexing.hpp.

74{ return inArrearsFixing_; }

◆ quantity() [2/2]

Real & quantity ( )

Definition at line 79 of file indexing.hpp.

79{ return quantity_; }

◆ index() [2/2]

string & index ( )

Definition at line 80 of file indexing.hpp.

80{ return index_; }

◆ indexFixingCalendar() [2/2]

string & indexFixingCalendar ( )

Definition at line 82 of file indexing.hpp.

82{ return indexFixingCalendar_; }

◆ indexIsDirty() [2/2]

bool & indexIsDirty ( )

Definition at line 84 of file indexing.hpp.

84{ return indexIsDirty_; }

◆ indexIsRelative() [2/2]

bool & indexIsRelative ( )

Definition at line 85 of file indexing.hpp.

85{ return indexIsRelative_; }

◆ indexIsConditionalOnSurvival() [2/2]

bool & indexIsConditionalOnSurvival ( )

Definition at line 86 of file indexing.hpp.

◆ initialFixing() [2/2]

Real & initialFixing ( )

Definition at line 88 of file indexing.hpp.

88{ return initialFixing_; }

◆ initialNotionalFixing() [2/2]

Real & initialNotionalFixing ( )

Definition at line 89 of file indexing.hpp.

89{ return initialNotionalFixing_; }

◆ valuationSchedule() [2/2]

ScheduleData & valuationSchedule ( )

Definition at line 90 of file indexing.hpp.

90{ return valuationSchedule_; }

◆ fixingDays() [2/2]

Size & fixingDays ( )

Definition at line 91 of file indexing.hpp.

91{ return fixingDays_; }

◆ fixingCalendar() [2/2]

string & fixingCalendar ( )

Definition at line 92 of file indexing.hpp.

92{ return fixingCalendar_; }

◆ fixingConvention() [2/2]

string & fixingConvention ( )

Definition at line 93 of file indexing.hpp.

93{ return fixingConvention_; }

◆ inArrearsFixing() [2/2]

bool & inArrearsFixing ( )

Definition at line 94 of file indexing.hpp.

94{ return inArrearsFixing_; }

◆ fromXML()

void fromXML ( XMLNode node)
overridevirtual

Implements XMLSerializable.

Definition at line 26 of file indexing.cpp.

26 {
27 XMLUtils::checkNode(node, "Indexing");
28 if (auto n = XMLUtils::getChildNode(node, "Quantity")) {
30 } else {
31 quantity_ = 1.0;
32 }
33 index_ = XMLUtils::getChildValue(node, "Index", false);
34 indexFixingCalendar_ = XMLUtils::getChildValue(node, "IndexFixingCalendar", false);
35 if (XMLUtils::getChildNode(node, "IndexFixingDays")) {
36 WLOG("Indexing::fromXML, node IndexFixingDays has been deprecated, fixing days are "
37 "taken from conventions.");
38 }
39 indexIsDirty_ = XMLUtils::getChildValueAsBool(node, "Dirty", false);
40 indexIsRelative_ = XMLUtils::getChildValueAsBool(node, "Relative", false);
41 indexIsConditionalOnSurvival_ = XMLUtils::getChildValueAsBool(node, "ConditionalOnSurvival", false);
42 initialFixing_ = Null<Real>();
43 if (auto n = XMLUtils::getChildNode(node, "InitialFixing"))
45 initialNotionalFixing_ = Null<Real>();
46 if (auto n = XMLUtils::getChildNode(node, "InitialNotionalFixing"))
48 if (auto tmp = XMLUtils::getChildNode(node, "ValuationSchedule"))
50 fixingDays_ = 0;
51 if (auto n = XMLUtils::getChildNode(node, "FixingDays"))
53 fixingCalendar_ = XMLUtils::getChildValue(node, "FixingCalendar");
54 fixingConvention_ = XMLUtils::getChildValue(node, "FixingConvention");
55 inArrearsFixing_ = false;
56 if (auto n = XMLUtils::getChildNode(node, "IsInArrears"))
58 hasData_ = true;
59}
virtual void fromXML(XMLNode *node) override
Definition: schedule.cpp:179
static void checkNode(XMLNode *n, const string &expectedName)
Definition: xmlutils.cpp:175
static string getChildValue(XMLNode *node, const string &name, bool mandatory=false, const string &defaultValue=string())
Definition: xmlutils.cpp:277
static bool getChildValueAsBool(XMLNode *node, const string &name, bool mandatory=false, bool defaultValue=true)
Definition: xmlutils.cpp:296
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
bool parseBool(const string &s)
Convert text to bool.
Definition: parsers.cpp:144
Real parseReal(const string &s)
Convert text to Real.
Definition: parsers.cpp:112
Integer parseInteger(const string &s)
Convert text to QuantLib::Integer.
Definition: parsers.cpp:136
#define WLOG(text)
Logging Macro (Level = Warning)
Definition: log.hpp:550
+ Here is the call graph for this function:

◆ toXML()

XMLNode * toXML ( XMLDocument doc) const
overridevirtual

Implements XMLSerializable.

Definition at line 61 of file indexing.cpp.

61 {
62 XMLNode* node = doc.allocNode("Indexing");
63 XMLUtils::addChild(doc, node, "Quantity", quantity_);
64 XMLUtils::addChild(doc, node, "Index", index_);
65 XMLUtils::addChild(doc, node, "IndexFixingCalendar", indexFixingCalendar_);
66 XMLUtils::addChild(doc, node, "Dirty", indexIsDirty_);
67 XMLUtils::addChild(doc, node, "Relative", indexIsRelative_);
68 XMLUtils::addChild(doc, node, "ConditionalOnSurvival", indexIsConditionalOnSurvival_);
69 if (initialFixing_ != Null<Real>())
70 XMLUtils::addChild(doc, node, "InitialFixing", initialFixing_);
71 if (initialNotionalFixing_ != Null<Real>())
72 XMLUtils::addChild(doc, node, "InitialNotionalFixing", initialNotionalFixing_);
74 XMLNode* schedNode = valuationSchedule_.toXML(doc);
75 XMLUtils::setNodeName(doc, schedNode, "ValuationSchedule");
76 XMLUtils::appendNode(node, schedNode);
77 }
78 XMLUtils::addChild(doc, node, "FixingDays", static_cast<int>(fixingDays_));
79 XMLUtils::addChild(doc, node, "FixingCalendar", fixingCalendar_);
80 XMLUtils::addChild(doc, node, "FixingConvention", fixingConvention_);
81 XMLUtils::addChild(doc, node, "IsInArrears", inArrearsFixing_);
82 return node;
83}
bool hasData() const
Check if has any dates/rules/derived schedules.
Definition: schedule.hpp:223
virtual XMLNode * toXML(XMLDocument &doc) const override
Definition: schedule.cpp:198
static void setNodeName(XMLDocument &doc, XMLNode *node, const string &name)
Definition: xmlutils.cpp:478
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
Definition: xmlutils.cpp:181
static void appendNode(XMLNode *parent, XMLNode *child)
Definition: xmlutils.cpp:406
rapidxml::xml_node< char > XMLNode
Definition: xmlutils.hpp:60
+ Here is the call graph for this function:

Member Data Documentation

◆ hasData_

bool hasData_
private

Definition at line 103 of file indexing.hpp.

◆ quantity_

Real quantity_
private

Definition at line 104 of file indexing.hpp.

◆ index_

string index_
private

Definition at line 105 of file indexing.hpp.

◆ indexFixingCalendar_

string indexFixingCalendar_
private

Definition at line 106 of file indexing.hpp.

◆ indexIsDirty_

bool indexIsDirty_
private

Definition at line 107 of file indexing.hpp.

◆ indexIsRelative_

bool indexIsRelative_
private

Definition at line 108 of file indexing.hpp.

◆ indexIsConditionalOnSurvival_

bool indexIsConditionalOnSurvival_
private

Definition at line 109 of file indexing.hpp.

◆ initialFixing_

Real initialFixing_
private

Definition at line 110 of file indexing.hpp.

◆ initialNotionalFixing_

Real initialNotionalFixing_
private

Definition at line 111 of file indexing.hpp.

◆ valuationSchedule_

ScheduleData valuationSchedule_
private

Definition at line 112 of file indexing.hpp.

◆ fixingDays_

Size fixingDays_
private

Definition at line 113 of file indexing.hpp.

◆ fixingCalendar_

string fixingCalendar_
private

Definition at line 114 of file indexing.hpp.

◆ fixingConvention_

string fixingConvention_
private

Definition at line 115 of file indexing.hpp.

◆ inArrearsFixing_

bool inArrearsFixing_
private

Definition at line 116 of file indexing.hpp.