JSON Voorhees
Killer JSON for C++
Loading...
Searching...
No Matches
jsonv::container_adapter< TContainer > Class Template Reference

An adapter for container types. More...

#include <jsonv/serialization/container_adapter.hpp>

+ Inheritance diagram for jsonv::container_adapter< TContainer >:
+ Collaboration diagram for jsonv::container_adapter< TContainer >:

Protected Member Functions

virtual TContainer create (const extraction_context &context, const value &from) const override
 
virtual value to_json (const serialization_context &context, const TContainer &from) const override
 

Additional Inherited Members

- Public Member Functions inherited from jsonv::adapter_for< TContainer >
virtual const std::type_info & get_type () const override
 Get the run-time type this extractor knows how to extract.
 
virtual void extract (const extraction_context &context, const value &from, void *into) const override
 Extract a the type from a value into a region of memory.
 
virtual value to_json (const serialization_context &context, const void *from) const override
 Create a value from the value in the given region of memory.
 

Detailed Description

template<typename TContainer>
class jsonv::container_adapter< TContainer >

An adapter for container types.

This is for convenience of creating an adapter for things like std::vector, std::set and such.

Template Parameters
TContaineris the container to create and encode. It must have a member type value_type, support iteration and an insert operation.

Definition at line 29 of file container_adapter.hpp.

Member Function Documentation

◆ create()

template<typename TContainer >
virtual TContainer jsonv::container_adapter< TContainer >::create ( const extraction_context context,
const value from 
) const
inlineoverrideprotectedvirtual

Implements jsonv::adapter_for< TContainer >.

Definition at line 35 of file container_adapter.hpp.

◆ to_json()

template<typename TContainer >
virtual value jsonv::container_adapter< TContainer >::to_json ( const serialization_context context,
const TContainer from 
) const
inlineoverrideprotectedvirtual

Implements jsonv::adapter_for< TContainer >.

Definition at line 46 of file container_adapter.hpp.


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