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">
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <title>DbSequence::stat()</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="seqset_range.html" title="DbSequence::set_range()" />
12 <link rel="next" href="seqstat_print.html" title="DbSequence::stat_print()" />
15 <div xmlns="" class="navheader">
17 <p>Library Version 11.2.5.3</p>
19 <table width="100%" summary="Navigation header">
21 <th colspan="3" align="center">DbSequence::stat()</th>
24 <td width="20%" align="left"><a accesskey="p" href="seqset_range.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 12.
28 <td width="20%" align="right"> <a accesskey="n" href="seqstat_print.html">Next</a></td>
33 <div class="sect1" lang="en" xml:lang="en">
34 <div class="titlepage">
37 <h2 class="title" style="clear: both"><a id="seqstat"></a>DbSequence::stat()</h2>
41 <pre class="programlisting">#include <db_cxx.h>
44 DbSequence::stat(DB_SEQUENCE_STAT **spp, u_int32_t flags); </pre>
46 The <code class="methodname">DbSequence::stat()</code> method creates a statistical structure and
47 copies a pointer to it into user-specified memory locations.
48 Specifically, if <span class="bold"><strong>spp</strong></span> is non-NULL, a
49 pointer to the statistics for the database are copied into the memory
50 location to which it refers.
53 Statistical structures are stored in allocated memory. If
54 application-specific allocation routines have been declared (see
55 <a class="xref" href="envset_alloc.html" title="DbEnv::set_alloc()">DbEnv::set_alloc()</a>
56 for more information), they are used to allocate the memory;
57 otherwise, the standard C library <span class="bold"><strong>malloc</strong></span>(3) is used. The caller is responsible
58 for deallocating the memory. To deallocate the memory, free the
59 memory reference; references inside the returned memory need not be
63 In the presence of multiple threads or processes accessing an active
64 sequence, the information returned by <code class="methodname">DbSequence::stat()</code> may be
68 The <code class="methodname">DbSequence::stat()</code> method cannot be transaction-protected. For
69 this reason, it should be called in a thread of control that has no
70 open cursors or active transactions.
73 The <code class="methodname">DbSequence::stat()</code> <span>
76 method either returns a non-zero error value or throws an
77 exception that encapsulates a non-zero error value on
78 failure, and returns 0 on success.
83 The statistics are stored in a structure of type <code class="literal">DB_SEQUENCE_STAT</code>.
84 The following fields will be filled in:
86 <div class="itemizedlist">
90 <span class="bold"><strong>int32_t st_cache_size;</strong></span>
93 The number of values that will be cached in this handle.
98 <span class="bold"><strong>db_seq_t st_current;</strong></span>
101 The current value of the sequence in the database.
106 <span class="bold"><strong>u_int32_t st_flags;</strong></span>
109 The flags value for the sequence.
114 <span class="bold"><strong>db_seq_t st_last_value;</strong></span>
117 The last cached value of the sequence.
122 <span class="bold"><strong>db_seq_t st_min;</strong></span>
125 The minimum permitted value of the sequence.
130 <span class="bold"><strong>db_seq_t st_max;</strong></span>
133 The maximum permitted value of the sequence.
138 <span class="bold"><strong>uintmax_t st_nowait;</strong></span>
141 The number of times that a thread of control was able to obtain handle
142 mutex without waiting.
147 <span class="bold"><strong>db_seq_t st_value;</strong></span>
150 The current cached value of the sequence.
155 <span class="bold"><strong>uintmax_t st_wait;</strong></span>
158 The number of times a thread of control was forced to wait on the
164 <div class="sect2" lang="en" xml:lang="en">
165 <div class="titlepage">
168 <h3 class="title"><a id="idp4845760"></a>Parameters</h3>
172 <div class="sect3" lang="en" xml:lang="en">
173 <div class="titlepage">
176 <h4 class="title"><a id="idp4801376"></a>flags</h4>
181 The <span class="bold"><strong>flags</strong></span> parameter must be set by
182 bitwise inclusively <span class="bold"><strong>OR</strong></span>'ing together
183 one or more of the following values:
185 <div class="itemizedlist">
189 <code class="literal">DB_STAT_ALL</code>
192 Display all available information.
197 <code class="literal">DB_STAT_CLEAR</code>
200 Reset statistics after printing their values.
207 <div class="sect2" lang="en" xml:lang="en">
208 <div class="titlepage">
211 <h3 class="title"><a id="idp4852560"></a>Class</h3>
216 <a class="link" href="seq.html" title="Chapter 12. The DbSequence Handle">DbSequence</a>
219 <div class="sect2" lang="en" xml:lang="en">
220 <div class="titlepage">
223 <h3 class="title"><a id="idp4854032"></a>See Also</h3>
228 <a class="xref" href="seq.html#seqlist" title="Sequences and Related Methods">Sequences and Related Methods</a>
232 <div class="navfooter">
234 <table width="100%" summary="Navigation footer">
236 <td width="40%" align="left"><a accesskey="p" href="seqset_range.html">Prev</a> </td>
237 <td width="20%" align="center">
238 <a accesskey="u" href="seq.html">Up</a>
240 <td width="40%" align="right"> <a accesskey="n" href="seqstat_print.html">Next</a></td>
243 <td width="40%" align="left" valign="top">DbSequence::set_range() </td>
244 <td width="20%" align="center">
245 <a accesskey="h" href="index.html">Home</a>
247 <td width="40%" align="right" valign="top"> DbSequence::stat_print()</td>