MCPcopy Create free account
hub / github.com/comaps/comaps / InitHeader

Method InitHeader

libs/tracking/protocol.cpp:133–145  ·  view source on GitHub ↗

static

Source from the content-addressed store, hash-verified

131
132// static
133void Protocol::InitHeader(vector<uint8_t> & packet, PacketType type, uint32_t payloadSize)
134{
135 packet.resize(sizeof(uint32_t));
136 uint32_t & size = *reinterpret_cast<uint32_t *>(packet.data());
137 size = payloadSize;
138
139 ASSERT_LESS(size, 0x00FFFFFF, ());
140
141 if (!IsBigEndianMacroBased())
142 size = ReverseByteOrder(size);
143
144 packet[0] = static_cast<uint8_t>(type);
145}
146
147string DebugPrint(Protocol::PacketType type)
148{

Callers

nothing calls this directly

Calls 4

IsBigEndianMacroBasedFunction · 0.85
ReverseByteOrderFunction · 0.85
resizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected