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

#include <JsonWriter.hpp>

Collaboration diagram for srs::writer::Json:

Public Types

using InputType = const StructData*
 
using OutputType = int
 
using CoroType = asio::experimental::coro<OutputType(std::optional<InputType>)>
 
using InputFuture = boost::shared_future<std::optional<InputType>>
 
using OutputFuture = boost::unique_future<std::optional<OutputType>>
 

Public Member Functions

 Json (asio::thread_pool &thread_pool, const std::string &filename)
 
auto write (auto pre_future) -> boost::unique_future< std::optional< int > >
 

Static Public Member Functions

static auto get_convert_mode () -> process::DataConvertOptions
 

Static Public Attributes

static constexpr auto IsStructType = true
 

Private Member Functions

auto generate_coro (asio::any_io_executor) -> CoroType
 
void write_json (const StructData &data_struct)
 

Private Attributes

bool is_first_item = true
 
std::string filename_
 
std::fstream file_stream_
 
CompactExportData data_buffer_
 
std::string string_buffer_
 
CoroType coro_
 

Detailed Description

Definition at line 71 of file JsonWriter.hpp.

Member Typedef Documentation

◆ CoroType

using srs::writer::Json::CoroType = asio::experimental::coro<OutputType(std::optional<InputType>)>

Definition at line 76 of file JsonWriter.hpp.

◆ InputFuture

using srs::writer::Json::InputFuture = boost::shared_future<std::optional<InputType>>

Definition at line 77 of file JsonWriter.hpp.

◆ InputType

Definition at line 74 of file JsonWriter.hpp.

◆ OutputFuture

using srs::writer::Json::OutputFuture = boost::unique_future<std::optional<OutputType>>

Definition at line 78 of file JsonWriter.hpp.

◆ OutputType

Definition at line 75 of file JsonWriter.hpp.

Constructor & Destructor Documentation

◆ Json()

srs::writer::Json::Json ( asio::thread_pool & thread_pool,
const std::string & filename )
inlineexplicit

Definition at line 81 of file JsonWriter.hpp.

Member Function Documentation

◆ generate_coro()

auto srs::writer::Json::generate_coro ( asio::any_io_executor ) -> CoroType
inlineprivate

Definition at line 113 of file JsonWriter.hpp.

◆ get_convert_mode()

static auto srs::writer::Json::get_convert_mode ( ) -> process::DataConvertOptions
inlinestaticnodiscard

Definition at line 95 of file JsonWriter.hpp.

◆ write()

auto srs::writer::Json::write ( auto pre_future) -> boost::unique_future<std::optional<int>>
inline

Definition at line 99 of file JsonWriter.hpp.

◆ write_json()

void srs::writer::Json::write_json ( const StructData & data_struct)
inlineprivate

Definition at line 140 of file JsonWriter.hpp.

Member Data Documentation

◆ coro_

CoroType srs::writer::Json::coro_
private

Definition at line 110 of file JsonWriter.hpp.

◆ data_buffer_

CompactExportData srs::writer::Json::data_buffer_
private

Definition at line 108 of file JsonWriter.hpp.

◆ file_stream_

std::fstream srs::writer::Json::file_stream_
private

Definition at line 107 of file JsonWriter.hpp.

◆ filename_

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

Definition at line 106 of file JsonWriter.hpp.

◆ is_first_item

bool srs::writer::Json::is_first_item = true
private

Definition at line 105 of file JsonWriter.hpp.

◆ IsStructType

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

Definition at line 79 of file JsonWriter.hpp.

◆ string_buffer_

std::string srs::writer::Json::string_buffer_
private

Definition at line 109 of file JsonWriter.hpp.


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