eclipse-iceoryx / eclipse-iceoryx/iceoryx

Refactor IpcChannel

Open
#832 1 comment 0 reactions 0 assignees View on GitHub
refactoring technical debt
Dominant language
C++
Stars
2.2k
Forks
492
Avg merge
18h 57m
Merged PRs (30d)
1

Description

## 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.
```cpp
template // 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 receive();
cxx::optional 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 `isOutdated` from 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.