pstore2
Public Types | Public Member Functions | List of all members
pstore::transaction< LockGuard > Class Template Reference
Inheritance diagram for pstore::transaction< LockGuard >:
Inheritance graph
[legend]
Collaboration diagram for pstore::transaction< LockGuard >:
Collaboration graph
[legend]

Public Types

using lock_type = LockGuard
 

Public Member Functions

 transaction (database &db, lock_type &&lock)
 
 transaction (transaction const &rhs)=delete
 
 transaction (transaction &&rhs) noexcept=default
 
transactionoperator= (transaction const &rhs)=delete
 
transactionoperator= (transaction &&rhs) noexcept=delete
 
- Public Member Functions inherited from pstore::transaction_base
 transaction_base (transaction_base const &)=delete
 
 transaction_base (transaction_base &&rhs) noexcept
 
transaction_baseoperator= (transaction_base const &)=delete
 
transaction_baseoperator= (transaction_base &&rhs) noexcept=delete
 
databasedb () 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_basecommit ()
 Commits all modifications made to the data store as part of this transaction. More...
 
transaction_baserollback () 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 >, addressalloc_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...
 

Additional Inherited Members

- Protected Member Functions inherited from pstore::transaction_base
 transaction_base (database &db)
 

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