diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-18 07:56:32 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-18 07:56:32 +0100 |
| commit | 4fd646501b75cb1d94a6e17d2387372d72ce797b (patch) | |
| tree | b9b6d442f8a92fea4c8943a1504dba105b133596 /dev/examples/fix | |
| parent | d6d127aefb6819fa97ef11aef0998c03a3aad88e (diff) | |
| parent | 9eec329ebdf4cf079619edb58dbcd78ce42b8626 (diff) | |
Merge pull request #10 from amlel-el-mahrouss/develop
fix: IO and FIX modules.
Diffstat (limited to 'dev/examples/fix')
| -rw-r--r-- | dev/examples/fix/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | dev/examples/fix/fix.cc | 9 |
2 files changed, 9 insertions, 3 deletions
diff --git a/dev/examples/fix/CMakeLists.txt b/dev/examples/fix/CMakeLists.txt index db8921b..5ed31e7 100644 --- a/dev/examples/fix/CMakeLists.txt +++ b/dev/examples/fix/CMakeLists.txt @@ -6,7 +6,10 @@ project( VERSION 1.0 LANGUAGES CXX) +find_package(Boost REQUIRED COMPONENTS container) + add_executable(Fix fix.cc) +target_link_libraries(Fix PRIVATE Boost::container) set_property(TARGET Fix PROPERTY CXX_STANDARD 20) target_include_directories(Fix PUBLIC ../../) diff --git a/dev/examples/fix/fix.cc b/dev/examples/fix/fix.cc index ec6668a..4015a67 100644 --- a/dev/examples/fix/fix.cc +++ b/dev/examples/fix/fix.cc @@ -4,10 +4,12 @@ licensed under the MIT license */ +#include <lib/core/error_handler.hpp> #include <lib/net/modem.hpp> #include <lib/fix/fix.hpp> #include <iostream> #include <unistd.h> +#include <lib/io/print.hpp> #include <sys/socket.h> /* finally test it */ @@ -22,12 +24,13 @@ int main(int argc, char** argv) std::cout << "magic_len=" << fix.magic_len_ << std::endl; std::cout << "is_valid=" << std::boolalpha << fix.is_valid() << std::endl; - ocl::fix::must_pass(fix); + ocl::basic_error_handler handler; + ocl::fix::must_pass<char, ocl::basic_error_handler>(fix, handler); for (auto fields : fix.body_) { - std::cout << "key=" << fields.first; - std::cout << ":value=" << fields.second << std::endl; + ocl::io::print("key=", fields.first); + ocl::io::print(", value=", fields.second); } return 0; |
