Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
buffered_snapshot_suite Struct Reference

#include <snapshot_suites.hpp>

Classes

struct  reader
 
struct  writer
 

Public Types

using writer_t = ostream_snapshot_writer
 
using reader_t = istream_snapshot_reader
 
using write_storage_t = std::ostringstream
 
using snapshot_t = std::string
 
using read_storage_t = std::istringstream
 

Static Public Member Functions

static auto get_writer ()
 
static auto finalize (const std::shared_ptr< writer > &w)
 
static auto get_reader (const snapshot_t &buffer)
 
static snapshot_t load_from_file (const std::string &filename)
 
static void write_to_file (const std::string &basename, const snapshot_t &snapshot)
 

Detailed Description

Definition at line 57 of file snapshot_suites.hpp.

Member Typedef Documentation

◆ read_storage_t

using buffered_snapshot_suite::read_storage_t = std::istringstream

Definition at line 62 of file snapshot_suites.hpp.

◆ reader_t

◆ snapshot_t

Definition at line 61 of file snapshot_suites.hpp.

◆ write_storage_t

using buffered_snapshot_suite::write_storage_t = std::ostringstream

Definition at line 60 of file snapshot_suites.hpp.

◆ writer_t

Member Function Documentation

◆ finalize()

static auto buffered_snapshot_suite::finalize ( const std::shared_ptr< writer > & w)
inlinestatic

Definition at line 89 of file snapshot_suites.hpp.

89 {
90 w->finalize();
91 return w->storage->str();
92 }

◆ get_reader()

static auto buffered_snapshot_suite::get_reader ( const snapshot_t & buffer)
inlinestatic

Definition at line 94 of file snapshot_suites.hpp.

94 {
95 return std::make_shared<reader>(std::make_shared<read_storage_t>(buffer));
96 }

◆ get_writer()

static auto buffered_snapshot_suite::get_writer ( )
inlinestatic

Definition at line 85 of file snapshot_suites.hpp.

85 {
86 return std::make_shared<writer>(std::make_shared<write_storage_t>());
87 }

◆ load_from_file()

static snapshot_t buffered_snapshot_suite::load_from_file ( const std::string & filename)
inlinestatic

Definition at line 98 of file snapshot_suites.hpp.

98 {
99 snapshot_input_file<snapshot::binary> file(filename);
100 return file.read_as_string();
101 }

◆ write_to_file()

static void buffered_snapshot_suite::write_to_file ( const std::string & basename,
const snapshot_t & snapshot )
inlinestatic

Definition at line 103 of file snapshot_suites.hpp.

103 {
104 snapshot_output_file<snapshot::binary> file(basename);
105 file.write<snapshot_t>(snapshot);
106 }

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