CommRaT
2.0.0
C++20 Real-Time Messaging Framework
Loading...
Searching...
No Matches
tims_helpers.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
commrat/messages.hpp
"
4
#include "
commrat/platform/timestamp.hpp
"
5
#include <cstdint>
6
#include <utility>
7
8
namespace
commrat
{
9
10
// ============================================================================
11
// TimsMessage Creation Helpers
12
// ============================================================================
13
20
template
<
typename
T>
21
TimsMessage<T>
create_tims_message
(T&& payload, uint64_t timestamp_ns) {
22
TimsMessage<T>
msg{
23
.
header
= {
24
.
msg_type
= 0,
// serialize() will set this
25
.msg_size = 0,
// serialize() will set this
26
.timestamp = timestamp_ns,
// ONE SOURCE OF TRUTH
27
.seq_number = 0,
// TiMS will set this
28
.flags = 0
29
},
30
.payload = std::forward<T>(payload)
31
};
32
return
msg;
33
}
34
35
}
// namespace commrat
messages.hpp
commrat
CommRaT - Modern C++ Real-Time Communication Framework.
commrat::create_tims_message
TimsMessage< T > create_tims_message(T &&payload, uint64_t timestamp_ns)
Create TimsMessage with header.timestamp set.
Definition
tims_helpers.hpp:21
commrat::TimsHeader::msg_type
uint32_t msg_type
Definition
messages.hpp:17
commrat::TimsMessage
Definition
messages.hpp:58
commrat::TimsMessage::header
TimsHeader header
Definition
messages.hpp:59
timestamp.hpp
Unified timestamp and time utility abstractions for CommRaT.
commrat
module
helpers
tims_helpers.hpp
Generated by
1.9.8