make root_size() and copy_root() const

This commit is contained in:
Joe Thornber 2011-11-16 13:17:23 +00:00
parent f503cf7fbe
commit a162073291
3 changed files with 6 additions and 7 deletions

View File

@ -54,9 +54,8 @@ namespace persistent_data {
public:
typedef boost::shared_ptr<persistent_space_map> ptr;
// FIXME: these two should be const
virtual size_t root_size() = 0;
virtual void copy_root(void *dest, size_t len) = 0;
virtual size_t root_size() const = 0;
virtual void copy_root(void *dest, size_t len) const = 0;
};
class checked_space_map : public persistent_space_map {

View File

@ -381,11 +381,11 @@ namespace {
}
}
virtual size_t root_size() {
virtual size_t root_size() const {
return sizeof(sm_root_disk);
}
virtual void copy_root(void *dest, size_t len) {
virtual void copy_root(void *dest, size_t len) const {
sm_root_disk d;
sm_root v;

View File

@ -120,13 +120,13 @@ namespace {
sm_->iterate(it);
}
virtual size_t root_size() {
virtual size_t root_size() const {
cant_recurse("root_size");
recursing_const_lock lock(*this);
return sm_->root_size();
}
virtual void copy_root(void *dest, size_t len) {
virtual void copy_root(void *dest, size_t len) const {
cant_recurse("copy_root");
recursing_const_lock lock(*this);
return sm_->copy_root(dest, len);