Skip to content

Commit

Permalink
Add getters for the filter/stamp funs
Browse files Browse the repository at this point in the history
  • Loading branch information
Vagabond committed Jan 10, 2019
1 parent 1343e7a commit 4f12c95
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/hbbft.erl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

-export([init/6,
init/7,
get_stamp_fun/1,
get_filter_fun/1,
set_stamp_fun/4,
set_filter_fun/4,
start_on_demand/1,
Expand Down Expand Up @@ -98,6 +100,14 @@ init(SK, N, F, J, BatchSize, MaxBuf) ->
init(SK, N, F, J, BatchSize, MaxBuf, {M, Fn, A}) ->
#hbbft_data{secret_key=SK, n=N, f=F, j=J, batch_size=BatchSize, acs=hbbft_acs:init(SK, N, F, J), max_buf=MaxBuf, stampfun={M, Fn, A}}.

-spec get_stamp_fun(hbbft_data()) -> {atom(), atom(), list()} | undefined.
get_stamp_fun(#hbbft_data{stampfun=S}) ->
S.

-spec get_filter_fun(hbbft_data()) -> {atom(), atom(), list()} | undefined.
get_filter_fun(#hbbft_data{filterfun=S}) ->
S.

-spec set_stamp_fun(atom(), atom(), list(), hbbft_data()) -> hbbft_data().
set_stamp_fun(M, F, A, Data) when is_atom(M), is_atom(F) ->
Data#hbbft_data{stampfun={M, F, A}}.
Expand Down

0 comments on commit 4f12c95

Please sign in to comment.