19#ifndef CPPREALM_BRIDGE_REALM_HPP
20#define CPPREALM_BRIDGE_REALM_HPP
22#include <cprealm/internal/bridge/utils.hpp>
35 agendador de
estrutura ;
37 aplicativo
namespace {
41 classe enum client_reset_mode: uint8_t {
53namespace realm::internal::bridge {
54 modelo<
typename T>
struct client_reset_mode_base;
56 esquema
de estrutura ;
57 estrutura object_schema;
59 dicionário
estruturado ;
60 estrutura thread_safe_reference;
63 struct async_open_task;
64 sync_session da
estrutura ;
68 classe enumeração sync_session_stop_policy: uint8_t {
71 after_changes_uploaded,
77 usando port_type = std::uint_fast16_t;
81 std::optional<std::pair<std::string, std::string>> username_password;
88 operador std::shared_ptr<SyncConfig>()
const;
89 set_stop_policy (sync_session_stop_policy &&);
93 std::shared_ptr<SyncConfig> m_config;
99 classe enum schema_mode : uint8_t {
180 config(
configuração const e outros);
185 config(
const RealmConfig&);
186 config(
const std::string& caminho,
187 const std::shared_ptr<struct scheduler>&
agendador);
188 [[nodiscard]] std::string path()
const;
190 [[nodiscard]] std::shared_ptr<struct scheduler>
agendador()
const;
191 operador RealmConfig()
const;
192 set_path (
const std::string&);
193 set_schema (
const std::vector<object_schema>&);
194 set_schema_mode (schema_mode);
195 vazio set_scheduler(
const std::shared_ptr<struct scheduler>&);
196 set_sync_config (
const std::opcional<struct sync_config>&);
197 set_custom_http_headers (
const std::map<std::string, std::string>e cabeçalhos);
199 set_schema_version (uint64_t version);
200 set_encryption_key (
const std::array<char, 64>&);
201 null
should_compact_on_launch (std::function<
bool(uint64_t total_bytes, uint64_t utilizados_bytes)>&& fn);
202 std::optional<schema> get_schema();
205 set_client_reset_handler
vazio (
client_reset_mode_base <T>e manipulador) {
206 before_client_reset([fn = std::move(handler.m_before)](
domínio local_realm) {
207 fn(local_realm.freeze());
209 after_client_reset([fn = std::move(handler.m_after)](
realm local_realm,
realm remote_realm) {
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 null before_client_reset (std::function <
null(
Realm old_realm ) > chamada de resposta de resposta );
218 vazio after_client_reset(std::function <
vazio(
realm local_realm,
realm remoto_realm)> chamada de resposta);
219 inline RealmConfig* get_config();
220 in-line const RealmConfig* get_config()
const;
221#ifdef CPPREALM_HVE_GENERATED_BRIDGE_TYPes
222 armazenamento::Realm_Config m_config[1];
224 std::shared_ptr<RealmConfig> m_config;
230 domínio(std::shared_ptr<Realm>);
232 operador std::shared_ptr<Realm>()
const;
234 [[nodiscard]]
config get_config()
const;
235 [[ nodiscard ]]
esquema de estrutura () const;
236 vazio begin_transaction()
const;
237 commit_transaction()
nulo const;
238 tabela table_for_object_type(
const std::string& object_type);
239 table get_table(
const uint32_t &);
240 [[nodiscard]] std::shared_ptr<struct scheduler>
agendador()
const;
243 bool is_congelado()
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;
253 amigo estrutura, estrutura grupo;
259 std::function <void(T local)> m_before;
260 std::function <void(T local, T remoto)> m_after;
261 ::realm::client_reset_mode m_mode;
272 operador de
bool ==(
const Realm&,
const Realm&);
273 operador de
bool !=(
const realm&,
const realm&);
Definição: async_open_task.hpp:31
Definição: dictionary.hpp:138
Definição: sync_error.hpp:40
Definição: sync_session.hpp:33
Definição: thread_safe_reference.hpp:32
Definição: scheduled.hpp:27