Class StreamWriter

Inheritance Relationships

Base Type

Class Documentation

class StreamWriter : public ska::pst::common::ApplicationManager

The Stream Writer class adheres to the StateModel and provides the functionality to write a data stream from a Shared Memory Ring Buffer to a series of files that are stored on disk. It makes use of a DiskMonitor instance to record the data writing performance.

Public Functions

StreamWriter(DiskMonitor &disk_monitor, const std::string &entity, bool use_o_direct, bool create_files)

Construct a new StreamWriter object that supports O_DIRECT file access.

Parameters
  • disk_monitorDiskMonitor instance to update with file writer statistics

  • entity – Name of the entity for logging context

  • use_o_direct – Flag to enable the O_DIRECT option.

  • create_files – Flag to enable the creation of output files

~StreamWriter()

Destroy the StreamWriter object.

virtual void validate_configure_beam(const ska::pst::common::AsciiHeader &config, ska::pst::common::ValidationContext *context) override

Validates Beam configuration. Specific validation errors must be set when throwing exceptions.

Parameters
  • config – Beam configuration to validate

  • context – A validation context where errors should be added.

virtual void validate_configure_scan(const ska::pst::common::AsciiHeader &config, ska::pst::common::ValidationContext *context) override

Validates Scan configuration. Specific validation errors must be set when throwing exceptions.

Parameters
  • config – Scan configuration to validate

  • context – A validation context where errors should be added.

virtual void validate_start_scan(const ska::pst::common::AsciiHeader &config) override

Validates StartScan configuration. Specific validation errors must be set when throwing exceptions.

Parameters

config – StartScan configuration to validate

inline std::filesystem::path get_output_path()

Get the output path to which files will be written.

Returns

std::filesystem::path output path to which files will be written

inline std::filesystem::path get_scan_path()

Get the directory to which scan files are written.

The scan path is the base_path / product / eb_id / subsystem_id / scan_id.

Returns

std::filesystem::path directory to which scan files are written

inline void set_skip_datablock_read_config()

Set the skip datablock read config flag.

void add_extra_headers(const ska::pst::common::AsciiHeader &extra_params)

Add extra parameters that will written to the header of the output files.

Note

This method may be called multiple times. The extra parameters are stored in the additional_header attribute. The additional_header parameters (key/value pairs) will overwrite any existing parameters with the same key.