![]() |
mutable
A Database System for Research and Fast Prototyping
|
A block of size N
contains N
tuples.
More...
#include <Interpreter.hpp>
Data Structures | |
struct | the_iterator |
Public Types | |
using | iterator = the_iterator< false > |
using | const_iterator = the_iterator< true > |
Public Member Functions | |
Block ()=default | |
Block (const Block &)=delete | |
Block (Block &&)=delete | |
Block (Schema schema) | |
Create a new Block with tuples of Schema schema . | |
Tuple * | data () |
Return a pointer to the underlying array of tuples. | |
const Tuple * | data () const |
Return a pointer to the underlying array of tuples. | |
const Schema & | schema () const |
std::size_t | size () const |
Return the number of alive tuples in this Block . | |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
const_iterator | cbegin () const |
const_iterator | cend () const |
iterator | at (std::size_t index) |
Returns an iterator to the tuple at index index . | |
const_iterator | at (std::size_t index) const |
Returns an iterator to the tuple at index index . | |
bool | alive (std::size_t index) const |
Check whether the tuple at the given index is alive. | |
bool | empty () const |
Returns true iff the block has no alive tuples, i.e. size() == 0 . | |
uint64_t | mask () const |
Returns the bit mask that identifies which tuples of this Block are alive. | |
void | mask (uint64_t new_mask) |
Returns the bit mask that identifies which tuples of this Block are alive. | |
Tuple & | operator[] (std::size_t index) |
Returns the tuple at index index . | |
const Tuple & | operator[] (std::size_t index) const |
Returns the tuple at index index . | |
void | fill () |
Make all tuples in this Block alive. | |
void | erase (std::size_t index) |
Erase the tuple at the given index from this Block . | |
void | erase (iterator it) |
Erase the tuple identified by it from this Block . | |
void | erase (const_iterator it) |
Erase the tuple identified by it from this Block . | |
void | clear () |
Renders all tuples dead and removes their attributes. | |
void | dump (std::ostream &out) const |
void | dump () const |
Static Public Member Functions | |
static constexpr std::size_t | capacity () |
Return the capacity of this Block . | |
Static Public Attributes | |
static constexpr std::size_t | CAPACITY = N |
the capacity of a block | |
Static Private Member Functions | |
static constexpr uint64_t | AllOnes () |
Returns a bit vector with left-most capacity() many bits set to 1 and the others set to 0 . | |
Private Attributes | |
std::array< Tuple, N > | data_ |
an array of the tuples of this Block ; some slots may be unused | |
uint64_t | mask_ = 0x0 |
a mast identifying which slots of data_ are in use | |
Schema | schema_ |
Friends | |
M_LCOV_EXCL_START friend std::ostream & | operator<< (std::ostream &out, const Block< N > &block) |
Print a textual representation of this Block to out . | |
A block of size N
contains N
tuples.
Definition at line 19 of file Interpreter.hpp.
using m::Block< N >::const_iterator = the_iterator<true> |
Definition at line 57 of file Interpreter.hpp.
using m::Block< N >::iterator = the_iterator<false> |
Definition at line 56 of file Interpreter.hpp.
|
default |
Create a new Block
with tuples of Schema
schema
.
Definition at line 71 of file Interpreter.hpp.
References m::Block< N >::data_, and m::Block< N >::schema_.
|
inline |
Check whether the tuple at the given index
is alive.
Definition at line 106 of file Interpreter.hpp.
References m::Block< N >::capacity(), M_insist, and m::Block< N >::mask_.
Referenced by m::Block< N >::operator[]().
|
inlinestaticconstexprprivate |
Returns a bit vector with left-most capacity()
many bits set to 1
and the others set to 0
.
Definition at line 121 of file Interpreter.hpp.
References m::Block< N >::capacity(), and m::Block< N >::mask_.
Referenced by m::Block< N >::fill().
Returns an iterator to the tuple at index index
.
Definition at line 98 of file Interpreter.hpp.
References m::Block< N >::capacity(), M_insist, and m::Block< N >::mask_.
|
inline |
Returns an iterator to the tuple at index index
.
Definition at line 103 of file Interpreter.hpp.
References m::Block< N >::at().
Referenced by m::Block< N >::at().
Definition at line 90 of file Interpreter.hpp.
References m::Block< N >::mask_.
|
inline |
Definition at line 92 of file Interpreter.hpp.
References m::Block< N >::mask_.
|
inlinestaticconstexpr |
Return the capacity of this Block
.
Definition at line 86 of file Interpreter.hpp.
References m::Block< N >::CAPACITY.
Referenced by m::Block< N >::alive(), m::Block< N >::AllOnes(), m::Block< N >::at(), m::Block< N >::erase(), m::Block< N >::fill(), and m::Block< N >::operator[]().
|
inline |
Definition at line 94 of file Interpreter.hpp.
References m::Block< N >::mask_.
|
inline |
Definition at line 95 of file Interpreter.hpp.
|
inline |
Renders all tuples dead and removes their attributes.
Definition at line 147 of file Interpreter.hpp.
References m::Block< N >::data_, and m::Block< N >::mask_.
Referenced by m::Pipeline::clear().
Return a pointer to the underlying array of tuples.
Definition at line 79 of file Interpreter.hpp.
References m::Block< N >::data_.
Return a pointer to the underlying array of tuples.
Definition at line 81 of file Interpreter.hpp.
References m::Block< N >::data_.
|
inline |
Definition at line 173 of file Interpreter.hpp.
References m::Block< N >::dump().
Referenced by m::Block< N >::dump().
|
inline |
Definition at line 168 of file Interpreter.hpp.
|
inline |
Returns true
iff the block has no alive tuples, i.e. size() == 0
.
Definition at line 112 of file Interpreter.hpp.
References m::Block< N >::size().
Definition at line 91 of file Interpreter.hpp.
|
inline |
Definition at line 93 of file Interpreter.hpp.
|
inline |
Erase the tuple identified by it
from this Block
.
Definition at line 144 of file Interpreter.hpp.
References m::Block< N >::erase(), and m::Block< N >::the_iterator< C >::index().
Referenced by m::Block< N >::erase().
Erase the tuple identified by it
from this Block
.
Definition at line 142 of file Interpreter.hpp.
References m::Block< N >::erase(), and m::Block< N >::the_iterator< C >::index().
Referenced by m::Block< N >::erase().
|
inline |
Erase the tuple at the given index
from this Block
.
Definition at line 137 of file Interpreter.hpp.
References m::Block< N >::capacity(), M_insist, m::Block< N >::mask_, and m::setbit().
|
inline |
Make all tuples in this Block
alive.
Definition at line 134 of file Interpreter.hpp.
References m::Block< N >::AllOnes(), m::Block< N >::capacity(), M_insist, m::Block< N >::mask_, and m::Block< N >::size().
|
inline |
Returns the bit mask that identifies which tuples of this Block
are alive.
Definition at line 115 of file Interpreter.hpp.
References m::Block< N >::mask_.
Referenced by m::Pipeline::Pipeline().
|
inline |
Returns the bit mask that identifies which tuples of this Block
are alive.
Definition at line 117 of file Interpreter.hpp.
References m::Block< N >::mask_.
Returns the tuple at index index
.
The tuple must be alive!
Definition at line 125 of file Interpreter.hpp.
References m::Block< N >::alive(), m::Block< N >::capacity(), m::Block< N >::data_, and M_insist.
Returns the tuple at index index
.
The tuple must be alive!
Definition at line 131 of file Interpreter.hpp.
Definition at line 83 of file Interpreter.hpp.
References m::Block< N >::schema_.
Referenced by m::Pipeline::schema().
|
inline |
Return the number of alive tuples in this Block
.
Definition at line 88 of file Interpreter.hpp.
References m::Block< N >::mask_.
Referenced by m::Block< N >::empty(), and m::Block< N >::fill().
|
friend |
Print a textual representation of this Block
to out
.
Definition at line 155 of file Interpreter.hpp.
|
staticconstexpr |
the capacity of a block
Definition at line 21 of file Interpreter.hpp.
Referenced by m::Block< N >::capacity().
an array of the tuples of this Block
; some slots may be unused
Definition at line 60 of file Interpreter.hpp.
Referenced by m::Block< N >::Block(), m::Block< N >::clear(), m::Block< N >::data(), and m::Block< N >::operator[]().
|
private |
a mast identifying which slots of data_
are in use
Definition at line 61 of file Interpreter.hpp.
Referenced by m::Block< N >::alive(), m::Block< N >::AllOnes(), m::Block< N >::at(), m::Block< N >::begin(), m::Block< N >::cbegin(), m::Block< N >::clear(), m::Block< N >::erase(), m::Block< N >::fill(), m::Block< N >::mask(), and m::Block< N >::size().
Definition at line 63 of file Interpreter.hpp.
Referenced by m::Block< N >::Block(), and m::Block< N >::schema().