45 lines
993 B
C
45 lines
993 B
C
|
#ifndef CACHE_EMITTER_H
|
||
|
#define CACHE_EMITTER_H
|
||
|
|
||
|
#include <boost/shared_ptr.hpp>
|
||
|
#include <string>
|
||
|
|
||
|
#include "persistent-data/block.h"
|
||
|
|
||
|
//----------------------------------------------------------------
|
||
|
|
||
|
namespace caching {
|
||
|
namespace pd = persistent_data;
|
||
|
|
||
|
class emitter {
|
||
|
public:
|
||
|
typedef boost::shared_ptr<emitter> ptr;
|
||
|
|
||
|
virtual ~emitter() {}
|
||
|
|
||
|
virtual void begin_superblock(std::string const &uuid,
|
||
|
pd::block_address block_size,
|
||
|
pd::block_address nr_cache_blocks,
|
||
|
std::string const &policy) = 0;
|
||
|
|
||
|
virtual void end_superblock() = 0;
|
||
|
|
||
|
virtual void begin_mappings() = 0;
|
||
|
virtual void end_mappings() = 0;
|
||
|
|
||
|
virtual void mapping(pd::block_address cblock,
|
||
|
pd::block_address oblock,
|
||
|
bool dirty) = 0;
|
||
|
|
||
|
virtual void begin_hints() = 0;
|
||
|
virtual void end_hints() = 0;
|
||
|
|
||
|
virtual void hint(pd::block_address cblock,
|
||
|
std::string const &data) = 0;
|
||
|
};
|
||
|
}
|
||
|
|
||
|
//----------------------------------------------------------------
|
||
|
|
||
|
#endif
|