MCPcopy Create free account
hub / github.com/actor-framework/actor-framework / encode

Function encode

libcaf_net/caf/net/lp/framing.test.cpp:169–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167};
168
169auto encode(std::string_view msg) {
170 byte_buffer bytes;
171 using detail::to_network_order;
172 auto prefix = to_network_order(static_cast<uint32_t>(msg.size()));
173 auto prefix_bytes = as_bytes(make_span(&prefix, 1));
174 bytes.insert(bytes.end(), prefix_bytes.begin(), prefix_bytes.end());
175 auto msg_bytes = as_bytes(make_span(msg));
176 bytes.insert(bytes.end(), msg_bytes.begin(), msg_bytes.end());
177 return bytes;
178}
179
180} // namespace
181

Callers 5

WITH_FIXTUREFunction · 0.70
framing.test.cppFile · 0.70
response_keyMethod · 0.50
write_http_1_requestMethod · 0.50

Calls 7

to_network_orderFunction · 0.85
as_bytesFunction · 0.85
make_spanFunction · 0.85
sizeMethod · 0.45
insertMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected