Module ecapnp_obj

Everything object.

Copyright 2013, Andreas Stenius

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

Description

Everything object.

Structs.. structs.. and more structs.

Data Types

field_name()

field_name() = ecapnp:field_name()

field_type()

field_type() = ecapnp:field_type()

object()

object() = ecapnp:object()

schema_node()

schema_node() = ecapnp:schema_node()

segment_id()

segment_id() = ecapnp:segment_id()

type_name()

type_name() = ecapnp:type_name()

Function Index

add_ref/2
alloc/3Allocate data for a new object.
copy/1Copy object recursively.
discard_ref/2
field/2Lookup field definition by name for object.
from_data/2
from_data/3Get object (or list) from data.
from_ref/3Get object (or list) from reference.
get_cap_table/1
init/1
init/2
refresh/1Reread object reference.
set_cap_table/2
to_data/1Type cast object to binary data.
to_list/2Type cast object to list of type.
to_struct/2Type cast object to another type of object.
to_text/1Type cast object to text.

Function Details

add_ref/2

add_ref(Ref, Object) -> any()

alloc/3

alloc(Node::schema_node(), SegmentId::segment_id(), Data::pid()) -> object()

Allocate data for a new object.

copy/1

copy(Object::object()) -> binary()

Copy object recursively.

discard_ref/2

discard_ref(Ref, Object) -> any()

field/2

field(NameOrId::field_name() | non_neg_integer() | {ptr, non_neg_integer()}, Object::object()) -> field_type()

Lookup field definition by name for object.

from_data/2

from_data(Data, Type) -> any()

from_data/3

from_data(Data::binary() | [binary()], Type::type_name(), Schema::term()) -> object() | list()

Get object (or list) from data.

Returns a reader object (i.e. a read-only version).

See also: from_ref/2.

from_ref/3

from_ref(Ref::#ref{segment = undefined | ecapnp:segment_id(), pos = ecapnp:segment_pos(), offset = ecapnp:segment_offset(), align = ecapnp:bit_count(), kind = ecapnp:ref_kind(), data = undefined | #builder{pid = undefined | pid()} | #reader{data = undefined | [binary()] | binary(), caps = list()}}, Type::type_name(), Schema::term()) -> object() | list()

Get object (or list) from reference. from ref doesn't work well as it doesn't preserve/keep the schema module name..

get_cap_table/1

get_cap_table(Object) -> any()

init/1

init(Object) -> any()

init/2

init(Ref, Type) -> any()

refresh/1

refresh(Object::object()) -> object()

Reread object reference.

See also: ecapnp_ref:refresh/1.

set_cap_table/2

set_cap_table(CapTable, Object) -> any()

to_data/1

to_data(Object::object()) -> binary()

Type cast object to binary data. Object must be a reference to data.

to_list/2

to_list(Type::type_name(), Object::object()) -> list()

Type cast object to list of type. Object must be a reference to a list.

to_struct/2

to_struct(Type::type_name(), Object::object()) -> object()

Type cast object to another type of object.

to_text/1

to_text(Object::object()) -> binary()

Type cast object to text. Object must be a reference to text.


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