00001 #ifndef artdaq_demo_Generators_ToySimulator_hh
00002 #define artdaq_demo_Generators_ToySimulator_hh
00003
00004
00005
00006
00007
00008
00009 #include "fhiclcpp/fwd.h"
00010 #include "artdaq-core/Data/Fragment.hh"
00011 #include "artdaq/Application/CommandableFragmentGenerator.hh"
00012 #include "artdaq-core-demo/Overlays/ToyFragment.hh"
00013 #include "artdaq-core-demo/Overlays/FragmentType.hh"
00014
00015 #include "ToyHardwareInterface/ToyHardwareInterface.hh"
00016
00017 #include <random>
00018 #include <vector>
00019 #include <atomic>
00020
00021 namespace demo
00022 {
00037 class ToySimulator : public artdaq::CommandableFragmentGenerator
00038 {
00039 public:
00048 explicit ToySimulator(fhicl::ParameterSet const& ps);
00049
00053 virtual ~ToySimulator();
00054
00055 private:
00056
00064 bool getNext_(artdaq::FragmentPtrs& output) override;
00065
00066
00067
00068
00069
00075 void start() override;
00076
00082 void stop() override;
00083
00088 void stopNoMutex() override {}
00089
00090 std::unique_ptr<ToyHardwareInterface> hardware_interface_;
00091 artdaq::Fragment::timestamp_t timestamp_;
00092 int timestampScale_;
00093
00094 ToyFragment::Metadata metadata_;
00095
00096
00097
00098
00099
00100
00101 char* readout_buffer_;
00102
00103 FragmentType fragment_type_;
00104 ToyHardwareInterface::DistributionType distribution_type_;
00105 };
00106 }
00107
00108 #endif