| 672 | } |
| 673 | |
| 674 | size_t Ca4Block::WriteReferences(std::streambuf& buffer, |
| 675 | const std::vector<CaTripleReference>& list, |
| 676 | size_t max_fill, |
| 677 | size_t start_index) { |
| 678 | size_t nof_links = 0; |
| 679 | for (size_t index = 0; index < max_fill; ++index) { |
| 680 | if (index < list.size()) { |
| 681 | const auto& ref = list[index]; |
| 682 | WriteReference(buffer, ref, start_index + nof_links); |
| 683 | UpdateLink(buffer, start_index + nof_links, |
| 684 | ref.DataGroup != nullptr ? ref.DataGroup->Index() : 0 ); |
| 685 | } else { |
| 686 | UpdateLink(buffer, start_index + nof_links,0 ); |
| 687 | UpdateLink(buffer, start_index + nof_links + 1, 0 ); |
| 688 | UpdateLink(buffer, start_index + nof_links + 2, 0 ); |
| 689 | } |
| 690 | nof_links += 3; |
| 691 | } |
| 692 | return nof_links; |
| 693 | } |
| 694 | |
| 695 | void Ca4Block::SetParentChannel(const Cn4Block* parent) { |
| 696 | parent_channel_ = parent; |