Derecho  0.9
Distributed systems toolkit for RDMA
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
objectstore::Blob Class Reference

#include <Object.hpp>

Inheritance diagram for objectstore::Blob:
Inheritance graph
[legend]
Collaboration diagram for objectstore::Blob:
Collaboration graph
[legend]

Public Member Functions

 Blob (const char *const b, const decltype(size) s)
 
 Blob (const Blob &other)
 
 Blob (Blob &&other)
 
 Blob ()
 
virtual ~Blob ()
 
Bloboperator= (Blob &&other)
 
Bloboperator= (const Blob &other)
 
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...
 
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. More...
 
void ensure_registered (mutils::DeserializationManager &)
 
mutils::context_ptr< Blobfrom_bytes_noalloc (mutils::DeserializationManager *ctx, const char *const v, mutils::context_ptr< Blob >=mutils::context_ptr< Blob >{})
 
- Public Member Functions inherited from mutils::ByteRepresentable
virtual ~ByteRepresentable ()
 

Static Public Member Functions

static std::unique_ptr< Blobfrom_bytes (mutils::DeserializationManager *, const char *const v)
 

Public Attributes

char * bytes
 
std::size_t size
 

Detailed Description

Definition at line 26 of file Object.hpp.

Constructor & Destructor Documentation

◆ Blob() [1/4]

objectstore::Blob::Blob ( const char *const  b,
const decltype(size s 
)

Definition at line 5 of file Object.cpp.

◆ Blob() [2/4]

objectstore::Blob::Blob ( const Blob other)

Definition at line 14 of file Object.cpp.

◆ Blob() [3/4]

objectstore::Blob::Blob ( Blob &&  other)

Definition at line 23 of file Object.cpp.

◆ Blob() [4/4]

objectstore::Blob::Blob ( )

Definition at line 29 of file Object.cpp.

◆ ~Blob()

objectstore::Blob::~Blob ( )
virtual

Definition at line 31 of file Object.cpp.

Member Function Documentation

◆ bytes_size()

std::size_t objectstore::Blob::bytes_size ( ) const
virtual

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 67 of file Object.cpp.

◆ ensure_registered()

void objectstore::Blob::ensure_registered ( mutils::DeserializationManager )
inline

Definition at line 59 of file Object.hpp.

◆ from_bytes()

std::unique_ptr< Blob > objectstore::Blob::from_bytes ( mutils::DeserializationManager ,
const char *const  v 
)
static

Definition at line 81 of file Object.cpp.

◆ from_bytes_noalloc()

mutils::context_ptr< Blob > objectstore::Blob::from_bytes_noalloc ( mutils::DeserializationManager ctx,
const char *const  v,
mutils::context_ptr< Blob = mutils::context_ptr<Blob>{} 
)

Definition at line 77 of file Object.cpp.

◆ operator=() [1/2]

Blob & objectstore::Blob::operator= ( Blob &&  other)

Definition at line 35 of file Object.cpp.

◆ operator=() [2/2]

Blob & objectstore::Blob::operator= ( const Blob other)

Definition at line 45 of file Object.cpp.

◆ post_object()

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

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 71 of file Object.cpp.

◆ to_bytes()

std::size_t objectstore::Blob::to_bytes ( char *  v) const
virtual

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 59 of file Object.cpp.

Member Data Documentation

◆ bytes

char* objectstore::Blob::bytes

Definition at line 28 of file Object.hpp.

◆ size

std::size_t objectstore::Blob::size

Definition at line 29 of file Object.hpp.


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