Derecho  0.9
Distributed systems toolkit for RDMA
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
VariableBytes Class Reference
Inheritance diagram for VariableBytes:
Inheritance graph
[legend]
Collaboration diagram for VariableBytes:
Collaboration graph
[legend]

Public Member Functions

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

Static Public Member Functions

static std::unique_ptr< VariableBytesfrom_bytes (DeserializationManager *dsm, char const *const v)
 

Public Attributes

std::size_t data_len
 
char buf [MAX_VB_SIZE]
 

Detailed Description

Definition at line 39 of file test.cpp.

Constructor & Destructor Documentation

◆ VariableBytes()

VariableBytes::VariableBytes ( )
inline

Definition at line 44 of file test.cpp.

Member Function Documentation

◆ bytes_size()

virtual std::size_t VariableBytes::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 57 of file test.cpp.

◆ ensure_registered()

virtual void VariableBytes::ensure_registered ( DeserializationManager dsm)
inlinevirtual

Definition at line 61 of file test.cpp.

◆ from_bytes()

static std::unique_ptr<VariableBytes> VariableBytes::from_bytes ( DeserializationManager dsm,
char const *const  v 
)
inlinestatic

Definition at line 69 of file test.cpp.

◆ post_object()

virtual void VariableBytes::post_object ( const std::function< void(char const *const, std::size_t)> &  ) const
inlinevirtual

Pass a pointer to a buffer containing this class's marshalled representation into the function f.

This pointer is not guaranteed to live beyond the duration of the call to f, so make a copy if you need to keep it around.

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

Implements mutils::ByteRepresentable.

Definition at line 53 of file test.cpp.

◆ to_bytes()

virtual std::size_t VariableBytes::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 48 of file test.cpp.

◆ to_string()

virtual std::string VariableBytes::to_string ( )
inlinevirtual

Definition at line 65 of file test.cpp.

Member Data Documentation

◆ buf

char VariableBytes::buf[MAX_VB_SIZE]

Definition at line 42 of file test.cpp.

◆ data_len

std::size_t VariableBytes::data_len

Definition at line 41 of file test.cpp.


The documentation for this class was generated from the following file: