artdaq_demo  v3_06_01
AsciiSimulator.hh
1 #ifndef artdaq_demo_Generators_AsciiSimulator_hh
2 #define artdaq_demo_Generators_AsciiSimulator_hh
3 
4 #include "artdaq-core-demo/Overlays/AsciiFragment.hh"
5 #include "artdaq-core-demo/Overlays/FragmentType.hh"
6 #include "artdaq-core/Data/Fragment.hh"
7 #include "artdaq/Generators/CommandableFragmentGenerator.hh"
8 #include "fhiclcpp/fwd.h"
9 
10 #include <atomic>
11 #include <random>
12 #include <vector>
13 
14 namespace demo {
24 class AsciiSimulator : public artdaq::CommandableFragmentGenerator
25 {
26 public:
33  explicit AsciiSimulator( fhicl::ParameterSet const& ps );
34 
35 private:
45  bool getNext_( artdaq::FragmentPtrs& output ) override;
46 
47  // Explicitly declare that there is nothing special to be done
48  // by the start, stop, and stopNoMutex methods in this class
49  void start() override {}
50  void stop() override {}
51  void stopNoMutex() override {}
52 
53  // FHiCL-configurable variables. Note that the C++ variable names
54  // are the FHiCL variable names with a "_" appended
55 
56  std::size_t const throttle_usecs_;
57 
58  // Members needed to generate the simulated data
59  std::string string1_;
60  std::string string2_;
61 };
62 } // namespace demo
63 
64 #endif /* artdaq_demo_Generators_AsciiSimulator_hh */
Generates ASCIIFragments filled with user-specified ASCII strings.
AsciiSimulator(fhicl::ParameterSet const &ps)
AsciiSimulator Constructor.