Skip to content

Commit

Permalink
build: disable -Wnon-virtual-dtor compiler warning
Browse files Browse the repository at this point in the history
See also named-data/NFD@0a05f7a

Change-Id: Id615459e8b9db20ae54851b3b4808b4c5e94d3b0
  • Loading branch information
Pesa committed Oct 28, 2023
1 parent 43fafd5 commit 7df36bd
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 28 deletions.
1 change: 0 additions & 1 deletion .waf-tools/default-compiler-flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ def getGeneralFlags(self, conf):
'-Wpedantic',
'-Wenum-conversion',
'-Wextra-semi',
'-Wnon-virtual-dtor',
'-Wno-unused-parameter',
]
__linkFlags = ['-Wl,-O1']
Expand Down
15 changes: 7 additions & 8 deletions src/handles/command-base-handle.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, Regents of the University of California.
* Copyright (c) 2014-2023, Regents of the University of California.
*
* This file is part of NDN repo-ng (Next generation of NDN repository).
* See AUTHORS.md for complete list of repo-ng authors and contributors.
Expand Down Expand Up @@ -41,13 +41,6 @@ class CommandBaseHandle
using std::runtime_error::runtime_error;
};

public:
CommandBaseHandle(Face& face, RepoStorage& storageHandle,
Scheduler& scheduler, ndn::security::Validator& validator);

virtual
~CommandBaseHandle() = default;

ndn::mgmt::Authorization
makeAuthorization();

Expand All @@ -68,6 +61,12 @@ class CommandBaseHandle
return true;
}

protected:
CommandBaseHandle(Face& face, RepoStorage& storageHandle,
Scheduler& scheduler, ndn::security::Validator& validator);

~CommandBaseHandle() = default;

protected:
Face& face;
RepoStorage& storageHandle;
Expand Down
2 changes: 1 addition & 1 deletion src/handles/read-handle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ namespace repo {

class ReadHandle : public noncopyable
{

public:
using DataPrefixRegistrationCallback = std::function<void(const ndn::Name&)>;
using DataPrefixUnregistrationCallback = std::function<void(const ndn::Name&)>;

struct RegisteredDataPrefix
{
ndn::RegisteredPrefixHandle hdl;
Expand Down
26 changes: 14 additions & 12 deletions src/repo-command.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, Regents of the University of California.
* Copyright (c) 2014-2023, Regents of the University of California.
*
* This file is part of NDN repo-ng (Next generation of NDN repository).
* See AUTHORS.md for complete list of repo-ng authors and contributors.
Expand Down Expand Up @@ -29,23 +29,21 @@ class RepoCommand : boost::noncopyable
{
public:
/**
* \brief Represents an error in RepoCommandParameters
* \brief Represents an error in RepoCommandParameter.
*/
class ArgumentError : public std::invalid_argument
{
public:
using std::invalid_argument::invalid_argument;
};

virtual
~RepoCommand() = default;

class FieldValidator
{
public:
FieldValidator();

/** \brief declare a required field
/**
* \brief Declare a required field.
*/
FieldValidator&
required(RepoParameterField field)
Expand All @@ -54,7 +52,8 @@ class RepoCommand : boost::noncopyable
return *this;
}

/** \brief declare an optional field
/**
* \brief Declare an optional field.
*/
FieldValidator&
optional(RepoParameterField field)
Expand All @@ -78,36 +77,39 @@ class RepoCommand : boost::noncopyable
void
validateRequest(const RepoCommandParameter& parameters);

protected:
~RepoCommand() = default;

private:
virtual void
check(const RepoCommandParameter& parameters) const
{
}

public:
protected:
FieldValidator m_requestValidator;
};

class InsertCommand : public RepoCommand
class InsertCommand final : public RepoCommand
{
public:
InsertCommand();
};

class InsertCheckCommand : public RepoCommand
class InsertCheckCommand final : public RepoCommand
{
public:
InsertCheckCommand();
};

class DeleteCommand : public RepoCommand
class DeleteCommand final : public RepoCommand
{
public:
DeleteCommand();

private:
void
check(const RepoCommandParameter& parameters) const override;
check(const RepoCommandParameter& parameters) const final;
};

} // namespace repo
Expand Down
8 changes: 2 additions & 6 deletions tests/unit/tcp-bulk-insert-handle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ BOOST_AUTO_TEST_SUITE(TcpBulkInsertHandle)
class TcpClient
{
public:
virtual
~TcpClient() = default;

void
start(const std::string& host, const std::string& port)
{
Expand All @@ -59,7 +56,6 @@ class TcpClient
{
if (error) {
BOOST_FAIL("TCP connection aborted");
return;
}
}

Expand All @@ -81,8 +77,8 @@ class TcpBulkInsertFixture : public TcpClient,
guardEvent = scheduler.schedule(2_s, std::bind(&TcpBulkInsertFixture::fail, this, "Test timed out"));
}

virtual void
onSuccessfullConnect(const boost::system::error_code& error)
void
onSuccessfullConnect(const boost::system::error_code& error) override
{
TcpClient::onSuccessfullConnect(error);

Expand Down

0 comments on commit 7df36bd

Please sign in to comment.