1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2<html> 3<head> 4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 5<title>Class abstract_variables_map</title> 6<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css"> 7<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 8<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> 9<link rel="up" href="../../program_options/reference.html#header.boost.program_options.variables_map_hpp" title="Header <boost/program_options/variables_map.hpp>"> 10<link rel="prev" href="bool_switch.html" title="Function bool_switch"> 11<link rel="next" href="basic_parsed_options.html" title="Class template basic_parsed_options"> 12</head> 13<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 14<table cellpadding="2" width="100%"><tr> 15<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td> 16<td align="center"><a href="../../../../index.html">Home</a></td> 17<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td> 18<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 19<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 20<td align="center"><a href="../../../../more/index.htm">More</a></td> 21</tr></table> 22<hr> 23<div class="spirit-nav"> 24<a accesskey="p" href="bool_switch.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../program_options/reference.html#header.boost.program_options.variables_map_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="basic_parsed_options.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> 25</div> 26<div class="refentry"> 27<a name="boost.program_options.abstract_variables_map"></a><div class="titlepage"></div> 28<div class="refnamediv"> 29<h2><span class="refentrytitle">Class abstract_variables_map</span></h2> 30<p>boost::program_options::abstract_variables_map</p> 31</div> 32<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> 33<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: <<a class="link" href="../../program_options/reference.html#header.boost.program_options.variables_map_hpp" title="Header <boost/program_options/variables_map.hpp>">boost/program_options/variables_map.hpp</a>> 34 35</span> 36<span class="keyword">class</span> <a class="link" href="abstract_variables_map.html" title="Class abstract_variables_map">abstract_variables_map</a> <span class="special">{</span> 37<span class="keyword">public</span><span class="special">:</span> 38 <span class="comment">// <a class="link" href="abstract_variables_map.html#boost.program_options.abstract_variables_mapconstruct-copy-destruct">construct/copy/destruct</a></span> 39 <a class="link" href="abstract_variables_map.html#id-1_3_31_9_11_1_1_1_3-bb"><span class="identifier">abstract_variables_map</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span> 40 <a class="link" href="abstract_variables_map.html#id-1_3_31_9_11_1_1_1_4-bb"><span class="identifier">abstract_variables_map</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="abstract_variables_map.html" title="Class abstract_variables_map">abstract_variables_map</a> <span class="special">*</span><span class="special">)</span><span class="special">;</span> 41 <a class="link" href="abstract_variables_map.html#id-1_3_31_9_11_1_1_1_5-bb"><span class="special">~</span><span class="identifier">abstract_variables_map</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span> 42 43 <span class="comment">// <a class="link" href="abstract_variables_map.html#id-1_3_31_9_11_1_1_1_2-bb">public member functions</a></span> 44 <span class="keyword">const</span> <a class="link" href="variable_value.html" title="Class variable_value">variable_value</a> <span class="special">&</span> <a class="link" href="abstract_variables_map.html#id-1_3_31_9_11_1_1_1_2_1-bb"><span class="keyword">operator</span><span class="special">[</span><span class="special">]</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span> 45 <span class="keyword">void</span> <a class="link" href="abstract_variables_map.html#id-1_3_31_9_11_1_1_1_2_2-bb"><span class="identifier">next</span></a><span class="special">(</span><a class="link" href="abstract_variables_map.html" title="Class abstract_variables_map">abstract_variables_map</a> <span class="special">*</span><span class="special">)</span><span class="special">;</span> 46 47 <span class="comment">// <a class="link" href="abstract_variables_map.html#id-1_3_31_9_11_1_1_1_6-bb">private member functions</a></span> 48 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="link" href="variable_value.html" title="Class variable_value">variable_value</a> <span class="special">&</span> <a class="link" href="abstract_variables_map.html#id-1_3_31_9_11_1_1_1_6_1-bb"><span class="identifier">get</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> 49<span class="special">}</span><span class="special">;</span></pre></div> 50<div class="refsect1"> 51<a name="id-1.3.31.9.12.3.4"></a><h2>Description</h2> 52<p>Implements string->string mapping with convenient value casting facilities. </p> 53<div class="refsect2"> 54<a name="id-1.3.31.9.12.3.4.3"></a><h3> 55<a name="boost.program_options.abstract_variables_mapconstruct-copy-destruct"></a><code class="computeroutput">abstract_variables_map</code> 56 public 57 construct/copy/destruct</h3> 58<div class="orderedlist"><ol class="orderedlist" type="1"> 59<li class="listitem"><pre class="literallayout"><a name="id-1_3_31_9_11_1_1_1_3-bb"></a><span class="identifier">abstract_variables_map</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre></li> 60<li class="listitem"><pre class="literallayout"><a name="id-1_3_31_9_11_1_1_1_4-bb"></a><span class="identifier">abstract_variables_map</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="abstract_variables_map.html" title="Class abstract_variables_map">abstract_variables_map</a> <span class="special">*</span> next<span class="special">)</span><span class="special">;</span></pre></li> 61<li class="listitem"><pre class="literallayout"><a name="id-1_3_31_9_11_1_1_1_5-bb"></a><span class="special">~</span><span class="identifier">abstract_variables_map</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre></li> 62</ol></div> 63</div> 64<div class="refsect2"> 65<a name="id-1.3.31.9.12.3.4.4"></a><h3> 66<a name="id-1_3_31_9_11_1_1_1_2-bb"></a><code class="computeroutput">abstract_variables_map</code> public member functions</h3> 67<div class="orderedlist"><ol class="orderedlist" type="1"> 68<li class="listitem"> 69<pre class="literallayout"><span class="keyword">const</span> <a class="link" href="variable_value.html" title="Class variable_value">variable_value</a> <span class="special">&</span> <a name="id-1_3_31_9_11_1_1_1_2_1-bb"></a><span class="keyword">operator</span><span class="special">[</span><span class="special">]</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span> name<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre> 70<p>Obtains the value of variable 'name', from *this and possibly from the chain of variable maps.</p> 71<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> 72<li class="listitem"> 73<p>if there's no value in *this.</p> 74<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "> 75<li class="listitem"><p>if there's next variable map, returns value from it</p></li> 76<li class="listitem"><p>otherwise, returns empty value</p></li> 77</ul></div> 78<p> 79</p> 80</li> 81<li class="listitem"> 82<p>if there's defaulted value</p> 83<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "> 84<li class="listitem"><p>if there's next variable map, which has a non-defaulted value, return that</p></li> 85<li class="listitem"><p>otherwise, return value from *this</p></li> 86</ul></div> 87<p> 88</p> 89</li> 90<li class="listitem"><p>if there's a non-defaulted value, returns it. </p></li> 91</ul></div> 92<p> 93</p> 94</li> 95<li class="listitem"> 96<pre class="literallayout"><span class="keyword">void</span> <a name="id-1_3_31_9_11_1_1_1_2_2-bb"></a><span class="identifier">next</span><span class="special">(</span><a class="link" href="abstract_variables_map.html" title="Class abstract_variables_map">abstract_variables_map</a> <span class="special">*</span> next<span class="special">)</span><span class="special">;</span></pre> 97<p>Sets next variable map, which will be used to find variables not found in *this. </p> 98</li> 99</ol></div> 100</div> 101<div class="refsect2"> 102<a name="id-1.3.31.9.12.3.4.5"></a><h3> 103<a name="id-1_3_31_9_11_1_1_1_6-bb"></a><code class="computeroutput">abstract_variables_map</code> private member functions</h3> 104<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"> 105<pre class="literallayout"><span class="keyword">virtual</span> <span class="keyword">const</span> <a class="link" href="variable_value.html" title="Class variable_value">variable_value</a> <span class="special">&</span> <a name="id-1_3_31_9_11_1_1_1_6_1-bb"></a><span class="identifier">get</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span> name<span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span></pre> 106<p>Returns value of variable 'name' stored in *this, or empty value otherwise. </p> 107</li></ol></div> 108</div> 109</div> 110</div> 111<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 112<td align="left"></td> 113<td align="right"><div class="copyright-footer">Copyright © 2002-2004 Vladimir Prus<p>Distributed under the Boost Software License, Version 1.0. 114 (See accompanying file <code class="filename">LICENSE_1_0.txt</code> or copy at 115 <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) 116 </p> 117</div></td> 118</tr></table> 119<hr> 120<div class="spirit-nav"> 121<a accesskey="p" href="bool_switch.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../program_options/reference.html#header.boost.program_options.variables_map_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="basic_parsed_options.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> 122</div> 123</body> 124</html> 125