3 #include "../mutils-networking/connection.hpp" 17 Bytes(decltype(bytes) b, decltype(size) s)
21 ((std::size_t*)(v))[0] = size;
22 memcpy(v +
sizeof(size),bytes,size);
23 return size +
sizeof(
size);
27 return size +
sizeof(
size);
30 void post_object(
const std::function<
void (
char const *
const,std::size_t)>& f)
const{
31 f((
char*)&size,
sizeof(size));
38 template<
typename T,
typename V>
40 static_assert(std::is_same<T,V>::value,
"Error: from_bytes disabled for mutils::Bytes. See comment in source.");
static context_ptr< Bytes > from_bytes_noalloc(DeserializationManager *, char const *const v)
void ensure_registered(DeserializationManager &)
A non-POD type which wishes to mark itself byte representable should extend this class.
std::unique_ptr< T, ContextDeleter< T > > context_ptr
The manager for any RemoteDeserializationContexts.
std::size_t to_bytes(char *v) const
Write this class's marshalled representation into the array found at v.
void post_object(const std::function< void(char const *const, std::size_t)> &f) const
Pass a pointer to a buffer containing this class's marshalled representation into the function f...
static std::unique_ptr< Bytes > from_bytes(T *, V *)
Bytes(decltype(bytes) b, decltype(size) s)
std::size_t bytes_size() const
the size of the marshalled representation of this object.