5 Blob::Blob(
const char*
const b,
const decltype(size) s) :
6 bytes(nullptr), size(0) {
25 other.bytes =
nullptr;
36 char* swp_bytes = other.
bytes;
37 std::size_t swp_size = other.size;
46 if(
bytes !=
nullptr) {
60 ((std::size_t*)(v))[0] =
size;
71 void Blob::post_object(
const std::function<
void(
char const*
const, std::size_t)>& f)
const {
72 f((
char*)&
size,
sizeof(size));
82 return std::make_unique<Blob>(v +
sizeof(std::size_t), ((std::size_t*)(v))[0]);
87 return (this->oid == other.
oid) && (this->ver == other.
ver);
106 Object::Object(
const std::tuple<persistent::version_t,uint64_t> _ver,
const uint64_t _oid,
const char*
const _b,
const std::size_t _s) :
ver(_ver),
oid(_oid),
blob(_b, _s) {}
mutils::context_ptr< Blob > from_bytes_noalloc(mutils::DeserializationManager *ctx, const char *const v, mutils::context_ptr< Blob >=mutils::context_ptr< Blob >{})
std::size_t bytes_size() const
the size of the marshalled representation of this object.
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.
bool operator==(const Object &other)
std::tuple< persistent::version_t, uint64_t > ver
Blob & operator=(Blob &&other)
static std::unique_ptr< Blob > from_bytes(mutils::DeserializationManager *, const char *const 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...