diff --git a/iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.hpp b/iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.hpp index c8b94ab20f..46515abdb5 100644 --- a/iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.hpp +++ b/iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.hpp @@ -194,7 +194,6 @@ constexpr char SHM_NAME[] = "/iceoryx_mgmt"; using namespace units::duration_literals; constexpr units::Duration PROCESS_DEFAULT_KILL_DELAY = 45_s; constexpr units::Duration PROCESS_TERMINATED_CHECK_INTERVAL = 250_ms; -constexpr units::Duration PROCESS_WAITING_FOR_ROUDI_TIMEOUT = 60_s; constexpr units::Duration DISCOVERY_INTERVAL = 100_ms; /// @brief Controls process alive monitoring. Upon timeout, a monitored process is removed @@ -209,20 +208,7 @@ enum class MonitoringMode OFF }; -inline iox::log::LogStream& operator<<(iox::log::LogStream& logstream, const MonitoringMode& mode) -{ - switch (mode) - { - case MonitoringMode::OFF: - logstream << "MonitoringMode::OFF"; - break; - case MonitoringMode::ON: - logstream << "MonitoringMode::ON"; - break; - } - return logstream; -} - +iox::log::LogStream& operator<<(iox::log::LogStream& logstream, const MonitoringMode& mode); } // namespace roudi namespace runtime @@ -230,10 +216,14 @@ namespace runtime // alias for IdString using IdString = iox::capro::IdString; using InstanceContainer = iox::cxx::vector; +using namespace units::duration_literals; +constexpr units::Duration PROCESS_WAITING_FOR_ROUDI_TIMEOUT = 60_s; constexpr units::Duration PROCESS_KEEP_ALIVE_INTERVAL = 3 * roudi::DISCOVERY_INTERVAL; // > DISCOVERY_INTERVAL constexpr units::Duration PROCESS_KEEP_ALIVE_TIMEOUT = 5 * PROCESS_KEEP_ALIVE_INTERVAL; // > PROCESS_KEEP_ALIVE_INTERVAL } // namespace runtime } // namespace iox +#include "iceoryx_posh/iceoryx_posh_types.inl" + #endif // IOX_POSH_ICEORYX_POSH_TYPES_HPP diff --git a/iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.inl b/iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.inl new file mode 100644 index 0000000000..d78e1dca62 --- /dev/null +++ b/iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.inl @@ -0,0 +1,38 @@ +// Copyright (c) 2020 by Apex.AI Inc. 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. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef IOX_POSH_ICEORYX_POSH_TYPES_INL +#define IOX_POSH_ICEORYX_POSH_TYPES_INL + +namespace iox +{ +namespace roudi +{ +inline iox::log::LogStream& operator<<(iox::log::LogStream& logstream, const MonitoringMode& mode) +{ + switch (mode) + { + case MonitoringMode::OFF: + logstream << "MonitoringMode::OFF"; + break; + case MonitoringMode::ON: + logstream << "MonitoringMode::ON"; + break; + } + return logstream; +} +} // namespace roudi + +} // namespace iox + +#endif // IOX_POSH_ICEORYX_POSH_TYPES_INL diff --git a/iceoryx_utils/test/moduletests/test_posix_thread.cpp b/iceoryx_utils/test/moduletests/test_posix_thread.cpp index 2880e6d382..2925abc667 100644 --- a/iceoryx_utils/test/moduletests/test_posix_thread.cpp +++ b/iceoryx_utils/test/moduletests/test_posix_thread.cpp @@ -50,6 +50,7 @@ class Thread_test : public Test { while (m_run) { + std::this_thread::sleep_for(std::chrono::milliseconds(10)); } };