Skip to content

Commit

Permalink
Merge pull request #6 from realm/tg-impl
Browse files Browse the repository at this point in the history
Move things which are not part of the API to an impl directory/namespace
  • Loading branch information
tgoyne committed Oct 20, 2015
2 parents 513e483 + 6dfeaf8 commit f5b790c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <sstream>

using namespace realm;
using namespace realm::_impl;

namespace {
// Write a byte to a pipe to notify anyone waiting for data on the pipe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
namespace realm {
class Realm;

namespace _impl {
class ExternalCommitHelper {
public:
ExternalCommitHelper(Realm* realm);
Expand Down Expand Up @@ -87,6 +88,7 @@ class ExternalCommitHelper {
FdHolder m_shutdown_write_fd;
};

} // namespace _impl
} // namespace realm

#endif /* REALM_EXTERNAL_COMMIT_HELPER_HPP */
2 changes: 2 additions & 0 deletions transact_log_handler.cpp → impl/transact_log_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ class TransactLogHandler {
} // anonymous namespace

namespace realm {
namespace _impl {
namespace transaction {
void advance(SharedGroup& sg, ClientHistory& history, RealmDelegate* delegate) {
TransactLogHandler(delegate, sg, [&](auto&&... args) {
Expand Down Expand Up @@ -344,4 +345,5 @@ void cancel(SharedGroup& sg, ClientHistory& history, RealmDelegate* delegate) {
}

} // namespace transaction
} // namespace _impl
} // namespace realm
2 changes: 2 additions & 0 deletions transact_log_handler.hpp → impl/transact_log_handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class RealmDelegate;
class SharedGroup;
class ClientHistory;

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

#endif /* REALM_TRANSACT_LOG_HANDLER_HPP */
1 change: 1 addition & 0 deletions shared_realm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <mutex>

using namespace realm;
using namespace realm::_impl;

RealmCache Realm::s_global_cache;

Expand Down
7 changes: 5 additions & 2 deletions shared_realm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,16 @@

namespace realm {
class ClientHistory;
class ExternalCommitHelper;
class Realm;
class RealmCache;
class RealmDelegate;
typedef std::shared_ptr<Realm> SharedRealm;
typedef std::weak_ptr<Realm> WeakRealm;

namespace _impl {
class ExternalCommitHelper;
}

class Realm : public std::enable_shared_from_this<Realm>
{
public:
Expand Down Expand Up @@ -114,7 +117,7 @@ namespace realm {

Group *m_group = nullptr;

std::shared_ptr<ExternalCommitHelper> m_notifier;
std::shared_ptr<_impl::ExternalCommitHelper> m_notifier;

public:
std::unique_ptr<RealmDelegate> m_delegate;
Expand Down

0 comments on commit f5b790c

Please sign in to comment.