Skip to content

Commit

Permalink
Merge pull request #538 from ApexAI/iox-#381-refactor-mq-interface-cl…
Browse files Browse the repository at this point in the history
…asses

Iox #381 Rename and refactor message queue interface classes
  • Loading branch information
mossmaurice committed Feb 12, 2021
2 parents e625656 + 8596014 commit ce730c9
Show file tree
Hide file tree
Showing 37 changed files with 1,478 additions and 1,759 deletions.
13 changes: 10 additions & 3 deletions iceoryx_posh/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) 2020 by Robert Bosch GmbH, Apex.AI Inc. All rights reserved.
# Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved.
# Copyright (c) 2020 - 2021 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.
Expand All @@ -11,6 +12,9 @@
# 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.
#
# SPDX-License-Identifier: Apache-2.0


cmake_minimum_required(VERSION 3.5)
file (STRINGS "../VERSION" iceoryx_posh_VERSION)
Expand Down Expand Up @@ -107,8 +111,11 @@ add_library(iceoryx_posh
source/popo/trigger_handle.cpp
source/popo/event_info.cpp
source/version/version_info.cpp
source/runtime/message_queue_interface.cpp
source/runtime/message_queue_message.cpp
source/runtime/ipc_interface_base.cpp
source/runtime/ipc_interface_user.cpp
source/runtime/ipc_interface_creator.cpp
source/runtime/ipc_runtime_interface.cpp
source/runtime/ipc_message.cpp
source/runtime/port_config_info.cpp
source/runtime/posh_runtime.cpp
source/runtime/posh_runtime_single_process.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ constexpr char ScopeTypeString[][MAX_NUMBER_OF_CHARS] = {"WORLDWIDE", "INTERNAL"
/// instance and the event id.
/// In order to support different communication protocols, two types of members exist: integer and string identifiers.
/// If string IDs are used, the integers are initialized to an invalid number. A class object can be
/// serialized/deserialized, so it is possible to send the information e.g. over a message queue.
/// serialized/deserialized, so it is possible to send the information e.g. over a IPC channel.
class ServiceDescription
{
public:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2019, 2021 by Robert Bosch GmbH, Apex.AI Inc. All rights reserved.
// Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved.
// Copyright (c) 2021 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.
Expand All @@ -11,6 +12,9 @@
// 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.
//
// SPDX-License-Identifier: Apache-2.0

#ifndef IOX_POSH_ROUDI_PORT_MANAGER_HPP
#define IOX_POSH_ROUDI_PORT_MANAGER_HPP

Expand All @@ -27,7 +31,7 @@
#include "iceoryx_posh/internal/popo/ports/subscriber_port_user.hpp"
#include "iceoryx_posh/internal/roudi/introspection/port_introspection.hpp"
#include "iceoryx_posh/internal/roudi/service_registry.hpp"
#include "iceoryx_posh/internal/runtime/message_queue_message.hpp"
#include "iceoryx_posh/internal/runtime/ipc_message.hpp"
#include "iceoryx_posh/internal/runtime/node_data.hpp"
#include "iceoryx_posh/mepoo/chunk_header.hpp"
#include "iceoryx_posh/mepoo/memory_info.hpp"
Expand Down Expand Up @@ -93,7 +97,7 @@ class PortManager
void destroySubscriberPort(SubscriberPortType::MemberType_t* const subscriberPortData) noexcept;

const std::atomic<uint64_t>* serviceRegistryChangeCounter() noexcept;
runtime::MqMessage findService(const capro::ServiceDescription& service) noexcept;
runtime::IpcMessage findService(const capro::ServiceDescription& service) noexcept;

protected:
void handlePublisherPorts() noexcept;
Expand All @@ -120,7 +124,8 @@ class PortManager
void removeEntryFromServiceRegistry(const capro::IdString_t& service, const capro::IdString_t& instance) noexcept;

template <typename T, std::enable_if_t<std::is_same<T, iox::build::OneToManyPolicy>::value>* = nullptr>
cxx::optional<ProcessName_t> doesViolateCommunicationPolicy(const capro::ServiceDescription& service) const noexcept;
cxx::optional<ProcessName_t> doesViolateCommunicationPolicy(const capro::ServiceDescription& service) const
noexcept;

template <typename T, std::enable_if_t<std::is_same<T, iox::build::ManyToManyPolicy>::value>* = nullptr>
cxx::optional<ProcessName_t> doesViolateCommunicationPolicy(const capro::ServiceDescription& service
Expand Down
14 changes: 9 additions & 5 deletions iceoryx_posh/include/iceoryx_posh/internal/roudi/roudi.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved.
// Copyright (c) 2021 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.
Expand All @@ -11,14 +12,17 @@
// 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.
//
// SPDX-License-Identifier: Apache-2.0

#ifndef IOX_POSH_ROUDI_ROUDI_MULTI_PROCESS_HPP
#define IOX_POSH_ROUDI_ROUDI_MULTI_PROCESS_HPP

#include "iceoryx_posh/iceoryx_posh_types.hpp"
#include "iceoryx_posh/internal/capro/capro_message.hpp"
#include "iceoryx_posh/internal/roudi/introspection/mempool_introspection.hpp"
#include "iceoryx_posh/internal/roudi/roudi_process.hpp"
#include "iceoryx_posh/internal/runtime/message_queue_interface.hpp"
#include "iceoryx_posh/internal/runtime/ipc_interface_base.hpp"
#include "iceoryx_posh/mepoo/mepoo_config.hpp"
#include "iceoryx_posh/roudi/memory/roudi_memory_interface.hpp"
#include "iceoryx_posh/roudi/memory/roudi_memory_manager.hpp"
Expand Down Expand Up @@ -91,14 +95,14 @@ class RouDi
///
/// @note Intentionally not virtual to be able to call it in derived class
void shutdown();
virtual void processMessage(const runtime::MqMessage& message,
const iox::runtime::MqMessageType& cmd,
virtual void processMessage(const runtime::IpcMessage& message,
const iox::runtime::IpcMessageType& cmd,
const ProcessName_t& processName);
virtual void cyclicUpdateHook();
void mqMessageErrorHandler();
void IpcMessageErrorHandler();

version::VersionInfo
parseRegisterMessage(const runtime::MqMessage& message, int& pid, uid_t& userId, int64_t& transmissionTimestamp);
parseRegisterMessage(const runtime::IpcMessage& message, int& pid, uid_t& userId, int64_t& transmissionTimestamp);

/// @brief Handles the registration request from process
/// @param [in] name of the process which wants to register at roudi; this is equal to the IPC channel name
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2019, 2021 by Robert Bosch GmbH, Apex.AI Inc. All rights reserved.
// Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved.
// Copyright (c) 2021 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.
Expand All @@ -11,13 +12,16 @@
// 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.
//
// SPDX-License-Identifier: Apache-2.0

#ifndef IOX_POSH_ROUDI_ROUDI_PROCESS_HPP
#define IOX_POSH_ROUDI_ROUDI_PROCESS_HPP

#include "iceoryx_posh/internal/mepoo/segment_manager.hpp"
#include "iceoryx_posh/internal/roudi/introspection/process_introspection.hpp"
#include "iceoryx_posh/internal/roudi/port_manager.hpp"
#include "iceoryx_posh/internal/runtime/message_queue_interface.hpp"
#include "iceoryx_posh/internal/runtime/ipc_interface_user.hpp"
#include "iceoryx_posh/mepoo/chunk_header.hpp"
#include "iceoryx_posh/version/compatibility_check_level.hpp"
#include "iceoryx_posh/version/version_info.hpp"
Expand Down Expand Up @@ -62,7 +66,7 @@ class RouDiProcess

const ProcessName_t getName() const noexcept;

void sendViaIpcChannel(const runtime::MqMessage& data) noexcept;
void sendViaIpcChannel(const runtime::IpcMessage& data) noexcept;

/// @brief The session ID which is used to check outdated IPC channel transmissions for this process
/// @return the session ID for this process
Expand All @@ -79,7 +83,7 @@ class RouDiProcess

private:
int m_pid;
runtime::MqInterfaceUser m_mq;
runtime::IpcInterfaceUser m_ipcChannel;
mepoo::TimePointNs_t m_timestamp;
mepoo::MemoryManager* m_payloadMemoryManager{nullptr};
bool m_isMonitored{true};
Expand Down
Loading

0 comments on commit ce730c9

Please sign in to comment.