1 #deinfe TRACE_NAME "requestReceiver"
3 #include <boost/program_options.hpp>
4 #include "fhiclcpp/make_ParameterSet.h"
5 namespace bpo = boost::program_options;
7 #include "artdaq/DAQrate/RequestReceiver.hh"
8 #include "artdaq-core/Utilities/configureMessageFacility.hh"
10 int main(
int argc,
char* argv[])
13 artdaq::configureMessageFacility(
"requestReceiver");
15 std::ostringstream descstr;
17 <<
" <-c <config-file>>";
18 bpo::options_description desc(descstr.str());
20 (
"config,c", bpo::value<std::string>(),
"Configuration file.")
21 (
"help,h",
"produce help message");
22 bpo::variables_map vm;
24 bpo::store(bpo::command_line_parser(argc, argv).options(desc).run(), vm);
27 catch (bpo::error
const & e) {
28 std::cerr <<
"Exception from command line processing in " << argv[0]
29 <<
": " << e.what() <<
"\n";
32 if (vm.count(
"help")) {
33 std::cout << desc << std::endl;
36 if (!vm.count(
"config")) {
37 std::cerr <<
"Exception from command line processing in " << argv[0]
38 <<
": no configuration file given.\n"
39 <<
"For usage and an options list, please do '"
40 << argv[0] <<
" --help"
45 fhicl::ParameterSet pset;
46 if (getenv(
"FHICL_FILE_PATH") ==
nullptr) {
48 <<
"INFO: environment variable FHICL_FILE_PATH was not set. Using \".\"\n";
49 setenv(
"FHICL_FILE_PATH",
".", 0);
51 cet::filepath_lookup_after1 lookup_policy(
"FHICL_FILE_PATH");
52 fhicl::make_ParameterSet(vm[
"config"].as<std::string>(), lookup_policy, pset);
57 recvr.startRequestReceiverThread();
61 for (
auto req : recvr.GetRequests())
63 TLOG(TLVL_INFO) <<
"Received Request for Sequence ID " << std::to_string(req.first) <<
", timestamp " << std::to_string(req.second) ;
65 recvr.ClearRequests();