0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 00:56:44 +01:00
mongodb/db/reci.h

46 lines
1.2 KiB
C
Raw Normal View History

// reci.h
#pragma once
#include "storage.h"
namespace mongo {
2009-02-05 22:17:46 +01:00
/* Subclass this and implement your real storage interface.
*/
class RecStoreInterface {
public:
2009-03-20 21:53:03 +01:00
virtual ~RecStoreInterface() {}
2009-12-22 21:22:37 +01:00
/* Get a pointer to the data at diskloc d. Pointer guaranteed to stay in
scope through the current database operation's life.
*/
virtual char* get(DiskLoc d, unsigned len) = 0;
2009-12-22 21:22:37 +01:00
/* indicate that the diskloc specified has been updated. note that as-is today, the modification may come AFTER this
call -- we handle that currently -- until the dblock finishes.
*/
virtual void modified(DiskLoc d) = 0;
2009-02-03 00:18:22 +01:00
/* insert specified data as a record */
virtual DiskLoc insert(const char *ns, const void *obuf, int len, bool god) = 0;
2009-09-24 20:21:40 +02:00
virtual void deleteRecord(const char *ns, DiskLoc d) { massert("not implemented RecStoreInterface::deleteRecord", false); }
/* drop the collection */
virtual void drop(const char *ns) = 0;
/* rename collection */
virtual void rename(const char *fromNs, const char *toNs) = 0;
2009-03-24 17:53:13 +01:00
/* close datafiles associated with the db specified. */
virtual void closeFiles(string dbname, string path) = 0;
/* todo add:
closeFiles(dbname)
eraseFiles(dbname)
*/
};
}