fix8
version 1.4.0
Open Source C++ FIX Framework
|
Go to the source code of this file.
Functions | |
string | odir ("./") |
string | prefix ("Myfix") |
bool | verbose (false) |
bool | error_ignore (false) |
bool | gen_fields (false) |
bool | norealm (false) |
bool | nocheck (false) |
bool | nowarn (false) |
bool | incpath (true) |
bool | nconst_router (false) |
bool | no_shared_groups (false) |
bool | no_default_routers (false) |
bool | report_unused (false) |
unsigned | glob_errors (0) |
unsigned | glob_warnings (0) |
unsigned | tabsize (3) |
unsigned | ext_ver (0) |
const string | GETARGLIST ("hvVo:p:dikn:rst:x:NRc:fbCIWPF:UeH:SDu") |
void | print_usage () |
string | insert_year () |
int | process (XmlElement &xf, Ctxt &ctxt) |
int | load_fix_version (XmlElement &xf, Ctxt &ctxt) |
int | load_fields (XmlElement &xf, FieldSpecMap &fspec) |
void | process_special_traits (const unsigned short field, FieldTraits &fts) |
int | process_message_fields (const std::string &where, const XmlElement *xt, FieldTraits &fts, const FieldToNumMap &ftonSpec, FieldSpecMap &fspec, const Components &compon) |
int | load_messages (XmlElement &xf, MessageSpecMap &mspec, const FieldToNumMap &ftonSpec, FieldSpecMap &fspec, Components &compon, CommonGroupMap &globmap) |
void | process_ordering (MessageSpecMap &mspec) |
ostream * | open_ofile (const string &odir, const string &fname, string &target) |
void | process_value_enums (FieldSpecMap::const_iterator itr, ostream &ost_hpp, ostream &ost_cpp) |
const string & | mkel (const string &base, const string &compon, string &where) |
const string & | filepart (const string &source, string &where) |
void | generate_preamble (ostream &to, const string &fname, bool isheader, bool donotedit=true) |
void | generate_includes (ostream &to) |
unsigned | parse_groups (MessageSpec &ritr, const string &name, const FieldToNumMap &ftonSpec, FieldSpecMap &fspec, XmlElement::XmlSet &grplist, const Components &compon, CommonGroupMap &globmap) |
int | precomp (XmlElement &xf, ostream &outf) |
void | process_group_ordering (const CommonGroupMap &gm) |
int | precompfixt (XmlElement &xft, XmlElement &xf, ostream &outf, bool nounique) |
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_nested_group (const MessageSpec &ms, const FieldSpecMap &fspec, int depth, ostream &outh, const std::string &fixns) |
void | generate_common_group_bodies (const FieldSpecMap &fspec, ostream &outp, CommonGroupMap &globmap) |
void | load_components (const XmlElement::XmlSet &comlist, Components &components) |
unsigned | lookup_component (const Components &compon, const f8String &name) |
void | binary_report () |
string | bintoaschex (const string &from) |
uint32_t | group_hash (const MessageSpec &p1) |
const MessageSpec * | find_group (const CommonGroupMap &globmap, int &vers, unsigned tp, uint32_t key) |
void | generate_group_traits (const FieldSpecMap &fspec, const MessageSpec &ms, const string &gname, const string &prefix, ostream &outp) |
void | generate_export (ostream &to, const string &ns) |
int | main (int argc, char **argv) |
Variables | |
string | precompFile |
string | spacer |
string | inputFile |
string | precompHdr |
string | shortName |
string | fixt |
string | shortNameFixt |
string | gen_classes |
string | extra_fields |
unsigned | glob_errors |
This is the fix8 compiler.
f8c – compile FIX xml schema
Usage: f8c [-CFHINPRSUVWbcdefhiknoprstvx] <input xml schema>
-C,–nocheck do not embed version checking in generated code (default false)
-F,–xfields specify additional fields with associated messages (see documentation for details)
-H,–pch <filename> use specified precompiled header name for Windows (default none)
-I,–info print package info, exit
-N,–nounique do not enforce unique field parsing (default false)
-P,–incpath prefix system include path with "fix8" in generated compilation units (default yes)
-R,–norealm do not generate realm constructed field instantiators (default false)
-U,–noconst Generate non-const Router method declarations (default false, const)")
-S,–noshared Treat every group as unique and expose all static traits. Do not share metadata in message classes (default shared)
-W,–nowarn suppress warning messages (default false)
-V,–verbose be more verbose when processing
-c,–classes <server|client> generate user session classes (default no)
-d,–dump dump 1st pass parsed source xml file, exit
-e,–extension Generate with .cxx/.hxx extensions (default .cpp/.hpp)
-f,–fields generate code for all defined fields even if they are not used in any message (default no)
-h,–help help, this screen
-i,–ignore ignore errors, attempt to generate code anyhow (default no)
-k,–keep retain generated temporaries even if there are errors (.*.tmp)
-n,–namespace <ns> namespace to place generated code in (default FIXMmvv e.g. FIX4400)
-o,–odir <file> output target directory (default ./)
-p,–prefix <prefix> output filename prefix (default Myfix)
-r,–retain retain 1st pass code (default delete)
-s,–second 2nd pass only, no precompile (default both)
-t,–tabwidth tabwidth for generated code (default 3 spaces)
-v,–version print version, exit
-x,–fixt <file> For FIXT hosted transports or for FIX5.0 and above, the input FIXT schema file
e.g.
f8c -Vp Texfix -n TEX myfix.xml
f8c -Vrp Texfix -n TEX -x ../schema/FIXT11.xml myfix.xml
f8c -Vp Texfix -n TEX -c client -x ../schema/FIXT11.xml myfix.xml
f8c -p Texfix -n TEX -c client -x ../schema/FIXT11.xml myfix.xml -F "<field number="9999" name="SampleUserField" type="STRING" messages="NewOrderSingle:Y ExecutionReport:Y OrderCancelRequest:N">
Definition in file f8c.cpp.
void binary_report | ( | ) |
string bintoaschex | ( | const string & | from | ) |
Definition at line 270 of file f8cutils.cpp.
Referenced by process().
bool error_ignore | ( | false | ) |
Referenced by main().
unsigned ext_ver | ( | 0 | ) |
Referenced by main().
const string& filepart | ( | const string & | source, |
string & | where | ||
) |
Definition at line 108 of file f8cutils.cpp.
Referenced by main(), and FIX8::FileLogger::rotate().
const MessageSpec * find_group | ( | const CommonGroupMap & | globmap, |
int & | vers, | ||
unsigned | tp, | ||
uint32_t | key | ||
) |
Definition at line 1554 of file f8c.cpp.
Referenced by FIX8::MessageBase::copy_legal(), FIX8::Configuration::create_clients(), FIX8::Configuration::create_logger(), FIX8::Configuration::create_login_schedule(), FIX8::Configuration::create_persister(), FIX8::Configuration::create_session_schedule(), FIX8::MessageBase::encode_group(), generate_group_bodies(), FIX8::Configuration::get_addresses(), and FIX8::MessageBase::print_group().
void generate_common_group_bodies | ( | const FieldSpecMap & | fspec, |
ostream & | outp, | ||
CommonGroupMap & | globmap | ||
) |
Definition at line 906 of file f8c.cpp.
References FIX8::_csMap, FIX8::cs_divider, and generate_group_traits().
Referenced by process().
void generate_export | ( | ostream & | to, |
const string & | ns | ||
) |
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() |
||
) |
Definition at line 742 of file f8c.cpp.
References FIX8::_csMap, FIX8::MessageSpec::_fields, FIX8::MessageSpec::_group_refcnt, FIX8::MessageSpec::_groups, FIX8::MessageSpec::_hash, FIX8::MessageSpec::_is_admin, FIX8::MessageSpec::_name, FIX8::cs_divider, find_group(), generate_group_traits(), generate_nested_group(), FIX8::FieldTraits::get_presence(), prefix(), FIX8::presorted_set< unsigned short, FieldTrait, FieldTrait::Compare >::size(), spacer, and tabsize().
Referenced by process().
void generate_group_traits | ( | const FieldSpecMap & | fspec, |
const MessageSpec & | ms, | ||
const string & | gname, | ||
const string & | prefix, | ||
ostream & | outp | ||
) |
Definition at line 853 of file f8c.cpp.
References FIX8::MessageSpec::_fields, FIX8::MessageSpec::_group_refcnt, FIX8::presorted_set< unsigned short, FieldTrait, FieldTrait::Compare >::begin(), FIX8::presorted_set< unsigned short, FieldTrait, FieldTrait::Compare >::end(), FIX8::FieldTraits::get_presence(), no_shared_groups(), FIX8::presorted_set< unsigned short, FieldTrait, FieldTrait::Compare >::size(), and spacer.
Referenced by generate_common_group_bodies(), and generate_group_bodies().
void generate_includes | ( | ostream & | to | ) |
Definition at line 394 of file f8cutils.cpp.
References incpath.
Referenced by process().
void generate_nested_group | ( | const MessageSpec & | ms, |
const FieldSpecMap & | fspec, | ||
int | depth, | ||
ostream & | outh, | ||
const std::string & | fixns | ||
) |
Definition at line 711 of file f8c.cpp.
References FIX8::MessageSpec::_groups, spacer, and tabsize().
Referenced by generate_group_bodies(), and process().
void generate_preamble | ( | ostream & | to, |
const string & | fname, | ||
bool | isheader, | ||
bool | donotedit = true |
||
) |
Definition at line 1567 of file f8c.cpp.
References FIX8::_csMap, FIX8::cs_copyright, FIX8::cs_copyright2, FIX8::cs_divider, FIX8::cs_do_not_edit, FIX8_MAGIC_NUM, FIX8_PACKAGE_VERSION, FIX8::GetTimeAsStringMS(), incpath(), insert_year(), nocheck(), and precompHdr.
Referenced by process().
const string GETARGLIST | ( | "hvVo:p:dikn:rst:x:NRc:fbCIWPF:UeH:SDu" | ) |
Referenced by main().
unsigned glob_errors | ( | 0 | ) |
unsigned glob_warnings | ( | 0 | ) |
Referenced by load_fields(), main(), and parse_groups().
uint32_t group_hash | ( | const MessageSpec & | p1 | ) |
Definition at line 1535 of file f8c.cpp.
References FIX8::MessageSpec::_fields, FIX8::MessageSpec::_groups, FIX8::FieldTraits::get_presence(), no_shared_groups(), and FIX8::rothash().
Referenced by parse_groups().
bool incpath | ( | true | ) |
Referenced by generate_preamble(), and main().
string insert_year | ( | ) |
Definition at line 376 of file f8cutils.cpp.
Referenced by generate_preamble().
void load_components | ( | const XmlElement::XmlSet & | comlist, |
Components & | components | ||
) |
Definition at line 182 of file f8precomp.cpp.
int load_fields | ( | XmlElement & | xf, |
FieldSpecMap & | fspec | ||
) |
Definition at line 453 of file f8c.cpp.
References XmlElement::find(), glob_errors, glob_warnings(), FIX8::InPlaceStrToUpper(), nowarn(), FIX8::recover_line(), shortName, and FIX8::trim().
Referenced by process().
int load_fix_version | ( | XmlElement & | xf, |
Ctxt & | ctxt | ||
) |
Definition at line 115 of file f8cutils.cpp.
References FIX8::Ctxt::_beginstr, FIX8::Ctxt::_clname, FIX8::Ctxt::_fixns, FIX8::Ctxt::_systemns, FIX8::Ctxt::_version, XmlElement::find(), prefix, and shortName.
Referenced by main().
int load_messages | ( | XmlElement & | xf, |
MessageSpecMap & | mspec, | ||
const FieldToNumMap & | ftonSpec, | ||
FieldSpecMap & | fspec, | ||
Components & | compon, | ||
CommonGroupMap & | globmap | ||
) |
Definition at line 541 of file f8c.cpp.
References XmlElement::find(), glob_errors, mkel(), parse_groups(), process_message_fields(), FIX8::recover_line(), shortName, and verbose().
Referenced by process().
unsigned lookup_component | ( | const Components & | compon, |
const f8String & | name | ||
) |
Definition at line 1528 of file f8c.cpp.
Referenced by parse_groups(), and process_message_fields().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 147 of file f8c.cpp.
References FIX8::Ctxt::_beginstr, FIX8::Ctxt::_exts, FIX8::Ctxt::_exts_ver, FIX8::Ctxt::_fixns, FIX8::Ctxt::_out, FIX8::Ctxt::_version, binary_report(), FIX8::CheckAddTrailingSlash(), FIX8::RegExp::Erase(), error_ignore(), ext_ver(), extra_fields, XmlElement::Factory(), filepart(), XmlElement::find(), fixt, gen_classes, gen_fields(), GETARGLIST(), glob_errors, glob_warnings(), incpath(), inputFile, XmlElement::Insert(), load_fix_version(), nconst_router(), no_default_routers(), no_shared_groups(), nocheck(), norealm(), nowarn(), odir(), open_ofile(), FIX8::package_info(), precomp(), precompFile, precompfixt(), precompHdr, prefix(), print_usage(), process(), report_unused(), FIX8::RegExp::SearchString(), shortName, shortNameFixt, spacer, FIX8::RegExp::SubExpr(), tabsize(), FIX8::trim(), verbose(), and FIX8::f8Exception::what().
const string & mkel | ( | const string & | base, |
const string & | compon, | ||
string & | where | ||
) |
Definition at line 100 of file f8cutils.cpp.
Referenced by load_messages().
bool no_shared_groups | ( | false | ) |
Referenced by generate_group_traits(), group_hash(), main(), and process().
bool nocheck | ( | false | ) |
Referenced by generate_preamble(), and main().
bool nowarn | ( | false | ) |
Referenced by load_fields(), main(), and parse_groups().
string odir | ( | "./" | ) |
Referenced by main().
ostream* open_ofile | ( | const string & | odir, |
const string & | fname, | ||
string & | target | ||
) |
Definition at line 77 of file f8cutils.cpp.
References FIX8::CheckAddTrailingSlash(), and FIX8::exist().
Referenced by main().
unsigned parse_groups | ( | MessageSpec & | ritr, |
const string & | name, | ||
const FieldToNumMap & | ftonSpec, | ||
FieldSpecMap & | fspec, | ||
XmlElement::XmlSet & | grplist, | ||
const Components & | compon, | ||
CommonGroupMap & | globmap | ||
) |
Definition at line 633 of file f8c.cpp.
References FIX8::MessageSpec::_fields, FIX8::MessageSpec::_groups, FIX8::MessageSpec::_hash, FIX8::FieldTraits::add(), glob_errors, glob_warnings(), group_hash(), lookup_component(), nowarn(), process_message_fields(), FIX8::recover_line(), and shortName.
Referenced by load_messages().
int precomp | ( | XmlElement & | xf, |
ostream & | outf | ||
) |
Definition at line 71 of file f8precomp.cpp.
References doctype(), XmlElement::find(), XmlElement::GetTag(), load_components(), and output_attributes().
Referenced by main().
int precompfixt | ( | XmlElement & | xft, |
XmlElement & | xf, | ||
ostream & | outf, | ||
bool | nounique | ||
) |
Definition at line 112 of file f8precomp.cpp.
Referenced by main().
string prefix | ( | "Myfix" | ) |
Referenced by generate_group_bodies(), and main().
void print_usage | ( | ) |
Definition at line 320 of file f8cutils.cpp.
References UsageMan::add(), GETARGLIST, UsageMan::print(), and UsageMan::setdesc().
Referenced by main().
int process | ( | XmlElement & | xf, |
Ctxt & | ctxt | ||
) |
Definition at line 928 of file f8c.cpp.
References FIX8::Ctxt::_beginstr, FIX8::Ctxt::_clname, FIX8::_csMap, FIX8::Ctxt::_fixns, FIX8::Ctxt::_out, FIX8::Ctxt::_version, bintoaschex(), FIX8::cs_divider, FIX8::cs_end_anon_namespace, FIX8::cs_end_namespace, FIX8::cs_generated_includes, FIX8::cs_header_preamble, FIX8::cs_start_anon_namespace, FIX8::cs_start_namespace, FIX8::cs_trailer_preamble, XmlElement::find(), gen_classes, gen_fields(), generate_common_group_bodies(), generate_export(), generate_group_bodies(), generate_includes(), generate_nested_group(), generate_preamble(), glob_errors, load_components(), load_fields(), load_messages(), nconst_router(), no_default_routers(), no_shared_groups(), norealm(), process_group_ordering(), process_ordering(), process_value_enums(), report_unused(), shortName, spacer, and verbose().
Referenced by main().
void process_group_ordering | ( | const CommonGroupMap & | gm | ) |
Definition at line 312 of file f8cutils.cpp.
References process_message_group_ordering().
Referenced by process().
int process_message_fields | ( | const std::string & | where, |
const XmlElement * | xt, | ||
FieldTraits & | fts, | ||
const FieldToNumMap & | ftonSpec, | ||
FieldSpecMap & | fspec, | ||
const Components & | compon | ||
) |
Definition at line 220 of file f8cutils.cpp.
References FIX8::FieldTraits::add(), XmlElement::find(), glob_errors, glob_warnings, lookup_component(), nowarn, process_special_traits(), FIX8::recover_line(), and shortName.
Referenced by load_messages(), and parse_groups().
void process_ordering | ( | MessageSpecMap & | mspec | ) |
Definition at line 279 of file f8cutils.cpp.
Referenced by process().
void process_special_traits | ( | const unsigned short | field, |
FieldTraits & | fts | ||
) |
Definition at line 159 of file f8cutils.cpp.
References FIX8::FieldTraits::clear(), FIX8::Common_BeginString(), FIX8::Common_BodyLength(), FIX8::Common_CheckSum(), FIX8::Common_MsgType(), and FIX8::FieldTraits::set().
Referenced by process_message_fields().
void process_value_enums | ( | FieldSpecMap::const_iterator | itr, |
ostream & | ost_hpp, | ||
ostream & | ost_cpp | ||
) |
Definition at line 176 of file f8cutils.cpp.
References FIX8::InPlaceReplaceInSet(), and spacer.
Referenced by process().
unsigned tabsize | ( | 3 | ) |
Referenced by generate_group_bodies(), generate_nested_group(), main(), and FIX8::MessageBase::set_tabsize().
bool verbose | ( | false | ) |
Referenced by load_messages(), main(), and process().
unsigned glob_errors |
Referenced by load_fields(), load_messages(), main(), parse_groups(), and process().
string precompHdr |
Definition at line 96 of file f8c.cpp.
Referenced by generate_preamble(), and main().
string shortName |
Definition at line 96 of file f8c.cpp.
Referenced by load_fields(), load_fix_version(), load_messages(), main(), parse_groups(), process(), and process_message_fields().
string spacer |
Definition at line 96 of file f8c.cpp.
Referenced by generate_group_bodies(), generate_group_traits(), generate_nested_group(), main(), operator<<(), UsageMan::print(), process(), FIX8::XmlFileLogger::process_logline(), process_value_enums(), and MyMenu::static_probe().