[caching] change the emitter->hint value type

This commit is contained in:
Joe Thornber 2013-09-24 12:37:27 +01:00
parent 8408ab12f8
commit bd1a189298
3 changed files with 13 additions and 10 deletions

View File

@ -1,11 +1,11 @@
#ifndef CACHE_EMITTER_H
#define CACHE_EMITTER_H
#include <boost/shared_ptr.hpp>
#include <string>
#include "persistent-data/block.h"
#include <boost/shared_ptr.hpp>
#include <vector>
//----------------------------------------------------------------
namespace caching {
@ -35,7 +35,7 @@ namespace caching {
virtual void end_hints() = 0;
virtual void hint(pd::block_address cblock,
std::string const &data) = 0;
std::vector<unsigned char> const &data) = 0;
};
}

View File

@ -88,13 +88,16 @@ namespace {
}
virtual void begin_hints() {
// noop
}
virtual void end_hints() {
// noop
}
virtual void hint(pd::block_address cblock,
std::string const &data) {
vector<unsigned char> const &data) {
}
private:

View File

@ -12,12 +12,12 @@ using namespace std;
namespace {
// base64 encoding?
string encode(string const &data) {
return data;
string encode(vector<unsigned char> const &data) {
return "";
}
string decode(string const &data) {
return data;
vector<unsigned char> decode(string const &data) {
return vector<unsigned char>();
}
//--------------------------------
@ -84,7 +84,7 @@ namespace {
}
virtual void hint(block_address cblock,
std::string const &data) {
vector<unsigned char> const &data) {
out_ << "<hint"
<< " cache_block=\"" << cblock << "\""
<< " data=\"" << encode(data) << "\""