Commit f1f4ce3e authored by Stephen Morris's avatar Stephen Morris

[1470] replaced shared_ptr by boost::shared_ptr

shared_ptr is a candidates for the next STL version and Windows has
already adopted it.  This change removes ambiguity between the Boost
and Windows versions of the class.
parent 0fd58479
...@@ -57,8 +57,6 @@ ...@@ -57,8 +57,6 @@
#include "resolver_log.h" #include "resolver_log.h"
using namespace std; using namespace std;
using boost::shared_ptr;
using namespace isc; using namespace isc;
using namespace isc::util; using namespace isc::util;
using namespace isc::acl; using namespace isc::acl;
...@@ -167,7 +165,7 @@ public: ...@@ -167,7 +165,7 @@ public:
return (*query_acl_); return (*query_acl_);
} }
void setQueryACL(shared_ptr<const RequestACL> new_acl) { void setQueryACL(boost::shared_ptr<const RequestACL> new_acl) {
query_acl_ = new_acl; query_acl_ = new_acl;
} }
...@@ -195,7 +193,7 @@ public: ...@@ -195,7 +193,7 @@ public:
private: private:
/// ACL on incoming queries /// ACL on incoming queries
shared_ptr<const RequestACL> query_acl_; boost::shared_ptr<const RequestACL> query_acl_;
/// Object to handle upstream queries /// Object to handle upstream queries
RecursiveQuery* rec_query_; RecursiveQuery* rec_query_;
...@@ -603,9 +601,9 @@ Resolver::updateConfig(ConstElementPtr config) { ...@@ -603,9 +601,9 @@ Resolver::updateConfig(ConstElementPtr config) {
AddressList listenAddresses(parseAddresses(listenAddressesE, AddressList listenAddresses(parseAddresses(listenAddressesE,
"listen_on")); "listen_on"));
const ConstElementPtr query_acl_cfg(config->get("query_acl")); const ConstElementPtr query_acl_cfg(config->get("query_acl"));
const shared_ptr<const RequestACL> query_acl = const boost::shared_ptr<const RequestACL> query_acl =
query_acl_cfg ? acl::dns::getRequestLoader().load(query_acl_cfg) : query_acl_cfg ? acl::dns::getRequestLoader().load(query_acl_cfg) :
shared_ptr<RequestACL>(); boost::shared_ptr<RequestACL>();
bool set_timeouts(false); bool set_timeouts(false);
int qtimeout = impl_->query_timeout_; int qtimeout = impl_->query_timeout_;
int ctimeout = impl_->client_timeout_; int ctimeout = impl_->client_timeout_;
...@@ -771,7 +769,7 @@ Resolver::getQueryACL() const { ...@@ -771,7 +769,7 @@ Resolver::getQueryACL() const {
} }
void void
Resolver::setQueryACL(shared_ptr<const RequestACL> new_acl) { Resolver::setQueryACL(boost::shared_ptr<const RequestACL> new_acl) {
if (!new_acl) { if (!new_acl) {
isc_throw(InvalidParameter, "NULL pointer is passed to setQueryACL"); isc_throw(InvalidParameter, "NULL pointer is passed to setQueryACL");
} }
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include <acl/logic_check.h> #include <acl/logic_check.h>
using namespace std; using namespace std;
using boost::shared_ptr;
using namespace isc::dns; using namespace isc::dns;
using namespace isc::data; using namespace isc::data;
...@@ -78,7 +77,7 @@ internal::RequestCheckCreator::names() const { ...@@ -78,7 +77,7 @@ internal::RequestCheckCreator::names() const {
return (supported_names); return (supported_names);
} }
shared_ptr<RequestCheck> boost::shared_ptr<RequestCheck>
internal::RequestCheckCreator::create(const string& name, internal::RequestCheckCreator::create(const string& name,
ConstElementPtr definition, ConstElementPtr definition,
// unused: // unused:
...@@ -90,10 +89,10 @@ internal::RequestCheckCreator::create(const string& name, ...@@ -90,10 +89,10 @@ internal::RequestCheckCreator::create(const string& name,
} }
if (name == "from") { if (name == "from") {
return (shared_ptr<internal::RequestIPCheck>( return (boost::shared_ptr<internal::RequestIPCheck>(
new internal::RequestIPCheck(definition->stringValue()))); new internal::RequestIPCheck(definition->stringValue())));
} else if (name == "key") { } else if (name == "key") {
return (shared_ptr<internal::RequestKeyCheck>( return (boost::shared_ptr<internal::RequestKeyCheck>(
new internal::RequestKeyCheck( new internal::RequestKeyCheck(
Name(definition->stringValue())))); Name(definition->stringValue()))));
} else { } else {
...@@ -116,16 +115,17 @@ getRequestLoader() { ...@@ -116,16 +115,17 @@ getRequestLoader() {
auto_ptr<RequestLoader>(new RequestLoader(REJECT)); auto_ptr<RequestLoader>(new RequestLoader(REJECT));
// Register default check creator(s) // Register default check creator(s)
loader_ptr->registerCreator(shared_ptr<internal::RequestCheckCreator>(
new internal::RequestCheckCreator()));
loader_ptr->registerCreator( loader_ptr->registerCreator(
shared_ptr<NotCreator<RequestContext> >( boost::shared_ptr<internal::RequestCheckCreator>(
new internal::RequestCheckCreator()));
loader_ptr->registerCreator(
boost::shared_ptr<NotCreator<RequestContext> >(
new NotCreator<RequestContext>("NOT"))); new NotCreator<RequestContext>("NOT")));
loader_ptr->registerCreator( loader_ptr->registerCreator(
shared_ptr<LogicCreator<AnyOfSpec, RequestContext> >( boost::shared_ptr<LogicCreator<AnyOfSpec, RequestContext> >(
new LogicCreator<AnyOfSpec, RequestContext>("ANY"))); new LogicCreator<AnyOfSpec, RequestContext>("ANY")));
loader_ptr->registerCreator( loader_ptr->registerCreator(
shared_ptr<LogicCreator<AllOfSpec, RequestContext> >( boost::shared_ptr<LogicCreator<AllOfSpec, RequestContext> >(
new LogicCreator<AllOfSpec, RequestContext>("ALL"))); new LogicCreator<AllOfSpec, RequestContext>("ALL")));
// From this point there shouldn't be any exception thrown // From this point there shouldn't be any exception thrown
......
...@@ -70,31 +70,30 @@ public: ...@@ -70,31 +70,30 @@ public:
// Some convenience functions to set up // Some convenience functions to set up
// Create a NamedCreator, convert to shared pointer // Create a NamedCreator, convert to shared pointer
shared_ptr<NamedCreator> namedCreator(const string& name, boost::shared_ptr<NamedCreator> namedCreator(const string& name,
bool abbreviatedList = true) bool abbreviatedList = true)
{ {
return (shared_ptr<NamedCreator>(new NamedCreator(name, return (boost::shared_ptr<NamedCreator>(new NamedCreator(name,
abbreviatedList))); abbreviatedList)));
} }
// Create and add a NamedCreator // Create and add a NamedCreator
void addNamed(const string& name, bool abbreviatedList = true) { void addNamed(const string& name, bool abbreviatedList = true) {
EXPECT_NO_THROW(loader_.registerCreator( EXPECT_NO_THROW(loader_.registerCreator(
namedCreator(name, abbreviatedList))); namedCreator(name, abbreviatedList)));
} }
template<class Result> shared_ptr<Result> loadCheckAny(const string& template<class Result> boost::shared_ptr<Result> loadCheckAny(
definition) const string& definition)
{ {
SCOPED_TRACE("Loading check " + definition); SCOPED_TRACE("Loading check " + definition);
shared_ptr<Check<Log> > loaded; boost::shared_ptr<Check<Log> > loaded;
EXPECT_NO_THROW(loaded = loader_.loadCheck( EXPECT_NO_THROW(loaded = loader_.loadCheck(
Element::fromJSON(definition))); Element::fromJSON(definition)));
shared_ptr<Result> result(dynamic_pointer_cast<Result>( boost::shared_ptr<Result> result(dynamic_pointer_cast<Result>(loaded));
loaded));
EXPECT_TRUE(result); EXPECT_TRUE(result);
return (result); return (result);
} }
// Load a check and convert it to named check to examine it // Load a check and convert it to named check to examine it
shared_ptr<NamedCheck> loadCheck(const string& definition) { boost::shared_ptr<NamedCheck> loadCheck(const string& definition) {
return (loadCheckAny<NamedCheck>(definition)); return (loadCheckAny<NamedCheck>(definition));
} }
// The loadCheck throws an exception // The loadCheck throws an exception
...@@ -114,11 +113,12 @@ public: ...@@ -114,11 +113,12 @@ public:
// Insert the throw, throwcheck and logcheck checks into the loader // Insert the throw, throwcheck and logcheck checks into the loader
void aclSetup() { void aclSetup() {
try { try {
loader_.registerCreator(shared_ptr<ThrowCreator>(new loader_.registerCreator(boost::shared_ptr<ThrowCreator>(
ThrowCreator())); new ThrowCreator()));
loader_.registerCreator(shared_ptr<ThrowCheckCreator>( loader_.registerCreator(boost::shared_ptr<ThrowCheckCreator>(
new ThrowCheckCreator())); new ThrowCheckCreator()));
loader_.registerCreator(shared_ptr<LogCreator>(new LogCreator())); loader_.registerCreator(boost::shared_ptr<LogCreator>(
new LogCreator()));
} }
// We ignore this exception here, because it happens when we try to // We ignore this exception here, because it happens when we try to
// insert the creators multiple times. This is harmless. // insert the creators multiple times. This is harmless.
...@@ -133,7 +133,7 @@ public: ...@@ -133,7 +133,7 @@ public:
{ {
SCOPED_TRACE("Running ACL for " + JSON); SCOPED_TRACE("Running ACL for " + JSON);
aclSetup(); aclSetup();
shared_ptr<ACL<Log> > acl; boost::shared_ptr<ACL<Log> > acl;
EXPECT_NO_THROW(acl = loader_.load(Element::fromJSON(JSON))); EXPECT_NO_THROW(acl = loader_.load(Element::fromJSON(JSON)));
EXPECT_EQ(expectedResult, acl->execute(log_)); EXPECT_EQ(expectedResult, acl->execute(log_));
log_.checkFirst(logged); log_.checkFirst(logged);
...@@ -174,7 +174,7 @@ TEST_F(LoaderTest, CreatorDuplicateUnchanged) { ...@@ -174,7 +174,7 @@ TEST_F(LoaderTest, CreatorDuplicateUnchanged) {
names.push_back("name1"); names.push_back("name1");
names.push_back("name3"); names.push_back("name3");
EXPECT_THROW(loader_.registerCreator( EXPECT_THROW(loader_.registerCreator(
shared_ptr<NamedCreator>(new NamedCreator(names))), LoaderError); boost::shared_ptr<NamedCreator>(new NamedCreator(names))), LoaderError);
// It should now reject both name2 and name3 as not known // It should now reject both name2 and name3 as not known
checkException("{\"name2\": null}"); checkException("{\"name2\": null}");
checkException("{\"name3\": null}"); checkException("{\"name3\": null}");
...@@ -183,7 +183,7 @@ TEST_F(LoaderTest, CreatorDuplicateUnchanged) { ...@@ -183,7 +183,7 @@ TEST_F(LoaderTest, CreatorDuplicateUnchanged) {
// Test that we can register a creator and load a check with the name // Test that we can register a creator and load a check with the name
TEST_F(LoaderTest, SimpleCheckLoad) { TEST_F(LoaderTest, SimpleCheckLoad) {
addNamed("name"); addNamed("name");
shared_ptr<NamedCheck> check(loadCheck("{\"name\": 42}")); boost::shared_ptr<NamedCheck> check(loadCheck("{\"name\": 42}"));
EXPECT_EQ("name", check->name_); EXPECT_EQ("name", check->name_);
EXPECT_TRUE(check->data_->equals(*Element::fromJSON("42"))); EXPECT_TRUE(check->data_->equals(*Element::fromJSON("42")));
} }
...@@ -192,7 +192,7 @@ TEST_F(LoaderTest, SimpleCheckLoad) { ...@@ -192,7 +192,7 @@ TEST_F(LoaderTest, SimpleCheckLoad) {
TEST_F(LoaderTest, MultiCreatorCheckLoad) { TEST_F(LoaderTest, MultiCreatorCheckLoad) {
addNamed("name1"); addNamed("name1");
addNamed("name2"); addNamed("name2");
shared_ptr<NamedCheck> check(loadCheck("{\"name2\": 42}")); boost::shared_ptr<NamedCheck> check(loadCheck("{\"name2\": 42}"));
EXPECT_EQ("name2", check->name_); EXPECT_EQ("name2", check->name_);
EXPECT_TRUE(check->data_->equals(*Element::fromJSON("42"))); EXPECT_TRUE(check->data_->equals(*Element::fromJSON("42")));
} }
...@@ -203,9 +203,9 @@ TEST_F(LoaderTest, MultiNameCheckLoad) { ...@@ -203,9 +203,9 @@ TEST_F(LoaderTest, MultiNameCheckLoad) {
vector<string> names; vector<string> names;
names.push_back("name2"); names.push_back("name2");
names.push_back("name3"); names.push_back("name3");
EXPECT_NO_THROW(loader_.registerCreator(shared_ptr<NamedCreator>( EXPECT_NO_THROW(loader_.registerCreator(boost::shared_ptr<NamedCreator>(
new NamedCreator(names)))); new NamedCreator(names))));
shared_ptr<NamedCheck> check(loadCheck("{\"name3\": 42}")); boost::shared_ptr<NamedCheck> check(loadCheck("{\"name3\": 42}"));
EXPECT_EQ("name3", check->name_); EXPECT_EQ("name3", check->name_);
EXPECT_TRUE(check->data_->equals(*Element::fromJSON("42"))); EXPECT_TRUE(check->data_->equals(*Element::fromJSON("42")));
} }
...@@ -230,7 +230,8 @@ TEST_F(LoaderTest, UnkownName) { ...@@ -230,7 +230,8 @@ TEST_F(LoaderTest, UnkownName) {
// Exception from the creator is propagated // Exception from the creator is propagated
TEST_F(LoaderTest, CheckPropagate) { TEST_F(LoaderTest, CheckPropagate) {
loader_.registerCreator(shared_ptr<ThrowCreator>(new ThrowCreator())); loader_.registerCreator(boost::shared_ptr<ThrowCreator>(
new ThrowCreator()));
EXPECT_THROW(loader_.loadCheck(Element::fromJSON("{\"throw\": null}")), EXPECT_THROW(loader_.loadCheck(Element::fromJSON("{\"throw\": null}")),
TestCreatorError); TestCreatorError);
} }
...@@ -239,7 +240,7 @@ TEST_F(LoaderTest, CheckPropagate) { ...@@ -239,7 +240,7 @@ TEST_F(LoaderTest, CheckPropagate) {
TEST_F(LoaderTest, AndAbbrev) { TEST_F(LoaderTest, AndAbbrev) {
addNamed("name1"); addNamed("name1");
addNamed("name2"); addNamed("name2");
shared_ptr<LogicOperator<AllOfSpec, Log> > oper( boost::shared_ptr<LogicOperator<AllOfSpec, Log> > oper(
loadCheckAny<LogicOperator<AllOfSpec, Log> >("{\"name1\": 1, \"name2\": 2}")); loadCheckAny<LogicOperator<AllOfSpec, Log> >("{\"name1\": 1, \"name2\": 2}"));
// If we don't have anything loaded, the rest would crash. It is already // If we don't have anything loaded, the rest would crash. It is already
// reported from within loadCheckAny if it isn't loaded. // reported from within loadCheckAny if it isn't loaded.
...@@ -258,7 +259,7 @@ TEST_F(LoaderTest, AndAbbrev) { ...@@ -258,7 +259,7 @@ TEST_F(LoaderTest, AndAbbrev) {
// The abbreviated form of parameters // The abbreviated form of parameters
TEST_F(LoaderTest, OrAbbrev) { TEST_F(LoaderTest, OrAbbrev) {
addNamed("name1"); addNamed("name1");
shared_ptr<LogicOperator<AnyOfSpec, Log> > oper( boost::shared_ptr<LogicOperator<AnyOfSpec, Log> > oper(
loadCheckAny<LogicOperator<AnyOfSpec, Log> >("{\"name1\": [1, 2]}")); loadCheckAny<LogicOperator<AnyOfSpec, Log> >("{\"name1\": [1, 2]}"));
// If we don't have anything loaded, the rest would crash. It is already // If we don't have anything loaded, the rest would crash. It is already
// reported from within loadCheckAny if it isn't loaded. // reported from within loadCheckAny if it isn't loaded.
...@@ -276,7 +277,7 @@ TEST_F(LoaderTest, OrAbbrev) { ...@@ -276,7 +277,7 @@ TEST_F(LoaderTest, OrAbbrev) {
TEST_F(LoaderTest, BothAbbrev) { TEST_F(LoaderTest, BothAbbrev) {
addNamed("name1"); addNamed("name1");
addNamed("name2"); addNamed("name2");
shared_ptr<LogicOperator<AllOfSpec, Log> > oper( boost::shared_ptr<LogicOperator<AllOfSpec, Log> > oper(
loadCheckAny<LogicOperator<AllOfSpec, Log> >("{\"name1\": 1, \"name2\": [3, 4]}")); loadCheckAny<LogicOperator<AllOfSpec, Log> >("{\"name1\": 1, \"name2\": [3, 4]}"));
// If we don't have anything loaded, the rest would crash. It is already // If we don't have anything loaded, the rest would crash. It is already
// reported from within loadCheckAny if it isn't loaded. // reported from within loadCheckAny if it isn't loaded.
...@@ -302,7 +303,7 @@ TEST_F(LoaderTest, BothAbbrev) { ...@@ -302,7 +303,7 @@ TEST_F(LoaderTest, BothAbbrev) {
// creator // creator
TEST_F(LoaderTest, ListCheck) { TEST_F(LoaderTest, ListCheck) {
addNamed("name1", false); addNamed("name1", false);
shared_ptr<NamedCheck> check(loadCheck("{\"name1\": [1, 2]}")); boost::shared_ptr<NamedCheck> check(loadCheck("{\"name1\": [1, 2]}"));
EXPECT_EQ("name1", check->name_); EXPECT_EQ("name1", check->name_);
EXPECT_TRUE(check->data_->equals(*Element::fromJSON("[1, 2]"))); EXPECT_TRUE(check->data_->equals(*Element::fromJSON("[1, 2]")));
} }
...@@ -310,7 +311,7 @@ TEST_F(LoaderTest, ListCheck) { ...@@ -310,7 +311,7 @@ TEST_F(LoaderTest, ListCheck) {
// Check the action key is ignored as it should be // Check the action key is ignored as it should be
TEST_F(LoaderTest, CheckNoAction) { TEST_F(LoaderTest, CheckNoAction) {
addNamed("name1"); addNamed("name1");
shared_ptr<NamedCheck> check(loadCheck("{\"name1\": 1, \"action\": 2}")); boost::shared_ptr<NamedCheck> check(loadCheck("{\"name1\": 1, \"action\": 2}"));
EXPECT_EQ("name1", check->name_); EXPECT_EQ("name1", check->name_);
EXPECT_TRUE(check->data_->equals(*Element::fromJSON("1"))); EXPECT_TRUE(check->data_->equals(*Element::fromJSON("1")));
} }
......
...@@ -52,7 +52,7 @@ testCheck(bool emptyResult) { ...@@ -52,7 +52,7 @@ testCheck(bool emptyResult) {
EXPECT_EQ(emptyResult, oper.matches(log)); EXPECT_EQ(emptyResult, oper.matches(log));
log.checkFirst(0); log.checkFirst(0);
// Fill it with some subexpressions // Fill it with some subexpressions
typedef shared_ptr<ConstCheck> CheckPtr; typedef boost::shared_ptr<ConstCheck> CheckPtr;
oper.addSubexpression(CheckPtr(new ConstCheck(emptyResult, 0))); oper.addSubexpression(CheckPtr(new ConstCheck(emptyResult, 0)));
oper.addSubexpression(CheckPtr(new ConstCheck(emptyResult, 1))); oper.addSubexpression(CheckPtr(new ConstCheck(emptyResult, 1)));
// Check what happens when only the default-valued are there // Check what happens when only the default-valued are there
...@@ -80,7 +80,7 @@ TEST(LogicOperators, AnyOf) { ...@@ -80,7 +80,7 @@ TEST(LogicOperators, AnyOf) {
// Fixture for the tests of the creators // Fixture for the tests of the creators
class LogicCreatorTest : public ::testing::Test { class LogicCreatorTest : public ::testing::Test {
private: private:
typedef shared_ptr<Loader<Log>::CheckCreator> CreatorPtr; typedef boost::shared_ptr<Loader<Log>::CheckCreator> CreatorPtr;
public: public:
// Register some creators, both tested ones and some auxiliary ones for // Register some creators, both tested ones and some auxiliary ones for
// help // help
...@@ -102,12 +102,12 @@ public: ...@@ -102,12 +102,12 @@ public:
// Some convenience shortcut names // Some convenience shortcut names
typedef LogicOperator<AnyOfSpec, Log> AnyOf; typedef LogicOperator<AnyOfSpec, Log> AnyOf;
typedef LogicOperator<AllOfSpec, Log> AllOf; typedef LogicOperator<AllOfSpec, Log> AllOf;
typedef shared_ptr<AnyOf> AnyOfPtr; typedef boost::shared_ptr<AnyOf> AnyOfPtr;
typedef shared_ptr<AllOf> AllOfPtr; typedef boost::shared_ptr<AllOf> AllOfPtr;
// Loads the JSON as a check and tries to convert it to the given check // Loads the JSON as a check and tries to convert it to the given check
// subclass // subclass
template<typename Result> shared_ptr<Result> load(const string& JSON) { template<typename Result> boost::shared_ptr<Result> load(const string& JSON) {
shared_ptr<Check<Log> > result; boost::shared_ptr<Check<Log> > result;
EXPECT_NO_THROW(result = loader_.loadCheck(Element::fromJSON(JSON))); EXPECT_NO_THROW(result = loader_.loadCheck(Element::fromJSON(JSON)));
/* /*
* Optimally, we would use a dynamic_pointer_cast here to both * Optimally, we would use a dynamic_pointer_cast here to both
...@@ -122,9 +122,9 @@ public: ...@@ -122,9 +122,9 @@ public:
* multiple inheritance. * multiple inheritance.
*/ */
EXPECT_STREQ(typeid(Result).name(), typeid(*result.get()).name()); EXPECT_STREQ(typeid(Result).name(), typeid(*result.get()).name());
shared_ptr<Result> boost::shared_ptr<Result>
resultConverted(static_pointer_cast<Result>(result)); resultConverted(static_pointer_cast<Result>(result));
EXPECT_NE(shared_ptr<Result>(), resultConverted); EXPECT_NE(boost::shared_ptr<Result>(), resultConverted);
return (resultConverted); return (resultConverted);
} }
}; };
...@@ -244,7 +244,8 @@ TEST_F(LogicCreatorTest, nested) { ...@@ -244,7 +244,8 @@ TEST_F(LogicCreatorTest, nested) {
} }
void notTest(bool value) { void notTest(bool value) {
NotOperator<Log> notOp(shared_ptr<Check<Log> >(new ConstCheck(value, 0))); NotOperator<Log> notOp(boost::shared_ptr<Check<Log> >(
new ConstCheck(value, 0)));
Log log; Log log;
// It returns negated value // It returns negated value
EXPECT_EQ(!value, notOp.matches(log)); EXPECT_EQ(!value, notOp.matches(log));
...@@ -281,7 +282,7 @@ TEST_F(LogicCreatorTest, notInvalid) { ...@@ -281,7 +282,7 @@ TEST_F(LogicCreatorTest, notInvalid) {
} }
TEST_F(LogicCreatorTest, notValid) { TEST_F(LogicCreatorTest, notValid) {
shared_ptr<NotOperator<Log> > notOp(load<NotOperator<Log> >("{\"NOT\":" boost::shared_ptr<NotOperator<Log> > notOp(load<NotOperator<Log> >("{\"NOT\":"
" {\"logcheck\":" " {\"logcheck\":"
" [0, true]}}")); " [0, true]}}"));
EXPECT_FALSE(notOp->matches(log_)); EXPECT_FALSE(notOp->matches(log_));
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
using namespace isc::dns; using namespace isc::dns;
using namespace std; using namespace std;
using boost::shared_ptr;
using namespace isc::dns::rdata; using namespace isc::dns::rdata;
namespace isc { namespace isc {
...@@ -874,7 +873,7 @@ namespace { ...@@ -874,7 +873,7 @@ namespace {
/// for next time. /// for next time.
class DatabaseIterator : public ZoneIterator { class DatabaseIterator : public ZoneIterator {
public: public:
DatabaseIterator(shared_ptr<DatabaseAccessor> accessor, DatabaseIterator(boost::shared_ptr<DatabaseAccessor> accessor,
const Name& zone_name, const Name& zone_name,
const RRClass& rrclass, const RRClass& rrclass,
bool separate_rrs) : bool separate_rrs) :
...@@ -970,7 +969,7 @@ private: ...@@ -970,7 +969,7 @@ private:
} }
// The dedicated accessor // The dedicated accessor
shared_ptr<DatabaseAccessor> accessor_; boost::shared_ptr<DatabaseAccessor> accessor_;
// The context // The context
DatabaseAccessor::IteratorContextPtr context_; DatabaseAccessor::IteratorContextPtr context_;
// Class of the zone // Class of the zone
...@@ -1006,7 +1005,7 @@ DatabaseClient::getIterator(const isc::dns::Name& name, ...@@ -1006,7 +1005,7 @@ DatabaseClient::getIterator(const isc::dns::Name& name,
// //
class DatabaseUpdater : public ZoneUpdater { class DatabaseUpdater : public ZoneUpdater {
public: public:
DatabaseUpdater(shared_ptr<DatabaseAccessor> accessor, int zone_id, DatabaseUpdater(boost::shared_ptr<DatabaseAccessor> accessor, int zone_id,
const Name& zone_name, const RRClass& zone_class, const Name& zone_name, const RRClass& zone_class,
bool journaling) : bool journaling) :
committed_(false), accessor_(accessor), zone_id_(zone_id), committed_(false), accessor_(accessor), zone_id_(zone_id),
...@@ -1052,7 +1051,7 @@ private: ...@@ -1052,7 +1051,7 @@ private:
typedef DatabaseAccessor Accessor; typedef DatabaseAccessor Accessor;
bool committed_; bool committed_;
shared_ptr<DatabaseAccessor> accessor_; boost::shared_ptr<DatabaseAccessor> accessor_;
const int zone_id_; const int zone_id_;
const string db_name_; const string db_name_;
const string zone_name_; const string zone_name_;
...@@ -1229,7 +1228,7 @@ DatabaseClient::getUpdater(const isc::dns::Name& name, bool replace, ...@@ -1229,7 +1228,7 @@ DatabaseClient::getUpdater(const isc::dns::Name& name, bool replace,
isc_throw(isc::BadValue, "Can't store journal and replace the whole " isc_throw(isc::BadValue, "Can't store journal and replace the whole "
"zone at the same time"); "zone at the same time");
} }
shared_ptr<DatabaseAccessor> update_accessor(accessor_->clone()); boost::shared_ptr<DatabaseAccessor> update_accessor(accessor_->clone());
const std::pair<bool, int> zone(update_accessor->startUpdateZone( const std::pair<bool, int> zone(update_accessor->startUpdateZone(
name.toText(), replace)); name.toText(), replace));
if (!zone.first) { if (!zone.first) {
...@@ -1249,7 +1248,7 @@ private: ...@@ -1249,7 +1248,7 @@ private:
// A shortcut typedef to keep the code concise. // A shortcut typedef to keep the code concise.
typedef DatabaseAccessor Accessor; typedef DatabaseAccessor Accessor;
public: public:
DatabaseJournalReader(shared_ptr<Accessor> accessor, const Name& zone, DatabaseJournalReader(boost::shared_ptr<Accessor> accessor, const Name& zone,
int zone_id, const RRClass& rrclass, uint32_t begin, int zone_id, const RRClass& rrclass, uint32_t begin,
uint32_t end) : uint32_t end) :
accessor_(accessor), zone_(zone), rrclass_(rrclass), accessor_(accessor), zone_(zone), rrclass_(rrclass),
...@@ -1297,7 +1296,7 @@ public: ...@@ -1297,7 +1296,7 @@ public:
} }
private: private:
shared_ptr<Accessor> accessor_; boost::shared_ptr<Accessor> accessor_;
const Name zone_; const Name zone_;
const RRClass rrclass_; const RRClass rrclass_;
Accessor::IteratorContextPtr context_; Accessor::IteratorContextPtr context_;
...@@ -1312,7 +1311,7 @@ DatabaseClient::getJournalReader(const isc::dns::Name& zone, ...@@ -1312,7 +1311,7 @@ DatabaseClient::getJournalReader(const isc::dns::Name& zone,
uint32_t begin_serial, uint32_t begin_serial,
uint32_t end_serial) const uint32_t end_serial) const
{ {
shared_ptr<DatabaseAccessor> jnl_accessor(accessor_->clone()); boost::shared_ptr<DatabaseAccessor> jnl_accessor(accessor_->clone());
const pair<bool, int> zoneinfo(jnl_accessor->getZone(zone.toText())); const pair<bool, int> zoneinfo(jnl_accessor->getZone(zone.toText()));
if (!zoneinfo.first) { if (!zoneinfo.first) {
return (pair<ZoneJournalReader::Result, ZoneJournalReaderPtr>( return (pair<ZoneJournalReader::Result, ZoneJournalReaderPtr>(
......
...@@ -41,7 +41,6 @@ using namespace isc::datasrc; ...@@ -41,7 +41,6 @@ using namespace isc::datasrc;
using namespace std; using namespace std;
// don't import the entire boost namespace. It will unexpectedly hide uint32_t // don't import the entire boost namespace. It will unexpectedly hide uint32_t
// for some systems. // for some systems.
using boost::shared_ptr;
using boost::dynamic_pointer_cast; using boost::dynamic_pointer_cast;
using boost::lexical_cast; using boost::lexical_cast;
using namespace isc::dns; using namespace isc::dns;
...@@ -229,9 +228,9 @@ public: ...@@ -229,9 +228,9 @@ public:
} }
} }
virtual shared_ptr<DatabaseAccessor> clone() { virtual boost::shared_ptr<DatabaseAccessor> clone() {
// This accessor is stateless, so we can simply return a new instance. // This accessor is stateless, so we can simply return a new instance.
return (shared_ptr<DatabaseAccessor>(new NopAccessor)); return (boost::shared_ptr<DatabaseAccessor>(new NopAccessor));
} }
virtual std::pair<bool, int> startUpdateZone(const std::string&, bool) { virtual std::pair<bool, int> startUpdateZone(const std::string&, bool) {
...@@ -350,8 +349,8 @@ public: ...@@ -350,8 +349,8 @@ public:
fillData(); fillData();
} }