Singleton to hold conventions.
More...
#include <ored/configuration/conventions.hpp>
Singleton to hold conventions.
Definition at line 162 of file conventions.hpp.
◆ InstrumentConventions()
Definition at line 166 of file conventions.hpp.
166{
conventions_[Date()] = QuantLib::ext::make_shared<ore::data::Conventions>(); }
std::map< QuantLib::Date, QuantLib::ext::shared_ptr< ore::data::Conventions > > conventions_
◆ conventions()
const QuantLib::ext::shared_ptr< ore::data::Conventions > & conventions |
( |
QuantLib::Date |
d = QuantLib::Date() | ) |
const |
Definition at line 72 of file conventions.cpp.
72 {
73 QL_REQUIRE(!
conventions_.empty(),
"InstrumentConventions: No conventions provided.");
74 boost::shared_lock<boost::shared_mutex> lock(
mutex_);
75 Date dt = d == Date() ? Settings::instance().evaluationDate() : d;
78 return it->second;
79 QL_REQUIRE(it !=
conventions_.begin(),
"InstrumentConventions: Could not find conventions for " << dt);
80 --it;
81 constexpr std::size_t max_num_warnings = 10;
84 WLOG(
"InstrumentConventions: Could not find conventions for "
85 << dt << ", using conventions from " << it->first
87 : ""));
88 }
89 return it->second;
90}
std::size_t numberOfEmittedWarnings_
boost::shared_mutex mutex_
#define WLOG(text)
Logging Macro (Level = Warning)
◆ setConventions()
void setConventions |
( |
const QuantLib::ext::shared_ptr< ore::data::Conventions > & |
conventions, |
|
|
QuantLib::Date |
d = QuantLib::Date() |
|
) |
| |
Definition at line 92 of file conventions.cpp.
93 {
94 boost::unique_lock<boost::shared_mutex> lock(
mutex_);
96}
const QuantLib::ext::shared_ptr< ore::data::Conventions > & conventions(QuantLib::Date d=QuantLib::Date()) const
◆ clear()
◆ QuantLib::Singleton< InstrumentConventions, std::integral_constant< bool, true > >
◆ conventions_
◆ mutex_
boost::shared_mutex mutex_ |
|
mutableprivate |
◆ numberOfEmittedWarnings_
std::size_t numberOfEmittedWarnings_ = 0 |
|
mutableprivate |