Derecho  0.9
Distributed systems toolkit for RDMA
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
mutils::marshalled Struct Reference

The "marshalled" type is a wrapper for already-serialized types;. More...

#include <SerializationSupport.hpp>

Inheritance diagram for mutils::marshalled:
Inheritance graph
[legend]
Collaboration diagram for mutils::marshalled:
Collaboration graph
[legend]

Public Member Functions

 marshalled (decltype(size) size, decltype(data) data)
 
std::size_t to_bytes (char *v) const
 Write this class's marshalled representation into the array found at v. More...
 
std::size_t bytes_size () const
 the size of the marshalled representation of this object. More...
 
- Public Member Functions inherited from mutils::ByteRepresentable
virtual void post_object (const std::function< void(char const *const, std::size_t)> &) const =0
 Pass a pointer to a buffer containing this class's marshalled representation into the function f. More...
 
virtual ~ByteRepresentable ()
 

Static Public Member Functions

template<typename DSM >
static std::unique_ptr< marshalledfrom_bytes (DSM const *const, char const *const)
 
static context_ptr< marshalledfrom_bytes_noalloc (DeserializationManager const *const, char *v)
 

Public Attributes

const std::size_t size
 
char const *const data
 

Detailed Description

The "marshalled" type is a wrapper for already-serialized types;.

Definition at line 422 of file SerializationSupport.hpp.

Constructor & Destructor Documentation

◆ marshalled()

mutils::marshalled::marshalled ( decltype(size size,
decltype(data data 
)
inline

Definition at line 426 of file SerializationSupport.hpp.

Member Function Documentation

◆ bytes_size()

std::size_t mutils::marshalled::bytes_size ( ) const
inlinevirtual

the size of the marshalled representation of this object.

useful when allocating arrays in which to store this object.

NOTE: it is recommended that users not call this directly, and prefer to use mutils::bytes_size(T,v) instead.

Implements mutils::ByteRepresentable.

Definition at line 434 of file SerializationSupport.hpp.

◆ from_bytes()

template<typename DSM >
static std::unique_ptr<marshalled> mutils::marshalled::from_bytes ( DSM const *  const,
char const *  const 
)
inlinestatic

Definition at line 443 of file SerializationSupport.hpp.

◆ from_bytes_noalloc()

context_ptr< marshalled > mutils::marshalled::from_bytes_noalloc ( DeserializationManager const * const  ,
char *  v 
)
static

Definition at line 31 of file SerializationSupport.cpp.

◆ to_bytes()

std::size_t mutils::marshalled::to_bytes ( char *  v) const
inlinevirtual

Write this class's marshalled representation into the array found at v.

assume v has at least bytes_size() of free memory available; behavior is undefined otherwise.

Returns number of bytes written, which should be the same as bytes_size().

NOTE: it is recommended that users not call this directly, and prefer to use mutils::to_bytes(T,v) instead.

Implements mutils::ByteRepresentable.

Definition at line 429 of file SerializationSupport.hpp.

Member Data Documentation

◆ data

char const* const mutils::marshalled::data

Definition at line 424 of file SerializationSupport.hpp.

◆ size

const std::size_t mutils::marshalled::size

Definition at line 423 of file SerializationSupport.hpp.


The documentation for this struct was generated from the following files: