Skip to content

Commit

Permalink
iox-eclipse-iceoryx#91 More review findings \o/
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Hoinkis <simon.hoinkis@apex.ai>
  • Loading branch information
mossmaurice committed Dec 14, 2020
1 parent ba00f78 commit edb6196
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 15 deletions.
20 changes: 5 additions & 15 deletions iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -209,31 +208,22 @@ 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
{
// alias for IdString
using IdString = iox::capro::IdString;
using InstanceContainer = iox::cxx::vector<IdString, MAX_NUMBER_OF_INSTANCES>;
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
38 changes: 38 additions & 0 deletions iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.inl
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions iceoryx_utils/test/moduletests/test_posix_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class Thread_test : public Test
{
while (m_run)
{
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
};

Expand Down

0 comments on commit edb6196

Please sign in to comment.