merged detFuncs for c and c++

This commit is contained in:
Erik Frojdh
2020-05-15 12:24:06 +02:00
parent ea7cc9db8c
commit 2c83abcac7
7 changed files with 23 additions and 405 deletions

View File

@ -4,6 +4,7 @@
#include "ToString.h"
#include "file_utils.h"
#include "network_utils.h"
#include "sls_detector_funcs.h"
#include "sls_detector_exceptions.h"
#include "string_utils.h"
#include "versionAPI.h"
@ -139,7 +140,7 @@ void Module::sendToDetector(int fnum, std::nullptr_t, Ret &retval) {
void Module::sendToDetector(int fnum) {
LOG(logDEBUG1) << "Sending: ["
<< getFunctionNameFromEnum(
static_cast<slsDetectorDefs::detFuncs>(fnum))
static_cast<detFuncs>(fnum))
<< "]";
sendToDetector(fnum, nullptr, 0, nullptr, 0);
}
@ -147,7 +148,7 @@ void Module::sendToDetector(int fnum) {
template <typename Ret> Ret Module::sendToDetector(int fnum) {
LOG(logDEBUG1) << "Sending: ["
<< getFunctionNameFromEnum(
static_cast<slsDetectorDefs::detFuncs>(fnum))
static_cast<detFuncs>(fnum))
<< ", nullptr, 0, " << typeid(Ret).name() << ", "
<< sizeof(Ret) << "]";
Ret retval{};
@ -160,7 +161,7 @@ template <typename Ret, typename Arg>
Ret Module::sendToDetector(int fnum, const Arg &args) {
LOG(logDEBUG1) << "Sending: ["
<< getFunctionNameFromEnum(
static_cast<slsDetectorDefs::detFuncs>(fnum))
static_cast<detFuncs>(fnum))
<< ", " << args << ", " << sizeof(args) << ", "
<< typeid(Ret).name() << ", " << sizeof(Ret) << "]";
Ret retval{};
@ -216,7 +217,7 @@ void Module::sendToDetectorStop(int fnum, std::nullptr_t, Ret &retval) const {
void Module::sendToDetectorStop(int fnum) {
LOG(logDEBUG1) << "Sending to detector stop: ["
<< getFunctionNameFromEnum(
static_cast<slsDetectorDefs::detFuncs>(fnum))
static_cast<detFuncs>(fnum))
<< "]";
sendToDetectorStop(fnum, nullptr, 0, nullptr, 0);
}
@ -237,7 +238,7 @@ void Module::sendToReceiver(int fnum, const void *args, size_t args_size,
std::ostringstream oss;
oss << "Set rx_hostname first to use receiver parameters, ";
oss << getFunctionNameFromEnum(
static_cast<slsDetectorDefs::detFuncs>(fnum));
static_cast<detFuncs>(fnum));
throw RuntimeError(oss.str());
}
auto receiver = ReceiverSocket(shm()->rxHostname, shm()->rxTCPPort);
@ -278,7 +279,7 @@ void Module::sendToReceiver(int fnum, std::nullptr_t, Ret &retval) const {
template <typename Ret> Ret Module::sendToReceiver(int fnum) {
LOG(logDEBUG1) << "Sending: ["
<< getFunctionNameFromEnum(
static_cast<slsDetectorDefs::detFuncs>(fnum))
static_cast<detFuncs>(fnum))
<< ", nullptr, 0, " << typeid(Ret).name() << ", "
<< sizeof(Ret) << "]";
Ret retval{};
@ -290,7 +291,7 @@ template <typename Ret> Ret Module::sendToReceiver(int fnum) {
template <typename Ret> Ret Module::sendToReceiver(int fnum) const {
LOG(logDEBUG1) << "Sending: ["
<< getFunctionNameFromEnum(
static_cast<slsDetectorDefs::detFuncs>(fnum))
static_cast<detFuncs>(fnum))
<< ", nullptr, 0, " << typeid(Ret).name() << ", "
<< sizeof(Ret) << "]";
Ret retval{};
@ -303,7 +304,7 @@ template <typename Ret, typename Arg>
Ret Module::sendToReceiver(int fnum, const Arg &args) {
LOG(logDEBUG1) << "Sending: ["
<< getFunctionNameFromEnum(
static_cast<slsDetectorDefs::detFuncs>(fnum))
static_cast<detFuncs>(fnum))
<< ", " << args << ", " << sizeof(args) << ", "
<< typeid(Ret).name() << ", " << sizeof(Ret) << "]";
Ret retval{};
@ -316,7 +317,7 @@ template <typename Ret, typename Arg>
Ret Module::sendToReceiver(int fnum, const Arg &args) const {
LOG(logDEBUG1) << "Sending: ["
<< getFunctionNameFromEnum(
static_cast<slsDetectorDefs::detFuncs>(fnum))
static_cast<detFuncs>(fnum))
<< ", " << args << ", " << sizeof(args) << ", "
<< typeid(Ret).name() << ", " << sizeof(Ret) << "]";
Ret retval{};