rxr sls namespace (#457)

* rxr src files and classes (detectordata, ZmqSocket) added to sls namespace

* moving defines inside namespace

* moving defines inside namespace, added helpdacs to namespace

* added namespace to gui

* gui also updated

* removed unnecessary sls:: when already in sls namespace for slsDetectoSoftware, receverSoftware, slsDetectorGui and slsSupportlib
This commit is contained in:
Dhanya Thattil
2022-05-18 11:48:38 +02:00
committed by GitHub
parent fcc7f7aef8
commit 4259363169
88 changed files with 1200 additions and 923 deletions

View File

@ -6,6 +6,8 @@
#include <chrono>
#include <unistd.h>
namespace sls {
// gettid added in glibc 2.30
#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 30
#include <sys/syscall.h>
@ -16,7 +18,7 @@ void Arping::SetInterfacesAndIps(const int index, const std::string &interface,
const std::string &ip) {
if (interface.empty() || ip.empty()) {
throw sls::RuntimeError("Could not arping. Interface name and ip not "
throw RuntimeError("Could not arping. Interface name and ip not "
"set up for interface " +
std::to_string(index));
}
@ -38,7 +40,7 @@ void Arping::StartThread() {
try {
t = std::thread(&Arping::ThreadExecution, this);
} catch (...) {
throw sls::RuntimeError("Could not start arping thread");
throw RuntimeError("Could not start arping thread");
}
runningFlag = true;
}
@ -74,13 +76,13 @@ void Arping::ThreadExecution() {
void Arping::TestCommands() {
// atleast one interface must be set up
if (commands[0].empty()) {
throw sls::RuntimeError(
throw RuntimeError(
"Could not arping. Interface not set up in apring thread");
}
// test if arping commands throw an error
std::string error = ExecuteCommands();
if (!error.empty()) {
throw sls::RuntimeError(error);
throw RuntimeError(error);
}
}
@ -117,4 +119,6 @@ std::string Arping::ExecuteCommands() {
}
return std::string();
}
}
} // namespace sls