Extend Readout example

This commit is contained in:
Alexey Rybalchenko
2019-04-02 15:23:26 +02:00
committed by Dennis Klein
parent 35399ee039
commit 7e6eb382d5
17 changed files with 416 additions and 299 deletions

View File

@@ -0,0 +1,37 @@
/********************************************************************************
* 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 FAIRMQEXAMPLEREGIONPROCESSOR_H
#define FAIRMQEXAMPLEREGIONPROCESSOR_H
#include "FairMQDevice.h"
namespace example_readout
{
class Processor : public FairMQDevice
{
public:
Processor() {
OnData("bp", &Processor::HandleData);
}
protected:
bool HandleData(FairMQMessagePtr& msg, int /*index*/)
{
FairMQMessagePtr msg2(NewMessageFor("ps", 0, msg->GetSize()));
if (Send(msg2, "ps") < 0) {
return false;
}
return true;
}
};
} // namespace example_readout
#endif /* FAIRMQEXAMPLEREGIONPROCESSOR_H */