Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/doc/html/boost/CV/constrained_value.html @ 29

Last change on this file since 29 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 7.2 KB
Line 
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
4<title>Class template constrained_value</title>
5<link rel="stylesheet" href="../../boostbook.css" type="text/css">
6<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
7<link rel="start" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
8<link rel="up" href="../../date_time/doxy.html#header.boost.date_time.constrained_value.hpp" title="Header &lt;boost/date_time/constrained_value.hpp&gt;">
9<link rel="prev" href="../date_time/c_time.html" title="Struct c_time">
10<link rel="next" href="simple_exception_policy.html" title="Class template simple_exception_policy">
11</head>
12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13<table cellpadding="2" width="100%">
14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
15<td align="center"><a href="../../../../index.htm">Home</a></td>
16<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
17<td align="center"><a href="../../../../people/people.htm">People</a></td>
18<td align="center"><a href="../../../../more/faq.htm">FAQ</a></td>
19<td align="center"><a href="../../../../more/index.htm">More</a></td>
20</table>
21<hr>
22<div class="spirit-nav">
23<a accesskey="p" href="../date_time/c_time.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../../date_time/doxy.html#header.boost.date_time.constrained_value.hpp"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="simple_exception_policy.html"><img src="../../images/next.png" alt="Next"></a>
24</div>
25<div class="refentry" lang="en">
26<a name="boost.CV.constrained_value"></a><div class="titlepage"></div>
27<div class="refnamediv">
28<h2><span class="refentrytitle">Class template constrained_value</span></h2>
29<p>boost::CV::constrained_value &#8212; A template to specify a constrained basic value type. </p>
30</div>
31<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
32<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> value_policies&gt; 
33<span class="bold"><strong>class</strong></span> constrained_value {
34<span class="bold"><strong>public</strong></span>:
35  <span class="emphasis"><em>// types</em></span>
36  <span class="bold"><strong>typedef</strong></span> value_policies::value_type value_type;
37
38  <span class="emphasis"><em>// <a href="constrained_value.html#boost.CV.constrained_valueconstruct-copy-destruct">construct/copy/destruct</a></em></span>
39  <a href="constrained_value.html#id963922-bb">constrained_value</a>(value_type);
40  constrained_value&amp; <a href="constrained_value.html#id963928-bb"><span class="bold"><strong>operator</strong></span>=</a>(value_type);
41
42  <span class="emphasis"><em>// <a href="constrained_value.html#id963907-bb">public member functions</a></em></span>
43  <a href="constrained_value.html#id963911-bb"><span class="bold"><strong>operator</strong></span> value_type</a>() <span class="bold"><strong>const</strong></span>;
44
45  <span class="emphasis"><em>// <a href="constrained_value.html#id963935-bb">public static functions</a></em></span>
46  <span class="type"><span class="bold"><strong>static</strong></span> value_type max</span> <a href="constrained_value.html#id963938-bb">BOOST_PREVENT_MACRO_SUBSTITUTION</a>() ;
47  <span class="type"><span class="bold"><strong>static</strong></span> value_type min</span> <a href="constrained_value.html#id963950-bb">BOOST_PREVENT_MACRO_SUBSTITUTION</a>() ;
48
49  <span class="emphasis"><em>// <a href="constrained_value.html#id761726-bb">private member functions</a></em></span>
50  <span class="type"><span class="bold"><strong>void</strong></span></span> <a href="constrained_value.html#id761730-bb">assign</a>(value_type) ;
51};</pre></div>
52<div class="refsect1" lang="en">
53<a name="id1031708"></a><h2>Description</h2>
54<p>This template provides a quick way to generate an integer type with a constrained range. The type provides for the ability to specify the min, max, and and error handling policy.</p>
55<p><span class="bold"><strong>value policies</strong></span>  A class that provides the range limits via the min and max functions as well as a function on_error that determines how errors are handled. A common strategy would be to assert or throw and exception. The on_error is passed both the current value and the new value that is in error. </p>
56<div class="refsect2" lang="en">
57<a name="id1031729"></a><h3>
58<a name="boost.CV.constrained_valueconstruct-copy-destruct"></a><code class="computeroutput">constrained_value</code> construct/copy/destruct</h3>
59<div class="orderedlist"><ol type="1">
60<li><pre class="literallayout"><a name="id963922-bb"></a>constrained_value(value_type value);</pre></li>
61<li><pre class="literallayout">constrained_value&amp; <a name="id963928-bb"></a><span class="bold"><strong>operator</strong></span>=(value_type v);</pre></li>
62</ol></div>
63</div>
64<div class="refsect2" lang="en">
65<a name="id1031782"></a><h3>
66<a name="id963907-bb"></a><code class="computeroutput">constrained_value</code> public member functions</h3>
67<div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id963911-bb"></a><span class="bold"><strong>operator</strong></span> value_type() <span class="bold"><strong>const</strong></span>;</pre></li></ol></div>
68</div>
69<div class="refsect2" lang="en">
70<a name="id1031824"></a><h3>
71<a name="id963935-bb"></a><code class="computeroutput">constrained_value</code> public static functions</h3>
72<div class="orderedlist"><ol type="1">
73<li><pre class="literallayout"><span class="type"><span class="bold"><strong>static</strong></span> value_type max</span> <a name="id963938-bb"></a>BOOST_PREVENT_MACRO_SUBSTITUTION() ;</pre></li>
74<li><pre class="literallayout"><span class="type"><span class="bold"><strong>static</strong></span> value_type min</span> <a name="id963950-bb"></a>BOOST_PREVENT_MACRO_SUBSTITUTION() ;</pre></li>
75</ol></div>
76</div>
77<div class="refsect2" lang="en">
78<a name="id1031886"></a><h3>
79<a name="id761726-bb"></a><code class="computeroutput">constrained_value</code> private member functions</h3>
80<div class="orderedlist"><ol type="1"><li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id761730-bb"></a>assign(value_type value) ;</pre></li></ol></div>
81</div>
82</div>
83</div>
84<table width="100%"><tr>
85<td align="left"></td>
86<td align="right"><small>Copyright © 2001-2005 CrystalClear Software, Inc</small></td>
87</tr></table>
88<hr>
89<div class="spirit-nav">
90<a accesskey="p" href="../date_time/c_time.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../../date_time/doxy.html#header.boost.date_time.constrained_value.hpp"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="simple_exception_policy.html"><img src="../../images/next.png" alt="Next"></a>
91</div>
92</body>
93</html>
Note: See TracBrowser for help on using the repository browser.