stldb::concurrent::trans_map — Parameters:.
// In header: </Users/bobw/workspace/stldb_lib/stldb/containers/concurrent_trans_map.h> template<typename K, typename V, typename Comparator = std::less<K>, typename Allocator = boost::interprocess::allocator<std::pair<const K, V>, typename boost::interprocess::managed_mapped_file::segment_manager>, typename mutex_family = stldb::bounded_mutex_family, int picket_lock_size = 31> class trans_map { public: // types typedef Allocator::template rebind< std::pair< K, TransEntry< V > > >::other base_alloc; typedef boost::interprocess::map< K, TransEntry< V >, Comparator, base_alloc > baseclass; typedef K key_type; typedef TransEntry< V > mapped_type; typedef std::pair< const K, TransEntry< V > > value_type; typedef Comparator key_compare; typedef Allocator allocator_type; typedef mutex_family::upgradable_mutex_type upgradable_mutex_type; typedef mutex_family::mutex_type mutex_type; typedef mutex_family::condition_type condition_type; typedef picket_lock_set< value_type, mutex_type, picket_lock_size > picket_lock_t; typedef value_type & reference; typedef const value_type & const_reference; typedef value_type * pointer; typedef const value_type * const_pointer; typedef Allocator::size_type size_type; typedef Allocator::difference_type difference_type; typedef trans_assoc_iterator< trans_map, typename baseclass::iterator, boost::interprocess::scoped_lock< mutex_type > > iterator; typedef trans_assoc_iterator< trans_map, typename baseclass::const_iterator, boost::interprocess::scoped_lock< mutex_type > > const_iterator; typedef std::reverse_iterator< iterator > reverse_iterator; typedef std::reverse_iterator< const_iterator > const_reverse_iterator; // member classes/structs/unions struct pending_change_map_t { // construct/copy/destruct pending_change_map_t(); bool exclusive_commit; bool exclusive_rollback; std::vector< typename trans_map::pointer > _modified_entries; std::vector< mutex_type * > _locks_held; }; struct trans_map_op_factory { // public member functions TransactionalOperation * create(TransactionalOperations, trans_map &) ; }; // construct/copy/destruct trans_map(const Comparator &, const Allocator &, const char *); template<typename InputIterator> trans_map(InputIterator, InputIterator, const Comparator &, const Allocator &, const Transaction &, int); trans_map(const trans_map &); ~trans_map(); // public member functions allocator_type get_allocator() const; iterator begin() ; const_iterator begin() const; iterator end() ; const_iterator end() const; reverse_iterator rbegin() ; const_reverse_iterator rbegin() const; reverse_iterator rend() ; const_reverse_iterator rend() const; iterator begin(Transaction &) ; iterator end(Transaction &) ; reverse_iterator rbegin(Transaction &) ; reverse_iterator rend(Transaction &) ; std::pair< iterator, bool > insert(const value_type &, Transaction &) ; iterator insert(iterator, const value_type &, Transaction &) ; template<typename InputIterator> void insert(InputIterator, InputIterator, Transaction &) ; template<typename wait_policy_t> std::pair< iterator, bool > insert(const value_type &, Transaction &, wait_policy_t &) ; template<typename wait_policy_t> iterator insert(iterator, const value_type &, Transaction &, wait_policy_t &) ; template<typename InputIterator, typename wait_policy_t> void insert(InputIterator, InputIterator, Transaction &, wait_policy_t &) ; void erase(iterator, Transaction &) ; size_type erase(const K &, Transaction &) ; void erase(iterator, iterator, Transaction &) ; template<typename wait_policy_t> void erase(iterator, Transaction &, wait_policy_t &) ; template<typename wait_policy_t> size_type erase(const K &, Transaction &, wait_policy_t &) ; template<typename wait_policy_t> void erase(iterator, iterator, Transaction &, wait_policy_t &) ; void clear(exclusive_transaction &) ; void swap(trans_map &, exclusive_transaction &) ; iterator find(const K &) ; const_iterator find(const K &) const; iterator find(const K &, Transaction &) ; iterator lower_bound(const K &) ; const_iterator lower_bound(const K &) const; iterator lower_bound(const K &, Transaction &) ; iterator upper_bound(const K &) ; const_iterator upper_bound(const K &) const; iterator upper_bound(const K &, Transaction &) ; void lock(iterator &, Transaction &) ; template<typename wait_policy_t> void lock(iterator &, Transaction &, wait_policy_t &) ; V & update(iterator &, const V &, Transaction &) ; template<typename wait_policy_t> V & update(iterator &, const V &, Transaction &, wait_policy_t &) ; upgradable_mutex_type & mutex() ; mutex_type & mutexForRow(const typename baseclass::iterator &) ; void print_stats() ; const char * get_name() ; // private member functions template<typename bound_method_t, typename wait_policy_t> bound_method_t::result_type while_row_locked(const bound_method_t &, iterator &, Transaction &, wait_policy_t &) ; void erase_i(iterator &, Transaction &) ; baseclass::size_type erase_i(const K &, Transaction &) ; void erase_i(iterator &, iterator, Transaction &) ; void lock_i(iterator &, Transaction &) ; V & update_i(iterator &, const V &, Transaction &) ; value_type & pendingUpdate(Transaction &, typename baseclass::iterator) ; value_type addPendingUpdate(Transaction &, typename baseclass::iterator, const V &) ; void addPendingInsert(Transaction &, typename baseclass::iterator) ; void addPendingErase(Transaction &, typename baseclass::iterator) ; void addPendingUnlock(Transaction &, typename baseclass::iterator) ; void save_checkpoint(std::ostream &) ; void load_checkpoint(std::istream &) ; };
trans_map
public
construct/copy/destructtrans_map(const Comparator & comp, const Allocator & alloc, const char * name);
template<typename InputIterator> trans_map(InputIterator first, InputIterator last, const Comparator & comp, const Allocator & alloc, const Transaction & trans, int id);
trans_map(const trans_map & rarg);
~trans_map();
trans_map
public member functionsallocator_type get_allocator() const;
iterator begin() ;
const_iterator begin() const;
iterator end() ;
const_iterator end() const;
reverse_iterator rbegin() ;
const_reverse_iterator rbegin() const;
reverse_iterator rend() ;
const_reverse_iterator rend() const;
iterator begin(Transaction & trans) ;
iterator end(Transaction & trans) ;
reverse_iterator rbegin(Transaction & trans) ;
reverse_iterator rend(Transaction & trans) ;
std::pair< iterator, bool > insert(const value_type &, Transaction & trans) ;
iterator insert(iterator, const value_type &, Transaction & trans) ;
template<typename InputIterator> void insert(InputIterator, InputIterator, Transaction & trans) ;
template<typename wait_policy_t> std::pair< iterator, bool > insert(const value_type &, Transaction & trans, wait_policy_t & wait_policy) ;
template<typename wait_policy_t> iterator insert(iterator, const value_type &, Transaction & trans, wait_policy_t & wait_policy) ;
template<typename InputIterator, typename wait_policy_t> void insert(InputIterator, InputIterator, Transaction & trans, wait_policy_t & wait_policy) ;
void erase(iterator, Transaction & trans) ;
size_type erase(const K &, Transaction & trans) ;
void erase(iterator, iterator, Transaction & trans) ;
template<typename wait_policy_t> void erase(iterator, Transaction & trans, wait_policy_t & wait_policy) ;
template<typename wait_policy_t> size_type erase(const K &, Transaction & trans, wait_policy_t & wait_policy) ;
template<typename wait_policy_t> void erase(iterator, iterator, Transaction & trans, wait_policy_t & wait_policy) ;
void clear(exclusive_transaction & trans) ;
void swap(trans_map & other, exclusive_transaction & trans) ;
iterator find(const K & key) ;
const_iterator find(const K & key) const;
iterator find(const K & key, Transaction & trans) ;
iterator lower_bound(const K & key) ;
const_iterator lower_bound(const K & key) const;
iterator lower_bound(const K & key, Transaction & trans) ;
iterator upper_bound(const K & key) ;
const_iterator upper_bound(const K & key) const;
iterator upper_bound(const K & key, Transaction & trans) ;
void lock(iterator & i, Transaction & trans) ;
template<typename wait_policy_t> void lock(iterator & i, Transaction & trans, wait_policy_t & wait_policy) ;
V & update(iterator & i, const V & newVal, Transaction & trans) ;
template<typename wait_policy_t> V & update(iterator & i, const V & newVal, Transaction & trans, wait_policy_t & wait_policy) ;
upgradable_mutex_type & mutex() ;
mutex_type & mutexForRow(const typename baseclass::iterator & i) ;
void print_stats() ;
const char * get_name() ;
trans_map
private member functionstemplate<typename bound_method_t, typename wait_policy_t> bound_method_t::result_type while_row_locked(const bound_method_t & bound_method, iterator & i, Transaction & trans, wait_policy_t & wait_policy) ;
void erase_i(iterator & i, Transaction & trans) ;
baseclass::size_type erase_i(const K &, Transaction & trans) ;
void erase_i(iterator & i, iterator, Transaction & trans) ;
void lock_i(iterator & i, Transaction & trans) ;
V & update_i(iterator & i, const V & newVal, Transaction & trans) ;
value_type & pendingUpdate(Transaction & trans, typename baseclass::iterator location) ;
Support for MVCC
value_type addPendingUpdate(Transaction & trans, typename baseclass::iterator location, const V & newVal) ;
void addPendingInsert(Transaction & trans, typename baseclass::iterator location) ;
void addPendingErase(Transaction & trans, typename baseclass::iterator location) ;
void addPendingUnlock(Transaction & trans, typename baseclass::iterator location) ;
void save_checkpoint(std::ostream & out) ;
void load_checkpoint(std::istream & in) ;