mirror of
https://github.com/boostorg/property_map.git
synced 2026-01-26 18:52:25 +00:00
https://svn.boost.org/svn/boost/trunk ........ r43206 | danieljames | 2008-02-10 09:55:03 +0000 (Sun, 10 Feb 2008) | 1 line Fix some broken links. ........ r43209 | danieljames | 2008-02-10 14:56:22 +0000 (Sun, 10 Feb 2008) | 1 line Link to people pages on the website, as they've been removed from the download. ........ r43210 | danieljames | 2008-02-10 15:02:17 +0000 (Sun, 10 Feb 2008) | 1 line Point links to the pages that used to be in 'more' to the site. ........ r43212 | danieljames | 2008-02-10 16:10:16 +0000 (Sun, 10 Feb 2008) | 1 line Fix links on the home page as well. ........ r43213 | danieljames | 2008-02-10 16:21:22 +0000 (Sun, 10 Feb 2008) | 1 line Generated documentation which is no longer generated. ........ [SVN r43214]
156 lines
3.7 KiB
HTML
156 lines
3.7 KiB
HTML
<HTML>
|
|
<!--
|
|
-- Copyright (c) Jeremy Siek 2000
|
|
--
|
|
-- Permission to use, copy, modify, distribute and sell this software
|
|
-- and its documentation for any purpose is hereby granted without fee,
|
|
-- provided that the above copyright notice appears in all copies and
|
|
-- that both that copyright notice and this permission notice appear
|
|
-- in supporting documentation. Silicon Graphics makes no
|
|
-- representations about the suitability of this software for any
|
|
-- purpose. It is provided "as is" without express or implied warranty.
|
|
-->
|
|
<Head>
|
|
<Title>WritablePropertyMap</Title>
|
|
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
|
ALINK="#ff0000">
|
|
<IMG SRC="../../boost.png"
|
|
ALT="C++ Boost" width="277" height="86">
|
|
|
|
<BR Clear>
|
|
|
|
|
|
<H2><A NAME="concept:WritablePropertyMap"></A>
|
|
Writable Property Map
|
|
</H2>
|
|
|
|
A Writable Property Map has the capability of setting the value
|
|
object associated with the given key object via the <tt>put()</tt>
|
|
function.
|
|
|
|
<h3>Refinement of</h3>
|
|
|
|
<a href="../utility/CopyConstructible.html">Copy Constructible</a>
|
|
|
|
|
|
<h3>Notation</h3>
|
|
|
|
<Table>
|
|
<TR>
|
|
<TD><tt>PMap</tt></TD>
|
|
<TD>A type that is a model of Writable Property Map.</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD><tt>pmap</tt></TD>
|
|
<TD>An object of type <tt>PMap</tt>.</td>
|
|
</TR>
|
|
<TR>
|
|
<TD><tt>key</tt></TD>
|
|
<TD>An object of type <tt>boost::property_traits<PMap>::key_type</tt>.</td>
|
|
</TR>
|
|
<TR>
|
|
<TD><tt>val</tt></TD>
|
|
<TD>An object of type <tt>boost::property_traits<PMap>::value_type</tt>.</td>
|
|
</TR>
|
|
</table>
|
|
|
|
<h3>Associated Types</h3>
|
|
|
|
<table border>
|
|
|
|
<tr>
|
|
<td>Value Type</td>
|
|
<td><TT>boost::property_traits<PMap>::value_type</TT></td>
|
|
<td>
|
|
The type of the property.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Key Type</td>
|
|
<td><TT>boost::property_traits<PMap>::key_type</TT></td>
|
|
<td>
|
|
The type of the key object used to look up the property. The property
|
|
map may be templated on the key type, in which case this typedef
|
|
can be <TT>void</TT>.
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Property Map Category </td>
|
|
<td><TT>boost::property_traits<PMap>::category</TT></td>
|
|
<td>
|
|
The category of the property: a type convertible to
|
|
<TT>writable_property_map_tag</TT>.
|
|
</td>
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
<h3>Valid Expressions</h3>
|
|
|
|
<table border>
|
|
<tr>
|
|
<th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Put Property Value<a href="#1">[1]</a></td>
|
|
<TD><TT>put(pmap, key, val)</TT></TD>
|
|
<TD><TT>void</TT></TD>
|
|
<TD>
|
|
Assign <TT>val</TT> to the property associated with <TT>k</TT>.
|
|
</TD>
|
|
</TR>
|
|
|
|
</TABLE>
|
|
|
|
|
|
<h3>Notes</h3>
|
|
|
|
<a name="1">[1]</a> The function <tt>put()</tt> was originally named
|
|
<tt>set()</tt>, but was changed to avoid name conflicts with the
|
|
<tt>std::set</tt> class when using a compiler (Microsoft Visual C++)
|
|
with non-standard name lookup rules. The following example demonstrates
|
|
the problem.
|
|
<pre>#include <set>
|
|
using namespace std;
|
|
namespace boost {
|
|
void set() { }
|
|
}</pre>
|
|
|
|
|
|
<h3>Concept Checking Class</h3>
|
|
|
|
<pre> template <class PMap, class Key>
|
|
struct WritablePropertyMapConcept
|
|
{
|
|
typedef typename property_traits<PMap>::key_type key_type;
|
|
typedef typename property_traits<PMap>::category Category;
|
|
typedef boost::writable_property_map_tag WritableTag;
|
|
void constraints() {
|
|
function_requires< ConvertibleConcept<Category, WritableTag> >();
|
|
put(pmap, k, val);
|
|
}
|
|
PMap pmap;
|
|
Key k;
|
|
typename property_traits<PMap>::value_type val;
|
|
};</pre>
|
|
|
|
<h3>See Also</h3>
|
|
|
|
<a href="./property_map.html">Property map concepts</a>
|
|
|
|
|
|
<br>
|
|
<HR>
|
|
<TABLE>
|
|
<TR valign=top>
|
|
<TD nowrap>Copyright © 2000</TD><TD>
|
|
<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>)
|
|
</TD></TR></TABLE>
|
|
|
|
</BODY>
|
|
</HTML>
|