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

#include <ored/portfolio/underlying.hpp>

+ Inheritance diagram for InterestRateUnderlying:
+ Collaboration diagram for InterestRateUnderlying:

Public Member Functions

 InterestRateUnderlying ()
 Default Constructor. More...
 
 InterestRateUnderlying (const std::string &type, const std::string &name, const QuantLib::Real weight)
 Constructor with identifier information. More...
 
Serialisation
void fromXML (XMLNode *node) override
 
XMLNodetoXML (XMLDocument &doc) const override
 
- Public Member Functions inherited from Underlying
 Underlying ()
 Default Constructor. More...
 
 Underlying (const std::string &type, const std::string &name, const QuantLib::Real weight=QuantLib::Null< QuantLib::Real >())
 Constructor with type, name, weight. More...
 
void setType (const string &type)
 
void setName (const string &name)
 
void setWeight (const QuantLib::Real weight)
 
void setNodeName (const string &nodeName)
 
void setBasicUnderlyingNodeName (const string &basicUnderlyingNodeName)
 
const std::string & type () const
 
virtual const std::string & name () const
 
Real weight () 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...
 

Additional Inherited Members

- Protected Attributes inherited from Underlying
std::string type_
 
std::string name_
 
Real weight_ = QuantLib::Null<QuantLib::Real>()
 
std::string nodeName_
 
std::string basicUnderlyingNodeName_
 
bool isBasic_ = false
 

Detailed Description

Definition at line 176 of file underlying.hpp.

Constructor & Destructor Documentation

◆ InterestRateUnderlying() [1/2]

InterestRateUnderlying ( )
explicit

Default Constructor.

Definition at line 179 of file underlying.hpp.

179: Underlying() { setType("InterestRate"); };
Underlying()
Default Constructor.
Definition: underlying.hpp:40
void setType(const string &type)
Definition: underlying.hpp:53
+ Here is the call graph for this function:

◆ InterestRateUnderlying() [2/2]

InterestRateUnderlying ( const std::string &  type,
const std::string &  name,
const QuantLib::Real  weight 
)

Constructor with identifier information.

Definition at line 182 of file underlying.hpp.

183 : Underlying(type, name, weight){};
const std::string & type() const
Definition: underlying.hpp:63
Real weight() const
Definition: underlying.hpp:65
virtual const std::string & name() const
Definition: underlying.hpp:64

Member Function Documentation

◆ fromXML()

void fromXML ( XMLNode node)
overridevirtual

Reimplemented from Underlying.

Definition at line 191 of file underlying.cpp.

191 {
194 isBasic_ = true;
195 } else if (XMLUtils::getNodeName(node) == nodeName_) {
197 isBasic_ = false;
198 } else {
199 QL_FAIL("Need either a Name or Underlying node for InterestRateUnderlying.");
200 }
201 setType("InterestRate");
202}
std::string basicUnderlyingNodeName_
Definition: underlying.hpp:71
std::string nodeName_
Definition: underlying.hpp:71
virtual void fromXML(ore::data::XMLNode *node) override
Definition: underlying.cpp:33
static string getNodeName(XMLNode *n)
Get and set a node's name.
Definition: xmlutils.cpp:473
static string getNodeValue(XMLNode *node)
Get a node's value.
Definition: xmlutils.cpp:489
+ Here is the call graph for this function:

◆ toXML()

XMLNode * toXML ( XMLDocument doc) const
overridevirtual

Reimplemented from Underlying.

Definition at line 204 of file underlying.cpp.

204 {
205 XMLNode* node;
206 if (isBasic_) {
207 node = doc.allocNode(basicUnderlyingNodeName_, name_);
208 } else {
209 node = Underlying::toXML(doc);
210 }
211 return node;
212}
virtual ore::data::XMLNode * toXML(ore::data::XMLDocument &doc) const override
Definition: underlying.cpp:42
rapidxml::xml_node< char > XMLNode
Definition: xmlutils.hpp:60
+ Here is the call graph for this function: