| 1 |
root |
1.1 |
// -*- Mode: C++ -*- |
| 2 |
|
|
|
| 3 |
|
|
// GiSTstore.h |
| 4 |
|
|
// |
| 5 |
|
|
// Copyright (c) 1996, Regents of the University of California |
| 6 |
|
|
// $Header: /usr/local/devel/GiST/libGiST/libGiST/GiSTstore.h,v 1.1.1.1 1996/08/06 23:47:22 jmh Exp $ |
| 7 |
|
|
|
| 8 |
|
|
#ifndef GISTSTORE_H |
| 9 |
|
|
#define GISTSTORE_H |
| 10 |
|
|
|
| 11 |
|
|
#include "GiSTdefs.h" |
| 12 |
|
|
|
| 13 |
|
|
// GiSTstore is the parent class for storage of GiST pages. GiSTfile is |
| 14 |
|
|
// provided as an example descendant of GiSTstore. |
| 15 |
|
|
|
| 16 |
|
|
class GiSTstore { |
| 17 |
|
|
public: |
| 18 |
|
|
GiSTstore(): isOpen(0) {} |
| 19 |
|
|
virtual void Create(const char *filename)=0; |
| 20 |
|
|
virtual void Open(const char *filename)=0; |
| 21 |
|
|
virtual void Close()=0; |
| 22 |
|
|
virtual void Read(GiSTpage page, char *buf)=0; |
| 23 |
|
|
virtual void Write(GiSTpage page, const char *buf)=0; |
| 24 |
|
|
virtual GiSTpage Allocate()=0; |
| 25 |
|
|
virtual void Deallocate(GiSTpage page)=0; |
| 26 |
|
|
virtual void Sync()=0; |
| 27 |
|
|
virtual int IsOpen() { return isOpen; } |
| 28 |
|
|
virtual int PageSize() const=0; |
| 29 |
|
|
virtual ~GiSTstore() { } |
| 30 |
|
|
protected: |
| 31 |
|
|
void SetOpen(int o) { isOpen=o; } |
| 32 |
|
|
private: |
| 33 |
|
|
int isOpen; |
| 34 |
|
|
}; |
| 35 |
|
|
|
| 36 |
|
|
#endif |