CCF
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ccf::kv::Tx Class Reference

#include <tx.h>

Inherits ccf::kv::ReadOnlyTx.

Inherited by ccf::kv::CommittableTx.

Public Member Functions

template<class M >
M::Handle * rw (M &m)
 
template<class M >
M::Handle * rw (const std::string &map_name)
 
template<class M >
M::WriteOnlyHandle * wo (M &m)
 
template<class M >
M::WriteOnlyHandle * wo (const std::string &map_name)
 
- Public Member Functions inherited from ccf::kv::ReadOnlyTx
template<class M >
M::ReadOnlyHandle * ro (M &m)
 
template<class M >
M::ReadOnlyHandle * ro (const std::string &map_name)
 
 BaseTx (AbstractStore *store_)
 
 BaseTx (const BaseTx &that)=delete
 
- Public Member Functions inherited from ccf::kv::BaseTx
 BaseTx (AbstractStore *store_)
 
 BaseTx (const BaseTx &that)=delete
 
BaseTxoperator= (BaseTx &&other)=default
 
virtual ~BaseTx ()
 
std::optional< ccf::crypto::Sha256Hashget_root_at_read_version ()
 

Additional Inherited Members

- Protected Member Functions inherited from ccf::kv::BaseTx
void retain_change_set (const std::string &map_name, std::unique_ptr< untyped::ChangeSet > &&change_set, const std::shared_ptr< AbstractMap > &abstract_map)
 
void retain_handle (const std::string &map_name, std::unique_ptr< AbstractHandle > &&handle)
 
MapChanges get_map_and_change_set_by_name (const std::string &map_name, bool track_deletes_on_missing_keys)
 
std::list< AbstractHandle * > get_possible_handles (const std::string &map_name)
 
void compacted_version_conflict (const std::string &map_name)
 
template<class THandle >
THandle * get_handle_by_name (const std::string &map_name, bool track_deletes_on_missing_keys)
 
- Protected Attributes inherited from ccf::kv::BaseTx
std::unique_ptr< PrivateImplpimpl
 
OrderedChanges all_changes
 
std::optional< ccf::crypto::Sha256Hashroot_at_read_version = std::nullopt
 

Detailed Description

Used to create writeable handles for accessing a Map.

Acquiring a handle will create the map in the KV if it does not yet exist. Any writes made by the returned handles will be visible to all other handles created by this transaction. They will only be visible to other transactions after this transaction has completed and been applied. For type-safety, prefer restricted handles returned by ro or wo where possible, rather than the general rw.

See also
ccf::kv::ReadOnlyTx

Member Function Documentation

◆ rw() [1/2]

template<class M >
M::Handle * ccf::kv::Tx::rw ( const std::string &  map_name)
inline

Get a read-write handle by map name. Map type must be specified as explicit template parameter.

Parameters
map_nameName of map

◆ rw() [2/2]

template<class M >
M::Handle * ccf::kv::Tx::rw ( M &  m)
inline

Get a read-write handle from a map instance.

This handle can be used for both reads and writes.

Parameters
mMap instance

◆ wo() [1/2]

template<class M >
M::WriteOnlyHandle * ccf::kv::Tx::wo ( const std::string &  map_name)
inline

Get a write-only handle by map name. Map type must be specified as explicit template parameter.

Parameters
map_nameName of map

◆ wo() [2/2]

template<class M >
M::WriteOnlyHandle * ccf::kv::Tx::wo ( M &  m)
inline

Get a write-only handle from a map instance.

Parameters
mMap instance

The documentation for this class was generated from the following file: