PageRenderTime 35ms CodeModel.GetById 21ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/libs/property_map/doc/LvaluePropertyMap.html

http://hadesmem.googlecode.com/
HTML | 145 lines | 110 code | 28 blank | 7 comment | 0 complexity | 2e42be0ab898c51869100bd0ddcccad1 MD5 | raw file
  1<HTML>
  2<!--
  3     Copyright (c) Jeremy Siek 2000
  4    
  5     Distributed under the Boost Software License, Version 1.0.
  6     (See accompanying file LICENSE_1_0.txt or copy at
  7     http://www.boost.org/LICENSE_1_0.txt)
  8  -->
  9<Head>
 10<Title>LvaluePropertyMap</Title>
 11<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" 
 12	ALINK="#ff0000"> 
 13<IMG SRC="../../../boost.png" 
 14     ALT="C++ Boost" width="277" height="86"> 
 15
 16<BR Clear>
 17
 18<H2><A NAME="concept:LvaluePropertyMap"></A>
 19LvaluePropertyMap
 20</H2>
 21
 22The LvaluePropertyMap provides an interface for accessing a
 23reference to a property object (instead of a copy of the object as in
 24the <TT>get()</TT> function required by <a
 25href="./ReadablePropertyMap.html">ReadablePropertyMap</a>). An
 26LvaluePropertyMap can be <I>mutable</I> or
 27<I>non-mutable</I>. The mutable LvaluePropertyMap returns a
 28reference whereas the non-mutable returns a const reference.
 29
 30<H3>Refinement of</H3>
 31
 32<a href="./ReadablePropertyMap.html">ReadablePropertyMap</a>
 33for non-mutable or <a href="./ReadWritePropertyMap.html">ReadWritePropertyMap</a> for mutable property map.
 34
 35<h3>Notation</h3>
 36
 37<Table>
 38<TR>
 39<TD><tt>PMap</tt></TD>
 40<TD>A type that is a model of LvaluePropertyMap.</TD>
 41</TR>
 42<TR>
 43<TD><tt>pmap</tt></TD>
 44<TD>An object of type <tt>PMap</tt>.</td>
 45</TR>
 46<TR>
 47<TD><tt>key</tt></TD>
 48<TD>An object of type <tt>boost::property_traits&lt;PMap&gt;::key_type</tt>.</td>
 49</TR>
 50
 51</table>
 52
 53
 54<h3>Associated Types</h3>
 55
 56<table border>
 57
 58<tr>
 59<td>Reference Type</td>
 60<td><TT>boost::property_traits&lt;PMap&gt;::reference</TT></td> 
 61<td>
 62The reference type, which must be a reference or const reference to
 63the value typeof the property map.
 64</td>
 65</tr>
 66
 67<tr>
 68<td>Property Map Category 
 69<td><TT>boost::property_traits&lt;PMap&gt;::category</TT></td> 
 70<td>
 71The category of the property: a type convertible to
 72<TT>boost::lvalue_property_map_tag</TT>.
 73</td>
 74</tr>
 75
 76</table>
 77
 78<h3>Valid Expressions</h3>
 79
 80<table border>
 81<tr>
 82<th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th>
 83</tr>
 84
 85
 86<tr>
 87<td>Access Property Value </td>
 88<TD><TT>pmap[key]</TT></TD>
 89<TD>
 90<TT>value_type&amp;</TT> for mutable, <TT>const value_type&amp;</TT>
 91otherwise.
 92</TD>
 93<TD>Obtain a reference to the property identified by <TT>key</TT>.</TD>
 94</TR>
 95</TABLE>
 96
 97<h3>Concept Checking Class</h3>
 98
 99<pre>  template &lt;class PMap, class Key&gt;
100  struct LvaluePropertyMapConcept
101  {
102    typedef typename property_traits&lt;PMap&gt;::category Category;
103    typedef boost::lvalue_property_map_tag LvalueTag;
104    typedef const typename property_traits&lt;PMap&gt;::value_type&amp; const_reference;
105    void constraints() {
106      function_requires&lt; ReadWritePropertyMapConcept&lt;PMap, Key&gt; &gt;();
107      function_requires&lt; ConvertibleConcept&lt;Category, LvalueTag&gt; &gt;();
108
109      const_reference ref = pmap[k];
110    }
111    PMap pmap;
112    Key k;
113  };
114
115  template &lt;class PMap, class Key&gt;
116  struct Mutable_LvaluePropertyMapConcept
117  {
118    typedef typename property_traits&lt;PMap&gt;::category Category;
119    typedef boost::lvalue_property_map_tag LvalueTag;
120    typedef typename property_traits&lt;PMap&gt;::value_type&amp; reference;
121    void constraints() { 
122      function_requires&lt; ReadWritePropertyMapConcept&lt;PMap, Key&gt; &gt;();
123      function_requires&lt;ConvertibleConcept&lt;Category, LvalueTag&gt; &gt;();
124
125      reference ref = pmap[k];
126    }
127    PMap pmap;
128    Key k;
129  };</pre>
130
131<h3>See Also</h3>
132
133<a href="./property_map.html">Property map concepts</a>
134
135
136<br>
137<HR>
138<TABLE>
139<TR valign=top>
140<TD nowrap>Copyright &copy 2000</TD><TD>
141<a HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</a>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
142</TD></TR></TABLE>
143
144</BODY>
145</HTML>