19#ifndef CPPRALM_BRIDGE_OBJ_HPP
20#define CPPRALM_BRIDGE_OBJ_HPP
29#include <cpprealm/types.hpp>
30#include <cpprealm/internal/bridge/binary.hpp>
31#include <cpprealm/internal/bridge/col_key.hpp>
32#include <cpprealm/internal/bridge/decimal128.hpp>
33#include <cpprealm/internal/bridge/Dictionary.hpp>
34#include <cpprealm/internal/bridge/ 객체.hpp>
35#include <cpprealm/internal/bridge/object_id.hpp>
36#include <cpprealm/internal/bridge/table.hpp>
37#include <cpprealm/internal/bridge/utils.hpp>
50 structNotificationToken ;
56 네임스페이스 internal::type_info {
57 템플릿 <
typename,
typename>
61 템플릿 <
typename,
typename>
63 템플릿 <
typename,
typename>
67namespace realm::internal::bridge {
88 struct is_optional : std::false_type {
93 struct is_optional<std::optional<T>> : std::true_type {
99 [[nodiscard]] T get(
const obj&,
const col_key& col_key);
101 [[nodiscard]] std::string get(
const obj&,
const col_key& col_key);
103 [[nodiscard]] uuid get(
const obj&,
const col_key& col_key);
105 [[nodiscard]] object_id get(
const obj&,
const col_key& col_key);
107 [[nodiscard]] 십진수128 get(
const obj&,
const col_key& col_key);
109 [[nodiscard]] 바이너리 get(
const obj&,
const col_key& col_key);
111 [[nodiscard]] timestamp get(
const obj&,
const col_key& col_key);
113 [[nodiscard]] int64_t get(
const obj&,
const col_key& col_key);
115 [[nodiscard]]
double get(
const obj&,
const col_key& col_key);
117 [[nodiscard]]
bool get(
const obj&,
const col_key& col_key);
119 [[nodiscard]] mixed get(
const obj&,
const col_key& col_key);
121 [[nodiscard]] core_dictionary get(
const obj&,
const col_key& col_key);
126 obj& 연산자=(
const obj& other) ;
128 obj& operator=(
obj&& other);
132 [[nodiscard]]
테이블 get_table()
const noException;
133 [[nodiscard]]
테이블 get_target_table(
col_key)
const noException;
135 [[nodiscard]]
bool is_valid()
const;
139 return internal::bridge::get<T>(*
this,
col_key);
147 return internal::bridge::get<T>(*
this,
col_key);
161 void 설정하다(
const col_key&
col_key,
const std::chrono::time_point<std::chrono::system_clock>& value);
175 set_list_values (
const col_key&
col_key,
const std::vector<obj_key>& values);
176 set_list_values (
const col_key&
col_key,
const std::vector<std::string>& values);
177 set_list_values (
const col_key&
col_key,
const std::vector<bool>& values);
178 set_list_values (
const col_key&
col_key,
const std::vector<int64_t>& values);
179 set_list_values (
const col_key&
col_key,
const std::vector<double>& values);
180 set_list_values (
const col_key&
col_key,
const std::vector<internal::bridge::uuid>& values);
181 set_list_values (
const col_key&
col_key,
const std::vector<internal::bridge::object_id>& values);
182 set_list_values (
const col_key&
col_key,
const std::vector<internal::bridge::decimal128>& values);
183 set_list_values (
const col_key&
col_key,
const std::vector<binary>& values);
184 set_list_values (
const col_key&
col_key,
const std::vector<mixed>& values);
185 set_list_values (
const col_key&
col_key,
const std::vector<timestamp>& values);
187 void set_list_values(
const col_key&
col_key,
const std::vector<std::optional<int64_t>>& values);
188 void set_list_values(
const col_key&
col_key,
const std::vector<std::optional<bool>>& values);
189 set_list_values (
const col_key&
col_key,
const std::vector<std::optional<double>>& values);
190 void set_list_values(
const col_key&
col_key,
const std::vector<std::optional<std::string>>& values);
191 void set_list_values(
const col_key&
col_key,
const std::vector<std::optional<obj_key>>& values);
192 void set_list_values(
const col_key&
col_key,
const std::vector<std::optional<internal::bridge::uuid>>& values);
193 void set_list_values(
const col_key&
col_key,
const std::vector<std::optional<internal::bridge::object_id>>& values);
194 set_list_values (
const col_key&
col_key,
const std::vector<std::optional<binary>>& values);
195 void set_list_values(
const col_key&
col_key,
const std::vector<std::optional<timestamp>>& values);
197 템플릿 <
typename ValueType>
198 set_list_values (
const col_key&
col_key,
const std::vector<ValueType>& values) {
199 std::vector<typename internal::type_info::type_info<ValueType, oid>::internal_type> v2;
200 for (
auto v : values) {
201 만약 constexpr (std::is_pointer_v<ValueType>) {
207 m_obj = m_obj = this->get_table().create_object();
209 std:: 적용([&m_obj, &v](
auto && ...p) {
210 (
접근 자<
typename std:: decay_t <
decltype(p)>::Result, oid >::
설정하다(
211 m_obj, m_obj.get_table().get_column_key(p.name),
212 (*v).*(std::decay_t<
decltype(p)>::ptr)), ...);
214 v2.push_back(m_obj.get_key());
216 v2.push_back(:: 영역::serialize(v));
222 [[nodiscard]]
obj_key get_key()
const;
223 [[nodiscard]]
obj_link get_link()
const;
227 obj create_and_set_linking_object(
const col_key&);
229 oid to_json(std::ostream& out)
const noException;
231 인라인 const Obj* get_obj()
const;
232 inline Obj* get_obj();
233 친구 인라인 const Obj* get_obj(
const obj&);
234 친구 인라인 Obj* get_obj(
obj&);
237#ifdef CPPRALM_HAVE_GENERATED_BRIDGE_TYPES
240 std::shared_ptr<Obj> m_obj;
246 테이블 get_table(uint32_t table_key);
247 테이블 get_table(
const std::string& table_key);
249 std::reference_wrapper<realm> m_realm;
252 std::string table_name_for_object_type(
const std::string&);