Class DataBlockManager

Inheritance Relationships

Base Type

Class Documentation

class DataBlockManager : public ska::pst::common::ApplicationManager

Manager for a Shared Memory Ring Buffer supporting the gRPC API for the SMRB component.

Public Functions

inline DataBlockManager()

Default Construct a new Data Block Manager object.

~DataBlockManager() = default

Destroy the Data Block Manager object.

void configure_beam_from_file(const std::string &config_file)

Configure beam for the data and weights ring buffers described by the configuration file.

Parameters

config_file – configuration file describing the data and weights ring buffers

void print_statistics()

Print the data and weights ring buffer statistics.

DataBlockStats::stats_t get_data_header_stats()

Return the statistics of the header_block of the data ring buffer.

Returns

DataBlockStats::stats_t header_block statistics of the data ring buffer

DataBlockStats::stats_t get_data_data_stats()

Return the statistics of the data_block of the data ring buffer.

Returns

DataBlockStats::stats_t data_block statistics of the data ring buffer

DataBlockStats::stats_t get_weights_header_stats()

Return the statistics of the header_block of the weights ring buffer.

Returns

DataBlockStats::stats_t header_block statistics of the weights ring buffer

DataBlockStats::stats_t get_weights_data_stats()

Return the statistics of the data_block of the weights ring buffer.

Returns

DataBlockStats::stats_t data_block statistics of the weights ring buffer

void check_beam_configured(bool required)

Check the configured flag matches the required value, throwing an exception if not.

Parameters

required – required value for the configured flag

inline bool is_beam_configured()

Return the value of the configured flag.

Returns

true the manager has been configured with data and weights keys

Returns

false the manage has not been configured with data and weights keys

void wait_for_duration(int milliseconds, volatile bool *signal)

Wait until the specified duration has elapsed, or the signal is set to true.

Parameters
  • milliseconds – duration to wait for before returning

  • signal – return immediately if the signal is true

void wait_for_observation(volatile bool *signal)

Wait until a signal observation has been processed by data DataBlock, or the signal set to true.

Parameters

signal – return immediately if the signal is true

void wait_for_signal(volatile bool *signal)

Wait until the signal is set to boolean true.

Parameters

signal – return immediately if the signal is true

std::string get_beam_configuration_header_key(const std::string &header_key)

Get the ring buffer key of the currently managed ring buffers.

Calls to this should be preceeded with calls to is_beam_configured

Parameters

header_key – string value defined in std::vector<std::string> header_keys

Throws

std::runtime_exception – if there are no currently beam configuration.

Returns

std::string of configured resources.

uint64_t get_beam_configuration_buffer_key(const std::string &buffer_key)

Get the ring buffer size of the currently managed ring buffers.

Calls to this should be preceeded with calls to is_beam_configured

Parameters

buffer_key – string value defined in std::vector<std::string> buffer_keys

Throws

std::runtime_exception – if there are no currently beam configuration.

Returns

std::string of configured resources.

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

Validates Beam configuration.

Validation errors should not be raise as exceptions but added to the validation context. The client of the method can decide what to do with the validation errors.

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.

Validation errors should not be raise as exceptions but added to the validation context. The client of the method can decide what to do with the validation errors.

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

Validate requested start scan configuration.

Parameters

config – AsciiHeader containing Start Scan Configuration

virtual void perform_initialise() override

Initialisation callback.

virtual void perform_configure_beam() override

Beam Configuration callback that is called by ska::pst::common::ApplicationManager::main. Contains the instructions required prior to transitioning the state from Idle to BeamConfigured.

virtual void perform_configure_scan() override

Scan Configuration callback that is called by ska::pst::common::ApplicationManager::main. Contains the instructions required prior to transitioning the state from BeamConfigured to ScanConfigured.

virtual void perform_start_scan() override

StartScan callback that is called by ska::pst::common::ApplicationManager::main. Contains the instructions required prior to transitioning the state from ScanConfigured to Scanning. Launches perform_scan on a separate thread.

virtual void perform_scan() override

Scan callback that is called by ska::pst::common::ApplicationManager::main. Contains scanning instructions meant to be launched in a separate thread.

virtual void perform_stop_scan() override

StopScan callback that is called by ska::pst::common::ApplicationManager::main. Contains the instructions required prior to transitioning the state from Scanning to ScanConfigured.

virtual void perform_deconfigure_scan() override

DeconfigureScan callback that is called by ska::pst::common::ApplicationManager::main. Contains the instructions required prior to transitioning the state from ScanConfigured to BeamConfigured.

virtual void perform_deconfigure_beam() override

DeconfigureBeam callback that is called by ska::pst::common::ApplicationManager::main. Contains the instructions required prior to transitioning the state from BeamConfigured to Idle.

virtual void perform_terminate() override

Terminate callback that is called by ka::pst::common::ApplicationManager::main. Contains the instructions required prior to transitioning the state from RuntimeError to Idle.