29 const std::shared_ptr<AbstractMap>& m,
30 std::unique_ptr<untyped::ChangeSet>&& cs);
34 std::shared_ptr<AbstractMap>
map;
50 std::unique_ptr<PrivateImpl>
pimpl;
57 const std::string& map_name,
58 std::unique_ptr<untyped::ChangeSet>&& change_set,
59 const std::shared_ptr<AbstractMap>& abstract_map);
61 const std::string& map_name, std::unique_ptr<AbstractHandle>&& handle);
64 const std::string& map_name,
bool track_deletes_on_missing_keys);
67 const std::string& map_name);
71 template <
class THandle>
73 const std::string& map_name,
bool track_deletes_on_missing_keys)
76 for (
auto handle : possible_handles)
78 auto typed_handle =
dynamic_cast<THandle*
>(handle);
79 if (typed_handle !=
nullptr)
88 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);
98 map_name, track_deletes_on_missing_keys);
100 if (change_set ==
nullptr)
105 auto typed_handle =
new THandle(*change_set, map_name);
106 std::unique_ptr<AbstractHandle> abstract_handle(typed_handle);
139 return get_handle_by_name<typename M::Diff>(m.get_name(),
true);
148 typename M::Diff*
diff(
const std::string& map_name)
150 return get_handle_by_name<typename M::Diff>(map_name,
true);
170 typename M::ReadOnlyHandle*
ro(M& m)
175 return get_handle_by_name<typename M::Handle>(m.get_name(),
false);
184 typename M::ReadOnlyHandle*
ro(
const std::string& map_name)
186 return get_handle_by_name<typename M::Handle>(map_name,
false);
204 using ReadOnlyTx::ReadOnlyTx;
213 typename M::Handle*
rw(M& m)
215 return get_handle_by_name<typename M::Handle>(m.get_name(),
false);
224 typename M::Handle*
rw(
const std::string& map_name)
226 return get_handle_by_name<typename M::Handle>(map_name,
false);
234 typename M::WriteOnlyHandle*
wo(M& m)
238 return get_handle_by_name<typename M::Handle>(m.get_name(),
false);
247 typename M::WriteOnlyHandle*
wo(
const std::string& map_name)
249 return get_handle_by_name<typename M::Handle>(map_name,
false);
Definition kv_types.h:677
void compacted_version_conflict(const std::string &map_name)
Definition tx.cpp:114
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:124
THandle * get_handle_by_name(const std::string &map_name, bool track_deletes_on_missing_keys)
Definition tx.h:72
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:52
std::optional< ccf::crypto::Sha256Hash > root_at_read_version
Definition tx.h:54
BaseTx & operator=(BaseTx &&other)=default
std::unique_ptr< PrivateImpl > pimpl
Definition tx.h:50
BaseTx(const BaseTx &that)=delete
std::optional< ccf::crypto::Sha256Hash > get_root_at_read_version()
Definition tx.h:125
std::list< AbstractHandle * > get_possible_handles(const std::string &map_name)
Definition tx.cpp:99
M::ReadOnlyHandle * ro(M &m)
Definition tx.h:170
M::ReadOnlyHandle * ro(const std::string &map_name)
Definition tx.h:184
M::Diff * diff(const std::string &map_name)
Definition tx.h:148
M::Diff * diff(M &m)
Definition tx.h:137
M::Handle * rw(M &m)
Definition tx.h:213
M::WriteOnlyHandle * wo(const std::string &map_name)
Definition tx.h:247
M::WriteOnlyHandle * wo(M &m)
Definition tx.h:234
M::Handle * rw(const std::string &map_name)
Definition tx.h:224
Definition app_interface.h:20
std::map< std::string, MapChanges > OrderedChanges
Definition tx.h:42
std::unique_ptr< untyped::ChangeSet > changeset
Definition tx.h:37
std::shared_ptr< AbstractMap > map
Definition tx.h:34