A helper class which can be used to emit containers which have a size() method and which support the requirements for range-based 'for'.
More...
#include <standard_types.hpp>
|
|
using | insert_callback = std::function< void(typename Container::value_type const &)> |
| |
|
| template<typename Archive > |
| static auto | write (Archive &&archive, Container const &ty) -> archive_result_type< Archive > |
| | Writes the contents of a container to an archive. More...
|
| |
| template<typename Archive > |
| static void | read (Archive &&archive, insert_callback inserter) |
| | Reads the contents of a container from an archive. More...
|
| |
template<typename Container>
struct pstore::serialize::container_archive_helper< Container >
A helper class which can be used to emit containers which have a size() method and which support the requirements for range-based 'for'.
◆ read()
template<typename Container >
template<typename Archive >
Reads the contents of a container from an archive.
Reads a std::size_t value – the number of following elements – and an array of Container::vaue_type elements. For each element, the inserter function is invoked: it is passed the container and value to be inserted. Its job is simply to insert the value into the given container.
- Parameters
-
| archive | The archive from which the container will be read. |
| inserter | A function which is responsible for inserting each of the Container::value_type elements from the archive into the container. |
◆ write()
template<typename Container >
template<typename Archive >
Writes the contents of a container to an archive.
Writes an initial std::size_t value with the number of elements in the container followed by an array of of those elements, in the order returned by iteration.
- Parameters
-
| archive | The archive to which the container is to be serialized. |
| ty | The container whose contents are to be written. |
The documentation for this struct was generated from the following file: