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

Method StrongInvariant

libraries/lib-wave-track/WaveClip.cpp:2033–2048  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2031}
2032
2033bool WaveClip::StrongInvariant() const
2034{
2035 if (!CheckInvariants())
2036 return false;
2037 const auto width = NChannels();
2038 auto iter = mSequences.begin(),
2039 end = mSequences.end();
2040 assert(iter != end); // because CheckInvariants is true
2041 auto &pFirst = *iter++;
2042 assert(pFirst); // likewise
2043 // All sequences must have the same lengths
2044 return all_of(iter, end, [&](decltype(pFirst) pSequence) {
2045 assert(pSequence); // likewise
2046 return pSequence->GetNumSamples() == pFirst->GetNumSamples();
2047 });
2048}
2049
2050void WaveClip::AssertOrRepairStrongInvariant()
2051{

Callers 3

PasteMethod · 0.80
CheckInvariantsMethod · 0.80
~StrongInvariantScopeMethod · 0.80

Calls 3

beginMethod · 0.45
endMethod · 0.45
GetNumSamplesMethod · 0.45

Tested by

no test coverage detected