{"id":22220625,"url":"https://github.com/fix8mt/ufeed_bindings_cpp","last_synced_at":"2025-10-14T05:32:11.313Z","repository":{"id":215362110,"uuid":"425228450","full_name":"fix8mt/ufeed_bindings_cpp","owner":"fix8mt","description":"C++ bindings to UFEed","archived":false,"fork":false,"pushed_at":"2021-11-16T06:40:01.000Z","size":196,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T07:41:50.557Z","etag":null,"topics":["cpp","fix","fix-engine","fix8","fix8-market","fix8pro","fixengine","fixprotocol","google-protocol-buffers","high-performance","low-latency","middleware","zeromq"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fix8mt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-11-06T11:38:09.000Z","updated_at":"2024-09-17T14:04:56.000Z","dependencies_parsed_at":"2024-01-04T02:16:11.516Z","dependency_job_id":"38fd4521-2636-4bf5-b312-38472740470c","html_url":"https://github.com/fix8mt/ufeed_bindings_cpp","commit_stats":null,"previous_names":["fix8mt/ufeed_bindings_cpp"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/fix8mt/ufeed_bindings_cpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fix8mt%2Fufeed_bindings_cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fix8mt%2Fufeed_bindings_cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fix8mt%2Fufeed_bindings_cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fix8mt%2Fufeed_bindings_cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fix8mt","download_url":"https://codeload.github.com/fix8mt/ufeed_bindings_cpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fix8mt%2Fufeed_bindings_cpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018011,"owners_count":26086235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","fix","fix-engine","fix8","fix8-market","fix8pro","fixengine","fixprotocol","google-protocol-buffers","high-performance","low-latency","middleware","zeromq"],"created_at":"2024-12-02T23:09:22.381Z","updated_at":"2025-10-14T05:32:11.292Z","avatar_url":"https://github.com/fix8mt.png","language":"C++","readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.fix8mt.com\"\u003e\u003cimg src=\"fix8mt_Master_Logo_Green_Trans.png\" width=\"200\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# UFEed C++ Binding\n\n-   [Introduction](#introduction)\n-   [Getting started](#getting-started)\n-   [Interface](#interface)\n    -   [UFEMessage Builder](#ufemessage-builder)\n    -   [UFEMessage](#ufemessage)\n    -   [UFEedClient](#ufeedclient)\n-   [Constants](#constants)\n    -   [FIX variants constants](#fix-variants-constants)\n-   [Building](#building)\n\n\n------------------------------------------------------------------------\n\n# Introduction\n\nThe UFEed C++ Binding (`UFEed_C++`) provides a low level C++ interface to the\nUFEGW. Interactions with the UFEGW are based around a `UFEedClient`\nobject from `UFECPP` namespace which can be used to send and receive\nMessages to and from the UFEGW.\n\nUse the following [Universal FIX engine documentaion](https://fix8mt.atlassian.net/wiki/spaces/FMT/pages/634438/Universal+FIX+Engine+Home) for a reference.\n\nFeatures of `UFEedClient`:\n\n-   System API support ([see 4. Implementation Guide - Section\n    1.3](https://fix8mt.atlassian.net/wiki/spaces/FIX8PRO/pages/628308/4.+Implementation+Guide))\n\n-   Business API support (eg. NewOrderSingle and standard FIX messages)\n\n-   Provides a 4-way communications API in order to make requests,\n    publish messages, receive responses and subscribe to broadcast\n    messages\n\n-   User defined implementation of callback interface to handle these\n    PUB, SUB, REQ and REP message events\n\n-   Dynamic configuration of PUB, SUB, REQ, REP addressing and topics\n\n-   Internal session management\n\nFeatures of a `UFEMessage/UFEMessage::Builder`:\n\n-   A generic container of fields, i.e. tag/typed value pairs with\n    possible nested messages called groups\n\n-   Smart field creation and access, rendering field value to ival, sval\n    or fval depending on context\n\n-   Named Message properties (name, long_name, seq, service_id,\n    subservice_id)\n\n# Getting started\n\nThe `UFEed_C++` is provided as a shared library in either .so (Linux) or .dll\n(Windows) format. It has no external dependencies besides Google\nProtobuf library header files that are included in the installation\npackage. Google Protobuf and ZeroMQ libraries are linked in to `UFEed_C++`\nstatically. Installation directory structure after the build (example is Linux) is as follows:\n\n```\nufeed_bindings_cpp\n├── include\n│   ├── 3rdparty\n│   │   └── google\n│   │       └── protobuf\n│   └── ufecpp\n│       ├── ufe_cpp_fields_fix40.hpp\n│       ├── ufe_cpp_fields_fix41.hpp\n│       ├── ufe_cpp_fields_fix42.hpp\n│       ├── ufe_cpp_fields_fix43.hpp\n│       ├── ufe_cpp_fields_fix44.hpp\n│       ├── ufe_cpp_fields_fix50.hpp\n│       ├── ufe_cpp_fields_fix50sp1.hpp\n│       ├── ufe_cpp_fields_fix50sp2.hpp\n│       ├── ufeapi.pb.h\n│       ├── ufeconfiguration.hpp\n│       ├── ufeconsts.hpp\n│       ├── ufecppdll.h\n│       ├── ufecppversion.h\n│       ├── ufeedclient.hpp\n│       ├── ufeexception.hpp\n│       └── ufemessage.hpp\n├── lib\n│   └── libufeedclient.so\n└── samples\n    ├── CMakeLists.txt\n    └── sample0.cpp\n```\n\n# Interface\n\nThe main `UFEed_C++` interfaces/classes are `UFEMessage`,\n`UFEMessage.::Builder` and `UFEedClient`. `UFEMessage` is read-only\naccessor to underlying `WireMessage` object with mapped fields and\ngroups. `UFEMessage::Builder` is a helper class that follows \"builder\"\npattern to simplify C++ language constructs (i.e. setters return the\nreference to an object it was called from):\n\n```c++\nauto login = _uc-\u003ecreate_message()\n    .set_long_name(\"login\")\n    .set_type(WireMessage::st_system)\n    .set_service_id(UFE_CMD_LOGIN)\n    .add_field(UFE_CMD, UFE_CMD_LOGIN)\n    .add_field(UFE_LOGIN_ID, \"webuser\")\n    .add_field(UFE_LOGIN_PW, \"5e8848\");\n// type of login is UFEMessage::Builder\n```\n\n## UFEMessage Builder\n\nThe `UFEMessage::Builder` class provides write-only acess to underlying\n`WireMessage` object format utilised by the UFEGW. `UFEMessage::Builder`\nctors are public but in most cases `UFEedClient::create_message()`\nmethod shall be used.\n\n```c++\nclass Builder\n{\npublic:\n    /**\n     * Ctor\n     * \\param wm WireMessage to init from NOT taking ownership\n     */\n    explicit Builder(WireMessage* wm): _wm(wm, WireMessageDeleter(false)) {}\n    /**\n     * Ctor\n     * \\param wm WireMessage to take ownership from\n     */\n    explicit Builder(WireMessagePtr\u0026\u0026 wm): _wm(std::move(wm)) {}\n\n    /// Returns service id\n    int service_id() const;\n    /// Sets service id, \\return *this\n    Builder\u0026 set_service_id(int service_id);\n    /// Return sub service id\n    int subservice_id() const;\n    /// Sets subservice id, \\return *this\n    Builder\u0026 set_subservice_id(int subservice_id);\n    /// Returns seq\n    uint32_t seq() const;\n    /// Sets seq, \\return *this\n    Builder\u0026 set_seq(uint32_t seq);\n    /// Returns wire message type\n    WireMessage::Type type() const;\n    /// Sets wire message type, \\return *this\n    Builder\u0026 set_type(WireMessage::Type type);\n    /// Returns message long name\n    const std::string\u0026 long_name() const;\n    /// Sets message long name\n    Builder\u0026 set_long_name(std::string long_name);\n    /// Return message name\n    const std::string\u0026 name() const;\n    /// Set message name, \\return *this\n    Builder\u0026 set_name(std::string name);\n    /// Return inner WireMessage pointer\n    const WireMessage* wire_message() const;\n\n    /**\n     * Adds integer field\n     * \\param tag integer field tag\n     * \\param val integer value\n     * \\param loc integer location\n     * \\return *this\n     */\n    template\u003ctypename T, std::enable_if_t\u003c\n        std::is_same\u003cT,  int64_t\u003e::value || std::is_same\u003cT,  int32_t\u003e::value || std::is_same\u003cT,  int16_t\u003e::value ||\n        std::is_same\u003cT, uint64_t\u003e::value || std::is_same\u003cT, uint32_t\u003e::value || std::is_same\u003cT, uint16_t\u003e::value ||\n        std::is_enum\u003cT\u003e::value\n        \u003e * = nullptr\u003e\n    Builder\u0026 add_field(uint32_t tag, T val, UFEField::UFEFieldLocation loc = UFEField::fl_body);\n\n    /**\n     * Adds char field\n     * \\param tag integer field tag\n     * \\param val integer value\n     * \\param loc integer location\n     * \\return *this\n     */\n    template\u003ctypename T, std::enable_if_t\u003c\n        std::is_same\u003cT,  char\u003e::value || std::is_same\u003cT, unsigned char\u003e::value\n        \u003e * = nullptr\u003e\n    Builder\u0026 add_field(uint32_t tag, T val, UFEField::UFEFieldLocation loc = UFEField::fl_body);\n\n    /**\n     * Adds double field\n     * \\param tag double field tag\n     * \\param val double val\n     * \\param loc double location\n     * \\return *this\n     */\n    template\u003ctypename T, std::enable_if_t\u003c\n        std::is_same\u003cT,  double\u003e::value || std::is_same\u003cT, float\u003e::value\n        \u003e * = nullptr\u003e\n    Builder\u0026 add_field(uint32_t tag, T val, UFEField::UFEFieldLocation loc = UFEField::fl_body);\n\n    /**\n     * Adds string field\n     * \\param tag string field tag\n     * \\param val string value\n     * \\param loc string location\n     * \\return *this\n     */\n    Builder\u0026 add_field(uint32_t tag, const char* val, UFEField::UFEFieldLocation loc = UFEField::fl_body);\n\n    /**\n     * Adds string field\n     * \\param tag string field tag\n     * \\param val string value\n     * \\param loc string location\n     * \\return *this\n     */\n    template\u003ctypename T, std::enable_if_t\u003c\n        std::is_same\u003ctypename std::decay\u003cT\u003e::type, std::string\u003e::value ||\n        std::is_same\u003ctypename std::decay\u003cT\u003e::type, std::string_view\u003e::value\n        \u003e * = nullptr\u003e\n    Builder\u0026 add_field(uint32_t tag, T\u0026\u0026 val, UFEField::UFEFieldLocation loc = UFEField::fl_body);\n\n    /**\n     * Adds bool field\n     * \\param tag bool field tag\n     * \\param val bool value\n     * \\param loc bool location\n     * \\return *this\n     */\n    Builder\u0026 add_field(uint32_t tag, bool val, UFEField::UFEFieldLocation loc = UFEField::fl_body);\n\n    /**\n     * Adds time field\n     * \\param tag time field tag\n     * \\param val time value\n     * \\param loc time location\n     * \\return *this\n     */\n    Builder\u0026 add_field(uint32_t tag, TimePoint\u0026\u0026 val, UFEField::UFEFieldLocation loc = UFEField::fl_body);\n\n    /**\n     * Adds UUID field\n     * \\param tag uuid tag\n     * \\param val uuid string representation\n     * \\param loc uuid location\n     * \\return *this\n     */\n    Builder\u0026 add_field(uint32_t tag, const Uuid\u0026 val, UFEField::UFEFieldLocation loc = UFEField::fl_body);\n\n    /**\n     * Adds status field\n     * \\param tag status tag\n     * \\param val status value\n     * \\param loc status location\n     * \\return *this\n     */\n    Builder\u0026 add_field(uint32_t tag, Status val, UFEField::UFEFieldLocation loc = UFEField::fl_body);\n\n    /**\n     * Added a set of fields to message\n     * \\tparam Iter iterator type\n     * \\param first begin iterator\n     * \\param last end iterator\n     * \\return *this\n     */\n    template\u003ctypename Iter\u003e\n    Builder\u0026 add_fields(Iter first, Iter last);\n\n    /**\n     * Adds group field to the message\n     * \\param to field to add to\n     * \\param tr group creation lambda\n     * \\param loc status location\n     * \\return created message unique_ptr ref\n     */\n    Builder\u0026 add_group(uint32_t tag, WireMessageGroup* \u0026grp, const std::function\u003cvoid(Builder\u0026, WireMessageGroup*)\u003e\u0026 tr={}, UFEField::UFEFieldLocation loc = UFEField::fl_body);\n\n    /*! Add group item\n     * \\param grp wire message group pointer\n     * \\param grp_cont ufe message group container\n     * \\param location field location\n     * \\return *this\n     */\n    Builder add_group_item(WireMessageGroup* grp, UFEField::UFEFieldLocation location = UFEField::fl_body);\n\n    UFEMessagePtr build();\n};\n```\n\n`UFEMessage::Builder` usage sample:\n\n```c++\nauto login = _uc-\u003ecreate_message()\n    .set_long_name(\"login\")\n    .set_type(WireMessage::st_system)\n    .set_service_id(UFE_CMD_LOGIN)\n    .add_field(UFE_CMD, UFE_CMD_LOGIN)\n    .add_field(UFE_LOGIN_ID, \"webuser\")\n    .add_field(UFE_LOGIN_PW, \"5e8848\");\n```\n\n`UFEMessage::Builder` creates `NewOrderSinge` message with groups:\n\n```c++\n// NOS creation\nusing namespace FIX50SP2::Field;\nWireMessageGroup* grp{};\nauto nos = _uc-\u003ecreate_message();\nnos.set_long_name(\"NewOrderSingle\")\n    .set_type(WireMessage::st_fixmsg)\n    .set_service_id(1)\n    .set_name(MsgType::NEWORDERSINGLE)\n    .add_field(ClOrdID::tag, \"123\")\n    .add_field(TransactTime::tag, std::chrono::system_clock::now())\n    .add_field(ExecInst::tag, ExecInst::ALL_OR_NONE)\n    .add_field(OrdType::tag, OrdType::LIMIT)\n    .add_field(Side::tag, Side::BUY)\n    .add_group(NoAllocs::tag, grp, [](UFEMessage::Builder\u0026 m, WireMessageGroup* grp)\n    {\n        m.add_group_item(grp)\n            .set_long_name(\"NoAlloc\")\n            .set_type(WireMessage::st_fixmsg)\n            .set_seq(1)\n            .add_field(AllocAccount::tag, \"ABC\")\n            .add_field(AllocQty::tag, 2);\n        m.add_group_item(grp)\n            .set_long_name(\"NoAlloc\")\n            .set_type(WireMessage::st_fixmsg)\n            .set_seq(2)\n            .add_field(AllocAccount::tag, \"CDE\")\n            .add_field(AllocQty::tag, 4);\n    });\n```\n\n## UFEMessage\n\nThe `UFEMessage` class provides read-only access to underlying\n`WireMessage` object format utilised by the UFEGW. `UFEMessage` ctors\nare public but in most cases `UFEMessage::Builder::build()` method shall\nbe used to extend `UFEMessage` class to other underlying protocols and\nmiddleware plugins in the future. `UFEMessage` has no copy ctor as well\nas no assignment operator - use `msg-\u003eclone()` to create a message copy.\n\n```c++\nclass UFEMessage\n{\npublic:\n    /**\n     * Ctors\n     */\n    UFEMessage(std::string long_name, WireMessage::Type type, int service_id, WireMessagePtr\u0026\u0026 wm);\n    explicit UFEMessage(WireMessage* wm);\n    explicit UFEMessage(WireMessagePtr\u0026\u0026 wm);\n\n    /**\n     * Clone UFE message\n     * \\return clonned message unique ptr\n     */\n    UFEMessagePtr clone();\n\n    /// Returns service id\n    int service_id() const;\n    /// Sets service id, \\return *this\n    UFEMessage\u0026 service_id(int service_id);\n\n    /// Return sub service id\n    int subservice_id() const;\n    /// Sets subservice id, \\return *this\n    UFEMessage\u0026 subservice_id(int subservice_id);\n\n    /// Returns seq\n    uint32_t seq() const;\n    /// Sets seq, \\return *this\n    UFEMessage\u0026 seq(uint32_t seq);\n\n    /// Returns wire message type\n    WireMessage::Type type() const;\n    /// Sets wire message type, \\return *this\n    UFEMessage\u0026 type(WireMessage::Type type);\n\n    /// Returns message long name\n    const std::string\u0026 long_name() const;\n\n    /// Return message name\n    const std::string\u0026 name() const;\n    /// Set message name, \\return *this\n    UFEMessage\u0026 name(std::string name);\n\n    /// Gets mapped fields, \\return field map\n    const FieldsMap\u0026 fields() const;\n    /// Gets mapped groups, \\return group map\n    const GroupsMap\u0026 groups() const;\n    /// Gets wire mesage, \\return wire message\n    const WireMessage* wire_message() const;\n\n    /**\n     * Finds field\n     * \\param tag field tag to find\n     * \\return UFEField pointer if found, otherwise nullptr\n     */\n    const UFEField* find_field(uint32_t tag) const;\n    UFEField* find_field(uint32_t tag);\n    template\u003ctypename T\u003e\n    std::optional\u003cT\u003e find_field_value(uint32_t tag) const;\n\n    /**\n     * Finds group\n     * \\param tag group tag to find\n     * \\return GroupsContainer pointer if found, otherwise nullptr\n     */\n    const GroupsContainer* find_group(uint32_t tag) const;\n\n    UFEMessage::Builder new_builder();\n```\n\n`UFEMessage` usage sample:\n\n```c++ {.syntaxhighlighter-pre syntaxhighlighter-params=\"brush: cpp; gutter: false; theme: RDark\" theme=\"RDark\"}\nauto login = _uc-\u003ecreate_message()\n    .set_long_name(\"login\")\n    .set_type(WireMessage::st_system)\n    .set_service_id(UFE_CMD_LOGIN)\n    .add_field(UFE_CMD, UFE_CMD_LOGIN)\n    .add_field(UFE_LOGIN_ID, \"webuser\")\n    .add_field(UFE_LOGIN_PW, \"5e8848\")\n    .build();       // build Message from Message::Builder\nauto const * login_id = login-\u003efind_field(UFE_LOGIN_ID);\nauto login_pw = login-\u003efind_field_value(UFE_LOGIN_PW);\nassert(login_pw.has_value());\n```\n\n## UFEedClient\n\nThe `UFEedClient` class is used as the interface to make both System and\nBusiness API calls to the UFEGW. Sessions between `UFEedClient` and the\nUFEGW are made up of ZeroMQ PUB/SUB and REQ/REP sockets. The network\naddresses and message topics inherent to these sockets are configurable\nvia `UFEedClient`. In addition, the `UFEedClient` manages these UFEGW\nsessions on behalf of the user (after the user has successfully logged\nin).\n\n`UFEedClient` provides a callback interface called `Listener` that must\nbe implemented by `UFEedClient` consumer:\n\n```c++\nstruct Listener\n{\n    /**\n      * Called when subscription message received, PUB/SUB pattern\n      * \\param message received subscription message\n      */\n      virtual void subscription_message_received(const UFEMessagePtr\u0026 message) = 0;\n    /**\n      * Called when responder message received, back cnannel pattern\n      * \\param message received responder message\n      */\n      virtual void responder_message_received(const UFEMessagePtr\u0026 message) = 0;\n    /**\n      * Called when response message received, REQ/REP pattern\n      * \\param message received response message\n      */\n    virtual void response_message_received(const UFEMessagePtr\u0026 message) = 0;\n    /**\n      * Called when authentication is requested via back channel\n      * \\param user user to check\n      * \\param password user password to check\n      * \\return true for successful authentication, otherwise false\n      */\n    virtual bool authenticate_requested(const std::string\u0026 user, const std::string\u0026 password) = 0;\n    /**\n      * Called when ZeroMQ error happened\n      * \\param error ZMQ error code\n      * \\return true to continue, false to stop processing loop\n      */\n    virtual bool zeromq_error_happened(int error) = 0;\n    /**\n      * Called when error happened\n      * \\param error error message\n      * \\param exception exception happened\n      * \\return true to continue, false to stop processing loop\n      */\n    virtual bool error_happened(const std::string\u0026 error, const std::exception\u0026 exception) = 0;\n};\n```\n\n`UFEedClient` is configured with `UFEconfiguration` class:\n\n```c++\nclass UFEedConfiguration\n{\npublic:\n    /**\n    * Subscriber endpoint, defaults to \"tcp://127.0.0.1:55745\"\n    * \\return subscriber endpoint\n    */\n    std::string subscriber() const;\n    UFEedConfiguration\u0026 subscriber(std::string subscriber);\n\n    /**\n    * Requester endpoint, defaults to \"tcp://127.0.0.1:55746\"\n    * \\return subscriber endpoint\n    */\n    std::string requester() const;\n    UFEedConfiguration\u0026 requester(std::string requester);\n\n    /**\n    * Publisher endpoint, defaults to \"tcp://\\*:55747\"\n    * \\return publisher endpoint\n    */\n    std::string publisher() const;\n    UFEedConfiguration\u0026 publisher(std::string publisher);\n\n    /**\n    * Responder endpoint, defaults to \"tcp://\\*:55748\"\n    * \\return responder endpoint\n    */\n    std::string responder() const;\n    UFEedConfiguration\u0026 responder(std::string responder);\n\n    /**\n    * Subscriber topic, defaults to \"ufegw-publisher\"\n    * \\return subscriber topic\n    */\n    std::string subscriber_topic() const;\n    UFEedConfiguration\u0026 subscriber_topic(std::string subscriber_topic);\n\n    /**\n    * Requester topic, defaults to \"ufegw-responder\"\n    * \\return requester topic\n    */\n    std::string requester_topic() const;\n    UFEedConfiguration\u0026 requester_topic(std::string requester_topic);\n\n    /**\n    * Publisher topic, defaults to \"ufeedclient-publisher\"\n    * \\return publisher topic\n    */\n    std::string publisher_topic() const;\n    UFEedConfiguration\u0026 publisher_topic(std::string publisher_topic);\n\n    /**\n    * Responder topic, defaults to \"ufeedclient-responder\"\n    * \\return responder topic\n    */\n    std::string responder_topic() const;\n    UFEedConfiguration\u0026 responder_topic(std::string responder_topic);\n\n    /**\n    * Max zmq IO thread count, defaults to 1\n    * \\return max zmq IO thread count\n    */\n    uint32_t max_io_threads() const;\n    UFEedConfiguration\u0026 max_io_threads(uint32_t max_io_threads);\n\n    /**\n    * Poll interval in msecs, defaults to 10 ms\n    * \\return poll interval in msecs\n    */\n    uint64_t poll_interval_ms() const;\n    UFEedConfiguration\u0026 poll_interval_ms(uint64_t poll_interval_ms);\n};\n```\n\n`UFEedClient` interface:\n\n```c++\nclass UFEedClient\n{\npublic:\n    /**\n     * UFEed Client ctor\n     * \\param config UFEedConfiguration to configure UFEed Client\n     * \\param listener listener based class to receive UFEed Client events\n     */\n    UFECPPAPI explicit UFEedClient(const UFEedConfiguration\u0026 config, Listener* listener);\n    /**\n     * Dtor\n     * Stops UFEed Client if it was started and frees allocated resources\n     */\n    UFECPPAPI ~UFEedClient();\n    /**\n     * Starts UFEed Client. When started in synchronous mode (wait = true)\n     * it does not return until stop() is called from a different thread.\n     * \\param wait true for synchronous call, false for asynchronous\n     */\n    UFECPPAPI void start(bool wait = false);\n    /**\n     * Stops UFEed Client\n     */\n    UFECPPAPI void stop();\n    /**\n     * Creates UFEMessage factory methods\n     * \\param long_name message long name\n     * \\param type message type, \\see WireMessage::Type\n     * \\param service_id message service id\n     * \\return message builder. \\see UFEMessage::Builder\n     */\n    UFECPPAPI UFEMessage::Builder create_message();\n    UFECPPAPI UFEMessage::Builder create_message(WireMessagePtr\u0026\u0026 wm);\n\n    /**\n     * Synchronously sends request to UFEGW and waits for UFE response, REQ/REP pattern\n     * \\param request request to send. Ownership of UFEMessage unique ptr IS taken. \\see UFEMessage\n     * \\return\n     */\n    UFECPPAPI UFEMessagePtr request(UFEMessage::Builder\u0026\u0026 request);\n    /**\n     * Send message to responder channel. Back channel patern.\n     * \\param msg request to send. Ownership of UFEMessage unique ptr IS taken. \\see UFEMessage\n     */\n    UFECPPAPI void respond(UFEMessage::Builder\u0026\u0026 msg);\n};\n```\n\n`UFEedClient` usage sample:\n\n```c++\n struct Listener: public UFEedClient::Listener {...} listener;\n auto _uc = make_shared\u003cUFEedClient\u003e(UFEedConfiguration()\n    .max_io_threads(2)\n    .poll_interval_ms(1)\n    .subscriber(SUBSCRIBER_DEFAULT)\n    .responder_topic(\"ufegw-requester\")\n , \u0026listener);\n _uc-\u003econnect();\n // logon\n auto login = _uc-\u003ecreate_message();\n login-\u003eset_long_name(\"login\")\n    .set_type(WireMessage::st_system)\n    .set_service_id(UFE_CMD_LOGIN)\n    .add_field(UFE_CMD, UFE_CMD_LOGIN)\n    .add_field(UFE_LOGIN_ID, \"abcdef\")\n    .add_field(UFE_LOGIN_PW, \"5e8848\");\n auto response = _uc-\u003erequest(move(login));\n ...\n _uc-\u003estop();\n _uc.reset();\n```\n\n# Constants\n\nThe `UFEed_C++` maintains a list of constant values that translate to integer\ncodes in the UFEGW. These integer codes are used to identify System API\nservices as well as general FIX functionality. A full list of these\nconstants is available under `include/ufecpp/ufeconsts.hpp`.\n\n## FIX variants constants\n\nThe `UFEed_C++` provides constants for all stock FIX variants:\n\n```c++\n#include \u003cufecpp/ufe_cpp_fields_fix50sp2.hpp\u003e\n...\n// NOS creation\nusing namespace FIX50SP2::Field;\nauto nos = _uc-\u003ecreate_message()\n    .set_long_name(\"NewOrderSingle\")\n    .set_type(WireMessage::st_fixmsg)\n    .set_service_id(1)\n    .set_name(MsgType::NEWORDERSINGLE)\n    .add_field(ClOrdID::tag, \"123\")\n    .add_field(TransactTime::tag, std::chrono::system_clock::now())\n    .add_field(ExecInst::tag, ExecInst::ALL_OR_NONE)\n    .add_field(OrdType::tag, OrdType::LIMIT)\n    .add_field(Side::tag, Side::BUY);\n```\n\n# Building\n\nThe `UFEed_C++` build is CMake based. To build use the following command line:\n```shell\nmkdir .build\ncd .build\ncmake ..\nmake -j4\n```\n\n`UFEed_C++` cand be used with address sanitizer by setting `-DUFECPP_ENABLE_ADDRESS_SANITIZER=ON` at cmake command line. To specify cmake install directory use standard cmake approach by setting `-DCMAKE_INSTALL_PREFIX=\u003cinstall_root\u003e` at cmake command line\n\nThe `UFEed_C++` provides a simple sample to use as a starting point for UFEed\nC++ development. The sample is under samples folder. To build sample,\nyou have to set `UFEed_C++` installation root directory as a cmake command line\nparameter:\n```shell\ncd samples\nmkdir .build\ncd .build\ncmake -DUFECPP_ROOT=\u003cUFEed_C++ install dir\u003e ..\nmake -j4\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffix8mt%2Fufeed_bindings_cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffix8mt%2Fufeed_bindings_cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffix8mt%2Fufeed_bindings_cpp/lists"}