| 223 | } |
| 224 | |
| 225 | bool Cg3Block::PrepareForWriting() { |
| 226 | try { |
| 227 | nof_channels_ = static_cast<uint16_t>(cn_list_.size()); |
| 228 | uint64_t record_size = 0; |
| 229 | size_of_data_record_ = 0; |
| 230 | for (auto &cn3 : cn_list_) { |
| 231 | cn3->ByteOffset(static_cast<uint32_t>(record_size)); |
| 232 | record_size += cn3->DataBytes(); |
| 233 | size_of_data_record_ = static_cast<uint16_t>(record_size); |
| 234 | } |
| 235 | if (record_size > 0xFFFF) { |
| 236 | throw std::runtime_error("The record size is to large. Size; " |
| 237 | + std::to_string(record_size) + " > " + std::to_string(0xFFFF)); |
| 238 | } |
| 239 | sample_buffer_.resize(static_cast<size_t>(record_size)); |
| 240 | |
| 241 | } catch (const std::exception &err) { |
| 242 | MDF_ERROR() << "Failed to prepare for writing. Error: " << err.what(); |
| 243 | return false; |
| 244 | } |
| 245 | return true; |
| 246 | } |
| 247 | |
| 248 | uint64_t Cg3Block::ReadDataRecord(std::streambuf& buffer, |
| 249 | const IDataGroup ¬ifier) const { |
nothing calls this directly
no test coverage detected