forked from eclipse-iceoryx/iceoryx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'iceoryx/master' into iox-eclipse-iceoryx#605-cleanup-re…
…locatable-ptr Signed-off-by: Marika Lehmann <[email protected]>
- Loading branch information
Showing
28 changed files
with
1,317 additions
and
1,042 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
iceoryx_posh/include/iceoryx_posh/internal/roudi/process.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
// 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. | ||
// 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. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
#ifndef IOX_POSH_ROUDI_PROCESS_HPP | ||
#define IOX_POSH_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/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" | ||
#include "iceoryx_utils/cxx/list.hpp" | ||
#include "iceoryx_utils/error_handling/error_handling.hpp" | ||
#include "iceoryx_utils/posix_wrapper/posix_access_rights.hpp" | ||
|
||
#include <cstdint> | ||
#include <ctime> | ||
|
||
namespace iox | ||
{ | ||
namespace roudi | ||
{ | ||
class Process | ||
{ | ||
public: | ||
/// @brief This class represents an application which has registered at RouDi and manages the communication to the | ||
/// application | ||
/// @param [in] name of the process; this is equal to the IPC channel name, which is used for communication | ||
/// @param [in] pid is the host system process id | ||
/// @param [in] payloadMemoryManager is a pointer to the payload memory manager for this process | ||
/// @param [in] isMonitored indicates if the process should be monitored for being alive | ||
/// @param [in] payloadSegmentId is an identifier for the shm payload segment | ||
/// @param [in] sessionId is an ID generated by RouDi to prevent sending outdated IPC channel transmission | ||
Process(const ProcessName_t& name, | ||
const uint32_t pid, | ||
mepoo::MemoryManager& payloadMemoryManager, | ||
const bool isMonitored, | ||
const uint64_t payloadSegmentId, | ||
const uint64_t sessionId) noexcept; | ||
|
||
Process(const Process& other) = delete; | ||
Process& operator=(const Process& other) = delete; | ||
/// @note the move cTor and assignment operator are already implicitly deleted because of the atomic | ||
Process(Process&& other) = delete; | ||
Process& operator=(Process&& other) = delete; | ||
~Process() = default; | ||
|
||
uint32_t getPid() const noexcept; | ||
|
||
const ProcessName_t getName() const 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 | ||
uint64_t getSessionId() noexcept; | ||
|
||
void setTimestamp(const mepoo::TimePointNs_t timestamp) noexcept; | ||
|
||
mepoo::TimePointNs_t getTimestamp() noexcept; | ||
|
||
mepoo::MemoryManager& getPayloadMemoryManager() const noexcept; | ||
uint64_t getPayloadSegmentId() const noexcept; | ||
|
||
bool isMonitored() const noexcept; | ||
|
||
private: | ||
const uint32_t m_pid{0U}; | ||
runtime::IpcInterfaceUser m_ipcChannel; | ||
mepoo::TimePointNs_t m_timestamp; | ||
mepoo::MemoryManager& m_payloadMemoryManager; | ||
bool m_isMonitored{true}; | ||
uint64_t m_payloadSegmentId{0U}; | ||
std::atomic<uint64_t> m_sessionId{0U}; | ||
}; | ||
|
||
} // namespace roudi | ||
} // namespace iox | ||
|
||
#endif // IOX_POSH_ROUDI_PROCESS_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.