a00021.html 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
  5. <title>GTL - Graph Template Library: node_map&lt; T, Alloc &gt; Class Template Reference</title>
  6. <link href="doxygen.css" rel="stylesheet" type="text/css">
  7. </head>
  8. <body>
  9. <p class="links">
  10. <a href="../index.html">Home</a> |
  11. Documentation |
  12. <a href="../register.html">Download</a> |
  13. <a href="../platforms.html">Platforms</a> |
  14. <a href="../refer.html">Projects</a> |
  15. <a href="../lists.html">Mailing Lists</a> |
  16. <a href="../history.html">Version History</a>
  17. </p>
  18. <!-- Generated by Doxygen 1.5.3 -->
  19. <div class="tabs">
  20. <ul>
  21. <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
  22. <li class="current"><a href="classes.html"><span>Classes</span></a></li>
  23. <li><a href="files.html"><span>Files</span></a></li>
  24. <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  25. </ul>
  26. </div>
  27. <div class="tabs">
  28. <ul>
  29. <li><a href="classes.html"><span>Alphabetical&nbsp;List</span></a></li>
  30. <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
  31. <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
  32. <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
  33. </ul>
  34. </div>
  35. <h1>node_map&lt; T, Alloc &gt; Class Template Reference</h1><!-- doxytag: class="node_map" --><!-- doxytag: inherits="ne_map&lt; node, T, graph, Alloc &gt;" -->A specialized map with nodes as keys.
  36. <a href="#_details">More...</a>
  37. <p>
  38. <div class="dynheader">
  39. Inheritance diagram for node_map&lt; T, Alloc &gt;:</div>
  40. <div class="dynsection">
  41. <p><center><img src="a00180.gif" border="0" usemap="#a00181" alt="Inheritance graph"></center>
  42. <map name="a00181">
  43. <area shape="rect" href="a00019.html" title="ne_map\&lt; node, T, graph, Alloc \&gt;" alt="" coords="5,7,221,31"></map>
  44. <center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
  45. <div class="dynheader">
  46. Collaboration diagram for node_map&lt; T, Alloc &gt;:</div>
  47. <div class="dynsection">
  48. <p><center><img src="a00182.gif" border="0" usemap="#a00183" alt="Collaboration graph"></center>
  49. <map name="a00183">
  50. <area shape="rect" href="a00019.html" title="ne_map\&lt; node, T, graph, Alloc \&gt;" alt="" coords="5,7,221,31"></map>
  51. <center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
  52. <p>
  53. <a href="a00184.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
  54. <tr><td></td></tr>
  55. <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
  56. <tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00021.html#7a4c767f07f348d31a1004776485d17b">node_map</a> ()</td></tr>
  57. <tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00021.html#5bd24349e3a56379592889abbe4c6b09">node_map</a> (const <a class="el" href="a00014.html">graph</a> &amp;g, T t=T())</td></tr>
  58. </table>
  59. <hr><a name="_details"></a><h2>Detailed Description</h2>
  60. <h3>template&lt;class T, class Alloc = allocator&lt;T&gt;&gt;<br>
  61. class node_map&lt; T, Alloc &gt;</h3>
  62. A specialized map with nodes as keys.
  63. <p>
  64. A <code><a class="el" href="a00021.html" title="A specialized map with nodes as keys.">node_map</a></code> is a specialized and optimized map implementation with nodes as keys. Using a <code><a class="el" href="a00021.html" title="A specialized map with nodes as keys.">node_map</a></code> is the standard way to attach user defined information to the nodes of a <code><a class="el" href="a00014.html" title="A directed or undirected graph.">graph</a></code>.<p>
  65. An example of usage: <pre>
  66. <a class="el" href="a00014.html" title="A directed or undirected graph.">graph</a> g;</pre><p>
  67. <pre> <a class="el" href="a00020.html" title="A node in a graph.">node</a> v1 = g.new_node();
  68. <a class="el" href="a00020.html" title="A node in a graph.">node</a> v2 = g.new_node();</pre><p>
  69. <pre> <a class="el" href="a00021.html" title="A specialized map with nodes as keys.">node_map</a>&lt;string&gt; label(g, "Default Label");</pre><p>
  70. <pre> label[v1] = "v1";
  71. label[v2] = "v2";</pre><p>
  72. <pre> assert(label[v1] != label[v2]);
  73. </pre><p>
  74. The nodes used as keys for a <code><a class="el" href="a00021.html" title="A specialized map with nodes as keys.">node_map</a></code> MUST be nodes of the same <a class="el" href="a00014.html" title="A directed or undirected graph.">graph</a>. If you want to use nodes from different graphs, use a <code>map&lt;<a class="el" href="a00020.html" title="A node in a graph.">node</a>,T&gt;</code> instead. A <a class="el" href="a00014.html" title="A directed or undirected graph.">graph</a> and a copy of it are considered to be different.<p>
  75. Most of the functionality of <code><a class="el" href="a00021.html" title="A specialized map with nodes as keys.">node_map</a></code> is inherited from <a class="el" href="a00019.html">ne_map</a>.<p>
  76. <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="a00011.html" title="A specialized map with edges as keys.">edge_map</a> </dd></dl>
  77. <hr><h2>Constructor &amp; Destructor Documentation</h2>
  78. <a class="anchor" name="7a4c767f07f348d31a1004776485d17b"></a><!-- doxytag: member="node_map::node_map" ref="7a4c767f07f348d31a1004776485d17b" args="()" -->
  79. <div class="memitem">
  80. <div class="memproto">
  81. <div class="memtemplate">
  82. template&lt;class T, class Alloc = allocator&lt;T&gt;&gt; </div>
  83. <table class="memname">
  84. <tr>
  85. <td class="memname"><a class="el" href="a00021.html">node_map</a>&lt; T, Alloc &gt;::<a class="el" href="a00021.html">node_map</a> </td>
  86. <td>(</td>
  87. <td class="paramname"> </td>
  88. <td>&nbsp;)&nbsp;</td>
  89. <td width="100%"><code> [inline]</code></td>
  90. </tr>
  91. </table>
  92. </div>
  93. <div class="memdoc">
  94. <p>
  95. Constructs an empty <code><a class="el" href="a00021.html" title="A specialized map with nodes as keys.">node_map</a></code> not associated with any <code><a class="el" href="a00014.html" title="A directed or undirected graph.">graph</a></code>. You may (but need not) call <code>ne_map::init(const graph &amp;, T)</code> to associate it to a <code><a class="el" href="a00014.html" title="A directed or undirected graph.">graph</a></code>.
  96. </div>
  97. </div><p>
  98. <a class="anchor" name="5bd24349e3a56379592889abbe4c6b09"></a><!-- doxytag: member="node_map::node_map" ref="5bd24349e3a56379592889abbe4c6b09" args="(const graph &amp;g, T t=T())" -->
  99. <div class="memitem">
  100. <div class="memproto">
  101. <div class="memtemplate">
  102. template&lt;class T, class Alloc = allocator&lt;T&gt;&gt; </div>
  103. <table class="memname">
  104. <tr>
  105. <td class="memname"><a class="el" href="a00021.html">node_map</a>&lt; T, Alloc &gt;::<a class="el" href="a00021.html">node_map</a> </td>
  106. <td>(</td>
  107. <td class="paramtype">const <a class="el" href="a00014.html">graph</a> &amp;&nbsp;</td>
  108. <td class="paramname"> <em>g</em>, </td>
  109. </tr>
  110. <tr>
  111. <td class="paramkey"></td>
  112. <td></td>
  113. <td class="paramtype">T&nbsp;</td>
  114. <td class="paramname"> <em>t</em> = <code>T()</code></td><td>&nbsp;</td>
  115. </tr>
  116. <tr>
  117. <td></td>
  118. <td>)</td>
  119. <td></td><td></td><td width="100%"><code> [inline, explicit]</code></td>
  120. </tr>
  121. </table>
  122. </div>
  123. <div class="memdoc">
  124. <p>
  125. Constructs a <code><a class="el" href="a00021.html" title="A specialized map with nodes as keys.">node_map</a></code> associated to the <a class="el" href="a00014.html" title="A directed or undirected graph.">graph</a> <code>g</code>. The value associated to each <a class="el" href="a00020.html" title="A node in a graph.">node</a> in <code>g</code> is set to <code>t</code>.
  126. </div>
  127. </div><p>
  128. <p class="links">
  129. <a href="http://www.uni-passau.de/">University of Passau</a>
  130. &nbsp;-&nbsp;
  131. <a href="http://www.fmi.uni-passau.de/">FMI</a>
  132. &nbsp;-&nbsp;
  133. <a href="http://www.fmi.uni-passau.de/fmi/lehrstuehle/brandenburg/">Theoretical
  134. Computer Science</a>
  135. </p>
  136. <div class="copyright">
  137. Design &copy; 2002, 2003 <a href="mailto:raitner@fmi.uni-passau.de">Marcus Raitner</a>, University of Passau
  138. </div>
  139. </body>
  140. </html>