MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / FindAllReferences

Method FindAllReferences

lib/mdflib/mdflib/src/ca4block.cpp:316–379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314}
315
316void Ca4Block::FindAllReferences(std::streambuf& buffer) {
317 const uint64_t prod_dim = ProductOfArray();
318 size_t link_index = 1;
319 if (Storage() == ArrayStorage::DgTemplate) {
320 data_links_.resize(static_cast<size_t>(prod_dim), 0);
321 for (int64_t& position : data_links_) {
322 position = Link(link_index);
323 ++link_index;
324 }
325 }
326
327 if ((Flags() & CaFlag::DynamicSize) != 0) {
328 dynamic_size_list_.resize(dimensions_);
329 for (CaTripleReference& ref : dynamic_size_list_) {
330 ref = ReadReference(link_index);
331 link_index += 3;
332 }
333 }
334
335 if ((Flags() & CaFlag::InputQuantity) != 0) {
336 input_quantity_list_.resize(dimensions_);
337 for (CaTripleReference& ref : input_quantity_list_) {
338 ref = ReadReference(link_index);
339 link_index += 3;
340 }
341 }
342
343 if ((Flags() & CaFlag::OutputQuantity) != 0) {
344 output_quantity_ = ReadReference(link_index);
345 link_index += 3;
346 }
347
348 if ((Flags() & CaFlag::ComparisonQuantity) != 0) {
349 comparison_quantity_ = ReadReference(link_index);
350 link_index += 3;
351 }
352
353 const auto* header = HeaderBlock();
354 if ((Flags() & CaFlag::Axis) != 0) {
355 axis_conversion_list_.resize(dimensions_,nullptr);
356 for (auto& ref: axis_conversion_list_) {
357 const int64_t position = Link(link_index);
358 if (position > 0 && header != nullptr) {
359 try {
360 ref = dynamic_cast<const IChannelConversion*>
361 (header->Find(position));
362 } catch (const std::exception& ) {
363 ref = nullptr;
364 }
365 } else {
366 ref = nullptr;
367 }
368 ++link_index;
369 }
370 }
371
372 if ((Flags() & CaFlag::Axis) != 0 && (Flags() & CaFlag::FixedAxis) == 0) {
373 axis_list_.resize(dimensions_);

Callers

nothing calls this directly

Calls 2

resizeMethod · 0.45
FindMethod · 0.45

Tested by

no test coverage detected