[caching/mapping_array] namespace tweaking

This commit is contained in:
Joe Thornber 2013-10-08 09:11:04 +01:00
parent 42fd6b928b
commit 96143f0bed
4 changed files with 24 additions and 24 deletions

View File

@ -11,8 +11,8 @@
using namespace std; using namespace std;
using namespace caching; using namespace caching;
using namespace caching::mapping_array_detail; using namespace caching::mapping_array_damage;
using namespace caching::superblock_detail; using namespace caching::superblock_damage;
//---------------------------------------------------------------- //----------------------------------------------------------------

View File

@ -1,7 +1,8 @@
#include "caching/mapping_array.h" #include "caching/mapping_array.h"
#include "persistent-data/endian_utils.h" #include "persistent-data/endian_utils.h"
using namespace caching::mapping_array_detail; using namespace caching;
using namespace caching::mapping_array_damage;
//---------------------------------------------------------------- //----------------------------------------------------------------

View File

@ -6,26 +6,26 @@
//---------------------------------------------------------------- //----------------------------------------------------------------
namespace caching { namespace caching {
namespace mapping_array_detail { enum mapping_flags {
enum mapping_flags { M_VALID = 1,
M_VALID = 1, M_DIRTY = 2
M_DIRTY = 2 };
};
struct mapping { struct mapping {
uint64_t oblock_; uint64_t oblock_;
uint32_t flags_; uint32_t flags_;
}; };
struct mapping_traits { struct mapping_traits {
typedef base::le64 disk_type; typedef base::le64 disk_type;
typedef mapping value_type; typedef mapping value_type;
typedef no_op_ref_counter<value_type> ref_counter; typedef no_op_ref_counter<value_type> ref_counter;
static void unpack(disk_type const &disk, value_type &value); static void unpack(disk_type const &disk, value_type &value);
static void pack(value_type const &value, disk_type &disk); static void pack(value_type const &value, disk_type &disk);
}; };
namespace mapping_array_damage {
class damage_visitor; class damage_visitor;
struct damage { struct damage {
@ -45,7 +45,7 @@ namespace caching {
public: public:
virtual ~damage_visitor() {} virtual ~damage_visitor() {}
virtual void visit(mapping_array_detail::damage const &d) { virtual void visit(mapping_array_damage::damage const &d) {
d.visit(*this); d.visit(*this);
} }
@ -53,10 +53,10 @@ namespace caching {
}; };
} }
typedef persistent_data::array<mapping_array_detail::mapping_traits> mapping_array; typedef persistent_data::array<mapping_traits> mapping_array;
void check_mapping_array(mapping_array const &array, void check_mapping_array(mapping_array const &array,
mapping_array_detail::damage_visitor &visitor); mapping_array_damage::damage_visitor &visitor);
} }
//---------------------------------------------------------------- //----------------------------------------------------------------

View File

@ -3,7 +3,6 @@
#include "caching/mapping_array.h" #include "caching/mapping_array.h"
using namespace caching; using namespace caching;
using namespace mapping_array_detail;
using namespace std; using namespace std;
using namespace superblock_damage; using namespace superblock_damage;
@ -59,7 +58,7 @@ namespace {
virtual void mapping(pd::block_address cblock, virtual void mapping(pd::block_address cblock,
pd::block_address oblock, pd::block_address oblock,
bool dirty) { bool dirty) {
mapping_array_detail::mapping m; typename caching::mapping m;
m.oblock_ = oblock; m.oblock_ = oblock;
m.flags_ = M_VALID; m.flags_ = M_VALID;