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

@ -15,6 +15,8 @@
#include <iostream>
#include <unistd.h>
namespace sls {
Fifo::Fifo(int ind, uint32_t fifoItemSize, uint32_t depth)
: index(ind), memory(nullptr), fifoBound(nullptr), fifoFree(nullptr),
fifoStream(nullptr), fifoDepth(depth), status_fifoBound(0),
@ -35,14 +37,14 @@ void Fifo::CreateFifos(uint32_t fifoItemSize) {
DestroyFifos();
// create fifos
fifoBound = new sls::CircularFifo<char>(fifoDepth);
fifoFree = new sls::CircularFifo<char>(fifoDepth);
fifoStream = new sls::CircularFifo<char>(fifoDepth);
fifoBound = new CircularFifo<char>(fifoDepth);
fifoFree = new CircularFifo<char>(fifoDepth);
fifoStream = new CircularFifo<char>(fifoDepth);
// allocate memory
size_t mem_len = (size_t)fifoItemSize * (size_t)fifoDepth * sizeof(char);
memory = (char *)malloc(mem_len);
if (memory == nullptr) {
throw sls::RuntimeError("Could not allocate memory for fifos");
throw RuntimeError("Could not allocate memory for fifos");
}
memset(memory, 0, mem_len);
int pagesize = getpagesize();
@ -116,3 +118,5 @@ int Fifo::GetMinLevelForFifoFree() {
status_fifoFree = fifoDepth;
return temp;
}
} // namespace sls