libmoost
|
#include <kvds_page_store.hpp>
Classes | |
struct | metadata |
Public Types | |
typedef pagemapT | pagemap_t |
typedef pagemap_t::size_type | size_type |
typedef pagemap_t::iterator | iterator |
typedef pagemap_t::const_iterator | const_iterator |
typedef pagemap_t::pageinfo_t | pageinfo_t |
typedef pagemap_t::itemid_t | itemid_t |
typedef pagemap_t::storage_t | storage_t |
typedef KvdsPageMapShared < pagemapT > | this_type |
Public Member Functions | |
~KvdsPageMapShared () | |
void | get_metadata_from (this_type const &rhs) |
take metadata from another shared pagemap | |
void | give_metadata_to (this_type const &rhs) |
share our metadata with another shared pagemap | |
storage_t & | get_storage () |
iterator | begin () |
iterator | end () |
size_type | size () const |
void | resize (size_type const size) |
bool | empty () const |
void | clear () |
iterator | find (void const *pkey, size_t const ksize) |
void | erase (iterator itr) |
iterator | insert (void const *pkey, size_t const ksize, pageinfo_t const &page_info) |
bool | itr2key (const_iterator itr, void *pkey, size_t &ksize) const |
void | load (std::string const &fname, bool newdb) |
void | save (std::string const &fname) |
Private Member Functions | |
void | validate_metadata_exists () const |
bool | create_metadata_ondemand () |
Private Attributes | |
boost::shared_ptr< metadata > | pmetadata_ |
A pagemap that allows multiple pagestores to share the same pagemap. Useful if you want to store the store entity in a resource stack to make sure there are not multiple instances of the pagemap being kept in memory. Shared pagemap simply works by wrapping a pointer to an instance of a pagemap. Different stores can be assigned the same pagemap by instantiating them with this shared pagemap and then assigning them all the same pointer handle. *** This class is NOT thread safe *** NB. There is no point in making this class thread safe since the pagestore that uses it is also not threadsafe!
Definition at line 89 of file kvds_page_store.hpp.
typedef pagemap_t::const_iterator moost::kvds::KvdsPageMapShared< pagemapT >::const_iterator |
Definition at line 95 of file kvds_page_store.hpp.
typedef pagemap_t::itemid_t moost::kvds::KvdsPageMapShared< pagemapT >::itemid_t |
Definition at line 97 of file kvds_page_store.hpp.
typedef pagemap_t::iterator moost::kvds::KvdsPageMapShared< pagemapT >::iterator |
Definition at line 94 of file kvds_page_store.hpp.
typedef pagemap_t::pageinfo_t moost::kvds::KvdsPageMapShared< pagemapT >::pageinfo_t |
Definition at line 96 of file kvds_page_store.hpp.
typedef pagemapT moost::kvds::KvdsPageMapShared< pagemapT >::pagemap_t |
Definition at line 92 of file kvds_page_store.hpp.
typedef pagemap_t::size_type moost::kvds::KvdsPageMapShared< pagemapT >::size_type |
Definition at line 93 of file kvds_page_store.hpp.
typedef pagemap_t::storage_t moost::kvds::KvdsPageMapShared< pagemapT >::storage_t |
Definition at line 98 of file kvds_page_store.hpp.
typedef KvdsPageMapShared<pagemapT> moost::kvds::KvdsPageMapShared< pagemapT >::this_type |
Definition at line 99 of file kvds_page_store.hpp.
moost::kvds::KvdsPageMapShared< pagemapT >::~KvdsPageMapShared | ( | ) | [inline] |
Definition at line 166 of file kvds_page_store.hpp.
iterator moost::kvds::KvdsPageMapShared< pagemapT >::begin | ( | ) | [inline] |
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= INTERFACE: You MUST implement the following methods in your pagemap =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Definition at line 205 of file kvds_page_store.hpp.
void moost::kvds::KvdsPageMapShared< pagemapT >::clear | ( | ) | [inline] |
Definition at line 236 of file kvds_page_store.hpp.
bool moost::kvds::KvdsPageMapShared< pagemapT >::create_metadata_ondemand | ( | ) | [inline, private] |
Because we need this to act like a normal pagemap we need to create an instance of the pagemap we're sharing on demand. We don't want to create it at construction in case we're going to share with another and we can't put a liability on the store to create it because the store knows nothing about the implementation detail of pagemaps.
Definition at line 317 of file kvds_page_store.hpp.
bool moost::kvds::KvdsPageMapShared< pagemapT >::empty | ( | ) | const [inline] |
Definition at line 231 of file kvds_page_store.hpp.
iterator moost::kvds::KvdsPageMapShared< pagemapT >::end | ( | ) | [inline] |
Definition at line 214 of file kvds_page_store.hpp.
void moost::kvds::KvdsPageMapShared< pagemapT >::erase | ( | iterator | itr | ) | [inline] |
Definition at line 261 of file kvds_page_store.hpp.
iterator moost::kvds::KvdsPageMapShared< pagemapT >::find | ( | void const * | pkey, |
size_t const | ksize | ||
) | [inline] |
Definition at line 245 of file kvds_page_store.hpp.
void moost::kvds::KvdsPageMapShared< pagemapT >::get_metadata_from | ( | this_type const & | rhs | ) | [inline] |
take metadata from another shared pagemap
Definition at line 175 of file kvds_page_store.hpp.
storage_t& moost::kvds::KvdsPageMapShared< pagemapT >::get_storage | ( | ) | [inline] |
void moost::kvds::KvdsPageMapShared< pagemapT >::give_metadata_to | ( | this_type const & | rhs | ) | [inline] |
share our metadata with another shared pagemap
Definition at line 185 of file kvds_page_store.hpp.
iterator moost::kvds::KvdsPageMapShared< pagemapT >::insert | ( | void const * | pkey, |
size_t const | ksize, | ||
pageinfo_t const & | page_info | ||
) | [inline] |
bool moost::kvds::KvdsPageMapShared< pagemapT >::itr2key | ( | const_iterator | itr, |
void * | pkey, | ||
size_t & | ksize | ||
) | const [inline] |
Definition at line 280 of file kvds_page_store.hpp.
void moost::kvds::KvdsPageMapShared< pagemapT >::load | ( | std::string const & | fname, |
bool | newdb | ||
) | [inline] |
void moost::kvds::KvdsPageMapShared< pagemapT >::resize | ( | size_type const | size | ) | [inline] |
void moost::kvds::KvdsPageMapShared< pagemapT >::save | ( | std::string const & | fname | ) | [inline] |
Definition at line 298 of file kvds_page_store.hpp.
size_type moost::kvds::KvdsPageMapShared< pagemapT >::size | ( | ) | const [inline] |
Definition at line 220 of file kvds_page_store.hpp.
void moost::kvds::KvdsPageMapShared< pagemapT >::validate_metadata_exists | ( | ) | const [inline, private] |
boost::shared_ptr<metadata> moost::kvds::KvdsPageMapShared< pagemapT >::pmetadata_ [private] |
Definition at line 162 of file kvds_page_store.hpp.