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

@ -193,7 +193,7 @@ bool operator!=(const std::vector<T> &lhs,
template <typename T, size_t Capacity>
std::ostream &operator<<(std::ostream &os,
const sls::StaticVector<T, Capacity> &c) {
const StaticVector<T, Capacity> &c) {
return os << ToString(c);
}

View File

@ -273,7 +273,7 @@ T StringTo(const std::string &t, const std::string &unit) {
try {
tval = std::stod(t);
} catch (const std::invalid_argument &e) {
throw sls::RuntimeError("Could not convert string to time");
throw RuntimeError("Could not convert string to time");
}
using std::chrono::duration;
@ -287,7 +287,7 @@ T StringTo(const std::string &t, const std::string &unit) {
} else if (unit == "s" || unit.empty()) {
return duration_cast<T>(std::chrono::duration<double>(tval));
} else {
throw sls::RuntimeError(
throw RuntimeError(
"Invalid unit in conversion from string to std::chrono::duration");
}
}

View File

@ -10,17 +10,20 @@
*/
#include "sls/sls_detector_exceptions.h"
#include "sls/container_utils.h"
#include <map>
#include <memory>
#include <rapidjson/document.h> //json header in zmq stream
#include <zmq.h>
namespace sls {
#define MAX_STR_LENGTH 1000
// #define ZMQ_DETAIL
#define ROIVERBOSITY
class zmq_msg_t;
#include "sls/container_utils.h"
#include <map>
#include <memory>
/** zmq header structure */
struct zmqHeader {
/** true if incoming data, false if end of acquisition */
@ -222,5 +225,7 @@ class ZmqSocket {
mySocketDescriptors sockfd;
std::unique_ptr<char[]> header_buffer =
sls::make_unique<char[]>(MAX_STR_LENGTH);
make_unique<char[]>(MAX_STR_LENGTH);
};
} // namespace sls

View File

@ -8,6 +8,8 @@
#include <sstream>
#include <sys/time.h>
namespace sls {
enum TLogLevel {
logERROR,
logWARNING,
@ -25,7 +27,7 @@ enum TLogLevel {
// Compiler should optimize away anything below this value
#ifndef LOG_MAX_REPORTING_LEVEL
#define LOG_MAX_REPORTING_LEVEL logINFO
#define LOG_MAX_REPORTING_LEVEL sls::logINFO
#endif
#define __AT__ \
@ -37,7 +39,6 @@ enum TLogLevel {
std::string(__SHORT_FORM_OF_FILE__) + std::string("::") + \
std::string(__func__) + std::string("(): ")
namespace sls {
class Logger {
std::ostringstream os;
TLogLevel level = LOG_MAX_REPORTING_LEVEL;