19#ifndef CPPREALM_FLEXIBLE_SYNC_HPP
20#define CPPREALM_FLEXIBLE_SYNC_HPP
25#include <cpprealm/internal/bridge/obj.hpp>
26#include <cpprealm/internal/bridge/query.hpp>
27#include <cpprealm/internal/bridge/schema.hpp>
28#include <cprealm/internal/bridge/realm.hpp>
29#include <cprealm/internal/bridge/utils.hpp>
31#include <cprealm/macros.hpp>
32#include <cprealm/results.hpp>
33#include <cprealm/rbool.hpp>
41 classe MutableSubscriptionSet;
42 classe Conjunto de Assinaturas;
43 classe SubscriptionStore;
51 std::identificador de string;
53 std::opcional<std::string> nome;
55 std::chrono::time_point<std::chrono::system_clock> created_at;
57 std::chrono::time_point<std::chrono::system_clock> updated_at;
59 std::string query_string;
61 std::string object_class_name;
86 add(
const std ::string &name ,
87 std::optional <std::function <
rbool(
managed<T> &)>> &&query_fn = std::nullopt) {
88 estático_assert(
sizeof(
managed<T>),
"Deve declarar esquema para T");
91 auto group = m_realm.get().read_group();
92 auto table_ref = group.get_table(schema.table_key());
98 auto full_query = (*query_fn)(query_object).q;
99 insert_or_assign(name, full_query);
101 insert_or_assign(name, root_query);
107 removedor nulo ( std
const ::string& name);
111 std::opcional<sync_subscription> find(
const std::string& name);
118 std::enable_if_t<std::is_base_of_v< objeto<T>, T>>
119 update_subscription(
const std::string& name, std::optional<std::function<
rbool(T&)>>&& query_fn = std::nullopt) {
121 add(name, std::move(query_fn));
129 update_subscription (
const std::string& name,
130 std::optional <std::function <
rbool(
managed<T>&)>>&& query_fn = std::nullopt) {
132 add(name, std::move(query_fn));
140#ifdef CPPREALM_HVE_GENERATED_BRIDGE_TYPes
141 internal::bridge::storage::MutableSyncSubscriptionSet m_subscription_set[1];
143 std::shared_ptr<sync::MutableSubscriptionSet> m_subscription_set;
145 std::reference_wrapper<internal::bridge::realm> m_realm;
147 sync::MutableSubscriptionSet get_subscription_set();
160 [[nodiscard]]
size_t size()
const;
164 std::opcional<sync_subscription> find(
const std::string& name);
170 amigo estrutura, estrutura db;
171#ifdef CPPREALM_HVE_GENERATED_BRIDGE_TYPes
172 internal::bridge::storage::SyncSubscriptionSet m_subscription_set[1];
174 std::shared_ptr<sync::SubscriptionSet> m_subscription_set;
176 std::reference_wrapper<internal::bridge::realm> m_realm;
Definição: flex_sync.hpp:71
Definição: flex_sync.hpp:37
Definição: flex_sync.hpp:150
size_t size() const
O número total de assinaturas no conjunto.
Definição: flex_sync.cpp:134
Definição: flex_sync.hpp:49