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

Function UniqueWindowAmongPeers

src/JournalWindowPaths.cpp:56–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54//! @return unique window in the list satisfying the predicate, or null
55template< typename Pred >
56wxWindow *UniqueWindowAmongPeers(
57 const wxWindowList &list, const Pred &pred )
58{
59 const auto begin = list.begin(), end = list.end();
60 auto iter1 = std::find_if(begin, end, pred);
61 if (iter1 == end)
62 return nullptr;
63 auto next = iter1, iter2 = std::find_if(++next, end, pred);
64 if (iter2 != end)
65 return nullptr;
66 return *iter1;
67}
68
69//! @return whether the window is uniquely named within the given list
70bool HasUniqueNameAmongPeers( const wxWindow &window, const wxWindowList &list )

Callers 2

HasUniqueNameAmongPeersFunction · 0.85
FindByNameAmongPeersFunction · 0.85

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected