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

#include <ored/portfolio/underlying.hpp>

+ Inheritance diagram for CreditUnderlying:
+ Collaboration diagram for CreditUnderlying:

Public Member Functions

 CreditUnderlying ()
 Default Constructor. More...
 
 CreditUnderlying (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 212 of file underlying.hpp.

Constructor & Destructor Documentation

◆ CreditUnderlying() [1/2]

CreditUnderlying ( )
explicit

Default Constructor.

Definition at line 215 of file underlying.hpp.

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

◆ CreditUnderlying() [2/2]

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

Constructor with identifier information.

Definition at line 218 of file underlying.hpp.

219 : 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 214 of file underlying.cpp.

214 {
217 isBasic_ = true;
218 } else if (XMLUtils::getNodeName(node) == nodeName_) {
220 isBasic_ = false;
221 } else {
222 QL_FAIL("Need either a Name or Underlying node for CreditUnderlying.");
223 }
224 setType("Credit");
225}
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 227 of file underlying.cpp.

227 {
228 XMLNode* node;
229 if (isBasic_) {
230 node = doc.allocNode(basicUnderlyingNodeName_, name_);
231 } else {
232 node = Underlying::toXML(doc);
233 }
234 return node;
235}
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: