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

#include <ored/portfolio/underlying.hpp>

+ Inheritance diagram for FXUnderlying:
+ Collaboration diagram for FXUnderlying:

Public Member Functions

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

Constructor & Destructor Documentation

◆ FXUnderlying() [1/2]

FXUnderlying ( )
explicit

Default Constructor.

Definition at line 163 of file underlying.hpp.

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

◆ FXUnderlying() [2/2]

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

Constructor with identifier information.

Definition at line 166 of file underlying.hpp.

167 : 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 168 of file underlying.cpp.

168 {
171 isBasic_ = true;
172 } else if (XMLUtils::getNodeName(node) == nodeName_) {
174 isBasic_ = false;
175 } else {
176 QL_FAIL("Need either a Name or Underlying node for FXUnderlying.");
177 }
178 setType("FX");
179}
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 181 of file underlying.cpp.

181 {
182 XMLNode* node;
183 if (isBasic_) {
184 node = doc.allocNode(basicUnderlyingNodeName_, name_);
185 } else {
186 node = Underlying::toXML(doc);
187 }
188 return node;
189}
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: