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

Serializable object holding netting set identification data. More...

#include <ored/portfolio/nettingsetdetails.hpp>

+ Inheritance diagram for NettingSetDetails:
+ Collaboration diagram for NettingSetDetails:

Public Member Functions

 NettingSetDetails ()
 Default constructor. More...
 
 NettingSetDetails (const string &nettingSetId, const string &agreementType="", const string &callType="", const string &initialMarginType="", const string &legalEntityId="")
 Constructor with all fields. More...
 
 NettingSetDetails (const map< string, string > &nettingSetMap)
 Constructor to reconstruct NettingSetDetails from map (field name to field value) More...
 
Serialisation
virtual void fromXML (XMLNode *node) override
 
virtual XMLNodetoXML (XMLDocument &doc) const override
 
Inspectors
const string & nettingSetId () const
 
const string & agreementType () const
 
const string & callType () const
 
const string & initialMarginType () const
 
const string & legalEntityId () 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...
 

Utility

string nettingSetId_
 
string agreementType_
 
string callType_
 
string initialMarginType_
 
string legalEntityId_
 
bool empty () const
 Check if the netting set details have been populated. More...
 
bool emptyOptionalFields () const
 
const map< string, string > mapRepresentation () const
 Returns a map representation of the object. More...
 
static const vector< string > fieldNames (bool includeOptionalFields=true)
 Returns the XML field names of all the private members. More...
 
static const vector< string > optionalFieldNames ()
 

Detailed Description

Serializable object holding netting set identification data.

Definition at line 40 of file nettingsetdetails.hpp.

Constructor & Destructor Documentation

◆ NettingSetDetails() [1/3]

Default constructor.

Definition at line 43 of file nettingsetdetails.hpp.

◆ NettingSetDetails() [2/3]

NettingSetDetails ( const string &  nettingSetId,
const string &  agreementType = "",
const string &  callType = "",
const string &  initialMarginType = "",
const string &  legalEntityId = "" 
)

Constructor with all fields.

Definition at line 48 of file nettingsetdetails.hpp.

◆ NettingSetDetails() [3/3]

NettingSetDetails ( const map< string, string > &  nettingSetMap)

Constructor to reconstruct NettingSetDetails from map (field name to field value)

Definition at line 27 of file nettingsetdetails.cpp.

27 {
28 for (const auto& m : nettingSetMap) {
29 if (m.first == "NettingSetId") {
30 nettingSetId_ = nettingSetMap.at(m.first);
31 } else if (m.first == "AgreementType") {
32 agreementType_ = nettingSetMap.at(m.first);
33 } else if (m.first == "CallType") {
34 callType_ = nettingSetMap.at(m.first);
35 } else if (m.first == "InitialMarginType") {
36 initialMarginType_ = nettingSetMap.at(m.first);
37 } else if (m.first == "LegalEntityId") {
38 legalEntityId_ = nettingSetMap.at(m.first);
39 } else {
40 WLOG("NettingSetDetails:: Unsupported field \'" << m.second << "\'");
41 }
42 }
43}
#define WLOG(text)
Logging Macro (Level = Warning)
Definition: log.hpp:550

Member Function Documentation

◆ fromXML()

void fromXML ( XMLNode node)
overridevirtual

Implements XMLSerializable.

Definition at line 45 of file nettingsetdetails.cpp.

45 {
46 nettingSetId_ = XMLUtils::getChildValue(node, "NettingSetId", true);
47 agreementType_ = XMLUtils::getChildValue(node, "AgreementType", false);
48 callType_ = XMLUtils::getChildValue(node, "CallType", false);
49 initialMarginType_ = XMLUtils::getChildValue(node, "InitialMarginType", false);
50 legalEntityId_ = XMLUtils::getChildValue(node, "LegalEntityId", false);
51}
static string getChildValue(XMLNode *node, const string &name, bool mandatory=false, const string &defaultValue=string())
Definition: xmlutils.cpp:277
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toXML()

XMLNode * toXML ( XMLDocument doc) const
overridevirtual

Implements XMLSerializable.

Definition at line 53 of file nettingsetdetails.cpp.

