Add slsReceiverUsers(int tcpip_port_no) overload

Use std::unique_ptr<> instead of raw pointers
This commit is contained in:
Samuel Debionne
2019-02-12 16:23:55 +01:00
parent 031a11c4f7
commit b18391330e
4 changed files with 33 additions and 24 deletions

View File

@ -78,14 +78,17 @@ slsReceiver::slsReceiver(int argc, char *argv[]):
}
// might throw an exception
tcpipInterface = new slsReceiverTCPIPInterface(tcpip_port_no);
//tcpipInterface = std::make_unique<slsReceiverTCPIPInterface>(tcpip_port_no);
tcpipInterface = std::unique_ptr<slsReceiverTCPIPInterface>(new slsReceiverTCPIPInterface(tcpip_port_no));
}
slsReceiver::~slsReceiver() {
if(tcpipInterface)
delete tcpipInterface;
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));
}