artdaq  3.12.07
ArtdaqGlobalsService.h
1 #ifndef artdaq_ArtModules_ArtdaqGlobalsService_h
2 #define artdaq_ArtModules_ArtdaqGlobalsService_h
3 
4 #include "art/Framework/Services/Registry/ServiceMacros.h"
5 #include "artdaq-core/Data/RawEvent.hh"
6 #include "artdaq/ArtModules/ArtdaqSharedMemoryServiceInterface.h"
7 #include "fhiclcpp/types/Atom.h"
8 
9 // ----------------------------------------------------------------------
10 
17 {
18 public:
22  struct Config
23  {
24  };
26  using Parameters = fhicl::WrappedTable<Config>;
27 
31  virtual ~ArtdaqGlobalsService();
32 
37  ArtdaqGlobalsService(fhicl::ParameterSet const& pset, art::ActivityRegistry&);
38 
43  std::unordered_map<artdaq::Fragment::type_t, std::unique_ptr<artdaq::Fragments>> ReceiveEvent(bool) override
44  {
45  return std::unordered_map<artdaq::Fragment::type_t, std::unique_ptr<artdaq::Fragments>>();
46  }
47 
52  size_t GetQueueSize() override { return 0; }
57  size_t GetQueueCapacity() override { return 0; }
62  std::shared_ptr<artdaq::detail::RawEventHeader> GetEventHeader() override { return nullptr; }
63 
68  size_t GetMyId() override { return 0; }
69 
70 private:
73  ArtdaqGlobalsService& operator=(ArtdaqGlobalsService const&) = delete;
74  ArtdaqGlobalsService& operator=(ArtdaqGlobalsService&&) = delete;
75 };
76 
77 DECLARE_ART_SERVICE_INTERFACE_IMPL(ArtdaqGlobalsService, ArtdaqSharedMemoryServiceInterface, LEGACY)
78 
79 #endif /* artdaq_ArtModules_ArtdaqGlobalsService_h */
80 
81 // Local Variables:
82 // mode: c++
83 // End:
size_t GetMyId() override
Get the ID of this art process. Always 0 since ArtdaqGlobalsService does not connect to shared memory...
Interface for ArtdaqSharedMemoryService. This interface is declared to art as part of the required re...
virtual ~ArtdaqGlobalsService()
ArtdaqGlobalsService Destructor. Calls disconnect().
size_t GetQueueCapacity() override
Get the maximum number of events which can be stored in the shared memory (0)
Allowed Configuration parameters of ArtdaqGlobalsService. May be used for configuration validation ...
std::unordered_map< artdaq::Fragment::type_t, std::unique_ptr< artdaq::Fragments > > ReceiveEvent(bool) override
Pretend to receive an event from the shared memory.
std::shared_ptr< artdaq::detail::RawEventHeader > GetEventHeader() override
Get a shared_ptr to the current event header, if any.
fhicl::WrappedTable< Config > Parameters
Used for ParameterSet validation (if desired)
ArtdaqGlobalsService(fhicl::ParameterSet const &pset, art::ActivityRegistry &)
ArtdaqGlobalsService Constructor.
ArtdaqGlobalsService extends ArtdaqSharedMemoryServiceInterface. It manages the artdaq Global varaibl...
size_t GetQueueSize() override
Get the number of events which are ready to be read (0)