22#include <ql/errors.hpp>
41 Date today = Settings::instance().evaluationDate();
42 if (vt >= today && vf <= today)
77 return Date::maxDate();
86 return Date::minDate();
92 const QuantLib::Date& referenceDate)
const {
110 LOG(
"Start parsing SIMMNameMappings");
120 ALOG(
"skip name mapping for name '" <<
name <<
"' and qualifier '" <<
qualifier <<
"'");
128 }
catch(std::exception&) {
129 ALOG(
"Cannot parse name mapping validTo " <<
validTo <<
" for qualifier " <<
qualifier <<
", ignore");
138 }
catch(std::exception&) {
139 ALOG(
"Cannot parse name mapping validFrom " <<
validFrom <<
" for qualifier " <<
qualifier <<
", ignore");
149 LOG(
"Finished parsing SIMMNameMappings");
154 LOG(
"Start toXML for SIMM name mappings");
170 LOG(
"Finished toXML for SIMM name mappings");
176 const std::string& validTo) {
184 }
catch (std::exception&) {
185 ALOG(
"Cannot parse name mapping validTo " <<
validTo <<
" for qualifier " <<
qualifier <<
", ignore");
192 }
catch (std::exception&) {
std::string validFrom(const std::string &externalName) const
Qualifier mapping start date (ISO date), may be blank and interpreted as QL::minDate()
std::string validTo(const std::string &externalName) const
Qualifier mapping expiry (ISO date), may be blank and interpreted as QL::maxDate()
QuantLib::Date validToDate(const std::string &externalName) const
Qualifier mapping expiry (QuantLib date)
std::map< std::string, std::string > mapping_
void fromXML(ore::data::XMLNode *node) override
QuantLib::Date validFromDate(const std::string &externalName) const
Qualifier mapping startDate (QuantLib date)
std::string externalName(const std::string &qualifier) const override
reverse lookup on qualifier
ore::data::XMLNode * toXML(ore::data::XMLDocument &doc) const override
void addMapping(const std::string &externalName, const std::string &qualifier, const std::string &validFrom="", const std::string &validTo="")
Add a single mapping.
bool hasQualifier(const std::string &externalName) const override
Has qualifier.
std::map< std::string, std::string > validFrom_
std::string qualifier(const std::string &externalName) const override
bool hasValidQualifier(const std::string &externalName, const QuantLib::Date &referenceDate) const
Has qualifier that is valid w.r.t. given reference date.
std::map< std::string, std::string > validTo_
XMLNode * allocNode(const string &nodeName)
static void checkNode(XMLNode *n, const string &expectedName)
static string getChildValue(XMLNode *node, const string &name, bool mandatory=false, const string &defaultValue=string())
static XMLNode * getChildNode(XMLNode *n, const string &name="")
static XMLNode * getNextSibling(XMLNode *node, const string &name="")
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
static void appendNode(XMLNode *parent, XMLNode *child)
Date parseDate(const string &s)
Basic SIMM class for mapping names to SIMM qualifiers.