Merge pull request #6 from realm/tg-impl

Move things which are not part of the API to an impl directory/namespace
This commit is contained in:
Thomas Goyne 2015-10-20 09:59:10 -07:00
commit f5b790cf87
6 changed files with 13 additions and 2 deletions

View File

@ -30,6 +30,7 @@
#include <sstream> #include <sstream>
using namespace realm; using namespace realm;
using namespace realm::_impl;
namespace { namespace {
// Write a byte to a pipe to notify anyone waiting for data on the pipe // Write a byte to a pipe to notify anyone waiting for data on the pipe

View File

@ -26,6 +26,7 @@
namespace realm { namespace realm {
class Realm; class Realm;
namespace _impl {
class ExternalCommitHelper { class ExternalCommitHelper {
public: public:
ExternalCommitHelper(Realm* realm); ExternalCommitHelper(Realm* realm);
@ -87,6 +88,7 @@ private:
FdHolder m_shutdown_write_fd; FdHolder m_shutdown_write_fd;
}; };
} // namespace _impl
} // namespace realm } // namespace realm
#endif /* REALM_EXTERNAL_COMMIT_HELPER_HPP */ #endif /* REALM_EXTERNAL_COMMIT_HELPER_HPP */

View File

@ -316,6 +316,7 @@ public:
} // anonymous namespace } // anonymous namespace
namespace realm { namespace realm {
namespace _impl {
namespace transaction { namespace transaction {
void advance(SharedGroup& sg, ClientHistory& history, RealmDelegate* delegate) { void advance(SharedGroup& sg, ClientHistory& history, RealmDelegate* delegate) {
TransactLogHandler(delegate, sg, [&](auto&&... args) { TransactLogHandler(delegate, sg, [&](auto&&... args) {
@ -344,4 +345,5 @@ void cancel(SharedGroup& sg, ClientHistory& history, RealmDelegate* delegate) {
} }
} // namespace transaction } // namespace transaction
} // namespace _impl
} // namespace realm } // namespace realm

View File

@ -24,6 +24,7 @@ class RealmDelegate;
class SharedGroup; class SharedGroup;
class ClientHistory; class ClientHistory;
namespace _impl {
namespace transaction { namespace transaction {
// Advance the read transaction version, with change notifications sent to delegate // Advance the read transaction version, with change notifications sent to delegate
// Must not be called from within a write transaction. // Must not be called from within a write transaction.
@ -41,6 +42,7 @@ void commit(SharedGroup& sg, ClientHistory& history, RealmDelegate* delegate);
// for reverting to the old values sent to delegate // for reverting to the old values sent to delegate
void cancel(SharedGroup& sg, ClientHistory& history, RealmDelegate* delegate); void cancel(SharedGroup& sg, ClientHistory& history, RealmDelegate* delegate);
} // namespace transaction } // namespace transaction
} // namespace _impl
} // namespace realm } // namespace realm
#endif /* REALM_TRANSACT_LOG_HANDLER_HPP */ #endif /* REALM_TRANSACT_LOG_HANDLER_HPP */

View File

@ -29,6 +29,7 @@
#include <mutex> #include <mutex>
using namespace realm; using namespace realm;
using namespace realm::_impl;
RealmCache Realm::s_global_cache; RealmCache Realm::s_global_cache;

View File

@ -28,13 +28,16 @@
namespace realm { namespace realm {
class ClientHistory; class ClientHistory;
class ExternalCommitHelper;
class Realm; class Realm;
class RealmCache; class RealmCache;
class RealmDelegate; class RealmDelegate;
typedef std::shared_ptr<Realm> SharedRealm; typedef std::shared_ptr<Realm> SharedRealm;
typedef std::weak_ptr<Realm> WeakRealm; typedef std::weak_ptr<Realm> WeakRealm;
namespace _impl {
class ExternalCommitHelper;
}
class Realm : public std::enable_shared_from_this<Realm> class Realm : public std::enable_shared_from_this<Realm>
{ {
public: public:
@ -114,7 +117,7 @@ namespace realm {
Group *m_group = nullptr; Group *m_group = nullptr;
std::shared_ptr<ExternalCommitHelper> m_notifier; std::shared_ptr<_impl::ExternalCommitHelper> m_notifier;
public: public:
std::unique_ptr<RealmDelegate> m_delegate; std::unique_ptr<RealmDelegate> m_delegate;