1 #ifndef artdaq_DAQrate_detail_RequestMessage_hh
2 #define artdaq_DAQrate_detail_RequestMessage_hh
4 #include "artdaq-core/Data/Fragment.hh"
5 #define MAX_REQUEST_MESSAGE_SIZE 65000
53 Fragment::sequence_id_t
sequence_id{Fragment::InvalidSequenceID};
54 Fragment::timestamp_t
timestamp{Fragment::InvalidTimestamp};
63 RequestPacket(
const Fragment::sequence_id_t& seq,
const Fragment::timestamp_t& ts)
119 assert(
size < MAX_REQUEST_MESSAGE_SIZE);
120 auto output = std::vector<uint8_t>(
size);
159 size_t size()
const {
return packets_.size(); }
166 void addRequest(
const Fragment::sequence_id_t& seq,
const Fragment::timestamp_t& time)
173 std::vector<RequestPacket> packets_;
176 #endif // artdaq_DAQrate_detail_RequestMessage
std::vector< uint8_t > GetMessage()
Get the contents of the RequestMessage.
End of Run mode (Used to end request processing on receiver)
void addRequest(const Fragment::sequence_id_t &seq, const Fragment::timestamp_t &time)
Add a request for a sequence ID and timestamp combination.
Fragment::timestamp_t timestamp
The timestamp of the request.
void setRunNumber(int run)
Set the run number in the header for this request. This will be the Run for which the request is vali...
A RequestMessage consists of a RequestHeader and zero or more RequestPackets. They will usually be se...
void setMode(RequestMessageMode mode)
Set the Request Message Mode for this request.
void setRank(int rank)
Set the rank in the header for this request. This will be the rank from which the request originates...
The RequestPacket contains information about a single data request.
RequestMessageMode
Mode used to indicate current run conditions to the request receiver.
size_t size() const
Get the number of RequestPackets in the RequestMessage.
bool isValid() const
Check the magic bytes of the packet.
RequestMessage()
Default Constructor.
RequestPacket(const Fragment::sequence_id_t &seq, const Fragment::timestamp_t &ts)
Create a RequestPacket using the given sequence ID and timestmap.
Fragment::sequence_id_t sequence_id
The sequence ID that responses to this request should use.