Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Boost scoped_ptr and scoped_ptr #1320

Merged
merged 3 commits into from
Jun 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions src/masternodes/anchors.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
#include <functional>
#include <vector>

#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>

#include <boost/multi_index_container.hpp>
#include <boost/multi_index/mem_fun.hpp>
#include <boost/multi_index/member.hpp>
Expand Down Expand Up @@ -189,8 +186,8 @@ class CAnchorAuthIndex
class CAnchorIndex
{
private:
boost::shared_ptr<CDBWrapper> db;
boost::scoped_ptr<CDBBatch> batch;
std::shared_ptr<CDBWrapper> db;
std::unique_ptr<CDBBatch> batch;
public:
using Signature = std::vector<unsigned char>;
using CTeam = CAnchorData::CTeam;
Expand Down Expand Up @@ -275,7 +272,7 @@ class CAnchorIndex
template <typename Key, typename Value>
bool IterateTable(char prefix, std::function<void(Key const &, Value &)> callback)
{
boost::scoped_ptr<CDBIterator> pcursor(const_cast<CDBWrapper*>(&*db)->NewIterator());
std::unique_ptr<CDBIterator> pcursor(const_cast<CDBWrapper*>(&*db)->NewIterator());
pcursor->Seek(prefix);

while (pcursor->Valid())
Expand Down
11 changes: 4 additions & 7 deletions src/spv/spv_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
#include <utility>
#include <vector>

#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>

#include <boost/multi_index_container.hpp>
#include <boost/multi_index/mem_fun.hpp>
#include <boost/multi_index/member.hpp>
Expand Down Expand Up @@ -82,8 +79,8 @@ using namespace boost::multi_index;
class CSpvWrapper
{
private:
boost::shared_ptr<CDBWrapper> db;
boost::scoped_ptr<CDBBatch> batch;
std::shared_ptr<CDBWrapper> db;
std::unique_ptr<CDBBatch> batch;

BRPeerManager *manager = nullptr;
std::string spv_internal_logfilename;
Expand Down Expand Up @@ -202,7 +199,7 @@ class CSpvWrapper
template <typename Key, typename Value>
bool IterateTable(char prefix, std::function<void(Key const &, Value &)> callback)
{
boost::scoped_ptr<CDBIterator> pcursor(const_cast<CDBWrapper*>(&*db)->NewIterator());
std::unique_ptr<CDBIterator> pcursor(const_cast<CDBWrapper*>(&*db)->NewIterator());
pcursor->Seek(prefix);

while (pcursor->Valid())
Expand Down Expand Up @@ -230,7 +227,7 @@ class CSpvWrapper
template <typename Key>
bool DeleteTable(char prefix)
{
boost::scoped_ptr<CDBIterator> pcursor(const_cast<CDBWrapper*>(&*db)->NewIterator());
std::unique_ptr<CDBIterator> pcursor(const_cast<CDBWrapper*>(&*db)->NewIterator());
pcursor->Seek(prefix);

while (pcursor->Valid())
Expand Down
2 changes: 0 additions & 2 deletions test/lint/lint-includes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ EXPECTED_BOOST_INCLUDES=(
boost/preprocessor/cat.hpp
boost/preprocessor/stringize.hpp
boost/range/adaptor/transformed.hpp
boost/scoped_ptr.hpp
boost/shared_ptr.hpp
boost/signals2/connection.hpp
boost/signals2/last_value.hpp
boost/signals2/signal.hpp
Expand Down