fix: Use namespaced typenames/headers

This commit is contained in:
Dennis Klein
2022-03-22 13:59:37 +01:00
parent 18f50871ef
commit 8d575a23a5
32 changed files with 114 additions and 116 deletions

View File

@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2018 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2018-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -17,7 +17,7 @@
namespace fair::mq::test
{
class ErrorState : public FairMQDevice
class ErrorState : public Device
{
public:
void Init() override

View File

@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2018 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2018-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -18,7 +18,7 @@
namespace fair::mq::test
{
class Exceptions : public FairMQDevice
class Exceptions : public Device
{
public:
auto Init() -> void override

View File

@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2015-2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2015-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -17,7 +17,7 @@
namespace fair::mq::test
{
class PairLeft : public FairMQDevice
class PairLeft : public Device
{
protected:
auto InitTask() -> void override

View File

@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2015-2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2015-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -17,7 +17,7 @@
namespace fair::mq::test
{
class PairRight : public FairMQDevice
class PairRight : public Device
{
protected:
auto InitTask() -> void override

View File

@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2015-2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2015-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -15,7 +15,7 @@
namespace fair::mq::test
{
class PollOut : public FairMQDevice
class PollOut : public Device
{
protected:
auto InitTask() -> void override
@@ -25,8 +25,8 @@ class PollOut : public FairMQDevice
auto Run() -> void override
{
auto msg1 = FairMQMessagePtr{NewMessage()};
auto msg2 = FairMQMessagePtr{NewMessage()};
auto msg1 = NewMessage();
auto msg2 = NewMessage();
Send(msg1, "data1");
Send(msg2, "data2");
};

View File

@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2015-2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2015-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -17,7 +17,7 @@
namespace fair::mq::test
{
class Pub : public FairMQDevice
class Pub : public Device
{
protected:
auto InitTask() -> void override
@@ -27,15 +27,15 @@ class Pub : public FairMQDevice
auto Run() -> void override
{
auto ready1 = FairMQMessagePtr{NewMessage()};
auto ready2 = FairMQMessagePtr{NewMessage()};
auto ready1 = NewMessage();
auto ready2 = NewMessage();
auto r1 = Receive(ready1, "control");
auto r2 = Receive(ready2, "control");
if (r1 >= 0 && r2 >= 0)
{
LOG(info) << "Received both ready signals, proceeding to publish data";
auto msg = FairMQMessagePtr{NewMessage()};
auto msg = NewMessage();
auto d1 = Send(msg, "data");
if (d1 >= 0)
{
@@ -46,8 +46,8 @@ class Pub : public FairMQDevice
LOG(error) << "Failed sending data: d1 = " << d1;
}
auto ack1 = FairMQMessagePtr{NewMessage()};
auto ack2 = FairMQMessagePtr{NewMessage()};
auto ack1 = NewMessage();
auto ack2 = NewMessage();
auto a1 = Receive(ack1, "control");
auto a2 = Receive(ack2, "control");
if (a1 >= 0 && a2 >= 0)

View File

@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2015-2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2015-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -18,7 +18,7 @@ namespace fair::mq::test
using namespace std;
class Pull : public FairMQDevice
class Pull : public Device
{
protected:
auto InitTask() -> void override
@@ -28,7 +28,7 @@ class Pull : public FairMQDevice
auto Run() -> void override
{
auto msg = FairMQMessagePtr{NewMessage()};
auto msg = NewMessage();
if (Receive(msg, "data") >= 0)
{

View File

@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2015-2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2015-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -15,7 +15,7 @@
namespace fair::mq::test
{
class Push : public FairMQDevice
class Push : public Device
{
protected:
auto InitTask() -> void override
@@ -25,7 +25,7 @@ class Push : public FairMQDevice
auto Run() -> void override
{
auto msg = FairMQMessagePtr{NewMessage()};
auto msg = NewMessage();
Send(msg, "data");
};
};

View File

@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2015-2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2015-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -16,7 +16,7 @@
namespace fair::mq::test
{
class Rep : public FairMQDevice
class Rep : public Device
{
protected:
auto InitTask() -> void override
@@ -26,16 +26,16 @@ class Rep : public FairMQDevice
auto Run() -> void override
{
auto request1 = FairMQMessagePtr{NewMessage()};
auto request1 = NewMessage();
if (Receive(request1, "data") >= 0) {
LOG(info) << "Received request 1";
auto reply = FairMQMessagePtr{NewMessage()};
auto reply = NewMessage();
Send(reply, "data");
}
auto request2 = FairMQMessagePtr{NewMessage()};
auto request2 = NewMessage();
if (Receive(request2, "data") >= 0) {
LOG(info) << "Received request 2";
auto reply = FairMQMessagePtr{NewMessage()};
auto reply = NewMessage();
Send(reply, "data");
}

View File

@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2015-2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2015-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -16,7 +16,7 @@
namespace fair::mq::test
{
class Req : public FairMQDevice
class Req : public Device
{
protected:
auto InitTask() -> void override
@@ -26,10 +26,10 @@ class Req : public FairMQDevice
auto Run() -> void override
{
auto request = FairMQMessagePtr{NewMessage()};
auto request = NewMessage();
Send(request, "data");
auto reply = FairMQMessagePtr{NewMessage()};
auto reply = NewMessage();
if (Receive(reply, "data") >= 0) {
LOG(info) << "received reply";
}

View File

@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2018 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2018-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -18,7 +18,7 @@
namespace fair::mq::test
{
class Signals : public FairMQDevice
class Signals : public Device
{
public:
void Init() override

View File

@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2015-2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2015-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -17,7 +17,7 @@
namespace fair::mq::test
{
class Sub : public FairMQDevice
class Sub : public Device
{
protected:
auto InitTask() -> void override
@@ -27,17 +27,17 @@ class Sub : public FairMQDevice
auto Run() -> void override
{
auto ready = FairMQMessagePtr{NewMessage()};
auto ready = NewMessage();
auto r1 = Send(ready, "control");
if (r1 >= 0)
{
LOG(info) << "Sent first control signal";
auto msg = FairMQMessagePtr{NewMessage()};
auto msg = NewMessage();
auto d1 = Receive(msg, "data");
if (d1 >= 0)
{
LOG(info) << "Received data";
auto ack = FairMQMessagePtr{NewMessage()};
auto ack = NewMessage();
auto a1 = Send(ack, "control");
if (a1 >= 0)
{

View File

@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2015-2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2015-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -17,7 +17,7 @@
namespace fair::mq::test
{
class TestWaitFor : public FairMQDevice
class TestWaitFor : public Device
{
public:
void PreRun() override

View File

@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2015-2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2015-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -22,7 +22,7 @@
#include "devices/TestErrorState.h"
#include "devices/TestSignals.h"
#include <runFairMQDevice.h>
#include <fairmq/runDevice.h>
#include <boost/program_options.hpp>
#include <iostream>
@@ -36,7 +36,7 @@ auto addCustomOptions(bpo::options_description& options) -> void
("poll-type", bpo::value<int>()->default_value(0), "Poll type switch(0 - vector of (sub-)channels, 1 - vector of channel names)");
}
auto getDevice(const fair::mq::ProgOptions& config) -> FairMQDevicePtr
auto getDevice(fair::mq::ProgOptions& config) -> std::unique_ptr<fair::mq::Device>
{
using namespace std;
using namespace fair::mq::test;
@@ -44,35 +44,35 @@ auto getDevice(const fair::mq::ProgOptions& config) -> FairMQDevicePtr
auto id = config.GetProperty<std::string>("id");
if (0 == id.find("pull_")) {
return new Pull;
return std::make_unique<Pull>();
} else if (0 == id.find("push_")) {
return new Push;
return std::make_unique<Push>();
} else if (0 == id.find("sub_")) {
return new Sub;
return std::make_unique<Sub>();
} else if (0 == id.find("pub_")) {
return new Pub;
return std::make_unique<Pub>();
} else if (0 == id.find("req_")) {
return new Req;
return std::make_unique<Req>();
} else if (0 == id.find("rep_")) {
return new Rep;
return std::make_unique<Rep>();
} else if (0 == id.find("transfer_timeout_")) {
return new TransferTimeout;
return std::make_unique<TransferTimeout>();
} else if (0 == id.find("pollout_")) {
return new PollOut;
return std::make_unique<PollOut>();
} else if (0 == id.find("pollin_")) {
return new PollIn;
return std::make_unique<PollIn>();
} else if (0 == id.find("pairleft_")) {
return new PairLeft;
return std::make_unique<PairLeft>();
} else if (0 == id.find("pairright_")) {
return new PairRight;
return std::make_unique<PairRight>();
} else if (0 == id.find("waitfor_")) {
return new TestWaitFor;
return std::make_unique<TestWaitFor>();
} else if (0 == id.find("exceptions_")) {
return new Exceptions;
return std::make_unique<Exceptions>();
} else if (0 == id.find("error_state_")) {
return new ErrorState;
return std::make_unique<ErrorState>();
} else if (0 == id.find("signals_")) {
return new Signals;
return std::make_unique<Signals>();
} else {
cerr << "Don't know id '" << id << "'" << endl;
return nullptr;