Cbeam
Loading...
Searching...
No Matches
cbeam::json::traits< T > Struct Template Reference

Defines the traits required for serializing and deserializing objects of type T. More...

#include <traits.hpp>

Static Public Member Functions

static void serialize (const T &val, container::buffer &stream)
 Required to serialize an object of type T into a shared_buffer stream.
 

Detailed Description

template<typename T>
struct cbeam::json::traits< T >

Defines the traits required for serializing and deserializing objects of type T.

This struct declares static methods as templates for serializing and deserializing objects. The default implementation is applicable for types that are both standard-layout and trivial. For types that do not meet these criteria, a specialized implementation of these methods must be provided to accommodate type-specific serialization behavior.

Member Function Documentation

◆ serialize()

template<typename T>
static void cbeam::json::traits< T >::serialize ( const T & val,
container::buffer & stream )
inlinestatic

Required to serialize an object of type T into a shared_buffer stream.

Parameters
valueThe object to serialize.
streamThe shared_buffer stream into which the object is serialized.

This method should take an object of type T and serialize it into a container::buffer stream. by using its append method.


The documentation for this struct was generated from the following file: