A columnar table of homogeneous numeric columns (tag 0x0D).
An object table is the binary equivalent of the TOON tabular array form:
each column holds the raw buffer for one field, decoded in bulk. Decoding
with typed_arrays: :views returns this struct; otherwise rows are
materialised as a list of maps.
Examples
iex> table = Btoon.ObjectTable.from_rows([%{"x" => 1, "y" => 2.5}, %{"x" => 3, "y" => 4.5}])
iex> Btoon.ObjectTable.rows(table)
[%{"x" => 1, "y" => 2.5}, %{"x" => 3, "y" => 4.5}]
Summary
Functions
Returns the column definitions.
Builds an object table from a list of maps. All maps must share the same
keys and every column must be homogeneous numeric (Btoon.Types.encodable).
Row count of the table.
Materialises the table as a list of maps.
Types
@type t() :: %ToonEx.Btoon.ObjectTable{ columns: [ToonEx.Btoon.ObjectTable.Column.t()], row_count: non_neg_integer() }
Functions
@spec columns(t()) :: [ToonEx.Btoon.ObjectTable.Column.t()]
Returns the column definitions.
Builds an object table from a list of maps. All maps must share the same
keys and every column must be homogeneous numeric (Btoon.Types.encodable).
@spec row_count(t()) :: non_neg_integer()
Row count of the table.
Materialises the table as a list of maps.