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

#include <ored/portfolio/underlying.hpp>

+ Inheritance diagram for BasicUnderlying:
+ Collaboration diagram for BasicUnderlying:

Public Member Functions

 BasicUnderlying ()
 Default Constructor. More...
 
 BasicUnderlying (const std::string &name)
 Constructor with identifier. 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 75 of file underlying.hpp.

Constructor & Destructor Documentation

◆ BasicUnderlying() [1/2]

Default Constructor.

Definition at line 78 of file underlying.hpp.

78 : Underlying() {
79 setType("Basic");
80 isBasic_ = true;
81 };
Underlying()
Default Constructor.
Definition: underlying.hpp:40
void setType(const string &type)
Definition: underlying.hpp:53
+ Here is the call graph for this function:

◆ BasicUnderlying() [2/2]

BasicUnderlying ( const std::string &  name)
explicit

Constructor with identifier.

Definition at line 84 of file underlying.hpp.

84: Underlying("Basic", name) { isBasic_ = true; }
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 50 of file underlying.cpp.

50 {
53 isBasic_ = true;
54 } else {
55 QL_FAIL("Need a " << basicUnderlyingNodeName_ << " node for BasicUnderlying.");
56 }
57 setType("Basic");
58}
std::string basicUnderlyingNodeName_
Definition: underlying.hpp:71
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 60 of file underlying.cpp.

60 {
61 XMLNode* node = doc.allocNode(basicUnderlyingNodeName_, name_);
62 return node;
63}
rapidxml::xml_node< char > XMLNode
Definition: xmlutils.hpp:60
+ Here is the call graph for this function: