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

Serializable obejct holding range bound data. More...

#include <ored/portfolio/rangebound.hpp>

+ Inheritance diagram for RangeBound:
+ Collaboration diagram for RangeBound:

Public Member Functions

 RangeBound ()
 Default constructor. More...
 
 RangeBound (const Real from, const Real to, const Real leverage, const Real strike, const Real strikeAdjustment)
 Constructor. More...
 
Inspectors
Real from () const
 
Real to () const
 
Real leverage () const
 
Real strike () const
 
Real strikeAdjustment () 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...
 

Serialisation

Real from_
 
Real to_
 
Real leverage_
 
Real strike_
 
Real strikeAdjustment_
 
virtual void fromXML (ore::data::XMLNode *node) override
 
virtual ore::data::XMLNodetoXML (ore::data::XMLDocument &doc) const override
 

Detailed Description

Serializable obejct holding range bound data.

Definition at line 39 of file rangebound.hpp.

Constructor & Destructor Documentation

◆ RangeBound() [1/2]

Default constructor.

Definition at line 42 of file rangebound.hpp.

42: from_(Null<Real>()), to_(Null<Real>()), leverage_(Null<Real>()), strike_(Null<Real>()) {}

◆ RangeBound() [2/2]

RangeBound ( const Real  from,
const Real  to,
const Real  leverage,
const Real  strike,
const Real  strikeAdjustment 
)

Constructor.

Definition at line 44 of file rangebound.hpp.

Member Function Documentation

◆ from()

Real from ( ) const

Definition at line 49 of file rangebound.hpp.

49{ return from_; }
+ Here is the caller graph for this function:

◆ to()

Real to ( ) const

Definition at line 50 of file rangebound.hpp.

50{ return to_; }
+ Here is the caller graph for this function:

◆ leverage()

Real leverage ( ) const

Definition at line 51 of file rangebound.hpp.

51{ return leverage_; }
+ Here is the caller graph for this function:

◆ strike()

Real strike ( ) const

Definition at line 52 of file rangebound.hpp.

52{ return strike_; }
+ Here is the caller graph for this function:

◆ strikeAdjustment()

Real strikeAdjustment ( ) const

Definition at line 53 of file rangebound.hpp.

53{ return strikeAdjustment_; }
+ Here is the caller graph for this function:

◆ fromXML()

void fromXML ( ore::data::XMLNode node)
overridevirtual

Implements XMLSerializable.

Definition at line 27 of file rangebound.cpp.

27 {
28 XMLUtils::checkNode(node, "RangeBound");
29 if (auto n = XMLUtils::getChildNode(node, "RangeFrom"))
31 else
32 from_ = Null<Real>();
33 if (auto n = XMLUtils::getChildNode(node, "RangeTo"))
35 else
36 to_ = Null<Real>();
37 if (auto n = XMLUtils::getChildNode(node, "Leverage"))
39 else
40 leverage_ = Null<Real>();
41 if (auto n = XMLUtils::getChildNode(node, "Strike"))
43 else
44 strike_ = Null<Real>();
45 if (auto n = XMLUtils::getChildNode(node, "StrikeAdjustment"))
47 else
48 strikeAdjustment_ = Null<Real>();
49}
static void checkNode(XMLNode *n, const string &expectedName)
Definition: xmlutils.cpp:175
static XMLNode * getChildNode(XMLNode *n, const string &name="")
Definition: xmlutils.cpp:387
static string getNodeValue(XMLNode *node)
Get a node's value.
Definition: xmlutils.cpp:489
Real parseReal(const string &s)
Convert text to Real.
Definition: parsers.cpp:112
+ Here is the call graph for this function:

◆ toXML()

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

Implements XMLSerializable.

Definition at line 51 of file rangebound.cpp.

51 {
52 XMLNode* node = doc.allocNode("RangeBound");
53 if (from_ != Null<Real>())
54 XMLUtils::addChild(doc, node, "RangeFrom", from_);
55 if (to_ != Null<Real>())
56 XMLUtils::addChild(doc, node, "RangeTo", to_);
57 if (leverage_ != Null<Real>())
58 XMLUtils::addChild(doc, node, "Leverage", leverage_);
59 if (strike_ != Null<Real>())
60 XMLUtils::addChild(doc, node, "Strike", strike_);
61 if (strikeAdjustment_ != Null<Real>())
62 XMLUtils::addChild(doc, node, "StrikeAdjustment", strikeAdjustment_);
63 return node;
64}
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
rapidxml::xml_node< char > XMLNode
Definition: xmlutils.hpp:60
+ Here is the call graph for this function:

Member Data Documentation

◆ from_

Real from_
private

Definition at line 63 of file rangebound.hpp.

◆ to_

Real to_
private

Definition at line 63 of file rangebound.hpp.

◆ leverage_

Real leverage_
private

Definition at line 63 of file rangebound.hpp.

◆ strike_

Real strike_
private

Definition at line 63 of file rangebound.hpp.

◆ strikeAdjustment_

Real strikeAdjustment_
private

Definition at line 63 of file rangebound.hpp.