fpmas 1.6
Public Member Functions | List of all members
fpmas::io::JsonOutput< T > Class Template Reference

#include <json_output.h>

Inheritance diagram for fpmas::io::JsonOutput< T >:
Inheritance graph
[legend]
Collaboration diagram for fpmas::io::JsonOutput< T >:
Collaboration graph
[legend]

Public Member Functions

 JsonOutput (api::io::OutputStream &output_stream, Watcher< T > watcher, bool indent=false)
 
void dump () override
 
- Public Member Functions inherited from fpmas::io::OutputBase
 OutputBase (api::io::OutputStream &output_stream)
 
const api::scheduler::Jobjob () override
 
virtual void dump ()=0
 
virtual const scheduler::Jobjob ()=0
 

Additional Inherited Members

- Protected Attributes inherited from fpmas::io::OutputBase
api::io::OutputStreamoutput_stream
 

Detailed Description

template<typename T>
class fpmas::io::JsonOutput< T >

An fpmas::api::io::Output implementation that dumps data of a single Watcher as JSON to the provided OutputStream.

Template Parameters
TData type

Constructor & Destructor Documentation

◆ JsonOutput()

template<typename T >
fpmas::io::JsonOutput< T >::JsonOutput ( api::io::OutputStream output_stream,
Watcher< T >  watcher,
bool  indent = false 
)
inline

JsonOutput constructor.

Parameters
output_streamOutputStream to which JSON data will be dumped.
watcherWatcher instance used to gather data to dump().
indentIf true, the json output is pretty-printed. Otherwise, a compact representation is used.

Member Function Documentation

◆ dump()

template<typename T >
void fpmas::io::JsonOutput< T >::dump ( )
inlineoverridevirtual
  1. Gathers data with a watcher() call.
  2. Serializes the data instance (of type T) using the nlohmann serialization process.
  3. Dumps JSON data to the output_stream.

Implements fpmas::api::io::Output.


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