pstore2
Classes | Functions
pstore::serialize::archive Namespace Reference

Contains the serialization archive types. More...

Classes

class  buffer_reader
 An archive-reader which consumes data from a supplied pointer range. More...
 
class  buffer_writer
 
class  database_reader
 An archive-reader which reads data from a database. More...
 
class  database_writer
 
class  null
 An archive-writer which simply discards any data that it writes. More...
 
class  range_reader
 An archive-reader which consumes data from an iterator. More...
 
class  vector_writer
 An archive-writer which writes data to a std::vector of std::uint8_t bytes. More...
 
struct  void_type
 The archiver put() and [optional] putn() methods can optionally return a value to the caller. More...
 
class  writer_base
 The base class for archive-writer objects. More...
 

Functions

auto make_writer (transaction_base &transaction) noexcept -> database_writer
 A convenience function which simplifies the construction of a database_writer instance if the caller has an existing transaction object. More...
 
database_reader make_reader (pstore::database const &db, pstore::address const addr) noexcept
 A convenience function which provides symmetry with the make_writer() function. More...
 
template<typename T >
auto unsigned_cast (T const &t) -> typename std::make_unsigned< T >::type
 
std::ostream & operator<< (std::ostream &os, vector_writer const &writer)
 Writes the contents of a vector_writer object to an ostream as a stream of space-separated two-digit hexadecimal values. More...
 
std::ostream & operator<< (std::ostream &os, buffer_writer const &writer)
 Writes the contents of a buffer_writer object to an ostream as a stream of space-separated two-digit hexadecimal values. More...
 
template<typename InputIterator >
range_reader< InputIterator > make_reader (InputIterator first)
 Constructs an archive-reader which will read from an iterator. More...
 

Detailed Description

Contains the serialization archive types.

Containts the serialization archive types.

Function Documentation

◆ make_reader() [1/2]

database_reader pstore::serialize::archive::make_reader ( pstore::database const &  db,
pstore::address const  addr 
)
inlinenoexcept

A convenience function which provides symmetry with the make_writer() function.

Constructs a database reader using an input database and an address.

Parameters
dbThe database from which data will be read.
addrThe address at which to start reading.
Returns
A database reader instance which will read the given database at the specified address.

◆ make_reader() [2/2]

template<typename InputIterator >
range_reader<InputIterator> pstore::serialize::archive::make_reader ( InputIterator  first)

Constructs an archive-reader which will read from an iterator.

Parameters
firstThe iterator from which bytes will be read.
Returns
Returns an instance of range_reader which will consume bytes from the iterator.

◆ make_writer()

auto pstore::serialize::archive::make_writer ( transaction_base transaction) -> database_writer
inlinenoexcept

A convenience function which simplifies the construction of a database_writer instance if the caller has an existing transaction object.

Parameters
transactionThe transaction to which the database_writer will append.

◆ operator<<() [1/2]

std::ostream & pstore::serialize::archive::operator<< ( std::ostream &  os,
vector_writer const &  writer 
)

Writes the contents of a vector_writer object to an ostream as a stream of space-separated two-digit hexadecimal values.

Parameters
osThe output stream to which output will be written.
writerThe vector_writer whose contents are to be dumped to the output stream.
Returns
The value passed as the 'os' parameter.

◆ operator<<() [2/2]

std::ostream & pstore::serialize::archive::operator<< ( std::ostream &  os,
buffer_writer const &  writer 
)

Writes the contents of a buffer_writer object to an ostream as a stream of space-separated two-digit hexadecimal values.

Parameters
osThe output stream to which output will be written.
writerThe buffer_writer whose contents are to be dumped to the output stream.
Returns
The value passed as the 'os' parameter.