本文整理汇总了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()
}
示例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()
}
示例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));
}
示例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);
}
示例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;
}
}
示例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]);
}
}
}