Refactor IpcChannel
Brief feature description
The current IpcChannel abstraction is just a type alias with the big downside that all ipc channels (message queue, unix domain sockets, named pipes and the upcoming qnx message passing) have to support all the features of the message queue.
We require an IpcChannel abstraction which reduces the interface to a very small subset of common functionality (send, receive).
Detailed information
- [ ] Create IpcChannel abstraction with the following interface.
template<typename IpcType> // could be MessageQueue, UnixDomainSocket, NamedPipe etc.
class IpcChannel {
public:
IpcChannel(const IpcType::connectionInformation_t & );
bool send(const IpcMessage_t& msg);
bool timedSend(const IpcMessage_t & msg, const units::Duration & timeout);
cxx::optional<IpcMessage_t> receive();
cxx::optional<IpcMessage_t> timedReceive(const units::Duration & timeout);
};
The IpcChannel object should be always in a valid and usable state, if the ctor can fail use the creation pattern.
- [ ] replace current IpcChannel alias with new IpcChannel abstraction
- [ ] refactor UnixDomainSockets so that it is a true unix domain socket abstraction.
- [ ] remove
isOutdatedfrom all IPC constructs - [ ] adjust UnixDomainSockets tests
- [ ] refactor NamedPipe so that the MessageQueue compatibility code is removed and the full feature set is supported
- [ ] implement unit tests for NamedPipes
- [ ] remove std::string from everything
- [ ] For better readability, create argument structs for the following functions (search for ticket number in codebase, consider https://github.com/eclipse-iceoryx/iceoryx/pull/1527#discussion_r924372545):
- MessageQueue class Ctor
- NamedPipe class Ctor
- Semaphore class Ctor
- UnixDomainSocket class Ctor
- SharedMemory class Ctor
The interface is not sufficient since we potentially need to do some checks when RouDi or an application starts like if an IpcChannel is already available or deleted from the file system.
Removing std::string could be done once we switch to a binary serialization. I already have a PoC for this, just need some time to finish it.