Move block_manager member down into checker base class.

This commit is contained in:
Joe Thornber 2013-04-29 13:31:33 +01:00
parent 1a8b1b29e8
commit 6422b22610
6 changed files with 14 additions and 12 deletions

View File

@ -5,7 +5,7 @@ using namespace thin_provisioning;
//----------------------------------------------------------------
device_checker::device_checker(block_manager::ptr bm)
: bm_(bm)
: checker(bm)
{
}

View File

@ -10,10 +10,6 @@ namespace thin_provisioning {
public:
device_checker(block_manager::ptr bm);
damage_list_ptr check();
private:
block_manager::ptr bm_;
damage_list_ptr damage_;
};
}

View File

@ -165,6 +165,13 @@ metadata_damage_visitor::visit(metadata_damage const &damage)
damage.visit(*this);
}
//--------------------------------
checker::checker(block_manager::ptr bm)
: bm_(bm)
{
}
//----------------------------------------------------------------
#if 0

View File

@ -156,8 +156,13 @@ namespace thin_provisioning {
typedef persistent_data::block_manager<> block_manager;
typedef boost::shared_ptr<checker> ptr;
checker(block_manager::ptr bm);
virtual ~checker() {};
virtual damage_list_ptr check() = 0;
protected:
block_manager::ptr bm_;
};
}

View File

@ -9,8 +9,7 @@ using namespace thin_provisioning;
//----------------------------------------------------------------
superblock_checker::superblock_checker(block_manager::ptr bm)
: bm_(bm),
damage(new damage_list)
: checker(bm)
{
}

View File

@ -10,11 +10,6 @@ namespace thin_provisioning {
public:
superblock_checker(block_manager::ptr bm);
damage_list_ptr check();
private:
// FIXME: surely we can push these down to the base class?
block_manager::ptr bm_;
damage_list_ptr damage;
};
}