mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-03 09:25:51 +00:00
Add null backend factory
This commit is contained in:
71
modules/ripple_app/node/ripple_NullBackendFactory.cpp
Normal file
71
modules/ripple_app/node/ripple_NullBackendFactory.cpp
Normal file
@@ -0,0 +1,71 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
Copyright (c) 2011-2013, OpenCoin, Inc.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
class NullBackendFactory::Backend : public NodeStore::Backend
|
||||
{
|
||||
public:
|
||||
Backend ()
|
||||
{
|
||||
}
|
||||
|
||||
~Backend ()
|
||||
{
|
||||
}
|
||||
|
||||
std::string getDataBaseName()
|
||||
{
|
||||
return std::string ();
|
||||
}
|
||||
|
||||
bool store (NodeObject::ref obj)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool bulkStore (const std::vector< NodeObject::pointer >& objs)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
NodeObject::pointer retrieve (uint256 const& hash)
|
||||
{
|
||||
return NodeObject::pointer ();
|
||||
}
|
||||
|
||||
void visitAll (FUNCTION_TYPE <void (NodeObject::pointer)> func)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
NullBackendFactory::NullBackendFactory ()
|
||||
{
|
||||
}
|
||||
|
||||
NullBackendFactory::~NullBackendFactory ()
|
||||
{
|
||||
}
|
||||
|
||||
NullBackendFactory& NullBackendFactory::getInstance ()
|
||||
{
|
||||
static NullBackendFactory instance;
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
String NullBackendFactory::getName () const
|
||||
{
|
||||
return "none";
|
||||
}
|
||||
|
||||
NodeStore::Backend* NullBackendFactory::createInstance (StringPairArray const& keyValues)
|
||||
{
|
||||
return new NullBackendFactory::Backend;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
29
modules/ripple_app/node/ripple_NullBackendFactory.h
Normal file
29
modules/ripple_app/node/ripple_NullBackendFactory.h
Normal file
@@ -0,0 +1,29 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
Copyright (c) 2011-2013, OpenCoin, Inc.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef RIPPLE_NULLBACKENDFACTORY_H_INCLUDED
|
||||
#define RIPPLE_NULLBACKENDFACTORY_H_INCLUDED
|
||||
|
||||
/** Factory to produce a null backend.
|
||||
|
||||
This is for standalone / testing mode.
|
||||
*/
|
||||
class NullBackendFactory : public NodeStore::BackendFactory
|
||||
{
|
||||
private:
|
||||
class Backend;
|
||||
|
||||
NullBackendFactory ();
|
||||
~NullBackendFactory ();
|
||||
|
||||
public:
|
||||
static NullBackendFactory& getInstance ();
|
||||
|
||||
String getName () const;
|
||||
NodeStore::Backend* createInstance (StringPairArray const& keyValues);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user