Use default where possible

pull/734/head
Nils Maier 2016-07-31 02:18:43 +02:00
parent 08f4b5e4f4
commit 366e2e8f79
272 changed files with 346 additions and 368 deletions

View File

@ -40,7 +40,7 @@ namespace aria2 {
AbstractAuthResolver::AbstractAuthResolver() {}
AbstractAuthResolver::~AbstractAuthResolver() {}
AbstractAuthResolver::~AbstractAuthResolver() = default;
void AbstractAuthResolver::setUserDefinedCred(std::string user,
std::string password)

View File

@ -54,7 +54,7 @@ AbstractBtMessage::AbstractBtMessage(uint8_t id, const char* name)
{
}
AbstractBtMessage::~AbstractBtMessage() {}
AbstractBtMessage::~AbstractBtMessage() = default;
void AbstractBtMessage::setPeer(const std::shared_ptr<Peer>& peer)
{

View File

@ -58,7 +58,7 @@ AbstractOptionHandler::AbstractOptionHandler(PrefPtr pref,
{
}
AbstractOptionHandler::~AbstractOptionHandler() {}
AbstractOptionHandler::~AbstractOptionHandler() = default;
void AbstractOptionHandler::parse(Option& option, const std::string& arg) const
{

View File

@ -64,7 +64,7 @@ AbstractProxyRequestCommand::AbstractProxyRequestCommand(
setWriteCheckSocket(getSocket());
}
AbstractProxyRequestCommand::~AbstractProxyRequestCommand() {}
AbstractProxyRequestCommand::~AbstractProxyRequestCommand() = default;
bool AbstractProxyRequestCommand::executeInternal()
{

View File

@ -60,7 +60,7 @@ AbstractProxyResponseCommand::AbstractProxyResponseCommand(
{
}
AbstractProxyResponseCommand::~AbstractProxyResponseCommand() {}
AbstractProxyResponseCommand::~AbstractProxyResponseCommand() = default;
bool AbstractProxyResponseCommand::executeInternal()
{

View File

@ -51,7 +51,7 @@ AbstractSingleDiskAdaptor::AbstractSingleDiskAdaptor()
{
}
AbstractSingleDiskAdaptor::~AbstractSingleDiskAdaptor() {}
AbstractSingleDiskAdaptor::~AbstractSingleDiskAdaptor() = default;
void AbstractSingleDiskAdaptor::initAndOpenFile()
{

View File

@ -51,7 +51,7 @@ AdaptiveFileAllocationIterator::AdaptiveFileAllocationIterator(
{
}
AdaptiveFileAllocationIterator::~AdaptiveFileAllocationIterator() {}
AdaptiveFileAllocationIterator::~AdaptiveFileAllocationIterator() = default;
void AdaptiveFileAllocationIterator::allocateChunk()
{

View File

@ -72,7 +72,7 @@ AdaptiveURISelector::AdaptiveURISelector(
resetCounters();
}
AdaptiveURISelector::~AdaptiveURISelector() {}
AdaptiveURISelector::~AdaptiveURISelector() = default;
std::string AdaptiveURISelector::select(
FileEntry* fileEntry,

View File

@ -58,7 +58,7 @@ AnnounceList::AnnounceList(
resetIterator();
}
AnnounceList::~AnnounceList() {}
AnnounceList::~AnnounceList() = default;
void AnnounceList::reconfigure(
const std::vector<std::vector<std::string>>& announceList)

View File

@ -41,7 +41,7 @@ AnnounceTier::AnnounceTier(std::deque<std::string> urls)
{
}
AnnounceTier::~AnnounceTier() {}
AnnounceTier::~AnnounceTier() = default;
void AnnounceTier::nextEvent()
{

View File

@ -45,8 +45,8 @@ namespace aria2 {
template <class DiskWriterType>
class AnonDiskWriterFactory : public DiskWriterFactory {
public:
AnonDiskWriterFactory() {}
virtual ~AnonDiskWriterFactory() {}
AnonDiskWriterFactory() = default;
virtual ~AnonDiskWriterFactory() = default;
virtual std::unique_ptr<DiskWriter>
newDiskWriter(const std::string& filename) CXX11_OVERRIDE

View File

@ -43,7 +43,7 @@ ApiCallbackDownloadEventListener::ApiCallbackDownloadEventListener(
{
}
ApiCallbackDownloadEventListener::~ApiCallbackDownloadEventListener() {}
ApiCallbackDownloadEventListener::~ApiCallbackDownloadEventListener() = default;
void ApiCallbackDownloadEventListener::onEvent(DownloadEvent event,
const RequestGroup* group)

View File

@ -48,7 +48,7 @@ template <size_t dlen, typename ctx_t, int (*init_fn)(ctx_t*),
class MessageDigestBase : public MessageDigestImpl {
public:
MessageDigestBase() { reset(); }
virtual ~MessageDigestBase() {}
virtual ~MessageDigestBase() = default;
static size_t length() { return dlen; }
virtual size_t getDigestLength() const CXX11_OVERRIDE { return dlen; }

View File

@ -47,7 +47,7 @@ AuthConfig::AuthConfig(std::string user, std::string password)
{
}
AuthConfig::~AuthConfig() {}
AuthConfig::~AuthConfig() = default;
std::string AuthConfig::getAuthText() const
{

View File

@ -54,7 +54,7 @@ const std::string AUTH_DEFAULT_PASSWD("ARIA2USER@");
AuthConfigFactory::AuthConfigFactory() {}
AuthConfigFactory::~AuthConfigFactory() {}
AuthConfigFactory::~AuthConfigFactory() = default;
std::unique_ptr<AuthConfig>
AuthConfigFactory::createAuthConfig(const std::shared_ptr<Request>& request,

View File

@ -46,7 +46,7 @@ class AuthConfig;
class AuthResolver {
public:
virtual ~AuthResolver() {}
virtual ~AuthResolver() = default;
virtual std::unique_ptr<AuthConfig>
resolveAuthConfig(const std::string& hostname) = 0;

View File

@ -44,7 +44,7 @@ AutoSaveCommand::AutoSaveCommand(cuid_t cuid, DownloadEngine* e,
{
}
AutoSaveCommand::~AutoSaveCommand() {}
AutoSaveCommand::~AutoSaveCommand() = default;
void AutoSaveCommand::preProcess()
{

View File

@ -72,7 +72,7 @@ BencodeParser::BencodeParser(StructParserStateMachine* psm)
stateStack_.push(BENCODE_FINISH);
}
BencodeParser::~BencodeParser() {}
BencodeParser::~BencodeParser() = default;
ssize_t BencodeParser::parseUpdate(const char* data, size_t size)
{

View File

@ -43,7 +43,7 @@ namespace aria2 {
class BinaryStream {
public:
virtual ~BinaryStream() {}
virtual ~BinaryStream() = default;
virtual void writeData(const unsigned char* data, size_t len,
int64_t offset) = 0;

View File

@ -43,6 +43,6 @@ BtAbortOutstandingRequestEvent::BtAbortOutstandingRequestEvent(
{
}
BtAbortOutstandingRequestEvent::~BtAbortOutstandingRequestEvent() {}
BtAbortOutstandingRequestEvent::~BtAbortOutstandingRequestEvent() = default;
} // namespace aria2

View File

@ -49,7 +49,7 @@ struct UDPTrackerRequest;
class BtAnnounce {
public:
virtual ~BtAnnounce() {}
virtual ~BtAnnounce() = default;
/**
* Returns true if announce is required.

View File

@ -56,7 +56,7 @@ BtBitfieldMessage::BtBitfieldMessage(const unsigned char* bitfield,
{
}
BtBitfieldMessage::~BtBitfieldMessage() {}
BtBitfieldMessage::~BtBitfieldMessage() = default;
void BtBitfieldMessage::setBitfield(const unsigned char* bitfield,
size_t bitfieldLength)

View File

@ -44,7 +44,7 @@ BtBitfieldMessageValidator::BtBitfieldMessageValidator(
{
}
BtBitfieldMessageValidator::~BtBitfieldMessageValidator() {}
BtBitfieldMessageValidator::~BtBitfieldMessageValidator() = default;
void BtBitfieldMessageValidator::validate()
{

View File

@ -51,7 +51,7 @@ BtCheckIntegrityEntry::BtCheckIntegrityEntry(RequestGroup* requestGroup)
{
}
BtCheckIntegrityEntry::~BtCheckIntegrityEntry() {}
BtCheckIntegrityEntry::~BtCheckIntegrityEntry() = default;
void BtCheckIntegrityEntry::onDownloadIncomplete(
std::vector<std::unique_ptr<Command>>& commands, DownloadEngine* e)

View File

@ -59,7 +59,7 @@ BtDependency::BtDependency(RequestGroup* dependant,
{
}
BtDependency::~BtDependency() {}
BtDependency::~BtDependency() = default;
namespace {
void copyValues(const std::shared_ptr<FileEntry>& d,

View File

@ -55,7 +55,7 @@ BtFileAllocationEntry::BtFileAllocationEntry(RequestGroup* requestGroup)
{
}
BtFileAllocationEntry::~BtFileAllocationEntry() {}
BtFileAllocationEntry::~BtFileAllocationEntry() = default;
void BtFileAllocationEntry::prepareForNextAction(
std::vector<std::unique_ptr<Command>>& commands, DownloadEngine* e)

View File

@ -55,7 +55,7 @@ BtHandshakeMessage::BtHandshakeMessage(const unsigned char* infoHash,
std::copy_n(peerId, peerId_.size(), std::begin(peerId_));
}
BtHandshakeMessage::~BtHandshakeMessage() {}
BtHandshakeMessage::~BtHandshakeMessage() = default;
void BtHandshakeMessage::init()
{

View File

@ -50,7 +50,7 @@ BtHandshakeMessageValidator::BtHandshakeMessageValidator(
memcpy(infoHash_, infoHash, sizeof(infoHash_));
}
BtHandshakeMessageValidator::~BtHandshakeMessageValidator() {}
BtHandshakeMessageValidator::~BtHandshakeMessageValidator() = default;
void BtHandshakeMessageValidator::validate()
{

View File

@ -45,7 +45,7 @@ class BtHandshakeMessage;
class BtInteractive {
public:
virtual ~BtInteractive() {}
virtual ~BtInteractive() = default;
virtual void initiateHandshake() = 0;

View File

@ -46,7 +46,7 @@ BtInterestedMessage::BtInterestedMessage()
{
}
BtInterestedMessage::~BtInterestedMessage() {}
BtInterestedMessage::~BtInterestedMessage() = default;
std::unique_ptr<BtInterestedMessage>
BtInterestedMessage::create(const unsigned char* data, size_t dataLength)

View File

@ -50,7 +50,7 @@ BtLeecherStateChoke::BtLeecherStateChoke()
{
}
BtLeecherStateChoke::~BtLeecherStateChoke() {}
BtLeecherStateChoke::~BtLeecherStateChoke() = default;
BtLeecherStateChoke::PeerEntry::PeerEntry(const std::shared_ptr<Peer>& peer)
: peer_(peer),
@ -63,11 +63,7 @@ BtLeecherStateChoke::PeerEntry::PeerEntry(const std::shared_ptr<Peer>& peer)
}
BtLeecherStateChoke::PeerEntry::PeerEntry(const PeerEntry& c)
: peer_(c.peer_),
downloadSpeed_(c.downloadSpeed_),
regularUnchoker_(c.regularUnchoker_)
{
}
= default;
void BtLeecherStateChoke::PeerEntry::swap(PeerEntry& c)
{
@ -88,7 +84,7 @@ operator=(const PeerEntry& c)
return *this;
}
BtLeecherStateChoke::PeerEntry::~PeerEntry() {}
BtLeecherStateChoke::PeerEntry::~PeerEntry() = default;
const std::shared_ptr<Peer>& BtLeecherStateChoke::PeerEntry::getPeer() const
{

View File

@ -54,7 +54,7 @@ private:
public:
BtMessage(uint8_t id) : id_(id) {}
virtual ~BtMessage() {}
virtual ~BtMessage() = default;
virtual bool isInvalidate() = 0;

View File

@ -49,7 +49,7 @@ class BtMessage;
class BtMessageDispatcher {
public:
virtual ~BtMessageDispatcher() {}
virtual ~BtMessageDispatcher() = default;
virtual void addMessageToQueue(std::unique_ptr<BtMessage> btMessage) = 0;

View File

@ -64,7 +64,7 @@ class Piece;
class BtMessageFactory {
public:
virtual ~BtMessageFactory() {}
virtual ~BtMessageFactory() = default;
virtual std::unique_ptr<BtMessage> createBtMessage(const unsigned char* msg,
size_t msgLength) = 0;

View File

@ -46,7 +46,7 @@ class BtHandshakeMessage;
class BtMessageReceiver {
public:
virtual ~BtMessageReceiver() {}
virtual ~BtMessageReceiver() = default;
virtual std::unique_ptr<BtHandshakeMessage>
receiveHandshake(bool quickReply = false) = 0;

View File

@ -43,7 +43,7 @@ namespace aria2 {
class BtMessageValidator {
public:
virtual ~BtMessageValidator() {}
virtual ~BtMessageValidator() = default;
// Throws RecoverableException on error.
virtual void validate() = 0;

View File

@ -46,7 +46,7 @@ BtNotInterestedMessage::BtNotInterestedMessage()
{
}
BtNotInterestedMessage::~BtNotInterestedMessage() {}
BtNotInterestedMessage::~BtNotInterestedMessage() = default;
std::unique_ptr<BtNotInterestedMessage>
BtNotInterestedMessage::create(const unsigned char* data, size_t dataLength)

View File

@ -78,7 +78,7 @@ BtPieceMessage::BtPieceMessage(size_t index, int32_t begin, int32_t blockLength)
setUploading(true);
}
BtPieceMessage::~BtPieceMessage() {}
BtPieceMessage::~BtPieceMessage() = default;
void BtPieceMessage::setMsgPayload(const unsigned char* data) { data_ = data; }

View File

@ -45,7 +45,7 @@ BtPieceMessageValidator::BtPieceMessageValidator(const BtPieceMessage* message,
{
}
BtPieceMessageValidator::~BtPieceMessageValidator() {}
BtPieceMessageValidator::~BtPieceMessageValidator() = default;
void BtPieceMessageValidator::validate()
{

View File

@ -43,7 +43,7 @@ namespace aria2 {
class BtProgressInfoFile {
public:
virtual ~BtProgressInfoFile() {}
virtual ~BtProgressInfoFile() = default;
virtual std::string getFilename() = 0;

View File

@ -47,7 +47,7 @@ class BtRequestMessage;
class BtRequestFactory {
public:
virtual ~BtRequestFactory() {}
virtual ~BtRequestFactory() = default;
virtual void addTargetPiece(const std::shared_ptr<Piece>& piece) = 0;

View File

@ -47,7 +47,7 @@ BtRuntime::BtRuntime()
{
}
BtRuntime::~BtRuntime() {}
BtRuntime::~BtRuntime() = default;
void BtRuntime::setMaxPeers(int maxPeers)
{

View File

@ -49,7 +49,7 @@ BtSeederStateChoke::BtSeederStateChoke() : round_(0), lastRound_(Timer::zero())
{
}
BtSeederStateChoke::~BtSeederStateChoke() {}
BtSeederStateChoke::~BtSeederStateChoke() = default;
namespace {
constexpr auto TIME_FRAME = 20_s;
@ -66,15 +66,9 @@ BtSeederStateChoke::PeerEntry::PeerEntry(const std::shared_ptr<Peer>& peer)
}
BtSeederStateChoke::PeerEntry::PeerEntry(const PeerEntry& c)
: peer_(c.peer_),
outstandingUpload_(c.outstandingUpload_),
lastAmUnchoking_(c.lastAmUnchoking_),
recentUnchoking_(c.recentUnchoking_),
uploadSpeed_(c.uploadSpeed_)
{
}
= default;
BtSeederStateChoke::PeerEntry::~PeerEntry() {}
BtSeederStateChoke::PeerEntry::~PeerEntry() = default;
void BtSeederStateChoke::PeerEntry::swap(PeerEntry& c)
{

View File

@ -88,7 +88,7 @@
namespace aria2 {
BtSetup::BtSetup() {}
BtSetup::BtSetup() = default;
void BtSetup::setup(std::vector<std::unique_ptr<Command>>& commands,
RequestGroup* requestGroup, DownloadEngine* e,

View File

@ -44,7 +44,7 @@ ByteArrayDiskWriter::ByteArrayDiskWriter(size_t maxLength)
{
}
ByteArrayDiskWriter::~ByteArrayDiskWriter() {}
ByteArrayDiskWriter::~ByteArrayDiskWriter() = default;
void ByteArrayDiskWriter::clear() { buf_.str(A2STR::NIL); }

View File

@ -38,7 +38,7 @@ namespace aria2 {
CUIDCounter::CUIDCounter() : count_(0) {}
CUIDCounter::~CUIDCounter() {}
CUIDCounter::~CUIDCounter() = default;
cuid_t CUIDCounter::newID()
{

View File

@ -50,7 +50,7 @@ CheckIntegrityEntry::CheckIntegrityEntry(RequestGroup* requestGroup,
{
}
CheckIntegrityEntry::~CheckIntegrityEntry() {}
CheckIntegrityEntry::~CheckIntegrityEntry() = default;
void CheckIntegrityEntry::validateChunk() { validator_->validateChunk(); }

View File

@ -44,7 +44,7 @@ Checksum::Checksum(std::string hashType, std::string digest)
Checksum::Checksum() : hashType_("sha-1") {}
Checksum::~Checksum() {}
Checksum::~Checksum() = default;
bool Checksum::isEmpty() const { return digest_.empty(); }

View File

@ -51,7 +51,7 @@ ChecksumCheckIntegrityEntry::ChecksumCheckIntegrityEntry(
{
}
ChecksumCheckIntegrityEntry::~ChecksumCheckIntegrityEntry() {}
ChecksumCheckIntegrityEntry::~ChecksumCheckIntegrityEntry() = default;
bool ChecksumCheckIntegrityEntry::isValidationReady()
{

View File

@ -74,7 +74,7 @@ ChunkedDecodingStreamFilter::ChunkedDecodingStreamFilter(
{
}
ChunkedDecodingStreamFilter::~ChunkedDecodingStreamFilter() {}
ChunkedDecodingStreamFilter::~ChunkedDecodingStreamFilter() = default;
void ChunkedDecodingStreamFilter::init() {}

View File

@ -73,7 +73,7 @@ protected:
public:
Command(cuid_t cuid);
virtual ~Command() {}
virtual ~Command() = default;
virtual bool execute() = 0;

View File

@ -50,7 +50,7 @@ protected:
virtual std::string format(int64_t size) const = 0;
public:
virtual ~SizeFormatter() {}
virtual ~SizeFormatter() = default;
std::string operator()(int64_t size) const;
};
@ -73,7 +73,7 @@ public:
ConsoleStatCalc(std::chrono::seconds summaryInterval, bool colorOutput = true,
bool humanReadable = true);
virtual ~ConsoleStatCalc() {}
virtual ~ConsoleStatCalc() = default;
virtual void calculateStat(const DownloadEngine* e) CXX11_OVERRIDE;

View File

@ -47,7 +47,7 @@ ContentTypeRequestGroupCriteria::ContentTypeRequestGroupCriteria(
{
}
ContentTypeRequestGroupCriteria::~ContentTypeRequestGroupCriteria() {}
ContentTypeRequestGroupCriteria::~ContentTypeRequestGroupCriteria() = default;
bool ContentTypeRequestGroupCriteria::match(
const RequestGroup* requestGroup) const

View File

@ -314,6 +314,6 @@ Context::Context(bool standalone, int argc, char** argv, const KeyVals& options)
}
}
Context::~Context() {}
Context::~Context() = default;
} // namespace aria2

View File

@ -40,7 +40,7 @@
namespace aria2 {
struct ContextAttribute {
virtual ~ContextAttribute() {}
virtual ~ContextAttribute() = default;
};
enum ContextAttributeType {

View File

@ -48,7 +48,7 @@ DHTAnnouncePeerReplyMessage::DHTAnnouncePeerReplyMessage(
{
}
DHTAnnouncePeerReplyMessage::~DHTAnnouncePeerReplyMessage() {}
DHTAnnouncePeerReplyMessage::~DHTAnnouncePeerReplyMessage() = default;
void DHTAnnouncePeerReplyMessage::doReceivedAction() {}

View File

@ -65,7 +65,7 @@ DHTAutoSaveCommand::DHTAutoSaveCommand(cuid_t cuid, DownloadEngine* e,
{
}
DHTAutoSaveCommand::~DHTAutoSaveCommand() {}
DHTAutoSaveCommand::~DHTAutoSaveCommand() = default;
void DHTAutoSaveCommand::preProcess()
{

View File

@ -69,7 +69,7 @@ DHTBucket::DHTBucket(const std::shared_ptr<DHTNode>& localNode)
memset(min_, 0, DHT_ID_LENGTH);
}
DHTBucket::~DHTBucket() {}
DHTBucket::~DHTBucket() = default;
void DHTBucket::getRandomNodeID(unsigned char* nodeID) const
{

View File

@ -51,7 +51,7 @@ DHTBucketRefreshCommand::DHTBucketRefreshCommand(cuid_t cuid, DownloadEngine* e,
{
}
DHTBucketRefreshCommand::~DHTBucketRefreshCommand() {}
DHTBucketRefreshCommand::~DHTBucketRefreshCommand() = default;
void DHTBucketRefreshCommand::preProcess()
{

View File

@ -49,7 +49,7 @@ namespace aria2 {
DHTBucketRefreshTask::DHTBucketRefreshTask() : forceRefresh_(false) {}
DHTBucketRefreshTask::~DHTBucketRefreshTask() {}
DHTBucketRefreshTask::~DHTBucketRefreshTask() = default;
void DHTBucketRefreshTask::startup()
{

View File

@ -57,7 +57,7 @@ DHTBucketTreeNode::DHTBucketTreeNode(std::shared_ptr<DHTBucket> bucket)
memcpy(maxId_, bucket_->getMaxID(), DHT_ID_LENGTH);
}
DHTBucketTreeNode::~DHTBucketTreeNode() {}
DHTBucketTreeNode::~DHTBucketTreeNode() = default;
void DHTBucketTreeNode::resetRelation()
{

View File

@ -43,7 +43,7 @@ namespace aria2 {
class DHTConnection {
public:
virtual ~DHTConnection() {}
virtual ~DHTConnection() = default;
virtual ssize_t receiveMessage(unsigned char* data, size_t len,
std::string& host, uint16_t& port) = 0;

View File

@ -52,7 +52,7 @@ DHTConnectionImpl::DHTConnectionImpl(int family)
{
}
DHTConnectionImpl::~DHTConnectionImpl() {}
DHTConnectionImpl::~DHTConnectionImpl() = default;
bool DHTConnectionImpl::bind(uint16_t& port, const std::string& addr,
SegList<int>& sgl)

View File

@ -58,7 +58,7 @@ DHTMessage::DHTMessage(const std::shared_ptr<DHTNode>& localNode,
}
}
DHTMessage::~DHTMessage() {}
DHTMessage::~DHTMessage() = default;
void DHTMessage::generateTransactionID()
{

View File

@ -51,7 +51,7 @@ class DHTPingReplyMessage;
class DHTMessageCallback {
public:
virtual ~DHTMessageCallback() {}
virtual ~DHTMessageCallback() = default;
void onReceived(DHTResponseMessage* message) { message->accept(this); }

View File

@ -48,7 +48,7 @@ class DHTMessage;
class DHTMessageDispatcher {
public:
virtual ~DHTMessageDispatcher() {}
virtual ~DHTMessageDispatcher() = default;
virtual void
addMessageToQueue(std::unique_ptr<DHTMessage> message,

View File

@ -63,7 +63,7 @@ class Peer;
class DHTMessageFactory {
public:
virtual ~DHTMessageFactory() {}
virtual ~DHTMessageFactory() = default;
virtual std::unique_ptr<DHTQueryMessage>
createQueryMessage(const Dict* dict, const std::string& ipaddr,

View File

@ -55,7 +55,7 @@ DHTNode::DHTNode(const unsigned char* id)
memcpy(id_, id, DHT_ID_LENGTH);
}
DHTNode::~DHTNode() {}
DHTNode::~DHTNode() = default;
void DHTNode::generateID() { util::generateRandomKey(id_); }

View File

@ -50,7 +50,7 @@ DHTPeerAnnounceCommand::DHTPeerAnnounceCommand(cuid_t cuid, DownloadEngine* e,
{
}
DHTPeerAnnounceCommand::~DHTPeerAnnounceCommand() {}
DHTPeerAnnounceCommand::~DHTPeerAnnounceCommand() = default;
void DHTPeerAnnounceCommand::preProcess()
{

View File

@ -47,7 +47,7 @@ DHTPeerAnnounceEntry::DHTPeerAnnounceEntry(const unsigned char* infoHash)
memcpy(infoHash_, infoHash, DHT_ID_LENGTH);
}
DHTPeerAnnounceEntry::~DHTPeerAnnounceEntry() {}
DHTPeerAnnounceEntry::~DHTPeerAnnounceEntry() = default;
void DHTPeerAnnounceEntry::addPeerAddrEntry(const PeerAddrEntry& entry)
{

View File

@ -54,7 +54,7 @@ DHTPingTask::DHTPingTask(const std::shared_ptr<DHTNode>& remoteNode,
{
}
DHTPingTask::~DHTPingTask() {}
DHTPingTask::~DHTPingTask() = default;
void DHTPingTask::addMessage()
{

View File

@ -50,7 +50,7 @@ DHTQueryMessage::DHTQueryMessage(const std::shared_ptr<DHTNode>& localNode,
{
}
DHTQueryMessage::~DHTQueryMessage() {}
DHTQueryMessage::~DHTQueryMessage() = default;
const std::string& DHTQueryMessage::getType() const { return Q; }

View File

@ -56,7 +56,7 @@ DHTReplaceNodeTask::DHTReplaceNodeTask(const std::shared_ptr<DHTBucket>& bucket,
{
}
DHTReplaceNodeTask::~DHTReplaceNodeTask() {}
DHTReplaceNodeTask::~DHTReplaceNodeTask() = default;
void DHTReplaceNodeTask::startup() { sendMessage(); }

View File

@ -49,7 +49,7 @@ DHTResponseMessage::DHTResponseMessage(
{
}
DHTResponseMessage::~DHTResponseMessage() {}
DHTResponseMessage::~DHTResponseMessage() = default;
const std::string& DHTResponseMessage::getType() const { return R; }

View File

@ -59,7 +59,7 @@ DHTRoutingTable::DHTRoutingTable(const std::shared_ptr<DHTNode>& localNode)
{
}
DHTRoutingTable::~DHTRoutingTable() {}
DHTRoutingTable::~DHTRoutingTable() = default;
bool DHTRoutingTable::addNode(const std::shared_ptr<DHTNode>& node)
{

View File

@ -58,7 +58,7 @@ DHTRoutingTableDeserializer::DHTRoutingTableDeserializer(int family)
{
}
DHTRoutingTableDeserializer::~DHTRoutingTableDeserializer() {}
DHTRoutingTableDeserializer::~DHTRoutingTableDeserializer() = default;
#define READ_CHECK(fp, ptr, count) \
if (fp.read((ptr), (count)) != (count)) { \

View File

@ -57,7 +57,7 @@ DHTRoutingTableSerializer::DHTRoutingTableSerializer(int family)
{
}
DHTRoutingTableSerializer::~DHTRoutingTableSerializer() {}
DHTRoutingTableSerializer::~DHTRoutingTableSerializer() = default;
void DHTRoutingTableSerializer::setLocalNode(
const std::shared_ptr<DHTNode>& localNode)

View File

@ -76,9 +76,9 @@
namespace aria2 {
DHTSetup::DHTSetup() {}
DHTSetup::DHTSetup() = default;
DHTSetup::~DHTSetup() {}
DHTSetup::~DHTSetup() = default;
std::pair<std::vector<std::unique_ptr<Command>>,
std::vector<std::unique_ptr<Command>>>

View File

@ -41,7 +41,7 @@ namespace aria2 {
class DHTTask {
public:
virtual ~DHTTask() {}
virtual ~DHTTask() = default;
virtual void startup() = 0;

View File

@ -49,7 +49,7 @@ DHTTaskExecutor::DHTTaskExecutor(int numConcurrent)
{
}
DHTTaskExecutor::~DHTTaskExecutor() {}
DHTTaskExecutor::~DHTTaskExecutor() = default;
void DHTTaskExecutor::update()
{

View File

@ -49,7 +49,7 @@ class DHTBucket;
class DHTTaskFactory {
public:
virtual ~DHTTaskFactory() {}
virtual ~DHTTaskFactory() = default;
virtual std::shared_ptr<DHTTask>
createPingTask(const std::shared_ptr<DHTNode>& remoteNode,

View File

@ -59,7 +59,7 @@ DHTTaskFactoryImpl::DHTTaskFactoryImpl()
{
}
DHTTaskFactoryImpl::~DHTTaskFactoryImpl() {}
DHTTaskFactoryImpl::~DHTTaskFactoryImpl() = default;
std::shared_ptr<DHTTask>
DHTTaskFactoryImpl::createPingTask(const std::shared_ptr<DHTNode>& remoteNode,

View File

@ -45,7 +45,7 @@ class DHTTask;
class DHTTaskQueue {
public:
virtual ~DHTTaskQueue() {}
virtual ~DHTTaskQueue() = default;
virtual void executeTask() = 0;

View File

@ -50,7 +50,7 @@ DHTTaskQueueImpl::DHTTaskQueueImpl()
{
}
DHTTaskQueueImpl::~DHTTaskQueueImpl() {}
DHTTaskQueueImpl::~DHTTaskQueueImpl() = default;
void DHTTaskQueueImpl::executeTask()
{

View File

@ -58,7 +58,7 @@ DHTTokenTracker::DHTTokenTracker(const unsigned char* initialSecret)
memcpy(secret_[1], initialSecret, SECRET_SIZE);
}
DHTTokenTracker::~DHTTokenTracker() {}
DHTTokenTracker::~DHTTokenTracker() = default;
std::string DHTTokenTracker::generateToken(const unsigned char* infoHash,
const std::string& ipaddr,

View File

@ -49,7 +49,7 @@ DHTTokenUpdateCommand::DHTTokenUpdateCommand(cuid_t cuid, DownloadEngine* e,
{
}
DHTTokenUpdateCommand::~DHTTokenUpdateCommand() {}
DHTTokenUpdateCommand::~DHTTokenUpdateCommand() = default;
void DHTTokenUpdateCommand::preProcess()
{

View File

@ -43,11 +43,9 @@ DNSCache::AddrEntry::AddrEntry(const std::string& addr)
}
DNSCache::AddrEntry::AddrEntry(const AddrEntry& c)
: addr_(c.addr_), good_(c.good_)
{
}
= default;
DNSCache::AddrEntry::~AddrEntry() {}
DNSCache::AddrEntry::~AddrEntry() = default;
DNSCache::AddrEntry& DNSCache::AddrEntry::operator=(const AddrEntry& c)
{
@ -64,11 +62,9 @@ DNSCache::CacheEntry::CacheEntry(const std::string& hostname, uint16_t port)
}
DNSCache::CacheEntry::CacheEntry(const CacheEntry& c)
: hostname_(c.hostname_), port_(c.port_), addrEntries_(c.addrEntries_)
{
}
= default;
DNSCache::CacheEntry::~CacheEntry() {}
DNSCache::CacheEntry::~CacheEntry() = default;
DNSCache::CacheEntry& DNSCache::CacheEntry::operator=(const CacheEntry& c)
{
@ -154,9 +150,9 @@ bool DNSCache::CacheEntry::operator==(const CacheEntry& e) const
DNSCache::DNSCache() {}
DNSCache::DNSCache(const DNSCache& c) : entries_(c.entries_) {}
DNSCache::DNSCache(const DNSCache& c) = default;
DNSCache::~DNSCache() {}
DNSCache::~DNSCache() = default;
DNSCache& DNSCache::operator=(const DNSCache& c)
{

View File

@ -74,7 +74,7 @@ DefaultBtAnnounce::DefaultBtAnnounce(DownloadContext* downloadContext,
{
}
DefaultBtAnnounce::~DefaultBtAnnounce() {}
DefaultBtAnnounce::~DefaultBtAnnounce() = default;
bool DefaultBtAnnounce::isDefaultAnnounceReady()
{

View File

@ -109,7 +109,7 @@ DefaultBtInteractive::DefaultBtInteractive(
{
}
DefaultBtInteractive::~DefaultBtInteractive() {}
DefaultBtInteractive::~DefaultBtInteractive() = default;
void DefaultBtInteractive::initiateHandshake()
{

View File

@ -84,7 +84,7 @@ DefaultBtProgressInfoFile::DefaultBtProgressInfoFile(
{
}
DefaultBtProgressInfoFile::~DefaultBtProgressInfoFile() {}
DefaultBtProgressInfoFile::~DefaultBtProgressInfoFile() = default;
void DefaultBtProgressInfoFile::updateFilename()
{

View File

@ -60,7 +60,7 @@ DefaultBtRequestFactory::DefaultBtRequestFactory()
{
}
DefaultBtRequestFactory::~DefaultBtRequestFactory() {}
DefaultBtRequestFactory::~DefaultBtRequestFactory() = default;
void DefaultBtRequestFactory::addTargetPiece(
const std::shared_ptr<Piece>& piece)

View File

@ -41,7 +41,7 @@ DefaultDiskWriter::DefaultDiskWriter(const std::string& filename)
{
}
DefaultDiskWriter::~DefaultDiskWriter() {}
DefaultDiskWriter::~DefaultDiskWriter() = default;
void DefaultDiskWriter::initAndOpenFile(int64_t totalLength) { createFile(); }

View File

@ -114,7 +114,7 @@ DefaultPieceStorage::DefaultPieceStorage(
}
}
DefaultPieceStorage::~DefaultPieceStorage() {}
DefaultPieceStorage::~DefaultPieceStorage() = default;
std::shared_ptr<Piece> DefaultPieceStorage::checkOutPiece(size_t index,
cuid_t cuid)

View File

@ -42,7 +42,7 @@ DefaultStreamPieceSelector::DefaultStreamPieceSelector(BitfieldMan* bitfieldMan)
{
}
DefaultStreamPieceSelector::~DefaultStreamPieceSelector() {}
DefaultStreamPieceSelector::~DefaultStreamPieceSelector() = default;
bool DefaultStreamPieceSelector::select(size_t& index, size_t minSplitSize,
const unsigned char* ignoreBitfield,

View File

@ -41,7 +41,7 @@ namespace aria2 {
class Dependency {
public:
virtual ~Dependency() {}
virtual ~Dependency() = default;
virtual bool resolve() = 0; // throw()
};

View File

@ -40,6 +40,6 @@ namespace aria2 {
DiskAdaptor::DiskAdaptor() : fileAllocationMethod_(FILE_ALLOC_ADAPTIVE) {}
DiskAdaptor::~DiskAdaptor() {}
DiskAdaptor::~DiskAdaptor() = default;
} // namespace aria2

View File

@ -47,7 +47,7 @@ class DiskWriter : public BinaryStream {
public:
DiskWriter() {}
virtual ~DiskWriter() {}
virtual ~DiskWriter() = default;
/**
* Opens file. If the file exists, then it is truncated to 0 length.
*/

View File

@ -46,7 +46,7 @@ class DiskWriter;
class DiskWriterFactory {
public:
virtual ~DiskWriterFactory() {}
virtual ~DiskWriterFactory() = default;
virtual std::unique_ptr<DiskWriter>
newDiskWriter(const std::string& filename) = 0;

View File

@ -72,7 +72,7 @@ DownloadContext::DownloadContext(int32_t pieceLength, int64_t totalLength,
std::make_shared<FileEntry>(std::move(path), totalLength, 0));
}
DownloadContext::~DownloadContext() {}
DownloadContext::~DownloadContext() = default;
void DownloadContext::resetDownloadStartTime()
{

View File

@ -150,7 +150,7 @@ void executeCommand(std::deque<std::unique_ptr<Command>>& commands,
namespace {
class GlobalHaltRequestedFinalizer {
public:
GlobalHaltRequestedFinalizer() {}
GlobalHaltRequestedFinalizer() = default;
~GlobalHaltRequestedFinalizer() { global::globalHaltRequested = 5; }
};
} // namespace
@ -519,7 +519,7 @@ DownloadEngine::SocketPoolEntry::SocketPoolEntry(
{
}
DownloadEngine::SocketPoolEntry::~SocketPoolEntry() {}
DownloadEngine::SocketPoolEntry::~SocketPoolEntry() = default;
bool DownloadEngine::SocketPoolEntry::isTimeout() const
{

Some files were not shown because too many files have changed in this diff Show More