mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 18:17:59 +02:00
in Listener, remove raw pointers allocations, use unique_ptr instead.
Add an overload of sls::make_unique for array types.
This commit is contained in:
@ -9,6 +9,8 @@
|
||||
*@short creates & manages a listener thread each
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "ThreadObject.h"
|
||||
|
||||
class GeneralData;
|
||||
@ -169,7 +171,7 @@ class Listener : private virtual slsDetectorDefs, public ThreadObject {
|
||||
* Pop free addresses, listen to udp socket,
|
||||
* write to memory & push the address into fifo
|
||||
*/
|
||||
void ThreadExecution();
|
||||
void ThreadExecution() override;
|
||||
|
||||
/**
|
||||
* Pushes non empty buffers into fifo/ frees empty buffer,
|
||||
@ -207,7 +209,6 @@ class Listener : private virtual slsDetectorDefs, public ThreadObject {
|
||||
/** Fifo structure */
|
||||
Fifo* fifo;
|
||||
|
||||
|
||||
// individual members
|
||||
/** Detector Type */
|
||||
detectorType myDetectorType;
|
||||
@ -216,7 +217,7 @@ class Listener : private virtual slsDetectorDefs, public ThreadObject {
|
||||
runStatus* status;
|
||||
|
||||
/** UDP Socket - Detector to Receiver */
|
||||
genericSocket* udpSocket;
|
||||
std::unique_ptr<genericSocket> udpSocket;
|
||||
|
||||
/** UDP Port Number */
|
||||
uint32_t* udpPortNumber;
|
||||
@ -293,10 +294,10 @@ class Listener : private virtual slsDetectorDefs, public ThreadObject {
|
||||
bool carryOverFlag;
|
||||
|
||||
/** Carry over packet buffer */
|
||||
char* carryOverPacket;
|
||||
std::unique_ptr<char []> carryOverPacket;
|
||||
|
||||
/** Listening buffer for one packet - might be removed when we can peek and eiger fnum is in header */
|
||||
char* listeningPacket;
|
||||
std::unique_ptr<char []> listeningPacket;
|
||||
|
||||
/** if the udp socket is connected */
|
||||
bool udpSocketAlive;
|
||||
|
Reference in New Issue
Block a user