Fix build with latest ndn-cxx
Change-Id: I850fc92a0bb50632ba5b5bacab6cedb321754db1
diff --git a/src/handles/command-base-handle.cpp b/src/handles/command-base-handle.cpp
index ba126c0..ba3d5f5 100644
--- a/src/handles/command-base-handle.cpp
+++ b/src/handles/command-base-handle.cpp
@@ -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-2025, 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.
@@ -54,7 +54,7 @@
CommandBaseHandle::makeAuthorization()
{
return [=] (const ndn::Name&, const auto& interest,
- const ndn::mgmt::ControlParameters*,
+ const ndn::mgmt::ControlParametersBase*,
const ndn::mgmt::AcceptContinuation& accept,
const ndn::mgmt::RejectContinuation& reject) {
m_validator.validate(interest,
diff --git a/src/handles/command-base-handle.hpp b/src/handles/command-base-handle.hpp
index 584c6b6..995ea48 100644
--- a/src/handles/command-base-handle.hpp
+++ b/src/handles/command-base-handle.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2023, Regents of the University of California.
+ * Copyright (c) 2014-2025, 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.
@@ -21,11 +21,10 @@
#define REPO_HANDLES_COMMAND_BASE_HANDLE_HPP
#include "common.hpp"
-
-#include "storage/repo-storage.hpp"
-#include "repo-command-response.hpp"
-#include "repo-command-parameter.hpp"
#include "repo-command.hpp"
+#include "repo-command-parameter.hpp"
+#include "repo-command-response.hpp"
+#include "storage/repo-storage.hpp"
#include <ndn-cxx/mgmt/dispatcher.hpp>
#include <ndn-cxx/security/validator.hpp>
@@ -46,14 +45,13 @@
template<typename T>
bool
- validateParameters(const ndn::mgmt::ControlParameters& parameters)
+ validateParameters(const ndn::mgmt::ControlParametersBase& parameters) const
{
- const auto* castParams = dynamic_cast<const RepoCommandParameter*>(¶meters);
- BOOST_ASSERT(castParams != nullptr);
+ const auto& castParams = dynamic_cast<const RepoCommandParameter&>(parameters);
T command;
try {
- command.validateRequest(*castParams);
+ command.validateRequest(castParams);
}
catch (const RepoCommand::ArgumentError&) {
return false;
diff --git a/src/handles/delete-handle.cpp b/src/handles/delete-handle.cpp
index d9efe76..18779cf 100644
--- a/src/handles/delete-handle.cpp
+++ b/src/handles/delete-handle.cpp
@@ -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-2025, 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.
@@ -38,11 +38,11 @@
}
void
-DeleteHandle::handleDeleteCommand(const Name& prefix, const Interest& interest,
- const ndn::mgmt::ControlParameters& parameter,
+DeleteHandle::handleDeleteCommand(const Name&, const Interest& interest,
+ const ndn::mgmt::ControlParametersBase& parameter,
const ndn::mgmt::CommandContinuation& done)
{
- const RepoCommandParameter& repoParameter = dynamic_cast<const RepoCommandParameter&>(parameter);
+ const auto& repoParameter = dynamic_cast<const RepoCommandParameter&>(parameter);
if (!repoParameter.hasStartBlockId() && !repoParameter.hasEndBlockId()) {
processSingleDeleteCommand(interest, repoParameter, done);
@@ -53,7 +53,7 @@
}
RepoCommandResponse
-DeleteHandle::positiveReply(const Interest& interest, const RepoCommandParameter& parameter,
+DeleteHandle::positiveReply(const Interest&, const RepoCommandParameter& parameter,
uint64_t statusCode, uint64_t nDeletedData) const
{
RepoCommandResponse response(statusCode, "Deletion Successful");
@@ -72,7 +72,7 @@
}
RepoCommandResponse
-DeleteHandle::negativeReply(const Interest& interest, uint64_t statusCode,
+DeleteHandle::negativeReply(const Interest&, uint64_t statusCode,
const std::string& text) const
{
RepoCommandResponse response(statusCode, text);
@@ -110,7 +110,7 @@
}
}
- //All the data deleted, return 200
+ // All the data deleted, return 200
done(positiveReply(interest, parameter, 200, nDeletedData));
}
diff --git a/src/handles/delete-handle.hpp b/src/handles/delete-handle.hpp
index 6bce2c1..8d30c55 100644
--- a/src/handles/delete-handle.hpp
+++ b/src/handles/delete-handle.hpp
@@ -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-2025, 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.
@@ -40,7 +40,7 @@
private:
void
handleDeleteCommand(const Name& prefix, const Interest& interest,
- const ndn::mgmt::ControlParameters& parameters,
+ const ndn::mgmt::ControlParametersBase& parameters,
const ndn::mgmt::CommandContinuation& done);
RepoCommandResponse
diff --git a/src/handles/read-handle.hpp b/src/handles/read-handle.hpp
index 4e53f97..b20a84f 100644
--- a/src/handles/read-handle.hpp
+++ b/src/handles/read-handle.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2023, Regents of the University of California.
+ * Copyright (c) 2014-2025, 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.
@@ -21,11 +21,7 @@
#define REPO_HANDLES_READ_HANDLE_HPP
#include "common.hpp"
-
#include "storage/repo-storage.hpp"
-#include "repo-command-response.hpp"
-#include "repo-command-parameter.hpp"
-#include "repo-command.hpp"
namespace repo {
@@ -59,9 +55,6 @@
void
onDataDeleted(const Name& name);
- /**
- * @param after Do something after successfully registering the data prefix
- */
void
onDataInserted(const Name& name);
diff --git a/src/handles/write-handle.cpp b/src/handles/write-handle.cpp
index b9c51f0..f9fdc7d 100644
--- a/src/handles/write-handle.cpp
+++ b/src/handles/write-handle.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2023, Regents of the University of California.
+ * Copyright (c) 2014-2025, 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.
@@ -53,11 +53,11 @@
}
void
-WriteHandle::handleInsertCommand(const Name& prefix, const Interest& interest,
- const ndn::mgmt::ControlParameters& params,
+WriteHandle::handleInsertCommand(const Name&, const Interest& interest,
+ const ndn::mgmt::ControlParametersBase& params,
const ndn::mgmt::CommandContinuation& done)
{
- auto& repoParam = dynamic_cast<RepoCommandParameter&>(const_cast<ndn::mgmt::ControlParameters&>(params));
+ const auto& repoParam = dynamic_cast<const RepoCommandParameter&>(params);
if (repoParam.hasStartBlockId() || repoParam.hasEndBlockId()) {
processSegmentedInsertCommand(interest, repoParam, done);
@@ -79,7 +79,7 @@
}
void
-WriteHandle::onDataValidated(const Interest& interest, const Data& data, ProcessId processId)
+WriteHandle::onDataValidated(const Interest&, const Data& data, ProcessId processId)
{
if (m_processes.count(processId) == 0) {
return;
@@ -97,14 +97,14 @@
}
void
-WriteHandle::onTimeout(const Interest& interest, ProcessId processId)
+WriteHandle::onTimeout(const Interest&, ProcessId processId)
{
NDN_LOG_DEBUG("Timeout" << std::endl);
m_processes.erase(processId);
}
void
-WriteHandle::processSingleInsertCommand(const Interest& interest, RepoCommandParameter& parameter,
+WriteHandle::processSingleInsertCommand(const Interest&, const RepoCommandParameter& parameter,
const ndn::mgmt::CommandContinuation& done)
{
ProcessId processId = ndn::random::generateWord64();
@@ -220,7 +220,7 @@
}
void
-WriteHandle::processSegmentedInsertCommand(const Interest& interest, RepoCommandParameter& parameter,
+WriteHandle::processSegmentedInsertCommand(const Interest&, const RepoCommandParameter& parameter,
const ndn::mgmt::CommandContinuation& done)
{
if (parameter.hasEndBlockId()) {
@@ -268,8 +268,8 @@
}
void
-WriteHandle::handleCheckCommand(const Name& prefix, const Interest& interest,
- const ndn::mgmt::ControlParameters& params,
+WriteHandle::handleCheckCommand(const Name&, const Interest&,
+ const ndn::mgmt::ControlParametersBase& params,
const ndn::mgmt::CommandContinuation& done)
{
const auto& repoParameter = dynamic_cast<const RepoCommandParameter&>(params);
diff --git a/src/handles/write-handle.hpp b/src/handles/write-handle.hpp
index 50cd335..2f72207 100644
--- a/src/handles/write-handle.hpp
+++ b/src/handles/write-handle.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2023, Regents of the University of California.
+ * Copyright (c) 2014-2025, 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.
@@ -93,7 +93,7 @@
*/
void
handleInsertCommand(const Name& prefix, const Interest& interest,
- const ndn::mgmt::ControlParameters& parameters,
+ const ndn::mgmt::ControlParametersBase& parameters,
const ndn::mgmt::CommandContinuation& done);
void
@@ -116,7 +116,7 @@
onTimeout(const Interest& interest, ProcessId processId);
void
- processSingleInsertCommand(const Interest& interest, RepoCommandParameter& parameter,
+ processSingleInsertCommand(const Interest& interest, const RepoCommandParameter& parameter,
const ndn::mgmt::CommandContinuation& done);
private: // segmented data fetching
@@ -139,7 +139,7 @@
segInit(ProcessId processId, const RepoCommandParameter& parameter);
void
- processSegmentedInsertCommand(const Interest& interest, RepoCommandParameter& parameter,
+ processSegmentedInsertCommand(const Interest& interest, const RepoCommandParameter& parameter,
const ndn::mgmt::CommandContinuation& done);
private:
@@ -159,7 +159,7 @@
void
handleCheckCommand(const Name& prefix, const Interest& interest,
- const ndn::mgmt::ControlParameters& parameters,
+ const ndn::mgmt::ControlParametersBase& parameters,
const ndn::mgmt::CommandContinuation& done);
void