📄 indexeddbview.htm
字号:
<td valign="top"><tt>a.find_AK(s, k)</tt> </td>
<td valign="top"> </td>
<td valign="top"><tt>const_iterator</tt> </td>
</tr>
<tr>
<td valign="top">Equal range alternate key</td>
<td valign="top"><tt>a.equal_range_AK(s, k)</tt> </td>
<td valign="top"> </td>
<td valign="top"><tt>pair<const_iterator,
const_iterator></tt>. </td>
</tr>
<tr>
<td valign="top">Find using key fields</td>
<td valign="top"><tt>a.find(f1, ..., fn)</tt> </td>
<td valign="top"> </td>
<td valign="top"><tt>const_iterator</tt> </td>
</tr>
<tr>
<td valign="top">Equal range using key fields</td>
<td valign="top"><tt>a.equal_range(f1, ..., fn)</tt></td>
<td valign="top"> </td>
<td valign="top"><tt>pair<const_iterator,
const_iterator></tt> </td>
</tr>
<tr>
<td valign="top">Find using alternate key fields</td>
<td valign="top"><tt>a.find_AK(s, f1, ..., fn)</tt> </td>
<td valign="top"> </td>
<td valign="top"><tt>const_iterator</tt> </td>
</tr>
<tr>
<td valign="top">Equal range using alternate key fields</td>
<td valign="top"><tt>a.equal_range_AK(s, f1, ..., fn)</tt></td>
<td valign="top"> </td>
<td valign="top"><tt>pair<const_iterator,
const_iterator></tt> </td>
</tr>
<tr>
<td valign="top">Replace element </td>
<td valign="top"><tt>a.replace(p, k)</tt> </td>
<td valign="top"> </td>
<td valign="top"><tt>pair<const_iterator, bool></tt></td>
</tr>
</table>
<h3>Expression semantics</h3>
<table border="1">
<tr>
<th>Name </th>
<th>Expression </th>
<th>Precondition </th>
<th>Semantics </th>
<th>Postcondition </th>
</tr>
<tr>
<td valign="top">Default constructor </td>
<td valign="top"><pre>X a(&view,
&IndexNamesAndFields,
bm, km, IndexedDBViewParam)
</pre>
</td>
<td valign="top"> </td>
<td valign="top">Creates an empty container bound to the <font
size="2" face="Courier New">DBView</font> referenced by
view. Creates named indexes on all rows fetched from <font
size="2" face="Courier New">DBView</font> using the <font
size="2" face="Courier New">IndexedDBView</font> of index
defintions in <font size="2" face="Courier New">IndexNamesAndFields</font>.
<p><font size="2" face="Courier New">IndexNamesAndFields</font>
takes the form <font size="2" face="Courier New">"UNIQUE
IndexName1; IndexField1,IndexField2; IndexName2;
IndexField3, IndexField4, IndexField5"</font>. The
first index in the list is used as the primary index for
the default <font size="2" face="Courier New">find()</font>
method. The <font size="2" face="Courier New">UNIQUE</font>
keyword is optional and may be specified before any index
name to indicate that keyfields in this index represent a
unique key that must be checked against before any
records are inserted or replaced in the container.</p>
<p><font size="2" face="Courier New">bm =</font> <font
size="2" face="Courier New">{ UNBOUND, BOUND }</font>. If
the mode for <font size="2" face="Courier New">IndexedDBView</font>
to <font size="2" face="Courier New">BOUND</font>, any
changes made to elements in the container will be written
back to the database. If the mode is <font size="2"
face="Courier New">UNBOUND</font>, any changes made are
not written back to the database.</p>
<p><font size="2" face="Courier New">km = {
USE_ALL_FIELDS, USE_PK_FIELDS_ONLY }</font>. This affects
what criteria are sent to the database for use in
updating or deleting records in <font size="2"
face="Courier New">BOUND</font><font size="3"
face="Courier New"> </font>mode. If <font size="2"
face="Courier New">km</font> is <font size="2"
face="Courier New">IndexedDBView</font> to U<font
size="2" face="Courier New">SE_ALL_FIELDS</font> then any
updates or deletes sent to the database will use all
fields specified in the <font size="2" face="Courier New">DBView</font>
object in the criteria for the underlying SQL <font
size="2" face="Courier New">UPDATE</font> or SQL <font
size="2" face="Courier New">DELETE</font> statement. If <font
size="2" face="Courier New">km</font> is <font size="2"
face="Courier New">IndexedDBView</font> to <font size="2"
face="Courier New">USE_PK_FIELDS_ONLY</font> then only
fields that are in the primary index as defined by <font
size="2" face="Courier New">IndexNamesAndFields</font>
will be used to update or delete records in the database.</p>
<p><font size="2" face="Courier New">IndexedDBViewParam</font>.
Function object that is called when the routine executes a fetch
against the <font size="2" face="Courier New">DBView</font>
to retrieve records from the database. This is used by<font
size="2" face="Courier New"> IndexedDBView</font> to set any
parameters that are needed by the <font size="2"
face="Courier">DBView</font> object's query.</p>
</td>
<td valign="top">The size of the container is <font
size="4" face="Times New Roman"><tt>0. Rows are not
fetched until an attempt is made to call methods in the
container.</tt></font><font size="4"> </font></td>
</tr>
<tr>
<td valign="top">Find alternate key</td>
<td valign="top"><tt>a.find_AK(s,k)</tt> </td>
<td valign="top"> </td>
<td valign="top">Returns an iterator pointing to an
element whose key is the same as <tt>k</tt>, with a key
match determined by using the index name in s, or <tt>a.end()</tt>
if no such element exists. </td>
<td valign="top">Either the return value is <tt>a.end()</tt>,
or else the return value has a key that is the same as <tt>k</tt>.
</td>
</tr>
<tr>
<td valign="top">Equal range alternate key</td>
<td valign="top"><tt>a.equal_range_AK(s, k)</tt> </td>
<td valign="top"> </td>
<td valign="top">Returns a pair <tt>P</tt> such that <tt>[P.first,
P.second)</tt> is a range containing all elements in <tt>a</tt>
whose keys are the same as <tt>k</tt>, with a key match
determined by using the index name in s. If no elements
have the same key as <tt>k</tt>, the return value is an
empty range. </td>
<td valign="top">If <tt>p</tt> is a dereferenceable
iterator in <tt>a</tt>, then either <tt>p</tt> lies in
the range <tt>[P.first, P.second)</tt>, or else <tt>*p</tt>
has a key that is not the same as <tt>k</tt>. </td>
</tr>
<tr>
<td valign="top">Find using key fields</td>
<td valign="top"><tt>a.find(f1, ..., fn)</tt> </td>
<td valign="top"> </td>
<td valign="top">Returns an iterator pointing to an
element whose key fields match the values given by f1,...,
fn, with a key match determined by using the primary
index, or <tt>a.end()</tt> if no such element exists. Key
fields are matched in the order that was given in the
constructor for a.</td>
<td valign="top">Either the return value is <tt>a.end()</tt>,
or else the return value has a key that is the same as <tt>f1,
.. fn.</tt>. </td>
</tr>
<tr>
<td valign="top">Equal range using key fields</td>
<td valign="top"><tt>a.equal_range(f1, ...,fn)</tt></td>
<td valign="top"> </td>
<td valign="top">Returns a pair <tt>P</tt> such that <tt>[P.first,
P.second)</tt> is a range containing all elements in <tt>a</tt>
whose keys are the same as <tt>k</tt>, with a key match
determined by using the primary index. Key fields are
matched in the order that was given in the constructor
for a. If no elements have the same key as <tt>k</tt>,
the return value is an empty range. </td>
<td valign="top">If <tt>p</tt> is a dereferenceable
iterator in <tt>a</tt>, then either <tt>p</tt> lies in
the range <tt>[P.first, P.second)</tt>, or else <tt>*p</tt>
has a key that is not the same as <tt>k</tt>. </td>
</tr>
<tr>
<td valign="top">Find using alternate key fields</td>
<td valign="top"><tt>a.find_AK(s, f1, ..., fn)</tt> </td>
<td valign="top"> </td>
<td valign="top">Returns an iterator pointing to an
element whose key fields match the values given by f1,...,
fn, with a key match determined by using the index name
in s, or <tt>a.end()</tt> if no such element exists. Key
fields are matched in the order that was given in the
constructor for a.</td>
<td valign="top">Either the return value is <tt>a.end()</tt>,
or else the return value has a key that is the same as <tt>f1,
.. fn.</tt>. </td>
</tr>
<tr>
<td valign="top">Equal range using alternate key fields</td>
<td valign="top"><tt>a.equal_range_AK(s, f1, ...,fn)</tt></td>
<td valign="top"> </td>
<td valign="top">Returns a pair <tt>P</tt> such that <tt>[P.first,
P.second)</tt> is a range containing all elements in <tt>a</tt>
whose keys are the same as <tt>k</tt>, with a key match
determined by using the index name in s. Key fields are
matched in the order that was given in the constructor
for a. If no elements have the same key as <tt>k</tt>,
the return value is an empty range. </td>
<td valign="top">If <tt>p</tt> is a dereferenceable
iterator in <tt>a</tt>, then either <tt>p</tt> lies in
the range <tt>[P.first, P.second)</tt>, or else <tt>*p</tt>
has a key that is not the same as <tt>k</tt>. </td>
</tr>
<tr>
<td valign="top">Replace element </td>
<td valign="top"><tt>a.replace(p, k)</tt></td>
<td valign="top"> <tt>p</tt> is a dereferenceable
iterator in <tt>a</tt>. </td>
<td valign="top">Replaces the element in the container
pointed to by p with the new value in k. The return value
is a <a href="http://www.sgi.com/tech/stl/pair.html"><tt>pair</tt></a>
<tt>P</tt>. <tt>P.first</tt> is an iterator pointing to
the element whose key is the same as the key of <tt>k</tt>.
<tt>P.second</tt> is a <tt>bool</tt>: it is <tt>true</tt>
if <tt>p</tt> was actually updated in <tt>a</tt>, and <tt>false</tt>
if <tt>p</tt> was not updated in <tt>a</tt>, <i>i.e.</i>
if <tt>a</tt> already contained an element not equal to p
with the same key as <tt>k. This uniqueness constraint is
checked against all UNIQUE indexes specified in the
IndexNamesAndFields parameter of the constructor</tt>. </td>
<td valign="top"><tt>P.first</tt> is a dereferenceable
iterator. <tt>*(P.first)</tt> has the same key as <tt>k</tt>.
</td>
</tr>
</table>
<h3>Members</h3>
<table border="1">
<tr>
<th>Member </th>
<th>Where defined </th>
<th>Description </th>
</tr>
<tr>
<td valign="top"><tt>value_type</tt> </td>
<td valign="top"><a
href="http://www.sgi.com/tech/stl/Container.html">Container</a>
</td>
<td valign="top">The type of object, <tt>T</tt>, stored
in the IndexedDBView. </td>
</tr>
<tr>
<td valign="top"><tt>key_type</tt> </td>
<td valign="top"><a
href="http://www.sgi.com/tech/stl/AssociativeContainer.html">Associative
Container</a> </td>
<td valign="top">The key type associated with <tt>value_type</tt>.
</td>
</tr>
<tr>
<td valign="top"><tt>pointer</tt> </td>
<td valign="top"><a
href="http://www.sgi.com/tech/stl/Container.html">Container</a>
</td>
<td valign="top">Pointer to <tt>T</tt>. </td>
</tr>
<tr>
<td valign="top"><tt>reference</tt> </td>
<td valign="top"><a
href="http://www.sgi.com/tech/stl/Container.html">Container</a>
</td>
<td valign="top">Reference to <tt>T</tt> </td>
</tr>
<tr>
<td valign="top"><tt>const_reference</tt> </td>
<td valign="top"><a
href="http://www.sgi.com/tech/stl/Container.html">Container</a>
</td>
<td valign="top">Const reference to <tt>T</tt> </td>
</tr>
<tr>
<td valign="top"><tt>size_type</tt> </td>
<td valign="top"><a
href="http://www.sgi.com/tech/stl/Container.html">Container</a>
</td>
<td valign="top">An unsigned integral type. </td>
</tr>
<tr>
<td valign="top"><tt>difference_type</tt> </td>
<td valign="top"><a
href="http://www.sgi.com/tech/stl/Container.html">Container</a>
</td>
<td valign="top">A signed integral type. </td>
</tr>
<tr>
<td valign="top"><tt>iterator</tt> </td>
<td valign="top"><a
href="http://www.sgi.com/tech/stl/Container.html">Container</a>
</td>
<td valign="top">Iterator used to iterate through a <font
size="2" face="Courier New">IndexedDBView</font>. </td>
</tr>
<tr>
<td valign="top"><tt>const_iterator</tt> </td>
<td valign="top"><a
href="http://www.sgi.com/tech/stl/Container.html">Container</a>
</td>
<td valign="top">Const iterator used to iterate through a
<font size="2" face="Courier">IndexedDBView.</font> (<tt>Iterator</tt>
and <tt>const_iterator</tt> are the same type.) </td>
</tr>
<tr>
<td valign="top"><tt>reverse_iterator</tt> </td>
<td valign="top"><a
href="http://www.sgi.com/tech/stl/ReversibleContainer.html">Reversible
Container</a> </td>
<td valign="top">Iterator used to iterate backwards
through a <font size="2" face="Courier New">IndexedDBView</font>.
</td>
</tr>
<tr>
<td valign="top"><tt>const_reverse_iterator</tt> </td>
<td valign="top"><a
href="http://www.sgi.com/tech/stl/ReversibleContainer.html">Reversible
Container</a> </td>
<td valign="top">Const iterator used to iterate backwards
through a <font size="2" face="Courier New">IndexedDBView</font>.
(<tt>Reverse_iterator</tt> and <tt>const_reverse_iterator</tt>
are the same type.) </td>
</tr>
<tr>
<td valign="top"><tt>iterator begin()</tt> </td>
<td valign="top"><a
href="http://www.sgi.com/tech/stl/Container.html">Container</a>
</td>
<td valign="top">Returns an <tt>iterator</tt> pointing to
the beginning of the<font size="2" face="Courier New">
IndexedDBView.</font> </td>
</tr>
<tr>
<td valign="top"><tt>const_iterator begin() const</tt> </td>
<td valign="top"><a
href="http://www.sgi.com/tech/stl/Container.html">Container</a>
</td>
<td valign="top">Returns a <tt>const_iterator</tt>
pointing to the beginning of the<font size="2"
face="Courier New"> IndexedDBView.</font> </td>
</tr>
<tr>
<td valign="top"><tt>iterator end()</tt> </td>
<td valign="top"><a
href="http://www.sgi.com/tech/stl/Container.html">Container</a>
</td>
<td valign="top">Returns an <tt>iterator</tt> pointing to
the end of the <font size="2" face="Courier New">IndexedDBView</font>.
</td>
</tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -