Commit | Line | Data |
---|---|---|
91eba41f C |
1 | (* !!take care!!: this class does side effect, not a pure oassoc. |
2 | * | |
3 | * Also can not put structure with ref or mutable field because when | |
4 | * you will modify those refs or fields, you will modify it in the memory, | |
5 | * not in the disk. The only way to modify on the disk is to call | |
6 | * #add or #replace with what you modified. Oassocbdb has no way | |
7 | * to know that you modified it. | |
8 | *) | |
34e49164 C |
9 | class ['a,'b] oassoc_btree : |
10 | Bdb.db -> | |
11 | string (* db name, for profiling *) -> | |
12 | (unit -> Bdb.dbtxn option) (* transaction handler *) -> | |
13 | ('b -> 'e) -> ('e -> 'b) (* marshaller/unmarshaller wrappers *) -> | |
14 | object('o) | |
15 | inherit ['a,'b] Oassoc.oassoc | |
16 | ||
17 | (* ocollection concrete instantiation of virtual methods *) | |
18 | method empty : 'o | |
19 | method add : 'a * 'b -> 'o | |
20 | ||
21 | method iter : ('a * 'b -> unit) -> unit | |
22 | method view : ('a * 'b, 'o) Ocollection.view | |
23 | ||
24 | method del : 'a * 'b -> 'o | |
25 | method mem : 'a * 'b -> bool | |
26 | method null : bool | |
27 | ||
28 | (* oassoc concrete instantiation of virtual methods *) | |
29 | method assoc : 'a -> 'b | |
30 | method delkey : 'a -> 'o | |
31 | ||
91eba41f C |
32 | method keys: 'a list |
33 | ||
34e49164 | 34 | end |
91eba41f C |
35 | |
36 | val create_bdb: | |
37 | string -> | |
38 | string -> | |
39 | Bdb.dbenv -> | |
40 | (unit -> Bdb.dbtxn option) -> | |
41 | ('a -> 'b) * ('c -> 'a) -> | |
42 | int -> | |
43 | Bdb.db * ('d, 'a) Oassoc_buffer.oassoc_buffer |