|
PST File Format SDK v0.4
|
Contains references to subnode_leaf_blocks. More...
#include <node.h>
Inheritance diagram for pstsdk::subnode_nonleaf_block:
Collaboration diagram for pstsdk::subnode_nonleaf_block:Public Member Functions | |
| subnode_nonleaf_block (const shared_db_ptr &db, const block_info &info, std::vector< std::pair< node_id, block_id > > subblocks) | |
| Construct a subnode_nonleaf_block from disk. | |
| const node_id & | get_key (uint pos) const |
| Returns the key at the specified position. | |
| subnode_block * | get_child (uint pos) |
| Returns the child btree_node at the requested location. | |
| const subnode_block * | get_child (uint pos) const |
| Returns the child btree_node at the requested location. | |
| uint | num_values () const |
| Returns the number of entries in this btree_node. | |
Public Member Functions inherited from pstsdk::subnode_block | |
| subnode_block (const shared_db_ptr &db, const block_info &info, ushort level) | |
| Construct a block from disk. | |
| virtual | ~subnode_block () |
| ushort | get_level () const |
| Get the level of this subnode_block. | |
| bool | is_internal () const |
| Returns the blocks internal/external state. | |
Public Member Functions inherited from pstsdk::block | |
| block (const shared_db_ptr &db, const block_info &info) | |
| Basic block constructor. | |
| virtual | ~block () |
| size_t | get_disk_size () const |
| Get the last known size of this block on disk. | |
| block_id | get_id () const |
| Get the block_id of this block. | |
| ulonglong | get_address () const |
| Get the address of this block on disk. | |
Public Member Functions inherited from pstsdk::btree_node< node_id, subnode_info > | |
| virtual | ~btree_node () |
| virtual const subnode_info & | lookup (const node_id &key) const=0 |
| Looks up the associated value for a given key. | |
| 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 node_id &key) const |
| Performs a binary search over the keys of this btree_node. | |
Public Member Functions inherited from pstsdk::btree_node_nonleaf< node_id, subnode_info > | |
| virtual | ~btree_node_nonleaf () |
| const subnode_info & | lookup (const node_id &key) const |
| Looks up the associated value for a given key. | |
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. | |
Additional Inherited Members | |
Public Types inherited from pstsdk::btree_node< node_id, subnode_info > | |
| typedef const_btree_node_iter< node_id, subnode_info > | const_iterator |
Public Types inherited from pstsdk::btree_node< K, V > | |
| typedef const_btree_node_iter< K, V > | const_iterator |
Protected Member Functions inherited from pstsdk::block | |
| shared_db_ptr | get_db_ptr () const |
| virtual void | trim () |
Protected Member Functions inherited from pstsdk::btree_node< node_id, subnode_info > | |
| virtual void | first (btree_iter_impl< node_id, subnode_info > &iter) const=0 |
| Positions the iterator at the first element on this tree. | |
| virtual void | last (btree_iter_impl< node_id, subnode_info > &iter) const=0 |
| Positions the iterator at the "end" element. | |
| virtual void | next (btree_iter_impl< node_id, subnode_info > &iter) const=0 |
| Moves the iterator to the next element. | |
| virtual void | prev (btree_iter_impl< node_id, subnode_info > &iter) const=0 |
| Moves the iterator to the previous element. | |
Protected Member Functions inherited from pstsdk::btree_node_nonleaf< node_id, subnode_info > | |
| void | first (btree_iter_impl< node_id, subnode_info > &iter) const |
| Positions the iterator at the first element on this tree. | |
| void | last (btree_iter_impl< node_id, subnode_info > &iter) const |
| Positions the iterator at the "end" element. | |
| void | next (btree_iter_impl< node_id, subnode_info > &iter) const |
| Moves the iterator to the next element. | |
| void | prev (btree_iter_impl< node_id, subnode_info > &iter) const |
| Moves the iterator to the previous element. | |
Protected Attributes inherited from pstsdk::subnode_block | |
| ushort | m_level |
| Level of this subnode_block. | |
Protected Attributes inherited from pstsdk::block | |
| bool | m_modified |
| True if this block has been modified and needs to be saved. | |
| size_t | m_size |
| The size of this specific block on disk at last save. | |
| block_id | m_id |
| The id of this block. | |
| ulonglong | m_address |
| The address of this specific block on disk, 0 if unknown. | |
| weak_db_ptr | m_db |
Contains references to subnode_leaf_blocks.
Because of the width of a subnode_leaf_block and the relative scarcity of subnodes, it's actually pretty uncommon to encounter a subnode non-leaf block in practice. But it does occur, typically on large tables.
This is the in memory version of one of these blocks. It forms the node of a tree, similar to the NBT, pointing to child blocks. There can only be one level of these - a subnode_nonleaf_block can not point to other subnode_nonleaf_blocks.
|
inline |
Construct a subnode_nonleaf_block from disk.
| [in] | db | The database context |
| [in] | info | Information about this block |
| [in] | subblocks | Information about the child blocks |
|
inlinevirtual |
Returns the child btree_node at the requested location.
| [in] | i | The position at which to get the child |
Implements pstsdk::btree_node_nonleaf< node_id, subnode_info >.
|
inlinevirtual |
Returns the child btree_node at the requested location.
| [in] | i | The position at which to get the child |
Implements pstsdk::btree_node_nonleaf< node_id, subnode_info >.
Returns the key at the specified position.
This is specific to this btree_node, not the entire tree
| [in] | pos | The position to retrieve the key for |
Implements pstsdk::btree_node< node_id, subnode_info >.
|
inlinevirtual |
Returns the number of entries in this btree_node.
This is specific to this btree_node, not the entire tree
Implements pstsdk::btree_node< node_id, subnode_info >.