Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-11-24 00:02:22

0001 #ifndef HeterogeneousCore_AlpakaCore_interface_alpaka_EDMetadataSentry_h
0002 #define HeterogeneousCore_AlpakaCore_interface_alpaka_EDMetadataSentry_h
0003 
0004 #include "FWCore/Utilities/interface/StreamID.h"
0005 #include "HeterogeneousCore/AlpakaCore/interface/alpaka/EDMetadata.h"
0006 
0007 namespace ALPAKA_ACCELERATOR_NAMESPACE {
0008   namespace detail {
0009     /**
0010      * Helper class to be used in produce()
0011      *
0012      * TODO: not really a sentry as it doesn't do anything special in its destructor. Better name?
0013      */
0014     class EDMetadataSentry {
0015     public:
0016       // For normal module
0017       EDMetadataSentry(edm::StreamID stream);
0018 
0019       // For ExternalWork-module's produce()
0020       EDMetadataSentry(std::shared_ptr<EDMetadata> metadata) : metadata_(std::move(metadata)) {}
0021 
0022       EDMetadataSentry(EDMetadataSentry const&) = delete;
0023       EDMetadataSentry& operator=(EDMetadataSentry const&) = delete;
0024       EDMetadataSentry(EDMetadataSentry&&) = delete;
0025       EDMetadataSentry& operator=(EDMetadataSentry&&) = delete;
0026 
0027       std::shared_ptr<EDMetadata> metadata() { return metadata_; }
0028 
0029       void finish();
0030 
0031     private:
0032       std::shared_ptr<EDMetadata> metadata_;
0033     };
0034   }  // namespace detail
0035 }  // namespace ALPAKA_ACCELERATOR_NAMESPACE
0036 
0037 #endif