object store fixes for js binding
This commit is contained in:
parent
7802a9e976
commit
4923d7d953
|
@ -199,6 +199,22 @@ void RealmCoordinator::clear_cache()
|
|||
}
|
||||
}
|
||||
|
||||
void RealmCoordinator::clear_all_caches()
|
||||
{
|
||||
std::vector<std::weak_ptr<RealmCoordinator>> to_clear;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(s_coordinator_mutex);
|
||||
for (auto iter : s_coordinators_per_path) {
|
||||
to_clear.push_back(iter.second);
|
||||
}
|
||||
}
|
||||
for (auto weak_coordinator : to_clear) {
|
||||
if (auto coordinator = weak_coordinator.lock()) {
|
||||
coordinator->clear_cache();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RealmCoordinator::send_commit_notifications()
|
||||
{
|
||||
REALM_ASSERT(!m_config.read_only);
|
||||
|
|
|
@ -65,7 +65,10 @@ public:
|
|||
// Should only be called in test code, as continuing to use the previously
|
||||
// cached instances will have odd results
|
||||
static void clear_cache();
|
||||
|
||||
|
||||
// Clears all caches on existing coordinators
|
||||
static void clear_all_caches();
|
||||
|
||||
// Explicit constructor/destructor needed for the unique_ptrs to forward-declared types
|
||||
RealmCoordinator();
|
||||
~RealmCoordinator();
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
#ifndef REALM_OBJECT_SCHEMA_HPP
|
||||
#define REALM_OBJECT_SCHEMA_HPP
|
||||
|
||||
#include "property.hpp"
|
||||
|
||||
#include <realm/string_data.hpp>
|
||||
|
||||
#include <string>
|
||||
|
@ -26,7 +28,6 @@
|
|||
|
||||
namespace realm {
|
||||
class Group;
|
||||
struct Property;
|
||||
|
||||
class ObjectSchema {
|
||||
public:
|
||||
|
|
|
@ -19,8 +19,7 @@
|
|||
#ifndef REALM_OBJECT_STORE_HPP
|
||||
#define REALM_OBJECT_STORE_HPP
|
||||
|
||||
#include "object_schema.hpp"
|
||||
#include "property.hpp"
|
||||
#include "schema.hpp"
|
||||
|
||||
#include <functional>
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#ifndef REALM_SCHEMA_HPP
|
||||
#define REALM_SCHEMA_HPP
|
||||
|
||||
#include "property.hpp"
|
||||
#include "object_schema.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
#ifndef REALM_REALM_HPP
|
||||
#define REALM_REALM_HPP
|
||||
|
||||
#include "object_store.hpp"
|
||||
|
||||
#include <realm/handover_defs.hpp>
|
||||
|
||||
#include <memory>
|
||||
|
@ -34,7 +36,6 @@ namespace realm {
|
|||
class Group;
|
||||
class Realm;
|
||||
class RealmDelegate;
|
||||
class Schema;
|
||||
class SharedGroup;
|
||||
typedef std::shared_ptr<Realm> SharedRealm;
|
||||
typedef std::weak_ptr<Realm> WeakRealm;
|
||||
|
|
Loading…
Reference in New Issue