1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta name="robots" content="none">
<title>Settings Class Reference</title>
<link rel="stylesheet" href="quantlib.css" type="text/css">
<link rel="stylesheet" href="print.css" type="text/css" media="print">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
</head>
<body>
<div id="container">
<div id="header">
<img class="titleimage"
src="QL-title.jpg" width="185" height="50" border="0"
alt="QuantLib">
<br>
<h3 class="subtitle">A free/open-source library for quantitative finance</h3>
</div>
<div id="menu">
<h3 class="navbartitle">Version 1.2</h3>
<hr>
<h3 class="navbartitle">Getting started</h3>
<ul class="navbarlist">
<li class="navlink"><a href="index.html">Introduction</a></li>
<li class="navlink"><a href="where.html">Where to get QuantLib</a></li>
<li class="navlink"><a href="install.html">Installation</a></li>
<li class="navlink"><a href="config.html">Configuration</a></li>
<li class="navlink"><a href="usage.html">Usage</a></li>
<li class="navlink"><a href="history.html">Version history</a></li>
<li class="navlink"><a href="resources.html">Additional resources</a></li>
<li class="navlink"><a href="group.html">The QuantLib group</a></li>
<li class="navlink"><a href="license.html">Copyright and license</a></li>
</ul>
<hr>
<h3 class="navbartitle">Reference manual</h3>
<ul class="navbarlist">
<li class="navlink"><a href="modules.html">Modules</a></li>
<li class="navlink"><a href="hierarchy.html">Class Hierarchy</a></li>
<li class="navlink"><a href="annotated.html">Compound List</a></li>
<li class="navlink"><a href="files.html">File List</a></li>
<li class="navlink"><a href="functions.html">Compound Members</a></li>
<li class="navlink"><a href="globals.html">File Members</a></li>
<li class="navlink"><a href="todo.html">Todo List</a></li>
<li class="navlink"><a href="bug.html">Known Bugs</a></li>
<li class="navlink"><a href="caveats.html">Caveats</a></li>
<li class="navlink"><a href="test.html">Test Suite</a></li>
<li class="navlink"><a href="examples.html">Examples</a></li>
</ul>
</div>
<div id="content">
<!--Doxygen-generated content-->
<!-- Generated by Doxygen 1.7.6.1 -->
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><b>QuantLib</b> </li>
<li class="navelem"><a class="el" href="class_quant_lib_1_1_settings.html">Settings</a> </li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="#friends">Friends</a> </div>
<div class="headertitle">
<div class="title">Settings Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="QuantLib::Settings" --><!-- doxytag: inherits="Singleton< Settings >" -->
<p>global repository for run-time library settings
<a href="class_quant_lib_1_1_settings.html#details">More...</a></p>
<p><code>#include <ql/settings.hpp></code></p>
<div class="dynheader">
Inheritance diagram for Settings:</div>
<div class="dyncontent">
<div class="center"><img src="class_quant_lib_1_1_settings__inherit__graph.png" border="0" usemap="#_settings_inherit__map" alt="Inheritance graph"/></div>
<map name="_settings_inherit__map" id="_settings_inherit__map">
<area shape="rect" id="node2" href="class_quant_lib_1_1_singleton.html" title="Singleton\< Settings \>" alt="" coords="5,6,152,37"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<p><a href="class_quant_lib_1_1_settings-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">DateProxy & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_settings.html#a95055e9410ed0465a5f30d3ffc90c1d3">evaluationDate</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">the date at which pricing is to be performed. <a href="#a95055e9410ed0465a5f30d3ffc90c1d3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae3189c550eea150ee68d731a28248ee2"></a><!-- doxytag: member="QuantLib::Settings::evaluationDate" ref="ae3189c550eea150ee68d731a28248ee2" args="() const " -->
const DateProxy & </td><td class="memItemRight" valign="bottom"><b>evaluationDate</b> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_settings.html#a9aa8356b35815cebac2f917f6d4e6b4f">anchorEvaluationDate</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_settings.html#a3d83ddb191bf74ffee552d9dd9fc2d3f">resetEvaluationDate</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_settings.html#a42985b53935a1455fae87abac7897abe">includeReferenceDateEvents</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a661c3f098e93123cf66b0435b1a5e0c6"></a><!-- doxytag: member="QuantLib::Settings::includeReferenceDateEvents" ref="a661c3f098e93123cf66b0435b1a5e0c6" args="() const " -->
bool </td><td class="memItemRight" valign="bottom"><b>includeReferenceDateEvents</b> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab02fe975a741a17aedf64c1904f73365"></a><!-- doxytag: member="QuantLib::Settings::includeReferenceDateCashFlows" ref="ab02fe975a741a17aedf64c1904f73365" args="()" -->
bool & </td><td class="memItemRight" valign="bottom"><b>includeReferenceDateCashFlows</b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a12e32d242634ec425ce24f3186bf65bd"></a><!-- doxytag: member="QuantLib::Settings::includeReferenceDateCashFlows" ref="a12e32d242634ec425ce24f3186bf65bd" args="() const " -->
bool </td><td class="memItemRight" valign="bottom"><b>includeReferenceDateCashFlows</b> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">boost::optional< bool > & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_quant_lib_1_1_settings.html#ae3bc274d0c10bfa3b2c27380eb000032">includeTodaysCashFlows</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1dbed895b6b7fa9c7c61a6618d55feac"></a><!-- doxytag: member="QuantLib::Settings::includeTodaysCashFlows" ref="a1dbed895b6b7fa9c7c61a6618d55feac" args="() const " -->
boost::optional< bool > </td><td class="memItemRight" valign="bottom"><b>includeTodaysCashFlows</b> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af595a253588ed5bb7d32db3ea376343a"></a><!-- doxytag: member="QuantLib::Settings::enforcesTodaysHistoricFixings" ref="af595a253588ed5bb7d32db3ea376343a" args="()" -->
bool & </td><td class="memItemRight" valign="bottom"><b>enforcesTodaysHistoricFixings</b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adda3a6a81339120e1ff517e66fc08420"></a><!-- doxytag: member="QuantLib::Settings::enforcesTodaysHistoricFixings" ref="adda3a6a81339120e1ff517e66fc08420" args="() const " -->
bool </td><td class="memItemRight" valign="bottom"><b>enforcesTodaysHistoricFixings</b> () const </td></tr>
<tr><td colspan="2"><h2><a name="friends"></a>
Friends</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a91c99b41b2e91d182b86ccc958e3248e"></a><!-- doxytag: member="QuantLib::Settings::Singleton< Settings >" ref="a91c99b41b2e91d182b86ccc958e3248e" args="" -->
class </td><td class="memItemRight" valign="bottom"><b>Singleton< Settings ></b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7372fd0b783fb5d23e60a661934d1203"></a><!-- doxytag: member="QuantLib::Settings::operator<<" ref="a7372fd0b783fb5d23e60a661934d1203" args="(std::ostream &, const DateProxy &)" -->
std::ostream & </td><td class="memItemRight" valign="bottom"><b>operator<<</b> (std::ostream &, const DateProxy &)</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>global repository for run-time library settings </p>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a95055e9410ed0465a5f30d3ffc90c1d3"></a><!-- doxytag: member="QuantLib::Settings::evaluationDate" ref="a95055e9410ed0465a5f30d3ffc90c1d3" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Settings::DateProxy & <a class="el" href="class_quant_lib_1_1_settings.html#a95055e9410ed0465a5f30d3ffc90c1d3">evaluationDate</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>the date at which pricing is to be performed. </p>
<p>Client code can inspect the evaluation date, as in: </p>
<div class="fragment"><pre class="fragment"> Date d = <a class="code" href="class_quant_lib_1_1_singleton.html#ab7455b7e1235d292c444095842349291" title="access to the unique instance">Settings::instance</a>().<a class="code" href="class_quant_lib_1_1_settings.html#a95055e9410ed0465a5f30d3ffc90c1d3" title="the date at which pricing is to be performed.">evaluationDate</a>();
</pre></div><p> where today's date is returned if the evaluation date is set to the null date (its default value;) can set it to a new value, as in: </p>
<div class="fragment"><pre class="fragment"> <a class="code" href="class_quant_lib_1_1_singleton.html#ab7455b7e1235d292c444095842349291" title="access to the unique instance">Settings::instance</a>().<a class="code" href="class_quant_lib_1_1_settings.html#a95055e9410ed0465a5f30d3ffc90c1d3" title="the date at which pricing is to be performed.">evaluationDate</a>() = d;
</pre></div><p> and can register with it, as in: </p>
<div class="fragment"><pre class="fragment"> registerWith(<a class="code" href="class_quant_lib_1_1_singleton.html#ab7455b7e1235d292c444095842349291" title="access to the unique instance">Settings::instance</a>().<a class="code" href="class_quant_lib_1_1_settings.html#a95055e9410ed0465a5f30d3ffc90c1d3" title="the date at which pricing is to be performed.">evaluationDate</a>());
</pre></div><p> to be notified when it is set to a new value. </p>
<dl class="caveats"><dt><b><a class="el" href="caveats.html#_caveats000105">Warning:</a></b></dt><dd>a notification is not sent when the evaluation date changes for natural causes---i.e., a date was not explicitly set (which results in today's date being used for pricing) and the current date changes as the clock strikes midnight. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="_bermudan_swaption_8cpp-example.html#a10">BermudanSwaption.cpp</a>, <a class="el" href="_bonds_8cpp-example.html#a8">Bonds.cpp</a>, <a class="el" href="_convertible_bonds_8cpp-example.html#a12">ConvertibleBonds.cpp</a>, <a class="el" href="_equity_option_8cpp-example.html#a5">EquityOption.cpp</a>, <a class="el" href="_replication_8cpp-example.html#a3">Replication.cpp</a>, and <a class="el" href="swapvaluation_8cpp-example.html#a7">swapvaluation.cpp</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="a9aa8356b35815cebac2f917f6d4e6b4f"></a><!-- doxytag: member="QuantLib::Settings::anchorEvaluationDate" ref="a9aa8356b35815cebac2f917f6d4e6b4f" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="class_quant_lib_1_1_settings.html#a9aa8356b35815cebac2f917f6d4e6b4f">anchorEvaluationDate</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Call this to prevent the evaluation date to change at midnight (and, incidentally, to gain quite a bit of performance.) If no evaluation date was previously set, it is equivalent to setting the evaluation date to <a class="el" href="class_quant_lib_1_1_date.html#aa3b3414c408337e640d21c0936602c66" title="today's date.">Date::todaysDate()</a>; if an evaluation date other than Date() was already set, it has no effect. </p>
</div>
</div>
<a class="anchor" id="a3d83ddb191bf74ffee552d9dd9fc2d3f"></a><!-- doxytag: member="QuantLib::Settings::resetEvaluationDate" ref="a3d83ddb191bf74ffee552d9dd9fc2d3f" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="class_quant_lib_1_1_settings.html#a3d83ddb191bf74ffee552d9dd9fc2d3f">resetEvaluationDate</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Call this to reset the evaluation date to <a class="el" href="class_quant_lib_1_1_date.html#aa3b3414c408337e640d21c0936602c66" title="today's date.">Date::todaysDate()</a> and allow it to change at midnight. It is equivalent to setting the evaluation date to Date(). This comes at the price of losing some performance, since the evaluation date is re-evaluated each time it is read. </p>
</div>
</div>
<a class="anchor" id="a42985b53935a1455fae87abac7897abe"></a><!-- doxytag: member="QuantLib::Settings::includeReferenceDateEvents" ref="a42985b53935a1455fae87abac7897abe" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool & <a class="el" href="class_quant_lib_1_1_settings.html#a42985b53935a1455fae87abac7897abe">includeReferenceDateEvents</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This flag specifies whether or not Events occurring on the reference date should, by default, be taken into account as not happened yet. It can be overridden locally when calling the <a class="el" href="class_quant_lib_1_1_event.html#aca737dd96c9485ce9613e5fb187c46eb" title="returns true if an event has already occurred before a date">Event::hasOccurred</a> method. </p>
</div>
</div>
<a class="anchor" id="ae3bc274d0c10bfa3b2c27380eb000032"></a><!-- doxytag: member="QuantLib::Settings::includeTodaysCashFlows" ref="ae3bc274d0c10bfa3b2c27380eb000032" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">boost::optional< bool > & <a class="el" href="class_quant_lib_1_1_settings.html#ae3bc274d0c10bfa3b2c27380eb000032">includeTodaysCashFlows</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>If set, this flag specifies whether or not <a class="el" href="class_quant_lib_1_1_cash_flows.html" title="cashflow-analysis functions">CashFlows</a> occurring on today's date should enter the NPV. When the NPV date (i.e., the date at which the cash flows are discounted) equals today's date, this flag overrides the behavior chosen for includeReferenceDate. It cannot be overridden locally when calling the <a class="el" href="class_quant_lib_1_1_cash_flow.html#a124a26b60637ae9384e543ed3f483064" title="returns true if an event has already occurred before a date">CashFlow::hasOccurred</a> method. </p>
</div>
</div>
</div><!-- contents -->
</div>
<div class="footer">
<div class="endmatter">
Documentation generated by
<a href="http://www.doxygen.org">Doxygen</a> 1.7.6.1
</div>
</div>
</div>
</body>
</html>
|