1 #ifndef _newpacket__hpp__included__
2 #define _newpacket__hpp__included__
12 uint16_t rp_channel
; //Channel number.
13 uint32_t rp_channel_perm
; //Pemanent channel number. Not used when writing.
14 std::string rp_channel_name
; //Channel name. Not used when writing.
15 uint16_t rp_major
; //Major type. Not used when writing.
16 uint8_t rp_minor
; //Minor type.
17 uint64_t rp_timestamp
; //Timestamp in nanoseconds.
18 std::vector
<unsigned char> rp_payload
; //Payload.
23 uint16_t c_channel
; //Channel number.
24 uint32_t c_channel_perm
; //Channel permanent number. Not used when writing.
25 uint16_t c_type
; //Channel type.
26 std::string c_channel_name
; //Channel name.
32 read_channel(const std::string
& filename
);
34 uint32_t number_for_channel(const std::string
& name
);
35 struct packet
* read();
37 read_channel(const read_channel
& x
);
38 read_channel
& operator=(const read_channel
& x
);
41 std::vector
<channel
> rc_channels
;
42 uint64_t rc_last_timestamp
;
44 bool rc_segmenttable_coming
;
45 uint32_t rc_next_permchan
;
46 std::map
<std::string
, uint32_t> rc_permchans
;
52 write_channel(const std::string
& filename
);
54 void start_segment(const std::vector
<channel
>& channels
);
55 void write(struct packet
& p
);
57 write_channel(const write_channel
& x
);
58 write_channel
& operator=(const write_channel
& x
);
61 std::vector
<channel
> wc_channels
;
62 uint64_t wc_last_timestamp
;