[caching] change the emitter->hint value type
This commit is contained in:
parent
8408ab12f8
commit
bd1a189298
@ -1,11 +1,11 @@
|
|||||||
#ifndef CACHE_EMITTER_H
|
#ifndef CACHE_EMITTER_H
|
||||||
#define CACHE_EMITTER_H
|
#define CACHE_EMITTER_H
|
||||||
|
|
||||||
#include <boost/shared_ptr.hpp>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include "persistent-data/block.h"
|
#include "persistent-data/block.h"
|
||||||
|
|
||||||
|
#include <boost/shared_ptr.hpp>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
|
|
||||||
namespace caching {
|
namespace caching {
|
||||||
@ -35,7 +35,7 @@ namespace caching {
|
|||||||
virtual void end_hints() = 0;
|
virtual void end_hints() = 0;
|
||||||
|
|
||||||
virtual void hint(pd::block_address cblock,
|
virtual void hint(pd::block_address cblock,
|
||||||
std::string const &data) = 0;
|
std::vector<unsigned char> const &data) = 0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,13 +88,16 @@ namespace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual void begin_hints() {
|
virtual void begin_hints() {
|
||||||
|
// noop
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void end_hints() {
|
virtual void end_hints() {
|
||||||
|
// noop
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void hint(pd::block_address cblock,
|
virtual void hint(pd::block_address cblock,
|
||||||
std::string const &data) {
|
vector<unsigned char> const &data) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -12,12 +12,12 @@ using namespace std;
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
// base64 encoding?
|
// base64 encoding?
|
||||||
string encode(string const &data) {
|
string encode(vector<unsigned char> const &data) {
|
||||||
return data;
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
string decode(string const &data) {
|
vector<unsigned char> decode(string const &data) {
|
||||||
return data;
|
return vector<unsigned char>();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------
|
//--------------------------------
|
||||||
@ -84,7 +84,7 @@ namespace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual void hint(block_address cblock,
|
virtual void hint(block_address cblock,
|
||||||
std::string const &data) {
|
vector<unsigned char> const &data) {
|
||||||
out_ << "<hint"
|
out_ << "<hint"
|
||||||
<< " cache_block=\"" << cblock << "\""
|
<< " cache_block=\"" << cblock << "\""
|
||||||
<< " data=\"" << encode(data) << "\""
|
<< " data=\"" << encode(data) << "\""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user