JSON Voorhees
Killer JSON for C++
jsonv::extractor Class Referenceabstract

An extractor holds the method for converting a value into an arbitrary C++ type. More...

#include <jsonv/serialization.hpp>

+ Inheritance diagram for jsonv::extractor:

Public Member Functions

virtual const std::type_info & get_type () const =0
 Get the run-time type this extractor knows how to extract. More...
 
virtual void extract (const extraction_context &context, const value &from, void *into) const =0
 Extract a the type from a value into a region of memory. More...
 

Detailed Description

An extractor holds the method for converting a value into an arbitrary C++ type.

Definition at line 208 of file serialization.hpp.

Member Function Documentation

virtual void jsonv::extractor::extract ( const extraction_context context,
const value from,
void *  into 
) const
pure virtual

Extract a the type from a value into a region of memory.

Parameters
contextExtra information to help you decode sub-objects, such as looking up other formats. It also tracks your path in the decoding heirarchy, so any exceptions thrown will have path information in the error message.
fromThe JSON value to extract something from.
intoThe region of memory to create the extracted object in. There will always be enough room to create your object and the alignment of the pointer should be correct (assuming a working alignof implementation).

Implemented in jsonv::adapter_for< T >, jsonv::adapter_for< TEnum >, jsonv::adapter_for< TPointer >, jsonv::adapter_for< TContainer >, jsonv::adapter_for< TOptional >, jsonv::adapter_for< optional< T > >, jsonv::adapter_for< TWrapper >, jsonv::extractor_for< T >, and jsonv::extractor_construction< T >.

virtual const std::type_info& jsonv::extractor::get_type ( ) const
pure virtual

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