![]() |
mutable
A Database System for Research and Fast Prototyping
|
Models how data is laid out in a linear address space. More...
#include <DataLayout.hpp>
Data Structures | |
struct | INode |
An internal node of the recursive data layout model. More... | |
struct | Leaf |
The Leaf represents exactly one attribue. More... | |
struct | leaf_info_t |
More... | |
struct | level_info_t |
More... | |
struct | Node |
More... | |
Public Types | |
using | size_type = std::size_t |
using | level_info_stack_t = std::vector< level_info_t > |
using | callback_leaves_t = std::function< void(const std::vector< leaf_info_t > &leaves, const level_info_stack_t &levels, uint64_t inode_offset_in_bits)> |
Public Member Functions | |
DataLayout (size_type num_tuples=0) | |
Create a new DataLayout for laying out num_tuples many tuples in linear memory. | |
bool | is_finite () const |
| |
size_type | num_tuples () const |
| |
uint64_t | stride_in_bits () const |
| |
const Node & | child () const |
| |
operator bool () const | |
| |
operator const INode & () const | |
| |
Leaf & | add_leaf (const m::Type *type, size_type idx, uint64_t stride_in_bits) |
Creates a Leaf and adds it as a child to this DataLayout 's internal INode . | |
INode & | add_inode (size_type num_tuples, uint64_t stride_in_bits) |
Creates an INode and adds it as a child to this DataLayout 's internal INode . | |
void | accept (ConstDataLayoutVisitor &v) const |
void | for_sibling_leaves (callback_leaves_t callback) const |
void | dump () const |
void | dump (std::ostream &out) const |
Private Attributes | |
INode | inode_ |
| |
Friends | |
M_LCOV_EXCL_START friend std::ostream & | operator<< (std::ostream &out, const DataLayout &layout) |
Models how data is laid out in a linear address space.
Definition at line 28 of file DataLayout.hpp.
using m::storage::DataLayout::callback_leaves_t = std::function<void(const std::vector<leaf_info_t> &leaves, const level_info_stack_t &levels, uint64_t inode_offset_in_bits)> |
Definition at line 55 of file DataLayout.hpp.
using m::storage::DataLayout::level_info_stack_t = std::vector<level_info_t> |
Definition at line 53 of file DataLayout.hpp.
using m::storage::DataLayout::size_type = std::size_t |
Definition at line 31 of file DataLayout.hpp.
|
inline |
Create a new DataLayout
for laying out num_tuples
many tuples in linear memory.
If num_tuples
is zero, this DataLayout
lays out an indefinite sequence of tuples.
Definition at line 197 of file DataLayout.hpp.
void DataLayout::accept | ( | ConstDataLayoutVisitor & | v | ) | const |
Definition at line 159 of file DataLayout.cpp.
DataLayout::INode & DataLayout::add_inode | ( | size_type | num_tuples, |
uint64_t | stride_in_bits | ||
) |
Creates an INode
and adds it as a child to this DataLayout
's internal INode
.
The created INode
represents num_tuples
many tuples and will have the given, relative offset_in_bits
and stride_in_bits
.
Definition at line 143 of file DataLayout.cpp.
References m::storage::DataLayout::INode::children_, inode_, M_insist, m::storage::DataLayout::INode::num_children(), num_tuples(), m::storage::DataLayout::INode::num_tuples(), m::storage::DataLayout::INode::child_t::ptr, and stride_in_bits().
Referenced by m::storage::RowLayoutFactory::make(), and m::storage::PAXLayoutFactory::make().
M_LCOV_EXCL_STOP DataLayout::Leaf & DataLayout::add_leaf | ( | const m::Type * | type, |
size_type | idx, | ||
uint64_t | stride_in_bits | ||
) |
Creates a Leaf
and adds it as a child to this DataLayout
's internal INode
.
The created Leaf
will have the given, relative offset_in_bits
and stride_in_bits
within the internal INode
.
Definition at line 137 of file DataLayout.cpp.
References m::storage::DataLayout::INode::add_leaf(), inode_, M_insist, m::storage::DataLayout::INode::num_children(), and stride_in_bits().
|
inline |
returns a reference to the single child of this
DataLayout
Definition at line 209 of file DataLayout.hpp.
References M_insist.
Referenced by m::wasm::Buffer< IsGlobal >::Buffer(), m::storage::DataLayout::INode::for_sibling_leaves(), get_column_offset_in_bytes(), m::WasmEngine::WasmContext::map_table(), and m::storage::DataLayout::INode::print().
|
inline |
|
inline |
Definition at line 238 of file DataLayout.hpp.
void DataLayout::for_sibling_leaves | ( | DataLayout::callback_leaves_t | callback | ) | const |
Definition at line 161 of file DataLayout.cpp.
References m::storage::DataLayout::INode::for_sibling_leaves(), and inode_.
Referenced by m::wasm::and(), and m::wasm::compile_data_layout_point_access().
|
inline |
returns
true
iff thisDataLayout
lays out a finite sequence of tuples
Definition at line 200 of file DataLayout.hpp.
References m::storage::DataLayout::INode::num_tuples().
Referenced by m::wasm::Buffer< IsGlobal >::Buffer(), and m::wasm::Buffer< IsGlobal >::setup_base_address().
|
inline |
returns the number of tuples laid out by this
DataLayout
; must not be called whennot is_finite()
Definition at line 202 of file DataLayout.hpp.
References M_insist, and m::storage::DataLayout::INode::num_tuples().
Referenced by m::storage::DataLayout::INode::add_inode(), add_inode(), m::storage::DataLayout::INode::add_leaf(), and m::wasm::Buffer< IsGlobal >::Buffer().
|
inline |
returns
true
iff thisDataLayout
has a child
Definition at line 212 of file DataLayout.hpp.
References m::storage::DataLayout::INode::num_children().
|
inlineexplicit |
returns a reference to the
DataLayout
's internalINode
object
Definition at line 214 of file DataLayout.hpp.
|
inline |
return the stride (in bits) of the single child of the
DataLayout
Definition at line 207 of file DataLayout.hpp.
References M_insist.
Referenced by m::storage::DataLayout::INode::add_inode(), add_inode(), m::storage::DataLayout::INode::add_leaf(), add_leaf(), m::wasm::Buffer< IsGlobal >::Buffer(), and m::WasmEngine::WasmContext::map_table().
|
friend |
Definition at line 228 of file DataLayout.hpp.
|
private |
use an
INode
to store a single child, allowing us to exploitINode
abstractions withinDataLayout
Definition at line 191 of file DataLayout.hpp.
Referenced by add_inode(), add_leaf(), and for_sibling_leaves().