WIN32 updates
[yazpp-moved-to-github.git] / include / yaz++ / record-cache.h
1 /*
2  * Copyright (c) 2002-2004, Index Data.
3  * See the file LICENSE for details.
4  * 
5  * $Id: record-cache.h,v 1.1 2004-03-29 22:46:50 adam Exp $
6  */
7
8
9 #include <yaz/nmem.h>
10 #include <yaz/z-core.h>
11
12 class Yaz_RecordCache_Entry;
13
14 class YAZ_EXPORT Yaz_RecordCache {
15  public:
16     Yaz_RecordCache ();
17     ~Yaz_RecordCache ();
18     void add (ODR o, Z_NamePlusRecordList *npr, int start, int hits);
19     
20     int lookup (ODR o, Z_NamePlusRecordList **npr, int start, int num,
21                 Odr_oid *syntax, Z_RecordComposition *comp);
22     void clear();
23
24     void copy_searchRequest(Z_SearchRequest *sr);
25     void copy_presentRequest(Z_PresentRequest *pr);
26     void set_max_size(int sz);
27  private:
28     NMEM m_mem;
29     Yaz_RecordCache_Entry *m_entries;
30     Z_SearchRequest *m_searchRequest;
31     Z_PresentRequest *m_presentRequest;
32     int match (Yaz_RecordCache_Entry *entry,
33                Odr_oid *syntax, int offset,
34                Z_RecordComposition *comp);
35     int m_max_size;
36 };