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

Function split

libcaf_net/caf/net/lp/framing.cpp:27–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25namespace {
26
27std::pair<size_t, byte_span> split(byte_span buffer) noexcept {
28 CAF_ASSERT(buffer.size() >= sizeof(uint32_t));
29 auto u32_size = uint32_t{0};
30 memcpy(&u32_size, buffer.data(), sizeof(uint32_t));
31 auto msg_size = static_cast<size_t>(detail::from_network_order(u32_size));
32 return std::make_pair(msg_size, buffer.subspan(sizeof(uint32_t)));
33}
34
35class framing_impl : public framing {
36public:

Callers 6

consumeMethod · 0.70
client_replFunction · 0.50
client_replFunction · 0.50
client_replFunction · 0.50
sendChatMessageMethod · 0.50

Calls 4

from_network_orderFunction · 0.85
subspanMethod · 0.80
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected