MCPcopy Create free account
hub / github.com/davisking/dlib / cat

Method cat

dlib/sequence/sequence_kernel_2.h:368–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

366 typename mem_manager
367 >
368 void sequence_kernel_2<T,mem_manager>::
369 cat (
370 sequence_kernel_2<T,mem_manager>& item
371 )
372 {
373 if (item.sequence_size > 0)
374 {
375 if (sequence_size > 0)
376 {
377 // move both sequences to a convenient location
378 move_to_pos(current_node,current_pos,0,sequence_size);
379 item.move_to_pos (
380 item.current_node,
381 item.current_pos,
382 item.sequence_size-1,
383 item.sequence_size
384 );
385
386 // make copies of poitners
387 node& item_right = *item.current_node->right;
388 node& left = *current_node->left;
389
390
391 item.current_node->right = current_node;
392 current_node->left = item.current_node;
393
394 left.right = &item_right;
395 item_right.left = &left;
396
397 // set sizes
398 sequence_size += item.sequence_size;
399 item.sequence_size = 0;
400 }
401 else
402 {
403 // *this is empty so just swap
404 item.swap(*this);
405 }
406 }
407 item.clear();
408 // reset the enumerator
409 reset();
410 }
411
412// ----------------------------------------------------------------------------------------
413

Callers

nothing calls this directly

Calls 3

resetFunction · 0.85
swapMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected