Skip to content

Commit

Permalink
iox-eclipse-iceoryx#605 clang-format all the things
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Hoinkis <[email protected]>
  • Loading branch information
mossmaurice committed Sep 29, 2022
1 parent 797d719 commit cd59d9b
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ inline id_t PointerRepository<id_t, ptr_t, CAPACITY>::searchId(ptr_t ptr) const
}
template <typename id_t, typename ptr_t, uint64_t CAPACITY>
inline bool PointerRepository<id_t, ptr_t, CAPACITY>::addPointerIfIdIsFree(const id_t id,
const ptr_t ptr,
const uint64_t size) noexcept
const ptr_t ptr,
const uint64_t size) noexcept
{
if (m_info[id].basePtr == nullptr)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

#include "iceoryx_hoofs/cxx/helplets.hpp"
#include "iceoryx_hoofs/internal/concurrent/loffli.hpp"
#include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp"
#include "iceoryx_hoofs/internal/memory/relative_pointer.hpp"
#include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp"
#include "iceoryx_posh/mepoo/chunk_header.hpp"

#include <atomic>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ inline SharedMemoryObjectType MePooSegment<SharedMemoryObjectType, MemoryManager
.permissions(SEGMENT_PERMISSIONS)
.create()
.and_then([this](auto& sharedMemoryObject) {
auto maybeSegmentId = iox::memory::UntypedRelativePointer::registerPtr(sharedMemoryObject.getBaseAddress(),
sharedMemoryObject.getSizeInBytes());
auto maybeSegmentId = iox::memory::UntypedRelativePointer::registerPtr(
sharedMemoryObject.getBaseAddress(), sharedMemoryObject.getSizeInBytes());
if (!maybeSegmentId.has_value())
{
errorHandler(PoshError::MEPOO__SEGMENT_INSUFFICIENT_SEGMENT_IDS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

#include "iceoryx_hoofs/cxx/algorithm.hpp"
#include "iceoryx_hoofs/cxx/vector.hpp"
#include "iceoryx_hoofs/internal/posix_wrapper/mutex.hpp"
#include "iceoryx_hoofs/internal/memory/relative_pointer.hpp"
#include "iceoryx_hoofs/internal/posix_wrapper/mutex.hpp"
#include "iceoryx_posh/error_handling/error_handling.hpp"
#include "iceoryx_posh/iceoryx_posh_types.hpp"
#include "iceoryx_posh/internal/log/posh_logging.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

#include "iceoryx_hoofs/cxx/optional.hpp"
#include "iceoryx_hoofs/cxx/vector.hpp"
#include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object.hpp"
#include "iceoryx_hoofs/internal/memory/relative_pointer.hpp"
#include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object.hpp"
#include "iceoryx_posh/iceoryx_posh_types.hpp"


Expand Down
11 changes: 6 additions & 5 deletions iceoryx_posh/source/mepoo/shm_safe_unmanaged_chunk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ ShmSafeUnmanagedChunk::ShmSafeUnmanagedChunk(mepoo::SharedChunk chunk) noexcept
cxx::Ensures(offset <= memory::RelativePointerData::OFFSET_RANGE
&& "RelativePointer offset must fit into offset type!");
/// @todo #1196 Unify types to uint64_t
m_chunkManagement = memory::RelativePointerData(static_cast<memory::RelativePointerData::identifier_t>(id), offset);
m_chunkManagement =
memory::RelativePointerData(static_cast<memory::RelativePointerData::identifier_t>(id), offset);
}
}

Expand All @@ -59,7 +60,7 @@ SharedChunk ShmSafeUnmanagedChunk::releaseToSharedChunk() noexcept
return SharedChunk();
}
auto chunkMgmt = memory::RelativePointer<mepoo::ChunkManagement>(m_chunkManagement.offset(),
memory::segment_id_t{m_chunkManagement.id()});
memory::segment_id_t{m_chunkManagement.id()});
m_chunkManagement.reset();
return SharedChunk(chunkMgmt.get());
}
Expand All @@ -71,7 +72,7 @@ SharedChunk ShmSafeUnmanagedChunk::cloneToSharedChunk() noexcept
return SharedChunk();
}
auto chunkMgmt = memory::RelativePointer<mepoo::ChunkManagement>(m_chunkManagement.offset(),
memory::segment_id_t{m_chunkManagement.id()});
memory::segment_id_t{m_chunkManagement.id()});
chunkMgmt->m_referenceCounter.fetch_add(1U, std::memory_order_relaxed);
return SharedChunk(chunkMgmt.get());
}
Expand All @@ -88,7 +89,7 @@ ChunkHeader* ShmSafeUnmanagedChunk::getChunkHeader() noexcept
return nullptr;
}
auto chunkMgmt = memory::RelativePointer<mepoo::ChunkManagement>(m_chunkManagement.offset(),
memory::segment_id_t{m_chunkManagement.id()});
memory::segment_id_t{m_chunkManagement.id()});
return chunkMgmt->m_chunkHeader.get();
}

Expand All @@ -105,7 +106,7 @@ bool ShmSafeUnmanagedChunk::isNotLogicalNullptrAndHasNoOtherOwners() const noexc
}

