SNMessageService_service.cc
Go to the documentation of this file.
3 
4 namespace novaddt{
7  fMailbox({"SuperNovaDDT",
8  p.get<unsigned>("dds.partition"),
9  p.get<std::string>("dds.mailbox")}),
10  fMessageBuffer( p.get<std::string>("shmem.segment").data(),
11  p.get<std::string>("shmem.object").data())
12  {
13  }
14 
15  void SNMessageService::PushPoint(uint64_t time, uint64_t hits){
16  //lock buffer before modifying it
17  auto lock=fMessageBuffer.ScopedLock();
18  //check if we have enough point in buffer for message
19  if(fMessageBuffer.isFull()){
23  }
24  //append buffer
25  try {
27  }
28  catch (std::exception& e){
29  //in case of any exception: print out error and skip this point
30  mf::LogError("SNMessageService")<<e.what();
31  }
32 
33  }
35 }
const char * p
Definition: xmltok.h:285
DEFINE_ART_SERVICE_INTERFACE_IMPL(DDTRCService, RunInfoInterface)
::xsd::cxx::tree::exception< char > exception
Definition: Database.h:225
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
::xsd::cxx::tree::time< char, simple_type > time
Definition: Database.h:194
const XML_Char const XML_Char * data
Definition: expat.h:268
void hits()
Definition: readHits.C:15
void PushPoint(uint64_t time, uint64_t hits) override
T get(std::string const &key) const
Definition: ParameterSet.h:231
SNMessageService(fhicl::ParameterSet const &p, art::ActivityRegistry &reg)
nsnmessages::NSNPackedMessage makeMessage()
Definition: MessageBuffer.h:74
scoped_lock ScopedLock()
Definition: MessageBuffer.h:84
DDSOutbox< nsnmessages::NSNPackedMessage > fMailbox
void addPoint(Point p)
Definition: MessageBuffer.h:64
Float_t e
Definition: plot.C:35
enum BeamMode string