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

#include <snapshot_suites.hpp>

Classes

struct  reader
 
struct  writer
 

Public Types

using writer_t = variant_snapshot_writer
 
using reader_t = variant_snapshot_reader
 
using write_storage_t = fc::mutable_variant_object
 
using snapshot_t = fc::variant
 

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 9 of file snapshot_suites.hpp.

Member Typedef Documentation

◆ reader_t

◆ snapshot_t

◆ write_storage_t

◆ writer_t

Member Function Documentation

◆ finalize()

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

Definition at line 37 of file snapshot_suites.hpp.

37 {
38 w->finalize();
39 return snapshot_t(*w->storage);
40 }

◆ get_reader()

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

Definition at line 42 of file snapshot_suites.hpp.

42 {
43 return std::make_shared<reader>(buffer);
44 }

◆ get_writer()

static auto variant_snapshot_suite::get_writer ( )
inlinestatic

Definition at line 33 of file snapshot_suites.hpp.

33 {
34 return std::make_shared<writer>(std::make_shared<write_storage_t>());
35 }

◆ load_from_file()

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

Definition at line 46 of file snapshot_suites.hpp.

46 {
47 snapshot_input_file<snapshot::json> file(filename);
48 return file.read();
49 }

◆ write_to_file()

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

Definition at line 51 of file snapshot_suites.hpp.

51 {
52 snapshot_output_file<snapshot::json> file(basename);
53 file.write<snapshot_t>(snapshot);
54 }

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