19#ifndef CPPREALM_BRIDGE_LIST_HPP
20#define CPPREALM_BRIDGE_LIST_HPP
26#include <cpprealm/internal/bridge/utils.hpp>
32namespace realm::internal::bridge {
44 struct notification_token;
45 struct collection_change_callback;
47 struct sort_descriptor;
57 operator List()
const;
60 [[nodiscard]]
size_t size()
const;
61 void remove(
size_t idx);
64 table get_table()
const;
66 void add(
const std::string&);
67 void add(
const int64_t &);
68 void add(
const double &);
69 void add(
const bool &);
71 void add(
const uuid &);
74 void add(
const mixed &);
79 void set(
size_t pos,
const int64_t &);
80 void set(
size_t pos,
const double &);
81 void set(
size_t pos,
const bool &);
82 void set(
size_t pos,
const std::string &);
83 void set(
size_t pos,
const uuid &);
90 size_t find(
const int64_t &);
91 size_t find(
const bool &);
92 size_t find(
const double &);
93 size_t find(
const std::string &);
94 size_t find(
const uuid &);
97 size_t find(
const mixed &);
99 size_t find(
const binary&);
102 results sort(
const std::vector<sort_descriptor>&);
103 [[nodiscard]]
results as_results()
const;
105 notification_token add_notification_callback(std::shared_ptr<collection_change_callback>);
107 template <
typename ValueType>
108 friend ValueType get(
const list&,
size_t idx);
109 friend inline List* get_list(
list& lst);
110 friend inline const List* get_list(
const list& lst);
111 inline ::realm::List* get_list();
112 inline const ::realm::List* get_list()
const;
113#ifdef CPPREALM_HAVE_GENERATED_BRIDGE_TYPES
114 storage::List m_list[1];
116 std::shared_ptr<::realm::List> m_list;
120 template <
typename ValueType>
121 [[nodiscard]] ValueType get(
const list&,
size_t idx);
123 [[nodiscard]] std::string get(
const list&,
size_t idx);
125 [[nodiscard]] int64_t get(
const list&,
size_t idx);
127 [[nodiscard]]
double get(
const list&,
size_t idx);
129 [[nodiscard]]
binary get(
const list&,
size_t idx);
131 [[nodiscard]]
uuid get(
const list&,
size_t idx);
137 [[nodiscard]]
mixed get(
const list&,
size_t idx);
139 [[nodiscard]]
obj get(
const list&,
size_t idx);
142 [[nodiscard]] std::optional<int64_t> get(
const list& lst,
size_t idx);
144 [[nodiscard]] std::optional<double> get(
const list& lst,
size_t idx);
146 [[nodiscard]] std::optional<bool> get(
const list& lst,
size_t idx);
148 [[nodiscard]] std::optional<uuid> get(
const list& lst,
size_t idx);
150 [[nodiscard]] std::optional<object_id> get(
const list& lst,
size_t idx);
152 [[nodiscard]] std::optional<std::string> get(
const list& lst,
size_t idx);
154 [[nodiscard]] std::optional<binary> get(
const list& lst,
size_t idx);
156 [[nodiscard]] std::optional<timestamp> get(
const list& lst,
size_t idx);
Definition: binary.hpp:30
Definition: col_key.hpp:28
Definition: decimal128.hpp:30
Definition: object.hpp:45
Definition: obj_key.hpp:33
Definition: object_id.hpp:31
Definition: results.hpp:46
Definition: timestamp.hpp:30