OutputModuleBase

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
#ifndef FWCore_Framework_one_OutputModuleBase_h
#define FWCore_Framework_one_OutputModuleBase_h
// -*- C++ -*-
//
// Package:     FWCore/Framework
// Class  :     OutputModuleBase
//
/**\class OutputModuleBase OutputModuleBase.h "FWCore/Framework/interface/one/OutputModuleBase.h"

 Description: Base class for all 'one' OutputModules

 Usage:
    <usage>

*/
//
// Original Author:  Chris Jones
//         Created:  Wed, 31 Jul 2013 15:37:16 GMT
//

// system include files

// user include files
#include "FWCore/Framework/interface/OutputModuleCore.h"
#include "FWCore/Framework/interface/SharedResourcesAcquirer.h"

// forward declarations
namespace edm {

  namespace one {

    class OutputModuleBase : public core::OutputModuleCore {
    public:
      template <typename U>
      friend class edm::maker::ModuleHolderT;
      template <typename T>
      friend class ::edm::WorkerT;
      template <typename T>
      friend class ::edm::OutputModuleCommunicatorT;
      typedef OutputModuleBase ModuleType;

      explicit OutputModuleBase(ParameterSet const& pset);

      OutputModuleBase(OutputModuleBase const&) = delete;             // Disallow copying and moving
      OutputModuleBase& operator=(OutputModuleBase const&) = delete;  // Disallow copying and moving

      //Output modules always need writeRun and writeLumi to be called
      virtual bool wantsProcessBlocks() const noexcept = 0;
      virtual bool wantsInputProcessBlocks() const noexcept = 0;
      virtual bool wantsGlobalRuns() const noexcept = 0;
      virtual bool wantsGlobalLuminosityBlocks() const noexcept = 0;
      bool wantsStreamRuns() const noexcept { return false; }
      bool wantsStreamLuminosityBlocks() const noexcept { return false; };

      virtual SerialTaskQueue* globalRunsQueue() { return nullptr; }
      virtual SerialTaskQueue* globalLuminosityBlocksQueue() { return nullptr; }
      SharedResourcesAcquirer& sharedResourcesAcquirer() { return resourcesAcquirer_; }

    protected:
      void doPreallocate(PreallocationConfiguration const&);

      void doBeginJob();
      bool doEvent(EventTransitionInfo const&, ActivityRegistry*, ModuleCallingContext const*);

      void configure(OutputModuleDescription const& desc);

    private:
      SharedResourcesAcquirer resourcesAcquirer_;
      SerialTaskQueue runQueue_;
      SerialTaskQueue luminosityBlockQueue_;

      virtual SharedResourcesAcquirer createAcquirer();

      std::string workerType() const { return "WorkerT<edm::one::OutputModuleBase>"; }

      virtual void preActionBeforeRunEventAsync(WaitingTaskHolder iTask,
                                                ModuleCallingContext const& iModuleCallingContext,
                                                Principal const& iPrincipal) const noexcept {}

      bool hasAcquire() const noexcept { return false; }
    };
  }  // namespace one
}  // namespace edm
#endif