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

Method Visit

libraries/lib-utility/Observer.cpp:52–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52bool RecordList::Visit(const void *arg)
53{
54 assert(m_visitor); // See constructor
55 if (m_pPolicy)
56 m_pPolicy->OnBeginPublish();
57 bool result = false;
58 for (auto pRecord = next; pRecord; pRecord = pRecord->next) {
59 try {
60 if (m_visitor(*pRecord, arg)) {
61 result = true;
62 break;
63 }
64 // pRecord might have been removed from the list by the callback,
65 // but pRecord->next is unchanged. We won't see callbacks added by
66 // the callback, because they are earlier in the list.
67 }
68 catch (...) {
69 if (m_pPolicy && m_pPolicy->OnEachFailedCallback()) {
70 result = true;
71 break;
72 }
73 }
74 }
75 // Intentionally not in a finally():
76 if (m_pPolicy)
77 m_pPolicy->OnEndPublish();
78 return result;
79}
80
81}
82

Callers 3

VisitSettingsMethod · 0.45
ProcessMethod · 0.45
PublishMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected