|
PST File Format SDK v0.4
|
A block which contains information about subnodes. More...
#include <node.h>
Inheritance diagram for pstsdk::subnode_block:
Collaboration diagram for pstsdk::subnode_block:Public Member Functions | |
| 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. | |
| virtual const node_id & | get_key (uint pos) const=0 |
| Returns the key at the specified position. | |
| virtual uint | num_values () const=0 |
| Returns the number of entries in this 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 node_id &key) const |
| Performs a binary search over the keys of this btree_node. | |
Protected Attributes | |
| 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 |
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 |
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. | |
A block which contains information about subnodes.
Subnode blocks form a sort of "private NBT" for a node. This class is the root class of that hierarchy, with child classes for the leaf and non-leaf versions of a subnode block.
This hierarchy also models the btree_node structure, inheriting the actual iteration and lookup logic.
|
inline |
Construct a block from disk.
| [in] | db | The database context |
| [in] | info | Information about this block |
| [in] | level | The level of this subnode_block (0 or 1) |
|
inlinevirtual |
|
inline |
Get the level of this subnode_block.
|
inlinevirtual |
Returns the blocks internal/external state.
Implements pstsdk::block.
|
protected |
Level of this subnode_block.