class CryStorage::PageManagement::MemoryManager

Defined in:

page_manager.cr

Constant Summary

MAX_SIZE = 20
PAGE_SIZE = 1024

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class CryStorage::PageManagement::IManager

new_page : Tuple(Index, IO::Memory) new_page, new_table_page(schema, cls = Page(Slot)) new_table_page, table_page(id, schema, cls = Page(Slot)) table_page

Instance methods inherited from module Enumerable(IO::Memory)

tabulate(io) tabulate

Instance methods inherited from class Object

tabulate(io)
tabulate
tabulate
, tap(&) tap

Constructor Detail

def self.new #

[View source]

Class Method Detail

def self.default #

[View source]

Instance Method Detail

def [](index : Int) : IO::Memory #
Description copied from module Indexable(IO::Memory)

Returns the element at the given index.

Negative indices can be used to start counting from the end of the array. Raises IndexError if trying to access an element outside the array's range.

ary = ['a', 'b', 'c']
ary[0]  # => 'a'
ary[2]  # => 'c'
ary[-1] # => 'c'
ary[-2] # => 'b'

ary[3]  # raises IndexError
ary[-4] # raises IndexError

[View source]
def []=(index : Int, page : IPage) #

[View source]
def new_page : Tuple(Index, IO::Memory) #

[View source]
def size : Int #
Description copied from module Indexable(IO::Memory)

Returns the number of elements in this container.


[View source]
def unsafe_fetch(index : Int) : IO::Memory #
Description copied from module Indexable(IO::Memory)

Returns the element at the given index, without doing any bounds check.

Indexable makes sure to invoke this method with index in 0...size, so converting negative indices to positive ones is not needed here.

Clients never invoke this method directly. Instead, they access elements with #[](index) and #[]?(index).

This method should only be directly invoked if you are absolutely sure the index is in bounds, to avoid a bounds check for a small boost of performance.


[View source]
def unsafe_put(index : Int, value : IO::Memory) #
Description copied from module Indexable::Mutable(IO::Memory)

Sets the element at the given index to value, without doing any bounds check.

Indexable::Mutable makes sure to invoke this method with index in 0...size, so converting negative indices to positive ones is not needed here.

Clients never invoke this method directly. Instead, they modify elements with #[]=(index, value).

This method should only be directly invoked if you are absolutely sure the index is in bounds, to avoid a bounds check for a small boost of performance.


[View source]