MCPcopy Create free account
hub / github.com/audacity/audacity / Swap

Method Swap

libraries/lib-track/Track.cpp:346–362  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

344#endif
345
346void TrackList::Swap(TrackList &that)
347{
348 auto SwapLOTs = [](
349 ListOfTracks &a, const std::weak_ptr< TrackList > &aSelf,
350 ListOfTracks &b, const std::weak_ptr< TrackList > &bSelf )
351 {
352 a.swap(b);
353 for (auto it = a.begin(), last = a.end(); it != last; ++it)
354 (*it)->SetOwner(aSelf, it);
355 for (auto it = b.begin(), last = b.end(); it != last; ++it)
356 (*it)->SetOwner(bSelf, it);
357 };
358
359 const auto self = shared_from_this();
360 const auto otherSelf = that.shared_from_this();
361 SwapLOTs( *this, self, that, otherSelf );
362}
363
364TrackList::~TrackList()
365{

Callers

nothing calls this directly

Calls 4

SetOwnerMethod · 0.80
swapMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected