File: classwx_s_q_lite3_named_collection.html

package info (click to toggle)
wxsqlite3 3.0.0.1~dfsg0-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 6,740 kB
  • sloc: cpp: 20,130; sh: 2,837; makefile: 302; ansic: 197; php: 9
file content (287 lines) | stat: -rwxr-xr-x 16,064 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>wxSQLite3: wxSQLite3NamedCollection Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.4 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">wxSQLite3&#160;<span id="projectnumber">3.0.0</span></div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="#friends">Friends</a>  </div>
  <div class="headertitle">
<div class="title">wxSQLite3NamedCollection Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="wxSQLite3NamedCollection" -->
<p>Represents a named collection.  
 <a href="classwx_s_q_lite3_named_collection.html#details">More...</a></p>

<p><code>#include &lt;wxsqlite3.h&gt;</code></p>
<div class="dynheader">
Inheritance diagram for wxSQLite3NamedCollection:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classwx_s_q_lite3_named_collection.png" usemap="#wxSQLite3NamedCollection_map" alt=""/>
  <map id="wxSQLite3NamedCollection_map" name="wxSQLite3NamedCollection_map">
<area href="classwx_s_q_lite3_integer_collection.html" title="Represents a named integer value collection." alt="wxSQLite3IntegerCollection" shape="rect" coords="0,56,167,80"/>
<area href="classwx_s_q_lite3_string_collection.html" title="Represents a named string value collection." alt="wxSQLite3StringCollection" shape="rect" coords="177,56,344,80"/>
</map>
 </div></div>

<p><a href="classwx_s_q_lite3_named_collection-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_s_q_lite3_named_collection.html#a34c808eacb3e6cc33f0f9c2cf91fb23c">wxSQLite3NamedCollection</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor.  <a href="#a34c808eacb3e6cc33f0f9c2cf91fb23c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_s_q_lite3_named_collection.html#ab8b6bf7777b92aa56fc25cb493ceaf2e">wxSQLite3NamedCollection</a> (const <a class="el" href="classwx_s_q_lite3_named_collection.html">wxSQLite3NamedCollection</a> &amp;collection)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy constructor.  <a href="#ab8b6bf7777b92aa56fc25cb493ceaf2e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classwx_s_q_lite3_named_collection.html">wxSQLite3NamedCollection</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_s_q_lite3_named_collection.html#a6c1533dfed00f7feed61beb2de43f113">operator=</a> (const <a class="el" href="classwx_s_q_lite3_named_collection.html">wxSQLite3NamedCollection</a> &amp;collection)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Assignement constructor.  <a href="#a6c1533dfed00f7feed61beb2de43f113"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_s_q_lite3_named_collection.html#a33c7a915b4df072b5a76668dfb501169">wxSQLite3NamedCollection</a> (const wxString &amp;collectionName, void *collectionData)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor (internal use only)  <a href="#a33c7a915b4df072b5a76668dfb501169"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_s_q_lite3_named_collection.html#a2a7ee33393636cba17eb0e54e6d32574">~wxSQLite3NamedCollection</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor.  <a href="#a2a7ee33393636cba17eb0e54e6d32574"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const wxString &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_s_q_lite3_named_collection.html#a4c400771b969ab818ee72e1017593e28">GetName</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the name of the collection.  <a href="#a4c400771b969ab818ee72e1017593e28"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">wxString&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_s_q_lite3_named_collection.html#a842c66940288e5aa577d9b0feeed0527">m_name</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Name of the collection.  <a href="#a842c66940288e5aa577d9b0feeed0527"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_s_q_lite3_named_collection.html#a20c5068226b2e06620316391fa836eed">m_data</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reference to the actual array of values representing the collection.  <a href="#a20c5068226b2e06620316391fa836eed"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="friends"></a>
Friends</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_s_q_lite3_named_collection.html#a702b7d74146d16f9f6ec69653fdc1cdb">wxSQLite3Database</a></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Represents a named collection. </p>
<p>A named collection is designed to facilitate using an array of integers or strings as the right-hand side of an IN operator. So instead of doing a prepared statement like this:</p>
<p>SELECT * FROM table WHERE x IN (?,?,?,...,?);</p>
<p>And then binding indivdual integers to each of ? slots, an application can create a named collection object (named "ex1" in the following example), prepare a statement like this:</p>
<p>SELECT * FROM table WHERE x IN ex1;</p>
<p>Then bind an array of integer or string values to the ex1 object to run the statement.</p>
<p>USAGE:</p>
<p>One or more named collection objects can be created as follows:</p>
<p><a class="el" href="classwx_s_q_lite3_integer_collection.html" title="Represents a named integer value collection.">wxSQLite3IntegerCollection</a> p1, p2, p3; p1 = db.CreateIntegerCollection("ex1"); p2 = db.CreateIntegerCollection("ex2"); p3 = db.CreateIntegerCollection("ex3");</p>
<p>Each call to CreateIntegerCollection generates a new virtual table module and a singleton of that virtual table module in the TEMP database. Both the module and the virtual table instance use the name given by the second parameter. The virtual tables can then be used in prepared statements:</p>
<p>SELECT * FROM t1, t2, t3 WHERE t1.x IN ex1 AND t2.y IN ex2 AND t3.z IN ex3;</p>
<p>Each integer array is initially empty. New arrays can be bound to an integer array as follows:</p>
<p>int a1[] = { 1, 2, 3, 4 }; int a2[] = { 5, 6, 7, 8, 9, 10, 11 }; wxArrayInt a3; // Fill a3 p1.Bind(4, a1); p2.Bind(7, a2); p3.Bind(a3);</p>
<p>A single named collection object can be rebound multiple times. But do not attempt to change the bindings of a named collection while it is in the middle of a query.</p>
<p>The array that holds the integer or string values is automatically allocated by the Bind method.</p>
<p>The named collection object is automatically destroyed when its corresponding virtual table is dropped. Since the virtual tables are created in the TEMP database, they are automatically dropped when the database connection closes so the application does not normally need to take any special action to free the named collection objects. </p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a34c808eacb3e6cc33f0f9c2cf91fb23c"></a><!-- doxytag: member="wxSQLite3NamedCollection::wxSQLite3NamedCollection" ref="a34c808eacb3e6cc33f0f9c2cf91fb23c" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">wxSQLite3NamedCollection::wxSQLite3NamedCollection </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Constructor. </p>

