Files
rippled/modules/ripple_app/node/ripple_KeyvaDB.h
2013-07-21 12:56:26 -07:00

41 lines
1.0 KiB
C++

//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================
#ifndef RIPPLE_KEYVADB_H_INCLUDED
#define RIPPLE_KEYVADB_H_INCLUDED
/** Key/value database optimized for Ripple usage.
*/
class KeyvaDB : LeakChecked <KeyvaDB>
{
public:
class GetCallback
{
public:
virtual void* getStorageForValue (int valueBytes) = 0;
};
static KeyvaDB* New (int keyBytes,
int keyBlockDepth,
File keyPath,
File valPath);
virtual ~KeyvaDB () { }
// VFALCO TODO Make the return value a Result so we can
// detect corruption and errors!
//
virtual bool get (void const* key, GetCallback* callback) = 0;
// VFALCO TODO Use Result for return value
//
virtual void put (void const* key, void const* value, int valueBytes) = 0;
virtual void flush () = 0;
};
#endif