diff options
author | Francis Dupont <fdupont@isc.org> | 2016-11-30 15:39:42 +0100 |
---|---|---|
committer | Francis Dupont <fdupont@isc.org> | 2016-11-30 15:39:42 +0100 |
commit | 818d58d73c27092563a244ececddcdd448e2cf70 (patch) | |
tree | fa8e8869352b22aa407989f03328b4cb60b70260 /src/lib/dns/rdataclass.cc | |
parent | [4631b] Applied the not unique_ptr stuff (diff) | |
download | kea-818d58d73c27092563a244ececddcdd448e2cf70.tar.xz kea-818d58d73c27092563a244ececddcdd448e2cf70.zip |
[5066] Enforced C++11 following #4631 discussion
Diffstat (limited to 'src/lib/dns/rdataclass.cc')
-rw-r--r-- | src/lib/dns/rdataclass.cc | 56 |
1 files changed, 33 insertions, 23 deletions
diff --git a/src/lib/dns/rdataclass.cc b/src/lib/dns/rdataclass.cc index 4a9bf3662e..b5c6107b85 100644 --- a/src/lib/dns/rdataclass.cc +++ b/src/lib/dns/rdataclass.cc @@ -5,12 +5,14 @@ /////////////// /////////////// -// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. +#include <config.h> + #include <string> #include <sstream> #include <vector> @@ -217,10 +219,10 @@ TSIG::constructFromLexer(MasterLexer& lexer, const Name* origin) { /// /// \param tsig_str A string containing the RDATA to be created TSIG::TSIG(const std::string& tsig_str) : impl_(NULL) { - // We use auto_ptr here because if there is an exception in this + // We use unique_ptr here because if there is an exception in this // constructor, the destructor is not called and there could be a // leak of the TSIGImpl that constructFromLexer() returns. - std::auto_ptr<TSIGImpl> impl_ptr(NULL); + std::unique_ptr<TSIGImpl> impl_ptr; try { std::istringstream ss(tsig_str); @@ -843,7 +845,7 @@ AFSDB::getSubtype() const { } // end of namespace "rdata" } // end of namespace "dns" } // end of namespace "isc" -// Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -942,10 +944,10 @@ CAA::constructFromLexer(MasterLexer& lexer) { CAA::CAA(const string& caa_str) : impl_(NULL) { - // We use auto_ptr here because if there is an exception in this + // We use unique_ptr here because if there is an exception in this // constructor, the destructor is not called and there could be a // leak of the CAAImpl that constructFromLexer() returns. - std::auto_ptr<CAAImpl> impl_ptr(NULL); + std::unique_ptr<CAAImpl> impl_ptr; try { std::istringstream ss(caa_str); @@ -1527,12 +1529,14 @@ DNAME::getDname() const { } // end of namespace "rdata" } // end of namespace "dns" } // end of namespace "isc" -// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. +#include <config.h> + #include <iostream> #include <string> #include <sstream> @@ -1601,10 +1605,10 @@ struct DNSKEYImpl { DNSKEY::DNSKEY(const std::string& dnskey_str) : impl_(NULL) { - // We use auto_ptr here because if there is an exception in this + // We use unique_ptr here because if there is an exception in this // constructor, the destructor is not called and there could be a // leak of the DNSKEYImpl that constructFromLexer() returns. - std::auto_ptr<DNSKEYImpl> impl_ptr(NULL); + std::unique_ptr<DNSKEYImpl> impl_ptr; try { std::istringstream ss(dnskey_str); @@ -2816,12 +2820,14 @@ NS::getNSName() const { } // end of namespace "rdata" } // end of namespace "dns" } // end of namespace "isc" -// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. +#include <config.h> + #include <iostream> #include <iomanip> #include <string> @@ -2899,10 +2905,10 @@ struct NSEC3Impl { NSEC3::NSEC3(const std::string& nsec3_str) : impl_(NULL) { - // We use auto_ptr here because if there is an exception in this + // We use unique_ptr here because if there is an exception in this // constructor, the destructor is not called and there could be a // leak of the NSEC3Impl that constructFromLexer() returns. - std::auto_ptr<NSEC3Impl> impl_ptr(NULL); + std::unique_ptr<NSEC3Impl> impl_ptr; try { std::istringstream ss(nsec3_str); @@ -3161,12 +3167,14 @@ NSEC3::getNext() const { } // end of namespace "rdata" } // end of namespace "dns" } // end of namespace "isc" -// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. +#include <config.h> + #include <util/buffer.h> #include <util/encode/hex.h> @@ -3222,10 +3230,10 @@ struct NSEC3PARAMImpl { NSEC3PARAM::NSEC3PARAM(const std::string& nsec3param_str) : impl_(NULL) { - // We use auto_ptr here because if there is an exception in this + // We use unique_ptr here because if there is an exception in this // constructor, the destructor is not called and there could be a // leak of the NSEC3PARAMImpl that constructFromLexer() returns. - std::auto_ptr<NSEC3PARAMImpl> impl_ptr(NULL); + std::unique_ptr<NSEC3PARAMImpl> impl_ptr; try { std::istringstream ss(nsec3param_str); @@ -3613,7 +3621,7 @@ NSEC::compare(const Rdata& other) const { } // end of namespace "rdata" } // end of namespace "dns" } // end of namespace "isc" -// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -3703,7 +3711,7 @@ OPT::OPT(MasterLexer&, const Name*, OPT::OPT(InputBuffer& buffer, size_t rdata_len) : impl_(NULL) { - std::auto_ptr<OPTImpl> impl_ptr(new OPTImpl); + std::unique_ptr<OPTImpl> impl_ptr(new OPTImpl); while (true) { if (rdata_len == 0) { @@ -4125,12 +4133,14 @@ RP::compare(const Rdata& other) const { } // end of namespace "rdata" } // end of namespace "dns" } // end of namespace "isc" -// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. +#include <config.h> + #include <string> #include <iomanip> #include <iostream> @@ -4266,10 +4276,10 @@ RRSIG::constructFromLexer(MasterLexer& lexer, const Name* origin) { RRSIG::RRSIG(const std::string& rrsig_str) : impl_(NULL) { - // We use auto_ptr here because if there is an exception in this + // We use unique_ptr here because if there is an exception in this // constructor, the destructor is not called and there could be a // leak of the RRSIGImpl that constructFromLexer() returns. - std::auto_ptr<RRSIGImpl> impl_ptr(NULL); + std::unique_ptr<RRSIGImpl> impl_ptr; try { std::istringstream iss(rrsig_str); @@ -4816,7 +4826,7 @@ SPF::compare(const Rdata& other) const { } // end of namespace "rdata" } // end of namespace "dns" } // end of namespace "isc" -// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2012-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -4924,10 +4934,10 @@ SSHFP::constructFromLexer(MasterLexer& lexer) { SSHFP::SSHFP(const string& sshfp_str) : impl_(NULL) { - // We use auto_ptr here because if there is an exception in this + // We use unique_ptr here because if there is an exception in this // constructor, the destructor is not called and there could be a // leak of the SSHFPImpl that constructFromLexer() returns. - std::auto_ptr<SSHFPImpl> impl_ptr(NULL); + std::unique_ptr<SSHFPImpl> impl_ptr; try { std::istringstream ss(sshfp_str); |