summaryrefslogtreecommitdiff
path: root/src/cache.sml
diff options
context:
space:
mode:
authorGravatar Ziv Scully <ziv@mit.edu>2015-05-06 23:11:30 -0400
committerGravatar Ziv Scully <ziv@mit.edu>2015-05-06 23:11:30 -0400
commitca3efa1458583772a9826198ed4b99eec381f2de (patch)
tree601805ceb6fea9d5d9282a2b2f51857b416e8f23 /src/cache.sml
parent9c155aa780bef9e6edae2c07516693c12b37962b (diff)
More work factoring out Sqlcache back end.
Diffstat (limited to 'src/cache.sml')
-rw-r--r--src/cache.sml16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/cache.sml b/src/cache.sml
new file mode 100644
index 00000000..8de22e0d
--- /dev/null
+++ b/src/cache.sml
@@ -0,0 +1,16 @@
+structure Cache = struct
+
+type cache =
+ {(* Takes a query ID and parameters (and, for store, the value to
+ store) and gives an FFI call that checks, stores, or flushes the
+ relevant entry. The parameters are strings for check and store and
+ optional strings for flush because some parameters might not be
+ fixed. *)
+ check : int * Mono.exp list -> Mono.exp',
+ store : int * Mono.exp list * Mono.exp -> Mono.exp',
+ flush : int * Mono.exp list -> Mono.exp',
+ (* Generates C needed for FFI calls in check, store, and flush. *)
+ setupGlobal : Print.PD.pp_desc,
+ setupQuery : {index : int, params : int} -> Print.PD.pp_desc}
+
+end