I files svlib09.cpp e svlib09.h permettono la gestione delle cache di lettura e SCRITTURA che operano su un Localisamfile Il metodo più importante è "put(rectype)", simmetrico di get() delle cache normali. La cache ha un algoritmo di discarding semplice (sbatte via una chiave a caso) ma è possibile imporre una politica particolare mediante la ridefinizione della funzione virtuale getkey2discard() git-svn-id: svn://10.65.10.50/trunk@5782 c028cbd2-c16b-5b4b-a496-9718f37d4682
42 lines
841 B
C++
Executable File
42 lines
841 B
C++
Executable File
#ifndef __SVLIB09_H
|
|
#define __SVLIB09_H
|
|
|
|
#ifndef __ASSOC_H
|
|
#include "assoc.h"
|
|
#endif
|
|
|
|
#ifndef __VELIB_H
|
|
#include "..\ve\velib.h"
|
|
#endif
|
|
|
|
#ifndef __TABUTIL_H
|
|
#include <tabutil.h>
|
|
#endif
|
|
|
|
#include "..\mg\mglib.h"
|
|
|
|
class TRWrecord_cache : public TRecord_cache
|
|
{
|
|
TAssoc_array _flags;
|
|
|
|
protected:
|
|
THash_object * get_some_obj();
|
|
virtual const TString & getkey2discard();
|
|
public:
|
|
virtual void discard(const TString & k);
|
|
virtual void put(const TRectype &r);
|
|
virtual const TRectype& get(const char* chiave);
|
|
|
|
void clear();
|
|
void flush();
|
|
|
|
TRWrecord_cache(TLocalisamfile *f, int key = 1, bool lock=FALSE);
|
|
TRWrecord_cache(int num, int key = 1, bool lock=FALSE);
|
|
TRWrecord_cache(const char* table, int key = 1, bool lock=FALSE);
|
|
virtual ~TRWrecord_cache() ;
|
|
const TAssoc_array * internal_array() {return &_cache;}
|
|
};
|
|
|
|
#endif
|
|
|