11 template <
typename K,
typename V,
typename KSerialiser,
typename VSerialiser>
45 std::optional<V>
get(
const K& key)
47 const auto opt_v_rep =
read_handle.
get(KSerialiser::to_serialised(key));
49 if (opt_v_rep.has_value())
51 return VSerialiser::from_serialised(*opt_v_rep);
73 const auto opt_v_rep =
76 if (opt_v_rep.has_value())
78 return VSerialiser::from_serialised(*opt_v_rep);
93 bool has(
const K& key)
115 KSerialiser::to_serialised(key));
152 KSerialiser::from_serialised(k_rep),
153 VSerialiser::from_serialised(v_rep));
174 return f(KSerialiser::from_serialised(k_rep));
195 return f(VSerialiser::from_serialised(v_rep));
216 template <
typename K,
typename V,
typename KSerialiser,
typename VSerialiser>
233 void put(
const K& key,
const V& value)
236 KSerialiser::to_serialised(key), VSerialiser::to_serialised(value));
264 template <
typename K,
typename V,
typename KSerialiser,
typename VSerialiser>
Definition abstract_handle.h:8
Definition map_handle.h:268
ccf::kv::untyped::MapHandle untyped_handle
Definition map_handle.h:270
MapHandle(ccf::kv::untyped::ChangeSet &changes, const std::string &map_name)
Definition map_handle.h:276
Definition map_handle.h:13
bool has(const K &key)
Definition map_handle.h:93
V ValueType
Definition map_handle.h:19
K KeyType
Definition map_handle.h:18
ReadableMapHandle(ccf::kv::untyped::MapHandle &uh)
Definition map_handle.h:21
std::optional< V > get_globally_committed(const K &key)
Definition map_handle.h:71
void foreach_value(F &&f)
Definition map_handle.h:190
ccf::kv::untyped::MapHandle & read_handle
Definition map_handle.h:15
std::string get_name_of_map() const
Definition map_handle.h:27
void foreach_key(F &&f)
Definition map_handle.h:169
size_t size()
Definition map_handle.h:208
std::optional< V > get(const K &key)
Definition map_handle.h:45
std::optional< Version > get_version_of_previous_write(const K &key)
Definition map_handle.h:112
Definition map_handle.h:218
void remove(const K &key)
Definition map_handle.h:245
void put(const K &key, const V &value)
Definition map_handle.h:233
WriteableMapHandle(ccf::kv::untyped::MapHandle &uh)
Definition map_handle.h:223
void clear()
Definition map_handle.h:252
ccf::kv::untyped::MapHandle & write_handle
Definition map_handle.h:220
Definition untyped_map_handle.h:18
void clear()
Definition untyped_map_handle.cpp:175
bool has(const KeyType &key)
Definition untyped_map_handle.cpp:145
void put(const KeyType &key, const ValueType &value)
Definition untyped_map_handle.cpp:160
std::optional< Version > get_version_of_previous_write(const KeyType &key)
Definition untyped_map_handle.cpp:111
std::optional< ValueType > get(const KeyType &key)
Definition untyped_map_handle.cpp:96
std::optional< ValueType > get_globally_committed(const KeyType &key)
Definition untyped_map_handle.cpp:131
size_t size()
Definition untyped_map_handle.cpp:188
void remove(const KeyType &key)
Definition untyped_map_handle.cpp:168
std::string get_name_of_map() const
Definition untyped_map_handle.cpp:91
void foreach(const ElementVisitorWithEarlyOut &fn)
Definition untyped_map_handle.cpp:183
ccf::ByteVector SerialisedEntry
Definition serialised_entry.h:8
Definition app_interface.h:19
Definition untyped_change_set.h:43