File: _field_map_8h_source.html

package info (click to toggle)
quickfix 1.13.3%2Bdfsg-9
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 152,548 kB
  • ctags: 679,426
  • sloc: cpp: 639,331; xml: 129,200; python: 108,722; ruby: 85,152; sh: 10,492; ansic: 9,025; java: 1,827; cs: 1,145; makefile: 523; sql: 313; perl: 108
file content (234 lines) | stat: -rw-r--r-- 35,909 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>QuickFIX: /home/omiller/Development/autobuild/quickfix/src/C++/FieldMap.h Source File</title>
<link href="quickfix.css" rel="stylesheet" type="text/css">
<table cellspacing="0" cellpadding="0" border="0">
  <tr>
   <td>
	<img src="images/QuickFIX.jpg" align="middle" border=0>
	&nbsp;&nbsp;
	<a href="index.html">Index</a>&nbsp;
	<a href="files.html">Source Files</a>&nbsp;
	<a href="annotated.html">Annotated Class List</a>&nbsp;
	<a href="classes.html">Alphabetical Class List</a>&nbsp;
	<a href="hierarchy.html">Class Hierarchy</a>&nbsp;
	<a href="inherits.html">Graphical Class Hierarchy</a>&nbsp;
   </td>
  </tr>
</table>
</head><body bgcolor="#ffffff">
<!-- Generated by Doxygen 1.6.1 -->
  <div class="navpath"><a class="el" href="dir_a9003438d6daff57482a26b22b6121a1.html">src</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_348ef16cf184025134029522e7f02883.html">C++</a>
  </div>