</div>
</div>
<a class="anchor" id="ab8b6bf7777b92aa56fc25cb493ceaf2e"></a><!-- doxytag: member="wxSQLite3NamedCollection::wxSQLite3NamedCollection" ref="ab8b6bf7777b92aa56fc25cb493ceaf2e" args="(const wxSQLite3NamedCollection &amp;collection)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">wxSQLite3NamedCollection::wxSQLite3NamedCollection </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classwx_s_q_lite3_named_collection.html">wxSQLite3NamedCollection</a> &amp;&#160;</td>
          <td class="paramname"><em>collection</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Copy constructor. </p>

</div>
</div>
<a class="anchor" id="a33c7a915b4df072b5a76668dfb501169"></a><!-- doxytag: member="wxSQLite3NamedCollection::wxSQLite3NamedCollection" ref="a33c7a915b4df072b5a76668dfb501169" args="(const wxString &amp;collectionName, void *collectionData)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">wxSQLite3NamedCollection::wxSQLite3NamedCollection </td>
          <td>(</td>
          <td class="paramtype">const wxString &amp;&#160;</td>
          <td class="paramname"><em>collectionName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>collectionData</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Constructor (internal use only) </p>

</div>
</div>
<a class="anchor" id="a2a7ee33393636cba17eb0e54e6d32574"></a><!-- doxytag: member="wxSQLite3NamedCollection::~wxSQLite3NamedCollection" ref="a2a7ee33393636cba17eb0e54e6d32574" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">wxSQLite3NamedCollection::~wxSQLite3NamedCollection </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Destructor. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a4c400771b969ab818ee72e1017593e28"></a><!-- doxytag: member="wxSQLite3NamedCollection::GetName" ref="a4c400771b969ab818ee72e1017593e28" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const wxString&amp; wxSQLite3NamedCollection::GetName </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the name of the collection. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>the name of the collection </dd></dl>

</div>
</div>
<a class="anchor" id="a6c1533dfed00f7feed61beb2de43f113"></a><!-- doxytag: member="wxSQLite3NamedCollection::operator=" ref="a6c1533dfed00f7feed61beb2de43f113" args="(const wxSQLite3NamedCollection &amp;collection)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classwx_s_q_lite3_named_collection.html">wxSQLite3NamedCollection</a> &amp; wxSQLite3NamedCollection::operator= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classwx_s_q_lite3_named_collection.html">wxSQLite3NamedCollection</a> &amp;&#160;</td>
          <td class="paramname"><em>collection</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Assignement constructor. </p>

</div>
</div>
<hr/><h2>Friends And Related Function Documentation</h2>
<a class="anchor" id="a702b7d74146d16f9f6ec69653fdc1cdb"></a><!-- doxytag: member="wxSQLite3NamedCollection::wxSQLite3Database" ref="a702b7d74146d16f9f6ec69653fdc1cdb" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">friend class <a class="el" href="classwx_s_q_lite3_database.html">wxSQLite3Database</a><code> [friend]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Reimplemented in <a class="el" href="classwx_s_q_lite3_integer_collection.html#a702b7d74146d16f9f6ec69653fdc1cdb">wxSQLite3IntegerCollection</a>, and <a class="el" href="classwx_s_q_lite3_string_collection.html#a702b7d74146d16f9f6ec69653fdc1cdb">wxSQLite3StringCollection</a>.</p>

</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a20c5068226b2e06620316391fa836eed"></a><!-- doxytag: member="wxSQLite3NamedCollection::m_data" ref="a20c5068226b2e06620316391fa836eed" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* <a class="el" href="classwx_s_q_lite3_named_collection.html#a20c5068226b2e06620316391fa836eed">wxSQLite3NamedCollection::m_data</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Reference to the actual array of values representing the collection. </p>

</div>
</div>
<a class="anchor" id="a842c66940288e5aa577d9b0feeed0527"></a><!-- doxytag: member="wxSQLite3NamedCollection::m_name" ref="a842c66940288e5aa577d9b0feeed0527" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">wxString <a class="el" href="classwx_s_q_lite3_named_collection.html#a842c66940288e5aa577d9b0feeed0527">wxSQLite3NamedCollection::m_name</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Name of the collection. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="wxsqlite3_8h.html">wxsqlite3.h</a></li>
<li><a class="el" href="wxsqlite3_8cpp.html">wxsqlite3.cpp</a></li>
</ul>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Thu Jan 19 2012 16:17:48 for wxSQLite3 by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>