SRS-control 0.1.4
Loading...
Searching...
No Matches
srs::writer::Json Class Reference

#include <JsonWriter.hpp>

Collaboration diagram for srs::writer::Json:

Classes

struct  Bool

Public Member Functions

 Json (const std::string &filename, process::DataConvertOptions convert_mode, std::size_t n_lines=1)
 Json (const Json &)=delete
 Json (Json &&)=default
Jsonoperator= (const Json &)=delete
Jsonoperator= (Json &&)=default
 ~Json ()
auto operator() (std::size_t line_number=0) const -> OutputType
auto get_filename () const -> const std::string &
auto run (const OutputTo< InputType > auto &prev_data_converter, std::size_t line_number=0) -> RunResult
Public Member Functions inherited from srs::process::WriterTask< DataWriterOption::json, const StructData *, std::size_t >
 WriterTask (std::string_view name, DataConvertOptions prev_convert, std::size_t n_lines=1)
Public Member Functions inherited from srs::process::BaseTask< const StructData *, std::size_t >
 BaseTask (std::string_view name, DataConvertOptions prev_convert, std::size_t n_lines=1)
auto get_n_lines () const -> std::size_t
auto get_required_conversion () const -> DataConvertOptions
auto get_name () const -> std::string_view
auto get_name_str () const -> std::string

Static Public Attributes

static constexpr auto IsStructType = true
Static Public Attributes inherited from srs::process::WriterTask< DataWriterOption::json, const StructData *, std::size_t >
static constexpr auto writer_type

Private Member Functions

void write_json (const StructData &data_struct, std::size_t line_num)

Private Attributes

std::vector< Boolis_first_item_
std::string filename_
std::vector< OutputTypeoutput_data_
std::vector< std::fstream > file_streams_
std::vector< CompactExportDatadata_buffers_
std::vector< std::string > string_buffers_

Static Private Attributes

static constexpr auto name_ = std::string_view{}

Additional Inherited Members

Public Types inherited from srs::process::BaseTask< const StructData *, std::size_t >
using InputType
using OutputType
using RunResult

Detailed Description

Definition at line 49 of file JsonWriter.hpp.

Constructor & Destructor Documentation

◆ Json() [1/3]

srs::writer::Json::Json ( const std::string & filename,
process::DataConvertOptions convert_mode,
std::size_t n_lines = 1 )
explicit

Definition at line 62 of file JsonWriter.cpp.

◆ Json() [2/3]

srs::writer::Json::Json ( const Json & )
delete

◆ Json() [3/3]

srs::writer::Json::Json ( Json && )
default

◆ ~Json()

srs::writer::Json::~Json ( )

Definition at line 89 of file JsonWriter.cpp.

Member Function Documentation

◆ get_filename()

auto srs::writer::Json::get_filename ( ) const->conststd::string &
inlinenodiscard

Definition at line 72 of file JsonWriter.hpp.

◆ operator()()

auto srs::writer::Json::operator() ( std::size_t line_number = 0) const->OutputType
inlinenodiscard

Definition at line 67 of file JsonWriter.hpp.

◆ operator=() [1/2]

Json & srs::writer::Json::operator= ( const Json & )
delete

◆ operator=() [2/2]

Json & srs::writer::Json::operator= ( Json && )
default

◆ run()

auto srs::writer::Json::run ( const OutputTo< InputType > auto & prev_data_converter,
std::size_t line_number = 0 )->RunResult
inline

Definition at line 74 of file JsonWriter.hpp.

◆ write_json()

void srs::writer::Json::write_json ( const StructData & data_struct,
std::size_t line_num )
private

Definition at line 100 of file JsonWriter.cpp.

Member Data Documentation

◆ data_buffers_

std::vector<CompactExportData> srs::writer::Json::data_buffers_
private

Definition at line 88 of file JsonWriter.hpp.

◆ file_streams_

std::vector<std::fstream> srs::writer::Json::file_streams_
private

Definition at line 87 of file JsonWriter.hpp.

◆ filename_

std::string srs::writer::Json::filename_
private

Definition at line 85 of file JsonWriter.hpp.

◆ is_first_item_

std::vector<Bool> srs::writer::Json::is_first_item_
private

Definition at line 84 of file JsonWriter.hpp.

◆ IsStructType

auto srs::writer::Json::IsStructType = true
staticconstexpr

Definition at line 52 of file JsonWriter.hpp.

◆ name_

auto srs::writer::Json::name_ = std::string_view{}
staticconstexprprivate

Definition at line 83 of file JsonWriter.hpp.

◆ output_data_

std::vector<OutputType> srs::writer::Json::output_data_
private

Definition at line 86 of file JsonWriter.hpp.

◆ string_buffers_

std::vector<std::string> srs::writer::Json::string_buffers_
private

Definition at line 89 of file JsonWriter.hpp.


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