1#ifndef PACKING_UTILITY_CRC_H_
2#define PACKING_UTILITY_CRC_H_
4#include <boost/crc.hpp>
63 template <
typename WordType,
64 std::enable_if_t<std::is_integral<WordType>::value,
bool> =
true>
66 crc.process_bytes(&w,
sizeof(WordType));
84 template <
typename ObjectType,
85 std::enable_if_t<std::is_class<ObjectType>::value,
bool> =
true>
100 template <
typename ContentType>
102 for (
auto const& w : vec) *
this << w;
110 uint32_t
get() {
return crc.checksum(); }
The HGC ROC and FPGA use a CRC checksum to double check that the data transfer has been done correctl...
CRC & operator<<(const WordType &w)
Stream an integral type into the calculator.
uint32_t get()
Get the calculate checksum from the calculator.
CRC & operator<<(const std::vector< ContentType > &vec)
Stream a vector of objects into the calculator.
CRC & operator<<(const ObjectType &o)
Stream an instance of a class into the calculator.
boost::crc_32_type crc
the object from Boost doing the summing