iceoryx
iceoryx copied to clipboard
Remove creation design pattern class with in place implementation
Brief feature description
Inheriting from the creation design pattern class has certain drawbacks which can be very error prone.
- In move and copy operations one has to delegate the call to the base class first
-
m_isInitialized
,m_errorValue
are sometimes overlooked or not set correctly - the creation class has to be a friend class of the resource which is using it
A better implementation alternative would be to create a static method in such classes called create
and create the system resource directly in there and provide the handle to that successfully created resource to the constructor of the class. The constructor does not create the system resource it just acquires a existing one and handles its lifetime.
Another approach is to introduce a builder pattern when the class constructors requires more then zero arguments to improve the readability.
Classes where Creation pattern must be replaced with static create method
- [x] SharedMemoryObject
- [x] MemoryMap
- [x] SharedMemory
- [ ] UnixDomainSocket (high prio)
- [ ] MessageQueue (medium prio)
- [ ] NamedPipe (medium prio)
- [x] FileLock
- [x] Semaphore (will be solved in #751)
- [x] Mutex (high prio)
- [x] Implement builder pattern
- [ ] Integrate new API into iceoryx and remove old constructor, all
@todo iox-#1036
should be gone
- [ ] move
creation.hpp
toiceoryx_dust
(high prio)