results should store const ObjectSchema
This commit is contained in:
parent
86e95fb9b1
commit
9b907b336a
|
@ -27,7 +27,7 @@ namespace realm {
|
||||||
public:
|
public:
|
||||||
List(SharedRealm &r, const ObjectSchema &s, LinkViewRef l) : m_realm(r), object_schema(s), m_link_view(l) {}
|
List(SharedRealm &r, const ObjectSchema &s, LinkViewRef l) : m_realm(r), object_schema(s), m_link_view(l) {}
|
||||||
|
|
||||||
const ObjectSchema object_schema;
|
const ObjectSchema &object_schema;
|
||||||
SharedRealm realm() { return m_realm; }
|
SharedRealm realm() { return m_realm; }
|
||||||
|
|
||||||
size_t size();
|
size_t size();
|
||||||
|
|
|
@ -27,7 +27,7 @@ namespace realm {
|
||||||
template<typename ValueType, typename ContextType>
|
template<typename ValueType, typename ContextType>
|
||||||
static inline Object create(ContextType ctx, SharedRealm realm, const ObjectSchema &object_schema, ValueType value, bool try_update);
|
static inline Object create(ContextType ctx, SharedRealm realm, const ObjectSchema &object_schema, ValueType value, bool try_update);
|
||||||
|
|
||||||
const ObjectSchema object_schema;
|
const ObjectSchema &object_schema;
|
||||||
SharedRealm realm() { return m_realm; }
|
SharedRealm realm() { return m_realm; }
|
||||||
Row row() { return m_row; }
|
Row row() { return m_row; }
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,15 @@ Results::Results(SharedRealm r, const ObjectSchema &o, Table& table)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Results& Results::operator=(Results const& r)
|
||||||
|
{
|
||||||
|
m_realm = r.m_realm;
|
||||||
|
const_cast<ObjectSchema &>(object_schema) = r.object_schema;
|
||||||
|
m_query = r.get_query();
|
||||||
|
m_sort = r.get_sort();
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
void Results::validate_read() const
|
void Results::validate_read() const
|
||||||
{
|
{
|
||||||
if (m_realm)
|
if (m_realm)
|
||||||
|
|
|
@ -38,14 +38,14 @@ public:
|
||||||
// Results is copyable and moveable
|
// Results is copyable and moveable
|
||||||
Results(Results const&) = default;
|
Results(Results const&) = default;
|
||||||
Results(Results&&) = default;
|
Results(Results&&) = default;
|
||||||
Results& operator=(Results const&) = default;
|
|
||||||
Results& operator=(Results&&) = default;
|
Results& operator=(Results&&) = default;
|
||||||
|
Results& operator=(Results const&);
|
||||||
|
|
||||||
// Get the Realm
|
// Get the Realm
|
||||||
SharedRealm get_realm() const { return m_realm; }
|
SharedRealm get_realm() const { return m_realm; }
|
||||||
|
|
||||||
// Object schema describing the vendored object type
|
// Object schema describing the vendored object type
|
||||||
ObjectSchema object_schema;
|
const ObjectSchema &object_schema;
|
||||||
|
|
||||||
// Get a query which will match the same rows as is contained in this Results
|
// Get a query which will match the same rows as is contained in this Results
|
||||||
// Returned query will not be valid if the current mode is Empty
|
// Returned query will not be valid if the current mode is Empty
|
||||||
|
|
Loading…
Reference in New Issue