20#ifndef GEODE_PERSISTENCEMANAGER_H_
21#define GEODE_PERSISTENCEMANAGER_H_
25#include "Serializable.hpp"
26#include "internal/geode_globals.hpp"
38class PersistenceManager;
41typedef std::shared_ptr<PersistenceManager> (*getPersistenceManagerInstance)(
42 const std::shared_ptr<Region>&);
71 virtual void write(
const std::shared_ptr<CacheableKey>& key,
72 const std::shared_ptr<Cacheable>& value,
73 std::shared_ptr<void>& persistenceInfo) = 0;
89 virtual void init(
const std::shared_ptr<Region>& region,
90 const std::shared_ptr<Properties>& diskProperties) = 0;
99 virtual std::shared_ptr<Cacheable>
read(
100 const std::shared_ptr<CacheableKey>& key,
101 const std::shared_ptr<void>& PersistenceInfo) = 0;
116 virtual void destroy(
const std::shared_ptr<CacheableKey>& key,
117 const std::shared_ptr<void>& PersistenceInfo) = 0;
126 : m_regionPtr(regionPtr) {}
PersistenceManager API for persistence and overflow.
Definition PersistenceManager.hpp:52
virtual bool readAll()=0
Reads all the values from the region.
static std::shared_ptr< PersistenceManager > getPersistenceManager()
Returns the current persistence manager.
std::shared_ptr< Region > m_regionPtr
Region for this persistence manager.
Definition PersistenceManager.hpp:135
virtual void init(const std::shared_ptr< Region > ®ion, const std::shared_ptr< Properties > &diskProperties)=0
This method gets called after an implementation object is created.
virtual void write(const std::shared_ptr< CacheableKey > &key, const std::shared_ptr< Cacheable > &value, std::shared_ptr< void > &persistenceInfo)=0
Writes a key, value pair of region to the disk.
virtual void close()=0
Closes the persistence manager instance.
virtual void destroy(const std::shared_ptr< CacheableKey > &key, const std::shared_ptr< void > &PersistenceInfo)=0
destroys the entry specified by the key in the argument.
virtual std::shared_ptr< Cacheable > read(const std::shared_ptr< CacheableKey > &key, const std::shared_ptr< void > &PersistenceInfo)=0
Reads the value for the key from the disk.
virtual bool writeAll()=0
Writes all the entries for a region.