$treeview $search $mathjax $extrastylesheet
artdaq
v3_04_01
$projectbrief
|
$projectbrief
|
$searchbox |
Receive data requests and make them available to CommandableFragmentGenerator or other interested parties. Track received requests and report errors when inconsistency is detected. More...
#include <artdaq/DAQrate/RequestReceiver.hh>
Classes | |
struct | Config |
Configuration of the RequestReceiver. May be used for parameter validation. More... | |
Public Member Functions | |
RequestReceiver () | |
RequestReceiver Default Constructor. | |
RequestReceiver (const fhicl::ParameterSet &ps) | |
RequestReceiver Constructor. | |
void | setupRequestListener () |
Opens the socket used to listen for data requests. | |
void | stopRequestReception (bool force=false) |
Disables (stops) the reception of data requests. | |
void | startRequestReception () |
Enables (starts) the reception of data requests. | |
void | receiveRequestsLoop () |
This function receives data request packets, adding new requests to the request list. | |
std::map < artdaq::Fragment::sequence_id_t, artdaq::Fragment::timestamp_t > | GetRequests () const |
Get the current requests. | |
void | RemoveRequest (artdaq::Fragment::sequence_id_t reqID) |
Remove the request with the given sequence ID from the request map. | |
bool | isRunning () |
Determine if the RequestReceiver is receiving requests. | |
void | ClearRequests () |
Clear all requests from the map. | |
std::map < artdaq::Fragment::sequence_id_t, artdaq::Fragment::timestamp_t > | GetAndClearRequests () |
Get the current requests, then clear the map. | |
size_t | size () |
Get the number of requests currently stored in the RequestReceiver. | |
bool | WaitForRequests (int timeout_ms) |
Wait for a new request message, up to the timeout given. | |
std::chrono::steady_clock::time_point | GetRequestTime (artdaq::Fragment::sequence_id_t reqID) |
Get the time a given request was received. | |
void | SetRunNumber (uint32_t run) |
Sets the current run number. |
Receive data requests and make them available to CommandableFragmentGenerator or other interested parties. Track received requests and report errors when inconsistency is detected.
Definition at line 18 of file RequestReceiver.hh.
artdaq::RequestReceiver::RequestReceiver | ( | const fhicl::ParameterSet & | ps | ) |
RequestReceiver Constructor.
ps | ParameterSet used to configure RequestReceiver. See artdaq::RequestReceiver::Config |
Definition at line 51 of file RequestReceiver.cc.
void artdaq::RequestReceiver::ClearRequests | ( | ) | [inline] |
Clear all requests from the map.
Definition at line 104 of file RequestReceiver.hh.
std::map<artdaq::Fragment::sequence_id_t, artdaq::Fragment::timestamp_t> artdaq::RequestReceiver::GetAndClearRequests | ( | ) | [inline] |
Get the current requests, then clear the map.
Definition at line 114 of file RequestReceiver.hh.
std::map<artdaq::Fragment::sequence_id_t, artdaq::Fragment::timestamp_t> artdaq::RequestReceiver::GetRequests | ( | ) | const [inline] |
Get the current requests.
Definition at line 78 of file RequestReceiver.hh.
std::chrono::steady_clock::time_point artdaq::RequestReceiver::GetRequestTime | ( | artdaq::Fragment::sequence_id_t | reqID | ) | [inline] |
Get the time a given request was received.
reqID | Request ID of the request |
Definition at line 157 of file RequestReceiver.hh.
bool artdaq::RequestReceiver::isRunning | ( | ) | [inline] |
Determine if the RequestReceiver is receiving requests.
Definition at line 99 of file RequestReceiver.hh.
void artdaq::RequestReceiver::RemoveRequest | ( | artdaq::Fragment::sequence_id_t | reqID | ) |
Remove the request with the given sequence ID from the request map.
reqID | Request ID to remove |
Definition at line 293 of file RequestReceiver.cc.
void artdaq::RequestReceiver::SetRunNumber | ( | uint32_t | run | ) | [inline] |
Sets the current run number.
run | The current run number |
Definition at line 167 of file RequestReceiver.hh.
size_t artdaq::RequestReceiver::size | ( | ) | [inline] |
Get the number of requests currently stored in the RequestReceiver.
Definition at line 133 of file RequestReceiver.hh.
void artdaq::RequestReceiver::stopRequestReception | ( | bool | force = false |
) |
Disables (stops) the reception of data requests.
force | Whether to suppress any error messages (used if called from destructor) |
Definition at line 127 of file RequestReceiver.cc.
bool artdaq::RequestReceiver::WaitForRequests | ( | int | timeout_ms | ) | [inline] |
Wait for a new request message, up to the timeout given.
timeout_ms | Milliseconds to wait for a new request to arrive |
Definition at line 143 of file RequestReceiver.hh.