mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Private Attributes
m::ColumnStore Struct Reference

This class implements a column store. More...

#include <ColumnStore.hpp>

Inheritance diagram for m::ColumnStore:
[legend]
Collaboration diagram for m::ColumnStore:
[legend]

Public Member Functions

 ColumnStore (const Table &table)
 
 ~ColumnStore ()
 
virtual std::size_t num_rows () const override
 Return the number of rows in this store.
 
std::size_t row_size () const
 Returns the effective size of a row, in bits.
 
void append () override
 Append a row to the store.
 
void drop () override
 Drop the most recently appended row.
 
const memory::Memorymemory () const override
 Returns the memory of the store.
 
void * memory (std::size_t attr_id) const
 Returns the memory address where the column assigned to the attribute with id attr_id starts.
 
void dump (std::ostream &out) const override
 
virtual void dump (std::ostream &out) const=0
 
void dump () const
 
const Tabletable () const
 

Static Public Attributes

static constexpr std::size_t ALLOCATION_SIZE = 1UL << 30
 1 GiB
 

Private Attributes

memory::LinearAllocator allocator_
 the memory allocator
 
memory::Memory data_
 
std::size_t num_rows_ = 0
 
std::size_t capacity_
 
std::size_t row_size_ = 0
 
const Tabletable_
 the table defining this store's schema
 

Detailed Description

This class implements a column store.

Definition at line 11 of file ColumnStore.hpp.

Constructor & Destructor Documentation

◆ ColumnStore()

ColumnStore::ColumnStore ( const Table table)

◆ ~ColumnStore()

ColumnStore::~ColumnStore ( )

Definition at line 33 of file ColumnStore.cpp.

Member Function Documentation

◆ append()

void m::ColumnStore::append ( )
inlineoverridevirtual

Append a row to the store.

Implements m::Store.

Definition at line 35 of file ColumnStore.hpp.

References capacity_, and num_rows_.

◆ drop()

void m::ColumnStore::drop ( )
inlineoverridevirtual

Drop the most recently appended row.

Implements m::Store.

Definition at line 41 of file ColumnStore.hpp.

References M_insist, and num_rows_.

◆ dump() [1/3]

M_LCOV_EXCL_START void Store::dump ( ) const

Definition at line 51 of file Store.cpp.

◆ dump() [2/3]

M_LCOV_EXCL_START void ColumnStore::dump ( std::ostream &  out) const
overridevirtual

Implements m::Store.

Definition at line 36 of file ColumnStore.cpp.

References capacity_, m::Table::name(), num_rows_, row_size_, and m::Store::table().

◆ dump() [3/3]

virtual void m::Store::dump ( std::ostream &  out) const
virtual

Implements m::Store.

◆ memory() [1/2]

const memory::Memory & m::ColumnStore::memory ( ) const
inlineoverridevirtual

Returns the memory of the store.

Implements m::Store.

Definition at line 47 of file ColumnStore.hpp.

References data_.

◆ memory() [2/2]

void * m::ColumnStore::memory ( std::size_t  attr_id) const
inline

Returns the memory address where the column assigned to the attribute with id attr_id starts.

Return the address of the NULL bitmap column if attr_id == table().size().

Definition at line 50 of file ColumnStore.hpp.

References m::memory::Memory::addr(), ALLOCATION_SIZE, data_, M_insist, and m::Store::table().

◆ num_rows()

virtual std::size_t m::ColumnStore::num_rows ( ) const
inlineoverridevirtual

Return the number of rows in this store.

Implements m::Store.

Definition at line 30 of file ColumnStore.hpp.

References num_rows_.

◆ row_size()

std::size_t m::ColumnStore::row_size ( ) const
inline

Returns the effective size of a row, in bits.

Definition at line 33 of file ColumnStore.hpp.

References row_size_.

◆ table()

const Table & m::Store::table ( ) const
inlineinherited

Field Documentation

◆ ALLOCATION_SIZE

constexpr std::size_t m::ColumnStore::ALLOCATION_SIZE = 1UL << 30
staticconstexpr

1 GiB

Definition at line 14 of file ColumnStore.hpp.

Referenced by ColumnStore(), and memory().

◆ allocator_

memory::LinearAllocator m::ColumnStore::allocator_
private

the memory allocator

Definition at line 20 of file ColumnStore.hpp.

Referenced by ColumnStore().

◆ capacity_

std::size_t m::ColumnStore::capacity_
private

Definition at line 23 of file ColumnStore.hpp.

Referenced by append(), ColumnStore(), and dump().

◆ data_

memory::Memory m::ColumnStore::data_
private

Definition at line 21 of file ColumnStore.hpp.

Referenced by ColumnStore(), and memory().

◆ num_rows_

std::size_t m::ColumnStore::num_rows_ = 0
private

Definition at line 22 of file ColumnStore.hpp.

Referenced by append(), drop(), dump(), and num_rows().

◆ row_size_

std::size_t m::ColumnStore::row_size_ = 0
private

Definition at line 24 of file ColumnStore.hpp.

Referenced by ColumnStore(), dump(), and row_size().

◆ table_

const Table& m::Store::table_
privateinherited

the table defining this store's schema

Definition at line 24 of file Store.hpp.


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