CbmRoot
Loading...
Searching...
No Matches
CbmDevNullSink.cxx
Go to the documentation of this file.
1/* Copyright (C) 2017-2019 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Florian Uhlig [committer] */
4
12#include "CbmDevNullSink.h"
13
14#include "FairMQLogger.h"
15#include "FairMQProgOptions.h" // device->fConfig
16
17using namespace std;
18
19CbmDevNullSink::CbmDevNullSink() : FairMQDevice {}, fNumMessages {0} {}
20
22
24{
25 // register a handler for data arriving on any channel
26 int noChannel = fChannels.size();
27 LOG(info) << "Number of defined input channels: " << noChannel;
28 for (auto const& entry : fChannels) {
29 LOG(info) << "Channel name: " << entry.first;
30 OnData(entry.first, &CbmDevNullSink::HandleData);
31 }
32}
33
34// handler is called whenever a message arrives on "data", with a reference to the message and a sub-channel index (here 0)
35bool CbmDevNullSink::HandleData(FairMQMessagePtr& msg, int /*index*/)
36{
37 // Don't do anything with the data
38 // Maybe add an message counter which counts the incomming messages and add
39 // an output
41 LOG(info) << "Received message number " << fNumMessages << " with size " << msg->GetSize();
42 return true;
43}
44
uint64_t fNumMessages
virtual void InitTask()
bool HandleData(FairMQMessagePtr &, int)
virtual ~CbmDevNullSink()
virtual void Init()
Hash for CbmL1LinkKey.