gaps-online-software 0.10
online software for the TOF system for the GAPS experiment
Loading...
Searching...
No Matches
serialization.h
1#ifndef SERIALIZATION_H_INCLUDED
2#define SERIALIZATION_H_INCLUDED
3
4#include <iostream>
5#include <sstream>
6#include <bitset>
7#include <vector>
8#include <numeric>
9#include <assert.h>
10#include <concepts>
11
12#include "tof_typedefs.h"
13#include "packets/tof_packet.h"
14#include "serialization.h"
15
17template<typename Derived>
19 static Derived from_tofpacket(const TofPacket &p) {
20 usize pos = 0;
21 return Derived::from_bytestream(p.payload, pos);
22 }
23};
24
25/***********************************************/
26
43u64 search_for_2byte_marker(const Vec<u8> &bytestream,
44 u8 marker,
45 bool &has_ended,
46 u64 start_pos=0,
47 u64 end_pos=0);
48
49/***********************************************/
50
51Vec<u32> get_2byte_markers_indices(const Vec<u8> &bytestream, u8 marker);
52
53// file i/o
54/***********************************************/
55bytestream get_bytestream_from_file(const std::string &filename);
56
57
58#endif
Allow to extend all classes with a from_tofpacket method.
Definition serialization.h:18
Definition tof_packet.h:81