#include <ozo/io/recv.h>
Defines how to receive an object from an input stream.
This functor is used to deserialize object as query result.
Out | — type of an object to apply to |
<anonymous> | — SFINAE-based overloading parameter. |
The default implementation uses ozo::read
function to deserialize simple objects like integers or strings. For the #DynamicSize objects method resize()
will be called. So if your special implementation of #DynamicSize type object does not have such method, you need to specialize this template for the type to resize it to fit the incoming size (see the example below). For the #StaticSize objects size check will be made. In case of incoming size does not equal to value returned by ozo::size_of()
for the object — std::range_error
will be thrown.
To deserialize complex types like Array or Composite special internal implementations are used.
This template is a customization point for specializing deserialization for user defined types if it can not be obtained via the library. Typically user does not need it.
File MyString.h
File MyStringOzoAdaptor.h
Static Public Member Functions | |
template<typename OidMap > | |
static istream & | apply (istream &in, size_type size, const OidMap &, Out &out) |
Implementation of deserialization object from a stream. More... | |
|
static |
Implementation of deserialization object from a stream.
in | — input stream |
size | — size of incoming data |
OidMap | — #OidMap to get oid for custom types |
out | — object to deserialize |
References ozo::error::bad_object_size, and ozo::size_of().