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

Serializable object holding a trade action. More...

#include <ored/portfolio/tradeactions.hpp>

+ Inheritance diagram for TradeAction:
+ Collaboration diagram for TradeAction:

Public Member Functions

 TradeAction ()
 Default constructor. More...
 
 TradeAction (const string &type, const string &owner, const ScheduleData &schedule)
 Constructor. More...
 
Inspectors
const string & type () const
 
const string & owner () const
 
const ScheduleDataschedule () 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

string type_
 
string owner_
 
ScheduleData schedule_
 
virtual void fromXML (XMLNode *node) override
 
virtual XMLNodetoXML (XMLDocument &doc) const override
 

Detailed Description

Serializable object holding a trade action.

Definition at line 42 of file tradeactions.hpp.

Constructor & Destructor Documentation

◆ TradeAction() [1/2]

Default constructor.

Definition at line 45 of file tradeactions.hpp.

45{}

◆ TradeAction() [2/2]

TradeAction ( const string &  type,
const string &  owner,
const ScheduleData schedule 
)

Constructor.

Definition at line 48 of file tradeactions.hpp.

const ScheduleData & schedule() const
const string & type() const
const string & owner() const

Member Function Documentation

◆ type()

const string & type ( ) const

Definition at line 53 of file tradeactions.hpp.

53{ return type_; }

◆ owner()

const string & owner ( ) const

Definition at line 54 of file tradeactions.hpp.

54{ return owner_; }

◆ schedule()

const ScheduleData & schedule ( ) const

Definition at line 55 of file tradeactions.hpp.

55{ return schedule_; }

◆ fromXML()

void fromXML ( XMLNode node)
overridevirtual

Implements XMLSerializable.

Definition at line 26 of file tradeactions.cpp.

26 {
27 XMLUtils::checkNode(node, "TradeAction");
28 type_ = XMLUtils::getChildValue(node, "Type", true);
29 owner_ = XMLUtils::getChildValue(node, "Owner", true);
30 schedule_.fromXML(XMLUtils::getChildNode(node, "Schedule"));
31}
virtual void fromXML(XMLNode *node) override
Definition: schedule.cpp:179
static void checkNode(XMLNode *n, const string &expectedName)
Definition: xmlutils.cpp:175
static string getChildValue(XMLNode *node, const string &name, bool mandatory=false, const string &defaultValue=string())
Definition: xmlutils.cpp:277
static XMLNode * getChildNode(XMLNode *n, const string &name="")
Definition: xmlutils.cpp:387
+ Here is the call graph for this function:

◆ toXML()

XMLNode * toXML ( XMLDocument doc) const
overridevirtual

Implements XMLSerializable.

Definition at line 33 of file tradeactions.cpp.

33 {
34 XMLNode* node = doc.allocNode("TradeAction");
35 QL_REQUIRE(node, "Failed to create trade node");
36 XMLUtils::addChild(doc, node, "Type", type_);
37 XMLUtils::addChild(doc, node, "Owner", owner_);
39 return node;
40}
virtual XMLNode * toXML(XMLDocument &doc) const override
Definition: schedule.cpp:198
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
Definition: xmlutils.cpp:181
static void appendNode(XMLNode *parent, XMLNode *child)
Definition: xmlutils.cpp:406
rapidxml::xml_node< char > XMLNode
Definition: xmlutils.hpp:60
+ Here is the call graph for this function:

Member Data Documentation

◆ type_

string type_
private

Definition at line 65 of file tradeactions.hpp.

◆ owner_

string owner_
private

Definition at line 66 of file tradeactions.hpp.

◆ schedule_

ScheduleData schedule_
private

Definition at line 67 of file tradeactions.hpp.