00001 #ifndef artdaq_core_Generators_FragmentGenerator_hh 00002 #define artdaq_core_Generators_FragmentGenerator_hh 00003 00005 // FragmentGenerator is an abstract class that defines the interface for 00006 // obtaining events in artdaq. Subclasses are to override the (private) virtual 00007 // functions; users of FragmentGenerator are to invoke the public 00008 // (non-virtual) functions. 00009 // 00010 // getNext() will be called only from a single thread 00012 00013 #include "artdaq-core/Data/Fragments.hh" 00014 00015 namespace artdaq { 00016 class FragmentGenerator { 00017 public: 00018 00019 FragmentGenerator() = default; 00020 00021 virtual ~FragmentGenerator() = default; 00022 00023 // Obtain the next collection of Fragments. Return false to indicate 00024 // end-of-data. Fragments may or may not be in the same event; 00025 // Fragments may or may not have the same FragmentID. Fragments 00026 // will all be part of the same Run and SubRun. 00027 virtual bool getNext(FragmentPtrs & output) = 0; 00028 00029 00030 // John F., 12/11/13 -- uncertain what the meaning of the comment below is 00031 00032 // This generator produces fragments with what distinct IDs (*not* 00033 // types)? 00034 virtual std::vector<Fragment::fragment_id_t> fragmentIDs() = 0; 00035 00036 }; 00037 00038 } 00039 00040 #endif /* artdaq_core_Generators_FragmentGenerator_hh */