fix8  version 1.4.0
Open Source C++ FIX Framework
f8cstatic.hpp
Go to the documentation of this file.
1 //-------------------------------------------------------------------------------------------------
2 /*
3 
4 Fix8 is released under the GNU LESSER GENERAL PUBLIC LICENSE Version 3.
5 
6 Fix8 Open Source FIX Engine.
7 Copyright (C) 2010-16 David L. Dight <fix@fix8.org>
8 
9 Fix8 is free software: you can redistribute it and / or modify it under the terms of the
10 GNU Lesser General Public License as published by the Free Software Foundation, either
11 version 3 of the License, or (at your option) any later version.
12 
13 Fix8 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
14 even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 
16 You should have received a copy of the GNU Lesser General Public License along with Fix8.
17 If not, see <http://www.gnu.org/licenses/>.
18 
19 BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO
20 THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE
21 COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY
22 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO
24 THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE,
25 YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
26 
27 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT
28 HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED
29 ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
30 CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
31 NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR
32 THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH
33 HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
34 
35 */
36 //-------------------------------------------------------------------------------------------------
37 namespace FIX8 {
38 
39 //-------------------------------------------------------------------------------------------------
41 {
42  {"INT", FieldTrait::ft_int},
43  {"LENGTH", FieldTrait::ft_Length},
44  {"TAGNUM", FieldTrait::ft_TagNum},
45  {"SEQNUM", FieldTrait::ft_SeqNum},
46  {"NUMINGROUP", FieldTrait::ft_NumInGroup},
47  {"DAYOFMONTH", FieldTrait::ft_DayOfMonth},
48  {"FLOAT", FieldTrait::ft_float},
49  {"QTY", FieldTrait::ft_Qty},
50  {"QUANTITY", FieldTrait::ft_Qty},
51  {"PRICE", FieldTrait::ft_Price},
52  {"PRICEOFFSET", FieldTrait::ft_PriceOffset},
53  {"AMT", FieldTrait::ft_Amt},
54  {"PERCENTAGE", FieldTrait::ft_Percentage},
55  {"CHAR", FieldTrait::ft_char},
56  {"BOOLEAN", FieldTrait::ft_Boolean},
57  {"STRING", FieldTrait::ft_string},
58  {"MULTIPLEVALUECHAR", FieldTrait::ft_MultipleCharValue},
59  {"MULTIPLECHARVALUE", FieldTrait::ft_MultipleCharValue},
60  {"MULTIPLESTRINGVALUE", FieldTrait::ft_MultipleStringValue},
61  {"MULTIPLEVALUESTRING", FieldTrait::ft_MultipleStringValue},
62  {"COUNTRY", FieldTrait::ft_Country},
63  {"CURRENCY", FieldTrait::ft_Currency},
64  {"EXCHANGE", FieldTrait::ft_Exchange},
65  {"MONTHYEAR", FieldTrait::ft_MonthYear},
66  {"UTCTIMESTAMP", FieldTrait::ft_UTCTimestamp},
67  {"UTCTIME", FieldTrait::ft_UTCTimeOnly},
68  {"UTCTIMEONLY", FieldTrait::ft_UTCTimeOnly},
69  {"UTCDATE", FieldTrait::ft_UTCDateOnly},
70  {"UTCDATEONLY", FieldTrait::ft_UTCDateOnly},
71  {"LOCALMKTDATE", FieldTrait::ft_LocalMktDate},
72  {"TZTIMEONLY", FieldTrait::ft_TZTimeOnly},
73  {"TZTIMESTAMP", FieldTrait::ft_TZTimestamp},
74  {"XMLDATA", FieldTrait::ft_XMLData},
75  {"DATA", FieldTrait::ft_data},
76  {"PATTERN", FieldTrait::ft_pattern},
77  {"LANGUAGE", FieldTrait::ft_Language},
78  {"TENOR", FieldTrait::ft_Tenor},
79  {"RESERVED100PLUS", FieldTrait::ft_Reserved100Plus},
80  {"RESERVED1000PLUS", FieldTrait::ft_Reserved1000Plus},
81  {"RESERVED4000PLUS", FieldTrait::ft_Reserved4000Plus}
82 };
83 
84 //-------------------------------------------------------------------------------------------------
86 {
87  { FieldTrait::ft_int, { "int", "ft_int" } },
88  { FieldTrait::ft_Length, { "Length", "ft_Length" } },
89  { FieldTrait::ft_TagNum, { "TagNum", "ft_TagNum" } },
90  { FieldTrait::ft_SeqNum, { "SeqNum", "ft_SeqNum" } },
91  { FieldTrait::ft_NumInGroup, { "NumInGroup", "ft_NumInGroup" } },
92  { FieldTrait::ft_DayOfMonth, { "DayOfMonth", "ft_DayOfMonth" } },
93  { FieldTrait::ft_float, { "fp_type", "ft_float" } }, // either float or double
94  { FieldTrait::ft_Qty, { "Qty", "ft_Qty" } },
95  { FieldTrait::ft_Price, { "price", "ft_Price" } },
96  { FieldTrait::ft_PriceOffset, { "PriceOffset", "ft_PriceOffset" } },
97  { FieldTrait::ft_Amt, { "Amt", "ft_Amt" } },
98  { FieldTrait::ft_Percentage, { "Percentage", "ft_Percentage" } },
99  { FieldTrait::ft_char, { "char", "ft_char" } },
100  { FieldTrait::ft_Boolean, { "Boolean", "ft_Boolean" } },
101  { FieldTrait::ft_string, { "f8String", "ft_string" } },
102  { FieldTrait::ft_MultipleCharValue, { "MultipleCharValue", "ft_MultipleCharValue" } },
103  { FieldTrait::ft_MultipleStringValue, { "MultipleStringValue", "ft_MultipleStringValue" } },
104  { FieldTrait::ft_Country, { "country", "ft_Country" } },
105  { FieldTrait::ft_Currency, { "currency", "ft_Currency" } },
106  { FieldTrait::ft_Exchange, { "Exchange", "ft_Exchange" } },
107  { FieldTrait::ft_MonthYear, { "MonthYear", "ft_MonthYear" } },
108  { FieldTrait::ft_UTCTimestamp, { "UTCTimestamp", "ft_UTCTimestamp" } },
109  { FieldTrait::ft_UTCTimeOnly, { "UTCTimeOnly", "ft_UTCTimeOnly" } },
110  { FieldTrait::ft_UTCDateOnly, { "UTCDateOnly", "ft_UTCDateOnly" } },
111  { FieldTrait::ft_LocalMktDate, { "LocalMktDate", "ft_LocalMktDate" } },
112  { FieldTrait::ft_TZTimeOnly, { "TZTimeOnly", "ft_TZTimeOnly" } },
113  { FieldTrait::ft_TZTimestamp, { "TZTimestamp", "ft_TZTimestamp" } },
114  { FieldTrait::ft_XMLData, { "XMLData", "ft_XMLData" } },
115  { FieldTrait::ft_data, { "data", "ft_data" } },
116  { FieldTrait::ft_pattern, { "pattern", "ft_pattern" } },
117  { FieldTrait::ft_Tenor, { "Tenor", "ft_Tenor" } },
118  { FieldTrait::ft_Reserved100Plus, { "f8String", "ft_Reserved100Plus" } },
119  { FieldTrait::ft_Reserved1000Plus, { "f8String", "ft_Reserved1000Plus" } },
120  { FieldTrait::ft_Reserved4000Plus, { "f8String", "ft_Reserved4000Plus" } },
121  { FieldTrait::ft_Language, { "Language", "ft_Language" } },
122 };
123 
124 //-------------------------------------------------------------------------------------------------
125 const CSMap _csMap
126 {
127  { cs_do_not_edit, "// *** f8c generated file: DO NOT EDIT! Created: "},
128  { cs_start_namespace, "namespace FIX8 {"},
129  { cs_end_namespace, "} // namespace FIX8"},
130  { cs_start_anon_namespace, "namespace {"},
131  { cs_end_anon_namespace, "} // namespace"},
133 "#include <iostream>\n"
134 "#include <fstream>\n"
135 "#include <iomanip>\n"
136 "#include <sstream>\n"
137 "#include <vector>\n"
138 "#include <map>\n"
139 "#include <list>\n"
140 "#include <set>\n"
141 "#include <iterator>\n"
142 "#include <algorithm>\n"
143 "#include <cerrno>\n"
144 "#include <string.h>"},
145  { cs_divider,
146 "//-------------------------------------------------------------------------------------------------"},
147 { cs_copyright,
148 "/*\n"
149 "\n"
150 "Fix8 is released under the GNU LESSER GENERAL PUBLIC LICENSE Version 3.\n"
151 "\n"
152 "Fix8 Open Source FIX Engine.\n"
153 "Copyright (C) 2010-"},
154 { cs_copyright2,
155 " David L. Dight <fix@fix8.org>\n"
156 "\n"
157 "Fix8 is free software: you can redistribute it and / or modify it under the terms of the\n"
158 "GNU Lesser General Public License as published by the Free Software Foundation, either\n"
159 "version 3 of the License, or (at your option) any later version.\n"
160 "\n"
161 "Fix8 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without\n"
162 "even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
163 "\n"
164 "You should have received a copy of the GNU Lesser General Public License along with Fix8.\n"
165 "If not, see <http://www.gnu.org/licenses/>.\n"
166 "\n"
167 "*******************************************************************************************\n"
168 "* Special note for Fix8 compiler generated source code *\n"
169 "* *\n"
170 "* Binary works that are the results of compilation of code that is generated by the Fix8 *\n"
171 "* compiler can be released without releasing your source code as long as your binary *\n"
172 "* links dynamically against an unmodified version of the Fix8 library. You are however *\n"
173 "* required to leave the copyright text in the generated code. *\n"
174 "* *\n"
175 "*******************************************************************************************\n"
176 "\n"
177 "BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO\n"
178 "THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE\n"
179 "COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY\n"
180 "KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n"
181 "WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO\n"
182 "THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE,\n"
183 "YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n"
184 "\n"
185 "IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT\n"
186 "HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED\n"
187 "ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\n"
188 "CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT\n"
189 "NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR\n"
190 "THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH\n"
191 "HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\n"
192 "\n"
193 "*/\n"},
195 " begin_string *get_begin_string() { return _begin_string; };\n"
196 " body_length *get_body_length() { return _body_length; };\n"
197 " msg_type *get_msg_type() { return _msg_type; };\n\n"
198 " void add_preamble()\n"
199 " {\n"
200 " add_field(Common_BeginString, 1, _begin_string, false);\n"
201 " add_field(Common_BodyLength, 2, _body_length, false);\n"
202 " add_field(Common_MsgType, 3, _msg_type, false);\n"
203 " }"},
205 " check_sum *get_check_sum() { return _check_sum; };\n\n"
206 " void add_preamble()\n"
207 " {\n"
208 " add_field(Common_CheckSum, 3, _check_sum, false);\n"
209 " }"},
210 };
211 
212 } // namespace FIX8
213 //-------------------------------------------------------------------------------------------------
const CSMap _csMap
Definition: f8cstatic.hpp:126
static const TypeToCPP _typeToCPP
Definition: f8c.hpp:130
std::map< comp_str, std::string > CSMap
Definition: f8c.hpp:201
std::map< FieldTrait::FieldType, std::pair< std::string, std::string >> TypeToCPP
Definition: f8c.hpp:124
static const BaseTypeMap _baseTypeMap
Definition: f8c.hpp:129
std::map< std::string, FieldTrait::FieldType > BaseTypeMap
Definition: f8c.hpp:123