Anklang C++ API 0.0.0
Loading...
Searching...
No Matches
Serializable< T >final

#include "jsonipc.hh"

Inheritance diagram for Serializable< T >:
[legend]

Public Member Functions

Serializable ()
template<typename A , REQUIRES< std::is_member_object_pointer< A >::value > = true>
Serializable &set (const char *name, A attribute)

Static Public Member Functions

static boolis_serializable ()
static std::shared_ptr< T >serialize_from_json (const JsonValue &value, const std::shared_ptr< T > &p=0)
static JsonValueserialize_to_json (const T &o, JsonAllocator &a)

Additional Inherited Members

- Protected Member Functions inherited from TypeInfo
voidprint (ClassPrinter::Op op, const std::string &name, int32_t count=0, const DefaultsList &dflts={})
TypeInfo (ClassPrinter *printer)
virtual~TypeInfo ()
- Protected Attributes inherited from TypeInfo
ClassPrinter *printer_

Detailed Description

template<typename T>
struct Jsonipc::Serializable< T >

Jsonipc wrapper type for objects that support field-wise serialization to/from JSON.

Constructor & Destructor Documentation

Serializable()

template<typename T >
Serializable ( )

Allow object handles to be streamed to/from Javascript, needs a Scope for temporaries.

Member Function Documentation

set()

template<typename T >
template<typename A , REQUIRES< std::is_member_object_pointer< A >::value > = true>
Serializable & set ( const char * name,
A attribute
)

Add a member object pointer.

is_serializable()

template<typename T >
static bool is_serializable ( )
static

serialize_to_json()

template<typename T >
static JsonValue serialize_to_json ( const T & o,
JsonAllocator & a
)
static

serialize_from_json()

template<typename T >
static std::shared_ptr< T > serialize_from_json ( const JsonValue & value,
const std::shared_ptr< T > & p = 0
)
static