Skip to content

Commit

Permalink
Remove unnecessary scheduler tests
Browse files Browse the repository at this point in the history
  • Loading branch information
leemaguire committed Jun 12, 2024
1 parent cb05fe6 commit c82957d
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 404 deletions.
1 change: 1 addition & 0 deletions include/cpprealm/macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ namespace realm {
#define DECLARE_MANAGED_PROPERTY_NAME(cls, p) #p,
#define DECLARE_COND_UNMANAGED_TO_MANAGED(cls, p) if constexpr (std::is_same_v<decltype(ptr), decltype(&cls::p)>) { return &managed<cls>::p; }

#include <tuple>
#include <utility>

#include <cpprealm/internal/bridge/col_key.hpp>
Expand Down
58 changes: 28 additions & 30 deletions include/cpprealm/schedulers/default_scheduler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,41 +29,39 @@
typedef struct uv_loop_s uv_loop_t;
#endif

namespace realm {
namespace default_scheduler {
/**
* Tries to choose a built in scheduler as default for the platform
* Current options are:
* - CFRunLoop for Apple platforms
* - UV for Linux and Windows
* - ALooper for Android
* If no suitable scheduler is available a generic scheduler will be provided.
*/
std::shared_ptr<scheduler> make_platform_default();
namespace realm::default_scheduler {
/**
* Tries to choose a built in scheduler as default for the platform
* Current options are:
* - CFRunLoop for Apple platforms
* - UV for Linux and Windows
* - ALooper for Android
* If no suitable scheduler is available a generic scheduler will be provided.
*/
std::shared_ptr<scheduler> make_platform_default();

#if defined(REALM_HAVE_UV) && REALM_HAVE_UV
/**
* Creates a scheduler using UV as the event loop
* @param loop A UV loop to be used on the same thread as Realm.
* @return A realm::scheduler which wraps UV to power the event loop.
*/
std::shared_ptr<scheduler> make_uv(uv_loop_t* loop);
/**
* Creates a scheduler using UV as the event loop
* @param loop A UV loop to be used on the same thread as Realm.
* @return A realm::scheduler which wraps UV to power the event loop.
*/
std::shared_ptr<scheduler> make_uv(uv_loop_t* loop);
#endif

/**
* Register a factory function which can produce custom schedulers when
* `scheduler::make_default()` is called. This function is not thread-safe
* and must be called before any schedulers are created.
*/
void set_default_factory(std::shared_ptr<scheduler> (*factory)());
/**
* Register a factory function which can produce custom schedulers when
* `scheduler::make_default()` is called. This function is not thread-safe
* and must be called before any schedulers are created.
*/
void set_default_factory(std::shared_ptr<scheduler> (*factory)());

/**
* Create a new instance of the scheduler type returned by the default
* scheduler factory. By default, the factory function is
* `Scheduler::make_platform_default()`.
*/
std::shared_ptr<scheduler> make_default();
}
/**
* Create a new instance of the scheduler type returned by the default
* scheduler factory. By default, the factory function is
* `Scheduler::make_platform_default()`.
*/
std::shared_ptr<scheduler> make_default();
} // namespace realm

#endif//CPPREALM_DEFAULT_SCHEDULERS_HPP
Loading

0 comments on commit c82957d

Please sign in to comment.