CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
evf::GlobalEvFOutputEventWriter Class Reference

Public Member Functions

void close ()
 
void doOutputEvent (EventMsgBuilder const &msg)
 
void doOutputEventAsync (std::unique_ptr< EventMsgBuilder > msg, edm::WaitingTaskHolder iHolder)
 
uint32 get_adler32 () const
 
unsigned long getAccepted () const
 
std::string const & getFilePath () const
 
 GlobalEvFOutputEventWriter (std::string const &filePath)
 
void incAccepted ()
 
edm::SerialTaskQueuequeue ()
 
 ~GlobalEvFOutputEventWriter ()
 

Private Attributes

std::atomic< unsigned long > accepted_
 
std::string filePath_
 
edm::propagate_const
< std::unique_ptr
< StreamerOutputFile > > 
stream_writer_events_
 
edm::SerialTaskQueue writeQueue_
 

Detailed Description

Definition at line 43 of file GlobalEvFOutputModule.cc.

Constructor & Destructor Documentation

evf::GlobalEvFOutputEventWriter::GlobalEvFOutputEventWriter ( std::string const &  filePath)
inlineexplicit

Definition at line 45 of file GlobalEvFOutputModule.cc.

evf::GlobalEvFOutputEventWriter::~GlobalEvFOutputEventWriter ( )
inline

Definition at line 48 of file GlobalEvFOutputModule.cc.

48 {}

Member Function Documentation

void evf::GlobalEvFOutputEventWriter::close ( void  )
inline

Definition at line 50 of file GlobalEvFOutputModule.cc.

References stream_writer_events_.

Referenced by esMonitoring.AsyncLineReaderMixin::handle_close(), and esMonitoring.FDJsonServer::handle_close().

50 { stream_writer_events_->close(); }
edm::propagate_const< std::unique_ptr< StreamerOutputFile > > stream_writer_events_
void evf::GlobalEvFOutputEventWriter::doOutputEvent ( EventMsgBuilder const &  msg)
inline

Definition at line 52 of file GlobalEvFOutputModule.cc.

References incAccepted(), EventMsgBuilder::startAddress(), and stream_writer_events_.

Referenced by doOutputEventAsync().

52  {
53  EventMsgView eview(msg.startAddress());
54  stream_writer_events_->write(eview);
55  incAccepted();
56  }
tuple msg
Definition: mps_check.py:285
edm::propagate_const< std::unique_ptr< StreamerOutputFile > > stream_writer_events_
void evf::GlobalEvFOutputEventWriter::doOutputEventAsync ( std::unique_ptr< EventMsgBuilder msg,
edm::WaitingTaskHolder  iHolder 
)
inline

Definition at line 58 of file GlobalEvFOutputModule.cc.

References doOutputEvent(), edm::WaitingTaskHolder::group(), watchdog::group, eostools::move(), edm::SerialTaskQueue::push(), createJobs::tmp, and writeQueue_.

58  {
59  auto group = iHolder.group();
60  writeQueue_.push(*group, [holder = std::move(iHolder), msg = msg.release(), this]() {
61  try {
62  std::unique_ptr<EventMsgBuilder> own(msg);
63  doOutputEvent(*msg); //msg is written and discarded at this point
64  } catch (...) {
65  auto tmp = holder;
66  tmp.doneWaiting(std::current_exception());
67  }
68  });
69  }
void doOutputEvent(EventMsgBuilder const &msg)
void push(tbb::task_group &, const T &iAction)
asynchronously pushes functor iAction into queue
def move
Definition: eostools.py:511
tuple group
Definition: watchdog.py:82
tuple msg
Definition: mps_check.py:285
tbb::task_group * group() const noexcept
tmp
align.sh
Definition: createJobs.py:716
uint32 evf::GlobalEvFOutputEventWriter::get_adler32 ( ) const
inline

Definition at line 71 of file GlobalEvFOutputModule.cc.

References stream_writer_events_.

71 { return stream_writer_events_->adler32(); }
edm::propagate_const< std::unique_ptr< StreamerOutputFile > > stream_writer_events_
unsigned long evf::GlobalEvFOutputEventWriter::getAccepted ( ) const
inline

Definition at line 75 of file GlobalEvFOutputModule.cc.

References accepted_.

75 { return accepted_; }
std::atomic< unsigned long > accepted_
std::string const& evf::GlobalEvFOutputEventWriter::getFilePath ( ) const
inline

Definition at line 73 of file GlobalEvFOutputModule.cc.

References filePath_.

73 { return filePath_; }
void evf::GlobalEvFOutputEventWriter::incAccepted ( )
inline

Definition at line 76 of file GlobalEvFOutputModule.cc.

References accepted_.

Referenced by doOutputEvent().

76 { accepted_++; }
std::atomic< unsigned long > accepted_
edm::SerialTaskQueue& evf::GlobalEvFOutputEventWriter::queue ( )
inline

Definition at line 78 of file GlobalEvFOutputModule.cc.

References writeQueue_.

78 { return writeQueue_; }

Member Data Documentation

std::atomic<unsigned long> evf::GlobalEvFOutputEventWriter::accepted_
private

Definition at line 82 of file GlobalEvFOutputModule.cc.

Referenced by getAccepted(), and incAccepted().

std::string evf::GlobalEvFOutputEventWriter::filePath_
private

Definition at line 81 of file GlobalEvFOutputModule.cc.

Referenced by getFilePath().

edm::propagate_const<std::unique_ptr<StreamerOutputFile> > evf::GlobalEvFOutputEventWriter::stream_writer_events_
private

Definition at line 83 of file GlobalEvFOutputModule.cc.

Referenced by close(), doOutputEvent(), and get_adler32().

edm::SerialTaskQueue evf::GlobalEvFOutputEventWriter::writeQueue_
private

Definition at line 84 of file GlobalEvFOutputModule.cc.

Referenced by doOutputEventAsync(), and queue().