FairRoot/PandaRoot
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
PndMQTopix4Sink Class Reference

#include <PndMQTopix4Sink.h>

Inheritance diagram for PndMQTopix4Sink:

Public Member Functions

 PndMQTopix4Sink ()
 
virtual ~PndMQTopix4Sink ()
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Protected Member Functions

virtual void Run ()
 

Protected Attributes

bool fHasBoostSerialization
 
std::vector< PndSdsDigiTopix4fTopixData
 
PndMvdReadInToPix4TBData fTopixDataReader
 

Friends

class boost::serialization::access
 

Detailed Description

PndMQTopix4Sink.h

Since
2014-10-10
Author
A. Rybalchenko

Definition at line 28 of file PndMQTopix4Sink.h.

Constructor & Destructor Documentation

PndMQTopix4Sink::PndMQTopix4Sink ( )

Definition at line 32 of file PndMQTopix4Sink.cxx.

References fHasBoostSerialization.

32  : fHasBoostSerialization(false)
33 {
34  //gSystem->ResetSignal(kSigInterrupt);
35  //gSystem->ResetSignal(kSigTermination);
36 
37  using namespace baseMQ::tools::resolve;
38  // coverity[pointless_expression]: suppress coverity warnings on apparant if(const).
39  if (has_BoostSerialization<PndSdsDigiTopix4, void(boost::archive::binary_iarchive&, const unsigned int)>::value == 1)
41 }
Data class to store the digi output of a pixel module.
PndMQTopix4Sink::~PndMQTopix4Sink ( )
virtual

Definition at line 99 of file PndMQTopix4Sink.cxx.

100 {
101 }

Member Function Documentation

void PndMQTopix4Sink::Run ( )
protectedvirtual

Definition at line 48 of file PndMQTopix4Sink.cxx.

References fHasBoostSerialization, and fTopixData.

49 {
50  LOG(INFO) << "Boost Serialization "<< fHasBoostSerialization;
52  FairMQChannel& dataInChannel = fChannels.at("data-in").at(0);
53  int receivedMsgs = 0;
54 
55  while (CheckCurrentState(RUNNING))
56  {
57  FairMQMessage* msg = fTransportFactory->CreateMessage();
58 
59  if (dataInChannel.Receive(msg) > 0)
60  {
61  LOG(INFO) << "Received Message: ";
62  LOG(INFO) << receivedMsgs++;
63  LOG(INFO) << msg->GetSize();
64 
65  string msgStr(static_cast<char*>(msg->GetData()), msg->GetSize());
66  istringstream ibuffer(msgStr);
67 
68  boost::archive::binary_iarchive InputArchive(ibuffer);
69 
70  try {
71  InputArchive >> fTopixData;
72  }
73  catch (boost::archive::archive_exception& e)
74  {
75  LOG(ERROR) << e.what();
76  }
77 
78  LOG(INFO) << "TopixData: " << fTopixData.size();
79 
80  if (fTopixData.size() > 0){
81  // ostringstream obuffer;
82  // boost::archive::binary_oarchive OutputArchive(obuffer);
83  // OutputArchive << frames.front();
84  // int outputSize = obuffer.str().length();
85  // unique_ptr<FairMQMessage> msg2(fTransportFactory->CreateMessage(const_cast<char*>(obuffer.str().c_str()), outputSize, CustomCleanup, &obuffer));
86  // fChannels.at("data-out").at(0).Send(msg);
87  LOG(INFO) << "Data: " << fTopixData.size() << " " << fTopixData.front() << std::endl;
88  }
89  delete(msg);
90 
91 
92  if (fTopixData.size() > 0)
93  fTopixData.clear();
94  }
95  }
96  }
97 }
std::vector< PndSdsDigiTopix4 > fTopixData
template<class Archive >
void PndMQTopix4Sink::serialize ( Archive &  ar,
const unsigned int  version 
)
inline

Definition at line 37 of file PndMQTopix4Sink.h.

References fTopixData.

38  {
39  ar& fTopixData;
40  }
std::vector< PndSdsDigiTopix4 > fTopixData

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 46 of file PndMQTopix4Sink.h.

Member Data Documentation

bool PndMQTopix4Sink::fHasBoostSerialization
protected

Definition at line 47 of file PndMQTopix4Sink.h.

Referenced by PndMQTopix4Sink(), and Run().

std::vector<PndSdsDigiTopix4> PndMQTopix4Sink::fTopixData
protected

Definition at line 50 of file PndMQTopix4Sink.h.

Referenced by Run(), and serialize().

PndMvdReadInToPix4TBData PndMQTopix4Sink::fTopixDataReader
protected

Definition at line 52 of file PndMQTopix4Sink.h.


The documentation for this class was generated from the following files: