libmoost
moost::kvds::KvdsPageMapShared< pagemapT > Class Template Reference

#include <kvds_page_store.hpp>

List of all members.

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_tget_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< metadatapmetadata_

Detailed Description

template<typename pagemapT>
class moost::kvds::KvdsPageMapShared< pagemapT >

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.


Member Typedef Documentation

template<typename pagemapT >
typedef pagemap_t::const_iterator moost::kvds::KvdsPageMapShared< pagemapT >::const_iterator

Definition at line 95 of file kvds_page_store.hpp.

template<typename pagemapT >
typedef pagemap_t::itemid_t moost::kvds::KvdsPageMapShared< pagemapT >::itemid_t

Definition at line 97 of file kvds_page_store.hpp.

template<typename pagemapT >
typedef pagemap_t::iterator moost::kvds::KvdsPageMapShared< pagemapT >::iterator

Definition at line 94 of file kvds_page_store.hpp.

template<typename pagemapT >
typedef pagemap_t::pageinfo_t moost::kvds::KvdsPageMapShared< pagemapT >::pageinfo_t

Definition at line 96 of file kvds_page_store.hpp.

template<typename pagemapT >
typedef pagemapT moost::kvds::KvdsPageMapShared< pagemapT >::pagemap_t

Definition at line 92 of file kvds_page_store.hpp.

template<typename pagemapT >
typedef pagemap_t::size_type moost::kvds::KvdsPageMapShared< pagemapT >::size_type

Definition at line 93 of file kvds_page_store.hpp.

template<typename pagemapT >
typedef pagemap_t::storage_t moost::kvds::KvdsPageMapShared< pagemapT >::storage_t

Definition at line 98 of file kvds_page_store.hpp.

template<typename pagemapT >
typedef KvdsPageMapShared<pagemapT> moost::kvds::KvdsPageMapShared< pagemapT >::this_type

Definition at line 99 of file kvds_page_store.hpp.


Constructor & Destructor Documentation

template<typename pagemapT >
moost::kvds::KvdsPageMapShared< pagemapT >::~KvdsPageMapShared ( ) [inline]

Definition at line 166 of file kvds_page_store.hpp.


Member Function Documentation

template<typename pagemapT >
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.

Here is the call graph for this function:

template<typename pagemapT >
void moost::kvds::KvdsPageMapShared< pagemapT >::clear ( ) [inline]

Definition at line 236 of file kvds_page_store.hpp.

template<typename pagemapT >
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.

Here is the caller graph for this function:

template<typename pagemapT >
bool moost::kvds::KvdsPageMapShared< pagemapT >::empty ( ) const [inline]

Definition at line 231 of file kvds_page_store.hpp.

template<typename pagemapT >
iterator moost::kvds::KvdsPageMapShared< pagemapT >::end ( ) [inline]

Definition at line 214 of file kvds_page_store.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename pagemapT >
void moost::kvds::KvdsPageMapShared< pagemapT >::erase ( iterator  itr) [inline]

Definition at line 261 of file kvds_page_store.hpp.

template<typename pagemapT >
iterator moost::kvds::KvdsPageMapShared< pagemapT >::find ( void const *  pkey,
size_t const  ksize 
) [inline]

Definition at line 245 of file kvds_page_store.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename pagemapT >
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.

Here is the call graph for this function:

template<typename pagemapT >
storage_t& moost::kvds::KvdsPageMapShared< pagemapT >::get_storage ( ) [inline]

Definition at line 194 of file kvds_page_store.hpp.

Here is the call graph for this function:

template<typename pagemapT >
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.

Here is the call graph for this function:

template<typename pagemapT >
iterator moost::kvds::KvdsPageMapShared< pagemapT >::insert ( void const *  pkey,
size_t const  ksize,
pageinfo_t const &  page_info 
) [inline]

Definition at line 270 of file kvds_page_store.hpp.

Here is the call graph for this function:

template<typename pagemapT >
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.

template<typename pagemapT >
void moost::kvds::KvdsPageMapShared< pagemapT >::load ( std::string const &  fname,
bool  newdb 
) [inline]

Definition at line 288 of file kvds_page_store.hpp.

Here is the call graph for this function:

template<typename pagemapT >
void moost::kvds::KvdsPageMapShared< pagemapT >::resize ( size_type const  size) [inline]

Definition at line 225 of file kvds_page_store.hpp.

Here is the call graph for this function:

template<typename pagemapT >
void moost::kvds::KvdsPageMapShared< pagemapT >::save ( std::string const &  fname) [inline]

Definition at line 298 of file kvds_page_store.hpp.

template<typename pagemapT >
size_type moost::kvds::KvdsPageMapShared< pagemapT >::size ( ) const [inline]

Definition at line 220 of file kvds_page_store.hpp.

template<typename pagemapT >
void moost::kvds::KvdsPageMapShared< pagemapT >::validate_metadata_exists ( ) const [inline, private]

Definition at line 308 of file kvds_page_store.hpp.

Here is the caller graph for this function:


Member Data Documentation

template<typename pagemapT >
boost::shared_ptr<metadata> moost::kvds::KvdsPageMapShared< pagemapT >::pmetadata_ [private]

Definition at line 162 of file kvds_page_store.hpp.


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