|
| template<typename SequenceContainer , typename = typename std::enable_if<std::is_same< typename SequenceContainer::value_type, internal_node>::value>::type> |
| static internal_node * | allocate (SequenceContainer *const container, internal_node const &other) |
| | Construct an internal node from existing internal-node instance. More...
|
| |
| template<typename SequenceContainer , typename = typename std::enable_if<std::is_same< typename SequenceContainer::value_type, internal_node>::value>::type> |
| static internal_node * | allocate (SequenceContainer *container, index_pointer const &leaf, hash_type const hash) |
| | Construct an internal node with a single child. More...
|
| |
| template<typename SequenceContainer , typename = typename std::enable_if<std::is_same< typename SequenceContainer::value_type, internal_node>::value>::type> |
| static internal_node * | allocate (SequenceContainer *container, index_pointer const &existing_leaf, index_pointer const &new_leaf, hash_type const existing_hash, hash_type const new_hash) |
| | Construct an internal node with two children. More...
|
| |
| static auto | get_node (database const &db, index_pointer node) -> std::pair< std::shared_ptr< internal_node const >, internal_node const *> |
| | Return a pointer to an internal node. More...
|
| |
| static auto | read_node (database const &db, typed_address< internal_node > addr) -> std::shared_ptr< internal_node const > |
| | Load an internal node from the store. More...
|
| |
| template<typename SequenceContainer , typename = typename std::enable_if<std::is_same< typename SequenceContainer::value_type, internal_node>::value>::type> |
| static internal_node * | make_writable (SequenceContainer *const container, index_pointer const node, internal_node const &internal) |
| | Returns a writable reference to an internal node. More...
|
| |
| static constexpr std::size_t | size_bytes (std::size_t const num_children) noexcept |
| | Returns the number of bytes occupied by an in-store internal node with the given number of child nodes. More...
|
| |
|
static unsigned | get_new_index (hash_type const new_hash, hash_type const existing_hash) noexcept |
| | Return the new leaf child index number.
|
| |
template<typename SequenceContainer , typename = typename std::enable_if<std::is_same< typename SequenceContainer::value_type, internal_node>::value>::type>
| static internal_node* pstore::index::details::internal_node::allocate |
( |
SequenceContainer *const |
container, |
|
|
internal_node const & |
other |
|
) |
| |
|
inlinestatic |
Construct an internal node from existing internal-node instance.
This may be used, for example, when copying an in-store node into memory in preparation for modifying it.
- Template Parameters
-
| SequenceContainer | A container of internal_node instances which supports emplace_back(). |
- Parameters
-
| container | Points to the container which will own the new internal node instance. |
| other | A existing internal_node whose contents are copied into the newly allocated instance. |
- Returns
- A new instance of internal_node which is owned by *container.
template<typename SequenceContainer , typename = typename std::enable_if<std::is_same< typename SequenceContainer::value_type, internal_node>::value>::type>
Returns a writable reference to an internal node.
If the node parameter references an in-heap node, then this pointer is returned otherwise a copy of the internal parameter is placed in heap-allocated memory.
- Note
- It is expected that both
node and internal are references to the same node.
- Template Parameters
-
| SequenceContainer | A container of internal_node instances which supports emplace_back(). |
- Parameters
-
| container | Points to the container which will own the new internal node instance. |
| node | A reference to an internal node. This may be either in-store on the heap. If on the heap the returned value is the underlying pointer. |
| internal | A read-only instance of an internal node. If the node parameter is in-store then a copy of this value is placed on the heap. |
- Returns
- See above.