930 ostream& ost_cpp(*ctxt.
_out[Ctxt::types_cpp].second);
931 ostream& ost_hpp(*ctxt.
_out[Ctxt::types_hpp].second);
932 ostream& osr_cpp(*ctxt.
_out[Ctxt::traits_cpp].second);
933 ostream& osc_hpp(*ctxt.
_out[Ctxt::classes_hpp].second);
934 ostream& osc_cpp(*ctxt.
_out[Ctxt::classes_cpp].second);
935 ostream& osu_hpp(*ctxt.
_out[Ctxt::router_hpp].second);
936 ostream& oss_hpp(*ctxt.
_out[Ctxt::session_hpp].second);
945 cout << fields <<
" fields defined" << endl;
950 for (
const auto& pp : fspec)
951 ftonSpec.insert({pp.second._name, pp.first});
955 xf.
find(
"fix/components/component", comlist);
961 int msgsloaded(
load_messages(xf, mspec, ftonSpec, fspec, components, globmap));
966 cout << msgsloaded <<
" messages defined" << endl;
967 if (components.size())
968 cout << components.size() <<
" components defined" << endl;
971 unsigned cgs(0), ugs(0), vars(0);
972 for (
const auto& pp : globmap)
974 vars +=
static_cast<unsigned>(pp.second.size());
975 for (
const auto& ii : pp.second)
977 if (ii.second._group_refcnt > 1)
978 ugs += ii.second._group_refcnt;
983 cout << globmap.size() <<
" repeating group catagories (" << vars <<
" variants, "
984 << ugs <<
" common, " << cgs <<
" unique) processed" << endl;
993 osu_hpp <<
"#ifndef " <<
bintoaschex(ctxt.
_out[Ctxt::router_hpp].first.second) << endl;
994 osu_hpp <<
"#define " <<
bintoaschex(ctxt.
_out[Ctxt::router_hpp].first.second) << endl << endl;
996 osu_hpp <<
"namespace " << ctxt.
_fixns <<
" {" << endl;
1000 osc_hpp <<
"#ifndef " <<
bintoaschex(ctxt.
_out[Ctxt::classes_hpp].first.second) << endl;
1001 osc_hpp <<
"#define " <<
bintoaschex(ctxt.
_out[Ctxt::classes_hpp].first.second) << endl << endl;
1004 osc_hpp << endl <<
"extern \"C\"" << endl <<
'{' << endl
1005 <<
spacer <<
"F8_" << ctxt.
_fixns <<
"_API const F8MetaCntx& " << ctxt.
_fixns <<
"_ctx();" << endl <<
'}' << endl << endl;
1006 osc_hpp <<
"namespace " << ctxt.
_fixns <<
" {" << endl;
1009 osc_hpp <<
"using " << ctxt.
_clname <<
"_BaseMsgEntry = MsgTable;" << endl;
1010 osc_hpp <<
"/// Compiler generated metadata object, accessed through this function." << endl;
1011 osc_hpp <<
"F8_" << ctxt.
_fixns <<
"_API " <<
"const F8MetaCntx& ctx();" << endl;
1012 osc_hpp <<
"class " << ctxt.
_clname <<
"_Router;" << endl;
1018 osc_cpp <<
"#include \"" << ctxt.
_out[Ctxt::types_hpp].first.second <<
'"' << endl;
1019 osc_cpp <<
"#include \"" << ctxt.
_out[Ctxt::router_hpp].first.second <<
'"' << endl;
1020 osc_cpp <<
"#include \"" << ctxt.
_out[Ctxt::classes_hpp].first.second <<
'"' << endl;
1023 osc_cpp <<
"namespace " << ctxt.
_fixns <<
" {" << endl << endl;
1030 osr_cpp <<
"#include \"" << ctxt.
_out[Ctxt::types_hpp].first.second <<
'"' << endl;
1031 osr_cpp <<
"#include \"" << ctxt.
_out[Ctxt::router_hpp].first.second <<
'"' << endl;
1032 osr_cpp <<
"#include \"" << ctxt.
_out[Ctxt::classes_hpp].first.second <<
'"' << endl;
1035 osr_cpp <<
"namespace " << ctxt.
_fixns <<
" {" << endl << endl;
1043 osr_cpp <<
"// Common group traits" << endl;
1044 osr_cpp <<
"namespace {" << endl;
1046 osr_cpp <<
"} // namespace" << endl << endl;
1048 #if defined FIX8_HAVE_EXTENDED_METADATA
1051 osr_cpp <<
"//" << endl;
1052 osr_cpp <<
"// Shared groups disabled (--noshared). Static traits are now exposed." << endl;
1053 osr_cpp <<
"//" << endl;
1057 osr_cpp <<
"// Message traits" << endl;
1059 FieldSpecMap::const_iterator fsitr(fspec.find(35));
1060 for (
const auto& pp : mspec)
1062 bool isTrailer(pp.second._name ==
"trailer");
1063 bool isHeader(pp.second._name ==
"header");
1064 osc_hpp <<
"/// " << pp.second._name <<
" (" << pp.first <<
"), "
1065 << (pp.second._is_admin ?
"admin" :
"application")
1066 <<
", " << pp.second._fields.get_presence().size() <<
" fiel"
1067 << (pp.second._fields.get_presence().size() == 1 ?
"d, " :
"ds, ")
1068 << pp.second._groups.size() <<
" grou" << (pp.second._groups.size() == 1 ?
"p." :
"ps.");
1069 if (!pp.second._comment.empty())
1070 osc_hpp <<
' ' << pp.second._comment;
1072 osc_hpp <<
"class " << pp.second._name <<
" : public "
1073 << (isTrailer || isHeader ?
"MessageBase" :
"Message") << endl <<
'{' << endl;
1075 if (pp.second._fields.get_presence().size())
1078 osr_cpp <<
"const FieldTrait " << pp.second._name <<
"::_traits[]"
1079 << endl <<
'{' << endl;
1082 flitr != pp.second._fields.get_presence().end(); ++flitr, ++felpos)
1085 if (flitr != pp.second._fields.get_presence().begin())
1088 if (felpos % 4 == 0)
1094 ostringstream tostr;
1095 tostr <<
"0x" << setfill(
'0') << setw(2) << hex << flitr->_field_traits.get();
1096 osr_cpp << (spaceme ?
spacer :
" ");
1097 osr_cpp <<
'{' << setw(4) << right << flitr->_fnum <<
','
1098 << setw(2) << right << flitr->_ftype <<
',' << setw(3) << right
1099 << flitr->_pos <<
',' << setw(3) << right << flitr->_component <<
',' << tostr.str();
1100 #if defined FIX8_HAVE_EXTENDED_METADATA
1104 FieldSpecMap::const_iterator gsitr(fspec.find(flitr->_fnum));
1105 osr_cpp << gsitr->second._name <<
"::get_traits(), " << gsitr->second._name <<
"::get_fieldcnt()";
1106 osr_cpp << endl << spacer <<
'}';
1113 osr_cpp << endl <<
"};" << endl;
1114 osr_cpp <<
"const FieldTrait_Hash_Array " << pp.second._name <<
"::_ftha(" << pp.second._name <<
"::_traits, "
1115 << pp.second._name <<
"::_fieldcnt);" << endl;
1116 osr_cpp <<
"const MsgType " << pp.second._name <<
"::_msgtype(\"" << pp.first <<
"\");" << endl;
1117 osc_hpp <<
spacer <<
"static F8_" << ctxt.
_fixns <<
"_API const FieldTrait _traits[];" << endl;
1118 osc_hpp <<
spacer <<
"static F8_" << ctxt.
_fixns <<
"_API const FieldTrait_Hash_Array _ftha; " << endl;
1119 osc_hpp <<
spacer <<
"static F8_" << ctxt.
_fixns <<
"_API const MsgType _msgtype;" << endl;
1120 osc_hpp <<
spacer <<
"static F8_" << ctxt.
_fixns <<
"_API const unsigned _fieldcnt = " << pp.second._fields.get_presence().size() <<
';' << endl;
1125 osc_hpp << endl <<
spacer <<
"begin_string *_begin_string;" << endl;
1126 osc_hpp <<
spacer <<
"body_length *_body_length;" << endl;
1127 osc_hpp <<
spacer <<
"msg_type *_msg_type;" << endl;
1130 osc_hpp << endl <<
spacer <<
"check_sum *_check_sum;" << endl;
1134 osc_hpp <<
"public:" << endl;
1135 osc_hpp <<
spacer <<
"explicit " << pp.second._name <<
"(bool deepctor=true)";
1136 if (pp.second._fields.get_presence().size())
1137 osc_hpp <<
" : " << (isTrailer || isHeader ?
"MessageBase" :
"Message")
1138 <<
"(ctx(), _msgtype(), _traits, _fieldcnt, &_ftha)";
1139 if (isHeader || isTrailer)
1143 osc_hpp <<
"_begin_string(new begin_string(ctx()._beginStr)), _body_length(new body_length), _msg_type(new msg_type)";
1145 osc_hpp <<
"_check_sum(new check_sum)";
1146 osc_hpp <<
" { add_preamble(); }" << endl;
1148 else if (!pp.second._groups.empty())
1150 osc_hpp << endl << spacer <<
'{' << endl;
1151 osc_hpp << spacer << spacer <<
"if (deepctor)" << endl;
1152 osc_hpp << spacer << spacer << spacer <<
"_groups.insert({";
1153 if (pp.second._groups.size() == 1)
1154 osc_hpp << pp.second._groups.begin()->first <<
", new " << pp.second._groups.begin()->second._name <<
" });" << endl;
1158 for (
const auto& ii : pp.second._groups)
1160 FieldSpecMap::const_iterator gsitr(fspec.find(ii.first));
1161 osc_hpp << spacer << spacer << spacer << spacer <<
"{ " << gsitr->first <<
", new " << gsitr->second._name <<
" }," << endl;
1163 osc_hpp << spacer << spacer << spacer <<
"});" << endl;
1165 osc_hpp << spacer <<
'}' << endl;
1168 osc_hpp <<
" {}" << endl;
1170 osc_hpp << spacer <<
"~" << pp.second._name <<
"() = default;" << endl;
1171 if (!isHeader && !isTrailer)
1173 osc_hpp << spacer <<
"bool process(Router& rt) const { return (static_cast<" << ctxt.
_clname <<
"_Router&>(rt))(this); }" << endl;
1174 if (pp.second._is_admin)
1175 osc_hpp << spacer <<
"bool is_admin() const { return true; }" << endl;
1178 osc_hpp << endl << spacer <<
"static const " << fsitr->second._name <<
"& get_msgtype() { return _msgtype; }" << endl;
1179 #if defined FIX8_HAVE_EXTENDED_METADATA
1180 osc_hpp << spacer <<
"static const FieldTrait *get_traits() { return _traits; };" << endl;
1181 osc_hpp << spacer <<
"static const unsigned get_fieldcnt() { return _fieldcnt; };" << endl;
1193 osc_hpp <<
"};" << endl << endl;
1201 osc_cpp <<
"const char *cn[] // Component names" << endl <<
'{' << endl;
1202 osc_cpp << spacer <<
"\"\"," << endl;
1203 for (Components::iterator citr(components.begin()); citr != components.end(); ++citr)
1204 osc_cpp << spacer <<
'"' << citr->first <<
"\", // " << (1 + distance(components.begin(), citr)) << endl;
1205 osc_cpp <<
"};" << endl;
1210 osc_cpp <<
"const " << ctxt.
_fixns <<
"::" << ctxt.
_clname <<
"_BaseMsgEntry::Pair "
1211 <<
"msgpairs[] " << endl <<
'{' << endl;
1212 for (MessageSpecMap::const_iterator mitr(mspec.begin()); mitr != mspec.end(); ++mitr)
1214 if (mitr != mspec.begin())
1215 osc_cpp <<
',' << endl;
1216 osc_cpp << spacer <<
"{ \"" << mitr->first <<
"\", { ";
1217 if (mitr->second._name ==
"trailer" || mitr->second._name ==
"header")
1218 osc_cpp <<
"Type2Type<" << ctxt.
_fixns <<
"::" << mitr->second._name <<
", bool>()";
1220 osc_cpp <<
"Type2Type<" << ctxt.
_fixns <<
"::" << mitr->second._name <<
">()";
1221 osc_cpp <<
", \"" << mitr->second._name <<
'"';
1222 if (!mitr->second._comment.empty())
1223 osc_cpp <<
',' << endl << spacer << spacer <<
'"' << mitr->second._comment <<
"\" }";
1228 osc_cpp << endl <<
"}; // " << mspec.size() << endl;
1230 size_t fields_generated(0);
1231 for (
const auto& pp : fspec)
1235 osc_cpp << endl <<
"extern const " << ctxt.
_clname <<
"_BaseEntry::Pair fldpairs[];" << endl << endl
1236 <<
"/// Compiler generated metadata object, accessed through this function." << endl
1237 <<
"const F8MetaCntx& ctx() // avoid SIOF" << endl <<
'{' << endl
1238 << spacer <<
"static const " << ctxt.
_clname <<
"_BaseMsgEntry "
1239 <<
"bme(msgpairs, " << mspec.size() <<
");" << endl
1240 << spacer <<
"static const " << ctxt.
_clname <<
"_BaseEntry "
1241 <<
"be(fldpairs, " << fields_generated <<
");" << endl
1242 << spacer <<
"static const F8MetaCntx _ctx(" << ctxt.
_version <<
", bme, be, cn, \"" << ctxt.
_beginstr <<
"\");" << endl
1243 << spacer <<
"return _ctx;" << endl <<
'}' << endl;
1244 osc_cpp << endl <<
"} // namespace " << ctxt.
_fixns << endl;
1248 osu_hpp <<
"class " << ctxt.
_clname <<
"_Router : public Router" << endl
1249 <<
'{' << endl <<
"public:" << endl;
1250 osu_hpp << spacer << ctxt.
_clname <<
"_Router() {}" << endl;
1251 osu_hpp << spacer <<
"virtual ~" << ctxt.
_clname <<
"_Router() {}" << endl << endl;
1252 osu_hpp << spacer <<
"virtual bool operator() (const class Message *msg) ";
1254 osu_hpp <<
"const ";
1255 osu_hpp <<
"{ return false; }" << endl;
1256 for (
const auto& pp : mspec)
1258 if (pp.second._name ==
"trailer" || pp.second._name ==
"header")
1260 osu_hpp << spacer <<
"virtual bool operator() (const class " << pp.second._name <<
" *msg)";
1262 osu_hpp <<
';' << endl;
1266 osu_hpp <<
" const";
1267 osu_hpp <<
" { return " << (pp.second._is_admin ?
"true" :
"false") <<
"; }" << endl;
1270 osu_hpp <<
"};" << endl;
1273 osc_hpp << endl <<
"} // namespace " << ctxt.
_fixns << endl;
1275 osc_hpp <<
"#endif // " <<
bintoaschex(ctxt.
_out[Ctxt::classes_hpp].first.second) << endl;
1276 osu_hpp << endl <<
"} // namespace " << ctxt.
_fixns << endl;
1278 osu_hpp <<
"#endif // " <<
bintoaschex(ctxt.
_out[Ctxt::router_hpp].first.second) << endl;
1279 osr_cpp << endl <<
"} // namespace " << ctxt.
_fixns << endl;
1281 osc_cpp << endl <<
"// Compiler generated metadata object accessible outside namespace through this function." << endl;
1282 osc_cpp <<
"extern \"C\"" << endl <<
'{' << endl
1283 << spacer <<
"const F8MetaCntx& " << ctxt.
_fixns <<
"_ctx() { return " << ctxt.
_fixns <<
"::ctx(); }"
1284 << endl <<
'}' << endl << endl;
1294 oss_hpp <<
"#ifndef " <<
bintoaschex(ctxt.
_out[Ctxt::session_hpp].first.second) << endl;
1295 oss_hpp <<
"#define " <<
bintoaschex(ctxt.
_out[Ctxt::session_hpp].first.second) << endl;
1298 oss_hpp <<
"// " <<
gen_classes <<
" session and router classes" << endl;
1301 oss_hpp <<
"class " << ctxt.
_clname <<
"_session_" <<
gen_classes <<
';' << endl << endl;
1303 <<
" : public FIX8::" << ctxt.
_fixns <<
"::" << ctxt.
_clname <<
"_Router" << endl <<
'{' << endl;
1304 oss_hpp << spacer << ctxt.
_clname <<
"_session_" <<
gen_classes <<
"& _session; " << endl << endl;
1305 oss_hpp <<
"public:" << endl;
1307 <<
'(' << ctxt.
_clname <<
"_session_" <<
gen_classes <<
"& session) : _session(session) {}" << endl;
1308 oss_hpp << spacer <<
"virtual ~" << ctxt.
_clname <<
"_router_" <<
gen_classes <<
"() {}" << endl << endl;
1309 oss_hpp << spacer <<
"// Override these methods to receive specific message callbacks." << endl;
1310 for (
const auto& pp : mspec)
1312 if (pp.second._name ==
"trailer" || pp.second._name ==
"header")
1314 oss_hpp << spacer <<
"// bool operator() (const FIX8::"
1315 << ctxt.
_fixns <<
"::" << pp.second._name <<
" *msg) const;" << endl;
1317 oss_hpp <<
"};" << endl;
1321 <<
" : public FIX8::Session" << endl <<
'{' << endl;
1322 oss_hpp << spacer << ctxt.
_clname <<
"_router_" <<
gen_classes <<
" _router; " << endl << endl;
1323 oss_hpp <<
"public:" << endl;
1327 oss_hpp <<
"(const FIX8::F8MetaCntx& ctx, FIX8::Persister *persist=0," << endl;
1328 oss_hpp << spacer << spacer <<
"FIX8::Logger *logger=0, FIX8::Logger *plogger=0) : Session"
1329 "(ctx, persist, logger, plogger), _router(*this) {} " << endl << endl;
1333 oss_hpp <<
"(const FIX8::F8MetaCntx& ctx, const FIX8::SessionID& sid, FIX8::Persister *persist=0," << endl;
1334 oss_hpp << spacer << spacer <<
"FIX8::Logger *logger=0, FIX8::Logger *plogger=0) : Session"
1335 "(ctx, sid, persist, logger, plogger), _router(*this) {} " << endl << endl;
1338 oss_hpp << spacer <<
"// Override these methods if required but remember to call the base class method first." << endl
1339 << spacer <<
"// bool handle_logon(const unsigned seqnum, const FIX8::Message *msg);" << endl
1340 << spacer <<
"// Message *generate_logon(const unsigned heartbeat_interval, const f8String davi=f8String());" << endl
1341 << spacer <<
"// bool handle_logout(const unsigned seqnum, const FIX8::Message *msg);" << endl
1342 << spacer <<
"// Message *generate_logout();" << endl
1343 << spacer <<
"// bool handle_heartbeat(const unsigned seqnum, const FIX8::Message *msg);" << endl
1344 << spacer <<
"// Message *generate_heartbeat(const f8String& testReqID);" << endl
1345 << spacer <<
"// bool handle_resend_request(const unsigned seqnum, const FIX8::Message *msg);" << endl
1346 << spacer <<
"// Message *generate_resend_request(const unsigned begin, const unsigned end=0);" << endl
1347 << spacer <<
"// bool handle_sequence_reset(const unsigned seqnum, const FIX8::Message *msg);" << endl
1348 << spacer <<
"// Message *generate_sequence_reset(const unsigned newseqnum, const bool gapfillflag=false);" << endl
1349 << spacer <<
"// bool handle_test_request(const unsigned seqnum, const FIX8::Message *msg);" << endl
1350 << spacer <<
"// Message *generate_test_request(const f8String& testReqID);" << endl
1351 << spacer <<
"// bool handle_reject(const unsigned seqnum, const FIX8::Message *msg);" << endl
1352 << spacer <<
"// Message *generate_reject(const unsigned seqnum, const char *what);" << endl
1353 << spacer <<
"// bool handle_admin(const unsigned seqnum, const FIX8::Message *msg);" << endl
1354 << spacer <<
"// void modify_outbound(FIX8::Message *msg);" << endl
1355 << spacer <<
"// bool authenticate(SessionID& id, const FIX8::Message *msg);" << endl << endl;
1357 oss_hpp << spacer <<
"// Override these methods to intercept admin and application methods." << endl
1358 << spacer <<
"// bool handle_admin(const unsigned seqnum, const FIX8::Message *msg);" << endl << endl
1359 << spacer <<
"bool handle_application(const unsigned seqnum, const FIX8::Message *&msg);" << endl
1360 << spacer <<
"/* In your compilation unit, this should be implemented with something like the following:" << endl
1361 << spacer <<
"bool " << ctxt.
_clname <<
"_session_" <<
gen_classes <<
"::handle_application(const unsigned seqnum, const FIX8::Message *&msg)" << endl
1362 << spacer <<
'{' << endl << spacer << spacer <<
"return enforce(seqnum, msg) || msg->process(_router);" << endl
1363 << spacer <<
'}' << endl << spacer <<
"*/" << endl;
1365 oss_hpp <<
"};" << endl;
1367 oss_hpp << endl <<
"#endif // " <<
bintoaschex(ctxt.
_out[Ctxt::session_hpp].first.second) << endl;
1374 ost_hpp <<
"#ifndef " <<
bintoaschex(ctxt.
_out[Ctxt::types_hpp].first.second) << endl;
1375 ost_hpp <<
"#define " <<
bintoaschex(ctxt.
_out[Ctxt::types_hpp].first.second) << endl << endl;
1377 ost_hpp <<
"namespace " << ctxt.
_fixns <<
" {" << endl;
1383 ost_cpp <<
"#include \"" << ctxt.
_out[Ctxt::types_hpp].first.second <<
'"' << endl;
1386 ost_cpp <<
"namespace " << ctxt.
_fixns <<
" {" << endl << endl;
1391 for (FieldSpecMap::const_iterator fitr(fspec.begin()); fitr != fspec.end(); ++fitr)
1395 if (!fitr->second._comment.empty())
1396 ost_hpp <<
"// " << fitr->second._comment << endl;
1397 const auto tyitr(FieldSpec::_typeToCPP.find(fitr->second._ftype));
1398 ost_hpp <<
"using " << fitr->second._name <<
" = Field<"
1399 << (tyitr == FieldSpec::_typeToCPP.end() ?
"unknown" : tyitr->second.first) <<
", " << fitr->first <<
">;" << endl;
1400 if (fitr->second._dvals)
1407 ost_cpp <<
"const RealmBase realmbases[] " << endl <<
'{' << endl;
1409 for (
auto& pp : fspec)
1411 if ((!pp.second._used && !
gen_fields) || !pp.second._dvals)
1413 const auto tyitr(FieldSpec::_typeToCPP.find(pp.second._ftype));
1414 ost_cpp << spacer <<
"{ reinterpret_cast<const void *>(" << pp.second._name <<
"_realm), "
1415 <<
"RealmBase::" << (pp.second._dtype == RealmBase::dt_set ?
"dt_set" :
"dt_range") <<
", "
1416 <<
"FieldTrait::" << tyitr->second.second <<
", "
1417 << pp.second._dvals->size() <<
", " << pp.second._name <<
"_descriptions }," << endl;
1418 pp.second._doffset = dcnt++;
1420 ost_cpp <<
"};" << endl;
1427 ost_hpp <<
"using " << ctxt.
_clname <<
"_BaseEntry = FieldTable;" << endl;
1430 ost_cpp <<
"extern const " << ctxt.
_clname <<
"_BaseEntry::Pair fldpairs[];" << endl;
1431 ost_cpp <<
"const " << ctxt.
_clname <<
"_BaseEntry::Pair fldpairs[] "
1432 << endl <<
'{' << endl;
1433 for (FieldSpecMap::const_iterator fitr(fspec.begin()); fitr != fspec.end(); ++fitr)
1437 if (fitr != fspec.begin())
1438 ost_cpp <<
',' << endl;
1439 ost_cpp << spacer <<
"{ " << fitr->first <<
", { ";
1440 if (fitr->second._dvals && !
norealm)
1442 ost_cpp <<
"Type2Type<" << ctxt.
_fixns <<
"::" << fitr->second._name <<
", ";
1444 if (!FieldTrait::get_type_string(fitr->second._ftype, ttype).empty())
1448 ost_cpp <<
"unknown";
1449 cerr <<
shortName <<
": error: unknown FieldTrait::type in realm '" << fitr->second._name <<
'\'' << endl;
1454 ost_cpp <<
"Type2Type<" << ctxt.
_fixns <<
"::" << fitr->second._name;
1455 ost_cpp <<
">(), \"" << fitr->second._name <<
"\", " << fitr->first;
1456 if (fitr->second._dvals)
1457 ost_cpp <<
", &" << ctxt.
_fixns <<
"::realmbases[" << fitr->second._doffset <<
']';
1458 if (!fitr->second._comment.empty())
1461 if (!fitr->second._dvals)
1462 ost_cpp <<
"nullptr, ";
1463 ost_cpp << endl << spacer << spacer <<
'"' << fitr->second._comment <<
'"';
1467 ost_cpp << endl <<
"}; // " << fields_generated << endl;
1470 ost_cpp <<
"} // namespace " << ctxt.
_fixns << endl;
1471 ost_hpp << endl <<
"} // namespace " << ctxt.
_fixns << endl;
1473 ost_hpp <<
"#endif // " <<
bintoaschex(ctxt.
_out[Ctxt::types_hpp].first.second) << endl;
1478 unsigned cnt(0), ucnt(0);
1479 for (
const auto& pp : fspec)
1481 if (pp.second._used)
1488 cout <<
"Unused fields: ";
1489 cout << pp.second._name <<
'(' << pp.first <<
')';
1494 cout << cnt <<
" of " << fspec.size() <<
" fields used in messages" << endl;
int load_fields(XmlElement &xf, FieldSpecMap &fspec)
void process_group_ordering(const CommonGroupMap &gm)
bool no_shared_groups(false)
bool nconst_router(false)
void load_components(const XmlElement::XmlSet &comlist, Components &components)
std::map< std::string, const XmlElement * > Components
bool no_default_routers(false)
void generate_nested_group(const MessageSpec &ms, const FieldSpecMap &fspec, int depth, ostream &outh, const std::string &fixns)
void generate_includes(ostream &to)
void generate_preamble(ostream &to, const string &fname, bool isheader, bool donotedit=true)
void process_value_enums(FieldSpecMap::const_iterator itr, ostream &ost_hpp, ostream &ost_cpp)
Used for static trait interrogation.
std::map< unsigned, struct FieldSpec > FieldSpecMap
int load_messages(XmlElement &xf, MessageSpecMap &mspec, const FieldToNumMap &ftonSpec, FieldSpecMap &fspec, Components &compon, CommonGroupMap &globmap)
string bintoaschex(const string &from)
std::set< const XmlElement *, EntityOrderComp > XmlSet
std::map< std::string, unsigned > FieldToNumMap
bool report_unused(false)
void generate_group_bodies(const MessageSpec &ms, const FieldSpecMap &fspec, int depth, const string &msname, ostream &outp, ostream &outh, const CommonGroupMap &globmap, const std::string &fixns, const string cls_prefix=string())
void generate_common_group_bodies(const FieldSpecMap &fspec, ostream &outp, CommonGroupMap &globmap)
std::map< const std::string, MessageSpec > MessageSpecMap
std::map< unsigned, CommonGroups > CommonGroupMap
void process_ordering(MessageSpecMap &mspec)
F8API const XmlElement * find(const std::string &what, const std::string *atag=nullptr, const std::string *aval=nullptr, const char delim='/') const
void generate_export(ostream &to, const string &ns)