mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-21 09:08:00 +02:00
Dev/proper free (#1005)
* first draft of fixing the free function available within the class * removed class member function freeSharedmemory for both Detector and Module; made the free function freeSharedmemory accessible to python interface; setHostname if there is already a module in shm will recreate the Detector object while freeing shm completely and keeping detsize and intitialchecks (previous commit), sethostname called from DetectorClass in virtual command to have one point of entry (previous commit), testing Module class frees shared memory using free function * Detector class: added copy and move constructor and assignmentoperators due to explicit destructor (DetectorImpl fwd declared), DetectorImpl class: included ZmqSocket to remove destructor (should not be virtual in any case), Module class: removed explciit destructor to allow compiler generated constructor and operators * formatting * minor fix for readme autocomplete * updated client version date
This commit is contained in:
@ -20,7 +20,7 @@ class IpAddr;
|
||||
// Free function to avoid dependence on class
|
||||
// and avoid the option to free another objects
|
||||
// shm by mistake
|
||||
void freeSharedMemory(int detectorIndex, int moduleIndex = -1);
|
||||
void freeSharedMemory(const int detectorIndex = 0, const int moduleIndex = -1);
|
||||
|
||||
/**
|
||||
* \class Detector
|
||||
@ -46,9 +46,13 @@ class Detector {
|
||||
Detector(int shm_id = 0);
|
||||
~Detector();
|
||||
|
||||
/** Free the shared memory of this detector and all modules
|
||||
belonging to it */
|
||||
void freeSharedMemory();
|
||||
// Disable copy since SharedMemory object is unique in DetectorImpl
|
||||
Detector(const Detector &other) = delete;
|
||||
Detector &operator=(const Detector &other) = delete;
|
||||
|
||||
// Move constructor and assignment operator
|
||||
Detector(Detector &&other) noexcept;
|
||||
Detector &operator=(Detector &&other) noexcept;
|
||||
|
||||
/** Frees shared memory before loading configuration file. Set up once
|
||||
normally */
|
||||
|
Reference in New Issue
Block a user