|
|
| transaction_base (transaction_base const &)=delete |
| |
| | transaction_base (transaction_base &&rhs) noexcept |
| |
|
transaction_base & | operator= (transaction_base const &)=delete |
| |
|
transaction_base & | operator= (transaction_base &&rhs) noexcept=delete |
| |
|
database & | db () noexcept |
| |
|
database const & | db () const noexcept |
| |
| bool | is_open () const noexcept |
| | Returns true if data has been added to this transaction, but not yet committed. More...
|
| |
| transaction_base & | commit () |
| | Commits all modifications made to the data store as part of this transaction. More...
|
| |
| transaction_base & | rollback () noexcept |
| | Discards all modifications made to the data store as part of this transaction. More...
|
| |
|
std::uint64_t | size () const noexcept |
| | Returns the number of bytes allocated in this transaction.
|
| |
|
|
std::shared_ptr< void const > | getro (address const addr, std::size_t const size) |
| |
|
template<typename T , typename = typename std::enable_if<std::is_standard_layout<T>::value>::type> |
| std::shared_ptr< T const > | getro (extent< T > const &ex) |
| |
|
template<typename T , typename = typename std::enable_if<std::is_standard_layout<T>::value>::type> |
| std::shared_ptr< T const > | getro (typed_address< T > const addr, std::size_t const elements=1) |
| |
|
|
std::shared_ptr< void > | getrw (address const addr, std::size_t const size) |
| |
|
template<typename T , typename = typename std::enable_if<std::is_standard_layout<T>::value>::type> |
| std::shared_ptr< T > | getrw (extent< T > const &ex) |
| |
|
template<typename T , typename = typename std::enable_if<std::is_standard_layout<T>::value>::type> |
| std::shared_ptr< T > | getrw (typed_address< T > const addr, std::size_t const elements=1) |
| |
|
| virtual address | allocate (std::uint64_t size, unsigned align) |
| |
| template<typename Ty > |
| address | allocate () |
| | Extend the database store ensuring that there's enough room for an instance of the template type. More...
|
| |
|
| std::pair< std::shared_ptr< void >, address > | alloc_rw (std::size_t size, unsigned align) |
| | Allocates sufficient space in the transaction for 'size' bytes at an alignment given by 'align' and returns both a writable pointer to the new space and its address. More...
|
| |
| template<typename Ty , typename = typename std::enable_if<std::is_standard_layout<Ty>::value>::type> |
| auto | alloc_rw (std::size_t const num=1) -> std::pair< std::shared_ptr< Ty >, typed_address< Ty >> |
| | Allocates sufficient space in the transaction for one or more new instances of type 'Ty' and returns both a writable pointer to the new space and its address. More...
|
| |
The database transaction class.
When a transaction object is instantiated, a transation begins. Every subsequent operation can be potentially undone if the rollback() method is called. The commit() method commits the work performed by all operations since the start of the transaction.
Similarly, the rollback() method command undoes all of the work performed by all operations since the start of the transaction. If neither the commit() nor rollback() methods are called before the object is destroyed, a commit() is performed by the destructor (unless an exception is being unwound). A transaction is a scope in which operations are performed together and committed, or completely reversed.