aboutsummaryrefslogtreecommitdiff
path: root/module/vcomponent/data-stores/meta.scm
blob: 8ec5f7fd28b7bf331ee07bc9dd454a5b7a936ae5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
;;; Commentary:
;;; A virtual data store which uses other data stores for its storage.
;;; Used to merge stores into larger stores
;;; Code:

(define-module (vcomponent data-stores meta)
  :use-module (oop goops)
  :use-module (vcomponent data-stores common)
  :use-module (srfi srfi-41)
  :use-module ((srfi srfi-88) :select ())
  :export ()
  )

(define-class <meta-data-store> (<calendar-data-store>)
  (stores accessor: stores
          init-value: '()
          init-keyword: stores:))



(define-method (get-all (this <meta-data-store>))
  (map get-all (stores this)))

(define-method (get-by-uid (this <meta-data-store>) (uid <string>))
  (stream-car
   (stream-append
    (steam-map (lambda (store) (get-by-uid store uid))
               (list->stream (stores this)))
    (stream #f))))