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


C++ LinkViewRef类代码示例

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


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

示例1: TR_ENTER_PTR

JNIEXPORT void JNICALL Java_io_realm_internal_LinkView_nativeInsert
  (JNIEnv* env, jobject, jlong nativeLinkViewPtr, jlong pos, jlong rowIndex)
{
    TR_ENTER_PTR(nativeLinkViewPtr)
    LinkViewRef *lv = LV(nativeLinkViewPtr);
    try {
        LinkViewRef lvr = *lv;
        lvr->insert( S(pos), S(rowIndex) );
    } CATCH_STD()
}
开发者ID:1538143915,项目名称:realm-java,代码行数:10,代码来源:io_realm_internal_LinkView.cpp

示例2: Java_io_realm_internal_LinkView_nativeAdd

JNIEXPORT void JNICALL Java_io_realm_internal_LinkView_nativeAdd(JNIEnv* env, jclass, jlong nativeLinkViewPtr,
                                                                 jlong rowIndex)
{
    TR_ENTER_PTR(nativeLinkViewPtr)
    LinkViewRef* lv = LV(nativeLinkViewPtr);
    try {
        LinkViewRef lvr = *lv;
        lvr->add(S(rowIndex));
    }
    CATCH_STD()
}
开发者ID:MaTriXy,项目名称:realm-java,代码行数:11,代码来源:io_realm_internal_LinkView.cpp

示例3: CaptureHelper

    CaptureHelper(std::string const& path, SharedRealm const& r, LinkViewRef lv)
    : m_history(make_client_history(path))
    , m_sg(*m_history, SharedGroup::durability_MemOnly)
    , m_realm(r)
    , m_group(m_sg.begin_read())
    , m_linkview(lv)
    {
        m_realm->begin_transaction();

        m_initial.reserve(lv->size());
        for (size_t i = 0; i < lv->size(); ++i)
            m_initial.push_back(lv->get(i).get_int(0));
    }
开发者ID:LewisPark,项目名称:realm-js,代码行数:13,代码来源:transaction_log_parsing.cpp

示例4: CollectionNotifier

ListNotifier::ListNotifier(LinkViewRef lv, std::shared_ptr<Realm> realm)
: CollectionNotifier(std::move(realm))
, m_prev_size(lv->size())
{
    // Find the lv's column, since that isn't tracked directly
    size_t row_ndx = lv->get_origin_row_index();
    m_col_ndx = not_found;
    auto& table = lv->get_origin_table();
    for (size_t i = 0, count = table.get_column_count(); i != count; ++i) {
        if (table.get_column_type(i) == type_LinkList && table.get_linklist(i, row_ndx) == lv) {
            m_col_ndx = i;
            break;
        }
    }
    REALM_ASSERT(m_col_ndx != not_found);

    set_table(lv->get_target_table());

    auto& sg = Realm::Internal::get_shared_group(*get_realm());
    m_lv_handover = sg.export_linkview_for_handover(lv);
}
开发者ID:BizBuzz,项目名称:Backend,代码行数:21,代码来源:list_notifier.cpp

示例5:

Results::Results(SharedRealm r, LinkViewRef lv, util::Optional<Query> q, SortOrder s)
: m_realm(std::move(r))
, m_link_view(lv)
, m_table(&lv->get_target_table())
, m_sort(std::move(s))
, m_mode(Mode::LinkView)
{
    REALM_ASSERT(m_sort.column_indices.size() == m_sort.ascending.size());
    if (q) {
        m_query = std::move(*q);
        m_mode = Mode::Query;
    }
}
开发者ID:0atme0,项目名称:tutu1,代码行数:13,代码来源:results.cpp

示例6: validate

    void validate(CollectionChangeSet const& info)
    {
        info.insertions.verify();
        info.deletions.verify();
        info.modifications.verify();

        std::vector<size_t> move_sources;
        for (auto const& move : info.moves)
            move_sources.push_back(m_initial[move.from]);

        // Apply the changes from the transaction log to our copy of the
        // initial, using UITableView's batching rules (i.e. delete, then
        // insert, then update)
        auto it = util::make_reverse_iterator(info.deletions.end());
        auto end = util::make_reverse_iterator(info.deletions.begin());
        for (; it != end; ++it) {
            m_initial.erase(m_initial.begin() + it->first, m_initial.begin() + it->second);
        }

        for (auto const& range : info.insertions) {
            for (auto i = range.first; i < range.second; ++i)
                m_initial.insert(m_initial.begin() + i, m_linkview->get(i).get_int(0));
        }

        for (auto const& range : info.modifications) {
            for (auto i = range.first; i < range.second; ++i)
                m_initial[i] = m_linkview->get(i).get_int(0);
        }

        REQUIRE(m_linkview->is_attached());

        // and make sure we end up with the same end result
        REQUIRE(m_initial.size() == m_linkview->size());
        for (size_t i = 0; i < m_initial.size(); ++i)
            CHECK(m_initial[i] == m_linkview->get(i).get_int(0));

        // Verify that everything marked as a move actually is one
        for (size_t i = 0; i < move_sources.size(); ++i) {
            if (!info.modifications.contains(info.moves[i].to)) {
                CHECK(m_linkview->get(info.moves[i].to).get_int(0) == move_sources[i]);
            }
        }
    }
开发者ID:LewisPark,项目名称:realm-js,代码行数:43,代码来源:transaction_log_parsing.cpp


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