View Source vdist_atom_cache (erldist_filter v1.1.0)

Link to this section Summary

Link to this section Types

-type index() :: 0..2047.
-type t() :: #vdist_atom_cache{}.

Link to this section Functions

-spec atom_cache_index(Atom) -> Index when Atom :: atom(), Index :: index().
-spec diff(t(), t()) -> #{del := ordsets:ordset(atom()), add := ordsets:ordset(atom())}.
-spec fill() -> t().
-spec fill(t()) -> t().
-spec fill(t(), non_neg_integer()) -> t().
-spec find(Cache, Atom) -> {ok, {Index, Atom}} | {error, Reason}
        when
            Cache :: t(),
            Atom :: atom(),
            Index :: index(),
            Reason :: not_found | {already_present, {Index, OtherAtom}},
            OtherAtom :: atom();
    (Cache, Index) -> {ok, {Index, Atom}} | {error, Reason}
        when Cache :: t(), Atom :: atom(), Index :: index(), Reason :: not_found.
Link to this function

find_or_insert(Cache, Atom)

View Source
-spec find_or_insert(Cache, Atom) -> {ok, {Index, Atom}, Cache} | {error, Reason}
                  when
                      Cache :: t(),
                      Atom :: atom(),
                      Index :: index(),
                      Reason :: {already_present, {Index, OtherAtom}} | max_atom_cache_size,
                      OtherAtom :: atom().
Link to this function

insert(Cache0, Index, Atom)

View Source
-spec insert(t(), non_neg_integer(), atom()) -> {ok, {non_neg_integer(), atom()}, t()}.
Link to this function

is_filled(Vdist_atom_cache)

View Source
-spec is_filled(t()) -> boolean().
-spec new() -> Cache when Cache :: t().