53 {
54 XMLNode* nettingSetDetailsNode = doc.allocNode("NettingSetDetails");
55 XMLUtils::addChild(doc, nettingSetDetailsNode, "NettingSetId", nettingSetId_);
56 if (!agreementType_.empty())
57 XMLUtils::addChild(doc, nettingSetDetailsNode, "AgreementType", agreementType_);
58 if (!callType_.empty())
59 XMLUtils::addChild(doc, nettingSetDetailsNode, "CallType", callType_);
60 if (!initialMarginType_.empty())
61 XMLUtils::addChild(doc, nettingSetDetailsNode, "InitialMarginType", initialMarginType_);
62 if (!legalEntityId_.empty())
63 XMLUtils::addChild(doc, nettingSetDetailsNode, "LegalEntityId", legalEntityId_);
64
65 return nettingSetDetailsNode;
66}
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:
+ Here is the caller graph for this function:

◆ nettingSetId()

const string & nettingSetId ( ) const

Definition at line 64 of file nettingsetdetails.hpp.

64{ return nettingSetId_; }
+ Here is the caller graph for this function:

◆ agreementType()

const string & agreementType ( ) const

Definition at line 65 of file nettingsetdetails.hpp.

65{ return agreementType_; }
+ Here is the caller graph for this function:

◆ callType()

const string & callType ( ) const

Definition at line 66 of file nettingsetdetails.hpp.

66{ return callType_; }
+ Here is the caller graph for this function:

◆ initialMarginType()

const string & initialMarginType ( ) const

Definition at line 67 of file nettingsetdetails.hpp.

67{ return initialMarginType_; }
+ Here is the caller graph for this function:

◆ legalEntityId()

const string & legalEntityId ( ) const

Definition at line 68 of file nettingsetdetails.hpp.

68{ return legalEntityId_; }
+ Here is the caller graph for this function:

◆ empty()

bool empty ( ) const

Check if the netting set details have been populated.

Definition at line 74 of file nettingsetdetails.hpp.

74{ return nettingSetId_.empty(); }
+ Here is the caller graph for this function:

◆ emptyOptionalFields()

bool emptyOptionalFields ( ) const

Definition at line 75 of file nettingsetdetails.hpp.

75 {
76 return agreementType_.empty() && callType_.empty() && initialMarginType_.empty() && legalEntityId_.empty();
77 }
+ Here is the caller graph for this function:

◆ mapRepresentation()

const map< string, string > mapRepresentation ( ) const

Returns a map representation of the object.

Definition at line 82 of file nettingsetdetails.cpp.

82 {
83 map<string, string> rep;
84 rep.insert({"NettingSetId", nettingSetId()});
85 rep.insert({"AgreementType", agreementType()});
86 rep.insert({"CallType", callType()});
87 rep.insert({"InitialMarginType", initialMarginType()});
88 rep.insert({"LegalEntityId", legalEntityId()});
89
90 return rep;
91}
+ Here is the call graph for this function:

◆ fieldNames()

const vector< string > fieldNames ( bool  includeOptionalFields = true)
static

Returns the XML field names of all the private members.

Definition at line 68 of file nettingsetdetails.cpp.

68 {
69 vector<string> fieldNames;
70 if (includeOptionalFields)
71 fieldNames = {"NettingSetId", "AgreementType", "CallType", "InitialMarginType", "LegalEntityId"};
72 else
73 fieldNames = {"NettingSetId"};
74
75 return fieldNames;
76}
static const vector< string > fieldNames(bool includeOptionalFields=true)
Returns the XML field names of all the private members.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ optionalFieldNames()

const vector< string > optionalFieldNames ( )
static

Definition at line 78 of file nettingsetdetails.cpp.

78 {
79 return vector<string>({"AgreementType", "CallType", "InitialMarginType", "LegalEntityId"});
80}

Member Data Documentation

◆ nettingSetId_

string nettingSetId_
private

Definition at line 88 of file nettingsetdetails.hpp.

◆ agreementType_

string agreementType_
private

Definition at line 89 of file nettingsetdetails.hpp.

◆ callType_

string callType_
private

Definition at line 90 of file nettingsetdetails.hpp.

◆ initialMarginType_

string initialMarginType_
private

Definition at line 91 of file nettingsetdetails.hpp.

◆ legalEntityId_

string legalEntityId_
private

Definition at line 92 of file nettingsetdetails.hpp.