Skip to content

Commit

Permalink
iox-eclipse-iceoryx#1693 Revert "iox-eclipse-iceoryx#1963 support for…
Browse files Browse the repository at this point in the history
… iox::string in MessageQueue"

This reverts commit 890848f.
  • Loading branch information
elBoberido committed Feb 5, 2024
1 parent 019a34f commit 68dbaa7
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 298 deletions.
1 change: 0 additions & 1 deletion doc/website/release-notes/iceoryx-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
- Fast POD data in `iox::vector` [#2082](https://github.com/eclipse-iceoryx/iceoryx/issues/2082)
- MinGW support for Windows [#2150](https://github.com/eclipse-iceoryx/iceoryx/issues/2150)
- Add support for `iox::string` in `UnixDomainSocket` and created `unix_domain_socket.inl` [#2040](https://github.com/eclipse-iceoryx/iceoryx/issues/2040)
- Add support for `iox::string` in `MessageQueue` and created `message_queue.inl` [#1963](https://github.com/eclipse-iceoryx/iceoryx/issues/1963)
- Add support for `iox::string` in `NamedPipe` and created `named_pipe.inl` [#1693](https://github.com/eclipse-iceoryx/iceoryx/issues/1693)


Expand Down
213 changes: 0 additions & 213 deletions iceoryx_hoofs/posix/ipc/include/iox/detail/message_queue.inl

This file was deleted.

56 changes: 0 additions & 56 deletions iceoryx_hoofs/posix/ipc/include/iox/message_queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "iox/builder.hpp"
#include "iox/duration.hpp"
#include "iox/expected.hpp"
#include "iox/not_null.hpp"
#include "iox/optional.hpp"
#include "iox/posix_ipc_channel.hpp"

Expand Down Expand Up @@ -59,7 +58,6 @@ class MessageQueue
static constexpr uint64_t MAX_NUMBER_OF_MESSAGES = 10;

using Builder_t = MessageQueueBuilder;
using Message_t = iox::string<MAX_MESSAGE_SIZE>;

MessageQueue() noexcept = delete;
MessageQueue(const MessageQueue& other) = delete;
Expand Down Expand Up @@ -90,38 +88,6 @@ class MessageQueue
expected<void, PosixIpcChannelError> timedSend(const std::string& msg,
const units::Duration& timeout) const noexcept;

/// @brief send a message using iox::string
/// @tparam N capacity of the iox::string
/// @param[in] buf data to send
/// @return PosixIpcChannelError if error occured
template <uint64_t N>
expected<void, PosixIpcChannelError> send(const iox::string<N>& buf) const noexcept;

/// @brief try to send a message for a given timeout duration using iox::string
/// @tparam N capacity of the iox::string
/// @param[in] buf data to send
/// @param[in] timeout for the send operation
/// @return PosixIpcChannelError if error occured
template <uint64_t N>
expected<void, PosixIpcChannelError> timedSend(const iox::string<N>& buf,
const units::Duration& timeout) const noexcept;

/// @brief receive message using iox::string
/// @tparam N capacity of the iox::string
/// @param[in] buf data to receive
/// @return PosixIpcChannelError if error occured
template <uint64_t N>
expected<void, PosixIpcChannelError> receive(iox::string<N>& buf) const noexcept;

/// @brief try to receive message for a given timeout duration using iox::string
/// @tparam N capacity of the iox::string
/// @param[in] buf data to receive
/// @param[in] timeout for the send operation
/// @return PosixIpcChannelError if error occured
template <uint64_t N>
expected<void, PosixIpcChannelError> timedReceive(iox::string<N>& buf,
const units::Duration& timeout) const noexcept;

static expected<bool, PosixIpcChannelError> isOutdated() noexcept;

private:
Expand All @@ -143,26 +109,6 @@ class MessageQueue
sanitizeIpcChannelName(const PosixIpcChannelName_t& name) noexcept;
expected<void, PosixIpcChannelError> destroy() noexcept;

enum class Termination
{
NONE,
NULL_TERMINATOR
};

template <typename Type, Termination Terminator>
expected<void, PosixIpcChannelError>
timedSendImpl(not_null<const Type*> msg, uint64_t msgSize, const units::Duration& timeout) const noexcept;
template <typename Type, Termination Terminator>
expected<uint64_t, PosixIpcChannelError>
timedReceiveImpl(not_null<Type*> msg, uint64_t maxMsgSize, const units::Duration& timeout) const noexcept;
template <typename Type, Termination Terminator>
expected<void, PosixIpcChannelError> sendImpl(not_null<const Type*> msg, uint64_t msgSize) const noexcept;
template <typename Type, Termination Terminator>
expected<uint64_t, PosixIpcChannelError> receiveImpl(not_null<Type*> msg, uint64_t maxMsgSize) const noexcept;
template <typename Type, Termination Terminator>
expected<uint64_t, PosixIpcChannelError> receiveVerification(not_null<Type*> msg,
uint64_t msgLenght) const noexcept;

private:
PosixIpcChannelName_t m_name;
mq_attr m_attributes{};
Expand Down Expand Up @@ -203,6 +149,4 @@ class MessageQueueBuilder

} // namespace iox

#include "detail/message_queue.inl"

#endif // IOX_HOOFS_POSIX_IPC_MESSAGE_QUEUE_HPP
Loading

0 comments on commit 68dbaa7

Please sign in to comment.