moved to vector of unique pointer in slsReceiverImplementation

This commit is contained in:
Erik Frojdh
2018-10-16 17:30:43 +02:00
parent b50d359ee6
commit 014dfaa251
10 changed files with 133 additions and 113 deletions

View File

@ -42,7 +42,7 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
* @param dataModifyReadycb pointer to data ready call back function with modified
* @param pDataReadycb pointer to arguments of data ready call back function. To write/stream a smaller size of processed data, change this value (only smaller value is allowed).
*/
DataProcessor(int ind, detectorType dtype, Fifo*& f, fileFormat* ftype,
DataProcessor(int ind, detectorType dtype, Fifo* f, fileFormat* ftype,
bool fwenable, bool* dsEnable, bool* gpEnable, uint32_t* dr,
uint32_t* freq, uint32_t* timer,
bool* fp, bool* act, bool* depaden, bool* sm,
@ -121,7 +121,7 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
* Set Fifo pointer to the one given
* @param f address of Fifo pointer
*/
void SetFifo(Fifo*& f);
void SetFifo(Fifo* f);
/**
* Reset parameters for new acquisition (including all scans)

View File

@ -31,7 +31,7 @@ class DataStreamer : private virtual slsDetectorDefs, public ThreadObject {
* @param ajh additional json header
* @param sm pointer to silent mode
*/
DataStreamer(int ind, Fifo*& f, uint32_t* dr, std::vector<ROI>* r,
DataStreamer(int ind, Fifo* f, uint32_t* dr, std::vector<ROI>* r,
uint64_t* fi, int* fd, char* ajh, bool* sm);
/**
@ -63,7 +63,7 @@ class DataStreamer : private virtual slsDetectorDefs, public ThreadObject {
* Set Fifo pointer to the one given
* @param f address of Fifo pointer
*/
void SetFifo(Fifo*& f);
void SetFifo(Fifo* f);
/**
* Reset parameters for new acquisition (including all scans)

View File

@ -37,7 +37,7 @@ class Listener : private virtual slsDetectorDefs, public ThreadObject {
* @param depaden pointer to deactivated padding enable
* @param sm pointer to silent mode
*/
Listener(int ind, detectorType dtype, Fifo*& f, runStatus* s,
Listener(int ind, detectorType dtype, Fifo* f, runStatus* s,
uint32_t* portno, char* e, uint64_t* nf, uint32_t* dr,
uint32_t* us, uint32_t* as, uint32_t* fpf,
frameDiscardPolicy* fdp, bool* act, bool* depaden, bool* sm);
@ -96,7 +96,7 @@ class Listener : private virtual slsDetectorDefs, public ThreadObject {
* Set Fifo pointer to the one given
* @param f address of Fifo pointer
*/
void SetFifo(Fifo*& f);
void SetFifo(Fifo* f);
/**
* Reset parameters for new acquisition (including all scans)

View File

@ -9,7 +9,7 @@
#include "sls_detector_defs.h"
#include "receiver_defs.h"
#include "logger.h"
#include "container_utils.h"
class GeneralData;
class Listener;
class DataProcessor;
@ -18,6 +18,7 @@ class Fifo;
#include <exception>
#include <vector>
#include <memory>
class slsReceiverImplementation: private virtual slsDetectorDefs {
public:
@ -832,13 +833,13 @@ private:
/** General Data Properties */
GeneralData* generalData;
/** Listener Objects that listen to UDP and push into fifo */
std::vector <Listener*> listener;
std::vector<std::unique_ptr<Listener>> listener;
/** DataProcessor Objects that pull from fifo and process data */
std::vector <DataProcessor*> dataProcessor;
std::vector<std::unique_ptr<DataProcessor>> dataProcessor;
/** DataStreamer Objects that stream data via ZMQ */
std::vector <DataStreamer*> dataStreamer;
std::vector<std::unique_ptr<DataStreamer>> dataStreamer;
/** Fifo Structure to store addresses of memory writes */
std::vector <Fifo*> fifo;
std::vector<std::unique_ptr<Fifo>> fifo;
//***callback parameters***
/**