1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html><head><meta http-equiv=
"Content-Type" content=
"text/html;charset=UTF-8">
3 <title>Barry: Barry::RecordBuilder
< RecordT, StorageT
> Class Template Reference
</title>
4 <link href=
"doxygen.css" rel=
"stylesheet" type=
"text/css">
5 <link href=
"tabs.css" rel=
"stylesheet" type=
"text/css">
7 <!-- Generated by Doxygen 1.5.6 -->
8 <div class=
"navigation" id=
"top">
11 <li><a href=
"index.html"><span>Main
Page
</span></a></li>
12 <li><a href=
"modules.html"><span>Modules
</span></a></li>
13 <li><a href=
"namespaces.html"><span>Namespaces
</span></a></li>
14 <li class=
"current"><a href=
"classes.html"><span>Classes
</span></a></li>
15 <li><a href=
"files.html"><span>Files
</span></a></li>
16 <li><a href=
"dirs.html"><span>Directories
</span></a></li>
21 <li><a href=
"classes.html"><span>Alphabetical
List
</span></a></li>
22 <li><a href=
"annotated.html"><span>Class
List
</span></a></li>
23 <li><a href=
"hierarchy.html"><span>Class
Hierarchy
</span></a></li>
24 <li><a href=
"functions.html"><span>Class
Members
</span></a></li>
27 <div class=
"navpath"><a class=
"el" href=
"namespaceBarry.html">Barry
</a>::
<a class=
"el" href=
"classBarry_1_1RecordBuilder.html">RecordBuilder
</a>
30 <div class=
"contents">
31 <h1>Barry::RecordBuilder
< RecordT, StorageT
> Class Template Reference
</h1><!-- doxytag: class="Barry::RecordBuilder" --><!-- doxytag: inherits="Barry::Builder" --><code>#include
<<a class=
"el" href=
"builder_8h-source.html">builder.h
</a>></code>
33 <div class=
"dynheader">
34 Inheritance diagram for Barry::RecordBuilder
< RecordT, StorageT
>:
</div>
35 <div class=
"dynsection">
36 <p><center><img src=
"classBarry_1_1RecordBuilder__inherit__graph.png" border=
"0" usemap=
"#Barry_1_1RecordBuilder_3_01RecordT_00_01StorageT_01_4__inherit__map" alt=
"Inheritance graph"></center>
37 <map name=
"Barry_1_1RecordBuilder_3_01RecordT_00_01StorageT_01_4__inherit__map">
38 <area shape=
"rect" href=
"classBarry_1_1Builder.html" title=
"Base class for the builder functor hierarchy." alt=
"" coords=
"93,5,192,32"></map>
39 <center><font size=
"2">[
<a href=
"graph_legend.html">legend
</a>]
</font></center></div>
40 <div class=
"dynheader">
41 Collaboration diagram for Barry::RecordBuilder
< RecordT, StorageT
>:
</div>
42 <div class=
"dynsection">
43 <p><center><img src=
"classBarry_1_1RecordBuilder__coll__graph.png" border=
"0" usemap=
"#Barry_1_1RecordBuilder_3_01RecordT_00_01StorageT_01_4__coll__map" alt=
"Collaboration graph"></center>
44 <map name=
"Barry_1_1RecordBuilder_3_01RecordT_00_01StorageT_01_4__coll__map">
45 <area shape=
"rect" href=
"classBarry_1_1Builder.html" title=
"Base class for the builder functor hierarchy." alt=
"" coords=
"5,5,104,32"></map>
46 <center><font size=
"2">[
<a href=
"graph_legend.html">legend
</a>]
</font></center></div>
49 <a href=
"classBarry_1_1RecordBuilder-members.html">List of all members.
</a><hr><a name=
"_details"></a><h2>Detailed Description
</h2>
50 <h3>template
<class RecordT, class StorageT
><br>
51 class Barry::RecordBuilder
< RecordT, StorageT
></h3>
53 Template class for easy creation of specific protocol packet builder objects.
55 This template takes the following template arguments:
<p>
57 <li>RecordT: One of the record classes in
<a class=
"el" href=
"record_8h.html" title=
"Blackberry database record classes.">record.h
</a></li><li>StorageT: A custom storage functor class. An object of this type will be called as a function with empty Record as an argument. The storage class is expected to fill the record object in preparation for building the packet out of that data. These calls happen on the fly as the data is sent to the device over USB, so it should not block forever.
</li></ul>
59 Example SaveDatabase() call:
<p>
63 <p>Definition at line
<a class=
"el" href=
"builder_8h-source.html#l00167">167</a> of file
<a class=
"el" href=
"builder_8h-source.html">builder.h
</a>.
</p>
64 <table border=
"0" cellpadding=
"0" cellspacing=
"0">
66 <tr><td colspan=
"2"><br><h2>Public Member Functions
</h2></td></tr>
67 <tr><td class=
"memItemLeft" nowrap
align=
"right" valign=
"top"> </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"classBarry_1_1RecordBuilder.html#c8cda12de94498b715d6171fb51930af">RecordBuilder
</a> (StorageT
&storage)
</td></tr>
69 <tr><td class=
"mdescLeft"> </td><td class=
"mdescRight">Constructor that references an externally managed storage object.
<a href=
"#c8cda12de94498b715d6171fb51930af"></a><br></td></tr>
70 <tr><td class=
"memItemLeft" nowrap
align=
"right" valign=
"top"> </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"classBarry_1_1RecordBuilder.html#ab6421e54af5c0886d2d9979fe4d2d35">RecordBuilder
</a> (StorageT *storage)
</td></tr>
72 <tr><td class=
"mdescLeft"> </td><td class=
"mdescRight">Constructor that references a locally managed storage object.
<a href=
"#ab6421e54af5c0886d2d9979fe4d2d35"></a><br></td></tr>
73 <tr><td class=
"memItemLeft" nowrap
align=
"right" valign=
"top">virtual bool
</td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"classBarry_1_1RecordBuilder.html#cc484ee4a8e30cf634e86c282498e9a0">BuildRecord
</a> (
<a class=
"el" href=
"classBarry_1_1DBData.html">DBData
</a> &data, size_t
&offset, const
<a class=
"el" href=
"classBarry_1_1IConverter.html">IConverter
</a> *ic)
</td></tr>
75 <tr><td class=
"mdescLeft"> </td><td class=
"mdescRight">Called to build the record field data.
<a href=
"#cc484ee4a8e30cf634e86c282498e9a0"></a><br></td></tr>
76 <tr><td class=
"memItemLeft" nowrap
align=
"right" valign=
"top">virtual bool
</td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"classBarry_1_1RecordBuilder.html#12bf6698689b031986008924d8c66946">FetchRecord
</a> (
<a class=
"el" href=
"classBarry_1_1DBData.html">DBData
</a> &data, const
<a class=
"el" href=
"classBarry_1_1IConverter.html">IConverter
</a> *ic)
</td></tr>
78 <tr><td class=
"mdescLeft"> </td><td class=
"mdescRight">Same as BuildRecord, but does not care about any offsets.
<a href=
"#12bf6698689b031986008924d8c66946"></a><br></td></tr>
79 <tr><td class=
"memItemLeft" nowrap
align=
"right" valign=
"top">virtual bool
</td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"classBarry_1_1RecordBuilder.html#a58d766db9692f978aa2a49736607dac">EndOfFile
</a> () const
</td></tr>
81 <tr><td class=
"mdescLeft"> </td><td class=
"mdescRight">Sometimes a builder can have multiple databases stored in it, so when Build/Fetch returns false, check if there is more data with this function.
<a href=
"#a58d766db9692f978aa2a49736607dac"></a><br></td></tr>
83 <hr><h2>Constructor
& Destructor Documentation
</h2>
84 <a class=
"anchor" name=
"c8cda12de94498b715d6171fb51930af"></a><!-- doxytag: member="Barry::RecordBuilder::RecordBuilder" ref="c8cda12de94498b715d6171fb51930af" args="(StorageT &storage)" -->
86 <div class=
"memproto">
87 <div class=
"memtemplate">
88 template
<class RecordT, class StorageT
> </div>
89 <table class=
"memname">
91 <td class=
"memname"><a class=
"el" href=
"classBarry_1_1RecordBuilder.html">Barry::RecordBuilder
</a>< RecordT, StorageT
>::
<a class=
"el" href=
"classBarry_1_1RecordBuilder.html">RecordBuilder
</a> </td>
93 <td class=
"paramtype">StorageT
& </td>
94 <td class=
"paramname"> <em>storage
</em> </td>
95 <td> )
</td>
96 <td><code> [inline]
</code></td>
103 Constructor that references an externally managed storage object.
106 <p>Definition at line
<a class=
"el" href=
"builder_8h-source.html#l00177">177</a> of file
<a class=
"el" href=
"builder_8h-source.html">builder.h
</a>.
</p>
110 <a class=
"anchor" name=
"ab6421e54af5c0886d2d9979fe4d2d35"></a><!-- doxytag: member="Barry::RecordBuilder::RecordBuilder" ref="ab6421e54af5c0886d2d9979fe4d2d35" args="(StorageT *storage)" -->
111 <div class=
"memitem">
112 <div class=
"memproto">
113 <div class=
"memtemplate">
114 template
<class RecordT, class StorageT
> </div>
115 <table class=
"memname">
117 <td class=
"memname"><a class=
"el" href=
"classBarry_1_1RecordBuilder.html">Barry::RecordBuilder
</a>< RecordT, StorageT
>::
<a class=
"el" href=
"classBarry_1_1RecordBuilder.html">RecordBuilder
</a> </td>
119 <td class=
"paramtype">StorageT *
</td>
120 <td class=
"paramname"> <em>storage
</em> </td>
121 <td> )
</td>
122 <td><code> [inline]
</code></td>
129 Constructor that references a locally managed storage object.
131 The pointer passed in will be stored, and freed when this class is destroyed. It is safe to call this constructor with a 'new'ly created storage object.
132 <p>Definition at line
<a class=
"el" href=
"builder_8h-source.html#l00189">189</a> of file
<a class=
"el" href=
"builder_8h-source.html">builder.h
</a>.
</p>
136 <hr><h2>Member Function Documentation
</h2>
137 <a class=
"anchor" name=
"cc484ee4a8e30cf634e86c282498e9a0"></a><!-- doxytag: member="Barry::RecordBuilder::BuildRecord" ref="cc484ee4a8e30cf634e86c282498e9a0" args="(DBData &data, size_t &offset, const IConverter *ic)" -->
138 <div class=
"memitem">
139 <div class=
"memproto">
140 <div class=
"memtemplate">
141 template
<class RecordT, class StorageT
> </div>
142 <table class=
"memname">
144 <td class=
"memname">virtual bool
<a class=
"el" href=
"classBarry_1_1RecordBuilder.html">Barry::RecordBuilder
</a>< RecordT, StorageT
>::BuildRecord
</td>
146 <td class=
"paramtype"><a class=
"el" href=
"classBarry_1_1DBData.html">DBData
</a> & </td>
147 <td class=
"paramname"> <em>data
</em>,
</td>
150 <td class=
"paramkey"></td>
152 <td class=
"paramtype">size_t
& </td>
153 <td class=
"paramname"> <em>offset
</em>,
</td>
156 <td class=
"paramkey"></td>
158 <td class=
"paramtype">const
<a class=
"el" href=
"classBarry_1_1IConverter.html">IConverter
</a> *
</td>
159 <td class=
"paramname"> <em>ic
</em></td><td> </td>
164 <td></td><td></td><td><code> [inline, virtual]
</code></td>
171 Called to build the record field data.
173 Store the raw data in data, using offset to know where to write. Be sure to update offset, and be sure to adjust the size of the data packet (possibly with Data::ReleaseBuffer()).
<p>
174 Returns true if successful, and false if at the end of the series. Note that if
<a class=
"el" href=
"classBarry_1_1RecordBuilder.html#a58d766db9692f978aa2a49736607dac" title=
"Sometimes a builder can have multiple databases stored in it, so when Build/Fetch...">EndOfFile()
</a> is false after this function returns false, then there may be another series available, which the next call to
<a class=
"el" href=
"classBarry_1_1RecordBuilder.html#cc484ee4a8e30cf634e86c282498e9a0" title=
"Called to build the record field data.">BuildRecord()
</a> will determine.
175 <p>Implements
<a class=
"el" href=
"classBarry_1_1Builder.html#4a3d38061d957eb6dd0539b18d40e6ad">Barry::Builder
</a>.
</p>
177 <p>Definition at line
<a class=
"el" href=
"builder_8h-source.html#l00203">203</a> of file
<a class=
"el" href=
"builder_8h-source.html">builder.h
</a>.
</p>
179 <p>References
<a class=
"el" href=
"builder_8h-source.html#l00135">Barry::SetDBData()
</a>.
</p>
181 <p>Referenced by
<a class=
"el" href=
"builder_8h-source.html#l00218">Barry::RecordBuilder
< RecordT, StorageT
>::FetchRecord()
</a>.
</p>
184 <div class=
"dynheader">
185 Here is the call graph for this function:
</div>
186 <div class=
"dynsection">
187 <p><center><img src=
"classBarry_1_1RecordBuilder_cc484ee4a8e30cf634e86c282498e9a0_cgraph.png" border=
"0" usemap=
"#classBarry_1_1RecordBuilder_cc484ee4a8e30cf634e86c282498e9a0_cgraph_map" alt=
""></center>
188 <map name=
"classBarry_1_1RecordBuilder_cc484ee4a8e30cf634e86c282498e9a0_cgraph_map">
189 <area shape=
"rect" href=
"namespaceBarry.html#1694e381d8f7c0a41714992c831e716b" title=
"Contains the proper way to convert a record object into a DBData object." alt=
"" coords=
"275,107,400,133"><area shape=
"rect" href=
"classBarry_1_1DBData.html#55d6bde680fe0b48d07882ade96ef9c3" title=
"Barry::DBData::SetDBName" alt=
"" coords=
"449,5,633,32"><area shape=
"rect" href=
"classBarry_1_1DBData.html#a46147fced1b122cb6a0e6d1cee3cb07" title=
"Barry::DBData::SetIds" alt=
"" coords=
"465,56,617,83"><area shape=
"rect" href=
"classBarry_1_1DBData.html#cb569139ee2d44442d4709ccf2a4ab3c" title=
"Barry::DBData::SetOffset" alt=
"" coords=
"457,107,625,133"><area shape=
"rect" href=
"classBarry_1_1DBData.html#d1a3e69cabea68e0a309459cd7c58e78" title=
"Barry::DBData::SetVersion" alt=
"" coords=
"453,157,629,184"><area shape=
"rect" href=
"classBarry_1_1DBData.html#3c1c4ad5ce85cef0ea85002a0fe07881" title=
"Barry::DBData::UseData" alt=
"" coords=
"460,208,623,235"></map>
193 <div class=
"dynheader">
194 Here is the caller graph for this function:
</div>
195 <div class=
"dynsection">
196 <p><center><img src=
"classBarry_1_1RecordBuilder_cc484ee4a8e30cf634e86c282498e9a0_icgraph.png" border=
"0" usemap=
"#classBarry_1_1RecordBuilder_cc484ee4a8e30cf634e86c282498e9a0_icgraph_map" alt=
""></center>
197 <map name=
"classBarry_1_1RecordBuilder_cc484ee4a8e30cf634e86c282498e9a0_icgraph_map">
198 <area shape=
"rect" href=
"classBarry_1_1RecordBuilder.html#12bf6698689b031986008924d8c66946" title=
"Same as BuildRecord, but does not care about any offsets." alt=
"" coords=
"275,5,499,32"></map>
203 <a class=
"anchor" name=
"12bf6698689b031986008924d8c66946"></a><!-- doxytag: member="Barry::RecordBuilder::FetchRecord" ref="12bf6698689b031986008924d8c66946" args="(DBData &data, const IConverter *ic)" -->
204 <div class=
"memitem">
205 <div class=
"memproto">
206 <div class=
"memtemplate">
207 template
<class RecordT, class StorageT
> </div>
208 <table class=
"memname">
210 <td class=
"memname">virtual bool
<a class=
"el" href=
"classBarry_1_1RecordBuilder.html">Barry::RecordBuilder
</a>< RecordT, StorageT
>::FetchRecord
</td>
212 <td class=
"paramtype"><a class=
"el" href=
"classBarry_1_1DBData.html">DBData
</a> & </td>
213 <td class=
"paramname"> <em>data
</em>,
</td>
216 <td class=
"paramkey"></td>
218 <td class=
"paramtype">const
<a class=
"el" href=
"classBarry_1_1IConverter.html">IConverter
</a> *
</td>
219 <td class=
"paramname"> <em>ic
</em></td><td> </td>
224 <td></td><td></td><td><code> [inline, virtual]
</code></td>
231 Same as BuildRecord, but does not care about any offsets.
233 The caller should call DBData::GetOffset() afterward to discover if there is an offset to the result.
<p>
234 This is usually the fastest of the two functions, since extra copying may be required if a specific offset is given. When building records from Record classes, both functions are the same speed. But when building records from the device, the device decides the offset, so
<a class=
"el" href=
"classBarry_1_1RecordBuilder.html#12bf6698689b031986008924d8c66946" title=
"Same as BuildRecord, but does not care about any offsets.">FetchRecord()
</a> is faster, since BuildRecord requires a copy to adjust to the right offset.
<p>
235 The caller should use the function that results in the least amount of copying for the caller. If the caller doesn't care about where the resulting record is in data, use
<a class=
"el" href=
"classBarry_1_1RecordBuilder.html#12bf6698689b031986008924d8c66946" title=
"Same as BuildRecord, but does not care about any offsets.">FetchRecord()
</a>.
236 <p>Implements
<a class=
"el" href=
"classBarry_1_1Builder.html#005a0269c1f96947d7a75c1cc09a4609">Barry::Builder
</a>.
</p>
238 <p>Definition at line
<a class=
"el" href=
"builder_8h-source.html#l00218">218</a> of file
<a class=
"el" href=
"builder_8h-source.html">builder.h
</a>.
</p>
240 <p>References
<a class=
"el" href=
"builder_8h-source.html#l00203">Barry::RecordBuilder
< RecordT, StorageT
>::BuildRecord()
</a>.
</p>
243 <div class=
"dynheader">
244 Here is the call graph for this function:
</div>
245 <div class=
"dynsection">
246 <p><center><img src=
"classBarry_1_1RecordBuilder_12bf6698689b031986008924d8c66946_cgraph.png" border=
"0" usemap=
"#classBarry_1_1RecordBuilder_12bf6698689b031986008924d8c66946_cgraph_map" alt=
""></center>
247 <map name=
"classBarry_1_1RecordBuilder_12bf6698689b031986008924d8c66946_cgraph_map">
248 <area shape=
"rect" href=
"classBarry_1_1RecordBuilder.html#cc484ee4a8e30cf634e86c282498e9a0" title=
"Called to build the record field data." alt=
"" coords=
"279,107,497,133"><area shape=
"rect" href=
"namespaceBarry.html#1694e381d8f7c0a41714992c831e716b" title=
"Contains the proper way to convert a record object into a DBData object." alt=
"" coords=
"547,107,672,133"><area shape=
"rect" href=
"classBarry_1_1DBData.html#55d6bde680fe0b48d07882ade96ef9c3" title=
"Barry::DBData::SetDBName" alt=
"" coords=
"721,5,905,32"><area shape=
"rect" href=
"classBarry_1_1DBData.html#a46147fced1b122cb6a0e6d1cee3cb07" title=
"Barry::DBData::SetIds" alt=
"" coords=
"737,56,889,83"><area shape=
"rect" href=
"classBarry_1_1DBData.html#cb569139ee2d44442d4709ccf2a4ab3c" title=
"Barry::DBData::SetOffset" alt=
"" coords=
"729,107,897,133"><area shape=
"rect" href=
"classBarry_1_1DBData.html#d1a3e69cabea68e0a309459cd7c58e78" title=
"Barry::DBData::SetVersion" alt=
"" coords=
"725,157,901,184"><area shape=
"rect" href=
"classBarry_1_1DBData.html#3c1c4ad5ce85cef0ea85002a0fe07881" title=
"Barry::DBData::UseData" alt=
"" coords=
"732,208,895,235"></map>
253 <a class=
"anchor" name=
"a58d766db9692f978aa2a49736607dac"></a><!-- doxytag: member="Barry::RecordBuilder::EndOfFile" ref="a58d766db9692f978aa2a49736607dac" args="() const " -->
254 <div class=
"memitem">
255 <div class=
"memproto">
256 <div class=
"memtemplate">
257 template
<class RecordT, class StorageT
> </div>
258 <table class=
"memname">
260 <td class=
"memname">virtual bool
<a class=
"el" href=
"classBarry_1_1RecordBuilder.html">Barry::RecordBuilder
</a>< RecordT, StorageT
>::EndOfFile
</td>
262 <td class=
"paramname"> </td>
263 <td> )
</td>
264 <td> const
<code> [inline, virtual]
</code></td>
271 Sometimes a builder can have multiple databases stored in it, so when Build/Fetch returns false, check if there is more data with this function.
273 This function is not used by database-oriented functions, but by pipe- oriented functions.
274 <p>Implements
<a class=
"el" href=
"classBarry_1_1Builder.html#0ecfa5788ddee814a2071c82c5734691">Barry::Builder
</a>.
</p>
276 <p>Definition at line
<a class=
"el" href=
"builder_8h-source.html#l00224">224</a> of file
<a class=
"el" href=
"builder_8h-source.html">builder.h
</a>.
</p>
280 <hr>The documentation for this class was generated from the following file:
<ul>
281 <li><a class=
"el" href=
"builder_8h-source.html">builder.h
</a></ul>
283 <hr size=
"1"><address style=
"text-align: right;"><small>Generated on Thu Feb
10 16:
14:
36 2011 for Barry by
284 <a href=
"http://www.doxygen.org/index.html">
285 <img src=
"doxygen.png" alt=
"doxygen" align=
"middle" border=
"0"></a> 1.5.6 </small></address>