| 657 | uint8_t Dg4Block::RecordIdSize() const { return rec_id_size_; } |
| 658 | |
| 659 | bool Dg4Block::FinalizeDtBlocks(std::streambuf& buffer) { |
| 660 | auto& block_list = DataBlockList(); |
| 661 | if (block_list.empty()) { |
| 662 | // No data blocks to update |
| 663 | MDF_DEBUG() << "No last data block to update."; |
| 664 | return true; |
| 665 | } |
| 666 | auto* last_block = block_list.back().get(); |
| 667 | if (last_block == nullptr || last_block->BlockType() != "DT") { |
| 668 | MDF_DEBUG() << "Last data block is not a DT block."; |
| 669 | return true; |
| 670 | } |
| 671 | auto* dt_block = dynamic_cast<Dt4Block*>(last_block); |
| 672 | if (dt_block == nullptr) { |
| 673 | MDF_ERROR() << "Invalid DT block type-cast."; |
| 674 | return false; |
| 675 | } |
| 676 | dt_block->UpdateDataSize(buffer); |
| 677 | |
| 678 | return true; |
| 679 | } |
| 680 | |
| 681 | // Update the unfinished payload data (DT) block. This function updates the |
| 682 | // channel group (CG) and a CG-VLSD channel group regarding cycle count |
no test coverage detected