28 const std::shared_ptr<AbstractMap>& m,
29 std::unique_ptr<untyped::ChangeSet>&&
cs);
33 std::shared_ptr<AbstractMap>
map;
49 std::unique_ptr<PrivateImpl>
pimpl;
56 const std::string& map_name,
57 std::unique_ptr<untyped::ChangeSet>&& change_set,
58 const std::shared_ptr<AbstractMap>& abstract_map);
60 const std::string& map_name, std::unique_ptr<AbstractHandle>&& handle);
63 const std::string& map_name,
bool track_deletes_on_missing_keys);
66 const std::string& map_name);
70 template <
class THandle>
72 const std::string& map_name,
bool track_deletes_on_missing_keys)
75 for (
auto* handle : possible_handles)
77 auto typed_handle =
dynamic_cast<THandle*
>(handle);
78 if (typed_handle !=
nullptr)
87 auto& [abstract_map, change_set] = it->second;
90 auto typed_handle =
new THandle(*change_set, map_name);
91 std::unique_ptr<AbstractHandle> abstract_handle(typed_handle);
95 auto [abstract_map, change_set] =
98 if (change_set ==
nullptr)
104 auto typed_handle =
new THandle(*change_set, map_name);
105 std::unique_ptr<AbstractHandle> abstract_handle(typed_handle);
137 return get_handle_by_name<typename M::Diff>(m.get_name(),
true);
146 typename M::Diff*
diff(
const std::string& map_name)
148 return get_handle_by_name<typename M::Diff>(map_name,
true);
168 typename M::ReadOnlyHandle*
ro(M& m)
173 return get_handle_by_name<typename M::Handle>(m.get_name(),
false);
182 typename M::ReadOnlyHandle*
ro(
const std::string& map_name)
184 return get_handle_by_name<typename M::Handle>(map_name,
false);
202 using ReadOnlyTx::ReadOnlyTx;
211 typename M::Handle*
rw(M& m)
213 return get_handle_by_name<typename M::Handle>(m.get_name(),
false);
222 typename M::Handle*
rw(
const std::string& map_name)
224 return get_handle_by_name<typename M::Handle>(map_name,
false);
232 typename M::WriteOnlyHandle*
wo(M& m)
236 return get_handle_by_name<typename M::Handle>(m.get_name(),
false);
245 typename M::WriteOnlyHandle*
wo(
const std::string& map_name)
247 return get_handle_by_name<typename M::Handle>(map_name,
false);
Definition kv_types.h:610
void compacted_version_conflict(const std::string &map_name)
Definition tx.cpp:116
void retain_change_set(const std::string &map_name, std::unique_ptr< untyped::ChangeSet > &&change_set, const std::shared_ptr< AbstractMap > &abstract_map)
Definition tx.cpp:25
BaseTx(AbstractStore *store_)
Definition tx.cpp:130
THandle * get_handle_by_name(const std::string &map_name, bool track_deletes_on_missing_keys)
Definition tx.h:71
void retain_handle(const std::string &map_name, std::unique_ptr< AbstractHandle > &&handle)
Definition tx.cpp:43
MapChanges get_map_and_change_set_by_name(const std::string &map_name, bool track_deletes_on_missing_keys)
Definition tx.cpp:49
OrderedChanges all_changes
Definition tx.h:51
std::optional< ccf::crypto::Sha256Hash > root_at_read_version
Definition tx.h:53
BaseTx & operator=(BaseTx &&other)=default
std::unique_ptr< PrivateImpl > pimpl
Definition tx.h:49
BaseTx(const BaseTx &that)=delete
std::optional< ccf::crypto::Sha256Hash > get_root_at_read_version()
Definition tx.h:123
std::list< AbstractHandle * > get_possible_handles(const std::string &map_name)
Definition tx.cpp:101
M::ReadOnlyHandle * ro(M &m)
Definition tx.h:168
M::ReadOnlyHandle * ro(const std::string &map_name)
Definition tx.h:182
M::Diff * diff(const std::string &map_name)
Definition tx.h:146
M::Diff * diff(M &m)
Definition tx.h:135
M::Handle * rw(M &m)
Definition tx.h:211
M::WriteOnlyHandle * wo(const std::string &map_name)
Definition tx.h:245
M::WriteOnlyHandle * wo(M &m)
Definition tx.h:232
M::Handle * rw(const std::string &map_name)
Definition tx.h:222
Definition app_interface.h:19
std::map< std::string, MapChanges > OrderedChanges
Definition tx.h:41
std::unique_ptr< untyped::ChangeSet > changeset
Definition tx.h:36
std::shared_ptr< AbstractMap > map
Definition tx.h:33