elixlsx v0.0.4 Elixlsx.Compiler.DBUtil

Generic functions for the Compiler.*DB modules.

Summary

Functions

return the ID for an object in the database

If the value does not exist in the database, return the tuple {dict, nextid} unmodified. Otherwise, returns a tuple {dict', nextid+1}, where dict' is the dictionary with the new element inserted (with id nextid)

Types

gen_db_datatype :: %{object_type => non_neg_integer}
gen_db_type :: {gen_db_datatype, non_neg_integer}
object_type :: any

Functions

get_id(dict, value)

Specs

get_id(gen_db_datatype, object_type) :: non_neg_integer

return the ID for an object in the database

id_sorted_values(dict)

Specs

id_sorted_values(gen_db_datatype) :: [object_type]
register(arg, value)

Specs

If the value does not exist in the database, return the tuple {dict, nextid} unmodified. Otherwise, returns a tuple {dict', nextid+1}, where dict' is the dictionary with the new element inserted (with id nextid)