1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 <title>move_to</title> 7 <link rel="stylesheet" href="apiReference.css" type="text/css" /> 8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> 9 <link rel="start" href="index.html" title="Berkeley DB C++ Standard Template Library API Reference" /> 10 <link rel="up" href="db_map_base_iterator.html" title="Chapter 15. Db_map_base_iterator" /> 11 <link rel="prev" href="stldb_map_base_iteratorclose_cursor.html" title="close_cursor" /> 12 <link rel="next" href="stldb_map_base_iteratorset_bulk_buffer.html" title="set_bulk_buffer" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center"> 19move_to 20</th> 21 </tr> 22 <tr> 23 <td width="20%" align="left"><a accesskey="p" href="stldb_map_base_iteratorclose_cursor.html">Prev</a> </td> 24 <th width="60%" align="center">Chapter 15. 25 Db_map_base_iterator </th> 26 <td width="20%" align="right"> <a accesskey="n" href="stldb_map_base_iteratorset_bulk_buffer.html">Next</a></td> 27 </tr> 28 </table> 29 <hr /> 30 </div> 31 <div class="sect1" lang="en" xml:lang="en"> 32 <div class="titlepage"> 33 <div> 34 <div> 35 <h2 class="title" style="clear: both"><a id="stldb_map_base_iteratormove_to"></a> 36move_to 37</h2> 38 </div> 39 </div> 40 </div> 41 <div class="sect2" lang="en" xml:lang="en"> 42 <div class="titlepage"> 43 <div> 44 <div> 45 <h3 class="title"><a id="func_details"></a> 46Function Details</h3> 47 </div> 48 </div> 49 </div> 50 <pre class="programlisting"> 51int move_to(const kdt &k, 52 int flag=DB_SET) const 53 </pre> 54 <div class="sect3" lang="en" xml:lang="en"> 55 <div class="titlepage"></div> 56 <p>Iterator movement function. </p> 57 <p>Move this iterator to the specified key k, by default moves exactly to k, and update cached data element, you can also specify DB_SET_RANGE, to move to the biggest key smaller than k. The btree/hash key comparison routine determines which key is bigger. When the iterator is on a multiple container, move_to will move itself to the first key/data pair of the identical keys. </p> 58 </div> 59 <div class="sect3" lang="en" xml:lang="en"> 60 <div class="titlepage"> 61 <div> 62 <div> 63 <h4 class="title"><a id="id1563850"></a> 64Parameters</h4> 65 </div> 66 </div> 67 </div> 68 <div class="sect4" lang="en" xml:lang="en"> 69 <div class="titlepage"> 70 <div> 71 <div> 72 <h5 class="title"><a id="id1563915"></a> 73 k </h5> 74 </div> 75 </div> 76 </div> 77 <p>The target key value to move to. </p> 78 </div> 79 <div class="sect4" lang="en" xml:lang="en"> 80 <div class="titlepage"> 81 <div> 82 <div> 83 <h5 class="title"><a id="id1563876"></a> 84 flag </h5> 85 </div> 86 </div> 87 </div> 88 <p>Flags available: DB_SET(default) or DB_SET_RANGE. DB_SET will move this iterator exactly at k; DB_SET_RANGE moves this iterator to k or the smallest key greater than k. If fail to find such a key, this iterator will become invalid. </p> 89 </div> 90 </div> 91 <div class="sect3" lang="en" xml:lang="en"> 92 <div class="titlepage"> 93 <div> 94 <div> 95 <h4 class="title"><a id="id1563503"></a> 96Return Value</h4> 97 </div> 98 </div> 99 </div> 100 <p>0 if succeed; non-0 otherwise, and this iterator becomes invalid. Call db_strerror with the return value to get the error message. </p> 101 </div> 102 </div> 103 <div class="sect2" lang="en" xml:lang="en"> 104 <div class="titlepage"> 105 <div> 106 <div> 107 <h3 class="title"><a id="id1563700"></a> 108Class</h3> 109 </div> 110 </div> 111 </div> 112 <p> 113 <a class="link" href="db_map_base_iterator.html" title="Chapter 15. Db_map_base_iterator"> 114 db_map_base_iterator</a> 115 </p> 116 </div> 117 </div> 118 <div class="navfooter"> 119 <hr /> 120 <table width="100%" summary="Navigation footer"> 121 <tr> 122 <td width="40%" align="left"><a accesskey="p" href="stldb_map_base_iteratorclose_cursor.html">Prev</a> </td> 123 <td width="20%" align="center"> 124 <a accesskey="u" href="db_map_base_iterator.html">Up</a> 125 </td> 126 <td width="40%" align="right"> <a accesskey="n" href="stldb_map_base_iteratorset_bulk_buffer.html">Next</a></td> 127 </tr> 128 <tr> 129 <td width="40%" align="left" valign="top"> 130close_cursor 131 </td> 132 <td width="20%" align="center"> 133 <a accesskey="h" href="index.html">Home</a> 134 </td> 135 <td width="40%" align="right" valign="top"> 136set_bulk_buffer 137</td> 138 </tr> 139 </table> 140 </div> 141 </body> 142</html> 143