BinarySerializerContext Class Reference
|
CPP API
|
mio::BinarySerializerContext Class Reference
Serializes objects in binary format. More...
#include <binary_serializer.h>
Inheritance diagram for mio::BinarySerializerContext:
Collaboration diagram for mio::BinarySerializerContext:
Public Member Functions | |
| BinarySerializerContext (ByteStream &stream, std::shared_ptr< IOStatus > status, int flags) | |
| BinarySerializerObject | create_object (const std::string &type) |
| Begin serialization of a new object. More... | |
| BinarySerializerObject | expect_object (const std::string &type) |
| Begin deserialization of an object. More... | |
Public Member Functions inherited from mio::SerializerBase | |
| int | flags () const |
| Flags that determine the behavior of serialization. More... | |
| SerializerBase (std::shared_ptr< IOStatus > status, int flags) | |
| Constructor that sets status and flags. More... | |
| void | set_error (const IOStatus &status) |
| Set the current status of serialization. More... | |
| void | set_flags (int f) |
| Set flags that determine the behavior of serialization. More... | |
| const IOStatus & | status () const |
| The current status of serialization. More... | |
Private Attributes | |
| ByteStream & | m_stream |
| Reference to a stream that stores the serialized bytes. More... | |
Friends | |
| template<class T > | |
| requires std::is_trivial_v< T > friend IOResult< T > | deserialize_internal (BinarySerializerContext &ctxt, Tag< T > tag) |
| Deserialize "naked" ints, etc. More... | |
| template<class T > | |
| requires std::is_trivial_v< T > friend void | serialize_internal (BinarySerializerContext &ctxt, const T &t) |
| Serialize "naked" ints, etc. More... | |
Additional Inherited Members | |
Protected Attributes inherited from mio::SerializerBase | |
| int | m_flags |
| std::shared_ptr< IOStatus > | m_status |
Detailed Description
Serializes objects in binary format.
See io.h for documentation of serialization.
Constructor & Destructor Documentation
◆ BinarySerializerContext()
|
inline |
Member Function Documentation
◆ create_object()
|
inline |
Begin serialization of a new object.
- Parameters
-
type Name of the type of the object. Only used if flag IOF_IncludeTypeInfo is set.
◆ expect_object()
|
inline |
Begin deserialization of an object.
- Parameters
-
type Name of the type of the object. Only used if flag IOF_IncludeTypeInfo is set.
Friends And Related Function Documentation
◆ deserialize_internal
template<class T >
|
friend |
Deserialize "naked" ints, etc.
that are not contained in a complex object hierarchy.
- Parameters
-
ctxt The serialization context. tag The value to be serialized.
- Returns
- The deserialized value.
◆ serialize_internal
template<class T >
|
friend |
Serialize "naked" ints, etc.
that are not contained in a complex object hierarchy, because they don't have an object that they can be added to.
- Parameters
-
ctxt The serialization context. t The value to be serialized.
Member Data Documentation
◆ m_stream
|
private |
Reference to a stream that stores the serialized bytes.
Generated by
Public Member Functions inherited from