#include <PndMQBurstProcessor.h>
Definition at line 50 of file PndMQBurstProcessor.h.
PndMQBurstProcessor::PndMQBurstProcessor |
( |
| ) |
|
|
inline |
Definition at line 53 of file PndMQBurstProcessor.h.
56 gSystem->ResetSignal(kSigInterrupt);
57 gSystem->ResetSignal(kSigTermination);
60 using namespace baseMQ::tools::resolve;
62 if (is_same<boost::archive::binary_iarchive, boost::archive::binary_iarchive>::value || is_same<boost::archive::binary_iarchive, boost::archive::text_iarchive>::value)
64 if (has_BoostSerialization<FairTimeStamp,
void(boost::archive::binary_iarchive&,
const unsigned int)>::value == 1)
bool fHasBoostSerialization
virtual PndMQBurstProcessor::~PndMQBurstProcessor |
( |
| ) |
|
|
inlinevirtual |
void PndMQBurstProcessor::CustomCleanupParameters |
( |
void * |
data, |
|
|
void * |
hint |
|
) |
| |
|
static |
void PndMQBurstProcessor::free_string |
( |
void * |
data, |
|
|
void * |
hint |
|
) |
| |
|
static |
virtual void PndMQBurstProcessor::ProcessData |
( |
| ) |
|
|
pure virtual |
void PndMQBurstProcessor::Run |
( |
| ) |
|
|
protectedvirtual |
Definition at line 36 of file PndMQBurstProcessor.cxx.
References fBurstDataIn, fBurstDataOut, BurstHeader::fBurstID, fCurrentRunId, BurstData::fData, fHasBoostSerialization, BurstData::fHeader, fNewRunId, free_string(), BurstHeader::fRunID, ProcessData(), SetParameters(), and UpdateParameters().
40 while (CheckCurrentState(RUNNING))
43 std::unique_ptr<FairMQMessage> msg(fTransportFactory->CreateMessage());
44 if (Receive(msg,
"data-in") >= 0)
46 LOG(INFO) <<
"Received data! " << msg->GetSize() << std::endl;
47 string msgStr(static_cast<char*>(msg->GetData()), msg->GetSize());
48 istringstream ibuffer(msgStr);
50 LOG(INFO) <<
"IBUFFER IS BAD!";
52 boost::archive::binary_iarchive InputArchive(ibuffer);
56 catch (boost::archive::archive_exception& e)
58 LOG(ERROR) << e.what();
75 std::ostringstream obuffer;
76 boost::archive::binary_oarchive OutputArchive(obuffer);
78 std::string* strMsg =
new std::string(obuffer.str());
79 unique_ptr<FairMQMessage> msgOut(NewMessage(const_cast<char*>(strMsg->c_str()), strMsg->length(),
free_string, strMsg));
80 LOG(INFO) <<
"Data sent: " << fBurstDataOut.fHeader.fBranchName <<
" BurstID: " << fBurstDataOut.fHeader.fBurstID <<
" size: " << msgOut->GetSize();
88 Send(msgOut,
"data-out");
94 LOG(ERROR) <<
" Boost Serialization not ok";
static void free_string(void *data, void *hint)
virtual void UpdateParameters()
virtual void SetParameters()
bool fHasBoostSerialization
virtual void ProcessData()=0
std::vector< std::vector< FairTimeStamp * > > fData
template<class Archive >
void PndMQBurstProcessor::serialize |
( |
Archive & |
ar, |
|
|
const unsigned int |
version |
|
) |
| |
|
inline |
virtual void PndMQBurstProcessor::SetParameters |
( |
| ) |
|
|
inlinevirtual |
FairParGenericSet * PndMQBurstProcessor::UpdateParameter |
( |
FairParGenericSet * |
thisPar | ) |
|
|
virtual |
Definition at line 106 of file PndMQBurstProcessor.cxx.
References CustomCleanupParameters(), and fCurrentRunId.
Referenced by UpdateParameters().
107 std::string paramName = thisPar->GetName();
109 std::string* reqStr =
new std::string(paramName +
"," + std::to_string(
fCurrentRunId));
110 LOG(WARN) <<
"Requesting parameter \"" << paramName <<
"\" for Run ID " <<
fCurrentRunId <<
" (" << thisPar <<
")";
111 std::unique_ptr<FairMQMessage> req(NewMessage(const_cast<char*>(reqStr->c_str()), reqStr->length(),
CustomCleanupParameters, reqStr));
112 std::unique_ptr<FairMQMessage> rep(NewMessage());
114 if (Send(req,
"param") > 0)
116 if (Receive(rep,
"param") > 0)
118 TMessage2 tm(rep->GetData(), rep->GetSize());
119 thisPar = (FairParGenericSet*)tm.ReadObject(tm.GetClass());
120 LOG(WARN) <<
"Received parameter"<< paramName <<
" from the server (" << thisPar <<
")" << tm.GetClass()->GetName() <<
" DataSize: " << rep->GetSize();
static void CustomCleanupParameters(void *data, void *hint)
void PndMQBurstProcessor::UpdateParameters |
( |
| ) |
|
|
virtual |
friend class boost::serialization::access |
|
friend |
int PndMQBurstProcessor::fCurrentRunId |
|
protected |
bool PndMQBurstProcessor::fHasBoostSerialization |
|
private |
int PndMQBurstProcessor::fNewRunId |
|
protected |
TList* PndMQBurstProcessor::fParCList |
|
protected |
The documentation for this class was generated from the following files: