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

Equity Reference data. More...

#include <ored/portfolio/referencedata.hpp>

+ Inheritance diagram for EquityReferenceDatum:
+ Collaboration diagram for EquityReferenceDatum:

Classes

struct  EquityData
 

Public Member Functions

 EquityReferenceDatum ()
 
 EquityReferenceDatum (const std::string &id)
 
 EquityReferenceDatum (const std::string &id, const QuantLib::Date &validFrom)
 
 EquityReferenceDatum (const std::string &id, const EquityData &equityData)
 
 EquityReferenceDatum (const std::string &id, const QuantLib::Date &validFrom, const EquityData &equityData)
 
void fromXML (XMLNode *node) override
 
XMLNodetoXML (ore::data::XMLDocument &doc) const override
 
const EquityDataequityData () const
 
void setEquityData (const EquityData &equityData)
 
- Public Member Functions inherited from ReferenceDatum
 ReferenceDatum ()
 Default Constructor. More...
 
 ReferenceDatum (const std::string &type, const std::string &id)
 Base class constructor. More...
 
 ReferenceDatum (const std::string &type, const std::string &id, const QuantLib::Date &validFrom)
 Base class constructor. More...
 
void setType (const string &type)
 setters More...
 
void setId (const string &id)
 
void setValidFrom (const QuantLib::Date &validFrom)
 
const std::string & type () const
 getters More...
 
const std::string & id () const
 
const QuantLib::Date & validFrom () const
 
void fromXML (XMLNode *node) override
 
XMLNodetoXML (ore::data::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...
 

Static Public Attributes

static constexpr const char * TYPE = "Equity"
 

Protected Attributes

EquityData equityData_
 

Detailed Description

Equity Reference data.

Definition at line 463 of file referencedata.hpp.

Constructor & Destructor Documentation

◆ EquityReferenceDatum() [1/5]

Definition at line 481 of file referencedata.hpp.

481{ setType(TYPE); }
static constexpr const char * TYPE
void setType(const string &type)
setters
+ Here is the call graph for this function:

◆ EquityReferenceDatum() [2/5]

EquityReferenceDatum ( const std::string &  id)

Definition at line 483 of file referencedata.hpp.

Base class for reference data.

◆ EquityReferenceDatum() [3/5]

EquityReferenceDatum ( const std::string &  id,
const QuantLib::Date &  validFrom 
)

Definition at line 485 of file referencedata.hpp.

const QuantLib::Date & validFrom() const

◆ EquityReferenceDatum() [4/5]

EquityReferenceDatum ( const std::string &  id,
const EquityData equityData 
)

Definition at line 488 of file referencedata.hpp.

const EquityData & equityData() const
ReferenceDatum()
Default Constructor.

◆ EquityReferenceDatum() [5/5]

EquityReferenceDatum ( const std::string &  id,
const QuantLib::Date &  validFrom,
const EquityData equityData 
)

Definition at line 490 of file referencedata.hpp.

Member Function Documentation

◆ fromXML()

void fromXML ( XMLNode node)
overridevirtual

Reimplemented from ReferenceDatum.

Definition at line 559 of file referencedata.cpp.

559 {
561 XMLNode* innerNode = XMLUtils::getChildNode(node, "EquityReferenceData");
562 QL_REQUIRE(innerNode, "No EquityReferenceData node");
563
564 equityData_.equityId = XMLUtils::getChildValue(innerNode, "EquityId", true);
565 equityData_.equityName = XMLUtils::getChildValue(innerNode, "EquityName", true);
566 equityData_.currency = XMLUtils::getChildValue(innerNode, "Currency", true);
567 equityData_.scalingFactor = XMLUtils::getChildValueAsInt(innerNode, "ScalingFactor", true);
568 equityData_.exchangeCode = XMLUtils::getChildValue(innerNode, "ExchangeCode", true);
569 equityData_.isIndex = XMLUtils::getChildValueAsBool(innerNode, "IsIndex", true);
570 equityData_.equityStartDate = parseDate(XMLUtils::getChildValue(innerNode, "EquityStartDate", true));
571 equityData_.proxyIdentifier = XMLUtils::getChildValue(innerNode, "ProxyIdentifier", true);
572 equityData_.simmBucket = XMLUtils::getChildValue(innerNode, "SimmBucket", true);
573 equityData_.crifQualifier = XMLUtils::getChildValue(innerNode, "CrifQualifier", true);
574 equityData_.proxyVolatilityId = XMLUtils::getChildValue(innerNode, "ProxyVolatilityId", true);
575}
void fromXML(XMLNode *node) override
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 int getChildValueAsInt(XMLNode *node, const string &name, bool mandatory=false, int defaultValue=0)
Definition: xmlutils.cpp:291
Date parseDate(const string &s)
Convert std::string to QuantLib::Date.
Definition: parsers.cpp:51
rapidxml::xml_node< char > XMLNode
Definition: xmlutils.hpp:60
+ Here is the call graph for this function:

◆ toXML()

XMLNode * toXML ( ore::data::XMLDocument doc) const
overridevirtual

Reimplemented from ReferenceDatum.

Definition at line 577 of file referencedata.cpp.

577 {
578 XMLNode* node = ReferenceDatum::toXML(doc);
579 XMLNode* equityNode = doc.allocNode("EquityReferenceData");
580 XMLUtils::appendNode(node, equityNode);
581 XMLUtils::addChild(doc, equityNode, "EquityId", equityData_.equityId);
582 XMLUtils::addChild(doc, equityNode, "EquityName", equityData_.equityName);
583 XMLUtils::addChild(doc, equityNode, "Currency", equityData_.currency);
584 XMLUtils::addChild(doc, equityNode, "ScalingFactor", int(equityData_.scalingFactor));
585 XMLUtils::addChild(doc, equityNode, "ExchangeCode", equityData_.exchangeCode);
586 XMLUtils::addChild(doc, equityNode, "IsIndex", equityData_.isIndex);
587 XMLUtils::addChild(doc, equityNode, "EquityStartDate", to_string(equityData_.equityStartDate));
588 XMLUtils::addChild(doc, equityNode, "ProxyIdentifier", equityData_.proxyIdentifier);
589 XMLUtils::addChild(doc, equityNode, "SimmBucket", equityData_.simmBucket);
590 XMLUtils::addChild(doc, equityNode, "CrifQualifier", equityData_.crifQualifier);
591 XMLUtils::addChild(doc, equityNode, "ProxyVolatilityId", equityData_.proxyVolatilityId);
592 return node;
593}
XMLNode * toXML(ore::data::XMLDocument &doc) const override
XMLNode * allocNode(const string &nodeName)
util functions that wrap rapidxml
Definition: xmlutils.cpp:132
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
std::string to_string(const LocationInfo &l)
Definition: ast.cpp:28
+ Here is the call graph for this function:

◆ equityData()

const EquityData & equityData ( ) const

Definition at line 497 of file referencedata.hpp.

497{ return equityData_; }
+ Here is the caller graph for this function:

◆ setEquityData()

void setEquityData ( const EquityData equityData)

Definition at line 498 of file referencedata.hpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ TYPE

constexpr const char* TYPE = "Equity"
staticconstexpr

Definition at line 465 of file referencedata.hpp.

◆ equityData_

EquityData equityData_
protected

Definition at line 501 of file referencedata.hpp.