Remove some global 'using namespace's

This commit is contained in:
Joe Thornber 2013-05-28 13:48:10 +01:00
parent 3066487814
commit 6706493304
9 changed files with 395 additions and 387 deletions

View File

@ -30,13 +30,9 @@
#include <stdexcept>
#include <sstream>
// FIXME: remove these from a header!
using namespace boost;
using namespace persistent_data;
using namespace std;
//----------------------------------------------------------------
// FIXME: give this namesace a name
namespace {
using namespace std;
@ -105,6 +101,7 @@ namespace {
}
};
namespace persistent_data {
template <uint32_t BlockSize>
block_io<BlockSize>::block_io(std::string const &path, block_address nr_blocks, mode m)
: nr_blocks_(nr_blocks),
@ -533,5 +530,6 @@ block_manager<BlockSize>::is_locked(block_address b) const
{
return tracker_.is_locked(b);
}
}
//----------------------------------------------------------------

View File

@ -380,7 +380,7 @@ namespace persistent_data {
private:
template <typename ValueTraits2, typename Search>
optional<typename ValueTraits2::value_type>
boost::optional<typename ValueTraits2::value_type>
lookup_raw(btree_detail::ro_spine &spine, block_address block, uint64_t key) const;
template <typename ValueTraits2>

View File

@ -24,9 +24,10 @@
#include <iostream>
// FIXME: remove
using namespace base;
using namespace btree_detail;
using namespace persistent_data;
using namespace btree_detail;
using namespace std;
//----------------------------------------------------------------

View File

@ -22,6 +22,8 @@
//----------------------------------------------------------------
namespace {
using namespace persistent_data;
class sm_careful_alloc : public checked_space_map {
public:
typedef std::shared_ptr<sm_careful_alloc> ptr;

View File

@ -11,9 +11,11 @@ using namespace base;
//----------------------------------------------------------------
block_address
persistent_data::block_address
thin_provisioning::get_nr_blocks(string const &path)
{
using namespace persistent_data;
struct stat info;
block_address nr_blocks;

View File

@ -6,7 +6,7 @@
//----------------------------------------------------------------
namespace thin_provisioning {
block_address get_nr_blocks(string const &path);
persistent_data::block_address get_nr_blocks(string const &path);
}
//----------------------------------------------------------------

View File

@ -120,10 +120,10 @@ namespace thin_provisioning {
};
}
block_manager<>::validator::ptr superblock_validator();
persistent_data::block_manager<>::validator::ptr superblock_validator();
superblock_detail::superblock read_superblock(block_manager<>::ptr bm);
void check_superblock(block_manager<>::ptr bm,
superblock_detail::superblock read_superblock(persistent_data::block_manager<>::ptr bm);
void check_superblock(persistent_data::block_manager<>::ptr bm,
superblock_detail::damage_visitor &visitor);
}

View File

@ -2,6 +2,8 @@
#include "persistent-data/space-maps/core.h"
using namespace persistent_data;
//----------------------------------------------------------------
void test::zero_block(block_manager<>::ptr bm, block_address b)
@ -10,7 +12,8 @@ void test::zero_block(block_manager<>::ptr bm, block_address b)
memset(&wr.data(), 0, sizeof(wr.data()));
}
transaction_manager::ptr test::open_temporary_tm(block_manager<>::ptr bm)
transaction_manager::ptr
test::open_temporary_tm(block_manager<>::ptr bm)
{
space_map::ptr sm(new core_map(bm->get_nr_blocks()));
transaction_manager::ptr tm(new transaction_manager(bm, sm));

View File

@ -22,6 +22,8 @@
//----------------------------------------------------------------
namespace test {
using namespace persistent_data;
unsigned const MAX_HELD_LOCKS = 16;
template <uint32_t BlockSize>