| 32 | } |
| 33 | |
| 34 | uint64_t Tr3Block::Write(std::streambuf& buffer) { |
| 35 | // The TR block is normally added after the measurement has been stopped as it |
| 36 | // cannot be appended |
| 37 | if (FilePosition() > 0) { |
| 38 | return block_size_; |
| 39 | } |
| 40 | |
| 41 | nof_events_ = static_cast<uint16_t>(event_list_.size()); |
| 42 | block_type_ = "TR"; |
| 43 | block_size_ = (2 + 2) + (1 * 4) + 2 + (nof_events_ * 24); |
| 44 | link_list_.resize(1, 0); |
| 45 | |
| 46 | if (!comment_.empty()) { |
| 47 | Tx3Block tx(comment_); |
| 48 | tx.Init(*this); |
| 49 | tx.Write(buffer); |
| 50 | link_list_[kIndexTx] = tx.FilePosition(); |
| 51 | } |
| 52 | |
| 53 | uint64_t bytes = MdfBlock::Write(buffer); |
| 54 | bytes += WriteNumber(buffer, nof_events_); |
| 55 | |
| 56 | for (const auto &ev : event_list_) { |
| 57 | bytes += WriteNumber(buffer, ev.event_time); |
| 58 | bytes += WriteNumber(buffer, ev.pre_time); |
| 59 | bytes += WriteNumber(buffer, ev.post_time); |
| 60 | } |
| 61 | |
| 62 | return bytes; |
| 63 | } |
| 64 | |
| 65 | } // namespace mdf::detail |
nothing calls this directly
no test coverage detected