JSON Voorhees
Killer JSON for C++
|
An extractor
holds the method for converting a value
into an arbitrary C++ type.
More...
#include <jsonv/serialization.hpp>
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... | |
An extractor
holds the method for converting a value
into an arbitrary C++ type.
Definition at line 208 of file serialization.hpp.
|
pure virtual |
Extract a the type from a value
into a region of memory.
context | Extra 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. |
from | The JSON value to extract something from. |
into | The 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 >.
|
pure virtual |
Get the run-time type this extractor
knows how to extract.
Once this extractor
is registered with a formats
, it is not allowed to change.
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 >.