diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-18 07:44:48 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-18 07:55:34 +0100 |
| commit | 9eec329ebdf4cf079619edb58dbcd78ce42b8626 (patch) | |
| tree | b9b6d442f8a92fea4c8943a1504dba105b133596 /dev/examples/fix | |
| parent | ce3ce66e005eb54b315dbc0c78a74e56e2db4191 (diff) | |
feat: lib: error_handler improvements, new method. FIX module improvements.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
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; |
