[all] Switch from boost::shared_ptr -> std::shared_ptr.
Shared_ptr has moved into the standard library since these tools were first written.
This commit is contained in:
parent
e801cc607b
commit
4313469475
@ -1,9 +1,9 @@
|
|||||||
#ifndef BASE_APPLICATION_H
|
#ifndef BASE_APPLICATION_H
|
||||||
#define BASE_APPLICATION_H
|
#define BASE_APPLICATION_H
|
||||||
|
|
||||||
#include <boost/shared_ptr.hpp>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -13,7 +13,7 @@
|
|||||||
namespace base {
|
namespace base {
|
||||||
class command {
|
class command {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<command> ptr;
|
typedef std::shared_ptr<command> ptr;
|
||||||
|
|
||||||
command(std::string const &name);
|
command(std::string const &name);
|
||||||
virtual ~command() {}
|
virtual ~command() {}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#ifndef BASE_PROGRESS_MONITOR_H
|
#ifndef BASE_PROGRESS_MONITOR_H
|
||||||
#define BASE_PROGRESS_MONITOR_H
|
#define BASE_PROGRESS_MONITOR_H
|
||||||
|
|
||||||
#include <boost/shared_ptr.hpp>
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
#include <boost/intrusive/list.hpp>
|
#include <boost/intrusive/list.hpp>
|
||||||
#include <boost/intrusive/set.hpp>
|
#include <boost/intrusive/set.hpp>
|
||||||
#include <boost/noncopyable.hpp>
|
#include <boost/noncopyable.hpp>
|
||||||
#include <boost/shared_ptr.hpp>
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <libaio.h>
|
#include <libaio.h>
|
||||||
@ -29,7 +28,7 @@ namespace bcache {
|
|||||||
|
|
||||||
class validator {
|
class validator {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<validator> ptr;
|
typedef std::shared_ptr<validator> ptr;
|
||||||
|
|
||||||
virtual ~validator() {}
|
virtual ~validator() {}
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ namespace cache {
|
|||||||
|
|
||||||
typedef block_manager<>::read_ref read_ref;
|
typedef block_manager<>::read_ref read_ref;
|
||||||
typedef block_manager<>::write_ref write_ref;
|
typedef block_manager<>::write_ref write_ref;
|
||||||
typedef boost::shared_ptr<metadata> ptr;
|
typedef std::shared_ptr<metadata> ptr;
|
||||||
|
|
||||||
tm_ptr tm_;
|
tm_ptr tm_;
|
||||||
superblock sb_;
|
superblock sb_;
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#include "persistent-data/block.h"
|
#include "persistent-data/block.h"
|
||||||
|
|
||||||
#include <boost/shared_ptr.hpp>
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
@ -13,7 +12,7 @@ namespace caching {
|
|||||||
|
|
||||||
class emitter {
|
class emitter {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<emitter> ptr;
|
typedef std::shared_ptr<emitter> ptr;
|
||||||
|
|
||||||
virtual ~emitter() {}
|
virtual ~emitter() {}
|
||||||
|
|
||||||
|
@ -38,16 +38,16 @@ namespace {
|
|||||||
xx(4);
|
xx(4);
|
||||||
|
|
||||||
template <uint32_t WIDTH>
|
template <uint32_t WIDTH>
|
||||||
boost::shared_ptr<array_base> mk_array(transaction_manager &tm) {
|
std::shared_ptr<array_base> mk_array(transaction_manager &tm) {
|
||||||
typedef hint_traits<WIDTH> traits;
|
typedef hint_traits<WIDTH> traits;
|
||||||
typedef persistent_data::array<traits> ha;
|
typedef persistent_data::array<traits> ha;
|
||||||
|
|
||||||
boost::shared_ptr<array_base> r = typename ha::ptr(new ha(tm, typename traits::ref_counter()));
|
std::shared_ptr<array_base> r = typename ha::ptr(new ha(tm, typename traits::ref_counter()));
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::shared_ptr<array_base> mk_array(transaction_manager &tm, uint32_t width) {
|
std::shared_ptr<array_base> mk_array(transaction_manager &tm, uint32_t width) {
|
||||||
switch (width) {
|
switch (width) {
|
||||||
#define xx(n) case n: return mk_array<n>(tm)
|
#define xx(n) case n: return mk_array<n>(tm)
|
||||||
|
|
||||||
@ -58,15 +58,15 @@ namespace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// never get here
|
// never get here
|
||||||
return boost::shared_ptr<array_base>();
|
return std::shared_ptr<array_base>();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------
|
//--------------------------------
|
||||||
|
|
||||||
template <typename HA>
|
template <typename HA>
|
||||||
boost::shared_ptr<HA>
|
std::shared_ptr<HA>
|
||||||
downcast_array(boost::shared_ptr<array_base> base) {
|
downcast_array(std::shared_ptr<array_base> base) {
|
||||||
boost::shared_ptr<HA> a = dynamic_pointer_cast<HA>(base);
|
std::shared_ptr<HA> a = dynamic_pointer_cast<HA>(base);
|
||||||
if (!a)
|
if (!a)
|
||||||
throw runtime_error("internal error: couldn't cast hint array");
|
throw runtime_error("internal error: couldn't cast hint array");
|
||||||
|
|
||||||
@ -76,16 +76,16 @@ namespace {
|
|||||||
//--------------------------------
|
//--------------------------------
|
||||||
|
|
||||||
template <uint32_t WIDTH>
|
template <uint32_t WIDTH>
|
||||||
boost::shared_ptr<array_base> mk_array(transaction_manager &tm, block_address root, unsigned nr_entries) {
|
std::shared_ptr<array_base> mk_array(transaction_manager &tm, block_address root, unsigned nr_entries) {
|
||||||
typedef hint_traits<WIDTH> traits;
|
typedef hint_traits<WIDTH> traits;
|
||||||
typedef persistent_data::array<traits> ha;
|
typedef persistent_data::array<traits> ha;
|
||||||
|
|
||||||
boost::shared_ptr<array_base> r = typename ha::ptr(new ha(tm, typename traits::ref_counter(), root, nr_entries));
|
std::shared_ptr<array_base> r = typename ha::ptr(new ha(tm, typename traits::ref_counter(), root, nr_entries));
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::shared_ptr<array_base> mk_array(transaction_manager &tm, uint32_t width, block_address root, unsigned nr_entries) {
|
std::shared_ptr<array_base> mk_array(transaction_manager &tm, uint32_t width, block_address root, unsigned nr_entries) {
|
||||||
switch (width) {
|
switch (width) {
|
||||||
#define xx(n) case n: return mk_array<n>(tm, root, nr_entries)
|
#define xx(n) case n: return mk_array<n>(tm, root, nr_entries)
|
||||||
all_widths
|
all_widths
|
||||||
@ -95,21 +95,21 @@ namespace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// never get here
|
// never get here
|
||||||
return boost::shared_ptr<array_base>();
|
return std::shared_ptr<array_base>();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------
|
//--------------------------------
|
||||||
|
|
||||||
template <uint32_t WIDTH>
|
template <uint32_t WIDTH>
|
||||||
void get_hint(boost::shared_ptr<array_base> base, unsigned index, vector<unsigned char> &data) {
|
void get_hint(std::shared_ptr<array_base> base, unsigned index, vector<unsigned char> &data) {
|
||||||
typedef hint_traits<WIDTH> traits;
|
typedef hint_traits<WIDTH> traits;
|
||||||
typedef persistent_data::array<traits> ha;
|
typedef persistent_data::array<traits> ha;
|
||||||
|
|
||||||
boost::shared_ptr<ha> a = downcast_array<ha>(base);
|
std::shared_ptr<ha> a = downcast_array<ha>(base);
|
||||||
data = a->get(index);
|
data = a->get(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void get_hint_(uint32_t width, boost::shared_ptr<array_base> base, unsigned index, vector<unsigned char> &data) {
|
void get_hint_(uint32_t width, std::shared_ptr<array_base> base, unsigned index, vector<unsigned char> &data) {
|
||||||
switch (width) {
|
switch (width) {
|
||||||
#define xx(n) case n: return get_hint<n>(base, index, data)
|
#define xx(n) case n: return get_hint<n>(base, index, data)
|
||||||
all_widths
|
all_widths
|
||||||
@ -120,15 +120,15 @@ namespace {
|
|||||||
//--------------------------------
|
//--------------------------------
|
||||||
|
|
||||||
template <uint32_t WIDTH>
|
template <uint32_t WIDTH>
|
||||||
void set_hint(boost::shared_ptr<array_base> base, unsigned index, vector<unsigned char> const &data) {
|
void set_hint(std::shared_ptr<array_base> base, unsigned index, vector<unsigned char> const &data) {
|
||||||
typedef hint_traits<WIDTH> traits;
|
typedef hint_traits<WIDTH> traits;
|
||||||
typedef persistent_data::array<traits> ha;
|
typedef persistent_data::array<traits> ha;
|
||||||
|
|
||||||
boost::shared_ptr<ha> a = downcast_array<ha>(base);
|
std::shared_ptr<ha> a = downcast_array<ha>(base);
|
||||||
a->set(index, data);
|
a->set(index, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_hint_(uint32_t width, boost::shared_ptr<array_base> base,
|
void set_hint_(uint32_t width, std::shared_ptr<array_base> base,
|
||||||
unsigned index, vector<unsigned char> const &data) {
|
unsigned index, vector<unsigned char> const &data) {
|
||||||
switch (width) {
|
switch (width) {
|
||||||
#define xx(n) case n: return set_hint<n>(base, index, data)
|
#define xx(n) case n: return set_hint<n>(base, index, data)
|
||||||
@ -140,15 +140,15 @@ namespace {
|
|||||||
//--------------------------------
|
//--------------------------------
|
||||||
|
|
||||||
template <uint32_t WIDTH>
|
template <uint32_t WIDTH>
|
||||||
void grow(boost::shared_ptr<array_base> base, unsigned new_nr_entries, vector<unsigned char> const &value) {
|
void grow(std::shared_ptr<array_base> base, unsigned new_nr_entries, vector<unsigned char> const &value) {
|
||||||
typedef hint_traits<WIDTH> traits;
|
typedef hint_traits<WIDTH> traits;
|
||||||
typedef persistent_data::array<traits> ha;
|
typedef persistent_data::array<traits> ha;
|
||||||
|
|
||||||
boost::shared_ptr<ha> a = downcast_array<ha>(base);
|
std::shared_ptr<ha> a = downcast_array<ha>(base);
|
||||||
a->grow(new_nr_entries, value);
|
a->grow(new_nr_entries, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void grow_(uint32_t width, boost::shared_ptr<array_base> base,
|
void grow_(uint32_t width, std::shared_ptr<array_base> base,
|
||||||
unsigned new_nr_entries, vector<unsigned char> const &value)
|
unsigned new_nr_entries, vector<unsigned char> const &value)
|
||||||
{
|
{
|
||||||
switch (width) {
|
switch (width) {
|
||||||
@ -194,17 +194,17 @@ namespace {
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <uint32_t WIDTH>
|
template <uint32_t WIDTH>
|
||||||
void walk_hints(boost::shared_ptr<array_base> base, hint_visitor &hv, damage_visitor &dv) {
|
void walk_hints(std::shared_ptr<array_base> base, hint_visitor &hv, damage_visitor &dv) {
|
||||||
typedef hint_traits<WIDTH> traits;
|
typedef hint_traits<WIDTH> traits;
|
||||||
typedef persistent_data::array<traits> ha;
|
typedef persistent_data::array<traits> ha;
|
||||||
|
|
||||||
boost::shared_ptr<ha> a = downcast_array<ha>(base);
|
std::shared_ptr<ha> a = downcast_array<ha>(base);
|
||||||
value_adapter vv(hv);
|
value_adapter vv(hv);
|
||||||
ll_damage_visitor ll(dv);
|
ll_damage_visitor ll(dv);
|
||||||
a->visit_values(vv, ll);
|
a->visit_values(vv, ll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void walk_hints_(uint32_t width, boost::shared_ptr<array_base> base,
|
void walk_hints_(uint32_t width, std::shared_ptr<array_base> base,
|
||||||
hint_visitor &hv, damage_visitor &dv) {
|
hint_visitor &hv, damage_visitor &dv) {
|
||||||
switch (width) {
|
switch (width) {
|
||||||
#define xx(n) case n: walk_hints<n>(base, hv, dv); break
|
#define xx(n) case n: walk_hints<n>(base, hv, dv); break
|
||||||
|
@ -55,7 +55,7 @@ namespace caching {
|
|||||||
|
|
||||||
class hint_array {
|
class hint_array {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<hint_array> ptr;
|
typedef std::shared_ptr<hint_array> ptr;
|
||||||
|
|
||||||
hint_array(transaction_manager &tm, unsigned width);
|
hint_array(transaction_manager &tm, unsigned width);
|
||||||
hint_array(transaction_manager &tm, unsigned width, block_address root, unsigned nr_entries);
|
hint_array(transaction_manager &tm, unsigned width, block_address root, unsigned nr_entries);
|
||||||
@ -77,7 +77,7 @@ namespace caching {
|
|||||||
static uint32_t check_width(uint32_t width);
|
static uint32_t check_width(uint32_t width);
|
||||||
|
|
||||||
unsigned width_;
|
unsigned width_;
|
||||||
boost::shared_ptr<persistent_data::array_base> impl_;
|
std::shared_ptr<persistent_data::array_base> impl_;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ namespace caching {
|
|||||||
|
|
||||||
typedef block_manager::read_ref read_ref;
|
typedef block_manager::read_ref read_ref;
|
||||||
typedef block_manager::write_ref write_ref;
|
typedef block_manager::write_ref write_ref;
|
||||||
typedef boost::shared_ptr<metadata> ptr;
|
typedef std::shared_ptr<metadata> ptr;
|
||||||
|
|
||||||
metadata(block_manager::ptr bm, open_type ot, unsigned metadata_version = 2); // Create only
|
metadata(block_manager::ptr bm, open_type ot, unsigned metadata_version = 2); // Create only
|
||||||
metadata(block_manager::ptr bm);
|
metadata(block_manager::ptr bm);
|
||||||
|
@ -74,7 +74,6 @@ AC_CHECK_HEADERS([expat.h \
|
|||||||
boost/lexical_cast.hpp \
|
boost/lexical_cast.hpp \
|
||||||
boost/noncopyable.hpp \
|
boost/noncopyable.hpp \
|
||||||
boost/optional.hpp \
|
boost/optional.hpp \
|
||||||
boost/shared_ptr.hpp \
|
|
||||||
boost/static_assert.hpp],
|
boost/static_assert.hpp],
|
||||||
[], [AC_MSG_ERROR(bailing out)])
|
[], [AC_MSG_ERROR(bailing out)])
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ namespace era {
|
|||||||
|
|
||||||
class emitter {
|
class emitter {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<emitter> ptr;
|
typedef std::shared_ptr<emitter> ptr;
|
||||||
|
|
||||||
virtual ~emitter() {}
|
virtual ~emitter() {}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ namespace era {
|
|||||||
|
|
||||||
typedef block_manager::read_ref read_ref;
|
typedef block_manager::read_ref read_ref;
|
||||||
typedef block_manager::write_ref write_ref;
|
typedef block_manager::write_ref write_ref;
|
||||||
typedef boost::shared_ptr<metadata> ptr;
|
typedef std::shared_ptr<metadata> ptr;
|
||||||
|
|
||||||
metadata(block_manager::ptr bm, open_type ot);
|
metadata(block_manager::ptr bm, open_type ot);
|
||||||
metadata(block_manager::ptr bm, block_address metadata_snap);
|
metadata(block_manager::ptr bm, block_address metadata_snap);
|
||||||
|
@ -46,7 +46,7 @@ namespace era {
|
|||||||
|
|
||||||
class damage_visitor {
|
class damage_visitor {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<damage_visitor> ptr;
|
typedef std::shared_ptr<damage_visitor> ptr;
|
||||||
|
|
||||||
virtual ~damage_visitor() {}
|
virtual ~damage_visitor() {}
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ namespace era {
|
|||||||
|
|
||||||
class writeset_visitor {
|
class writeset_visitor {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<writeset_visitor> ptr;
|
typedef std::shared_ptr<writeset_visitor> ptr;
|
||||||
|
|
||||||
virtual ~writeset_visitor() {}
|
virtual ~writeset_visitor() {}
|
||||||
|
|
||||||
|
@ -27,7 +27,6 @@
|
|||||||
|
|
||||||
#include <boost/noncopyable.hpp>
|
#include <boost/noncopyable.hpp>
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
#include <boost/shared_ptr.hpp>
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@ -40,7 +39,7 @@ namespace persistent_data {
|
|||||||
|
|
||||||
class block_manager : private boost::noncopyable {
|
class block_manager : private boost::noncopyable {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<block_manager> ptr;
|
typedef std::shared_ptr<block_manager> ptr;
|
||||||
|
|
||||||
enum mode {
|
enum mode {
|
||||||
READ_ONLY,
|
READ_ONLY,
|
||||||
|
@ -75,7 +75,7 @@ namespace persistent_data {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct damage {
|
struct damage {
|
||||||
typedef boost::shared_ptr<damage> ptr;
|
typedef std::shared_ptr<damage> ptr;
|
||||||
|
|
||||||
damage(run<uint32_t> lost_keys,
|
damage(run<uint32_t> lost_keys,
|
||||||
std::string const &desc)
|
std::string const &desc)
|
||||||
@ -222,7 +222,7 @@ namespace persistent_data {
|
|||||||
typedef array_block<ValueTraits, block_manager::write_ref> wblock;
|
typedef array_block<ValueTraits, block_manager::write_ref> wblock;
|
||||||
typedef array_block<ValueTraits, block_manager::read_ref> rblock;
|
typedef array_block<ValueTraits, block_manager::read_ref> rblock;
|
||||||
|
|
||||||
typedef boost::shared_ptr<array<ValueTraits> > ptr;
|
typedef std::shared_ptr<array<ValueTraits> > ptr;
|
||||||
typedef typename ValueTraits::value_type value_type;
|
typedef typename ValueTraits::value_type value_type;
|
||||||
typedef typename ValueTraits::ref_counter ref_counter;
|
typedef typename ValueTraits::ref_counter ref_counter;
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ namespace persistent_data {
|
|||||||
template <typename ValueTraits, typename RefType>
|
template <typename ValueTraits, typename RefType>
|
||||||
class array_block {
|
class array_block {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<array_block> ptr;
|
typedef std::shared_ptr<array_block> ptr;
|
||||||
typedef typename ValueTraits::disk_type disk_type;
|
typedef typename ValueTraits::disk_type disk_type;
|
||||||
typedef typename ValueTraits::value_type value_type;
|
typedef typename ValueTraits::value_type value_type;
|
||||||
typedef typename ValueTraits::ref_counter ref_counter;
|
typedef typename ValueTraits::ref_counter ref_counter;
|
||||||
|
@ -30,7 +30,7 @@ namespace persistent_data {
|
|||||||
|
|
||||||
class bitset_impl {
|
class bitset_impl {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<bitset_impl> ptr;
|
typedef std::shared_ptr<bitset_impl> ptr;
|
||||||
typedef persistent_data::transaction_manager::ptr tm_ptr;
|
typedef persistent_data::transaction_manager::ptr tm_ptr;
|
||||||
|
|
||||||
bitset_impl(transaction_manager &tm)
|
bitset_impl(transaction_manager &tm)
|
||||||
|
@ -38,7 +38,7 @@ namespace persistent_data {
|
|||||||
|
|
||||||
class bitset_visitor {
|
class bitset_visitor {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<bitset_visitor> ptr;
|
typedef std::shared_ptr<bitset_visitor> ptr;
|
||||||
|
|
||||||
virtual ~bitset_visitor() {}
|
virtual ~bitset_visitor() {}
|
||||||
virtual void visit(uint32_t index, bool value) = 0;
|
virtual void visit(uint32_t index, bool value) = 0;
|
||||||
@ -48,7 +48,7 @@ namespace persistent_data {
|
|||||||
|
|
||||||
class bitset {
|
class bitset {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<bitset> ptr;
|
typedef std::shared_ptr<bitset> ptr;
|
||||||
|
|
||||||
bitset(transaction_manager &tm);
|
bitset(transaction_manager &tm);
|
||||||
bitset(transaction_manager &tm,
|
bitset(transaction_manager &tm,
|
||||||
@ -66,7 +66,7 @@ namespace persistent_data {
|
|||||||
void walk_bitset(bitset_detail::bitset_visitor &v) const;
|
void walk_bitset(bitset_detail::bitset_visitor &v) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
boost::shared_ptr<bitset_detail::bitset_impl> impl_;
|
std::shared_ptr<bitset_detail::bitset_impl> impl_;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,14 +4,12 @@
|
|||||||
#include "persistent-data/transaction_manager.h"
|
#include "persistent-data/transaction_manager.h"
|
||||||
#include "persistent-data/data-structures/bitset.h"
|
#include "persistent-data/data-structures/bitset.h"
|
||||||
|
|
||||||
#include <boost/shared_ptr.hpp>
|
|
||||||
|
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
|
|
||||||
namespace persistent_data {
|
namespace persistent_data {
|
||||||
class bloom_filter {
|
class bloom_filter {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<bloom_filter> ptr;
|
typedef std::shared_ptr<bloom_filter> ptr;
|
||||||
|
|
||||||
// nr_bits must be a power of two
|
// nr_bits must be a power of two
|
||||||
bloom_filter(transaction_manager &tm,
|
bloom_filter(transaction_manager &tm,
|
||||||
|
@ -298,7 +298,7 @@ namespace persistent_data {
|
|||||||
template <unsigned Levels, typename ValueTraits>
|
template <unsigned Levels, typename ValueTraits>
|
||||||
class btree {
|
class btree {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<btree<Levels, ValueTraits> > ptr;
|
typedef std::shared_ptr<btree<Levels, ValueTraits> > ptr;
|
||||||
|
|
||||||
typedef uint64_t key[Levels];
|
typedef uint64_t key[Levels];
|
||||||
typedef typename ValueTraits::value_type value_type;
|
typedef typename ValueTraits::value_type value_type;
|
||||||
@ -338,7 +338,7 @@ namespace persistent_data {
|
|||||||
// inspect the individual nodes that make up a btree.
|
// inspect the individual nodes that make up a btree.
|
||||||
class visitor {
|
class visitor {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<visitor> ptr;
|
typedef std::shared_ptr<visitor> ptr;
|
||||||
typedef btree_detail::node_location node_location;
|
typedef btree_detail::node_location node_location;
|
||||||
|
|
||||||
virtual ~visitor() {}
|
virtual ~visitor() {}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
namespace persistent_data {
|
namespace persistent_data {
|
||||||
namespace btree_detail {
|
namespace btree_detail {
|
||||||
struct damage {
|
struct damage {
|
||||||
typedef boost::shared_ptr<damage> ptr;
|
typedef std::shared_ptr<damage> ptr;
|
||||||
|
|
||||||
damage(run<uint64_t> lost_keys,
|
damage(run<uint64_t> lost_keys,
|
||||||
std::string const &desc)
|
std::string const &desc)
|
||||||
|
@ -19,15 +19,13 @@
|
|||||||
#ifndef REF_COUNTER_H
|
#ifndef REF_COUNTER_H
|
||||||
#define REF_COUNTER_H
|
#define REF_COUNTER_H
|
||||||
|
|
||||||
#include <boost/shared_ptr.hpp>
|
|
||||||
|
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
|
|
||||||
namespace persistent_data {
|
namespace persistent_data {
|
||||||
template <typename ValueType>
|
template <typename ValueType>
|
||||||
class ref_counter {
|
class ref_counter {
|
||||||
public:
|
public:
|
||||||
boost::shared_ptr<ref_counter<ValueType> > ptr;
|
std::shared_ptr<ref_counter<ValueType> > ptr;
|
||||||
|
|
||||||
virtual ~ref_counter() {}
|
virtual ~ref_counter() {}
|
||||||
|
|
||||||
|
@ -20,8 +20,8 @@
|
|||||||
#define ERROR_SET_H
|
#define ERROR_SET_H
|
||||||
|
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
#include <boost/shared_ptr.hpp>
|
|
||||||
#include <list>
|
#include <list>
|
||||||
|
#include <memory>
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ namespace persistent_data {
|
|||||||
// user can control how much detail is displayed.
|
// user can control how much detail is displayed.
|
||||||
class error_set {
|
class error_set {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<error_set> ptr;
|
typedef std::shared_ptr<error_set> ptr;
|
||||||
|
|
||||||
error_set(std::string const &err);
|
error_set(std::string const &err);
|
||||||
|
|
||||||
|
@ -19,8 +19,6 @@
|
|||||||
#include "persistent-data/space-maps/careful_alloc.h"
|
#include "persistent-data/space-maps/careful_alloc.h"
|
||||||
#include "persistent-data/space-maps/subtracting_span_iterator.h"
|
#include "persistent-data/space-maps/subtracting_span_iterator.h"
|
||||||
|
|
||||||
#include <boost/shared_ptr.hpp>
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
@ -30,7 +28,7 @@ namespace {
|
|||||||
|
|
||||||
class sm_careful_alloc : public checked_space_map {
|
class sm_careful_alloc : public checked_space_map {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<sm_careful_alloc> ptr;
|
typedef std::shared_ptr<sm_careful_alloc> ptr;
|
||||||
|
|
||||||
sm_careful_alloc(checked_space_map::ptr sm)
|
sm_careful_alloc(checked_space_map::ptr sm)
|
||||||
: sm_(sm) {
|
: sm_(sm) {
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
namespace persistent_data {
|
namespace persistent_data {
|
||||||
class core_map : public checked_space_map {
|
class core_map : public checked_space_map {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<core_map> ptr;
|
typedef std::shared_ptr<core_map> ptr;
|
||||||
|
|
||||||
core_map(block_address nr_blocks)
|
core_map(block_address nr_blocks)
|
||||||
: counts_(nr_blocks, 0),
|
: counts_(nr_blocks, 0),
|
||||||
|
@ -250,7 +250,7 @@ namespace {
|
|||||||
#if 0
|
#if 0
|
||||||
class ref_count_checker : public btree_checker<1, ref_count_traits> {
|
class ref_count_checker : public btree_checker<1, ref_count_traits> {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<ref_count_checker> ptr;
|
typedef std::shared_ptr<ref_count_checker> ptr;
|
||||||
|
|
||||||
ref_count_checker(block_counter &counter)
|
ref_count_checker(block_counter &counter)
|
||||||
: btree_checker<1, ref_count_traits>(counter) {
|
: btree_checker<1, ref_count_traits>(counter) {
|
||||||
@ -267,7 +267,7 @@ namespace {
|
|||||||
|
|
||||||
class index_store {
|
class index_store {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<index_store> ptr;
|
typedef std::shared_ptr<index_store> ptr;
|
||||||
|
|
||||||
virtual ~index_store() {}
|
virtual ~index_store() {}
|
||||||
|
|
||||||
@ -285,7 +285,7 @@ namespace {
|
|||||||
|
|
||||||
class sm_disk : public checked_space_map {
|
class sm_disk : public checked_space_map {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<sm_disk> ptr;
|
typedef std::shared_ptr<sm_disk> ptr;
|
||||||
typedef transaction_manager::read_ref read_ref;
|
typedef transaction_manager::read_ref read_ref;
|
||||||
typedef transaction_manager::write_ref write_ref;
|
typedef transaction_manager::write_ref write_ref;
|
||||||
|
|
||||||
@ -635,7 +635,7 @@ namespace {
|
|||||||
|
|
||||||
class btree_index_store : public index_store {
|
class btree_index_store : public index_store {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<btree_index_store> ptr;
|
typedef std::shared_ptr<btree_index_store> ptr;
|
||||||
|
|
||||||
btree_index_store(transaction_manager &tm)
|
btree_index_store(transaction_manager &tm)
|
||||||
: tm_(tm),
|
: tm_(tm),
|
||||||
@ -714,7 +714,7 @@ namespace {
|
|||||||
|
|
||||||
class metadata_index_store : public index_store {
|
class metadata_index_store : public index_store {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<metadata_index_store> ptr;
|
typedef std::shared_ptr<metadata_index_store> ptr;
|
||||||
|
|
||||||
metadata_index_store(transaction_manager &tm)
|
metadata_index_store(transaction_manager &tm)
|
||||||
: tm_(tm) {
|
: tm_(tm) {
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
namespace persistent_data {
|
namespace persistent_data {
|
||||||
class noop_map : public checked_space_map {
|
class noop_map : public checked_space_map {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<noop_map> ptr;
|
typedef std::shared_ptr<noop_map> ptr;
|
||||||
|
|
||||||
block_address get_nr_blocks() const {
|
block_address get_nr_blocks() const {
|
||||||
fail();
|
fail();
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include "persistent-data/block_counter.h"
|
#include "persistent-data/block_counter.h"
|
||||||
#include "persistent-data/run.h"
|
#include "persistent-data/run.h"
|
||||||
|
|
||||||
#include <boost/shared_ptr.hpp>
|
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
@ -36,7 +35,7 @@ namespace persistent_data {
|
|||||||
|
|
||||||
class space_map {
|
class space_map {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<space_map> ptr;
|
typedef std::shared_ptr<space_map> ptr;
|
||||||
|
|
||||||
virtual ~space_map() {};
|
virtual ~space_map() {};
|
||||||
|
|
||||||
@ -140,7 +139,7 @@ namespace persistent_data {
|
|||||||
|
|
||||||
class persistent_space_map : public space_map {
|
class persistent_space_map : public space_map {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<persistent_space_map> ptr;
|
typedef std::shared_ptr<persistent_space_map> ptr;
|
||||||
|
|
||||||
virtual void count_metadata(block_counter &bc) const = 0;
|
virtual void count_metadata(block_counter &bc) const = 0;
|
||||||
virtual size_t root_size() const = 0;
|
virtual size_t root_size() const = 0;
|
||||||
@ -149,7 +148,7 @@ namespace persistent_data {
|
|||||||
|
|
||||||
class checked_space_map : public persistent_space_map {
|
class checked_space_map : public persistent_space_map {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<checked_space_map> ptr;
|
typedef std::shared_ptr<checked_space_map> ptr;
|
||||||
|
|
||||||
virtual void visit(space_map_detail::visitor &v) const {
|
virtual void visit(space_map_detail::visitor &v) const {
|
||||||
throw std::runtime_error("space_map.visit not implemented");
|
throw std::runtime_error("space_map.visit not implemented");
|
||||||
|
@ -23,14 +23,13 @@
|
|||||||
#include "space_map.h"
|
#include "space_map.h"
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <boost/shared_ptr.hpp>
|
|
||||||
|
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
|
|
||||||
namespace persistent_data {
|
namespace persistent_data {
|
||||||
class transaction_manager : boost::noncopyable {
|
class transaction_manager : boost::noncopyable {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<transaction_manager> ptr;
|
typedef std::shared_ptr<transaction_manager> ptr;
|
||||||
typedef block_manager::read_ref read_ref;
|
typedef block_manager::read_ref read_ref;
|
||||||
typedef block_manager::write_ref write_ref;
|
typedef block_manager::write_ref write_ref;
|
||||||
typedef bcache::validator::ptr validator;
|
typedef bcache::validator::ptr validator;
|
||||||
|
@ -50,7 +50,7 @@ namespace thin_provisioning {
|
|||||||
|
|
||||||
class damage_visitor {
|
class damage_visitor {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<damage_visitor> ptr;
|
typedef std::shared_ptr<damage_visitor> ptr;
|
||||||
|
|
||||||
virtual ~damage_visitor() {}
|
virtual ~damage_visitor() {}
|
||||||
|
|
||||||
|
@ -19,10 +19,10 @@
|
|||||||
#ifndef EMITTER_H
|
#ifndef EMITTER_H
|
||||||
#define EMITTER_H
|
#define EMITTER_H
|
||||||
|
|
||||||
#include <boost/shared_ptr.hpp>
|
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
#include <boost/optional/optional_io.hpp>
|
#include <boost/optional/optional_io.hpp>
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ namespace thin_provisioning {
|
|||||||
|
|
||||||
class emitter {
|
class emitter {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<emitter> ptr;
|
typedef std::shared_ptr<emitter> ptr;
|
||||||
|
|
||||||
virtual ~emitter() {}
|
virtual ~emitter() {}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ namespace thin_provisioning {
|
|||||||
|
|
||||||
class damage_visitor {
|
class damage_visitor {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<damage_visitor> ptr;
|
typedef std::shared_ptr<damage_visitor> ptr;
|
||||||
|
|
||||||
virtual ~damage_visitor() {}
|
virtual ~damage_visitor() {}
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ namespace thin_provisioning {
|
|||||||
|
|
||||||
typedef block_manager::read_ref read_ref;
|
typedef block_manager::read_ref read_ref;
|
||||||
typedef block_manager::write_ref write_ref;
|
typedef block_manager::write_ref write_ref;
|
||||||
typedef boost::shared_ptr<metadata> ptr;
|
typedef std::shared_ptr<metadata> ptr;
|
||||||
|
|
||||||
metadata(block_manager::ptr bm, open_type ot,
|
metadata(block_manager::ptr bm, open_type ot,
|
||||||
sector_t data_block_size = 128,
|
sector_t data_block_size = 128,
|
||||||
|
@ -56,7 +56,7 @@ namespace thin_provisioning {
|
|||||||
|
|
||||||
class metadata_checker {
|
class metadata_checker {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<metadata_checker> ptr;
|
typedef std::shared_ptr<metadata_checker> ptr;
|
||||||
|
|
||||||
virtual ~metadata_checker() {}
|
virtual ~metadata_checker() {}
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ namespace {
|
|||||||
|
|
||||||
class command {
|
class command {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<command> ptr;
|
typedef std::shared_ptr<command> ptr;
|
||||||
|
|
||||||
virtual ~command() {}
|
virtual ~command() {}
|
||||||
virtual void exec(strings const &args, ostream &out) = 0;
|
virtual void exec(strings const &args, ostream &out) = 0;
|
||||||
|
@ -52,7 +52,7 @@ namespace {
|
|||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
|
|
||||||
struct btree_node_checker {
|
struct btree_node_checker {
|
||||||
typedef boost::shared_ptr<btree_node_checker> ptr;
|
typedef std::shared_ptr<btree_node_checker> ptr;
|
||||||
virtual ~btree_node_checker() {}
|
virtual ~btree_node_checker() {}
|
||||||
virtual bool check(node_ref<uint64_traits> &n) = 0;
|
virtual bool check(node_ref<uint64_traits> &n) = 0;
|
||||||
};
|
};
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
#include "metadata.h"
|
#include "metadata.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <boost/shared_ptr.hpp>
|
|
||||||
|
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
|
|
||||||
@ -34,7 +33,7 @@ namespace thin_provisioning {
|
|||||||
class thin_pool;
|
class thin_pool;
|
||||||
class thin {
|
class thin {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<thin> ptr;
|
typedef std::shared_ptr<thin> ptr;
|
||||||
typedef boost::optional<mapping_tree_detail::block_time> maybe_address;
|
typedef boost::optional<mapping_tree_detail::block_time> maybe_address;
|
||||||
|
|
||||||
thin_dev_t get_dev_t() const;
|
thin_dev_t get_dev_t() const;
|
||||||
@ -57,7 +56,7 @@ namespace thin_provisioning {
|
|||||||
|
|
||||||
class thin_pool {
|
class thin_pool {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<thin_pool> ptr;
|
typedef std::shared_ptr<thin_pool> ptr;
|
||||||
|
|
||||||
thin_pool(metadata::ptr md);
|
thin_pool(metadata::ptr md);
|
||||||
~thin_pool();
|
~thin_pool();
|
||||||
|
@ -61,7 +61,7 @@ namespace {
|
|||||||
|
|
||||||
class validator_mock : public bcache::validator {
|
class validator_mock : public bcache::validator {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<validator_mock> ptr;
|
typedef std::shared_ptr<validator_mock> ptr;
|
||||||
|
|
||||||
MOCK_CONST_METHOD2(check, void(void const *, block_address));
|
MOCK_CONST_METHOD2(check, void(void const *, block_address));
|
||||||
MOCK_CONST_METHOD1(check_raw, bool(void const *data));
|
MOCK_CONST_METHOD1(check_raw, bool(void const *data));
|
||||||
|
@ -66,7 +66,7 @@ namespace {
|
|||||||
//--------------------------------
|
//--------------------------------
|
||||||
|
|
||||||
struct node_info {
|
struct node_info {
|
||||||
typedef boost::shared_ptr<node_info> ptr;
|
typedef std::shared_ptr<node_info> ptr;
|
||||||
|
|
||||||
btree_detail::btree_path path;
|
btree_detail::btree_path path;
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ namespace {
|
|||||||
public:
|
public:
|
||||||
typedef btree_detail::node_location node_location;
|
typedef btree_detail::node_location node_location;
|
||||||
typedef btree<Levels, ValueTraits> tree;
|
typedef btree<Levels, ValueTraits> tree;
|
||||||
typedef boost::shared_ptr<btree_layout_visitor> ptr;
|
typedef std::shared_ptr<btree_layout_visitor> ptr;
|
||||||
|
|
||||||
virtual bool visit_internal(node_location const &loc,
|
virtual bool visit_internal(node_location const &loc,
|
||||||
typename tree::internal_node const &n) {
|
typename tree::internal_node const &n) {
|
||||||
|
@ -19,8 +19,6 @@
|
|||||||
#include "gmock/gmock.h"
|
#include "gmock/gmock.h"
|
||||||
#include "persistent-data/cache.h"
|
#include "persistent-data/cache.h"
|
||||||
|
|
||||||
#include <boost/shared_ptr.hpp>
|
|
||||||
|
|
||||||
using namespace boost;
|
using namespace boost;
|
||||||
using namespace base;
|
using namespace base;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@ -55,7 +53,7 @@ namespace {
|
|||||||
|
|
||||||
struct SharedThingTraits {
|
struct SharedThingTraits {
|
||||||
typedef unsigned key_type;
|
typedef unsigned key_type;
|
||||||
typedef boost::shared_ptr<Thing> value_type;
|
typedef std::shared_ptr<Thing> value_type;
|
||||||
|
|
||||||
static key_type get_key(value_type const &p) {
|
static key_type get_key(value_type const &p) {
|
||||||
return p->key_;
|
return p->key_;
|
||||||
|
@ -61,7 +61,7 @@ namespace {
|
|||||||
class devices_visitor : public detail_tree::visitor {
|
class devices_visitor : public detail_tree::visitor {
|
||||||
public:
|
public:
|
||||||
struct node_info {
|
struct node_info {
|
||||||
typedef boost::shared_ptr<node_info> ptr;
|
typedef std::shared_ptr<node_info> ptr;
|
||||||
|
|
||||||
bool leaf;
|
bool leaf;
|
||||||
unsigned depth;
|
unsigned depth;
|
||||||
@ -71,7 +71,7 @@ namespace {
|
|||||||
};
|
};
|
||||||
|
|
||||||
typedef btree_detail::node_location node_location;
|
typedef btree_detail::node_location node_location;
|
||||||
typedef boost::shared_ptr<devices_visitor> ptr;
|
typedef std::shared_ptr<devices_visitor> ptr;
|
||||||
|
|
||||||
virtual bool visit_internal(node_location const &loc,
|
virtual bool visit_internal(node_location const &loc,
|
||||||
detail_tree::internal_node const &n) {
|
detail_tree::internal_node const &n) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user