view

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2022 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package view contains general page view constants and functions.

PageView is the super-struct for all page views. A page view is special object attached to a particular StorageFile record. A view provides specialised functions for the record it is attached to.

Use GetPageView() if the record has already view information stored on it or NewPageView() to initialise or reassign a given record.

Index

Constants

View Source
const OffsetData = OffsetPrevPage + file.SizeLong

OffsetData is the offset for page specific data

View Source
const OffsetNextPage = file.SizeShort

OffsetNextPage is the offset for next page id

View Source
const OffsetPrevPage = OffsetNextPage + file.SizeLong

OffsetPrevPage is the offset for previous page id

View Source
const TypeDataPage = 1

TypeDataPage is a page which is in use and contains data

View Source
const TypeFreeLogicalSlotPage = 3

TypeFreeLogicalSlotPage is a page which holds free logical slot ids (used to give stable ids to objects which can grow in size)

View Source
const TypeFreePage = 0

TypeFreePage is a free page waiting to be (re)allocated

View Source
const TypeFreePhysicalSlotPage = 4

TypeFreePhysicalSlotPage is a page which holds free physical slot ids

View Source
const TypeTranslationPage = 2

TypeTranslationPage is a page which translates between physical and logical row ids

View Source
const ViewPageHeader = 0x1990

ViewPageHeader is the header magic number to identify view pages

Variables

This section is empty.

Functions

This section is empty.

Types

type PageView

type PageView struct {
	Record *file.Record // Record which is wrapped by the PageView
}

PageView data structure

func GetPageView

func GetPageView(record *file.Record) *PageView

GetPageView returns the page view of a given record.

func NewPageView

func NewPageView(record *file.Record, pagetype int16) *PageView

NewPageView creates a new page view for a given record.

func (*PageView) NextPage

func (pv *PageView) NextPage() uint64

NextPage returns the id of the next page.

func (*PageView) PrevPage

func (pv *PageView) PrevPage() uint64

PrevPage returns the id of the previous page.

func (*PageView) SetNextPage

func (pv *PageView) SetNextPage(val uint64)

SetNextPage sets the id of the next page.

func (*PageView) SetPrevPage

func (pv *PageView) SetPrevPage(val uint64)

SetPrevPage sets the id of the previous page.

func (*PageView) SetType

func (pv *PageView) SetType(pagetype int16)

SetType sets the type of this page view which is stored on the record.

func (*PageView) String

func (pv *PageView) String() string

func (*PageView) Type

func (pv *PageView) Type() int16

Type gets the type of this page view which is stored on the record.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL