| 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>DbSequence</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++ API Reference" /> |
| 10 | <link rel="up" href="seq.html" title="Chapter 12. The DbSequence Handle" /> |
| 11 | <link rel="prev" href="seq.html" title="Chapter 12. The DbSequence Handle" /> |
| 12 | <link rel="next" href="seqclose.html" title="DbSequence::close()" /> |
| 13 | </head> |
| 14 | <body> |
| 15 | <div xmlns="" class="navheader"> |
| 16 | <div class="libver"> |
| 17 | <p>Library Version 11.2.5.3</p> |
| 18 | </div> |
| 19 | <table width="100%" summary="Navigation header"> |
| 20 | <tr> |
| 21 | <th colspan="3" align="center">DbSequence</th> |
| 22 | </tr> |
| 23 | <tr> |
| 24 | <td width="20%" align="left"><a accesskey="p" href="seq.html">Prev</a> </td> |
| 25 | <th width="60%" align="center">Chapter 12. |
| 26 | The DbSequence Handle |
| 27 | </th> |
| 28 | <td width="20%" align="right"> <a accesskey="n" href="seqclose.html">Next</a></td> |
| 29 | </tr> |
| 30 | </table> |
| 31 | <hr /> |
| 32 | </div> |
| 33 | <div class="sect1" lang="en" xml:lang="en"> |
| 34 | <div class="titlepage"> |
| 35 | <div> |
| 36 | <div> |
| 37 | <h2 class="title" style="clear: both"><a id="seqcreate"></a>DbSequence</h2> |
| 38 | </div> |
| 39 | </div> |
| 40 | </div> |
| 41 | <pre class="programlisting">#include <db_cxx.h> |
| 42 | |
| 43 | class DbSequence { |
| 44 | public: |
| 45 | DbSequence(Db *db, u_int32_t flags); |
| 46 | ~DbSequence(); |
| 47 | |
| 48 | DB_SEQUENCE *DbSequence::get_DB(); |
| 49 | const DB *DbSequence::get_const_DB() const; |
| 50 | static DbSequence *DbSequence::get_DbSequence(DB *db); |
| 51 | static const DbSequence |
| 52 | *DbSequence::get_const_DbSequence(const DB *db); |
| 53 | ... |
| 54 | }; </pre> |
| 55 | <p> |
| 56 | The <code class="classname">DbSequence</code> handle is the handle used to manipulate a sequence |
| 57 | object. A sequence object is stored in a record in a database. |
| 58 | </p> |
| 59 | <p> |
| 60 | |
| 61 | <code class="classname">DbSequence</code> handles are free-threaded if the |
| 62 | <a class="link" href="seqopen.html#seqopen_DB_THREAD">DB_THREAD</a> |
| 63 | flag is specified to the |
| 64 | <a class="xref" href="seqopen.html" title="DbSequence::open()">DbSequence::open()</a> |
| 65 | method when the sequence is opened. Once the |
| 66 | <a class="xref" href="seqclose.html" title="DbSequence::close()">DbSequence::close()</a> or |
| 67 | <a class="xref" href="seqremove.html" title="DbSequence::remove()">DbSequence::remove()</a> |
| 68 | methods are called, the handle can not be accessed again, regardless |
| 69 | of the method's return. |
| 70 | </p> |
| 71 | <p> |
| 72 | Each handle opened on a sequence may maintain a separate cache of values which are |
| 73 | returned to the application using the <a class="xref" href="seqget.html" title="DbSequence::get()">DbSequence::get()</a> |
| 74 | method either singly or in groups |
| 75 | depending on its <span class="bold"><strong>delta</strong></span> parameter. |
| 76 | </p> |
| 77 | <p> |
| 78 | Calling the <a class="xref" href="seqclose.html" title="DbSequence::close()">DbSequence::close()</a> |
| 79 | or <a class="xref" href="seqremove.html" title="DbSequence::remove()">DbSequence::remove()</a> |
| 80 | methods discards this handle. |
| 81 | </p> |
| 82 | <div class="sect2" lang="en" xml:lang="en"> |
| 83 | <div class="titlepage"> |
| 84 | <div> |
| 85 | <div> |
| 86 | <h3 class="title"><a id="idp10055224"></a>Parameters</h3> |
| 87 | </div> |
| 88 | </div> |
| 89 | </div> |
| 90 | <div class="sect3" lang="en" xml:lang="en"> |
| 91 | <div class="titlepage"> |
| 92 | <div> |
| 93 | <div> |
| 94 | <h4 class="title"><a id="idp10055472"></a>db</h4> |
| 95 | </div> |
| 96 | </div> |
| 97 | </div> |
| 98 | <p> |
| 99 | The <span class="bold"><strong>db</strong></span> parameter is an open database |
| 100 | handle which holds the persistent data for the sequence. The database |
| 101 | may be of any type, but must not have been configured to support |
| 102 | duplicate data items. |
| 103 | </p> |
| 104 | </div> |
| 105 | <div class="sect3" lang="en" xml:lang="en"> |
| 106 | <div class="titlepage"> |
| 107 | <div> |
| 108 | <div> |
| 109 | <h4 class="title"><a id="idp10021624"></a>flags</h4> |
| 110 | </div> |
| 111 | </div> |
| 112 | </div> |
| 113 | <p> |
| 114 | The <span class="bold"><strong>flags</strong></span> parameter is |
| 115 | currently unused, and must be set to 0. |
| 116 | </p> |
| 117 | </div> |
| 118 | </div> |
| 119 | <div class="sect2" lang="en" xml:lang="en"> |
| 120 | <div class="titlepage"> |
| 121 | <div> |
| 122 | <div> |
| 123 | <h3 class="title"><a id="idp10035248"></a>Errors</h3> |
| 124 | </div> |
| 125 | </div> |
| 126 | </div> |
| 127 | <p> |
| 128 | The <code class="methodname">db_sequence_create</code> <span> |
| 129 | |
| 130 | <span> |
| 131 | method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a> |
| 132 | exception, encapsulating one of the following non-zero errors, or return one |
| 133 | of the following non-zero errors: |
| 134 | </span> |
| 135 | </span> |
| 136 | </p> |
| 137 | <div class="sect3" lang="en" xml:lang="en"> |
| 138 | <div class="titlepage"> |
| 139 | <div> |
| 140 | <div> |
| 141 | <h4 class="title"><a id="idp10061872"></a>EINVAL</h4> |
| 142 | </div> |
| 143 | </div> |
| 144 | </div> |
| 145 | <p> |
| 146 | An invalid flag value or parameter was specified. |
| 147 | </p> |
| 148 | </div> |
| 149 | </div> |
| 150 | <div class="sect2" lang="en" xml:lang="en"> |
| 151 | <div class="titlepage"> |
| 152 | <div> |
| 153 | <div> |
| 154 | <h3 class="title"><a id="idp10059896"></a>Class</h3> |
| 155 | </div> |
| 156 | </div> |
| 157 | </div> |
| 158 | <p> |
| 159 | <a class="link" href="seq.html" title="Chapter 12. The DbSequence Handle">DbSequence</a> |
| 160 | </p> |
| 161 | </div> |
| 162 | <div class="sect2" lang="en" xml:lang="en"> |
| 163 | <div class="titlepage"> |
| 164 | <div> |
| 165 | <div> |
| 166 | <h3 class="title"><a id="idp10056616"></a>See Also</h3> |
| 167 | </div> |
| 168 | </div> |
| 169 | </div> |
| 170 | <p> |
| 171 | <a class="xref" href="seq.html#seqlist" title="Sequences and Related Methods">Sequences and Related Methods</a> |
| 172 | </p> |
| 173 | </div> |
| 174 | </div> |
| 175 | <div class="navfooter"> |
| 176 | <hr /> |
| 177 | <table width="100%" summary="Navigation footer"> |
| 178 | <tr> |
| 179 | <td width="40%" align="left"><a accesskey="p" href="seq.html">Prev</a> </td> |
| 180 | <td width="20%" align="center"> |
| 181 | <a accesskey="u" href="seq.html">Up</a> |
| 182 | </td> |
| 183 | <td width="40%" align="right"> <a accesskey="n" href="seqclose.html">Next</a></td> |
| 184 | </tr> |
| 185 | <tr> |
| 186 | <td width="40%" align="left" valign="top">Chapter 12. |
| 187 | The DbSequence Handle |
| 188 | </td> |
| 189 | <td width="20%" align="center"> |
| 190 | <a accesskey="h" href="index.html">Home</a> |
| 191 | </td> |
| 192 | <td width="40%" align="right" valign="top"> DbSequence::close()</td> |
| 193 | </tr> |
| 194 | </table> |
| 195 | </div> |
| 196 | </body> |
| 197 | </html> |