Realm C++ SDK Version v2.2.0
Public Member Functions | List of all members
realm::internal::realm_core_scheduler Struct Referencefinal

#include <realm_core_scheduler.hpp>

Inheritance diagram for realm::internal::realm_core_scheduler:
realm::scheduler

Public Member Functions

void invoke (std::function< void()> &&fn) final
 
bool is_on_thread () const noexcept final
 
bool is_same_as (const scheduler *other) const noexcept final
 
bool can_invoke () const noexcept final
 
 realm_core_scheduler (std::shared_ptr< util::Scheduler > s)
 
 operator std::shared_ptr< util::Scheduler > ()
 
virtual void invoke (std::function< void()> &&)=0
 
virtual bool is_on_thread () const noexcept=0
 
virtual bool is_same_as (const scheduler *other) const noexcept=0
 
virtual bool can_invoke () const noexcept=0
 

Detailed Description

A type erased scheduler used for wrapping default scheduler implementations from RealmCore.

Member Function Documentation

◆ can_invoke()

bool realm::internal::realm_core_scheduler::can_invoke ( ) const
finalvirtualnoexcept

Check if this scheduler actually can support invoke(). Invoking may be either not implemented, not applicable to a scheduler type, or simply not be possible currently (e.g. if the associated event loop is not actually running).

This function is not thread-safe.

Implements realm::scheduler.

◆ invoke()

void realm::internal::realm_core_scheduler::invoke ( std::function< void()> &&  fn)
finalvirtual

Invoke the given function on the scheduler's thread. This function can be called from any thread.

Implements realm::scheduler.

◆ is_on_thread()

bool realm::internal::realm_core_scheduler::is_on_thread ( ) const
finalvirtualnoexcept

Check if the caller is currently running on the scheduler's thread. This function can be called from any thread.

Implements realm::scheduler.

◆ is_same_as()

bool realm::internal::realm_core_scheduler::is_same_as ( const scheduler other) const
finalvirtualnoexcept

Checks if this scheduler instance wraps the same underlying instance. This is up to the platforms to define, but if this method returns true, caching may occur.

Implements realm::scheduler.


The documentation for this struct was generated from the following files: