Module Make.Sub

include P2p.S.SUBSCRIPTION
type 'a t
type gid
type group
val empty : 'a t

empty returns the empty subscription set.

val add : group -> 'a -> 'a t -> 'a t

add group 'a t adds group to the subscription set t

val remove : gid -> 'a t -> 'a t

remove group t removes group from the subscription set t

val length : 'a t -> int

length t returns the number of groups in the subscription set.

val is_empty : 'a t -> bool

is_empty t returns true if the subscription set is empty.

val mem : gid -> 'a t -> bool

mem gid t returns true if gid is in the subscription set.

val find : gid -> 'a t -> (group * 'a) option

find gid t returns Some group if gid is in the subscription set, otherwise None.

val filter : (gid -> (group * 'a) -> bool) -> 'a t -> 'a t
val fold : (gid -> (group * 'a) -> 'b -> 'b) -> 'a t -> 'b -> 'b
val iter : (gid -> (group * 'a) -> unit) -> 'a t -> unit
val map : (gid -> (group * 'a) -> group * 'a) -> 'a t -> 'a t
val to_list : 'a t -> (group * 'a) list

to_list t returns the subscription set as list ordered by group ID.

val init : int -> 'a t

int max_subs initializes an empty subscription set with max_subs maximum number of subscriptions expected.

val of_list : int -> (group * 'a) list -> 'a t

of_list max_subs sub_list initializes a subscription set from a list of (group, metadata) pairs

val bloom : 'a t -> Bitv.t

bloom t returns a bloom filter with the subscribed group IDs inserted.

val blip : 'a t -> float -> Bitv.t

blip t e is bloom with independent random bit flips.

parameter e

Differential privacy parameter ε. Determines the privacy-utility trade-off. See Blip.p in the documentation of the Blip module.