results should store const ObjectSchema
This commit is contained in:
parent
dc67be30fc
commit
143564d0b9
2
list.hpp
2
list.hpp
|
@ -27,7 +27,7 @@ namespace realm {
|
|||
public:
|
||||
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; }
|
||||
|
||||
size_t size();
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace realm {
|
|||
template<typename ValueType, typename ContextType>
|
||||
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; }
|
||||
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
|
||||
{
|
||||
if (m_realm)
|
||||
|
|
|
@ -38,14 +38,14 @@ public:
|
|||
// Results is copyable and moveable
|
||||
Results(Results const&) = default;
|
||||
Results(Results&&) = default;
|
||||
Results& operator=(Results const&) = default;
|
||||
Results& operator=(Results&&) = default;
|
||||
Results& operator=(Results const&);
|
||||
|
||||
// Get the Realm
|
||||
SharedRealm get_realm() const { return m_realm; }
|
||||
|
||||
// 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
|
||||
// Returned query will not be valid if the current mode is Empty
|
||||
|
|
Loading…
Reference in New Issue