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:
2024-10-21 16:25:07 +02:00
committed by GitHub
parent 76ab0228ac
commit 6add9aad5d
12 changed files with 71 additions and 120 deletions

View File

@@ -5,6 +5,7 @@
#include "CtbConfig.h"
#include "SharedMemory.h"
#include "sls/Result.h"
#include "sls/ZmqSocket.h"
#include "sls/logger.h"
#include "sls/sls_detector_defs.h"
@@ -19,7 +20,6 @@
namespace sls {
class ZmqSocket;
class detectorData;
class Module;
@@ -79,11 +79,6 @@ class DetectorImpl : public virtual slsDetectorDefs {
explicit DetectorImpl(int detector_index = 0, bool verify = true,
bool update = true);
/**
* Destructor
*/
virtual ~DetectorImpl();
template <class CT> struct NonDeduced { using type = CT; };
template <typename RT, typename... CT>
Result<RT> Parallel(RT (Module::*somefunc)(CT...),
@@ -198,14 +193,6 @@ class DetectorImpl : public virtual slsDetectorDefs {
/** return detector index in shared memory */
int getDetectorIndex() const;
/** Free specific shared memory from the command line without creating
* object */
static void freeSharedMemory(int detectorIndex, int detPos = -1);
/** Free all modules from current multi Id shared memory and delete members
*/
void freeSharedMemory();
/** Get user details of shared memory */
std::string getUserDetails();
@@ -215,12 +202,7 @@ class DetectorImpl : public virtual slsDetectorDefs {
* default enabled */
void setInitialChecks(const bool value);
/**
* Connect to Virtual Detector Servers at local host
* @param numdet number of modules
* @param port starting port number
*/
void setVirtualDetectorServers(const int numdet, const uint16_t port);
bool hasModulesInSharedMemory();
/** Sets the hostname of all sls modules in shared memory and updates
* local cache */