void ResultsNotifier::do_detach_from(SharedGroup& sg) { REALM_ASSERT(m_query); REALM_ASSERT(!m_tv.is_attached()); m_query_handover = sg.export_for_handover(*m_query, MutableSourcePayload::Move); m_query = nullptr; }
void ObjectNotifier::do_detach_from(SharedGroup& sg) { REALM_ASSERT(!m_handover); if (m_row) { m_handover = sg.export_for_handover(*m_row); m_row = nullptr; } }
void ResultsNotifier::do_detach_from(SharedGroup& sg) { REALM_ASSERT(m_query); REALM_ASSERT(!m_tv.is_attached()); SortDescriptor::generate_patch(m_sort, m_sort_handover); SortDescriptor::generate_patch(m_distinct, m_distinct_handover); m_query_handover = sg.export_for_handover(*m_query, MutableSourcePayload::Move); m_query = nullptr; }
void ResultsNotifier::do_prepare_handover(SharedGroup& sg) { if (!m_tv.is_attached()) { return; } REALM_ASSERT(m_tv.is_in_sync()); m_initial_run_complete = true; m_tv_handover = sg.export_for_handover(m_tv, MutableSourcePayload::Move); add_changes(std::move(m_changes)); REALM_ASSERT(m_changes.empty()); // detach the TableView as we won't need it again and keeping it around // makes advance_read() much more expensive m_tv = {}; }
void ResultsNotifier::do_prepare_handover(SharedGroup& sg) { if (!m_tv.is_attached()) { // if the table version didn't change we can just reuse the same handover // object and bump its version to the current SG version if (m_tv_handover) m_tv_handover->version = sg.get_version_of_current_transaction(); return; } REALM_ASSERT(m_tv.is_in_sync()); m_tv_handover = sg.export_for_handover(m_tv, MutableSourcePayload::Move); add_changes(std::move(m_changes)); REALM_ASSERT(m_changes.empty()); // detach the TableView as we won't need it again and keeping it around // makes advance_read() much more expensive m_tv = {}; }