Fix region example by moving our test code to a separate one

This commit is contained in:
Alexey Rybalchenko
2019-03-04 11:39:43 +01:00
committed by Dennis Klein
parent 3bf5f3bf45
commit f191c5099c
15 changed files with 380 additions and 17 deletions

View File

@@ -0,0 +1,40 @@
/********************************************************************************
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
* copied verbatim in the file "LICENSE" *
********************************************************************************/
#ifndef FAIRMQEXAMPLEREGIONBUILDER_H
#define FAIRMQEXAMPLEREGIONBUILDER_H
#include <atomic>
#include "FairMQDevice.h"
namespace example_region
{
class Builder : public FairMQDevice
{
public:
Builder() {
OnData("data1", &Builder::HandleData);
}
virtual ~Builder() {}
protected:
bool HandleData(FairMQMessagePtr& msg, int /*index*/)
{
if (Send(msg, "data2") < 0) {
return false;
}
return true;
}
};
} // namespace example_region
#endif /* FAIRMQEXAMPLEREGIONBUILDER_H */