32 Blob(
const char*
const b,
const decltype(size) s);
57 void post_object(
const std::function<
void(
char const*
const, std::size_t)>& f)
const;
71 #define INV_OID (0xffffffffffffffffLLU) 75 mutable std::tuple<persistent::version_t,uint64_t>
ver;
81 bool is_valid()
const;
87 Object(
const std::tuple<persistent::version_t,uint64_t> _ver,
const OID& _oid,
const Blob& _blob);
90 Object(
const uint64_t _oid,
const char*
const _b,
const std::size_t _s);
93 Object(
const std::tuple<persistent::version_t,uint64_t> _ver,
const uint64_t _oid,
const char*
const _b,
const std::size_t _s);
110 out <<
"[size:" << b.
size <<
", data:" << std::hex;
113 for(i = 0; i < 8 && i < b.
size; i++) {
114 out <<
" " << b.
bytes[i];
120 out << std::dec <<
"]";
125 out <<
"Object{ver: 0x" << std::hex << std::get<0>(o.
ver) << std::dec
126 <<
", ts: " << std::get<1>(o.
ver) <<
", id:" 127 << o.
oid <<
", data:" << o.
blob <<
"}";
std::enable_if_t< std::is_base_of< ByteRepresentable CMA T >::value, std::unique_ptr< T > > from_bytes(DeserializationManager *ctx, char const *v)
Calls T::from_bytes(ctx,v) when T is a ByteRepresentable.
This file include all common types internal to derecho and not necessarily being known by a client pr...
std::enable_if_t< std::is_base_of< ByteRepresentable CMA std::decay_t< T > >::value, context_ptr< T > > from_bytes_noalloc(DeserializationManager *ctx, const char *v, context_ptr< std::decay_t< T >>=context_ptr< std::decay_t< T >>{})
Calls T::from_bytes_noalloc(ctx,v) when T is a ByteRepresentable.
#define DEFAULT_SERIALIZATION_SUPPORT(CLASS_NAME, CLASS_MEMBERS...)
THIS (below) is the only user-facing macro in this file.
A non-POD type which wishes to mark itself byte representable should extend this class.
auto bytes_size(const T &)
Just calls sizeof(T)
std::unique_ptr< T, ContextDeleter< T > > context_ptr
The manager for any RemoteDeserializationContexts.
bool operator==(const Opcode &lhs, const Opcode &rhs)
std::tuple< persistent::version_t, uint64_t > ver
std::ostream & operator<<(std::ostream &out, const Object &o)
std::enable_if_t< std::is_pod< BR >::value > post_object(const F &f, const BR &br, Args &&... args)
In-place serialization is also sometimes possible.
std::size_t to_bytes(const ByteRepresentable &b, char *v)
calls b.to_bytes(v) when b is a ByteRepresentable; calls std::memcpy() when b is POD.
void ensure_registered(mutils::DeserializationManager &)