PST File Format SDK v0.4
Loading...
Searching...
No Matches
pstsdk::subnode_nonleaf_block Class Reference

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_idget_key (uint pos) const
 Returns the key at the specified position.
 
subnode_blockget_child (uint pos)
 Returns the child btree_node at the requested location.
 
const subnode_blockget_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_infolookup (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_infolookup (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_infoconst_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
 

Detailed Description

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.

See also
[MS-PST] 2.2.2.8.3.3.2

Definition at line 800 of file node.h.

Constructor & Destructor Documentation

◆ subnode_nonleaf_block()

pstsdk::subnode_nonleaf_block::subnode_nonleaf_block ( const shared_db_ptr db,
const block_info info,
std::vector< std::pair< node_id, block_id > >  subblocks 
)
inline

Construct a subnode_nonleaf_block from disk.

Parameters
[in]dbThe database context
[in]infoInformation about this block
[in]subblocksInformation about the child blocks

Definition at line 811 of file node.h.

Member Function Documentation

◆ get_child() [1/2]

pstsdk::subnode_block * pstsdk::subnode_nonleaf_block::get_child ( uint  i)
inlinevirtual

Returns the child btree_node at the requested location.

Parameters
[in]iThe position at which to get the child
Returns
a non-owning pointer of the child btree_node

Implements pstsdk::btree_node_nonleaf< node_id, subnode_info >.

Definition at line 1040 of file node.h.

◆ get_child() [2/2]

const pstsdk::subnode_block * pstsdk::subnode_nonleaf_block::get_child ( uint  i) const
inlinevirtual

Returns the child btree_node at the requested location.

Parameters
[in]iThe position at which to get the child
Returns
a non-owning pointer of the child btree_node

Implements pstsdk::btree_node_nonleaf< node_id, subnode_info >.

Definition at line 1050 of file node.h.

◆ get_key()

const node_id & pstsdk::subnode_nonleaf_block::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< node_id, subnode_info >.

Definition at line 819 of file node.h.

◆ num_values()

uint pstsdk::subnode_nonleaf_block::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< node_id, subnode_info >.

Definition at line 823 of file node.h.


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