mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-11 23:04:29 +00:00
Remove list.hpp's dependency on shared_realm.hpp
This commit is contained in:
parent
07c40b4517
commit
356c17ba11
11
src/list.cpp
11
src/list.cpp
@ -18,10 +18,21 @@
|
|||||||
|
|
||||||
#include "list.hpp"
|
#include "list.hpp"
|
||||||
|
|
||||||
|
#include "shared_realm.hpp"
|
||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
using namespace realm;
|
using namespace realm;
|
||||||
|
|
||||||
|
List::List(std::shared_ptr<Realm> r, const ObjectSchema& s, LinkViewRef l)
|
||||||
|
: m_realm(std::move(r))
|
||||||
|
, m_object_schema(&s)
|
||||||
|
, m_link_view(std::move(l))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
List::~List() = default;
|
||||||
|
|
||||||
size_t List::size()
|
size_t List::size()
|
||||||
{
|
{
|
||||||
verify_attached();
|
verify_attached();
|
||||||
|
17
src/list.hpp
17
src/list.hpp
@ -19,22 +19,21 @@
|
|||||||
#ifndef REALM_LIST_HPP
|
#ifndef REALM_LIST_HPP
|
||||||
#define REALM_LIST_HPP
|
#define REALM_LIST_HPP
|
||||||
|
|
||||||
#include "shared_realm.hpp"
|
|
||||||
#include <realm/link_view.hpp>
|
#include <realm/link_view.hpp>
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
namespace realm {
|
namespace realm {
|
||||||
class ObjectSchema;
|
class ObjectSchema;
|
||||||
|
class Realm;
|
||||||
|
|
||||||
class List {
|
class List {
|
||||||
public:
|
public:
|
||||||
List(SharedRealm& r, const ObjectSchema& s, LinkViewRef l)
|
List(std::shared_ptr<Realm> r, const ObjectSchema& s, LinkViewRef l);
|
||||||
: m_realm(r)
|
~List();
|
||||||
, m_object_schema(&s)
|
|
||||||
, m_link_view(l)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
const ObjectSchema& get_object_schema() const { return *m_object_schema; }
|
const ObjectSchema& get_object_schema() const { return *m_object_schema; }
|
||||||
SharedRealm realm() { return m_realm; }
|
const std::shared_ptr<Realm>& realm() { return m_realm; }
|
||||||
|
|
||||||
size_t size();
|
size_t size();
|
||||||
Row get(std::size_t row_ndx);
|
Row get(std::size_t row_ndx);
|
||||||
@ -60,7 +59,7 @@ public:
|
|||||||
void verify_in_tranaction();
|
void verify_in_tranaction();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SharedRealm m_realm;
|
std::shared_ptr<Realm> m_realm;
|
||||||
const ObjectSchema* m_object_schema;
|
const ObjectSchema* m_object_schema;
|
||||||
LinkViewRef m_link_view;
|
LinkViewRef m_link_view;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user