MCPcopy Create free account
hub / github.com/COVESA/vsomeip / parse

Function parse

implementation/protocol/include/deserialize.hpp:26–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24
25template<typename... Ts>
26uint32_t parse(unsigned char const* _mem, uint32_t _size, Ts&... _ts) {
27 uint32_t parsed{0};
28 auto checked_parse = [&](auto& _out) {
29 auto const result = from_mem(_mem, _size, _out);
30 if (result == 0) {
31 return false;
32 }
33 parsed += result;
34 _mem += result;
35 _size -= result;
36 return true;
37 };
38 return (checked_parse(_ts) && ...) ? parsed : 0;
39}
40
41inline uint32_t deserialize(const byte_t* _data, uint32_t _size, command_header& _out) {
42 return parse(_data, _size, _out.id_, _out.version_, _out.client_, _out.length_);

Callers 1

deserializeFunction · 0.70

Calls 1

from_memFunction · 0.85

Tested by

no test coverage detected