|
JSON Voorhees
Killer JSON for C++
|
A base for serializers written against the older value -based interface.
More...
#include <jsonv/serialization/serializer_for.hpp>
Inheritance diagram for jsonv::value_serializer_for< T >:
Collaboration diagram for jsonv::value_serializer_for< T >:Protected Member Functions | |
| virtual void | serialize (const serialization_context &context, const T &from, writer &to) const final override |
| Write from into to. | |
| virtual value | to_json (const serialization_context &context, const T &from) const =0 |
Convert from into a value. | |
Additional Inherited Members | |
Public Member Functions inherited from jsonv::serializer_for< T > | |
| virtual const std::type_info & | get_type () const noexcept override |
| virtual void | serialize (const serialization_context &context, const void *from, writer &to) const override |
A base for serializers written against the older value -based interface.
The value the subclass's to_json builds is written whole into the writer with writer::write. This costs the tree the writer exists to avoid – so it is a stepping stone for ports, not a destination. New serializers should derive from serializer_for and write into the writer.
Definition at line 61 of file serializer_for.hpp.
|
inlinefinaloverrideprotectedvirtual |
Write from into to.
Implements jsonv::serializer_for< T >.
Definition at line 65 of file serializer_for.hpp.
Here is the call graph for this function:
|
protectedpure virtual |
Convert from into a value.
| context | Extra information to help you encode sub-objects for your type, such as the ability to find other formats. |
| from | The value to convert. |