auto chunkMgmt = memory::RelativePointer<mepoo::ChunkManagement>(m_chunkManagement.offset(),
memory::segment_id_t{m_chunkManagement.id()});
memory::segment_id_t{m_chunkManagement.id()});
return chunkMgmt->m_referenceCounter.load(std::memory_order_relaxed) == 1U;
}

Expand Down
14 changes: 8 additions & 6 deletions iceoryx_posh/source/roudi/process_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,8 @@ void ProcessManager::addNodeForProcess(const RuntimeName_t& runtimeName, const N
.and_then([&](auto& process) {
m_portManager.acquireNodeData(runtimeName, nodeName)
.and_then([&](auto nodeData) {
auto offset = memory::UntypedRelativePointer::getOffset(memory::segment_id_t{m_mgmtSegmentId}, nodeData);
auto offset =
memory::UntypedRelativePointer::getOffset(memory::segment_id_t{m_mgmtSegmentId}, nodeData);

runtime::IpcMessage sendBuffer;
sendBuffer << runtime::IpcMessageTypeToString(runtime::IpcMessageType::CREATE_NODE_ACK)
Expand Down Expand Up @@ -424,8 +425,8 @@ void ProcessManager::addSubscriberForProcess(const RuntimeName_t& name,
if (!maybeSubscriber.has_error())
{
// send SubscriberPort to app as a serialized relative pointer
auto offset =
memory::UntypedRelativePointer::getOffset(memory::segment_id_t{m_mgmtSegmentId}, maybeSubscriber.value());
auto offset = memory::UntypedRelativePointer::getOffset(memory::segment_id_t{m_mgmtSegmentId},
maybeSubscriber.value());

runtime::IpcMessage sendBuffer;
sendBuffer << runtime::IpcMessageTypeToString(runtime::IpcMessageType::CREATE_SUBSCRIBER_ACK)
Expand Down Expand Up @@ -477,8 +478,8 @@ void ProcessManager::addPublisherForProcess(const RuntimeName_t& name,
if (!maybePublisher.has_error())
{
// send PublisherPort to app as a serialized relative pointer
auto offset =
memory::UntypedRelativePointer::getOffset(memory::segment_id_t{m_mgmtSegmentId}, maybePublisher.value());
auto offset = memory::UntypedRelativePointer::getOffset(memory::segment_id_t{m_mgmtSegmentId},
maybePublisher.value());

runtime::IpcMessage sendBuffer;
sendBuffer << runtime::IpcMessageTypeToString(runtime::IpcMessageType::CREATE_PUBLISHER_ACK)
Expand Down Expand Up @@ -636,7 +637,8 @@ void ProcessManager::addConditionVariableForProcess(const RuntimeName_t& runtime
.and_then([&](auto& process) { // Try to create a condition variable
m_portManager.acquireConditionVariableData(runtimeName)
.and_then([&](auto condVar) {
auto offset = memory::UntypedRelativePointer::getOffset(memory::segment_id_t{m_mgmtSegmentId}, condVar);
auto offset =
memory::UntypedRelativePointer::getOffset(memory::segment_id_t{m_mgmtSegmentId}, condVar);

runtime::IpcMessage sendBuffer;
sendBuffer << runtime::IpcMessageTypeToString(
Expand Down
14 changes: 8 additions & 6 deletions iceoryx_posh/source/runtime/shared_memory_user.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ SharedMemoryUser::SharedMemoryUser(const size_t topicSize,
.permissions(SHM_SEGMENT_PERMISSIONS)
.create()
.and_then([this, segmentId, segmentManagerAddressOffset](auto& sharedMemoryObject) {
auto registeredSuccessfully = memory::UntypedRelativePointer::registerPtrWithId(
memory::segment_id_t{segmentId}, sharedMemoryObject.getBaseAddress(), sharedMemoryObject.getSizeInBytes());
auto registeredSuccessfully =
memory::UntypedRelativePointer::registerPtrWithId(memory::segment_id_t{segmentId},
sharedMemoryObject.getBaseAddress(),
sharedMemoryObject.getSizeInBytes());

if (!registeredSuccessfully)
{
Expand All @@ -59,8 +61,8 @@ SharedMemoryUser::SharedMemoryUser(const size_t topicSize,
.or_else([](auto&) { errorHandler(PoshError::POSH__SHM_APP_MAPP_ERR); });
}

void SharedMemoryUser::openDataSegments(const uint64_t segmentId,
const memory::UntypedRelativePointer::offset_t segmentManagerAddressOffset) noexcept
void SharedMemoryUser::openDataSegments(
const uint64_t segmentId, const memory::UntypedRelativePointer::offset_t segmentManagerAddressOffset) noexcept
{
auto* ptr = memory::UntypedRelativePointer::getPtr(memory::segment_id_t{segmentId}, segmentManagerAddressOffset);
auto* segmentManager = static_cast<mepoo::SegmentManager<>*>(ptr);
Expand All @@ -84,8 +86,8 @@ void SharedMemoryUser::openDataSegments(const uint64_t segmentId,

auto registeredSuccessfully =
memory::UntypedRelativePointer::registerPtrWithId(memory::segment_id_t{segment.m_segmentId},
sharedMemoryObject.getBaseAddress(),
sharedMemoryObject.getSizeInBytes());
sharedMemoryObject.getBaseAddress(),
sharedMemoryObject.getSizeInBytes());

if (!registeredSuccessfully)
{
Expand Down

0 comments on commit cd59d9b

Please sign in to comment.