X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Fyazpp%2Frecord-cache.h;fp=include%2Fyazpp%2Frecord-cache.h;h=d53533fd09897b4d3c1893e7f9d1dc91a31a0682;hb=0cc824e02bc2c69986bec8c9dd9ff53f07a0cd3d;hp=0000000000000000000000000000000000000000;hpb=76d66b222afff97cf367a3e7b8bfe045a62d0d57;p=yazpp-moved-to-github.git diff --git a/include/yazpp/record-cache.h b/include/yazpp/record-cache.h new file mode 100644 index 0000000..d53533f --- /dev/null +++ b/include/yazpp/record-cache.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2002-2004, Index Data. + * See the file LICENSE for details. + * + * $Id: record-cache.h,v 1.1 2006-03-29 13:14:15 adam Exp $ + */ + + +#include +#include + +namespace yazpp_1 { +class RecordCache_Entry; + +class YAZ_EXPORT RecordCache { + public: + RecordCache (); + ~RecordCache (); + void add (ODR o, Z_NamePlusRecordList *npr, int start, int hits); + + int lookup (ODR o, Z_NamePlusRecordList **npr, int start, int num, + Odr_oid *syntax, Z_RecordComposition *comp); + void clear(); + + void copy_searchRequest(Z_SearchRequest *sr); + void copy_presentRequest(Z_PresentRequest *pr); + void set_max_size(int sz); + private: + NMEM m_mem; + RecordCache_Entry *m_entries; + Z_SearchRequest *m_searchRequest; + Z_PresentRequest *m_presentRequest; + int match (RecordCache_Entry *entry, + Odr_oid *syntax, int offset, + Z_RecordComposition *comp); + int m_max_size; +}; +}; +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ +