aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/Lifecycle.mli
blob: fa3abee82ec10f352cc08d300d661d939ad43245 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
class type lifecycle = object
  method reference : bool
  method release : unit
end

class type virtual controlled_lifecycle = object
  inherit lifecycle
  method virtual destroy : unit
end

class null : lifecycle
class virtual counted : controlled_lifecycle

(** stands for [inner], carrying what it carries, while holding a
    reference to [owner], so what [inner] reads outlives a release of
    the object that produced it. *)
class retaining : Protocols.Handle.t -> lifecycle -> object
  inherit lifecycle
  method destroy : unit
  method hash : Concepts.Hash.hash
  method protocols : Protocols.Handle.protocol list
end