PST File Format SDK v0.4
Loading...
Searching...
No Matches
pstsdk::bt_leaf_page< K, V > Class Template Reference

Contains the actual key value pairs of the btree. More...

#include <page.h>

+ Inheritance diagram for pstsdk::bt_leaf_page< K, V >:
+ Collaboration diagram for pstsdk::bt_leaf_page< K, V >:

Public Member Functions

 bt_leaf_page (const shared_db_ptr &db, const page_info &pi, std::vector< std::pair< K, V > > data)
 Construct a leaf page from disk.
 
const V & get_value (uint pos) const
 Returns the value at the associated position on this leaf node.
 
const K & get_key (uint pos) const
 Returns the key at the specified position.
 
uint num_values () const
 Returns the number of entries in this btree_node.
 
- Public Member Functions inherited from pstsdk::bt_page< K, V >
 bt_page (const shared_db_ptr &db, const page_info &pi, ushort level)
 Construct a bt_page from disk.
 
ushort get_level () const
 Returns the level of this bt_page.
 
- Public Member Functions inherited from pstsdk::page
 page (const shared_db_ptr &db, const page_info &pi)
 Construct a page from disk.
 
page_id get_page_id () const
 Get the page id.
 
ulonglong get_address () const
 Get the physical address of this page.
 
- Public Member Functions inherited from pstsdk::btree_node< K, V >
virtual ~btree_node ()
 
const_iterator begin () const
 Returns a STL style iterator positioned at the first entry.
 
const_iterator end () const
 Returns a STL style iterator positioned at the "end" entry.
 
int binary_search (const K &key) const
 Performs a binary search over the keys of this btree_node.
 
- Public Member Functions inherited from pstsdk::btree_node_leaf< K, V >
virtual ~btree_node_leaf ()
 
const V & lookup (const K &key) const
 Looks up the associated value for a given key.
 

Additional Inherited Members

- Public Types inherited from pstsdk::btree_node< K, V >
typedef const_btree_node_iter< K, V > const_iterator
 
- Protected Member Functions inherited from pstsdk::page
shared_db_ptr get_db_ptr () const
 
- Protected Member Functions inherited from pstsdk::btree_node_leaf< K, V >
void first (btree_iter_impl< K, V > &iter) const
 Positions the iterator at the first element on this tree.
 
void last (btree_iter_impl< K, V > &iter) const
 Positions the iterator at the "end" element.
 
void next (btree_iter_impl< K, V > &iter) const
 Moves the iterator to the next element.
 
void prev (btree_iter_impl< K, V > &iter) const
 Moves the iterator to the previous element.
 
- Protected Attributes inherited from pstsdk::page
weak_db_ptr m_db
 The database context we're a member of.
 
page_id m_pid
 Page id.
 
ulonglong m_address
 Address of this page.
 

Detailed Description

template<typename K, typename V>
class pstsdk::bt_leaf_page< K, V >

Contains the actual key value pairs of the btree.

Template Parameters
Kkey type
Vvalue type

Definition at line 154 of file page.h.

Constructor & Destructor Documentation

◆ bt_leaf_page()

template<typename K , typename V >
pstsdk::bt_leaf_page< K, V >::bt_leaf_page ( const shared_db_ptr db,
const page_info pi,
std::vector< std::pair< K, V > >  data 
)
inline

Construct a leaf page from disk.

Parameters
[in]dbThe database context
[in]piInformation about this page
[in]dataThe key/value pairs on this leaf page

Definition at line 165 of file page.h.

Member Function Documentation

◆ get_key()

template<typename K , typename V >
const K & pstsdk::bt_leaf_page< K, V >::get_key ( uint  pos) const
inlinevirtual

Returns the key at the specified position.

This is specific to this btree_node, not the entire tree

Parameters
[in]posThe position to retrieve the key for
Returns
The key at the requested position

Implements pstsdk::btree_node< K, V >.

Definition at line 175 of file page.h.

◆ get_value()

template<typename K , typename V >
const V & pstsdk::bt_leaf_page< K, V >::get_value ( uint  pos) const
inlinevirtual

Returns the value at the associated position on this leaf node.

Parameters
[in]posThe position to retrieve the value for
Returns
The value at the requested position

Implements pstsdk::btree_node_leaf< K, V >.

Definition at line 173 of file page.h.

◆ num_values()

template<typename K , typename V >
uint pstsdk::bt_leaf_page< K, V >::num_values ( ) const
inlinevirtual

Returns the number of entries in this btree_node.

This is specific to this btree_node, not the entire tree

Returns
The number of keys in this btree_node

Implements pstsdk::btree_node< K, V >.

Definition at line 177 of file page.h.


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