artdaq::RequestReceiver Class Reference

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>

List of all members.

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 stopRequestReceiverThread (bool force=false)
 Stop the data request receiver thread (receiveRequestsLoop).
void startRequestReceiverThread ()
 Function that launches the data request receiver thread (receiveRequestsLoop()).
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.
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.

Detailed Description

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 20 of file RequestReceiver.hh.


Constructor & Destructor Documentation

artdaq::RequestReceiver::RequestReceiver ( const fhicl::ParameterSet &  ps  ) 

RequestReceiver Constructor.

Parameters:
ps ParameterSet used to configure RequestReceiver. See artdaq::RequestReceiver::Config

Definition at line 47 of file RequestReceiver.cc.


Member Function Documentation

void artdaq::RequestReceiver::ClearRequests (  )  [inline]

Clear all requests from the map.

Definition at line 107 of file RequestReceiver.hh.

std::map<artdaq::Fragment::sequence_id_t, artdaq::Fragment::timestamp_t> artdaq::RequestReceiver::GetRequests (  )  const [inline]

Get the current requests.

Returns:
Map relating sequence IDs to timestamps

Definition at line 81 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.

Parameters:
reqID Request ID of the request
Returns:
steady_clock::time_point corresponding to when the request was received

Definition at line 135 of file RequestReceiver.hh.

bool artdaq::RequestReceiver::isRunning (  )  [inline]

Determine if the RequestReceiver is receiving requests.

Returns:
True if the request receiver is running

Definition at line 102 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.

Parameters:
reqID Request ID to remove

Definition at line 277 of file RequestReceiver.cc.

size_t artdaq::RequestReceiver::size (  )  [inline]

Get the number of requests currently stored in the RequestReceiver.

Returns:
The number of requests stored in the RequestReceiver

Definition at line 117 of file RequestReceiver.hh.

void artdaq::RequestReceiver::stopRequestReceiverThread ( bool  force = false  ) 

Stop the data request receiver thread (receiveRequestsLoop).

Parameters:
force Whether to suppress any error messages (used if called from destructor)

Definition at line 122 of file RequestReceiver.cc.

bool artdaq::RequestReceiver::WaitForRequests ( int  timeout_ms  )  [inline]

Wait for a new request message, up to the timeout given.

Parameters:
timeout_ms Milliseconds to wait for a new request to arrive
Returns:
True if any requests are present in the request map

Definition at line 124 of file RequestReceiver.hh.


The documentation for this class was generated from the following files:

Generated on 6 Jun 2018 for artdaq by  doxygen 1.6.1