当前位置: 首页>>代码示例>>C++>>正文


C++ SharedGroup类代码示例

本文整理汇总了C++中SharedGroup的典型用法代码示例。如果您正苦于以下问题:C++ SharedGroup类的具体用法?C++ SharedGroup怎么用?C++ SharedGroup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了SharedGroup类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: do_deliver

bool ResultsNotifier::do_deliver(SharedGroup& sg)
{
    auto lock = lock_target();

    // Target realm being null here indicates that we were unregistered while we
    // were in the process of advancing the Realm version and preparing for
    // delivery, i.e. the results was destroyed from the "wrong" thread
    if (!get_realm()) {
        return false;
    }

    // We can get called before the query has actually had the chance to run if
    // we're added immediately before a different set of async results are
    // delivered
    if (!m_initial_run_complete) {
        return false;
    }

    REALM_ASSERT(!m_query_handover);

    if (m_tv_handover) {
        m_tv_handover->version = version();
        Results::Internal::set_table_view(*m_target_results,
                                          std::move(*sg.import_from_handover(std::move(m_tv_handover))));
    }
    REALM_ASSERT(!m_tv_handover);
    return true;
}
开发者ID:131e55,项目名称:realm-cocoa,代码行数:28,代码来源:results_notifier.cpp

示例2: do_attach_to

void ResultsNotifier::do_attach_to(SharedGroup& sg)
{
    REALM_ASSERT(m_query_handover);
    m_query = sg.import_from_handover(std::move(m_query_handover));
    m_sort = SortDescriptor::create_from_and_consume_patch(m_sort_handover, *m_query->get_table());
    m_distinct = SortDescriptor::create_from_and_consume_patch(m_distinct_handover, *m_query->get_table());
}
开发者ID:marcyyy0612,项目名称:CocktailRecipe,代码行数:7,代码来源:results_notifier.cpp

示例3: do_detach_from

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;
}
开发者ID:131e55,项目名称:realm-cocoa,代码行数:8,代码来源:results_notifier.cpp

示例4: do_detach_from

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;
    }
}
开发者ID:gerlandiolucena,项目名称:iosvisits,代码行数:8,代码来源:object_notifier.cpp

示例5: do_detach_from

void ListNotifier::do_detach_from(SharedGroup& sg)
{
    REALM_ASSERT(!m_lv_handover);
    if (m_lv) {
        m_lv_handover = sg.export_linkview_for_handover(m_lv);
        m_lv = {};
    }
}
开发者ID:BizBuzz,项目名称:Backend,代码行数:8,代码来源:list_notifier.cpp

示例6: do_detach_from

void PrimitiveListNotifier::do_detach_from(SharedGroup& sg)
{
    REALM_ASSERT(!m_table_handover);
    if (m_table) {
        m_table_handover = sg.export_table_for_handover(m_table);
        m_table = {};
    }
}
开发者ID:AlanAherne,项目名称:BabyTunes,代码行数:8,代码来源:primitive_list_notifier.cpp

示例7: do_detach_from

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;
}
开发者ID:marcyyy0612,项目名称:CocktailRecipe,代码行数:10,代码来源:results_notifier.cpp

示例8: do_prepare_handover

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 = {};
}
开发者ID:marcyyy0612,项目名称:CocktailRecipe,代码行数:21,代码来源:results_notifier.cpp

示例9: deliver

void NotifierPackage::deliver(SharedGroup& sg)
{
    if (m_error) {
        for (auto& notifier : m_notifiers)
            notifier->deliver_error(m_error);
        return;
    }
    // Can't deliver while in a write transaction
    if (sg.get_transact_stage() != SharedGroup::transact_Reading)
        return;
    for (auto& notifier : m_notifiers)
        notifier->deliver(sg);
}
开发者ID:NeilNie,项目名称:Visionary,代码行数:13,代码来源:collection_notifier.cpp

示例10: do_prepare_handover

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 = {};
}
开发者ID:131e55,项目名称:realm-cocoa,代码行数:18,代码来源:results_notifier.cpp

示例11: deliver

void ResultsNotifier::deliver(SharedGroup& sg)
{
    auto lock = lock_target();

    // Target realm being null here indicates that we were unregistered while we
    // were in the process of advancing the Realm version and preparing for
    // delivery, i.e. the results was destroyed from the "wrong" thread
    if (!get_realm()) {
        return;
    }

    REALM_ASSERT(!m_query_handover);
    if (m_tv_to_deliver) {
        Results::Internal::set_table_view(*m_target_results,
                                          std::move(*sg.import_from_handover(std::move(m_tv_to_deliver))));
    }
    REALM_ASSERT(!m_tv_to_deliver);
}
开发者ID:DenisDorokhov,项目名称:pony-ios,代码行数:18,代码来源:results_notifier.cpp

示例12: do_attach_to

void ResultsNotifier::do_attach_to(SharedGroup& sg)
{
    REALM_ASSERT(m_query_handover);
    m_query = sg.import_from_handover(std::move(m_query_handover));
}
开发者ID:131e55,项目名称:realm-cocoa,代码行数:5,代码来源:results_notifier.cpp

示例13: do_attach_to

void ObjectNotifier::do_attach_to(SharedGroup& sg)
{
    REALM_ASSERT(m_handover);
    REALM_ASSERT(!m_row);
    m_row = sg.import_from_handover(std::move(m_handover));
}
开发者ID:gerlandiolucena,项目名称:iosvisits,代码行数:6,代码来源:object_notifier.cpp

示例14: promote_to_write

inline void LangBindHelper::promote_to_write(SharedGroup& sg,
                                             TransactLogRegistry& log_registry)
{
    sg.promote_to_write(log_registry);
}
开发者ID:IGZjuantrias,项目名称:Hello-Swift-Youtube,代码行数:5,代码来源:lang_bind_helper.hpp

示例15: advance_read

inline void LangBindHelper::advance_read(SharedGroup& sg,
                                         TransactLogRegistry& log_registry)
{
    sg.advance_read(log_registry);
}
开发者ID:IGZjuantrias,项目名称:Hello-Swift-Youtube,代码行数:5,代码来源:lang_bind_helper.hpp


注:本文中的SharedGroup类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。