mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Data Structures | Public Types | Public Member Functions | Private Attributes | Friends
m::storage::DataLayout Struct Reference

Models how data is laid out in a linear address space. More...

#include <DataLayout.hpp>

Collaboration diagram for m::storage::DataLayout:
[legend]

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
 

‍combines information of a single leaf for for_sibling_leaves()

More...
 
struct  level_info_t
 

‍combines information of a single internal level inside the DataLayout, used by for_sibling_leaves()

More...
 
struct  Node
 

‍an abstract node in the recursive data layout model

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
 

‍returns true iff this DataLayout lays out a finite sequence of tuples


 
size_type num_tuples () const
 

‍returns the number of tuples laid out by this DataLayout; must not be called when not is_finite()


 
uint64_t stride_in_bits () const
 

‍return the stride (in bits) of the single child of the DataLayout


 
const Nodechild () const
 

‍returns a reference to the single child of this DataLayout


 
 operator bool () const
 

‍returns true iff this DataLayout has a child


 
 operator const INode & () const
 

‍returns a reference to the DataLayout's internal INode object


 
Leafadd_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.
 
INodeadd_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_
 

‍use an INode to store a single child, allowing us to exploit INode abstractions within DataLayout


 

Friends

M_LCOV_EXCL_START friend std::ostream & operator<< (std::ostream &out, const DataLayout &layout)
 

Detailed Description

Models how data is laid out in a linear address space.

Definition at line 28 of file DataLayout.hpp.

Member Typedef Documentation

◆ callback_leaves_t

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.

◆ level_info_stack_t

Definition at line 53 of file DataLayout.hpp.

◆ size_type

using m::storage::DataLayout::size_type = std::size_t

Definition at line 31 of file DataLayout.hpp.

Constructor & Destructor Documentation

◆ DataLayout()

m::storage::DataLayout::DataLayout ( size_type  num_tuples = 0)
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.

Member Function Documentation

◆ accept()

void DataLayout::accept ( ConstDataLayoutVisitor &  v) const

Definition at line 159 of file DataLayout.cpp.

◆ add_inode()

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().

◆ add_leaf()

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().

◆ child()

const Node & m::storage::DataLayout::child ( ) const
inline

◆ dump() [1/2]

void m::storage::DataLayout::dump ( ) const
inline

Definition at line 237 of file DataLayout.hpp.

References dump().

Referenced by dump().

◆ dump() [2/2]

void m::storage::DataLayout::dump ( std::ostream &  out) const
inline

Definition at line 238 of file DataLayout.hpp.

◆ for_sibling_leaves()

void DataLayout::for_sibling_leaves ( DataLayout::callback_leaves_t  callback) const

◆ is_finite()

bool m::storage::DataLayout::is_finite ( ) const
inline

‍returns true iff this DataLayout 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().

◆ num_tuples()

size_type m::storage::DataLayout::num_tuples ( ) const
inline

‍returns the number of tuples laid out by this DataLayout; must not be called when not 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().

◆ operator bool()

m::storage::DataLayout::operator bool ( ) const
inline

‍returns true iff this DataLayout has a child

Definition at line 212 of file DataLayout.hpp.

References m::storage::DataLayout::INode::num_children().

◆ operator const INode &()

m::storage::DataLayout::operator const INode & ( ) const
inlineexplicit

‍returns a reference to the DataLayout's internal INode object

Definition at line 214 of file DataLayout.hpp.

◆ stride_in_bits()

uint64_t m::storage::DataLayout::stride_in_bits ( ) const
inline

Friends And Related Function Documentation

◆ operator<<

M_LCOV_EXCL_START friend std::ostream & operator<< ( std::ostream &  out,
const DataLayout layout 
)
friend

Definition at line 228 of file DataLayout.hpp.

Field Documentation

◆ inode_

INode m::storage::DataLayout::inode_
private

‍use an INode to store a single child, allowing us to exploit INode abstractions within DataLayout

Definition at line 191 of file DataLayout.hpp.

Referenced by add_inode(), add_leaf(), and for_sibling_leaves().


The documentation for this struct was generated from the following files: