19#ifndef CPPREALM_BRIDGE_REALM_HPP
20#define CPPREALM_BRIDGE_REALM_HPP
22#include <cpprealm/internal/bridge/utils.hpp>
41 enum class client_reset_mode: uint 8 _t {
53命名空间realm::internal::bridge {
54 template <
typename T>
struct client_reset_mode_base;
60 structthread_safe_reference ;
63 struct async_open_task;
68 枚举 class sync_session_stop_policy: uint 8 _t {
71 after_changes_uploaded,
77 using port_type = std::uint_fast 16 _t;
81 std::Optional<std::pair<std::string, std::string>> username_password;
88 Operator std::shared_ptr<SyncConfig>()
const ;
89 void set_stop_policy(sync_session_stop_policy &&);
93 std::shared_ptr<SyncConfig> m_config;
99 enum class schema_mode : uint 8 _t {
185 config (
const RealmConfig&);
186 config (
const std::string& path,
187 const std::shared_ptr<struct scheduler>&
scheduler );
188 [[nodiscard]] std::string path()
const ;
190 [[nodiscard]] std::shared_ptr<struct scheduler>
scheduler ()
const ;
191 Operator RealmConfig()
const ;
192 void set_path(
const std::string&);
193 void set_schema(
const std::vector<object_schema>&);
194 void set_schema_mode(schema_mode);
195 void set_scheduler(
const std::shared_ptr<struct scheduler>&);
196 void set_sync_config(
const std::Optional<struct sync_config>&);
197 void set_custom_http_headers(
const std::map<std::string, std::string>& headers);
199 void set_schema_version(uint 64 _t version);
200 void set_encryption_key(
const std::array<char, 64 >&);
201 void should_compact_on_launch(std::function<
bool (uint 64 _t total_bytes, uint 64 _tused_bytes)>&& fn);
202std::Optional<schema> get_schema();
204 template <
typename T>
206 before_client_reset([fn = std::move(handler.m_before)](
realm local_realm) {
207 fn(local_realm.freeze());
210 fn(local_realm.freeze(), remote_realm);
212 set_client_reset_mode(handler.m_mode);
214 enum client_reset_mode get_client_reset_mode()
const;
216 void set_client_reset_mode(
enum client_reset_mode mode);
217 void before_client_reset(std::function<
void (
域 old_realm)> 回调);
218 void after_client_reset(std::function<
void (
realm local_realm,
Realm Remote_realm)> callback);
219 inline RealmConfig* get_config();
220 内联 const RealmConfig* get_config()
const ;
221#ifdef CPPREALM_HAVE_GENERATED_BRIDGE_TYPES
222 storage::Realm_Config m_config[ 1 ];
224 std::shared_ptr<RealmConfig> m_config;
230 realm (std::shared_ptr<Realm>);
232 Operator std::shared_ptr<Realm>()
const ;
234 [[nodiscard]]
config get_config()
const ;
236 void begin_transaction()
const ;
237 void commit_transaction()
const ;
238 表table_for_object_type(
const std::string& object_type);
239 Table get_table(
const uint 32 _t &);
240 [[nodiscard]] std::shared_ptr<struct scheduler>
scheduler ()
const ;
243 bool is_frozen()
const ;
249 obj import_copy_of(
const obj &)
const ;
250 [[nodiscard]] std::Optional<sync_session> get_sync_session()
const ;
252 std::shared_ptr<Realm> m_realm;
256 template <
typename T>
259 std::function<void(T local)> m_before;
260 std::function<void(T local, Tremote)> m_after;
261 ::realm::client_reset_mode m_mode;
265 template <
typename T>
272 bool 操作符 ==(
const 域 &,
const 域 &);
273 bool Operator !=(
const realm &,
const realm &);
定义: async_open_task.hpp: 31
定义: thread_safe_reference.hpp: 32