1#ifndef SISCO_SISCO_WRITER_H_
2#define SISCO_SISCO_WRITER_H_
34 void Open(std::span<const std::byte> header_data);
35 void Write(
size_t baseline_index, std::span<
const std::complex<float>> data);
63 std::vector<std::byte>
data;
72 void NewChunk(std::unique_lock<std::mutex>& lock);
77 std::unique_lock<std::mutex>& lock);
78 void WriteChunk(
size_t uncompressed_size, std::span<const std::byte> data);
Internal header file for the Lane.
The Lane is an efficient cyclic buffer that is synchronized.
A queue with a limited size and the ability to query only specific values.
std::byte * exponent_position_
void RemoveChunk(const Chunk *chunk)
aocommon::Lane< WriteTask > write_tasks_
std::set< size_t > busy_baselines_
Holds a list of baseline ids currently being preprocessed.
static constexpr size_t kDefaultChunkSize
Chunk data.
void Preprocess(SiscoWriter::PreprocessingTask &task, std::unique_lock< std::mutex > &lock)
std::condition_variable chunk_finished_condition_
std::byte * mantisa_position_
SiscoWriter(SiscoWriter &&)=delete
ConditionalQueue< PreprocessingTask > preprocessing_tasks_
std::list< Chunk > chunks_
A list is used because we do not want to invalidate pointers when adding/revoming members.
std::vector< std::thread > compression_threads_
void Write(size_t baseline_index, std::span< const std::complex< float > > data)
SiscoWriter & operator=(SiscoWriter &&)=delete
SiscoWriter(const std::string &filename, int predict_level, int deflate_level)
std::map< size_t, BaselineData > baseline_data_
Indexed by baseline_index.
void NewChunk(std::unique_lock< std::mutex > &lock)
std::thread write_thread_
void DeflateChunk(Chunk &chunk)
void WriteChunk(size_t uncompressed_size, std::span< const std::byte > data)
void Open(std::span< const std::byte > header_data)
size_t chunk_write_position_
CompressorState imaginary_state_
CompressorState real_state_
size_t allocated_chunk_size
std::vector< std::byte > mantisas_data
size_t n_allocated_items
Whenever a thread finishes preprocessing, it will update this value.
std::vector< std::byte > exponent_data
std::vector< float > imaginary_data
std::byte * mantisa_position
std::vector< float > real_data
std::byte * exponent_position
std::vector< std::byte > data