Module ecapnp_data

Data server module.

Copyright 2013, Andreas Stenius

Behaviours: gen_server.

Authors: Andreas Stenius (kaos@astekk.se).

Description

Data server module

All objects data is held in a data process, implemented by this module.

Data Types

segment_id()

segment_id() = ecapnp:segment_id()

Function Index

add_ref/2
alloc/3Allocate data.
code_change/3
discard_ref/2
get_cap/2
get_cap_idx/2
get_cap_table/1
get_segment/4Read data from segment.
get_segment_size/2Get size of segment, in words (8 bytes).
get_segments/1Get all allocated data from all segments.
handle_call/3
handle_cast/2
handle_info/2
init/1
set_cap_table/2
start/1
start_link/1
stop/1
terminate/2
update_segment/3Write data to segment.

Function Details

add_ref/2

add_ref(Ref, Pid) -> any()

alloc/3

alloc(Id::segment_id(), Size::integer(), Pid::pid()) -> {segment_id(), Offset::integer()}

Allocate data.

Preferably from segment id Id, if possible. This will rarely fail, as new segments are added in case there is not enough free space left.

code_change/3

code_change(OldVsn, State, Extra) -> any()

discard_ref/2

discard_ref(Ref, Pid) -> any()

get_cap/2

get_cap(Idx, Pid) -> any()

get_cap_idx/2

get_cap_idx(Cap, Pid) -> any()

get_cap_table/1

get_cap_table(Pid) -> any()

get_segment/4

get_segment(Id::segment_id(), Offset::integer(), Length::integer(), Pid::pid()) -> binary()

Read data from segment.

get_segment_size/2

get_segment_size(Id::segment_id(), Pid::pid()) -> integer()

Get size of segment, in words (8 bytes).

get_segments/1

get_segments(Pid::pid()) -> [binary()]

Get all allocated data from all segments.

handle_call/3

handle_call(X1, From, State) -> any()

handle_cast/2

handle_cast(X1, State) -> any()

handle_info/2

handle_info(Info, State) -> any()

init/1

init(X1) -> any()

set_cap_table/2

set_cap_table(CapTable, Pid) -> any()

start/1

start(Init) -> any()

start_link/1

start_link(Init) -> any()

stop/1

stop(Pid) -> any()

terminate/2

terminate(Reason, State) -> any()

update_segment/3

update_segment(X1::{segment_id(), integer()}, Data::binary(), Pid::pid()) -> ok

Write data to segment.


Generated by EDoc, May 30 2014, 12:56:29.