10 #include "PndMQGapEventBuilder.h"
13 #include "PndMapSorter.h"
28 delete (std::string*)hint;
33 delete static_cast<std::string*
>(hint);
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";
99 for (
int iparC = 0 ; iparC <
fParCList->GetEntries() ; iparC++ ) {
100 FairParGenericSet* tempObj = (FairParGenericSet*)(
fParCList->At(iparC));
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();
virtual FairParGenericSet * UpdateParameter(FairParGenericSet *thisPar)
static void free_string(void *data, void *hint)
virtual void UpdateParameters()
virtual void SetParameters()
static void CustomCleanupParameters(void *data, void *hint)
bool fHasBoostSerialization
TMessage2(void *buf, Int_t len)
virtual void ProcessData()=0
std::vector< std::vector< FairTimeStamp * > > fData