pstore2
Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
pstore::serialize::archive::writer_base< WriterPolicy > Class Template Reference

The base class for archive-writer objects. More...

#include <archive.hpp>

Public Types

using policy_type = WriterPolicy
 
using result_type = typename policy_type::result_type
 

Public Member Functions

 writer_base (writer_base const &)=delete
 
 writer_base (writer_base &&) noexcept=default
 
writer_baseoperator= (writer_base &&) noexcept=default
 
writer_baseoperator= (writer_base const &)=delete
 
void flush ()
 Flushes the stream to the output.
 
std::size_t bytes_consumed () const
 Returns the number of bytes that have been written via this archive.
 
std::size_t bytes_produced () const
 Returns the number of bytes that the policy object wrote to its final destination. More...
 
template<typename Ty >
auto put (Ty const &t) -> result_type
 Writes one or more instances of a standard-layout type Ty to the output. Must not be used once the stream has been flushed. More...
 
template<typename Span >
auto putn (Span sp) -> result_type
 Writes a span of values to the output. More...
 
WriterPolicy & writer_policy () noexcept
 
WriterPolicy const & writer_policy () const noexcept
 

Protected Member Functions

 writer_base (WriterPolicy policy=WriterPolicy())
 

Detailed Description

template<typename WriterPolicy>
class pstore::serialize::archive::writer_base< WriterPolicy >

The base class for archive-writer objects.

Member Function Documentation

◆ bytes_produced()

template<typename WriterPolicy>
std::size_t pstore::serialize::archive::writer_base< WriterPolicy >::bytes_produced ( ) const
inline

Returns the number of bytes that the policy object wrote to its final destination.

◆ put()

template<typename WriterPolicy>
template<typename Ty >
auto pstore::serialize::archive::writer_base< WriterPolicy >::put ( Ty const &  t) -> result_type
inline

Writes one or more instances of a standard-layout type Ty to the output. Must not be used once the stream has been flushed.

Parameters
tThe value to be written to the output.

◆ putn()

template<typename WriterPolicy>
template<typename Span >
auto pstore::serialize::archive::writer_base< WriterPolicy >::putn ( Span  sp) -> result_type
inline

Writes a span of values to the output.

This will call either the put() or putn() method on the archive type depending on whether the latter is available.

Parameters
spThe span of values to be written.
Returns
The value returned by the archive putn() function.

◆ writer_policy()

template<typename WriterPolicy>
WriterPolicy& pstore::serialize::archive::writer_base< WriterPolicy >::writer_policy ( )
inlinenoexcept

Returns the writer_base output policy object.


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