Use NSDMIs for Realm

This commit is contained in:
Thomas Goyne 2015-08-24 13:16:31 -07:00
parent 348f4a7b39
commit 45890f2772
2 changed files with 5 additions and 6 deletions

View File

@ -40,7 +40,7 @@ Realm::Config::Config(const Config& c) : path(c.path), read_only(c.read_only), i
} }
} }
Realm::Realm(Config &config) : m_config(config), m_thread_id(std::this_thread::get_id()), m_auto_refresh(true), m_in_transaction(false) Realm::Realm(Config &config) : m_config(config)
{ {
try { try {
if (config.read_only) { if (config.read_only) {
@ -52,7 +52,6 @@ Realm::Realm(Config &config) : m_config(config), m_thread_id(std::this_thread::g
SharedGroup::DurabilityLevel durability = config.in_memory ? SharedGroup::durability_MemOnly : SharedGroup::DurabilityLevel durability = config.in_memory ? SharedGroup::durability_MemOnly :
SharedGroup::durability_Full; SharedGroup::durability_Full;
m_shared_group = std::make_unique<SharedGroup>(*m_history, durability, config.encryption_key.get()); m_shared_group = std::make_unique<SharedGroup>(*m_history, durability, config.encryption_key.get());
m_group = nullptr;
} }
} }
catch (util::File::PermissionDenied const& ex) { catch (util::File::PermissionDenied const& ex) {

View File

@ -100,9 +100,9 @@ namespace realm {
Realm(Config &config); Realm(Config &config);
Config m_config; Config m_config;
std::thread::id m_thread_id; std::thread::id m_thread_id = std::this_thread::get_id();
bool m_in_transaction; bool m_in_transaction = false;
bool m_auto_refresh; bool m_auto_refresh = true;
std::set<NotificationFunction> m_notifications; std::set<NotificationFunction> m_notifications;
void send_local_notifications(const std::string &notification); void send_local_notifications(const std::string &notification);
@ -114,7 +114,7 @@ namespace realm {
std::unique_ptr<SharedGroup> m_shared_group; std::unique_ptr<SharedGroup> m_shared_group;
std::unique_ptr<Group> m_read_only_group; std::unique_ptr<Group> m_read_only_group;
Group *m_group; Group *m_group = nullptr;
public: public:
ExternalNotificationFunction m_external_notifier; ExternalNotificationFunction m_external_notifier;