diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b743fe8e2..f1e5b5e9f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,8 +28,8 @@ on: jobs: build_windows: - runs-on: windows-2022 - name: "Windows 2022 Arch: ${{ matrix.arch }}, Shared: ${{ matrix.shared }}" + runs-on: windows-latest + name: "Windows latest Arch: ${{ matrix.arch }}, Shared: ${{ matrix.shared }}" strategy: matrix: arch: ["x86", "amd64"] diff --git a/CMakeLists.txt b/CMakeLists.txt index 29b337cb9..d1220305c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ set(AGENT_VERSION_MAJOR 2) set(AGENT_VERSION_MINOR 6) set(AGENT_VERSION_PATCH 0) -set(AGENT_VERSION_BUILD 2) +set(AGENT_VERSION_BUILD 3) set(AGENT_VERSION_RC "") # This minimum version is to support Visual Studio 2019 and C++ feature checking and FetchContent @@ -22,13 +22,14 @@ set(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_DATADIR}/mtconnect") message(INFO " Shared build: ${SHARED_AGENT_LIB}") -project(cppagent LANGUAGES C CXX) - # We will define these properties by default for each CMake target to be created. -set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) -set(CXX_COMPILE_FEATURES cxx_std_17) +set(CXX_COMPILE_FEATURES cxx_std_20) +set(CMAKE_OSX_DEPLOYMENT_TARGET 13.3) + +project(cppagent LANGUAGES C CXX) set(WITH_RUBY ON CACHE STRING "With Ruby Support") diff --git a/agent/cppagent.cpp b/agent/cppagent.cpp index 3557e01a4..12f728208 100644 --- a/agent/cppagent.cpp +++ b/agent/cppagent.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/conan/mqtt_cpp/conanfile.py b/conan/mqtt_cpp/conanfile.py index 35450edf5..f5051e99f 100644 --- a/conan/mqtt_cpp/conanfile.py +++ b/conan/mqtt_cpp/conanfile.py @@ -4,13 +4,13 @@ class MqttcppConan(ConanFile): name = "mqtt_cpp" - version = "13.2.1" + version = "13.2.2" license = "Boost Software License, Version 1.0" author = "Takatoshi Kondo redboltz@gmail.com" url = "https://github.com/redboltz/mqtt_cpp" description = "MQTT client/server for C++14 based on Boost.Asio" topics = ("mqtt") - requires = ["boost/1.85.0"] + requires = ["boost/1.88.0"] no_copy_source = True exports_sources = "include/*" diff --git a/conan/mruby/conanfile.py b/conan/mruby/conanfile.py index f1c85b456..32cb2762c 100644 --- a/conan/mruby/conanfile.py +++ b/conan/mruby/conanfile.py @@ -155,7 +155,7 @@ def search_header_path(name) if is_msvc(self): if self.settings.build_type == 'Debug': f.write(" conf.compilers.each { |c| c.flags << '/Od' }\n") - f.write(" conf.compilers.each { |c| c.flags << '/std:c++17' }\n") + f.write(" conf.compilers.each { |c| c.flags << '/std:c++20' }\n") f.write(" conf.compilers.each { |c| c.flags << '/%s' }\n" % msvc_runtime_flag(self)) else: if self.settings.build_type == 'Debug': diff --git a/conan/profiles/clang b/conan/profiles/clang index d80d9b6cb..7a37344ec 100644 --- a/conan/profiles/clang +++ b/conan/profiles/clang @@ -2,6 +2,7 @@ include(default) [settings] compiler.libcxx=libstdc++11 +compiler.cppstd=20 [env] CC=/usr/bin/clang diff --git a/conan/profiles/docker b/conan/profiles/docker index 2759a86de..9a48de725 100644 --- a/conan/profiles/docker +++ b/conan/profiles/docker @@ -2,6 +2,7 @@ include(default) [settings] compiler.libcxx=libstdc++11 +compiler.cppstd=20 [options] without_ipv6=True diff --git a/conan/profiles/gcc b/conan/profiles/gcc index 698cc39b2..cac1ad8f7 100644 --- a/conan/profiles/gcc +++ b/conan/profiles/gcc @@ -2,6 +2,7 @@ include(default) [settings] compiler.libcxx=libstdc++11 +compiler.cppstd=20 [system_tools] cmake/>3.23.0 \ No newline at end of file diff --git a/conan/profiles/macos b/conan/profiles/macos index 822d173c7..b7c3df9ac 100644 --- a/conan/profiles/macos +++ b/conan/profiles/macos @@ -2,7 +2,7 @@ include(default) [settings] compiler=apple-clang -compiler.cppstd=gnu17 +compiler.cppstd=20 [system_tools] cmake/>3.26.0 diff --git a/conan/profiles/vs32 b/conan/profiles/vs32 index fb406b017..3a5f87099 100644 --- a/conan/profiles/vs32 +++ b/conan/profiles/vs32 @@ -2,11 +2,9 @@ include(default) [settings] compiler=msvc -compiler.cppstd=17 +compiler.cppstd=20 arch=x86 compiler.runtime=static compiler.runtime_type=Release build_type=Release -[options] -winver=0x0600 diff --git a/conan/profiles/vs32debug b/conan/profiles/vs32debug index 54344e405..c88c703e0 100644 --- a/conan/profiles/vs32debug +++ b/conan/profiles/vs32debug @@ -2,11 +2,8 @@ include(default) [settings] compiler=msvc -compiler.cppstd=17 +compiler.cppstd=20 arch=x86 compiler.runtime=static compiler.runtime_type=Debug build_type=Debug - -[options] -winver=0x0600 diff --git a/conan/profiles/vs32shared b/conan/profiles/vs32shared index d30b8f54c..a06bc0799 100644 --- a/conan/profiles/vs32shared +++ b/conan/profiles/vs32shared @@ -2,13 +2,9 @@ include(default) [settings] compiler=msvc -compiler.cppstd=17 +compiler.cppstd=20 arch=x86 compiler.runtime=dynamic compiler.runtime_type=Release build_type=Release - -[options] -shared=True -winver=0x0600 diff --git a/conan/profiles/vs64 b/conan/profiles/vs64 index 729464e42..3e639b8cd 100644 --- a/conan/profiles/vs64 +++ b/conan/profiles/vs64 @@ -2,7 +2,7 @@ include(default) [settings] compiler=msvc -compiler.cppstd=17 +compiler.cppstd=20 arch=x86_64 compiler.runtime=static compiler.runtime_type=Release diff --git a/conan/profiles/vs64debug b/conan/profiles/vs64debug index 226a6a3fe..9445c691d 100644 --- a/conan/profiles/vs64debug +++ b/conan/profiles/vs64debug @@ -2,7 +2,7 @@ include(default) [settings] compiler=msvc -compiler.cppstd=17 +compiler.cppstd=20 arch=x86_64 compiler.runtime=static compiler.runtime_type=Debug diff --git a/conan/profiles/vs64shared b/conan/profiles/vs64shared index ebea4cd9a..13548f255 100644 --- a/conan/profiles/vs64shared +++ b/conan/profiles/vs64shared @@ -2,7 +2,7 @@ include(default) [settings] compiler=msvc -compiler.cppstd=17 +compiler.cppstd=20 arch=x86_64 compiler.runtime=dynamic compiler.runtime_type=Release diff --git a/conan/profiles/vsxp b/conan/profiles/vsxp deleted file mode 100644 index 10d64e4a1..000000000 --- a/conan/profiles/vsxp +++ /dev/null @@ -1,15 +0,0 @@ -include(default) - -[settings] -compiler=msvc -arch=x86 -compiler.cppstd=17 -compiler.runtime=static -compiler.runtime_type=Release -build_type=Release -compiler.toolset=v141_xp - -[options] -winver=0x0501 -with_ruby=False -date:header_only=True diff --git a/conan/profiles/xcode b/conan/profiles/xcode index 3121ffdd6..bea2b337a 100644 --- a/conan/profiles/xcode +++ b/conan/profiles/xcode @@ -1,7 +1,7 @@ include(default) [settings] -compiler.cppstd=17 +compiler.cppstd=20 [platform_tool_requires] cmake/3.26.4 diff --git a/conanfile.py b/conanfile.py index 60702ba63..94213e50e 100644 --- a/conanfile.py +++ b/conanfile.py @@ -35,7 +35,7 @@ class MTConnectAgentConan(ConanFile): "with_ruby": True, "development": False, "shared": False, - "winver": "0x0602", + "winver": "0x0A00", "with_docs": False, "cpack": False, "agent_prefix": None, @@ -84,10 +84,6 @@ def layout(self): self.folders.build_folder_vars = ["options.shared", "settings.arch"] cmake_layout(self) - def layout(self): - self.folders.build_folder_vars = ["options.shared", "settings.arch"] - cmake_layout(self) - def config_options(self): if is_msvc(self): self.options.rm_safe("fPIC") @@ -105,6 +101,7 @@ def tool_requires_version(self, package, version): self.output.info(f"Version of {package} is {ver}") else: self.output.info(f"Command: '{command}' returned {res}") + if ver < version: ver_text = '.'.join([str(x) for x in version]) self.output.info(f"Old version of {package}, requesting tool {package}/{ver_text}") @@ -118,19 +115,19 @@ def build_requirements(self): self.tool_requires_version("doxygen", [1, 14, 0]) def requirements(self): - self.requires("boost/1.85.0", headers=True, libs=True, transitive_headers=True, transitive_libs=True) - self.requires("libxml2/2.10.3", headers=True, libs=True, visible=True, transitive_headers=True, transitive_libs=True) + self.requires("boost/1.88.0", headers=True, libs=True, transitive_headers=True, transitive_libs=True) + self.requires("libxml2/2.14.5", headers=True, libs=True, visible=True, transitive_headers=True, transitive_libs=True) self.requires("date/3.0.4", headers=True, libs=True, transitive_headers=True, transitive_libs=True) - self.requires("nlohmann_json/3.9.1", headers=True, libs=False, transitive_headers=True, transitive_libs=False) - self.requires("openssl/3.0.8", headers=True, libs=True, transitive_headers=True, transitive_libs=True) - self.requires("rapidjson/cci.20220822", headers=True, libs=False, transitive_headers=True, transitive_libs=False) - self.requires("mqtt_cpp/13.2.1", headers=True, libs=False, transitive_headers=True, transitive_libs=False) + self.requires("nlohmann_json/3.12.0", headers=True, libs=False, transitive_headers=True, transitive_libs=False) + self.requires("openssl/3.5.4", headers=True, libs=True, transitive_headers=True, transitive_libs=True) + self.requires("rapidjson/cci.20230929", headers=True, libs=False, transitive_headers=True, transitive_libs=False) + self.requires("mqtt_cpp/13.2.2", headers=True, libs=False, transitive_headers=True, transitive_libs=False) self.requires("bzip2/1.0.8", headers=True, libs=True, transitive_headers=True, transitive_libs=True) if self.options.with_ruby: self.requires("mruby/3.2.0", headers=True, libs=True, transitive_headers=True, transitive_libs=True) - self.requires("gtest/1.10.0", headers=True, libs=True, transitive_headers=True, transitive_libs=True, test=True) + self.requires("gtest/1.17.0", headers=True, libs=True, transitive_headers=True, transitive_libs=True, test=True) def configure(self): if self.options.shared: @@ -143,9 +140,6 @@ def configure(self): if is_msvc(self): self.options["boost/*"].extra_b2_flags = ("define=BOOST_USE_WINAPI_VERSION=" + str(self.options.winver)) - if is_msvc(self): - self.options["boost/*"].extra_b2_flags = ("define=BOOST_USE_WINAPI_VERSION=" + str(self.options.winver)) - # Make sure shared builds use shared boost if is_msvc(self) and self.options.shared: print("**** Making boost, libxml2, gtest, and openssl shared") diff --git a/docker/alpine/Dockerfile b/docker/alpine/Dockerfile index 270e90ae0..ec7599cf2 100644 --- a/docker/alpine/Dockerfile +++ b/docker/alpine/Dockerfile @@ -74,7 +74,7 @@ WORKDIR /root/agent COPY . cppagent ARG WITH_TESTS=false -ARG WITH_TESTS_ARG=argument +ARG WITH_TESTS_ARG= # Build and optionally test. Unpack the dist to reduce overhead in the following release step. RUN if [ -z "$WITH_TESTS" ] || [ "$WITH_TESTS" = "false" ]; then \ @@ -94,7 +94,7 @@ RUN if [ -z "$WITH_TESTS" ] || [ "$WITH_TESTS" = "false" ]; then \ -o cpack_name=dist \ -o cpack_generator=TGZ \ -pr "$CONAN_PROFILE" \ - "${WITH_TESTS_ARG}" \ + ${WITH_TESTS_ARG} \ && tar xf dist.tar.gz \ && rm dist.tar.gz diff --git a/docker/ubuntu/Dockerfile b/docker/ubuntu/Dockerfile index 7372a5466..a01755a12 100644 --- a/docker/ubuntu/Dockerfile +++ b/docker/ubuntu/Dockerfile @@ -46,13 +46,12 @@ ARG CONAN_CPU_COUNT=2 ARG WITH_RUBY='True' # set some variables -ENV PATH="$HOME/venv3.9/bin:$PATH" ENV CONAN_PROFILE='/root/agent/cppagent/conan/profiles/docker' # update os and add dependencies # note: Dockerfiles run as root by default, so don't need sudo -RUN apt-get update \ - && apt-get install -y \ +RUN apt clean && apt update \ + && apt install -y \ autoconf \ automake \ build-essential \ @@ -72,7 +71,7 @@ WORKDIR /root/agent COPY . cppagent ARG WITH_TESTS=false -ARG WITH_TESTS_ARG=argument +ARG WITH_TESTS_ARG= # Build and optionally test RUN if [ -z "$WITH_TESTS" ] || [ "$WITH_TESTS" = "false" ]; then \ @@ -91,7 +90,7 @@ RUN if [ -z "$WITH_TESTS" ] || [ "$WITH_TESTS" = "false" ]; then \ -o cpack_name=dist \ -o cpack_generator=TGZ \ -pr "$CONAN_PROFILE" \ - "${WITH_TESTS_ARG}" \ + ${WITH_TESTS_ARG} \ && tar xf dist.tar.gz \ && rm dist.tar.gz diff --git a/src/mtconnect/agent.cpp b/src/mtconnect/agent.cpp index bac1512c9..8efbb565c 100644 --- a/src/mtconnect/agent.cpp +++ b/src/mtconnect/agent.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -477,7 +477,7 @@ namespace mtconnect { return; } - auto callback = [=](config::AsyncContext &context) { + auto callback = [=, this](config::AsyncContext &context) { try { bool changed = false; @@ -604,7 +604,7 @@ namespace mtconnect { createUniqueIds(device); LOG(info) << "Checking if device " << *uuid << " has changed"; - if (*device != *oldDev) + if (device->different(*oldDev)) { LOG(info) << "Device " << *uuid << " changed, updating model"; diff --git a/src/mtconnect/agent.hpp b/src/mtconnect/agent.hpp index cd11c975f..79fc144fd 100644 --- a/src/mtconnect/agent.hpp +++ b/src/mtconnect/agent.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/asset.cpp b/src/mtconnect/asset/asset.cpp index ac51d0cd9..92422d010 100644 --- a/src/mtconnect/asset/asset.cpp +++ b/src/mtconnect/asset/asset.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/asset.hpp b/src/mtconnect/asset/asset.hpp index 6d9fdc096..715b31cee 100644 --- a/src/mtconnect/asset/asset.hpp +++ b/src/mtconnect/asset/asset.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/asset_buffer.hpp b/src/mtconnect/asset/asset_buffer.hpp index 662780745..77d8d09cb 100644 --- a/src/mtconnect/asset/asset_buffer.hpp +++ b/src/mtconnect/asset/asset_buffer.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/asset_storage.hpp b/src/mtconnect/asset/asset_storage.hpp index ff90e49a4..5b13c2ed3 100644 --- a/src/mtconnect/asset/asset_storage.hpp +++ b/src/mtconnect/asset/asset_storage.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/component_configuration_parameters.cpp b/src/mtconnect/asset/component_configuration_parameters.cpp index d341b6d8c..687a56c74 100644 --- a/src/mtconnect/asset/component_configuration_parameters.cpp +++ b/src/mtconnect/asset/component_configuration_parameters.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/component_configuration_parameters.hpp b/src/mtconnect/asset/component_configuration_parameters.hpp index fc40d3449..7fe5d85bd 100644 --- a/src/mtconnect/asset/component_configuration_parameters.hpp +++ b/src/mtconnect/asset/component_configuration_parameters.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/cutting_tool.cpp b/src/mtconnect/asset/cutting_tool.cpp index 245f0b2a6..3c09a973f 100644 --- a/src/mtconnect/asset/cutting_tool.cpp +++ b/src/mtconnect/asset/cutting_tool.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/cutting_tool.hpp b/src/mtconnect/asset/cutting_tool.hpp index 969a01270..af98b1e97 100644 --- a/src/mtconnect/asset/cutting_tool.hpp +++ b/src/mtconnect/asset/cutting_tool.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/file_asset.cpp b/src/mtconnect/asset/file_asset.cpp index b001c86ca..9e3a30574 100644 --- a/src/mtconnect/asset/file_asset.cpp +++ b/src/mtconnect/asset/file_asset.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/file_asset.hpp b/src/mtconnect/asset/file_asset.hpp index 9c5ea9797..df01b7bc8 100644 --- a/src/mtconnect/asset/file_asset.hpp +++ b/src/mtconnect/asset/file_asset.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/fixture.cpp b/src/mtconnect/asset/fixture.cpp index 16bf509a8..2225f9f4b 100644 --- a/src/mtconnect/asset/fixture.cpp +++ b/src/mtconnect/asset/fixture.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/fixture.hpp b/src/mtconnect/asset/fixture.hpp index 5823f9432..f89b6257d 100644 --- a/src/mtconnect/asset/fixture.hpp +++ b/src/mtconnect/asset/fixture.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/pallet.cpp b/src/mtconnect/asset/pallet.cpp index 1f3023620..dfb84916b 100644 --- a/src/mtconnect/asset/pallet.cpp +++ b/src/mtconnect/asset/pallet.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/pallet.hpp b/src/mtconnect/asset/pallet.hpp index 77894aaf4..bf0a2690f 100644 --- a/src/mtconnect/asset/pallet.hpp +++ b/src/mtconnect/asset/pallet.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/physical_asset.cpp b/src/mtconnect/asset/physical_asset.cpp index c5e413d0b..aa609d018 100644 --- a/src/mtconnect/asset/physical_asset.cpp +++ b/src/mtconnect/asset/physical_asset.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/physical_asset.hpp b/src/mtconnect/asset/physical_asset.hpp index 216bc73ca..05b7ae4eb 100644 --- a/src/mtconnect/asset/physical_asset.hpp +++ b/src/mtconnect/asset/physical_asset.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/qif_document.cpp b/src/mtconnect/asset/qif_document.cpp index 6c762cd12..e227247bd 100644 --- a/src/mtconnect/asset/qif_document.cpp +++ b/src/mtconnect/asset/qif_document.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/qif_document.hpp b/src/mtconnect/asset/qif_document.hpp index 45bc7f2f2..a37b4de02 100644 --- a/src/mtconnect/asset/qif_document.hpp +++ b/src/mtconnect/asset/qif_document.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/raw_material.cpp b/src/mtconnect/asset/raw_material.cpp index 0ca15b37d..58a92f99e 100644 --- a/src/mtconnect/asset/raw_material.cpp +++ b/src/mtconnect/asset/raw_material.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/raw_material.hpp b/src/mtconnect/asset/raw_material.hpp index 76af8d858..8f61ca959 100644 --- a/src/mtconnect/asset/raw_material.hpp +++ b/src/mtconnect/asset/raw_material.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/buffer/checkpoint.cpp b/src/mtconnect/buffer/checkpoint.cpp index fd5ec3034..9e39341d2 100644 --- a/src/mtconnect/buffer/checkpoint.cpp +++ b/src/mtconnect/buffer/checkpoint.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/buffer/checkpoint.hpp b/src/mtconnect/buffer/checkpoint.hpp index b830c223d..48c98ed44 100644 --- a/src/mtconnect/buffer/checkpoint.hpp +++ b/src/mtconnect/buffer/checkpoint.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/buffer/circular_buffer.hpp b/src/mtconnect/buffer/circular_buffer.hpp index eb3b3f4d6..3ac0d475a 100644 --- a/src/mtconnect/buffer/circular_buffer.hpp +++ b/src/mtconnect/buffer/circular_buffer.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -326,8 +326,8 @@ namespace mtconnect::buffer { mutable std::recursive_mutex m_sequenceLock; // Sequence number - volatile SequenceNumber_t m_sequence; - volatile SequenceNumber_t m_firstSequence; + SequenceNumber_t m_sequence; + SequenceNumber_t m_firstSequence; // The sliding/circular buffer to hold all of the events/sample data unsigned int m_slidingBufferSize; diff --git a/src/mtconnect/config.hpp b/src/mtconnect/config.hpp index a522fe123..a4868684e 100644 --- a/src/mtconnect/config.hpp +++ b/src/mtconnect/config.hpp @@ -1,7 +1,7 @@ #pragma once // -// Copyright Copyright 2009-2024, AMT � The Association For Manufacturing Technology (�AMT�) +// Copyright Copyright 2009-2025, AMT � The Association For Manufacturing Technology (�AMT�) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/configuration/agent_config.cpp b/src/mtconnect/configuration/agent_config.cpp index 45cd0b240..48ee6f8b2 100644 --- a/src/mtconnect/configuration/agent_config.cpp +++ b/src/mtconnect/configuration/agent_config.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -366,7 +366,7 @@ namespace mtconnect::configuration { using std::placeholders::_1; - m_monitorTimer.expires_from_now(100ms); + m_monitorTimer.expires_after(100ms); m_monitorTimer.async_wait(boost::bind(&AgentConfiguration::monitorFiles, this, _1)); } else @@ -388,7 +388,7 @@ namespace mtconnect::configuration { using std::placeholders::_1; - m_monitorTimer.expires_from_now(m_monitorInterval); + m_monitorTimer.expires_after(m_monitorInterval); m_monitorTimer.async_wait(boost::bind(&AgentConfiguration::monitorFiles, this, _1)); } @@ -1252,3 +1252,4 @@ namespace mtconnect::configuration { return false; } } // namespace mtconnect::configuration + diff --git a/src/mtconnect/configuration/agent_config.hpp b/src/mtconnect/configuration/agent_config.hpp index eb0b51414..72191af28 100644 --- a/src/mtconnect/configuration/agent_config.hpp +++ b/src/mtconnect/configuration/agent_config.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/configuration/async_context.hpp b/src/mtconnect/configuration/async_context.hpp index 910c07ee1..aa92c3e5b 100644 --- a/src/mtconnect/configuration/async_context.hpp +++ b/src/mtconnect/configuration/async_context.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/configuration/config_options.hpp b/src/mtconnect/configuration/config_options.hpp index b0ca2e951..b192c70d4 100644 --- a/src/mtconnect/configuration/config_options.hpp +++ b/src/mtconnect/configuration/config_options.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/configuration/hook_manager.hpp b/src/mtconnect/configuration/hook_manager.hpp index d831146c8..4988e8277 100644 --- a/src/mtconnect/configuration/hook_manager.hpp +++ b/src/mtconnect/configuration/hook_manager.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/configuration/parser.cpp b/src/mtconnect/configuration/parser.cpp index 2baeb8e15..c365e9563 100644 --- a/src/mtconnect/configuration/parser.cpp +++ b/src/mtconnect/configuration/parser.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/configuration/parser.hpp b/src/mtconnect/configuration/parser.hpp index 13d9bb0d8..7c7a11c88 100644 --- a/src/mtconnect/configuration/parser.hpp +++ b/src/mtconnect/configuration/parser.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/configuration/service.cpp b/src/mtconnect/configuration/service.cpp index a3ef8c0dd..a98185912 100644 --- a/src/mtconnect/configuration/service.cpp +++ b/src/mtconnect/configuration/service.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -220,7 +220,7 @@ namespace mtconnect { g_service = this; m_isService = true; - SERVICE_TABLE_ENTRY DispatchTable[] = {{"", (LPSERVICE_MAIN_FUNCTION)SvcMain}, + SERVICE_TABLE_ENTRY DispatchTable[] = {{LPSTR(""), (LPSERVICE_MAIN_FUNCTION)SvcMain}, {nullptr, nullptr}}; if (StartServiceCtrlDispatcher(DispatchTable) == 0) @@ -229,7 +229,7 @@ namespace mtconnect { } else { - SvcReportEvent("StartServiceCtrlDispatcher"); + SvcReportEvent(LPSTR("StartServiceCtrlDispatcher")); } } catch (std::exception &e) @@ -516,7 +516,7 @@ namespace mtconnect { if (!g_svcStatusHandle) { - SvcReportEvent("RegisterServiceCtrlHandler"); + SvcReportEvent(LPSTR("RegisterServiceCtrlHandler")); return; } @@ -554,7 +554,7 @@ namespace mtconnect { auto res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, key, 0ul, KEY_READ, &agent); if (res != ERROR_SUCCESS) { - SvcReportEvent("RegOpenKey: Could not open MTConnect Agent Key"); + SvcReportEvent(LPSTR("RegOpenKey: Could not open MTConnect Agent Key")); ReportSvcStatus(SERVICE_STOPPED, 1ul, 0ul); return; } @@ -566,7 +566,7 @@ namespace mtconnect { agent = nullptr; if (res != ERROR_SUCCESS) { - SvcReportEvent("RegOpenKey: Could not open ConfigurationFile"); + SvcReportEvent(LPSTR("RegOpenKey: Could not open ConfigurationFile")); ReportSvcStatus(SERVICE_STOPPED, 1ul, 0ul); return; } diff --git a/src/mtconnect/configuration/service.hpp b/src/mtconnect/configuration/service.hpp index fca63e1e5..7795965be 100644 --- a/src/mtconnect/configuration/service.hpp +++ b/src/mtconnect/configuration/service.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/agent_device.cpp b/src/mtconnect/device_model/agent_device.cpp index 7c6c3fb02..287e4065a 100644 --- a/src/mtconnect/device_model/agent_device.cpp +++ b/src/mtconnect/device_model/agent_device.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/agent_device.hpp b/src/mtconnect/device_model/agent_device.hpp index 4b693b5e6..52aa94ed1 100644 --- a/src/mtconnect/device_model/agent_device.hpp +++ b/src/mtconnect/device_model/agent_device.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/component.cpp b/src/mtconnect/device_model/component.cpp index 779bccc12..ee8bcc030 100644 --- a/src/mtconnect/device_model/component.cpp +++ b/src/mtconnect/device_model/component.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/component.hpp b/src/mtconnect/device_model/component.hpp index 911b7a5ad..6288cb754 100644 --- a/src/mtconnect/device_model/component.hpp +++ b/src/mtconnect/device_model/component.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -219,7 +219,14 @@ namespace mtconnect { /// @return the data item list auto getDataItems() const { return getList("DataItems"); } + /// @brief compares the ids of the component for sorting + /// @param comp other component to compare against + /// @return `true` if this id is less than the comp id bool operator<(const Component &comp) const { return m_id < comp.getId(); } + + /// @brief compares the ids for equality + /// @param comp other component to compare against + /// @return `true` if this id is equal than the comp id bool operator==(const Component &comp) const { return m_id == comp.getId(); } /// @brief connected references by looking them up in the device diff --git a/src/mtconnect/device_model/composition.cpp b/src/mtconnect/device_model/composition.cpp index 40f57cd2a..d0bd73e68 100644 --- a/src/mtconnect/device_model/composition.cpp +++ b/src/mtconnect/device_model/composition.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT The Association For Manufacturing Technology (AMT) +// Copyright Copyright 2009-2025, AMT The Association For Manufacturing Technology (AMT) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/composition.hpp b/src/mtconnect/device_model/composition.hpp index 97bdad4c5..fc9f37955 100644 --- a/src/mtconnect/device_model/composition.hpp +++ b/src/mtconnect/device_model/composition.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/configuration.cpp b/src/mtconnect/device_model/configuration/configuration.cpp index 44cbcaa71..2af947dfb 100644 --- a/src/mtconnect/device_model/configuration/configuration.cpp +++ b/src/mtconnect/device_model/configuration/configuration.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/configuration.hpp b/src/mtconnect/device_model/configuration/configuration.hpp index dc01d1f3f..453eebb20 100644 --- a/src/mtconnect/device_model/configuration/configuration.hpp +++ b/src/mtconnect/device_model/configuration/configuration.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/coordinate_systems.cpp b/src/mtconnect/device_model/configuration/coordinate_systems.cpp index a36b27895..0785dca95 100644 --- a/src/mtconnect/device_model/configuration/coordinate_systems.cpp +++ b/src/mtconnect/device_model/configuration/coordinate_systems.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/coordinate_systems.hpp b/src/mtconnect/device_model/configuration/coordinate_systems.hpp index 8fdc819f3..117cc06e0 100644 --- a/src/mtconnect/device_model/configuration/coordinate_systems.hpp +++ b/src/mtconnect/device_model/configuration/coordinate_systems.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/image_file.cpp b/src/mtconnect/device_model/configuration/image_file.cpp index 84be05aaa..ae9f0d86d 100644 --- a/src/mtconnect/device_model/configuration/image_file.cpp +++ b/src/mtconnect/device_model/configuration/image_file.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT The Association For Manufacturing Technology (AMT) +// Copyright Copyright 2009-2025, AMT The Association For Manufacturing Technology (AMT) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/image_file.hpp b/src/mtconnect/device_model/configuration/image_file.hpp index 6aac7f61c..46e67540b 100644 --- a/src/mtconnect/device_model/configuration/image_file.hpp +++ b/src/mtconnect/device_model/configuration/image_file.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/motion.cpp b/src/mtconnect/device_model/configuration/motion.cpp index 1d7d06c34..59ba8ab5c 100644 --- a/src/mtconnect/device_model/configuration/motion.cpp +++ b/src/mtconnect/device_model/configuration/motion.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT The Association For Manufacturing Technology (AMT) +// Copyright Copyright 2009-2025, AMT The Association For Manufacturing Technology (AMT) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/motion.hpp b/src/mtconnect/device_model/configuration/motion.hpp index 1594e309d..f5fa9c765 100644 --- a/src/mtconnect/device_model/configuration/motion.hpp +++ b/src/mtconnect/device_model/configuration/motion.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/relationships.cpp b/src/mtconnect/device_model/configuration/relationships.cpp index a2ed6d78f..0ad5a6a1b 100644 --- a/src/mtconnect/device_model/configuration/relationships.cpp +++ b/src/mtconnect/device_model/configuration/relationships.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT The Association For Manufacturing Technology (AMT) +// Copyright Copyright 2009-2025, AMT The Association For Manufacturing Technology (AMT) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/relationships.hpp b/src/mtconnect/device_model/configuration/relationships.hpp index c2a6fb462..7bb420410 100644 --- a/src/mtconnect/device_model/configuration/relationships.hpp +++ b/src/mtconnect/device_model/configuration/relationships.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/sensor_configuration.cpp b/src/mtconnect/device_model/configuration/sensor_configuration.cpp index 2bb26ecde..95b507605 100644 --- a/src/mtconnect/device_model/configuration/sensor_configuration.cpp +++ b/src/mtconnect/device_model/configuration/sensor_configuration.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT The Association For Manufacturing Technology (AMT) +// Copyright Copyright 2009-2025, AMT The Association For Manufacturing Technology (AMT) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/sensor_configuration.hpp b/src/mtconnect/device_model/configuration/sensor_configuration.hpp index 8eeb25b64..295c946a0 100644 --- a/src/mtconnect/device_model/configuration/sensor_configuration.hpp +++ b/src/mtconnect/device_model/configuration/sensor_configuration.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/solid_model.cpp b/src/mtconnect/device_model/configuration/solid_model.cpp index 6c96236b1..75a969a8a 100644 --- a/src/mtconnect/device_model/configuration/solid_model.cpp +++ b/src/mtconnect/device_model/configuration/solid_model.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT The Association For Manufacturing Technology (AMT) +// Copyright Copyright 2009-2025, AMT The Association For Manufacturing Technology (AMT) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/solid_model.hpp b/src/mtconnect/device_model/configuration/solid_model.hpp index fa406d9a5..9ffdbfb68 100644 --- a/src/mtconnect/device_model/configuration/solid_model.hpp +++ b/src/mtconnect/device_model/configuration/solid_model.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/specifications.cpp b/src/mtconnect/device_model/configuration/specifications.cpp index a4d55bc0c..daa49b8b8 100644 --- a/src/mtconnect/device_model/configuration/specifications.cpp +++ b/src/mtconnect/device_model/configuration/specifications.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/specifications.hpp b/src/mtconnect/device_model/configuration/specifications.hpp index 226af76a1..2b65e5216 100644 --- a/src/mtconnect/device_model/configuration/specifications.hpp +++ b/src/mtconnect/device_model/configuration/specifications.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/data_item/constraints.hpp b/src/mtconnect/device_model/data_item/constraints.hpp index 21c362955..da1870f5c 100644 --- a/src/mtconnect/device_model/data_item/constraints.hpp +++ b/src/mtconnect/device_model/data_item/constraints.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/data_item/data_item.cpp b/src/mtconnect/device_model/data_item/data_item.cpp index c3007387e..a6828900c 100644 --- a/src/mtconnect/device_model/data_item/data_item.cpp +++ b/src/mtconnect/device_model/data_item/data_item.cpp @@ -1,6 +1,6 @@ // // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/data_item/data_item.hpp b/src/mtconnect/device_model/data_item/data_item.hpp index 65f769807..2c41a2385 100644 --- a/src/mtconnect/device_model/data_item/data_item.hpp +++ b/src/mtconnect/device_model/data_item/data_item.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/data_item/definition.hpp b/src/mtconnect/device_model/data_item/definition.hpp index f1ba7245b..97715e5a4 100644 --- a/src/mtconnect/device_model/data_item/definition.hpp +++ b/src/mtconnect/device_model/data_item/definition.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/data_item/filter.hpp b/src/mtconnect/device_model/data_item/filter.hpp index 779f6d3cc..1337eb1df 100644 --- a/src/mtconnect/device_model/data_item/filter.hpp +++ b/src/mtconnect/device_model/data_item/filter.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/data_item/relationships.hpp b/src/mtconnect/device_model/data_item/relationships.hpp index 10c34c8c3..78861aa86 100644 --- a/src/mtconnect/device_model/data_item/relationships.hpp +++ b/src/mtconnect/device_model/data_item/relationships.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/data_item/source.hpp b/src/mtconnect/device_model/data_item/source.hpp index e0895282d..3b18306a4 100644 --- a/src/mtconnect/device_model/data_item/source.hpp +++ b/src/mtconnect/device_model/data_item/source.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/data_item/unit_conversion.cpp b/src/mtconnect/device_model/data_item/unit_conversion.cpp index 78fc8a439..1d052dcf8 100644 --- a/src/mtconnect/device_model/data_item/unit_conversion.cpp +++ b/src/mtconnect/device_model/data_item/unit_conversion.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/data_item/unit_conversion.hpp b/src/mtconnect/device_model/data_item/unit_conversion.hpp index 068a43aa7..3ec8e43ea 100644 --- a/src/mtconnect/device_model/data_item/unit_conversion.hpp +++ b/src/mtconnect/device_model/data_item/unit_conversion.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/description.cpp b/src/mtconnect/device_model/description.cpp index 9a7c1cb4f..57c1dc130 100644 --- a/src/mtconnect/device_model/description.cpp +++ b/src/mtconnect/device_model/description.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/description.hpp b/src/mtconnect/device_model/description.hpp index 8789eba6f..c64216dd5 100644 --- a/src/mtconnect/device_model/description.hpp +++ b/src/mtconnect/device_model/description.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/device.cpp b/src/mtconnect/device_model/device.cpp index bb58cb0a1..fea72bc30 100644 --- a/src/mtconnect/device_model/device.cpp +++ b/src/mtconnect/device_model/device.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/device.hpp b/src/mtconnect/device_model/device.hpp index 650fe3ecc..7042f069f 100644 --- a/src/mtconnect/device_model/device.hpp +++ b/src/mtconnect/device_model/device.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/reference.cpp b/src/mtconnect/device_model/reference.cpp index bc48b32fa..1d951e805 100644 --- a/src/mtconnect/device_model/reference.cpp +++ b/src/mtconnect/device_model/reference.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT The Association For Manufacturing Technology (AMT) +// Copyright Copyright 2009-2025, AMT The Association For Manufacturing Technology (AMT) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/reference.hpp b/src/mtconnect/device_model/reference.hpp index ba9595a5a..f3a41dc60 100644 --- a/src/mtconnect/device_model/reference.hpp +++ b/src/mtconnect/device_model/reference.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT � The Association For Manufacturing Technology (�AMT�) +// Copyright Copyright 2009-2025, AMT � The Association For Manufacturing Technology (�AMT�) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/entity/data_set.cpp b/src/mtconnect/entity/data_set.cpp index 4358e762c..9548f64a1 100644 --- a/src/mtconnect/entity/data_set.cpp +++ b/src/mtconnect/entity/data_set.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/entity/data_set.hpp b/src/mtconnect/entity/data_set.hpp index d528f402d..671768b19 100644 --- a/src/mtconnect/entity/data_set.hpp +++ b/src/mtconnect/entity/data_set.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -83,7 +83,7 @@ namespace mtconnect::entity { /// @param value the a data set variant /// @param removed `true` if the key has been removed Entry(const std::string &key, T value, bool removed = false) - : m_key(key), m_value(std::move(value)), m_removed(removed) + : m_key(key), m_value(std::forward(value)), m_removed(removed) {} /// @brief Create a data set entry with just a key (used for search) /// @param key diff --git a/src/mtconnect/entity/entity.cpp b/src/mtconnect/entity/entity.cpp index 9a55ca18f..0b8da9a45 100644 --- a/src/mtconnect/entity/entity.cpp +++ b/src/mtconnect/entity/entity.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/entity/entity.hpp b/src/mtconnect/entity/entity.hpp index aa6ac8a19..c70872596 100644 --- a/src/mtconnect/entity/entity.hpp +++ b/src/mtconnect/entity/entity.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -369,15 +369,25 @@ namespace mtconnect { return empty; } + /// @brief checks if two entity models are different–does a deep analysis + /// @param other the other entity to check + /// @return `true` if the entities are different + bool different(const Entity &other) const; + + /// @brief cover method for entity comparison + /// @param other the other entity to check + /// @return `true` if the entities are different + bool different(const std::shared_ptr other) const { return different(*other); } + /// @brief compare two entities for equality /// @param other the other entity /// @return `true` if they have equal name and properties - bool operator==(const Entity &other) const; + bool operator==(const Entity &other) const { return !different(other); } /// @brief compare two entities for inequality /// @param other the other entity /// @return `true` if they have unequal name and properties - bool operator!=(const Entity &other) const { return !(*this == other); } + bool operator!=(const Entity &other) const { return different(other); } /// @brief update this entity to be the same as other /// @param other the other entity @@ -398,7 +408,7 @@ namespace mtconnect { boost::uuids::detail::sha1 sha1; hash(sha1); - unsigned int digest[5]; + unsigned char digest[20]; sha1.get_digest(digest); char encoded[32]; @@ -517,23 +527,23 @@ namespace mtconnect { inline bool operator!=(const Value &v1, const Value &v2) { return !(v1 == v2); } - inline bool Entity::operator==(const Entity &other) const + inline bool Entity::different(const Entity &other) const { if (m_name != other.m_name) - return false; + return true; if (m_properties.size() != other.m_properties.size()) - return false; + return true; for (auto it1 = m_properties.cbegin(), it2 = other.m_properties.cbegin(); it1 != m_properties.cend(); it1++, it2++) { if (it1->first != it2->first || it1->second != it2->second) { - return false; + return true; } } - return true; + return false; } /// @brief variant visitor to merge two entities diff --git a/src/mtconnect/entity/factory.cpp b/src/mtconnect/entity/factory.cpp index e763accdd..eb93aebd5 100644 --- a/src/mtconnect/entity/factory.cpp +++ b/src/mtconnect/entity/factory.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/entity/factory.hpp b/src/mtconnect/entity/factory.hpp index 6da238d40..2f9474721 100644 --- a/src/mtconnect/entity/factory.hpp +++ b/src/mtconnect/entity/factory.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/entity/json_parser.cpp b/src/mtconnect/entity/json_parser.cpp index 3976d2fb6..638924118 100644 --- a/src/mtconnect/entity/json_parser.cpp +++ b/src/mtconnect/entity/json_parser.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT The Association For Manufacturing Technology (AMT) +// Copyright Copyright 2009-2025, AMT The Association For Manufacturing Technology (AMT) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/entity/json_parser.hpp b/src/mtconnect/entity/json_parser.hpp index 2fa29a0bb..0e8b117d1 100644 --- a/src/mtconnect/entity/json_parser.hpp +++ b/src/mtconnect/entity/json_parser.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT � The Association For Manufacturing Technology (�AMT�) +// Copyright Copyright 2009-2025, AMT � The Association For Manufacturing Technology (�AMT�) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/entity/json_printer.hpp b/src/mtconnect/entity/json_printer.hpp index 47e64f648..5154ed33a 100644 --- a/src/mtconnect/entity/json_printer.hpp +++ b/src/mtconnect/entity/json_printer.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -306,7 +306,7 @@ namespace mtconnect::entity { printer.printEntity(entity); }); - return std::string(output.GetString(), output.GetLength()); + return std::string(output.GetString(), output.GetSize()); } /// @brief wrapper around the JsonPrinter print method that creates the correct printer @@ -325,7 +325,7 @@ namespace mtconnect::entity { printer.print(entity); }); - return std::string(output.GetString(), output.GetLength()); + return std::string(output.GetString(), output.GetSize()); } protected: diff --git a/src/mtconnect/entity/qname.hpp b/src/mtconnect/entity/qname.hpp index c2c5b9eda..e97e67954 100644 --- a/src/mtconnect/entity/qname.hpp +++ b/src/mtconnect/entity/qname.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/entity/requirement.cpp b/src/mtconnect/entity/requirement.cpp index 8198a71ba..51c2848d5 100644 --- a/src/mtconnect/entity/requirement.cpp +++ b/src/mtconnect/entity/requirement.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/entity/requirement.hpp b/src/mtconnect/entity/requirement.hpp index 1ed29f0bc..ebacbf824 100644 --- a/src/mtconnect/entity/requirement.hpp +++ b/src/mtconnect/entity/requirement.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/entity/xml_parser.cpp b/src/mtconnect/entity/xml_parser.cpp index 395270874..0a88a6269 100644 --- a/src/mtconnect/entity/xml_parser.cpp +++ b/src/mtconnect/entity/xml_parser.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -32,7 +32,7 @@ using namespace std; namespace mtconnect::entity { using namespace mtconnect::printer; - extern "C" void XMLCDECL entityXMLErrorFunc(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...) + extern "C" void XMLCDECL entityXMLErrorFunc([[maybe_unused]] void *ctx, const char *msg, ...) { va_list args; diff --git a/src/mtconnect/entity/xml_parser.hpp b/src/mtconnect/entity/xml_parser.hpp index d771dc866..30e76b036 100644 --- a/src/mtconnect/entity/xml_parser.hpp +++ b/src/mtconnect/entity/xml_parser.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/entity/xml_printer.cpp b/src/mtconnect/entity/xml_printer.cpp index f12ae1cd0..3cfb0ccb4 100644 --- a/src/mtconnect/entity/xml_printer.cpp +++ b/src/mtconnect/entity/xml_printer.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,6 +20,7 @@ #include #include +#include #include "mtconnect/logging.hpp" #include "mtconnect/printer/xml_printer_helper.hpp" diff --git a/src/mtconnect/entity/xml_printer.hpp b/src/mtconnect/entity/xml_printer.hpp index 23a8aa5dd..cb378b823 100644 --- a/src/mtconnect/entity/xml_printer.hpp +++ b/src/mtconnect/entity/xml_printer.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/logging.hpp b/src/mtconnect/logging.hpp index 7f7ac3714..80735efab 100644 --- a/src/mtconnect/logging.hpp +++ b/src/mtconnect/logging.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/mqtt/mqtt_authorization.hpp b/src/mtconnect/mqtt/mqtt_authorization.hpp index 73c79ace2..dabb69c02 100644 --- a/src/mtconnect/mqtt/mqtt_authorization.hpp +++ b/src/mtconnect/mqtt/mqtt_authorization.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/mqtt/mqtt_client.hpp b/src/mtconnect/mqtt/mqtt_client.hpp index 0924f926b..bf5050b91 100644 --- a/src/mtconnect/mqtt/mqtt_client.hpp +++ b/src/mtconnect/mqtt/mqtt_client.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/mqtt/mqtt_client_impl.hpp b/src/mtconnect/mqtt/mqtt_client_impl.hpp index 850387b89..9fb8db361 100644 --- a/src/mtconnect/mqtt/mqtt_client_impl.hpp +++ b/src/mtconnect/mqtt/mqtt_client_impl.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/mqtt/mqtt_server.hpp b/src/mtconnect/mqtt/mqtt_server.hpp index 8d38700a9..0a8f1fcea 100644 --- a/src/mtconnect/mqtt/mqtt_server.hpp +++ b/src/mtconnect/mqtt/mqtt_server.hpp @@ -1,5 +1,5 @@ -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/mtconnect/mqtt/mqtt_server_impl.hpp b/src/mtconnect/mqtt/mqtt_server_impl.hpp index 4c3b05715..ce8a9f621 100644 --- a/src/mtconnect/mqtt/mqtt_server_impl.hpp +++ b/src/mtconnect/mqtt/mqtt_server_impl.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/observation/change_observer.cpp b/src/mtconnect/observation/change_observer.cpp index f489b287c..522ec9707 100644 --- a/src/mtconnect/observation/change_observer.cpp +++ b/src/mtconnect/observation/change_observer.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/observation/change_observer.hpp b/src/mtconnect/observation/change_observer.hpp index 5b0dc1ad2..deb6fc950 100644 --- a/src/mtconnect/observation/change_observer.hpp +++ b/src/mtconnect/observation/change_observer.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/observation/observation.cpp b/src/mtconnect/observation/observation.cpp index f2a3609c5..58f276b16 100644 --- a/src/mtconnect/observation/observation.cpp +++ b/src/mtconnect/observation/observation.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/observation/observation.hpp b/src/mtconnect/observation/observation.hpp index bc2e48537..9aa52a07c 100644 --- a/src/mtconnect/observation/observation.hpp +++ b/src/mtconnect/observation/observation.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/parser/xml_parser.cpp b/src/mtconnect/parser/xml_parser.cpp index 6485ecfef..9f5363e75 100644 --- a/src/mtconnect/parser/xml_parser.cpp +++ b/src/mtconnect/parser/xml_parser.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -62,7 +62,7 @@ namespace mtconnect::parser { using namespace device_model; using namespace printer; - extern "C" void XMLCDECL agentXMLErrorFunc(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...) + extern "C" void XMLCDECL agentXMLErrorFunc([[maybe_unused]] void *ctx, const char *msg, ...) { va_list args; diff --git a/src/mtconnect/parser/xml_parser.hpp b/src/mtconnect/parser/xml_parser.hpp index e5747c987..ce5af0785 100644 --- a/src/mtconnect/parser/xml_parser.hpp +++ b/src/mtconnect/parser/xml_parser.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/convert_sample.hpp b/src/mtconnect/pipeline/convert_sample.hpp index 90dc9e907..a7b775aa1 100644 --- a/src/mtconnect/pipeline/convert_sample.hpp +++ b/src/mtconnect/pipeline/convert_sample.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/correct_timestamp.hpp b/src/mtconnect/pipeline/correct_timestamp.hpp index faddde4c3..8d33c2a04 100644 --- a/src/mtconnect/pipeline/correct_timestamp.hpp +++ b/src/mtconnect/pipeline/correct_timestamp.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/deliver.cpp b/src/mtconnect/pipeline/deliver.cpp index a97af1b20..c9d0e6648 100644 --- a/src/mtconnect/pipeline/deliver.cpp +++ b/src/mtconnect/pipeline/deliver.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -115,7 +115,7 @@ namespace mtconnect { } using std::placeholders::_1; - m_timer.expires_from_now(10s); + m_timer.expires_after(10s); m_timer.async_wait( boost::asio::bind_executor(m_strand, boost::bind(&ComputeMetrics::compute, ptr(), _1))); } diff --git a/src/mtconnect/pipeline/deliver.hpp b/src/mtconnect/pipeline/deliver.hpp index f48b45080..acd583bb4 100644 --- a/src/mtconnect/pipeline/deliver.hpp +++ b/src/mtconnect/pipeline/deliver.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/delta_filter.hpp b/src/mtconnect/pipeline/delta_filter.hpp index 313f92e49..f6e955f89 100644 --- a/src/mtconnect/pipeline/delta_filter.hpp +++ b/src/mtconnect/pipeline/delta_filter.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/duplicate_filter.hpp b/src/mtconnect/pipeline/duplicate_filter.hpp index 0493baa3b..981fe9c18 100644 --- a/src/mtconnect/pipeline/duplicate_filter.hpp +++ b/src/mtconnect/pipeline/duplicate_filter.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/guard.hpp b/src/mtconnect/pipeline/guard.hpp index 98cb89dca..1ed5a1271 100644 --- a/src/mtconnect/pipeline/guard.hpp +++ b/src/mtconnect/pipeline/guard.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/json_mapper.cpp b/src/mtconnect/pipeline/json_mapper.cpp index 6f4a072c4..127adcbe2 100644 --- a/src/mtconnect/pipeline/json_mapper.cpp +++ b/src/mtconnect/pipeline/json_mapper.cpp @@ -1,4 +1,4 @@ -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/json_mapper.hpp b/src/mtconnect/pipeline/json_mapper.hpp index 34835ecf0..7c90301ce 100644 --- a/src/mtconnect/pipeline/json_mapper.hpp +++ b/src/mtconnect/pipeline/json_mapper.hpp @@ -1,4 +1,4 @@ -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/message_mapper.hpp b/src/mtconnect/pipeline/message_mapper.hpp index 49edb6f51..b9b3fa85d 100644 --- a/src/mtconnect/pipeline/message_mapper.hpp +++ b/src/mtconnect/pipeline/message_mapper.hpp @@ -1,4 +1,4 @@ -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/mtconnect_xml_transform.hpp b/src/mtconnect/pipeline/mtconnect_xml_transform.hpp index 269913336..84a191568 100644 --- a/src/mtconnect/pipeline/mtconnect_xml_transform.hpp +++ b/src/mtconnect/pipeline/mtconnect_xml_transform.hpp @@ -1,4 +1,4 @@ -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/period_filter.hpp b/src/mtconnect/pipeline/period_filter.hpp index 9073e8552..5746eaf98 100644 --- a/src/mtconnect/pipeline/period_filter.hpp +++ b/src/mtconnect/pipeline/period_filter.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/pipeline.hpp b/src/mtconnect/pipeline/pipeline.hpp index c16b9e334..8fa7b8594 100644 --- a/src/mtconnect/pipeline/pipeline.hpp +++ b/src/mtconnect/pipeline/pipeline.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,6 +18,7 @@ #pragma once #include +#include #include "mtconnect/config.hpp" #include "pipeline_context.hpp" @@ -95,7 +96,7 @@ namespace mtconnect { { std::promise p; auto f = p.get_future(); - m_strand.dispatch([this, &p]() { + boost::asio::dispatch(m_strand, [this, &p]() { clearTransforms(); p.set_value(); }); diff --git a/src/mtconnect/pipeline/pipeline_context.hpp b/src/mtconnect/pipeline/pipeline_context.hpp index 42e55b554..17894961a 100644 --- a/src/mtconnect/pipeline/pipeline_context.hpp +++ b/src/mtconnect/pipeline/pipeline_context.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/pipeline_contract.hpp b/src/mtconnect/pipeline/pipeline_contract.hpp index 0e38733fc..ab9306ecf 100644 --- a/src/mtconnect/pipeline/pipeline_contract.hpp +++ b/src/mtconnect/pipeline/pipeline_contract.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/response_document.cpp b/src/mtconnect/pipeline/response_document.cpp index bbfe56b7f..d538488c6 100644 --- a/src/mtconnect/pipeline/response_document.cpp +++ b/src/mtconnect/pipeline/response_document.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/response_document.hpp b/src/mtconnect/pipeline/response_document.hpp index f61016526..2642012e2 100644 --- a/src/mtconnect/pipeline/response_document.hpp +++ b/src/mtconnect/pipeline/response_document.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/shdr_token_mapper.cpp b/src/mtconnect/pipeline/shdr_token_mapper.cpp index 7db74b6ca..efef18c9f 100644 --- a/src/mtconnect/pipeline/shdr_token_mapper.cpp +++ b/src/mtconnect/pipeline/shdr_token_mapper.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/shdr_token_mapper.hpp b/src/mtconnect/pipeline/shdr_token_mapper.hpp index f12c192d6..f80eb4335 100644 --- a/src/mtconnect/pipeline/shdr_token_mapper.hpp +++ b/src/mtconnect/pipeline/shdr_token_mapper.hpp @@ -1,4 +1,4 @@ -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/shdr_tokenizer.hpp b/src/mtconnect/pipeline/shdr_tokenizer.hpp index a9c3d31f0..e8709dcb6 100644 --- a/src/mtconnect/pipeline/shdr_tokenizer.hpp +++ b/src/mtconnect/pipeline/shdr_tokenizer.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -34,7 +34,7 @@ namespace mtconnect::pipeline { using entity::Entity::Entity; Tokens(const Tokens &) = default; Tokens() = default; - Tokens(const Tokens &ts, TokenList list) : Entity(ts), m_tokens(list) {} + Tokens(const Tokens &ts, const TokenList &list) : Entity(ts), m_tokens(list) {} TokenList m_tokens; }; diff --git a/src/mtconnect/pipeline/timestamp_extractor.hpp b/src/mtconnect/pipeline/timestamp_extractor.hpp index 2cddc792e..651c77350 100644 --- a/src/mtconnect/pipeline/timestamp_extractor.hpp +++ b/src/mtconnect/pipeline/timestamp_extractor.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -87,7 +87,6 @@ namespace mtconnect::pipeline { using namespace date; using namespace chrono; using namespace chrono_literals; - using namespace date::literals; using namespace date; // Extract duration @@ -104,7 +103,7 @@ namespace mtconnect::pipeline { if (has_t) { istringstream in(timestamp.data()); - in >> std::setw(6) >> parse("%FT%T", result); + in >> std::setw(6) >> date::parse("%FT%T", result); if (!in.good()) { result = now(); diff --git a/src/mtconnect/pipeline/topic_mapper.hpp b/src/mtconnect/pipeline/topic_mapper.hpp index 7aa52887e..e6604157b 100644 --- a/src/mtconnect/pipeline/topic_mapper.hpp +++ b/src/mtconnect/pipeline/topic_mapper.hpp @@ -1,4 +1,4 @@ -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/transform.hpp b/src/mtconnect/pipeline/transform.hpp index 6fbf9d3a5..691e6ff20 100644 --- a/src/mtconnect/pipeline/transform.hpp +++ b/src/mtconnect/pipeline/transform.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/upcase_value.hpp b/src/mtconnect/pipeline/upcase_value.hpp index fae0d1a42..9ea8d2554 100644 --- a/src/mtconnect/pipeline/upcase_value.hpp +++ b/src/mtconnect/pipeline/upcase_value.hpp @@ -1,4 +1,4 @@ -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/validator.hpp b/src/mtconnect/pipeline/validator.hpp index ff3abf09d..21f692414 100644 --- a/src/mtconnect/pipeline/validator.hpp +++ b/src/mtconnect/pipeline/validator.hpp @@ -1,4 +1,4 @@ -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/printer/json_printer.cpp b/src/mtconnect/printer/json_printer.cpp index 4dc7266cd..c7e699a44 100644 --- a/src/mtconnect/printer/json_printer.cpp +++ b/src/mtconnect/printer/json_printer.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/printer/json_printer.hpp b/src/mtconnect/printer/json_printer.hpp index c4c1cd902..c5615b71f 100644 --- a/src/mtconnect/printer/json_printer.hpp +++ b/src/mtconnect/printer/json_printer.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/printer/json_printer_helper.hpp b/src/mtconnect/printer/json_printer_helper.hpp index 61b843e33..a95c5e051 100644 --- a/src/mtconnect/printer/json_printer_helper.hpp +++ b/src/mtconnect/printer/json_printer_helper.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/printer/printer.hpp b/src/mtconnect/printer/printer.hpp index 914b8e701..36a3394b7 100644 --- a/src/mtconnect/printer/printer.hpp +++ b/src/mtconnect/printer/printer.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/printer/xml_helper.hpp b/src/mtconnect/printer/xml_helper.hpp index e1758ae55..9cbfbada1 100644 --- a/src/mtconnect/printer/xml_helper.hpp +++ b/src/mtconnect/printer/xml_helper.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/printer/xml_printer.cpp b/src/mtconnect/printer/xml_printer.cpp index e57629818..3ea09f277 100644 --- a/src/mtconnect/printer/xml_printer.cpp +++ b/src/mtconnect/printer/xml_printer.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -25,6 +25,7 @@ #include #include +#include #include "mtconnect/asset/asset.hpp" #include "mtconnect/asset/cutting_tool.hpp" diff --git a/src/mtconnect/printer/xml_printer.hpp b/src/mtconnect/printer/xml_printer.hpp index 71dc5287a..ba7c1648d 100644 --- a/src/mtconnect/printer/xml_printer.hpp +++ b/src/mtconnect/printer/xml_printer.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/printer/xml_printer_helper.hpp b/src/mtconnect/printer/xml_printer_helper.hpp index 3ac60e91a..fb5d4b223 100644 --- a/src/mtconnect/printer/xml_printer_helper.hpp +++ b/src/mtconnect/printer/xml_printer_helper.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/ruby/embedded.cpp b/src/mtconnect/ruby/embedded.cpp index 4942b6885..f461d086b 100644 --- a/src/mtconnect/ruby/embedded.cpp +++ b/src/mtconnect/ruby/embedded.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -62,7 +62,6 @@ using namespace std; namespace mtconnect::ruby { using namespace mtconnect::pipeline; using namespace std::literals; - using namespace date::literals; using namespace observation; RClass *RubyObservation::m_eventClass; diff --git a/src/mtconnect/ruby/embedded.hpp b/src/mtconnect/ruby/embedded.hpp index 38a5a1102..ffd2cc432 100644 --- a/src/mtconnect/ruby/embedded.hpp +++ b/src/mtconnect/ruby/embedded.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/ruby/ruby_agent.hpp b/src/mtconnect/ruby/ruby_agent.hpp index 954fff2da..45b3b050c 100644 --- a/src/mtconnect/ruby/ruby_agent.hpp +++ b/src/mtconnect/ruby/ruby_agent.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/ruby/ruby_entity.hpp b/src/mtconnect/ruby/ruby_entity.hpp index 3ad5fde06..3d85fe376 100644 --- a/src/mtconnect/ruby/ruby_entity.hpp +++ b/src/mtconnect/ruby/ruby_entity.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/ruby/ruby_observation.hpp b/src/mtconnect/ruby/ruby_observation.hpp index df0dec968..8f5ed6722 100644 --- a/src/mtconnect/ruby/ruby_observation.hpp +++ b/src/mtconnect/ruby/ruby_observation.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/ruby/ruby_pipeline.hpp b/src/mtconnect/ruby/ruby_pipeline.hpp index 0e1bf5312..c924d0d2f 100644 --- a/src/mtconnect/ruby/ruby_pipeline.hpp +++ b/src/mtconnect/ruby/ruby_pipeline.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/ruby/ruby_smart_ptr.hpp b/src/mtconnect/ruby/ruby_smart_ptr.hpp index a8c23106f..d8a044e50 100644 --- a/src/mtconnect/ruby/ruby_smart_ptr.hpp +++ b/src/mtconnect/ruby/ruby_smart_ptr.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/ruby/ruby_transform.hpp b/src/mtconnect/ruby/ruby_transform.hpp index 94693b29d..ad23ed08a 100644 --- a/src/mtconnect/ruby/ruby_transform.hpp +++ b/src/mtconnect/ruby/ruby_transform.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -28,7 +28,6 @@ namespace mtconnect::ruby { using namespace mtconnect::pipeline; using namespace std::literals; - using namespace date::literals; using namespace entity; using namespace observation; diff --git a/src/mtconnect/ruby/ruby_type.hpp b/src/mtconnect/ruby/ruby_type.hpp index 087b0e8fd..3a81c70e5 100644 --- a/src/mtconnect/ruby/ruby_type.hpp +++ b/src/mtconnect/ruby/ruby_type.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/ruby/ruby_vm.hpp b/src/mtconnect/ruby/ruby_vm.hpp index faba18f23..88dbb1a5d 100644 --- a/src/mtconnect/ruby/ruby_vm.hpp +++ b/src/mtconnect/ruby/ruby_vm.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/cached_file.hpp b/src/mtconnect/sink/rest_sink/cached_file.hpp index 40efea4fb..95243f50b 100644 --- a/src/mtconnect/sink/rest_sink/cached_file.hpp +++ b/src/mtconnect/sink/rest_sink/cached_file.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/error.cpp b/src/mtconnect/sink/rest_sink/error.cpp index 2183594ab..b3ee21ca8 100644 --- a/src/mtconnect/sink/rest_sink/error.cpp +++ b/src/mtconnect/sink/rest_sink/error.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/error.hpp b/src/mtconnect/sink/rest_sink/error.hpp index 0a0edacea..72592b88e 100644 --- a/src/mtconnect/sink/rest_sink/error.hpp +++ b/src/mtconnect/sink/rest_sink/error.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/file_cache.cpp b/src/mtconnect/sink/rest_sink/file_cache.cpp index 07d31e182..4c1ae8f5c 100644 --- a/src/mtconnect/sink/rest_sink/file_cache.cpp +++ b/src/mtconnect/sink/rest_sink/file_cache.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/file_cache.hpp b/src/mtconnect/sink/rest_sink/file_cache.hpp index f5125ccd3..d0802f324 100644 --- a/src/mtconnect/sink/rest_sink/file_cache.hpp +++ b/src/mtconnect/sink/rest_sink/file_cache.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/parameter.hpp b/src/mtconnect/sink/rest_sink/parameter.hpp index 2c3c479e2..541e4dcd0 100644 --- a/src/mtconnect/sink/rest_sink/parameter.hpp +++ b/src/mtconnect/sink/rest_sink/parameter.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/request.hpp b/src/mtconnect/sink/rest_sink/request.hpp index 9cf912b68..b96207faf 100644 --- a/src/mtconnect/sink/rest_sink/request.hpp +++ b/src/mtconnect/sink/rest_sink/request.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/response.hpp b/src/mtconnect/sink/rest_sink/response.hpp index 2e662f8da..a380c609a 100644 --- a/src/mtconnect/sink/rest_sink/response.hpp +++ b/src/mtconnect/sink/rest_sink/response.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/rest_service.cpp b/src/mtconnect/sink/rest_sink/rest_service.cpp index c57a9b0ff..46775087c 100644 --- a/src/mtconnect/sink/rest_sink/rest_service.cpp +++ b/src/mtconnect/sink/rest_sink/rest_service.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -366,28 +366,24 @@ namespace mtconnect { if (!host.empty()) { // Check if it is a simple numeric address - using br = ip::resolver_base; boost::system::error_code ec; auto addr = ip::make_address(host, ec); if (ec) { ip::tcp::resolver resolver(m_context); - ip::tcp::resolver::query query(host, "0", br::v4_mapped); - - auto it = resolver.resolve(query, ec); + auto results = resolver.resolve(host, "0", ip::resolver_base::flags::v4_mapped, ec); if (ec) { cout << "Failed to resolve " << host << ": " << ec.message() << endl; } else { - ip::tcp::resolver::iterator end; - for (; it != end; it++) + for (const auto &res : results) { - const auto &addr = it->endpoint().address(); - if (!addr.is_multicast() && !addr.is_unspecified()) + const auto &a = res.endpoint().address(); + if (!a.is_multicast() && !a.is_unspecified()) { - m_server->allowPutFrom(addr.to_string()); + m_server->allowPutFrom(a.to_string()); } } } @@ -1229,7 +1225,7 @@ namespace mtconnect { boost::asio::bind_executor( m_strand, [this, asyncResponse]() { - asyncResponse->m_timer.expires_from_now(asyncResponse->getInterval()); + asyncResponse->m_timer.expires_after(asyncResponse->getInterval()); asyncResponse->m_timer.async_wait(boost::asio::bind_executor( m_strand, boost::bind(&RestService::streamNextCurrent, this, asyncResponse, _1))); @@ -1620,3 +1616,4 @@ namespace mtconnect { } // namespace sink::rest_sink } // namespace mtconnect + diff --git a/src/mtconnect/sink/rest_sink/rest_service.hpp b/src/mtconnect/sink/rest_sink/rest_service.hpp index 3d5e7943c..17437f2fb 100644 --- a/src/mtconnect/sink/rest_sink/rest_service.hpp +++ b/src/mtconnect/sink/rest_sink/rest_service.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/routing.hpp b/src/mtconnect/sink/rest_sink/routing.hpp index ea4f37ab6..16813c01c 100644 --- a/src/mtconnect/sink/rest_sink/routing.hpp +++ b/src/mtconnect/sink/rest_sink/routing.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/server.cpp b/src/mtconnect/sink/rest_sink/server.cpp index dd34add95..550715817 100644 --- a/src/mtconnect/sink/rest_sink/server.cpp +++ b/src/mtconnect/sink/rest_sink/server.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/server.hpp b/src/mtconnect/sink/rest_sink/server.hpp index f025fa2b1..924adedd4 100644 --- a/src/mtconnect/sink/rest_sink/server.hpp +++ b/src/mtconnect/sink/rest_sink/server.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/session.hpp b/src/mtconnect/sink/rest_sink/session.hpp index 821d7ff88..653661c8d 100644 --- a/src/mtconnect/sink/rest_sink/session.hpp +++ b/src/mtconnect/sink/rest_sink/session.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/session_impl.cpp b/src/mtconnect/sink/rest_sink/session_impl.cpp index cdd04d2e8..e90a4c2cc 100644 --- a/src/mtconnect/sink/rest_sink/session_impl.cpp +++ b/src/mtconnect/sink/rest_sink/session_impl.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/session_impl.hpp b/src/mtconnect/sink/rest_sink/session_impl.hpp index b890a6039..13eb59eac 100644 --- a/src/mtconnect/sink/rest_sink/session_impl.hpp +++ b/src/mtconnect/sink/rest_sink/session_impl.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/tls_dector.hpp b/src/mtconnect/sink/rest_sink/tls_dector.hpp index cf8065899..41c260e5e 100644 --- a/src/mtconnect/sink/rest_sink/tls_dector.hpp +++ b/src/mtconnect/sink/rest_sink/tls_dector.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/sink.cpp b/src/mtconnect/sink/sink.cpp index 1a65d10f9..ff9724417 100644 --- a/src/mtconnect/sink/sink.cpp +++ b/src/mtconnect/sink/sink.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/sink.hpp b/src/mtconnect/sink/sink.hpp index 416564933..8fed400ef 100644 --- a/src/mtconnect/sink/sink.hpp +++ b/src/mtconnect/sink/sink.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/adapter.hpp b/src/mtconnect/source/adapter/adapter.hpp index 7052d6d87..33c52a15f 100644 --- a/src/mtconnect/source/adapter/adapter.hpp +++ b/src/mtconnect/source/adapter/adapter.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/adapter_pipeline.cpp b/src/mtconnect/source/adapter/adapter_pipeline.cpp index 0c0a8ada4..261ce5db1 100644 --- a/src/mtconnect/source/adapter/adapter_pipeline.cpp +++ b/src/mtconnect/source/adapter/adapter_pipeline.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/adapter_pipeline.hpp b/src/mtconnect/source/adapter/adapter_pipeline.hpp index a42a49112..fe5e448fb 100644 --- a/src/mtconnect/source/adapter/adapter_pipeline.hpp +++ b/src/mtconnect/source/adapter/adapter_pipeline.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/agent_adapter/agent_adapter.cpp b/src/mtconnect/source/adapter/agent_adapter/agent_adapter.cpp index afc34b151..b99bff088 100644 --- a/src/mtconnect/source/adapter/agent_adapter/agent_adapter.cpp +++ b/src/mtconnect/source/adapter/agent_adapter/agent_adapter.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -134,15 +134,8 @@ namespace mtconnect::source::adapter::agent_adapter { } m_name = m_url.getUrlText(m_sourceDevice); - boost::uuids::detail::sha1 sha1; - sha1.process_bytes(m_name.c_str(), m_name.length()); - boost::uuids::detail::sha1::digest_type digest; - sha1.get_digest(digest); - - stringstream identity; - identity << std::hex << digest[0] << digest[1] << digest[2]; - m_identity = string("_") + (identity.str()).substr(0, 10); - + m_identity = CreateIdentityHash(m_name); + m_options.insert_or_assign(configuration::AdapterIdentity, m_identity); m_feedbackId = "XmlTransformFeedback:" + m_identity; diff --git a/src/mtconnect/source/adapter/agent_adapter/agent_adapter.hpp b/src/mtconnect/source/adapter/agent_adapter/agent_adapter.hpp index aed804f63..44e17c790 100644 --- a/src/mtconnect/source/adapter/agent_adapter/agent_adapter.hpp +++ b/src/mtconnect/source/adapter/agent_adapter/agent_adapter.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/agent_adapter/http_session.hpp b/src/mtconnect/source/adapter/agent_adapter/http_session.hpp index 9f887b8d0..08f25669c 100644 --- a/src/mtconnect/source/adapter/agent_adapter/http_session.hpp +++ b/src/mtconnect/source/adapter/agent_adapter/http_session.hpp @@ -1,6 +1,6 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/agent_adapter/https_session.hpp b/src/mtconnect/source/adapter/agent_adapter/https_session.hpp index a00323016..698821ba4 100644 --- a/src/mtconnect/source/adapter/agent_adapter/https_session.hpp +++ b/src/mtconnect/source/adapter/agent_adapter/https_session.hpp @@ -1,6 +1,6 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/agent_adapter/session.hpp b/src/mtconnect/source/adapter/agent_adapter/session.hpp index 7a321ad60..6cd87de9e 100644 --- a/src/mtconnect/source/adapter/agent_adapter/session.hpp +++ b/src/mtconnect/source/adapter/agent_adapter/session.hpp @@ -1,6 +1,6 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/agent_adapter/session_impl.hpp b/src/mtconnect/source/adapter/agent_adapter/session_impl.hpp index 41745fb7e..1557d46d3 100644 --- a/src/mtconnect/source/adapter/agent_adapter/session_impl.hpp +++ b/src/mtconnect/source/adapter/agent_adapter/session_impl.hpp @@ -1,6 +1,6 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/mqtt/mqtt_adapter.cpp b/src/mtconnect/source/adapter/mqtt/mqtt_adapter.cpp index 583c979cc..82533ae81 100644 --- a/src/mtconnect/source/adapter/mqtt/mqtt_adapter.cpp +++ b/src/mtconnect/source/adapter/mqtt/mqtt_adapter.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -166,15 +166,7 @@ namespace mtconnect { identity << s; } - boost::uuids::detail::sha1 sha1; - sha1.process_bytes(identity.str().c_str(), identity.str().length()); - boost::uuids::detail::sha1::digest_type digest; - sha1.get_digest(digest); - - identity.str(""); - identity << std::hex << digest[0] << digest[1] << digest[2]; - m_identity = string("_") + (identity.str()).substr(0, 10); - + m_identity = CreateIdentityHash(identity.str()); m_options[configuration::AdapterIdentity] = m_identity; } diff --git a/src/mtconnect/source/adapter/mqtt/mqtt_adapter.hpp b/src/mtconnect/source/adapter/mqtt/mqtt_adapter.hpp index b0c932e66..e75211701 100644 --- a/src/mtconnect/source/adapter/mqtt/mqtt_adapter.hpp +++ b/src/mtconnect/source/adapter/mqtt/mqtt_adapter.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/shdr/connector.cpp b/src/mtconnect/source/adapter/shdr/connector.cpp index fb7f5979d..8345eab3f 100644 --- a/src/mtconnect/source/adapter/shdr/connector.cpp +++ b/src/mtconnect/source/adapter/shdr/connector.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -103,7 +103,7 @@ namespace mtconnect::source::adapter::shdr { LOG(error) << "Will retry resolution of " << m_server << " in " << m_reconnectInterval.count() << " milliseconds"; - m_timer.expires_from_now(m_reconnectInterval); + m_timer.expires_after(m_reconnectInterval); m_timer.async_wait([this](boost::system::error_code ec) { if (ec != boost::asio::error::operation_aborted) { @@ -131,11 +131,7 @@ namespace mtconnect::source::adapter::shdr { // Using a smart pointer to ensure connection is deleted if exception thrown LOG(debug) << "Connecting to data source: " << m_server << " on port: " << m_port; - asio::async_connect( - m_socket, m_results.begin(), m_results.end(), - [this](const boost::system::error_code &ec, ip::tcp::resolver::iterator it) { - asio::dispatch(m_strand, boost::bind(&Connector::connected, this, ec, it)); - }); + asio::async_connect(m_socket, m_results, boost::bind(&Connector::connected, this, _1, _2)); return true; } @@ -144,7 +140,7 @@ namespace mtconnect::source::adapter::shdr { { NAMED_SCOPE("Connector::asyncTryConnect"); - m_timer.expires_from_now(m_reconnectInterval); + m_timer.expires_after(m_reconnectInterval); m_timer.async_wait([this](boost::system::error_code ec) { if (ec != boost::asio::error::operation_aborted) { @@ -176,7 +172,7 @@ namespace mtconnect::source::adapter::shdr { asyncTryConnect(); } - void Connector::connected(const boost::system::error_code &ec, ip::tcp::resolver::iterator it) + void Connector::connected(const boost::system::error_code &ec, const ip::tcp::endpoint &endpoint) { NAMED_SCOPE("Connector::connected"); @@ -229,7 +225,7 @@ namespace mtconnect::source::adapter::shdr { while (parseSocketBuffer()) ; - m_timer.expires_from_now(m_receiveTimeLimit); + m_timer.expires_after(m_receiveTimeLimit); m_timer.async_wait([this](boost::system::error_code ec) { if (ec != boost::asio::error::operation_aborted) { @@ -267,7 +263,7 @@ namespace mtconnect::source::adapter::shdr { { NAMED_SCOPE("Connector::setReceiveTimeout"); - m_receiveTimeout.expires_from_now(m_receiveTimeLimit); + m_receiveTimeout.expires_after(m_receiveTimeLimit); m_receiveTimeout.async_wait([this](sys::error_code ec) { if (!ec) { @@ -385,7 +381,7 @@ namespace mtconnect::source::adapter::shdr { { LOG(debug) << "Sending heartbeat"; sendCommand("PING"); - m_heartbeatTimer.expires_from_now(m_heartbeatFrequency); + m_heartbeatTimer.expires_after(m_heartbeatFrequency); m_heartbeatTimer.async_wait([this](boost::system::error_code ec) { asio::dispatch(m_strand, boost::bind(&Connector::heartbeat, this, ec)); }); @@ -420,7 +416,7 @@ namespace mtconnect::source::adapter::shdr { m_receiveTimeLimit = 2 * m_heartbeatFrequency; setReceiveTimeout(); - m_heartbeatTimer.expires_from_now(m_heartbeatFrequency); + m_heartbeatTimer.expires_after(m_heartbeatFrequency); m_heartbeatTimer.async_wait([this](boost::system::error_code ec) { asio::dispatch(m_strand, boost::bind(&Connector::heartbeat, this, ec)); }); diff --git a/src/mtconnect/source/adapter/shdr/connector.hpp b/src/mtconnect/source/adapter/shdr/connector.hpp index d8cd727a8..ad0e9ed14 100644 --- a/src/mtconnect/source/adapter/shdr/connector.hpp +++ b/src/mtconnect/source/adapter/shdr/connector.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -105,7 +105,7 @@ namespace mtconnect::source::adapter::shdr { void resolved(const boost::system::error_code &error, boost::asio::ip::tcp::resolver::results_type results); void connected(const boost::system::error_code &error, - boost::asio::ip::tcp::resolver::iterator it); + const boost::asio::ip::tcp::endpoint& endpoint); void writer(boost::system::error_code ec, std::size_t length); void reader(boost::system::error_code ec, std::size_t length); bool parseSocketBuffer(); diff --git a/src/mtconnect/source/adapter/shdr/shdr_adapter.cpp b/src/mtconnect/source/adapter/shdr/shdr_adapter.cpp index 366b4e9b1..0a614b6d3 100644 --- a/src/mtconnect/source/adapter/shdr/shdr_adapter.cpp +++ b/src/mtconnect/source/adapter/shdr/shdr_adapter.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -34,7 +34,6 @@ using namespace std; using namespace std::literals; -using namespace date::literals; namespace mtconnect::source::adapter::shdr { // Adapter public methods @@ -90,14 +89,7 @@ namespace mtconnect::source::adapter::shdr { { if (IsOptionSet(m_options, configuration::SuppressIPAddress)) { - boost::uuids::detail::sha1 sha1; - sha1.process_bytes(identity.str().c_str(), identity.str().length()); - boost::uuids::detail::sha1::digest_type digest; - sha1.get_digest(digest); - - identity.str(""); - identity << std::hex << digest[0] << digest[1] << digest[2]; - m_identity = string("_") + (identity.str()).substr(0, 10); + m_identity = CreateIdentityHash(identity.str()); } else { diff --git a/src/mtconnect/source/adapter/shdr/shdr_adapter.hpp b/src/mtconnect/source/adapter/shdr/shdr_adapter.hpp index 4b40f514c..15c25eba3 100644 --- a/src/mtconnect/source/adapter/shdr/shdr_adapter.hpp +++ b/src/mtconnect/source/adapter/shdr/shdr_adapter.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/shdr/shdr_pipeline.cpp b/src/mtconnect/source/adapter/shdr/shdr_pipeline.cpp index 45116061e..2b7ab05f2 100644 --- a/src/mtconnect/source/adapter/shdr/shdr_pipeline.cpp +++ b/src/mtconnect/source/adapter/shdr/shdr_pipeline.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/shdr/shdr_pipeline.hpp b/src/mtconnect/source/adapter/shdr/shdr_pipeline.hpp index f975ee4f2..0c65502d0 100644 --- a/src/mtconnect/source/adapter/shdr/shdr_pipeline.hpp +++ b/src/mtconnect/source/adapter/shdr/shdr_pipeline.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/error_code.hpp b/src/mtconnect/source/error_code.hpp index af3164bb5..f62876641 100644 --- a/src/mtconnect/source/error_code.hpp +++ b/src/mtconnect/source/error_code.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/loopback_source.cpp b/src/mtconnect/source/loopback_source.cpp index 65e629ef1..e0acc0045 100644 --- a/src/mtconnect/source/loopback_source.cpp +++ b/src/mtconnect/source/loopback_source.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/loopback_source.hpp b/src/mtconnect/source/loopback_source.hpp index e12ee2282..f0b804889 100644 --- a/src/mtconnect/source/loopback_source.hpp +++ b/src/mtconnect/source/loopback_source.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/source.cpp b/src/mtconnect/source/source.cpp index eb1f8c59a..d67880b97 100644 --- a/src/mtconnect/source/source.cpp +++ b/src/mtconnect/source/source.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,8 +15,12 @@ // limitations under the License. // +#include + #include "mtconnect/source/source.hpp" +#include + #include "mtconnect/logging.hpp" namespace mtconnect::source { @@ -38,4 +42,21 @@ namespace mtconnect::source { return nullptr; } + std::string CreateIdentityHash(const std::string &input) + { + using namespace std; + + boost::uuids::detail::sha1 sha1; + sha1.process_bytes(input.c_str(), input.length()); + boost::uuids::detail::sha1::digest_type digest; + sha1.get_digest(digest); + + ostringstream identity; + identity << '_' << std::hex; + for (int i = 0; i < 5; i++) + identity << (uint16_t) digest[i]; + + return identity.str(); + } + } // namespace mtconnect::source diff --git a/src/mtconnect/source/source.hpp b/src/mtconnect/source/source.hpp index 4debdafb6..8ff888bb4 100644 --- a/src/mtconnect/source/source.hpp +++ b/src/mtconnect/source/source.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -95,6 +95,11 @@ namespace mtconnect { std::string m_name; boost::asio::io_context::strand m_strand; }; + + /// @brief create a unique identity hash for an XML id starting with an `_` and 10 hex digits + /// @param text the text to create the hashed id + /// @returns a string with the hashed result + AGENT_LIB_API std::string CreateIdentityHash(const std::string &input); /// @brief A factory for creating the source class AGENT_LIB_API SourceFactory diff --git a/src/mtconnect/utilities.cpp b/src/mtconnect/utilities.cpp index e9d48a60e..d6fb420c8 100644 --- a/src/mtconnect/utilities.cpp +++ b/src/mtconnect/utilities.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -150,13 +150,13 @@ namespace mtconnect { { using namespace boost; using namespace asio; - using res = ip::udp::resolver; + using res = ip::tcp::resolver; string address; boost::system::error_code ec; res resolver(context); - auto iter = resolver.resolve(ip::host_name(), "5000", res::flags::address_configured, ec); + auto results = resolver.resolve(ip::host_name(), "5000", res::flags::address_configured, ec); if (ec) { LOG(warning) << "Cannot find IP address: " << ec.message(); @@ -164,11 +164,9 @@ namespace mtconnect { } else { - res::iterator end; - while (iter != end) + for (auto &res : results) { - const auto &ep = iter->endpoint(); - const auto &ad = ep.address(); + const auto &ad = res.endpoint().address(); if (!ad.is_unspecified() && !ad.is_loopback() && (!onlyV4 || !ad.is_v6())) { auto ads {ad.to_string()}; @@ -178,7 +176,6 @@ namespace mtconnect { address = ads; } } - iter++; } } @@ -210,7 +207,7 @@ namespace mtconnect { /// @return a boost ipv6 address static boost::asio::ip::address_v6 from_v6_string(std::vector str) { - return boost::asio::ip::address_v6::from_string(str.data()); + return boost::asio::ip::make_address_v6(str.data()); } BOOST_PHOENIX_ADAPT_FUNCTION(boost::asio::ip::address_v4, v4_from_4number, from_four_number, 4) diff --git a/src/mtconnect/utilities.hpp b/src/mtconnect/utilities.hpp index da603aa7b..70bddd58f 100644 --- a/src/mtconnect/utilities.hpp +++ b/src/mtconnect/utilities.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -163,7 +164,7 @@ namespace mtconnect { /// @brief Convert text to upper case /// @param[in,out] text text /// @return upper-case of text as string - inline std::string toUpperCase(std::string &text) + constexpr std::string &toUpperCase(std::string &text) { std::transform(text.begin(), text.end(), text.begin(), [](unsigned char c) { return std::toupper(c); }); @@ -174,7 +175,7 @@ namespace mtconnect { /// @brief Simple check if a number as a string is negative /// @param s the numbeer /// @return `true` if positive - inline bool isNonNegativeInteger(const std::string &s) + constexpr bool isNonNegativeInteger(const std::string &s) { for (const char c : s) { @@ -188,7 +189,7 @@ namespace mtconnect { /// @brief Checks if a string is a valid integer /// @param s the string /// @return `true` if is `[+-]\d+` - inline bool isInteger(const std::string &s) + constexpr bool isInteger(const std::string &s) { auto iter = s.cbegin(); if (*iter == '-' || *iter == '+') @@ -218,7 +219,12 @@ namespace mtconnect { using namespace std; using namespace std::chrono; constexpr char ISO_8601_FMT[] = "%Y-%m-%dT%H:%M:%SZ"; - +#ifdef _WINDOWS + namespace tzchrono = std::chrono; +#else + namespace tzchrono = date; +#endif + switch (format) { case HUM_READ: @@ -228,12 +234,11 @@ namespace mtconnect { case GMT_UV_SEC: return date::format(ISO_8601_FMT, date::floor(timePoint)); case LOCAL: - auto time = system_clock::to_time_t(timePoint); - struct tm timeinfo = {0}; - mt_localtime(&time, &timeinfo); - char timestamp[64] = {0}; - strftime(timestamp, 50u, "%Y-%m-%dT%H:%M:%S%z", &timeinfo); - return timestamp; + { + auto zone = tzchrono::current_zone(); + auto zt = date::zoned_time(zone, timePoint); + return date::format("%Y-%m-%dT%H:%M:%S%z", zt); + } } return ""; @@ -757,14 +762,9 @@ namespace mtconnect { /// @return converted `Timestamp` inline Timestamp parseTimestamp(const std::string ×tamp) { - using namespace date; - using namespace std::chrono; - using namespace std::chrono_literals; - using namespace date::literals; - Timestamp ts; std::istringstream in(timestamp); - in >> std::setw(6) >> parse("%FT%T", ts); + in >> std::setw(6) >> date::parse("%FT%T", ts); if (!in.good()) { ts = std::chrono::system_clock::now(); @@ -819,11 +819,12 @@ namespace mtconnect { /// @param[in] sha the sha1 namespace to use as context /// @param[in] id the id to use transform /// @returns Returns the first 16 characters of the base 64 encoded sha1 - inline std::string makeUniqueId(const ::boost::uuids::detail::sha1 &sha, const std::string &id) + inline std::string makeUniqueId(const ::boost::uuids::detail::sha1 &contextSha, const std::string &id) { using namespace std; + using namespace boost::uuids::detail; - ::boost::uuids::detail::sha1 sha1(sha); + sha1 sha(contextSha); constexpr string_view startc("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_"); constexpr auto isIDStartChar = [](unsigned char c) -> bool { return isalpha(c) || c == '_'; }; @@ -831,12 +832,14 @@ namespace mtconnect { return isIDStartChar(c) || isdigit(c) || c == '.' || c == '-'; }; - sha1.process_bytes(id.data(), id.length()); - unsigned int digest[5]; - sha1.get_digest(digest); + sha.process_bytes(id.data(), id.length()); + sha1::digest_type digest; + sha.get_digest(digest); + auto data = (unsigned int *) digest; + string s(32, ' '); - auto len = boost::beast::detail::base64::encode(s.data(), digest, sizeof(digest)); + auto len = boost::beast::detail::base64::encode(s.data(), data, sizeof(digest)); s.erase(len - 1); s.erase(std::remove_if(++(s.begin()), s.end(), not_fn(isIDChar)), s.end()); diff --git a/src/mtconnect/validation/observations.cpp b/src/mtconnect/validation/observations.cpp index 4f2825a5d..1c4e44eaa 100644 --- a/src/mtconnect/validation/observations.cpp +++ b/src/mtconnect/validation/observations.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/validation/observations.hpp b/src/mtconnect/validation/observations.hpp index 324f9ddd5..6f7b13ca9 100644 --- a/src/mtconnect/validation/observations.hpp +++ b/src/mtconnect/validation/observations.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/version.cpp b/src/mtconnect/version.cpp index 8a082fb36..23f72e6a5 100644 --- a/src/mtconnect/version.cpp +++ b/src/mtconnect/version.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/CMakeLists.txt b/test_package/CMakeLists.txt index 05f82d637..2cd035cc7 100644 --- a/test_package/CMakeLists.txt +++ b/test_package/CMakeLists.txt @@ -285,7 +285,7 @@ add_agent_test(correct_timestamp TRUE pipeline) add_agent_test(agent TRUE core) add_agent_test(agent_asset TRUE core) -add_agent_test(globals FALSE core) +add_agent_test(utilities FALSE core) add_agent_test(config_parser FALSE configuration) add_agent_test(config FALSE configuration) diff --git a/test_package/adapter_test.cpp b/test_package/adapter_test.cpp index 58712ec98..beb1cee70 100644 --- a/test_package/adapter_test.cpp +++ b/test_package/adapter_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/agent_adapter_test.cpp b/test_package/agent_adapter_test.cpp index b086e69a0..21394cbaf 100644 --- a/test_package/agent_adapter_test.cpp +++ b/test_package/agent_adapter_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/agent_asset_test.cpp b/test_package/agent_asset_test.cpp index e28b50ac1..bb934e015 100644 --- a/test_package/agent_asset_test.cpp +++ b/test_package/agent_asset_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/agent_device_test.cpp b/test_package/agent_device_test.cpp index 7ff334c68..6eb74c5fb 100644 --- a/test_package/agent_device_test.cpp +++ b/test_package/agent_device_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/agent_test.cpp b/test_package/agent_test.cpp index 4bf95ad9b..2a889c87a 100644 --- a/test_package/agent_test.cpp +++ b/test_package/agent_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/agent_test_helper.cpp b/test_package/agent_test_helper.cpp index c1dd2ccb3..b2a466a4a 100644 --- a/test_package/agent_test_helper.cpp +++ b/test_package/agent_test_helper.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/agent_test_helper.hpp b/test_package/agent_test_helper.hpp index 16c7a5cf7..45ff79c00 100644 --- a/test_package/agent_test_helper.hpp +++ b/test_package/agent_test_helper.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/asset_buffer_test.cpp b/test_package/asset_buffer_test.cpp index 92efefea8..558c041a7 100644 --- a/test_package/asset_buffer_test.cpp +++ b/test_package/asset_buffer_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/asset_hash_test.cpp b/test_package/asset_hash_test.cpp index ae17a1665..4705947ad 100644 --- a/test_package/asset_hash_test.cpp +++ b/test_package/asset_hash_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/asset_test.cpp b/test_package/asset_test.cpp index f5fd92825..6794d6676 100644 --- a/test_package/asset_test.cpp +++ b/test_package/asset_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/change_observer_test.cpp b/test_package/change_observer_test.cpp index b7501a6c8..26d91807e 100644 --- a/test_package/change_observer_test.cpp +++ b/test_package/change_observer_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -31,7 +31,6 @@ using namespace std::chrono_literals; using namespace std; using namespace std::literals; -using namespace date::literals; using WorkGuard = boost::asio::executor_work_guard; diff --git a/test_package/checkpoint_test.cpp b/test_package/checkpoint_test.cpp index f874ae5c4..8e09c0a60 100644 --- a/test_package/checkpoint_test.cpp +++ b/test_package/checkpoint_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/circular_buffer_test.cpp b/test_package/circular_buffer_test.cpp index 4e935c94b..776708be1 100644 --- a/test_package/circular_buffer_test.cpp +++ b/test_package/circular_buffer_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/component_parameters_test.cpp b/test_package/component_parameters_test.cpp index 076175db9..625fa3df4 100644 --- a/test_package/component_parameters_test.cpp +++ b/test_package/component_parameters_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/component_test.cpp b/test_package/component_test.cpp index b4b8c1a87..a48b9bd71 100644 --- a/test_package/component_test.cpp +++ b/test_package/component_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/composition_test.cpp b/test_package/composition_test.cpp index 4501ac3f4..baa2d34c1 100644 --- a/test_package/composition_test.cpp +++ b/test_package/composition_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/config_parser_test.cpp b/test_package/config_parser_test.cpp index fab7e9ad6..569d19301 100644 --- a/test_package/config_parser_test.cpp +++ b/test_package/config_parser_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/config_test.cpp b/test_package/config_test.cpp index 29913b225..fde6e2f1b 100644 --- a/test_package/config_test.cpp +++ b/test_package/config_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -1006,7 +1006,7 @@ Port = 0 ASSERT_EQ("SPINDLE_SPEED", dataItem->getType()); boost::asio::steady_timer timer1(context.get()); - timer1.expires_from_now(1s); + timer1.expires_after(1s); timer1.async_wait([this, &devices, agent](boost::system::error_code ec) { if (ec) { @@ -1025,7 +1025,7 @@ Port = 0 }); boost::asio::steady_timer timer2(context.get()); - timer2.expires_from_now(6s); + timer2.expires_after(6s); timer2.async_wait([this, agent, &chg](boost::system::error_code ec) { if (!ec) { @@ -1085,7 +1085,7 @@ Port = 0 ASSERT_EQ("SPINDLE_SPEED", dataItem->getType()); boost::asio::steady_timer timer1(context.get()); - timer1.expires_from_now(1s); + timer1.expires_after(1s); timer1.async_wait([this, &devices](boost::system::error_code ec) { if (ec) { @@ -1098,7 +1098,7 @@ Port = 0 }); boost::asio::steady_timer timer2(context.get()); - timer2.expires_from_now(6s); + timer2.expires_after(6s); timer2.async_wait([this, &chg](boost::system::error_code ec) { if (!ec) { @@ -1151,7 +1151,7 @@ Port = 0 auto instance = rest->instanceId(); boost::asio::steady_timer timer1(context.get()); - timer1.expires_from_now(1s); + timer1.expires_after(1s); timer1.async_wait([this, &config](boost::system::error_code ec) { if (ec) { @@ -1167,7 +1167,7 @@ Port = 0 this_thread::sleep_for(5s); boost::asio::steady_timer timer1(context.get()); - timer1.expires_from_now(1s); + timer1.expires_after(1s); timer1.async_wait([this, agent, instance](boost::system::error_code ec) { if (!ec) { @@ -1228,7 +1228,7 @@ Port = 0 DataItemPtr di; boost::asio::steady_timer timer1(context.get()); - timer1.expires_from_now(1s); + timer1.expires_after(1s); timer1.async_wait([this, &devices](boost::system::error_code ec) { if (ec) { @@ -1242,7 +1242,7 @@ Port = 0 }); boost::asio::steady_timer timer2(context.get()); - timer2.expires_from_now(6s); + timer2.expires_after(6s); timer2.async_wait([this](boost::system::error_code ec) { if (!ec) { @@ -1345,7 +1345,7 @@ Port = 0 ASSERT_EQ("1.2", *printer->getSchemaVersion()); boost::asio::steady_timer timer1(context.get()); - timer1.expires_from_now(1s); + timer1.expires_after(1s); timer1.async_wait([this, &devices, agent](boost::system::error_code ec) { if (ec) { @@ -1368,7 +1368,7 @@ Port = 0 this_thread::sleep_for(5s); boost::asio::steady_timer timer1(context.get()); - timer1.expires_from_now(1s); + timer1.expires_after(1s); timer1.async_wait([this, agent, instance](boost::system::error_code ec) { if (!ec) { @@ -1501,13 +1501,13 @@ Adapters { )"); adapter->processData("--multiline--AAAAA"); - timer2.expires_from_now(500ms); + timer2.expires_after(500ms); timer2.async_wait(validate); } }; boost::asio::steady_timer timer1(asyncContext.get()); - timer1.expires_from_now(100ms); + timer1.expires_after(100ms); timer1.async_wait(send); m_config->start(); @@ -1634,13 +1634,13 @@ Port = 0 )"); adapter->processData("--multiline--AAAAA"); - timer2.expires_from_now(500ms); + timer2.expires_after(500ms); timer2.async_wait(validate); } }; boost::asio::steady_timer timer1(asyncContext.get()); - timer1.expires_from_now(100ms); + timer1.expires_after(100ms); timer1.async_wait(send); m_config->start(); @@ -1807,13 +1807,13 @@ Port = 0 )"); adapter->processData("--multiline--AAAAA"); - timer2.expires_from_now(500ms); + timer2.expires_after(500ms); timer2.async_wait(validate); } }; boost::asio::steady_timer timer1(asyncContext.get()); - timer1.expires_from_now(100ms); + timer1.expires_after(100ms); timer1.async_wait(send); m_config->start(); @@ -1913,13 +1913,13 @@ Adapters { )"); adapter->processData("--multiline--AAAAA"); - timer2.expires_from_now(500ms); + timer2.expires_after(500ms); timer2.async_wait(validate); } }; boost::asio::steady_timer timer1(asyncContext.get()); - timer1.expires_from_now(100ms); + timer1.expires_after(100ms); timer1.async_wait(send); m_config->start(); @@ -2003,7 +2003,7 @@ Port = 0 ASSERT_EQ("001", pipeline->getDevice()); } - shutdownTimer.expires_from_now(3s); + shutdownTimer.expires_after(3s); shutdownTimer.async_wait(shudown); }; @@ -2039,13 +2039,13 @@ Port = 0 )"); adapter->processData("--multiline--AAAAA"); - timer2.expires_from_now(500ms); + timer2.expires_after(500ms); timer2.async_wait(validate); } }; boost::asio::steady_timer timer1(asyncContext.get()); - timer1.expires_from_now(100ms); + timer1.expires_after(100ms); timer1.async_wait(send); m_config->start(); @@ -2116,13 +2116,13 @@ Adapters { adapter->processData("* device: none"); adapter->processData("* uuid: 12345"); - timer2.expires_from_now(500ms); + timer2.expires_after(500ms); timer2.async_wait(validate); } }; boost::asio::steady_timer timer1(asyncContext.get()); - timer1.expires_from_now(100ms); + timer1.expires_after(100ms); timer1.async_wait(send); m_config->start(); diff --git a/test_package/connector_test.cpp b/test_package/connector_test.cpp index e40c351d8..016b8cbdf 100644 --- a/test_package/connector_test.cpp +++ b/test_package/connector_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/coordinate_system_test.cpp b/test_package/coordinate_system_test.cpp index 4a4f56535..3b362d05f 100644 --- a/test_package/coordinate_system_test.cpp +++ b/test_package/coordinate_system_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/correct_timestamp_test.cpp b/test_package/correct_timestamp_test.cpp index 685b2c051..48d0ba701 100644 --- a/test_package/correct_timestamp_test.cpp +++ b/test_package/correct_timestamp_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/cutting_tool_test.cpp b/test_package/cutting_tool_test.cpp index 4647cc036..17989ba9b 100644 --- a/test_package/cutting_tool_test.cpp +++ b/test_package/cutting_tool_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/data_item_mapping_test.cpp b/test_package/data_item_mapping_test.cpp index 167cdcbdb..380677dcc 100644 --- a/test_package/data_item_mapping_test.cpp +++ b/test_package/data_item_mapping_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/data_item_test.cpp b/test_package/data_item_test.cpp index 0b7385024..7932e387e 100644 --- a/test_package/data_item_test.cpp +++ b/test_package/data_item_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/data_set_test.cpp b/test_package/data_set_test.cpp index 24566788a..6302ea3b3 100644 --- a/test_package/data_set_test.cpp +++ b/test_package/data_set_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/device_test.cpp b/test_package/device_test.cpp index 6bb14a651..faa671fc2 100644 --- a/test_package/device_test.cpp +++ b/test_package/device_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/duplicate_filter_test.cpp b/test_package/duplicate_filter_test.cpp index 3d891457c..cc9e0d8f4 100644 --- a/test_package/duplicate_filter_test.cpp +++ b/test_package/duplicate_filter_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/embedded_ruby_test.cpp b/test_package/embedded_ruby_test.cpp index b83e4e24e..326aa7bcd 100644 --- a/test_package/embedded_ruby_test.cpp +++ b/test_package/embedded_ruby_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/entity_parser_test.cpp b/test_package/entity_parser_test.cpp index a5aa43e1e..61213d293 100644 --- a/test_package/entity_parser_test.cpp +++ b/test_package/entity_parser_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/entity_printer_test.cpp b/test_package/entity_printer_test.cpp index 2999fe1e3..b3fa98ac9 100644 --- a/test_package/entity_printer_test.cpp +++ b/test_package/entity_printer_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -331,12 +331,12 @@ TEST_F(EntityPrinterTest, should_honor_include_hidden_parameter) entity::XmlPrinter printer(false); printer.print(*m_writer, entity, {}); - ASSERT_EQ(R"( + ASSERT_EQ(R"( - + - - + + @@ -348,12 +348,12 @@ TEST_F(EntityPrinterTest, should_honor_include_hidden_parameter) entity::XmlPrinter printer2(true); printer2.print(*m_writer, entity, {}); - ASSERT_EQ(R"( + ASSERT_EQ(R"( - + - - + + diff --git a/test_package/entity_test.cpp b/test_package/entity_test.cpp index 88396d8de..2cf031928 100644 --- a/test_package/entity_test.cpp +++ b/test_package/entity_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/file_asset_test.cpp b/test_package/file_asset_test.cpp index 9b5a753e9..2c1172399 100644 --- a/test_package/file_asset_test.cpp +++ b/test_package/file_asset_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/file_cache_test.cpp b/test_package/file_cache_test.cpp index 5e916fd28..a750463fd 100644 --- a/test_package/file_cache_test.cpp +++ b/test_package/file_cache_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -180,7 +180,7 @@ TEST_F(FileCacheTest, file_cache_should_compress_file_async) }); bool ran {false}; - context.post([&ran] { ran = true; }); + boost::asio::post(context, [&ran] { ran = true; }); context.run(); // EXPECT_TRUE(ran); diff --git a/test_package/fixture_test.cpp b/test_package/fixture_test.cpp index 36cc02e8f..48f711f3d 100644 --- a/test_package/fixture_test.cpp +++ b/test_package/fixture_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/http_server_test.cpp b/test_package/http_server_test.cpp index fa2607c58..ff73298c3 100644 --- a/test_package/http_server_test.cpp +++ b/test_package/http_server_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -42,6 +42,7 @@ using namespace mtconnect::sink::rest_sink; namespace asio = boost::asio; namespace beast = boost::beast; namespace http = boost::beast::http; +namespace ip = asio::ip; using tcp = boost::asio::ip::tcp; // main @@ -70,7 +71,7 @@ class Client beast::error_code ec; // These objects perform our I/O - tcp::endpoint server(asio::ip::address_v4::from_string("127.0.0.1"), port); + tcp::endpoint server(ip::make_address("127.0.0.1"), port); // Set the timeout. m_stream.expires_after(std::chrono::seconds(30)); @@ -231,7 +232,8 @@ class Client void spawnReadChunk() { - asio::spawn(m_context, std::bind(&Client::readChunk, this, std::placeholders::_1)); + asio::spawn(m_context, std::bind(&Client::readChunk, this, std::placeholders::_1), + boost::asio::detached); } void spawnRequest(boost::beast::http::verb verb, std::string const& target, @@ -242,7 +244,8 @@ class Client m_done = false; m_count = 0; asio::spawn(m_context, std::bind(&Client::request, this, verb, target, body, close, contentType, - std::placeholders::_1)); + std::placeholders::_1), + boost::asio::detached); while (!m_done && m_context.run_for(20ms) > 0) ; @@ -307,7 +310,9 @@ class HttpServerTest : public testing::Test m_client->m_connected = false; asio::spawn(m_context, std::bind(&Client::connect, m_client.get(), - static_cast(m_server->getPort()), std::placeholders::_1)); + static_cast(m_server->getPort()), std::placeholders::_1), + boost::asio::detached); + while (!m_client->m_connected) m_context.run_one(); diff --git a/test_package/image_file_test.cpp b/test_package/image_file_test.cpp index 9a1ebfe67..339878370 100644 --- a/test_package/image_file_test.cpp +++ b/test_package/image_file_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/json_helper.hpp b/test_package/json_helper.hpp index 5ec636147..71d74fb08 100644 --- a/test_package/json_helper.hpp +++ b/test_package/json_helper.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/json_mapping_test.cpp b/test_package/json_mapping_test.cpp index b4d06be49..7b9e8f31c 100644 --- a/test_package/json_mapping_test.cpp +++ b/test_package/json_mapping_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/json_parser_test.cpp b/test_package/json_parser_test.cpp index 5db25737f..8bbd86d56 100644 --- a/test_package/json_parser_test.cpp +++ b/test_package/json_parser_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/json_printer_asset_test.cpp b/test_package/json_printer_asset_test.cpp index d2e61b8f6..fa65800b7 100644 --- a/test_package/json_printer_asset_test.cpp +++ b/test_package/json_printer_asset_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/json_printer_error_test.cpp b/test_package/json_printer_error_test.cpp index 0fb0166f5..fa307ee52 100644 --- a/test_package/json_printer_error_test.cpp +++ b/test_package/json_printer_error_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/json_printer_probe_test.cpp b/test_package/json_printer_probe_test.cpp index 1760aea92..1c2a1cb65 100644 --- a/test_package/json_printer_probe_test.cpp +++ b/test_package/json_printer_probe_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -355,14 +355,14 @@ TEST_F(JsonPrinterProbeTest, PrintDataItemRelationships) auto dir1 = load.at("/Relationships/0"_json_pointer); ASSERT_TRUE(dir1.is_object()); - ASSERT_EQ(string("archie"), dir1.at("/DataItemRelationship/name"_json_pointer)); - ASSERT_EQ(string("LIMIT"), dir1.at("/DataItemRelationship/type"_json_pointer)); - ASSERT_EQ(string("xlcpl"), dir1.at("/DataItemRelationship/idRef"_json_pointer)); + ASSERT_EQ(string("archie"), dir1.at("/DataItemRelationship/name"_json_pointer).get()); + ASSERT_EQ(string("LIMIT"), dir1.at("/DataItemRelationship/type"_json_pointer).get()); + ASSERT_EQ(string("xlcpl"), dir1.at("/DataItemRelationship/idRef"_json_pointer).get()); auto dir2 = load.at("/Relationships/1"_json_pointer); ASSERT_TRUE(dir2.is_object()); - ASSERT_EQ(string("LIMIT"), dir2.at("/SpecificationRelationship/type"_json_pointer)); - ASSERT_EQ(string("spec1"), dir2.at("/SpecificationRelationship/idRef"_json_pointer)); + ASSERT_EQ(string("LIMIT"), dir2.at("/SpecificationRelationship/type"_json_pointer).get()); + ASSERT_EQ(string("spec1"), dir2.at("/SpecificationRelationship/idRef"_json_pointer).get()); auto limits = linear.at("/DataItems/5/DataItem"_json_pointer); ASSERT_TRUE(load.is_object()); @@ -370,9 +370,9 @@ TEST_F(JsonPrinterProbeTest, PrintDataItemRelationships) auto dir3 = limits.at("/Relationships/0"_json_pointer); ASSERT_TRUE(dir3.is_object()); - ASSERT_EQ(string("bob"), dir3.at("/DataItemRelationship/name"_json_pointer)); - ASSERT_EQ(string("OBSERVATION"), dir3.at("/DataItemRelationship/type"_json_pointer)); - ASSERT_EQ(string("xlc"), dir3.at("/DataItemRelationship/idRef"_json_pointer)); + ASSERT_EQ(string("bob"), dir3.at("/DataItemRelationship/name"_json_pointer).get()); + ASSERT_EQ(string("OBSERVATION"), dir3.at("/DataItemRelationship/type"_json_pointer).get()); + ASSERT_EQ(string("xlc"), dir3.at("/DataItemRelationship/idRef"_json_pointer).get()); } TEST_F(JsonPrinterProbeTest, version_2_with_multiple_devices) diff --git a/test_package/json_printer_stream_test.cpp b/test_package/json_printer_stream_test.cpp index 40e85c5bf..8ae04ad3f 100644 --- a/test_package/json_printer_stream_test.cpp +++ b/test_package/json_printer_stream_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/json_printer_test.cpp b/test_package/json_printer_test.cpp index 1fbb276f1..0405d6ea2 100644 --- a/test_package/json_printer_test.cpp +++ b/test_package/json_printer_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -392,12 +392,12 @@ TEST_F(JsonPrinterTest, should_honor_include_hidden_parameter) "Components": [ { "Electric": { - "id": "Pm2JhGKEeAYzVA8c" + "id": "hIltPgZ4hGIcD1Qz" } }, { "Heating": { - "id": "culKrBObwYWb6x0g" + "id": "rErpcoXBmxMgHeub" } } ], @@ -405,7 +405,7 @@ TEST_F(JsonPrinterTest, should_honor_include_hidden_parameter) "value": "Hey Will", "model": "abc" }, - "id": "_cNZEyq5kGkgppmh" + "id": "ZA2H50HmqkxmmoKk" } } ], @@ -413,7 +413,7 @@ TEST_F(JsonPrinterTest, should_honor_include_hidden_parameter) { "DataItem": { "category": "EVENT", - "id": "FFZeJQRwQvAdUJX4", + "id": "JV5WFPBCcAT4lVAd", "name": "avail", "type": "AVAILABILITY" } @@ -421,19 +421,19 @@ TEST_F(JsonPrinterTest, should_honor_include_hidden_parameter) { "DataItem": { "category": "EVENT", - "id": "T0qItk3igtyip1XX", + "id": "tohKT9C4k1nYryEA", "type": "ASSET_CHANGED" } }, { "DataItem": { "category": "EVENT", - "id": "LWOt9yZtpFPWjL7v", + "id": "F1jLVOkbSb7Mv7WI", "type": "ASSET_REMOVED" } } ], - "id": "DFYX7ls4d4to2Lhb", + "id": "AdWDIt3OFtbuNhoe", "name": "foo", "uuid": "xxx" } @@ -467,13 +467,13 @@ TEST_F(JsonPrinterTest, should_honor_include_hidden_parameter) "Components": [ { "Electric": { - "id": "Pm2JhGKEeAYzVA8c", + "id": "hIltPgZ4hGIcD1Qz", "originalId": "e1" } }, { "Heating": { - "id": "culKrBObwYWb6x0g", + "id": "rErpcoXBmxMgHeub", "originalId": "h1" } } @@ -482,7 +482,7 @@ TEST_F(JsonPrinterTest, should_honor_include_hidden_parameter) "value": "Hey Will", "model": "abc" }, - "id": "_cNZEyq5kGkgppmh", + "id": "ZA2H50HmqkxmmoKk", "originalId": "s1" } } @@ -491,7 +491,7 @@ TEST_F(JsonPrinterTest, should_honor_include_hidden_parameter) { "DataItem": { "category": "EVENT", - "id": "FFZeJQRwQvAdUJX4", + "id": "JV5WFPBCcAT4lVAd", "name": "avail", "originalId": "avail", "type": "AVAILABILITY" @@ -500,7 +500,7 @@ TEST_F(JsonPrinterTest, should_honor_include_hidden_parameter) { "DataItem": { "category": "EVENT", - "id": "T0qItk3igtyip1XX", + "id": "tohKT9C4k1nYryEA", "originalId": "d1_asset_chg", "type": "ASSET_CHANGED" } @@ -508,13 +508,13 @@ TEST_F(JsonPrinterTest, should_honor_include_hidden_parameter) { "DataItem": { "category": "EVENT", - "id": "LWOt9yZtpFPWjL7v", + "id": "F1jLVOkbSb7Mv7WI", "originalId": "d1_asset_rem", "type": "ASSET_REMOVED" } } ], - "id": "DFYX7ls4d4to2Lhb", + "id": "AdWDIt3OFtbuNhoe", "name": "foo", "originalId": "d1", "uuid": "xxx" diff --git a/test_package/kinematics_test.cpp b/test_package/kinematics_test.cpp index 1c9c462c8..15fe9aa10 100644 --- a/test_package/kinematics_test.cpp +++ b/test_package/kinematics_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/mqtt_adapter_test.cpp b/test_package/mqtt_adapter_test.cpp index da4efeddb..080d09e92 100644 --- a/test_package/mqtt_adapter_test.cpp +++ b/test_package/mqtt_adapter_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/mqtt_isolated_test.cpp b/test_package/mqtt_isolated_test.cpp index 9789436c5..fb802105f 100644 --- a/test_package/mqtt_isolated_test.cpp +++ b/test_package/mqtt_isolated_test.cpp @@ -1,5 +1,5 @@ -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); @@ -115,7 +115,7 @@ class MqttIsolatedUnitTest : public testing::Test bool waitFor(const chrono::duration &time, function pred) { boost::asio::steady_timer timer(m_agentTestHelper->m_ioContext); - timer.expires_from_now(time); + timer.expires_after(time); bool timeout = false; timer.async_wait([&timeout](boost::system::error_code ec) { if (!ec) diff --git a/test_package/mqtt_sink_test.cpp b/test_package/mqtt_sink_test.cpp index 0da157089..d544b579c 100644 --- a/test_package/mqtt_sink_test.cpp +++ b/test_package/mqtt_sink_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/mtconnect_xml_transform_test.cpp b/test_package/mtconnect_xml_transform_test.cpp index 21e3b010e..53730c8dc 100644 --- a/test_package/mtconnect_xml_transform_test.cpp +++ b/test_package/mtconnect_xml_transform_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -31,7 +31,6 @@ using namespace mtconnect::pipeline; using namespace mtconnect::observation; using namespace mtconnect::asset; using namespace std; -using namespace date::literals; using namespace std::literals; // main diff --git a/test_package/observation_test.cpp b/test_package/observation_test.cpp index 3040dfe31..15194982d 100644 --- a/test_package/observation_test.cpp +++ b/test_package/observation_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/observation_validation_test.cpp b/test_package/observation_validation_test.cpp index bd45fbab2..df0be79f3 100644 --- a/test_package/observation_validation_test.cpp +++ b/test_package/observation_validation_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/pallet_test.cpp b/test_package/pallet_test.cpp index a8eb5f5ce..40b382bde 100644 --- a/test_package/pallet_test.cpp +++ b/test_package/pallet_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/period_filter_test.cpp b/test_package/period_filter_test.cpp index 49ee0833c..4e2c01f21 100644 --- a/test_package/period_filter_test.cpp +++ b/test_package/period_filter_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -607,7 +607,7 @@ TEST_F(PeriodFilterTest, streaming_observations_spaced_temporally) } m_ioContext.run_for(400ms); - m_ioContext.reset(); + m_ioContext.restart(); { auto os = observe({"a", "2"}, now + 400ms); @@ -617,7 +617,7 @@ TEST_F(PeriodFilterTest, streaming_observations_spaced_temporally) } m_ioContext.run_for(200ms); - m_ioContext.reset(); + m_ioContext.restart(); { auto os = observe({"a", "3"}, now + 600ms); @@ -627,7 +627,7 @@ TEST_F(PeriodFilterTest, streaming_observations_spaced_temporally) } m_ioContext.run_for(600ms); - m_ioContext.reset(); + m_ioContext.restart(); { auto os = observe({"a", "4"}, now + 1200ms); @@ -638,7 +638,7 @@ TEST_F(PeriodFilterTest, streaming_observations_spaced_temporally) } m_ioContext.run_for(700ms); - m_ioContext.reset(); + m_ioContext.restart(); { auto os = observe({"a", "5"}, now + 1900ms); @@ -648,7 +648,7 @@ TEST_F(PeriodFilterTest, streaming_observations_spaced_temporally) } m_ioContext.run_for(1200ms); - m_ioContext.reset(); + m_ioContext.restart(); { auto os = observe({"a", "6"}, now + 3100ms); @@ -660,7 +660,7 @@ TEST_F(PeriodFilterTest, streaming_observations_spaced_temporally) } m_ioContext.run_for(1400ms); - m_ioContext.reset(); + m_ioContext.restart(); { auto os = observe({"a", "7"}, now + 4500ms); diff --git a/test_package/physical_asset_test.cpp b/test_package/physical_asset_test.cpp index f451f03a3..3a66fd587 100644 --- a/test_package/physical_asset_test.cpp +++ b/test_package/physical_asset_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/pipeline_deliver_test.cpp b/test_package/pipeline_deliver_test.cpp index 3e632ee37..1584b0497 100644 --- a/test_package/pipeline_deliver_test.cpp +++ b/test_package/pipeline_deliver_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/pipeline_edit_test.cpp b/test_package/pipeline_edit_test.cpp index c5b68d90f..5268fec63 100644 --- a/test_package/pipeline_edit_test.cpp +++ b/test_package/pipeline_edit_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/qif_document_test.cpp b/test_package/qif_document_test.cpp index 68097689f..42d552c3e 100644 --- a/test_package/qif_document_test.cpp +++ b/test_package/qif_document_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/qname_test.cpp b/test_package/qname_test.cpp index 05ac55b35..0cc873b4a 100644 --- a/test_package/qname_test.cpp +++ b/test_package/qname_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/raw_material_test.cpp b/test_package/raw_material_test.cpp index e7edecf6d..fab3a2feb 100644 --- a/test_package/raw_material_test.cpp +++ b/test_package/raw_material_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/references_test.cpp b/test_package/references_test.cpp index 7d18c1148..2b79f546c 100644 --- a/test_package/references_test.cpp +++ b/test_package/references_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/relationship_test.cpp b/test_package/relationship_test.cpp index b9ebf7f07..94174d5b8 100644 --- a/test_package/relationship_test.cpp +++ b/test_package/relationship_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/response_document_test.cpp b/test_package/response_document_test.cpp index f02f3f0db..55c6c793d 100644 --- a/test_package/response_document_test.cpp +++ b/test_package/response_document_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/routing_test.cpp b/test_package/routing_test.cpp index 57c06fef1..3235cea32 100644 --- a/test_package/routing_test.cpp +++ b/test_package/routing_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/sensor_configuration_test.cpp b/test_package/sensor_configuration_test.cpp index eaf783b65..4ea1ddd74 100644 --- a/test_package/sensor_configuration_test.cpp +++ b/test_package/sensor_configuration_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/shdr_tokenizer_test.cpp b/test_package/shdr_tokenizer_test.cpp index 76b754d43..570015fe8 100644 --- a/test_package/shdr_tokenizer_test.cpp +++ b/test_package/shdr_tokenizer_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -29,7 +29,6 @@ using namespace mtconnect; using namespace mtconnect::pipeline; using namespace mtconnect::observation; using namespace std; -using namespace date::literals; using namespace std::literals; // main diff --git a/test_package/solid_model_test.cpp b/test_package/solid_model_test.cpp index 7cd6696a7..4e81d23d1 100644 --- a/test_package/solid_model_test.cpp +++ b/test_package/solid_model_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/specification_test.cpp b/test_package/specification_test.cpp index 3e3529fd6..fe7ab06d8 100644 --- a/test_package/specification_test.cpp +++ b/test_package/specification_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/table_test.cpp b/test_package/table_test.cpp index f424a12e7..d27b14edd 100644 --- a/test_package/table_test.cpp +++ b/test_package/table_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/test_utilities.hpp b/test_package/test_utilities.hpp index c40b39f42..21ba8f892 100644 --- a/test_package/test_utilities.hpp +++ b/test_package/test_utilities.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/testadapter_service.cpp b/test_package/testadapter_service.cpp index 23ae60b83..a78130bbf 100644 --- a/test_package/testadapter_service.cpp +++ b/test_package/testadapter_service.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/testadapter_service.hpp b/test_package/testadapter_service.hpp index d0828588a..558cdf30e 100644 --- a/test_package/testadapter_service.hpp +++ b/test_package/testadapter_service.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/testsink_service.cpp b/test_package/testsink_service.cpp index 245c9f595..cd6a421ed 100644 --- a/test_package/testsink_service.cpp +++ b/test_package/testsink_service.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/testsink_service.hpp b/test_package/testsink_service.hpp index 9b79806e2..6cfa35559 100644 --- a/test_package/testsink_service.hpp +++ b/test_package/testsink_service.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/timestamp_extractor_test.cpp b/test_package/timestamp_extractor_test.cpp index dd355f17a..99a314d63 100644 --- a/test_package/timestamp_extractor_test.cpp +++ b/test_package/timestamp_extractor_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -30,7 +30,6 @@ using namespace mtconnect::entity; using namespace std; using namespace std::literals; using namespace date; -using namespace date::literals; // main int main(int argc, char *argv[]) diff --git a/test_package/tls_http_server_test.cpp b/test_package/tls_http_server_test.cpp index 830d85f06..13a047719 100644 --- a/test_package/tls_http_server_test.cpp +++ b/test_package/tls_http_server_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -75,7 +75,7 @@ class Client SSL_set_tlsext_host_name(m_stream.native_handle(), "localhost"); // These objects perform our I/O - tcp::endpoint server(asio::ip::address_v4::from_string("127.0.0.1"), port); + tcp::endpoint server(asio::ip::make_address("127.0.0.1"), port); // Set the timeout. beast::get_lowest_layer(m_stream).expires_after(std::chrono::seconds(30)); @@ -241,7 +241,8 @@ class Client void spawnReadChunk() { - asio::spawn(m_context, std::bind(&Client::readChunk, this, std::placeholders::_1)); + asio::spawn(m_context, std::bind(&Client::readChunk, this, std::placeholders::_1), + asio::detached); } void spawnRequest(boost::beast::http::verb verb, std::string const& target, @@ -252,7 +253,7 @@ class Client m_done = false; m_count = 0; asio::spawn(m_context, std::bind(&Client::request, this, verb, target, body, close, contentType, - std::placeholders::_1)); + std::placeholders::_1), boost::asio::detached); while (!m_done && !m_failed && m_context.run_for(20ms) > 0) ; @@ -271,7 +272,7 @@ class Client m_done = true; }; - asio::spawn(m_context, std::bind(closeStream, std::placeholders::_1)); + asio::spawn(m_context, std::bind(closeStream, std::placeholders::_1), boost::asio::detached); while (!m_done && m_context.run_for(100ms) > 0) ; } @@ -309,7 +310,7 @@ const string ClientKeyFile {TEST_RESOURCE_DIR "/client.key"}; const string ClientDhFile {TEST_RESOURCE_DIR "/dh2048.pem"}; const string ClientCAFile(TEST_RESOURCE_DIR "/clientca.crt"); -class TlsRestServiceTest : public testing::Test +class TlsHttpServerTest : public testing::Test { protected: void SetUp() override @@ -362,7 +363,8 @@ class TlsRestServiceTest : public testing::Test m_client->m_clientCert = clientCert; asio::spawn(m_context, std::bind(&Client::connect, m_client.get(), - static_cast(m_server->getPort()), std::placeholders::_1)); + static_cast(m_server->getPort()), std::placeholders::_1), + boost::asio::detached); while (!m_client->m_connected && !m_client->m_failed) m_context.run_one(); @@ -384,7 +386,7 @@ class TlsRestServiceTest : public testing::Test unique_ptr m_client; }; -TEST_F(TlsRestServiceTest, create_server_and_load_certificates) +TEST_F(TlsHttpServerTest, create_server_and_load_certificates) { weak_ptr savedSession; @@ -422,7 +424,7 @@ TEST_F(TlsRestServiceTest, create_server_and_load_certificates) ASSERT_TRUE(savedSession.expired()); } -TEST_F(TlsRestServiceTest, streaming_response) +TEST_F(TlsHttpServerTest, streaming_response) { struct context { @@ -505,7 +507,7 @@ TEST_F(TlsRestServiceTest, streaming_response) ; } -TEST_F(TlsRestServiceTest, check_failed_client_certificate) +TEST_F(TlsHttpServerTest, check_failed_client_certificate) { using namespace mtconnect::configuration; ConfigOptions options {{TlsCertificateChain, CertFile}, @@ -533,7 +535,7 @@ TEST_F(TlsRestServiceTest, check_failed_client_certificate) const string ClientCA(TEST_RESOURCE_DIR "/clientca.crt"); -TEST_F(TlsRestServiceTest, check_valid_client_certificate) +TEST_F(TlsHttpServerTest, check_valid_client_certificate) { using namespace mtconnect::configuration; ConfigOptions options {{TlsCertificateChain, CertFile}, @@ -564,7 +566,7 @@ TEST_F(TlsRestServiceTest, check_valid_client_certificate) EXPECT_EQ(200, m_client->m_status); } -TEST_F(TlsRestServiceTest, check_valid_client_certificate_without_server_ca) +TEST_F(TlsHttpServerTest, check_valid_client_certificate_without_server_ca) { using namespace mtconnect::configuration; ConfigOptions options {{TlsCertificateChain, CertFile}, diff --git a/test_package/topic_mapping_test.cpp b/test_package/topic_mapping_test.cpp index a83824e5e..19b928af2 100644 --- a/test_package/topic_mapping_test.cpp +++ b/test_package/topic_mapping_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/unit_conversion_test.cpp b/test_package/unit_conversion_test.cpp index 7a09bbc31..72438ecf5 100644 --- a/test_package/unit_conversion_test.cpp +++ b/test_package/unit_conversion_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/url_parser_test.cpp b/test_package/url_parser_test.cpp index bf7199a99..a9d646a9d 100644 --- a/test_package/url_parser_test.cpp +++ b/test_package/url_parser_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/globals_test.cpp b/test_package/utilities_test.cpp similarity index 90% rename from test_package/globals_test.cpp rename to test_package/utilities_test.cpp index 48cdee99a..4f43b903c 100644 --- a/test_package/globals_test.cpp +++ b/test_package/utilities_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -34,7 +34,7 @@ int main(int argc, char *argv[]) return RUN_ALL_TESTS(); } -TEST(GlobalsTest, IntToString) +TEST(UtilitiesTest, should_be_able_to_convert_from_integer_to_string) { ASSERT_EQ((string) "1234", to_string(1234)); ASSERT_EQ((string) "0", to_string(0)); @@ -42,7 +42,7 @@ TEST(GlobalsTest, IntToString) ASSERT_EQ((string) "1", to_string(1)); } -TEST(GlobalsTest, FloatToString) +TEST(UtilitiesTest, should_be_able_to_convert_from_float_to_string) { ASSERT_EQ((string) "1.234", format(1.234)); ASSERT_EQ((string) "0", format(0.0)); @@ -50,7 +50,7 @@ TEST(GlobalsTest, FloatToString) ASSERT_EQ((string) "1", format(1.0)); } -TEST(GlobalsTest, ToUpperCase) +TEST(UtilitiesTest, should_uppercase_string) { string lower = "abcDef"; ASSERT_EQ((string) "ABCDEF", toUpperCase(lower)); @@ -62,7 +62,7 @@ TEST(GlobalsTest, ToUpperCase) ASSERT_EQ((string) "QWERTY.ASDF|", toUpperCase(lower)); } -TEST(GlobalsTest, IsNonNegativeInteger) +TEST(UtilitiesTest, IsNonNegativeInteger) { ASSERT_TRUE(isNonNegativeInteger("12345")); ASSERT_TRUE(isNonNegativeInteger("123456789012345678901234567890")); @@ -72,7 +72,7 @@ TEST(GlobalsTest, IsNonNegativeInteger) ASSERT_TRUE(!isNonNegativeInteger("123.45")); } -TEST(GlobalsTest, Time) +TEST(UtilitiesTest, Time) { auto time1 = getCurrentTime(GMT); auto time2 = getCurrentTime(GMT); @@ -99,7 +99,7 @@ TEST(GlobalsTest, Time) ASSERT_TRUE(time7 < time9); } -TEST(GlobalsTest, IllegalCharacters) +TEST(UtilitiesTest, IllegalCharacters) { string before1("Don't Change Me"), after1("Don't Change Me"); replaceIllegalCharacters(before1); @@ -114,7 +114,7 @@ TEST(GlobalsTest, IllegalCharacters) ASSERT_EQ(before3, after3); } -TEST(GlobalsTest, GetCurrentTime) +TEST(UtilitiesTest, GetCurrentTime) { auto gmt = getCurrentTime(GMT); auto time = parseTimeMicro(gmt); @@ -140,7 +140,7 @@ TEST(GlobalsTest, GetCurrentTime) ASSERT_EQ(8, n); } -TEST(GlobalsTest, GetCurrentTime2) +TEST(UtilitiesTest, GetCurrentTime2) { // Build a known system time point auto knownTimePoint = std::chrono::system_clock::from_time_t(0); // 1 Jan 1970 00:00:00 @@ -173,14 +173,14 @@ TEST(GlobalsTest, GetCurrentTime2) ASSERT_EQ(string("Thu, 01 Jan 1970 00:00:10 GMT"), humRead); } -TEST(GlobalsTest, ParseTimeMicro) +TEST(UtilitiesTest, ParseTimeMicro) { // This time is 123456 microseconds after the epoch auto v = parseTimeMicro("1970-01-01T00:00:00.123456Z"); ASSERT_EQ(uint64_t {123456}, v); } -TEST(GlobalsTest, AddNamespace) +TEST(UtilitiesTest, AddNamespace) { auto result = addNamespace("//Device//Foo", "m"); ASSERT_EQ(string("//m:Device//m:Foo"), result); @@ -201,7 +201,7 @@ TEST(GlobalsTest, AddNamespace) ASSERT_EQ(string("//m:Device/m:DataItems/"), result); } -TEST(GlobalsTest, ParseTimeMilli) +TEST(UtilitiesTest, ParseTimeMilli) { string v = "2012-11-20T12:33:22.123456"; @@ -213,4 +213,4 @@ TEST(GlobalsTest, ParseTimeMilli) ASSERT_TRUE(1353414802123000LL == time); } -TEST(GlobalsTest, Int64ToString) { ASSERT_EQ((string) "8805345009", to_string(8805345009ULL)); } +TEST(UtilitiesTest, Int64ToString) { ASSERT_EQ((string) "8805345009", to_string(8805345009ULL)); } diff --git a/test_package/websockets_test.cpp b/test_package/websockets_test.cpp index d225449b8..07044401f 100644 --- a/test_package/websockets_test.cpp +++ b/test_package/websockets_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -73,7 +73,7 @@ class Client beast::error_code ec; // These objects perform our I/O - tcp::endpoint server(asio::ip::address_v4::from_string("127.0.0.1"), port); + tcp::endpoint server(asio::ip::make_address("127.0.0.1"), port); // Make the connection on the IP address we get from a lookup beast::get_lowest_layer(m_stream).async_connect(server, yield[ec]); @@ -126,7 +126,7 @@ class Client bool waitFor(const chrono::duration& time, function pred) { boost::asio::steady_timer timer(m_context); - timer.expires_from_now(time); + timer.expires_after(time); bool timeout = false; timer.async_wait([&timeout](boost::system::error_code ec) { if (!ec) @@ -197,7 +197,8 @@ class WebsocketsTest : public testing::Test m_client->m_connected = false; asio::spawn(m_context, std::bind(&Client::connect, m_client.get(), - static_cast(m_server->getPort()), std::placeholders::_1)); + static_cast(m_server->getPort()), std::placeholders::_1), + boost::asio::detached); m_client->waitFor(1s, [this]() { return m_client->m_connected; }); } @@ -241,7 +242,8 @@ TEST_F(WebsocketsTest, should_make_simple_request) startClient(); asio::spawn(m_context, std::bind(&Client::request, m_client.get(), - "{\"id\":\"1\",\"request\":\"probe\"}"s, std::placeholders::_1)); + "{\"id\":\"1\",\"request\":\"probe\"}"s, std::placeholders::_1), + boost::asio::detached); m_client->waitFor(2s, [this]() { return m_client->m_done; }); @@ -269,7 +271,8 @@ TEST_F(WebsocketsTest, should_return_error_when_there_is_no_id) startClient(); asio::spawn(m_context, std::bind(&Client::request, m_client.get(), "{\"request\":\"probe\"}"s, - std::placeholders::_1)); + std::placeholders::_1), + boost::asio::detached); m_client->waitFor(2s, [this]() { return m_client->m_done; }); @@ -297,7 +300,8 @@ TEST_F(WebsocketsTest, should_return_error_when_there_is_no_request) startClient(); asio::spawn(m_context, - std::bind(&Client::request, m_client.get(), "{\"id\": 3}"s, std::placeholders::_1)); + std::bind(&Client::request, m_client.get(), "{\"id\": 3}"s, std::placeholders::_1), + boost::asio::detached); m_client->waitFor(2s, [this]() { return m_client->m_done; }); @@ -328,7 +332,8 @@ TEST_F(WebsocketsTest, should_return_error_when_a_parameter_is_invalid) asio::spawn(m_context, std::bind(&Client::request, m_client.get(), "{\"id\": 3, \"request\": \"sample\", \"interval\": 99999999999}"s, - std::placeholders::_1)); + std::placeholders::_1), + asio::detached); m_client->waitFor(2s, [this]() { return m_client->m_done; }); @@ -358,7 +363,8 @@ TEST_F(WebsocketsTest, should_return_error_when_bad_json_is_sent) startClient(); asio::spawn(m_context, - std::bind(&Client::request, m_client.get(), "!}}"s, std::placeholders::_1)); + std::bind(&Client::request, m_client.get(), "!}}"s, std::placeholders::_1), + boost::asio::detached); m_client->waitFor(2s, [this]() { return m_client->m_done; }); @@ -392,7 +398,8 @@ TEST_F(WebsocketsTest, should_return_multiple_errors_when_parameters_are_invalid m_context, std::bind(&Client::request, m_client.get(), R"DOC({"id": 3, "request": "sample", "interval": 99999999999,"to": -1 })DOC", - std::placeholders::_1)); + std::placeholders::_1), + boost::asio::detached); m_client->waitFor(2s, [this]() { return m_client->m_done; }); @@ -424,7 +431,8 @@ TEST_F(WebsocketsTest, should_return_error_for_an_invalid_command) asio::spawn(m_context, std::bind(&Client::request, m_client.get(), "{\"id\":\"1\",\"request\":\"sample\"}"s, - std::placeholders::_1)); + std::placeholders::_1), + boost::asio::detached); m_client->waitFor(2s, [this]() { return m_client->m_done; }); diff --git a/test_package/xml_parser_test.cpp b/test_package/xml_parser_test.cpp index f2c532b94..88e61545a 100644 --- a/test_package/xml_parser_test.cpp +++ b/test_package/xml_parser_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/xml_printer_test.cpp b/test_package/xml_printer_test.cpp index 8cc4ea6bf..287344fb1 100644 --- a/test_package/xml_printer_test.cpp +++ b/test_package/xml_printer_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License");