mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 07:20:01 +02:00
Use sls::make_unique<>
This commit is contained in:
parent
b18391330e
commit
f125b94a7d
@ -11,6 +11,7 @@
|
||||
#include <map>
|
||||
#include <getopt.h>
|
||||
|
||||
#include "container_utils.h" // For sls::make_unique<>
|
||||
|
||||
#include "slsReceiver.h"
|
||||
#include "slsReceiverTCPIPInterface.h"
|
||||
@ -78,17 +79,14 @@ slsReceiver::slsReceiver(int argc, char *argv[]):
|
||||
}
|
||||
|
||||
// might throw an exception
|
||||
//tcpipInterface = std::make_unique<slsReceiverTCPIPInterface>(tcpip_port_no);
|
||||
tcpipInterface = std::unique_ptr<slsReceiverTCPIPInterface>(new slsReceiverTCPIPInterface(tcpip_port_no));
|
||||
|
||||
tcpipInterface = sls::make_unique<slsReceiverTCPIPInterface>(tcpip_port_no);
|
||||
}
|
||||
|
||||
|
||||
slsReceiver::slsReceiver(int tcpip_port_no)
|
||||
{
|
||||
// might throw an exception
|
||||
//tcpipInterface = std::make_unique<slsReceiverTCPIPInterface>(tcpip_port_no);
|
||||
tcpipInterface = std::unique_ptr<slsReceiverTCPIPInterface>(new slsReceiverTCPIPInterface(tcpip_port_no));
|
||||
tcpipInterface = sls::make_unique<slsReceiverTCPIPInterface>(tcpip_port_no);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,10 +1,11 @@
|
||||
#include "container_utils.h" // For sls::make_unique<>
|
||||
|
||||
#include "slsReceiverUsers.h"
|
||||
|
||||
slsReceiverUsers::slsReceiverUsers(int argc, char *argv[], int &success) {
|
||||
// catch the exception here to limit it to within the library (for current version)
|
||||
try {
|
||||
//receiver = std::make_unique<slsReceiver>(argc, argv);
|
||||
receiver = std::unique_ptr<slsReceiver>(new slsReceiver(argc, argv));
|
||||
receiver = sls::make_unique<slsReceiver>(argc, argv);
|
||||
success = slsDetectorDefs::OK;
|
||||
} catch (...) {
|
||||
success = slsDetectorDefs::FAIL;
|
||||
@ -12,8 +13,7 @@ slsReceiverUsers::slsReceiverUsers(int argc, char *argv[], int &success) {
|
||||
}
|
||||
|
||||
slsReceiverUsers::slsReceiverUsers(int tcpip_port_no) {
|
||||
//receiver = std::make_unique<slsReceiver>(tcpip_port_no);
|
||||
receiver = std::unique_ptr<slsReceiver>(new slsReceiver(tcpip_port_no));
|
||||
receiver = sls::make_unique<slsReceiver>(tcpip_port_no);
|
||||
}
|
||||
|
||||
int slsReceiverUsers::start() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user