DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
DAQEthHeader.hxx
Go to the documentation of this file.
1
3
4static_assert(std::endian::native == std::endian::little,
5 "The DAQEthHeader bitfield layout assumes little-endian architecture");
6
7static_assert(std::is_trivially_copyable_v<DAQEthHeader>,
8 "DAQEthHeader isn't trivially copyable and can't be safely std::memcpy'd");
9static_assert(std::is_standard_layout_v<DAQEthHeader>,
10 "DAQEthHeader isn't standard layout; reinterpret_cast and offsetof can't safely be used with it");
11
12static_assert(sizeof(DAQEthHeader) == 16, "DAQEthHeader not the expected size");
13static_assert(offsetof(DAQEthHeader, timestamp) == 8, "timestamp field not at expected offset");
14
15inline std::ostream&
16operator<<(std::ostream& o, DAQEthHeader const& h)
17{
18 return o << "Version:" << static_cast<unsigned>(h.version) << " DetID:" << static_cast<unsigned>(h.det_id)
19 << " CrateID:" << static_cast<unsigned>(h.crate_id) << " SlotID:" << static_cast<unsigned>(h.slot_id)
20 << " StreamID:" << static_cast<unsigned>(h.stream_id) << " SequenceID: " << static_cast<unsigned>(h.seq_id)
21 << " Block length: " << static_cast<unsigned>(h.block_length) << " Timestamp: " << h.get_timestamp() << '\n';
22}
23
24} // namespace dunedaq::detdataformats
std::ostream & operator<<(std::ostream &o, DAQEthHeader const &h)
DAQEthHeader is a versioned and unified structure for every FE electronics.