<div class="contents">
<h1>FieldMap.h</h1><a href="_field_map_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* -*- C++ -*- */</span>
<a name="l00002"></a>00002 
<a name="l00003"></a>00003 <span class="comment">/****************************************************************************</span>
<a name="l00004"></a>00004 <span class="comment">** Copyright (c) quickfixengine.org  All rights reserved.</span>
<a name="l00005"></a>00005 <span class="comment">**</span>
<a name="l00006"></a>00006 <span class="comment">** This file is part of the QuickFIX FIX Engine</span>
<a name="l00007"></a>00007 <span class="comment">**</span>
<a name="l00008"></a>00008 <span class="comment">** This file may be distributed under the terms of the quickfixengine.org</span>
<a name="l00009"></a>00009 <span class="comment">** license as defined by quickfixengine.org and appearing in the file</span>
<a name="l00010"></a>00010 <span class="comment">** LICENSE included in the packaging of this file.</span>
<a name="l00011"></a>00011 <span class="comment">**</span>
<a name="l00012"></a>00012 <span class="comment">** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE</span>
<a name="l00013"></a>00013 <span class="comment">** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.</span>
<a name="l00014"></a>00014 <span class="comment">**</span>
<a name="l00015"></a>00015 <span class="comment">** See http://www.quickfixengine.org/LICENSE for licensing information.</span>
<a name="l00016"></a>00016 <span class="comment">**</span>
<a name="l00017"></a>00017 <span class="comment">** Contact ask@quickfixengine.org if any conditions of this licensing are</span>
<a name="l00018"></a>00018 <span class="comment">** not clear to you.</span>
<a name="l00019"></a>00019 <span class="comment">**</span>
<a name="l00020"></a>00020 <span class="comment">****************************************************************************/</span>
<a name="l00021"></a>00021 
<a name="l00022"></a>00022 <span class="preprocessor">#ifndef FIX_FIELDMAP</span>
<a name="l00023"></a>00023 <span class="preprocessor"></span><span class="preprocessor">#define FIX_FIELDMAP</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span>
<a name="l00025"></a>00025 <span class="preprocessor">#ifdef _MSC_VER</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#pragma warning( disable: 4786 )</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span>
<a name="l00029"></a>00029 <span class="preprocessor">#include &quot;<a class="code" href="_field_8h.html">Field.h</a>&quot;</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include &quot;<a class="code" href="_message_sorters_8h.html">MessageSorters.h</a>&quot;</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include &quot;<a class="code" href="_exceptions_8h.html">Exceptions.h</a>&quot;</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include &quot;<a class="code" href="_call_stack_8h.html">CallStack.h</a>&quot;</span>
<a name="l00033"></a>00033 <span class="preprocessor">#include &quot;<a class="code" href="_utility_8h.html">Utility.h</a>&quot;</span>
<a name="l00034"></a>00034 <span class="preprocessor">#include &lt;map&gt;</span>
<a name="l00035"></a>00035 <span class="preprocessor">#include &lt;vector&gt;</span>
<a name="l00036"></a>00036 <span class="preprocessor">#include &lt;sstream&gt;</span>
<a name="l00037"></a>00037 <span class="preprocessor">#include &lt;algorithm&gt;</span>
<a name="l00038"></a>00038 
<a name="l00039"></a>00039 <span class="keyword">namespace </span>FIX
<a name="l00040"></a>00040 {
<a name="l00047"></a><a class="code" href="class_f_i_x_1_1_field_map.html">00047</a> <span class="keyword">class </span><a class="code" href="class_f_i_x_1_1_field_map.html" title="Stores and organizes a collection of Fields.">FieldMap</a>
<a name="l00048"></a>00048 {
<a name="l00049"></a>00049 <span class="keyword">public</span>:
<a name="l00050"></a>00050 <span class="preprocessor">#if defined(_MSC_VER) &amp;&amp; _MSC_VER &lt; 1300</span>
<a name="l00051"></a>00051 <span class="preprocessor"></span>  <span class="keyword">typedef</span> std::multimap &lt; int, FieldBase, message_order &gt; <a class="code" href="class_f_i_x_1_1_field_map.html#aa7da75e92fa648c523c5920e674b8d22">Fields</a>;
<a name="l00052"></a>00052   <span class="keyword">typedef</span> std::map &lt; int, std::vector &lt; FieldMap* &gt;, std::less&lt;int&gt; &gt; <a class="code" href="class_f_i_x_1_1_field_map.html#a69aab31c15b7458f1d347d8ad24cb287">Groups</a>;
<a name="l00053"></a>00053 <span class="preprocessor">#else</span>
<a name="l00054"></a>00054 <span class="preprocessor"></span>  <span class="keyword">typedef</span> std::multimap &lt; int, <a class="code" href="class_f_i_x_1_1_field_base.html" title="Base representation of all Field classes.">FieldBase</a>, <a class="code" href="struct_f_i_x_1_1message__order.html" title="Sorts fields in header, normal, or trailer order.">message_order</a>, 
<a name="l00055"></a><a class="code" href="class_f_i_x_1_1_field_map.html#aa7da75e92fa648c523c5920e674b8d22">00055</a>                           ALLOCATOR&lt;std::pair&lt;const int,FieldBase&gt; &gt; &gt; <a class="code" href="class_f_i_x_1_1_field_map.html#aa7da75e92fa648c523c5920e674b8d22">Fields</a>;
<a name="l00056"></a>00056   <span class="keyword">typedef</span> std::map &lt; int, std::vector &lt; FieldMap* &gt;, std::less&lt;int&gt;, 
<a name="l00057"></a><a class="code" href="class_f_i_x_1_1_field_map.html#a69aab31c15b7458f1d347d8ad24cb287">00057</a>                      ALLOCATOR&lt;std::pair&lt;const int, std::vector&lt; FieldMap* &gt; &gt; &gt; &gt; <a class="code" href="class_f_i_x_1_1_field_map.html#a69aab31c15b7458f1d347d8ad24cb287">Groups</a>;
<a name="l00058"></a>00058 <span class="preprocessor">#endif</span>
<a name="l00059"></a>00059 <span class="preprocessor"></span>
<a name="l00060"></a><a class="code" href="class_f_i_x_1_1_field_map.html#a072a7e7d8787ddfbbb2b0d602bdba1c0">00060</a>   <span class="keyword">typedef</span> Fields::const_iterator <a class="code" href="class_f_i_x_1_1_field_map.html#a072a7e7d8787ddfbbb2b0d602bdba1c0">iterator</a>;
<a name="l00061"></a><a class="code" href="class_f_i_x_1_1_field_map.html#ab6d0c1c03e877f96989c96390f34b84e">00061</a>   <span class="keyword">typedef</span> <a class="code" href="class_f_i_x_1_1_field_map.html#a072a7e7d8787ddfbbb2b0d602bdba1c0">iterator</a> <a class="code" href="class_f_i_x_1_1_field_map.html#ab6d0c1c03e877f96989c96390f34b84e">const_iterator</a>;
<a name="l00062"></a><a class="code" href="class_f_i_x_1_1_field_map.html#af198222f637572419a19c80af118a7e9">00062</a>   <span class="keyword">typedef</span> Groups::const_iterator <a class="code" href="class_f_i_x_1_1_field_map.html#af198222f637572419a19c80af118a7e9">g_iterator</a>;
<a name="l00063"></a><a class="code" href="class_f_i_x_1_1_field_map.html#a6bbfc911d6f2b9f5e91f97d7240eb670">00063</a>   <span class="keyword">typedef</span> Groups::const_iterator <a class="code" href="class_f_i_x_1_1_field_map.html#a6bbfc911d6f2b9f5e91f97d7240eb670">g_const_iterator</a>;
<a name="l00064"></a>00064 
<a name="l00065"></a><a class="code" href="class_f_i_x_1_1_field_map.html#a4de8b7fc6113f68bba8fd38a3c62fc84">00065</a>   <a class="code" href="class_f_i_x_1_1_field_map.html#a4de8b7fc6113f68bba8fd38a3c62fc84">FieldMap</a>( <span class="keyword">const</span> <a class="code" href="struct_f_i_x_1_1message__order.html" title="Sorts fields in header, normal, or trailer order.">message_order</a>&amp; order =
<a name="l00066"></a>00066             <a class="code" href="struct_f_i_x_1_1message__order.html" title="Sorts fields in header, normal, or trailer order.">message_order</a>( <a class="code" href="struct_f_i_x_1_1message__order.html#ab3b368e2f9ac89ffeeefaa2fc7ebbc38a04982cd220186887d26bb448b28e2b37">message_order::normal</a> ) )
<a name="l00067"></a>00067   : <a class="code" href="class_f_i_x_1_1_field_map.html#ae761e270bcb08c00196d6ea2e4383381">m_fields</a>( order ) {}
<a name="l00068"></a>00068 
<a name="l00069"></a><a class="code" href="class_f_i_x_1_1_field_map.html#aaa2ed7d45a6471c38555ad0943f56784">00069</a>   <a class="code" href="class_f_i_x_1_1_field_map.html#a4de8b7fc6113f68bba8fd38a3c62fc84">FieldMap</a>( <span class="keyword">const</span> <span class="keywordtype">int</span> order[] )
<a name="l00070"></a>00070   : <a class="code" href="class_f_i_x_1_1_field_map.html#ae761e270bcb08c00196d6ea2e4383381">m_fields</a>( <a class="code" href="struct_f_i_x_1_1message__order.html" title="Sorts fields in header, normal, or trailer order.">message_order</a>(order) ) {}
<a name="l00071"></a>00071 
<a name="l00072"></a><a class="code" href="class_f_i_x_1_1_field_map.html#a66d461b192dbc30313a71747f321885e">00072</a>   <a class="code" href="class_f_i_x_1_1_field_map.html#a4de8b7fc6113f68bba8fd38a3c62fc84">FieldMap</a>( <span class="keyword">const</span> <a class="code" href="class_f_i_x_1_1_field_map.html" title="Stores and organizes a collection of Fields.">FieldMap</a>&amp; copy )
<a name="l00073"></a>00073   { *<span class="keyword">this</span> = copy; }
<a name="l00074"></a>00074 
<a name="l00075"></a>00075   <span class="keyword">virtual</span> <a class="code" href="class_f_i_x_1_1_field_map.html#ac50582bc5542fc5c1456d698abe8fff1">~FieldMap</a>();
<a name="l00076"></a>00076 
<a name="l00077"></a>00077   <a class="code" href="class_f_i_x_1_1_field_map.html" title="Stores and organizes a collection of Fields.">FieldMap</a>&amp; <a class="code" href="class_f_i_x_1_1_field_map.html#ae2b789042f6c10d81205e5b669efbe23">operator=</a>( <span class="keyword">const</span> <a class="code" href="class_f_i_x_1_1_field_map.html" title="Stores and organizes a collection of Fields.">FieldMap</a>&amp; rhs );
<a name="l00078"></a>00078 
<a name="l00080"></a><a class="code" href="class_f_i_x_1_1_field_map.html#a0c122c1387b0333c1ea12298a63af3a5">00080</a>   <span class="keywordtype">void</span> <a class="code" href="class_f_i_x_1_1_field_map.html#a0c122c1387b0333c1ea12298a63af3a5" title="Set a field without type checking.">setField</a>( <span class="keyword">const</span> <a class="code" href="class_f_i_x_1_1_field_base.html" title="Base representation of all Field classes.">FieldBase</a>&amp; field, <span class="keywordtype">bool</span> overwrite = <span class="keyword">true</span> )
<a name="l00081"></a>00081   throw( <a class="code" href="struct_f_i_x_1_1_repeated_tag.html" title="Repeated tag not part of repeating group.">RepeatedTag</a> )
<a name="l00082"></a>00082   {
<a name="l00083"></a>00083     Fields::iterator i = <a class="code" href="class_f_i_x_1_1_field_map.html#ae761e270bcb08c00196d6ea2e4383381">m_fields</a>.find( field.<a class="code" href="class_f_i_x_1_1_field_base.html#a8dc3a427659ca40d08c6752dc3c03e01" title="Get the fields integer tag.">getField</a>() );
<a name="l00084"></a>00084     <span class="keywordflow">if</span>( i == <a class="code" href="class_f_i_x_1_1_field_map.html#ae761e270bcb08c00196d6ea2e4383381">m_fields</a>.end() )
<a name="l00085"></a>00085       <a class="code" href="class_f_i_x_1_1_field_map.html#ae761e270bcb08c00196d6ea2e4383381">m_fields</a>.insert( Fields::value_type( field.<a class="code" href="class_f_i_x_1_1_field_base.html#a8dc3a427659ca40d08c6752dc3c03e01" title="Get the fields integer tag.">getField</a>(), field ) );
<a name="l00086"></a>00086     <span class="keywordflow">else</span>
<a name="l00087"></a>00087     {
<a name="l00088"></a>00088       <span class="keywordflow">if</span>( overwrite )
<a name="l00089"></a>00089         i-&gt;second = field;
<a name="l00090"></a>00090       <span class="keywordflow">else</span>
<a name="l00091"></a>00091         <a class="code" href="class_f_i_x_1_1_field_map.html#ae761e270bcb08c00196d6ea2e4383381">m_fields</a>.insert( Fields::value_type( field.<a class="code" href="class_f_i_x_1_1_field_base.html#a8dc3a427659ca40d08c6752dc3c03e01" title="Get the fields integer tag.">getField</a>(), field ) );
<a name="l00092"></a>00092     }
<a name="l00093"></a>00093   }
<a name="l00095"></a><a class="code" href="class_f_i_x_1_1_field_map.html#a132a5fbf8aa1ebbca3d41d473a13ee35">00095</a>   <span class="keywordtype">void</span> <a class="code" href="class_f_i_x_1_1_field_map.html#a0c122c1387b0333c1ea12298a63af3a5" title="Set a field without type checking.">setField</a>( <span class="keywordtype">int</span> field, <span class="keyword">const</span> std::string&amp; value )
<a name="l00096"></a>00096   <span class="keywordflow">throw</span>( <a class="code" href="struct_f_i_x_1_1_repeated_tag.html" title="Repeated tag not part of repeating group.">RepeatedTag</a>, <a class="code" href="struct_f_i_x_1_1_no_tag_value.html" title="Field exists in message without a value.">NoTagValue</a> )
<a name="l00097"></a>00097   {
<a name="l00098"></a>00098     <a class="code" href="class_f_i_x_1_1_field_base.html" title="Base representation of all Field classes.">FieldBase</a> fieldBase( field, value );
<a name="l00099"></a>00099     <a class="code" href="class_f_i_x_1_1_field_map.html#a0c122c1387b0333c1ea12298a63af3a5" title="Set a field without type checking.">setField</a>( fieldBase );
<a name="l00100"></a>00100   }
<a name="l00101"></a>00101 
<a name="l00103"></a><a class="code" href="class_f_i_x_1_1_field_map.html#a9116cfc2e25ee379a08e7e10579fde44">00103</a>   <a class="code" href="class_f_i_x_1_1_field_base.html" title="Base representation of all Field classes.">FieldBase</a>&amp; <a class="code" href="class_f_i_x_1_1_field_map.html#a9116cfc2e25ee379a08e7e10579fde44" title="Get a field without type checking.">getField</a>( <a class="code" href="class_f_i_x_1_1_field_base.html" title="Base representation of all Field classes.">FieldBase</a>&amp; field )
<a name="l00104"></a>00104   <span class="keyword">const</span> <span class="keywordflow">throw</span>( <a class="code" href="struct_f_i_x_1_1_field_not_found.html" title="Field not found inside a message.">FieldNotFound</a> )
<a name="l00105"></a>00105   {
<a name="l00106"></a>00106     Fields::const_iterator iter = <a class="code" href="class_f_i_x_1_1_field_map.html#ae761e270bcb08c00196d6ea2e4383381">m_fields</a>.find( field.getField() );
<a name="l00107"></a>00107     <span class="keywordflow">if</span> ( iter == <a class="code" href="class_f_i_x_1_1_field_map.html#ae761e270bcb08c00196d6ea2e4383381">m_fields</a>.end() )
<a name="l00108"></a>00108       <span class="keywordflow">throw</span> <a class="code" href="struct_f_i_x_1_1_field_not_found.html" title="Field not found inside a message.">FieldNotFound</a>( field.getField() );
<a name="l00109"></a>00109     field = iter-&gt;second;
<a name="l00110"></a>00110     <span class="keywordflow">return</span> field;
<a name="l00111"></a>00111   }
<a name="l00112"></a>00112 
<a name="l00114"></a><a class="code" href="class_f_i_x_1_1_field_map.html#afcffab4d949d50c97971e6789e750408">00114</a>   <span class="keyword">const</span> std::string&amp; <a class="code" href="class_f_i_x_1_1_field_map.html#a9116cfc2e25ee379a08e7e10579fde44" title="Get a field without type checking.">getField</a>( <span class="keywordtype">int</span> field )
<a name="l00115"></a>00115   <span class="keyword">const</span> <span class="keywordflow">throw</span>( <a class="code" href="struct_f_i_x_1_1_field_not_found.html" title="Field not found inside a message.">FieldNotFound</a> )
<a name="l00116"></a>00116   {
<a name="l00117"></a>00117     <span class="keywordflow">return</span> <a class="code" href="class_f_i_x_1_1_field_map.html#afdad9dd2cb95032c32189fca614dcd92" title="Get direct access to a field through a reference.">getFieldRef</a>( field ).<a class="code" href="class_f_i_x_1_1_field_base.html#ab23b10cf8730f51aa42eedd0342641b6" title="Get the string representation of the fields value.">getString</a>();
<a name="l00118"></a>00118   }
<a name="l00119"></a>00119 
<a name="l00121"></a><a class="code" href="class_f_i_x_1_1_field_map.html#afdad9dd2cb95032c32189fca614dcd92">00121</a>   <span class="keyword">const</span> <a class="code" href="class_f_i_x_1_1_field_base.html" title="Base representation of all Field classes.">FieldBase</a>&amp; <a class="code" href="class_f_i_x_1_1_field_map.html#afdad9dd2cb95032c32189fca614dcd92" title="Get direct access to a field through a reference.">getFieldRef</a>( <span class="keywordtype">int</span> field )
<a name="l00122"></a>00122   <span class="keyword">const</span> <span class="keywordflow">throw</span>( <a class="code" href="struct_f_i_x_1_1_field_not_found.html" title="Field not found inside a message.">FieldNotFound</a> )
<a name="l00123"></a>00123   {
<a name="l00124"></a>00124     Fields::const_iterator iter = <a class="code" href="class_f_i_x_1_1_field_map.html#ae761e270bcb08c00196d6ea2e4383381">m_fields</a>.find( field );
<a name="l00125"></a>00125     <span class="keywordflow">if</span> ( iter == <a class="code" href="class_f_i_x_1_1_field_map.html#ae761e270bcb08c00196d6ea2e4383381">m_fields</a>.end() )
<a name="l00126"></a>00126       <span class="keywordflow">throw</span> <a class="code" href="struct_f_i_x_1_1_field_not_found.html" title="Field not found inside a message.">FieldNotFound</a>( field );
<a name="l00127"></a>00127     <span class="keywordflow">return</span> iter-&gt;second;
<a name="l00128"></a>00128   }
<a name="l00129"></a>00129 
<a name="l00131"></a><a class="code" href="class_f_i_x_1_1_field_map.html#a923b3abdb0590d24828df509d076782b">00131</a>   <span class="keyword">const</span> <a class="code" href="class_f_i_x_1_1_field_base.html" title="Base representation of all Field classes.">FieldBase</a>* <span class="keyword">const</span> <a class="code" href="class_f_i_x_1_1_field_map.html#a923b3abdb0590d24828df509d076782b" title="Get direct access to a field through a pointer.">getFieldPtr</a>( <span class="keywordtype">int</span> field )
<a name="l00132"></a>00132   <span class="keyword">const</span> <span class="keywordflow">throw</span>( <a class="code" href="struct_f_i_x_1_1_field_not_found.html" title="Field not found inside a message.">FieldNotFound</a> )
<a name="l00133"></a>00133   {
<a name="l00134"></a>00134     <span class="keywordflow">return</span> &amp;<a class="code" href="class_f_i_x_1_1_field_map.html#afdad9dd2cb95032c32189fca614dcd92" title="Get direct access to a field through a reference.">getFieldRef</a>( field );
<a name="l00135"></a>00135   }
<a name="l00136"></a>00136 
<a name="l00138"></a><a class="code" href="class_f_i_x_1_1_field_map.html#a0665413260d831ea096689393412ab41">00138</a>   <span class="keywordtype">bool</span> <a class="code" href="class_f_i_x_1_1_field_map.html#a0665413260d831ea096689393412ab41" title="Check to see if a field is set.">isSetField</a>( <span class="keyword">const</span> <a class="code" href="class_f_i_x_1_1_field_base.html" title="Base representation of all Field classes.">FieldBase</a>&amp; field )<span class="keyword"> const</span>
<a name="l00139"></a>00139 <span class="keyword">  </span>{ <span class="keywordflow">return</span> <a class="code" href="class_f_i_x_1_1_field_map.html#ae761e270bcb08c00196d6ea2e4383381">m_fields</a>.find( field.<a class="code" href="class_f_i_x_1_1_field_base.html#a8dc3a427659ca40d08c6752dc3c03e01" title="Get the fields integer tag.">getField</a>() ) != <a class="code" href="class_f_i_x_1_1_field_map.html#ae761e270bcb08c00196d6ea2e4383381">m_fields</a>.end(); }
<a name="l00141"></a><a class="code" href="class_f_i_x_1_1_field_map.html#abc2b5578f79eb2965943e7a6ce1876c3">00141</a>   <span class="keywordtype">bool</span> <a class="code" href="class_f_i_x_1_1_field_map.html#a0665413260d831ea096689393412ab41" title="Check to see if a field is set.">isSetField</a>( <span class="keywordtype">int</span> field )<span class="keyword"> const</span>
<a name="l00142"></a>00142 <span class="keyword">  </span>{ <span class="keywordflow">return</span> <a class="code" href="class_f_i_x_1_1_field_map.html#ae761e270bcb08c00196d6ea2e4383381">m_fields</a>.find( field ) != <a class="code" href="class_f_i_x_1_1_field_map.html#ae761e270bcb08c00196d6ea2e4383381">m_fields</a>.end(); }
<a name="l00143"></a>00143 
<a name="l00145"></a>00145   <span class="keywordtype">void</span> <a class="code" href="class_f_i_x_1_1_field_map.html#a6c6e0361d61975edc6c72c091fbf8b76" title="Remove a field. If field is not present, this is a no-op.">removeField</a>( <span class="keywordtype">int</span> field );
<a name="l00146"></a>00146 
<a name="l00148"></a>00148   <span class="keywordtype">void</span> <a class="code" href="class_f_i_x_1_1_field_map.html#a09f476a2bb2d98b8bcfcd5f75fe513e7" title="Add a group.">addGroup</a>( <span class="keywordtype">int</span> field, <span class="keyword">const</span> <a class="code" href="class_f_i_x_1_1_field_map.html" title="Stores and organizes a collection of Fields.">FieldMap</a>&amp; group, <span class="keywordtype">bool</span> setCount = <span class="keyword">true</span> );
<a name="l00149"></a>00149 
<a name="l00151"></a>00151   <span class="keywordtype">void</span> <a class="code" href="class_f_i_x_1_1_field_map.html#a69002f7c86605281858186433288518e" title="Replace a specific instanct of a group.">replaceGroup</a>( <span class="keywordtype">int</span> num, <span class="keywordtype">int</span> field, <a class="code" href="class_f_i_x_1_1_field_map.html" title="Stores and organizes a collection of Fields.">FieldMap</a>&amp; group );
<a name="l00152"></a>00152 
<a name="l00154"></a><a class="code" href="class_f_i_x_1_1_field_map.html#a70b3e277451479ceb72dbd649e17e706">00154</a>   <a class="code" href="class_f_i_x_1_1_field_map.html" title="Stores and organizes a collection of Fields.">FieldMap</a>&amp; <a class="code" href="class_f_i_x_1_1_field_map.html#a70b3e277451479ceb72dbd649e17e706" title="Get a specific instance of a group.">getGroup</a>( <span class="keywordtype">int</span> num, <span class="keywordtype">int</span> field, <a class="code" href="class_f_i_x_1_1_field_map.html" title="Stores and organizes a collection of Fields.">FieldMap</a>&amp; group ) <span class="keyword">const</span>
<a name="l00155"></a>00155   <span class="keywordflow">throw</span>( <a class="code" href="struct_f_i_x_1_1_field_not_found.html" title="Field not found inside a message.">FieldNotFound</a> )
<a name="l00156"></a>00156   {
<a name="l00157"></a>00157     <span class="keywordflow">return</span> group = <a class="code" href="class_f_i_x_1_1_field_map.html#a946c9f8d42b7e877e96f2a3e3e9d0bd6" title="Get direct access to a field through a reference.">getGroupRef</a>( num, field );
<a name="l00158"></a>00158   }
<a name="l00159"></a>00159 
<a name="l00161"></a><a class="code" href="class_f_i_x_1_1_field_map.html#a946c9f8d42b7e877e96f2a3e3e9d0bd6">00161</a>   <a class="code" href="class_f_i_x_1_1_field_map.html" title="Stores and organizes a collection of Fields.">FieldMap</a>&amp; <a class="code" href="class_f_i_x_1_1_field_map.html#a946c9f8d42b7e877e96f2a3e3e9d0bd6" title="Get direct access to a field through a reference.">getGroupRef</a>( <span class="keywordtype">int</span> num, <span class="keywordtype">int</span> field ) <span class="keyword">const</span>
<a name="l00162"></a>00162   <span class="keywordflow">throw</span>( <a class="code" href="struct_f_i_x_1_1_field_not_found.html" title="Field not found inside a message.">FieldNotFound</a> )
<a name="l00163"></a>00163   {
<a name="l00164"></a>00164     Groups::const_iterator i = <a class="code" href="class_f_i_x_1_1_field_map.html#a8d9c2cfe41c4fe6ced9e79a2cd976984">m_groups</a>.find( field );
<a name="l00165"></a>00165     <span class="keywordflow">if</span>( i == <a class="code" href="class_f_i_x_1_1_field_map.html#a8d9c2cfe41c4fe6ced9e79a2cd976984">m_groups</a>.end() ) <span class="keywordflow">throw</span> <a class="code" href="struct_f_i_x_1_1_field_not_found.html" title="Field not found inside a message.">FieldNotFound</a>( field );
<a name="l00166"></a>00166     <span class="keywordflow">if</span>( num &lt;= 0 ) <span class="keywordflow">throw</span> <a class="code" href="struct_f_i_x_1_1_field_not_found.html" title="Field not found inside a message.">FieldNotFound</a>( field );
<a name="l00167"></a>00167     <span class="keywordflow">if</span>( i-&gt;second.size() &lt; (unsigned)num ) <span class="keywordflow">throw</span> <a class="code" href="struct_f_i_x_1_1_field_not_found.html" title="Field not found inside a message.">FieldNotFound</a>( field );
<a name="l00168"></a>00168     <span class="keywordflow">return</span> *( *(i-&gt;second.begin() + (num-1) ) );
<a name="l00169"></a>00169   }
<a name="l00170"></a>00170 
<a name="l00172"></a><a class="code" href="class_f_i_x_1_1_field_map.html#acf913c70f5729831ca592b5bf1859772">00172</a>   <a class="code" href="class_f_i_x_1_1_field_map.html" title="Stores and organizes a collection of Fields.">FieldMap</a>* <a class="code" href="class_f_i_x_1_1_field_map.html#acf913c70f5729831ca592b5bf1859772" title="Get direct access to a field through a pointer.">getGroupPtr</a>( <span class="keywordtype">int</span> num, <span class="keywordtype">int</span> field ) <span class="keyword">const</span>
<a name="l00173"></a>00173   <span class="keywordflow">throw</span>( <a class="code" href="struct_f_i_x_1_1_field_not_found.html" title="Field not found inside a message.">FieldNotFound</a> )
<a name="l00174"></a>00174   {
<a name="l00175"></a>00175     <span class="keywordflow">return</span> &amp;<a class="code" href="class_f_i_x_1_1_field_map.html#a946c9f8d42b7e877e96f2a3e3e9d0bd6" title="Get direct access to a field through a reference.">getGroupRef</a>( num, field );
<a name="l00176"></a>00176   }
<a name="l00177"></a>00177 
<a name="l00179"></a>00179   <span class="keywordtype">void</span> <a class="code" href="class_f_i_x_1_1_field_map.html#a2e7a2cd14629310a34982acba5abd980" title="Remove a specific instance of a group.">removeGroup</a>( <span class="keywordtype">int</span> num, <span class="keywordtype">int</span> field );
<a name="l00181"></a>00181   <span class="keywordtype">void</span> <a class="code" href="class_f_i_x_1_1_field_map.html#a2e7a2cd14629310a34982acba5abd980" title="Remove a specific instance of a group.">removeGroup</a>( <span class="keywordtype">int</span> field );
<a name="l00182"></a>00182 
<a name="l00184"></a>00184   <span class="keywordtype">bool</span> <a class="code" href="class_f_i_x_1_1_field_map.html#a05176103542f9990dbadbd01356f0858" title="Check to see any instance of a group exists.">hasGroup</a>( <span class="keywordtype">int</span> field ) <span class="keyword">const</span>;
<a name="l00186"></a>00186   <span class="keywordtype">bool</span> <a class="code" href="class_f_i_x_1_1_field_map.html#a05176103542f9990dbadbd01356f0858" title="Check to see any instance of a group exists.">hasGroup</a>( <span class="keywordtype">int</span> num, <span class="keywordtype">int</span> field ) <span class="keyword">const</span>;
<a name="l00188"></a>00188   <span class="keywordtype">int</span> <a class="code" href="class_f_i_x_1_1_field_map.html#a04a0b0dc50314f1b66ca756498dc1af3" title="Count the number of instance of a group.">groupCount</a>( <span class="keywordtype">int</span> field ) <span class="keyword">const</span>;
<a name="l00189"></a>00189 
<a name="l00191"></a>00191   <span class="keywordtype">void</span> <a class="code" href="class_f_i_x_1_1_field_map.html#a8b6007fdb11b5788ca28563607d23074" title="Clear all fields from the map.">clear</a>();
<a name="l00193"></a>00193   <span class="keywordtype">bool</span> <a class="code" href="class_f_i_x_1_1_field_map.html#a32fa044c2ce1f97fb36766d03220c092" title="Check if map contains any fields.">isEmpty</a>();
<a name="l00194"></a>00194 
<a name="l00195"></a>00195   <span class="keywordtype">int</span> <a class="code" href="class_f_i_x_1_1_field_map.html#ab7f6638dbcbb7ebf2307afe6dd0fd108">totalFields</a>() <span class="keyword">const</span>;
<a name="l00196"></a>00196 
<a name="l00197"></a>00197   std::string&amp; <a class="code" href="class_f_i_x_1_1_field_map.html#aa556697b51d8e3c3f1463bfd2a4faec5">calculateString</a>( std::string&amp;, <span class="keywordtype">bool</span> <a class="code" href="class_f_i_x_1_1_field_map.html#a8b6007fdb11b5788ca28563607d23074" title="Clear all fields from the map.">clear</a> = <span class="keyword">true</span> ) <span class="keyword">const</span>;
<a name="l00198"></a>00198 
<a name="l00199"></a>00199   <span class="keywordtype">int</span> <a class="code" href="class_f_i_x_1_1_field_map.html#a096018489d885125f0d4915bc51b179c">calculateLength</a>( <span class="keywordtype">int</span> beginStringField = <a class="code" href="namespace_f_i_x_1_1_f_i_e_l_d.html#af7a28df11a59f1c290bcfe47c2367a33">FIELD::BeginString</a>,
<a name="l00200"></a>00200                        <span class="keywordtype">int</span> bodyLengthField = <a class="code" href="namespace_f_i_x_1_1_f_i_e_l_d.html#aac36b44ae2683cdf53dd263b82e735d1">FIELD::BodyLength</a>,
<a name="l00201"></a>00201                        <span class="keywordtype">int</span> checkSumField = <a class="code" href="namespace_f_i_x_1_1_f_i_e_l_d.html#a4076637b33d1478ac3a53338bc862512">FIELD::CheckSum</a> ) <span class="keyword">const</span>;
<a name="l00202"></a>00202 
<a name="l00203"></a>00203   <span class="keywordtype">int</span> <a class="code" href="class_f_i_x_1_1_field_map.html#a211a80980805f02930ec5429e333da3d">calculateTotal</a>( <span class="keywordtype">int</span> checkSumField = <a class="code" href="namespace_f_i_x_1_1_f_i_e_l_d.html#a4076637b33d1478ac3a53338bc862512">FIELD::CheckSum</a> ) <span class="keyword">const</span>;
<a name="l00204"></a>00204 
<a name="l00205"></a><a class="code" href="class_f_i_x_1_1_field_map.html#ae1172940d25b63494d9e2ec58744542f">00205</a>   <a class="code" href="class_f_i_x_1_1_field_map.html#a072a7e7d8787ddfbbb2b0d602bdba1c0">iterator</a> <a class="code" href="class_f_i_x_1_1_field_map.html#ae1172940d25b63494d9e2ec58744542f">begin</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="class_f_i_x_1_1_field_map.html#ae761e270bcb08c00196d6ea2e4383381">m_fields</a>.begin(); }
<a name="l00206"></a><a class="code" href="class_f_i_x_1_1_field_map.html#ab0cce8f78aa5aaacf0ebd88fb3c3c7e6">00206</a>   <a class="code" href="class_f_i_x_1_1_field_map.html#a072a7e7d8787ddfbbb2b0d602bdba1c0">iterator</a> <a class="code" href="class_f_i_x_1_1_field_map.html#ab0cce8f78aa5aaacf0ebd88fb3c3c7e6">end</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="class_f_i_x_1_1_field_map.html#ae761e270bcb08c00196d6ea2e4383381">m_fields</a>.end(); }
<a name="l00207"></a><a class="code" href="class_f_i_x_1_1_field_map.html#ab0c424222d4cb4078e2ac5831647368c">00207</a>   <a class="code" href="class_f_i_x_1_1_field_map.html#af198222f637572419a19c80af118a7e9">g_iterator</a> <a class="code" href="class_f_i_x_1_1_field_map.html#ab0c424222d4cb4078e2ac5831647368c">g_begin</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="class_f_i_x_1_1_field_map.html#a8d9c2cfe41c4fe6ced9e79a2cd976984">m_groups</a>.begin(); }
<a name="l00208"></a><a class="code" href="class_f_i_x_1_1_field_map.html#a1801e794f65e703b0bc1c54ef4ef49bc">00208</a>   <a class="code" href="class_f_i_x_1_1_field_map.html#af198222f637572419a19c80af118a7e9">g_iterator</a> <a class="code" href="class_f_i_x_1_1_field_map.html#a1801e794f65e703b0bc1c54ef4ef49bc">g_end</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="class_f_i_x_1_1_field_map.html#a8d9c2cfe41c4fe6ced9e79a2cd976984">m_groups</a>.end(); }
<a name="l00209"></a>00209 
<a name="l00210"></a>00210 <span class="keyword">private</span>:
<a name="l00211"></a><a class="code" href="class_f_i_x_1_1_field_map.html#ae761e270bcb08c00196d6ea2e4383381">00211</a>   <a class="code" href="class_f_i_x_1_1_field_map.html#aa7da75e92fa648c523c5920e674b8d22">Fields</a> <a class="code" href="class_f_i_x_1_1_field_map.html#ae761e270bcb08c00196d6ea2e4383381">m_fields</a>;
<a name="l00212"></a><a class="code" href="class_f_i_x_1_1_field_map.html#a8d9c2cfe41c4fe6ced9e79a2cd976984">00212</a>   <a class="code" href="class_f_i_x_1_1_field_map.html#a69aab31c15b7458f1d347d8ad24cb287">Groups</a> <a class="code" href="class_f_i_x_1_1_field_map.html#a8d9c2cfe41c4fe6ced9e79a2cd976984">m_groups</a>;
<a name="l00213"></a>00213 };
<a name="l00215"></a>00215 }
<a name="l00216"></a>00216 
<a name="l00217"></a><a class="code" href="_field_map_8h.html#af8cad35e4072a0be777dcb5261ee01f6">00217</a> <span class="preprocessor">#define FIELD_SET( MAP, FIELD )           \</span>
<a name="l00218"></a>00218 <span class="preprocessor">bool isSet( const FIELD&amp; field ) const    \</span>
<a name="l00219"></a>00219 <span class="preprocessor">{ return (MAP).isSetField(field); }       \</span>
<a name="l00220"></a>00220 <span class="preprocessor">void set( const FIELD&amp; field )            \</span>
<a name="l00221"></a>00221 <span class="preprocessor">{ (MAP).setField(field); }                \</span>
<a name="l00222"></a>00222 <span class="preprocessor">FIELD&amp; get( FIELD&amp; field ) const          \</span>
<a name="l00223"></a>00223 <span class="preprocessor">{ return (FIELD&amp;)(MAP).getField(field); }</span>
<a name="l00224"></a>00224 <span class="preprocessor"></span>
<a name="l00225"></a><a class="code" href="_field_map_8h.html#aaa5734b75ad42468e54939cc5477dd5e">00225</a> <span class="preprocessor">#define FIELD_GET_PTR( MAP, FLD ) \</span>
<a name="l00226"></a>00226 <span class="preprocessor">(const FIX::FLD*)MAP.getFieldPtr( FIX::FIELD::FLD )</span>
<a name="l00227"></a><a class="code" href="_field_map_8h.html#a359e720795a7652bd2d1a4fb9d3b9aef">00227</a> <span class="preprocessor"></span><span class="preprocessor">#define FIELD_GET_REF( MAP, FLD ) \</span>
<a name="l00228"></a>00228 <span class="preprocessor">(const FIX::FLD&amp;)MAP.getFieldRef( FIX::FIELD::FLD )</span>
<a name="l00229"></a>00229 <span class="preprocessor"></span>
<a name="l00230"></a>00230 <span class="preprocessor">#endif //FIX_FIELDMAP</span>
<a name="l00231"></a>00231 <span class="preprocessor"></span>
</pre></div></div>
<hr><address><small>
Generated on Mon Apr 5 20:59:50 2010 for QuickFIX by <a href="http://www.doxygen.org/index.html">
<img src="doxygen.gif" alt="doxygen" align="middle" border=0 width=110 height=53>
</a> 1.6.1 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>,
 &copy;&nbsp;1997-2001</small></address>
</body>
</html>