diff options
Diffstat (limited to 'dev/examples')
| -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; |
