CMS 3D CMS Logo

OutputModuleBase.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: FWCore/Framework
4 // Class : OutputModuleBase
5 //
6 // Implementation:
7 // [Notes on implementation]
8 //
9 //
10 
11 // system include files
12 #include <cassert>
13 
14 // user include files
16 
20 
21 namespace edm {
22  namespace global {
23 
24  // -------------------------------------------------------
26 
28  auto nstreams = iPC.numberOfStreams();
29  preallocStreams(nstreams);
31  preallocate(iPC);
32  }
33 
35 
37  ActivityRegistry* act,
38  ModuleCallingContext const* mcc) {
40 
41  auto remainingEvents = remainingEvents_.load();
42  bool keepTrying = remainingEvents > 0;
43  while (keepTrying) {
44  auto newValue = remainingEvents - 1;
45  keepTrying = !remainingEvents_.compare_exchange_strong(remainingEvents, newValue);
46  if (keepTrying) {
47  // the exchange failed because the value was changed by another thread.
48  // remainingEvents was changed to be the new value of remainingEvents_;
49  keepTrying = remainingEvents > 0;
50  }
51  }
52  return true;
53  }
54 
56  ActivityRegistry* act,
57  ModuleCallingContext const* mcc,
60  e.setConsumer(this);
61  EventAcquireSignalsSentry sentry(act, mcc);
62  this->doAcquire_(e.streamID(), e, holder);
63  }
64  } // namespace global
65 } // namespace edm
virtual void preallocate(PreallocationConfiguration const &)
StreamID streamID() const
static const TGPicture * info(bool iBackgroundIsBlack)
virtual void preallocStreams(unsigned int)
void doPreallocate_(PreallocationConfiguration const &)
OutputModuleBase(ParameterSet const &pset)
Definition: __init__.py:1
std::atomic< int > remainingEvents_
bool doEvent_(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
void doPreallocate(PreallocationConfiguration const &)
HLT enums.
const ModuleDescription & moduleDescription() const
virtual void doAcquire_(StreamID, EventForOutput const &, WaitingTaskWithArenaHolder &)
void doAcquire(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *, WaitingTaskWithArenaHolder &)