Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysio::chain::variant_snapshot_writer Class Reference

#include <snapshot.hpp>

Inheritance diagram for sysio::chain::variant_snapshot_writer:
Collaboration diagram for sysio::chain::variant_snapshot_writer:

Public Member Functions

 variant_snapshot_writer (fc::mutable_variant_object &snapshot)
 
void write_start_section (const std::string &section_name) override
 
void write_row (const detail::abstract_snapshot_row_writer &row_writer) override
 
void write_end_section () override
 
void finalize ()
 
- Public Member Functions inherited from sysio::chain::snapshot_writer
template<typename F >
void write_section (const std::string section_name, F f)
 
template<typename T , typename F >
void write_section (F f)
 
virtual ~snapshot_writer ()
 

Additional Inherited Members

- Protected Member Functions inherited from sysio::chain::snapshot_writer

Detailed Description

Definition at line 296 of file snapshot.hpp.

Constructor & Destructor Documentation

◆ variant_snapshot_writer()

sysio::chain::variant_snapshot_writer::variant_snapshot_writer ( fc::mutable_variant_object & snapshot)

Definition at line 7 of file snapshot.cpp.

8: snapshot(snapshot)
9{
10 snapshot.set("sections", fc::variants());
11 snapshot.set("version", current_snapshot_version );
12}
std::vector< fc::variant > variants
Definition variant.hpp:173

Member Function Documentation

◆ finalize()

void sysio::chain::variant_snapshot_writer::finalize ( )

Definition at line 27 of file snapshot.cpp.

27 {
28
29}

◆ write_end_section()

void sysio::chain::variant_snapshot_writer::write_end_section ( )
overridevirtual

Implements sysio::chain::snapshot_writer.

Definition at line 23 of file snapshot.cpp.

23 {
24 snapshot["sections"].get_array().emplace_back(fc::mutable_variant_object()("name", std::move(current_section_name))("rows", std::move(current_rows)));
25}
An order-preserving dictionary of variants.

◆ write_row()

void sysio::chain::variant_snapshot_writer::write_row ( const detail::abstract_snapshot_row_writer & row_writer)
overridevirtual

Implements sysio::chain::snapshot_writer.

Definition at line 19 of file snapshot.cpp.

19 {
20 current_rows.emplace_back(row_writer.to_variant());
21}
Here is the call graph for this function:

◆ write_start_section()

void sysio::chain::variant_snapshot_writer::write_start_section ( const std::string & section_name)
overridevirtual

Implements sysio::chain::snapshot_writer.

Definition at line 14 of file snapshot.cpp.

14 {
15 current_rows.clear();
16 current_section_name = section_name;
17}

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