removed typedef for shared struct

This commit is contained in:
Erik Frojdh
2019-03-12 14:42:27 +01:00
parent d4e4fb8ffe
commit 7e793539ca
2 changed files with 682 additions and 701 deletions

View File

@ -7,10 +7,10 @@
* @short This is the base class for multi detector system functionalities
* @author Anna Bergamaschi
*/
#include "SharedMemory.h"
#include "error_defs.h"
#include "logger.h"
#include "sls_detector_defs.h"
#include "SharedMemory.h"
class slsDetector;
// class SharedMemory;
class ZmqSocket;
@ -27,12 +27,11 @@ class detectorData;
#define SHORT_STRING_LENGTH 50
#define DATE_LENGTH 30
/**
* @short structure allocated in shared memory to store detector settings
* for IPC and cache
*/
typedef struct sharedMultiSlsDetector {
struct sharedMultiSlsDetector {
/* FIXED PATTERN FOR STATIC FUNCTIONS. DO NOT CHANGE, ONLY APPEND
* ------*/
@ -107,15 +106,13 @@ class detectorData;
/** data streaming (up stream) enable in receiver */
bool receiver_upstream;
} sharedMultiSlsDetector;
};
class multiSlsDetector : public virtual slsDetectorDefs,
public virtual errorDefs {
// private:
public:
/**
* Constructor
@ -444,8 +441,6 @@ class multiSlsDetector : public virtual slsDetectorDefs,
*/
int setReceiverPort(int port_number = -1, int detPos = -1);
/**
* Lock server for this client IP
* @param p 0 to unlock, 1 to lock
@ -951,7 +946,6 @@ class multiSlsDetector : public virtual slsDetectorDefs,
*/
int setReceiverUDPPort(int udpport, int detPos = -1);
/**
* Returns the receiver UDP port
* @param detPos -1 for all detectors in list or specific detector position
@ -1968,7 +1962,6 @@ class multiSlsDetector : public virtual slsDetectorDefs,
/** Shared Memory object */
SharedMemory<sharedMultiSlsDetector> sharedMemory{0, -1};
/** pointers to the slsDetector structures */
std::vector<std::unique_ptr<slsDetector>> detectors;

View File

@ -9,11 +9,11 @@
* @author Anna Bergamaschi
*/
#include "sls_detector_defs.h"
#include "error_defs.h"
#include "logger.h"
#include "ClientSocket.h"
#include "SharedMemory.h"
#include "error_defs.h"
#include "logger.h"
#include "sls_detector_defs.h"
class ClientInterface;
#include <cmath>
@ -41,11 +41,10 @@ typedef struct detParameterList {
int nGappixelsY;
} detParameterList;
/**
* @short structure allocated in shared memory to store detector settings for IPC and cache
*/
typedef struct sharedSlsDetector {
struct sharedSlsDetector {
/* FIXED PATTERN FOR STATIC FUNCTIONS. DO NOT CHANGE, ONLY APPEND ------*/
@ -69,9 +68,6 @@ typedef struct detParameterList {
/** END OF FIXED PATTERN -----------------------------------------------*/
/** Detector offset in the X & Y direction in the multi detector structure */
int offset[2];
@ -257,12 +253,10 @@ typedef struct detParameterList {
/** overwriteenable */
bool receiver_overWriteEnable;
} sharedSlsDetector;
};
class slsDetector : public virtual slsDetectorDefs, public virtual errorDefs {
public:
/**
* Constructor called when creating new shared memory
* @param type detector type
@ -456,7 +450,6 @@ public:
*/
int setOnline(int value = GET_ONLINE_FLAG);
/**
* Returns the online flag
*/
@ -596,7 +589,6 @@ public:
*/
int getThresholdEnergy();
/**
* Set threshold energy (Mythen and Eiger)
* For Eiger, calls setThresholdEneryAndSettings
@ -1253,7 +1245,6 @@ public:
*/
int setAutoComparatorDisableMode(int ival = -1);
/**
* Returns the trimbits from the detector's shared memmory (Eiger)
* @param retval is the array with the trimbits
@ -1272,7 +1263,6 @@ public:
*/
int setModule(sls_detector_module module, int tb = 1);
/**
* Get module structure from detector (all detectors)
* @returns pointer to module structure (which has been created and must then be deleted)
@ -1643,7 +1633,6 @@ public:
int setDigitalIODelay(uint64_t pinMask, int delay);
private:
/**
* Get Detector Type from Shared Memory (opening shm without verifying size)
* @param multiId multi detector Id
@ -1783,7 +1772,6 @@ private:
*/
int writeSettingsFile(const std::string &fname, sls_detector_module mod);
/** slsDetector Id or position in the detectors list */
int detId;