Replace all uses of BOOST_THROW_EXCEPTION with NDN_THROW
Refs: #4834
Change-Id: I6c536cd321fba62d397bf8520f51d2dbba73d908
diff --git a/src/daemon/config-file.cpp b/src/daemon/config-file.cpp
index a03937f..636a69e 100644
--- a/src/daemon/config-file.cpp
+++ b/src/daemon/config-file.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2020, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -43,8 +43,8 @@
const ConfigSection& section,
bool isDryRun)
{
- BOOST_THROW_EXCEPTION(Error("Error processing configuration file " + filename +
- ": no module subscribed for section \"" + sectionName + "\""));
+ NDN_THROW(Error("Error processing configuration file " + filename +
+ ": no module subscribed for section \"" + sectionName + "\""));
}
void
@@ -69,8 +69,8 @@
return false;
}
- BOOST_THROW_EXCEPTION(Error("Invalid value \"" + value + "\" for option \"" +
- key + "\" in \"" + sectionName + "\" section"));
+ NDN_THROW(Error("Invalid value \"" + value + "\" for option \"" +
+ key + "\" in \"" + sectionName + "\" section"));
}
void
@@ -85,7 +85,7 @@
{
std::ifstream inputFile(filename);
if (!inputFile.good() || !inputFile.is_open()) {
- BOOST_THROW_EXCEPTION(Error("Failed to read configuration file " + filename));
+ NDN_THROW(Error("Failed to read configuration file " + filename));
}
parse(inputFile, isDryRun, filename);
inputFile.close();
@@ -105,8 +105,8 @@
boost::property_tree::read_info(input, m_global);
}
catch (const boost::property_tree::info_parser_error& error) {
- BOOST_THROW_EXCEPTION(Error("Failed to parse configuration file " + filename +
- ": " + error.message() + " on line " + to_string(error.line())));
+ NDN_THROW_NESTED(Error("Failed to parse configuration file " + filename +
+ ": " + error.message() + " on line " + to_string(error.line())));
}
process(isDryRun, filename);
diff --git a/src/daemon/config-file.hpp b/src/daemon/config-file.hpp
index a177bfa..b17dfe6 100644
--- a/src/daemon/config-file.hpp
+++ b/src/daemon/config-file.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2020, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,6 +28,8 @@
#include "common.hpp"
+#include <boost/property_tree/ptree.hpp>
+
namespace ndn {
namespace ndns {
@@ -54,17 +56,13 @@
/** \brief configuration file parsing utility
*/
-class ConfigFile : noncopyable
+class ConfigFile : boost::noncopyable
{
public:
class Error : public std::runtime_error
{
public:
- explicit
- Error(const std::string& what)
- : std::runtime_error(what)
- {
- }
+ using std::runtime_error::runtime_error;
};
explicit
@@ -115,8 +113,8 @@
if (value) {
return *value;
}
- BOOST_THROW_EXCEPTION(Error("Invalid value \"" + node.get_value<std::string>() +
- "\" for option \"" + key + "\" in \"" + sectionName + "\" section"));
+ NDN_THROW(Error("Invalid value \"" + node.get_value<std::string>() +
+ "\" for option \"" + key + "\" in \"" + sectionName + "\" section"));
}
template <typename T>
diff --git a/src/daemon/db-mgr.cpp b/src/daemon/db-mgr.cpp
index da40d58..49dcfa9 100644
--- a/src/daemon/db-mgr.cpp
+++ b/src/daemon/db-mgr.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California.
+ * Copyright (c) 2014-2020, Regents of the University of California.
*
* This file is part of NDNS (Named Data Networking Domain Name Service).
* See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -85,7 +85,7 @@
if (res != SQLITE_OK) {
NDNS_LOG_FATAL("Cannot open the db file: " << m_dbFile);
- BOOST_THROW_EXCEPTION(ConnectError("Cannot open the db file: " + m_dbFile));
+ NDN_THROW(ConnectError("Cannot open the db file: " + m_dbFile));
}
// ignore any errors from DB creation (command will fail for the existing database, which is ok)
@@ -116,7 +116,7 @@
// sqlite3_step cannot execute multiple SQL statements
int rc = sqlite3_exec(m_conn, sql, nullptr, nullptr, nullptr);
if (rc != SQLITE_OK) {
- BOOST_THROW_EXCEPTION(ExecuteError(sql));
+ NDN_THROW(ExecuteError(sql));
}
NDNS_LOG_INFO("clear all the data in the database: " << m_dbFile);
@@ -142,7 +142,7 @@
name::Component component;
std::tie(hasDecodingSucceeded, component) = Block::fromBuffer(buffer, nBytesLeft);
if (!hasDecodingSucceeded) {
- BOOST_THROW_EXCEPTION(Error("Error while decoding name from the database"));
+ NDN_THROW(Error("Error while decoding name from the database"));
}
name.append(component);
buffer += component.size();
@@ -166,7 +166,7 @@
const char* sql = "INSERT INTO zones (name, ttl) VALUES (?, ?)";
int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, nullptr);
if (rc != SQLITE_OK) {
- BOOST_THROW_EXCEPTION(PrepareError(sql));
+ NDN_THROW(PrepareError(sql));
}
saveName(zone.getName(), stmt, 1);
@@ -175,7 +175,7 @@
rc = sqlite3_step(stmt);
if (rc != SQLITE_DONE) {
sqlite3_finalize(stmt);
- BOOST_THROW_EXCEPTION(ExecuteError(sql));
+ NDN_THROW(ExecuteError(sql));
}
zone.setId(sqlite3_last_insert_rowid(m_conn));
@@ -188,18 +188,18 @@
const Block& value)
{
if (zone.getId() == 0) {
- BOOST_THROW_EXCEPTION(Error("zone has not been initialized"));
+ NDN_THROW(Error("zone has not been initialized"));
}
if (key.length() > 10) {
- BOOST_THROW_EXCEPTION(Error("key length should not exceed 10"));
+ NDN_THROW(Error("key length should not exceed 10"));
}
sqlite3_stmt* stmt;
const char* sql = "INSERT OR REPLACE INTO zone_info (zone_id, key, value) VALUES (?, ?, ?)";
int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, nullptr);
if (rc != SQLITE_OK) {
- BOOST_THROW_EXCEPTION(PrepareError(sql));
+ NDN_THROW(PrepareError(sql));
}
sqlite3_bind_int(stmt, 1, zone.getId());
@@ -209,7 +209,7 @@
rc = sqlite3_step(stmt);
if (rc != SQLITE_DONE) {
sqlite3_finalize(stmt);
- BOOST_THROW_EXCEPTION(ExecuteError(sql));
+ NDN_THROW(ExecuteError(sql));
}
sqlite3_finalize(stmt);
@@ -226,14 +226,14 @@
}
if (zone.getId() == 0) {
- BOOST_THROW_EXCEPTION(Error("zone has not been initialized"));
+ NDN_THROW(Error("zone has not been initialized"));
}
sqlite3_stmt* stmt;
const char* sql = "SELECT key, value FROM zone_info WHERE zone_id=?";
int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, nullptr);
if (rc != SQLITE_OK) {
- BOOST_THROW_EXCEPTION(PrepareError(sql));
+ NDN_THROW(PrepareError(sql));
}
sqlite3_bind_int(stmt, 1, zone.getId());
@@ -255,7 +255,7 @@
const char* sql = "SELECT id, ttl FROM zones WHERE name=?";
int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, nullptr);
if (rc != SQLITE_OK) {
- BOOST_THROW_EXCEPTION(PrepareError(sql));
+ NDN_THROW(PrepareError(sql));
}
saveName(zone.getName(), stmt, 1);
@@ -280,7 +280,7 @@
const char* sql = "SELECT id, name, ttl FROM zones";
int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, nullptr);
if (rc != SQLITE_OK) {
- BOOST_THROW_EXCEPTION(PrepareError(sql));
+ NDN_THROW(PrepareError(sql));
}
std::vector<Zone> vec;
@@ -307,7 +307,7 @@
const char* sql = "DELETE FROM zones where id=?";
int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, nullptr);
if (rc != SQLITE_OK) {
- BOOST_THROW_EXCEPTION(PrepareError(sql));
+ NDN_THROW(PrepareError(sql));
}
sqlite3_bind_int64(stmt, 1, zone.getId());
@@ -315,7 +315,7 @@
rc = sqlite3_step(stmt);
if (rc != SQLITE_DONE) {
sqlite3_finalize(stmt);
- BOOST_THROW_EXCEPTION(ExecuteError(sql));
+ NDN_THROW(ExecuteError(sql));
}
sqlite3_finalize(stmt);
@@ -334,7 +334,7 @@
return;
if (rrset.getZone() == nullptr) {
- BOOST_THROW_EXCEPTION(RrsetError("Rrset has not been assigned to a zone"));
+ NDN_THROW(RrsetError("Rrset has not been assigned to a zone"));
}
if (rrset.getZone()->getId() == 0) {
@@ -348,7 +348,7 @@
sqlite3_stmt* stmt;
int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, nullptr);
if (rc != SQLITE_OK) {
- BOOST_THROW_EXCEPTION(PrepareError(sql));
+ NDN_THROW(PrepareError(sql));
}
sqlite3_bind_int64(stmt, 1, rrset.getZone()->getId());
@@ -362,7 +362,7 @@
rc = sqlite3_step(stmt);
if (rc != SQLITE_DONE) {
sqlite3_finalize(stmt);
- BOOST_THROW_EXCEPTION(ExecuteError(sql));
+ NDN_THROW(ExecuteError(sql));
}
rrset.setId(sqlite3_last_insert_rowid(m_conn));
@@ -373,7 +373,7 @@
DbMgr::find(Rrset& rrset)
{
if (rrset.getZone() == nullptr) {
- BOOST_THROW_EXCEPTION(RrsetError("Rrset has not been assigned to a zone"));
+ NDN_THROW(RrsetError("Rrset has not been assigned to a zone"));
}
if (rrset.getZone()->getId() == 0) {
@@ -389,7 +389,7 @@
" WHERE zone_id=? and label=? and type=?";
int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, nullptr);
if (rc != SQLITE_OK) {
- BOOST_THROW_EXCEPTION(PrepareError(sql));
+ NDN_THROW(PrepareError(sql));
}
sqlite3_bind_int64(stmt, 1, rrset.getZone()->getId());
@@ -417,7 +417,7 @@
DbMgr::findLowerBound(Rrset& rrset)
{
if (rrset.getZone() == nullptr) {
- BOOST_THROW_EXCEPTION(RrsetError("Rrset has not been assigned to a zone"));
+ NDN_THROW(RrsetError("Rrset has not been assigned to a zone"));
}
if (rrset.getZone()->getId() == 0) {
@@ -433,7 +433,7 @@
" WHERE zone_id=? and label<? and type=? ORDER BY label DESC";
int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, nullptr);
if (rc != SQLITE_OK) {
- BOOST_THROW_EXCEPTION(PrepareError(sql));
+ NDN_THROW(PrepareError(sql));
}
sqlite3_bind_int64(stmt, 1, rrset.getZone()->getId());
@@ -464,7 +464,7 @@
find(zone);
if (zone.getId() == 0)
- BOOST_THROW_EXCEPTION(RrsetError("Attempting to find all the rrsets with a zone does not in the database"));
+ NDN_THROW(RrsetError("Attempting to find all the rrsets with a zone does not in the database"));
std::vector<Rrset> vec;
sqlite3_stmt* stmt;
@@ -473,7 +473,7 @@
int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, nullptr);
if (rc != SQLITE_OK) {
- BOOST_THROW_EXCEPTION(PrepareError(sql));
+ NDN_THROW(PrepareError(sql));
}
sqlite3_bind_int64(stmt, 1, zone.getId());
@@ -503,13 +503,13 @@
find(zone);
if (zone.getId() == 0)
- BOOST_THROW_EXCEPTION(RrsetError("Attempting to find all the rrsets with a zone does not in the database"));
+ NDN_THROW(RrsetError("Attempting to find all the rrsets with a zone does not in the database"));
sqlite3_stmt* stmt;
const char* sql = "DELETE FROM rrsets WHERE zone_id = ? AND type = ?";
int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, nullptr);
if (rc != SQLITE_OK) {
- BOOST_THROW_EXCEPTION(PrepareError(sql));
+ NDN_THROW(PrepareError(sql));
}
sqlite3_bind_int64(stmt, 1, zone.getId());
@@ -518,7 +518,7 @@
rc = sqlite3_step(stmt);
if (rc != SQLITE_DONE) {
sqlite3_finalize(stmt);
- BOOST_THROW_EXCEPTION(ExecuteError(sql));
+ NDN_THROW(ExecuteError(sql));
}
sqlite3_finalize(stmt);
}
@@ -527,13 +527,13 @@
DbMgr::remove(Rrset& rrset)
{
if (rrset.getId() == 0)
- BOOST_THROW_EXCEPTION(RrsetError("Attempting to remove Rrset that has no assigned id"));
+ NDN_THROW(RrsetError("Attempting to remove Rrset that has no assigned id"));
sqlite3_stmt* stmt;
const char* sql = "DELETE FROM rrsets WHERE id=?";
int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, nullptr);
if (rc != SQLITE_OK) {
- BOOST_THROW_EXCEPTION(PrepareError(sql));
+ NDN_THROW(PrepareError(sql));
}
sqlite3_bind_int64(stmt, 1, rrset.getId());
@@ -541,7 +541,7 @@
rc = sqlite3_step(stmt);
if (rc != SQLITE_DONE) {
sqlite3_finalize(stmt);
- BOOST_THROW_EXCEPTION(ExecuteError(sql));
+ NDN_THROW(ExecuteError(sql));
}
sqlite3_finalize(stmt);
@@ -553,18 +553,18 @@
DbMgr::update(Rrset& rrset)
{
if (rrset.getId() == 0) {
- BOOST_THROW_EXCEPTION(RrsetError("Attempting to replace Rrset that has no assigned id"));
+ NDN_THROW(RrsetError("Attempting to replace Rrset that has no assigned id"));
}
if (rrset.getZone() == nullptr) {
- BOOST_THROW_EXCEPTION(RrsetError("Rrset has not been assigned to a zone"));
+ NDN_THROW(RrsetError("Rrset has not been assigned to a zone"));
}
sqlite3_stmt* stmt;
const char* sql = "UPDATE rrsets SET ttl=?, version=?, data=? WHERE id=?";
int rc = sqlite3_prepare_v2(m_conn, sql, -1, &stmt, nullptr);
if (rc != SQLITE_OK) {
- BOOST_THROW_EXCEPTION(PrepareError(sql));
+ NDN_THROW(PrepareError(sql));
}
sqlite3_bind_int64(stmt, 1, rrset.getTtl().count());
diff --git a/src/daemon/db-mgr.hpp b/src/daemon/db-mgr.hpp
index a41380a..81ae5ad 100644
--- a/src/daemon/db-mgr.hpp
+++ b/src/daemon/db-mgr.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California.
+ * Copyright (c) 2014-2020, Regents of the University of California.
*
* This file is part of NDNS (Named Data Networking Domain Name Service).
* See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -20,7 +20,7 @@
#ifndef NDNS_DAEMON_DB_MGR_HPP
#define NDNS_DAEMON_DB_MGR_HPP
-#include "config.hpp"
+#include "common.hpp"
#include "rrset.hpp"
#include "zone.hpp"
@@ -46,7 +46,7 @@
*
* @note Method names follow MongoDB convention: insert/remove/find/update
*/
-class DbMgr : noncopyable
+class DbMgr : boost::noncopyable
{
public:
/**
diff --git a/src/daemon/name-server.cpp b/src/daemon/name-server.cpp
index c1d3bfa..4e40b17 100644
--- a/src/daemon/name-server.cpp
+++ b/src/daemon/name-server.cpp
@@ -44,7 +44,7 @@
if (m_zone.getId() == 0) {
NDNS_LOG_FATAL("m_zone does not exist: " << zoneName);
- BOOST_THROW_EXCEPTION(Error("Zone " + zoneName.toUri() + " does not exist in the database"));
+ NDN_THROW(Error("Zone " + zoneName.toUri() + " does not exist in the database"));
}
m_ndnsPrefix.append(ndns::label::NDNS_ITERATIVE_QUERY);
@@ -101,7 +101,7 @@
doe.setType(label::DOE_RR_TYPE);
if (!m_dbMgr.findLowerBound(doe)) {
NDNS_LOG_FATAL("fail to find DoE record of zone:" + m_zone.getName().toUri());
- BOOST_THROW_EXCEPTION(std::runtime_error("fail to find DoE record of zone:" + m_zone.getName().toUri()));
+ NDN_THROW(std::runtime_error("fail to find DoE record of zone:" + m_zone.getName().toUri()));
}
answer->setContent(doe.getData());
@@ -133,9 +133,9 @@
}
m_validator.validate(*data,
bind(&NameServer::doUpdate, this, interest.shared_from_this(), data),
- [] (const Data& data, const security::ValidationError& msg) {
+ [] (const Data&, const security::ValidationError&) {
NDNS_LOG_WARN("Ignoring update that did not pass the verification. "
- << "Check the root certificate");
+ "Check the root certificate");
});
}
}
@@ -144,8 +144,8 @@
NameServer::onRegisterFailed(const ndn::Name& prefix, const std::string& reason)
{
NDNS_LOG_FATAL("fail to register prefix=" << prefix << ". Due to: " << reason);
- BOOST_THROW_EXCEPTION(Error("zone " + m_zone.getName().toUri() + " register prefix: " +
- prefix.toUri() + " fails. due to: " + reason));
+ NDN_THROW(Error("zone " + m_zone.getName().toUri() + " register prefix: " +
+ prefix.toUri() + " fails. due to: " + reason));
}
void
diff --git a/src/daemon/name-server.hpp b/src/daemon/name-server.hpp
index fd820e5..8a84f42 100644
--- a/src/daemon/name-server.hpp
+++ b/src/daemon/name-server.hpp
@@ -26,14 +26,12 @@
#include "ndns-label.hpp"
#include "ndns-tlv.hpp"
#include "validator/validator.hpp"
-#include "common.hpp"
#include <ndn-cxx/security/key-chain.hpp>
#include <ndn-cxx/face.hpp>
#include <boost/asio.hpp>
#include <boost/bind.hpp>
-#include <boost/noncopyable.hpp>
#include <sstream>
#include <stdexcept>
@@ -46,7 +44,7 @@
*
* The authoritative name server handles NDNS query and update.
*/
-class NameServer : noncopyable
+class NameServer : boost::noncopyable
{
DEFINE_ERROR(Error, std::runtime_error);
diff --git a/src/daemon/rrset-factory.cpp b/src/daemon/rrset-factory.cpp
index 029e3b0..d0938a1 100644
--- a/src/daemon/rrset-factory.cpp
+++ b/src/daemon/rrset-factory.cpp
@@ -52,7 +52,7 @@
Name zoneIdentityName = Name(m_zone.getName()).append(label::NDNS_ITERATIVE_QUERY);
if (m_dskCertName != DEFAULT_CERT &&
!matchCertificate(m_dskCertName, zoneIdentityName)) {
- BOOST_THROW_EXCEPTION(Error("Cannot verify certificate"));
+ NDN_THROW(Error("Cannot verify certificate"));
}
}
@@ -67,7 +67,7 @@
DbMgr dbMgr(m_dbFile);
const Name& zoneName = m_zone.getName();
if (!dbMgr.find(m_zone)) {
- BOOST_THROW_EXCEPTION(Error(zoneName.toUri() + " is not presented in the NDNS db"));
+ NDN_THROW(Error(zoneName.toUri() + " is not presented in the NDNS db"));
}
}
@@ -120,7 +120,7 @@
const ndn::DelegationList& delegations)
{
if (!m_checked) {
- BOOST_THROW_EXCEPTION(Error("You have to call checkZoneKey before call generate functions"));
+ NDN_THROW(Error("You have to call checkZoneKey before call generate functions"));
}
if (ttl == DEFAULT_RR_TTL)
@@ -147,7 +147,7 @@
const std::vector<std::string>& strings)
{
if (!m_checked) {
- BOOST_THROW_EXCEPTION(Error("You have to call checkZoneKey before call generate functions"));
+ NDN_THROW(Error("You have to call checkZoneKey before call generate functions"));
}
if (ttl == DEFAULT_RR_TTL)
@@ -181,7 +181,7 @@
const ndn::security::Certificate& cert)
{
if (!m_checked) {
- BOOST_THROW_EXCEPTION(Error("You have to call checkZoneKey before call generate functions"));
+ NDN_THROW(Error("You have to call checkZoneKey before call generate functions"));
}
if (ttl == DEFAULT_RR_TTL)
@@ -207,7 +207,7 @@
time::seconds ttl)
{
if (!m_checked) {
- BOOST_THROW_EXCEPTION(Error("You have to call checkZoneKey before call generate functions"));
+ NDN_THROW(Error("You have to call checkZoneKey before call generate functions"));
}
if (ttl == DEFAULT_RR_TTL)
@@ -234,7 +234,7 @@
const Name& upperLabel)
{
if (!m_checked) {
- BOOST_THROW_EXCEPTION(Error("You have to call checkZoneKey before call generate functions"));
+ NDN_THROW(Error("You have to call checkZoneKey before call generate functions"));
}
if (ttl == DEFAULT_RR_TTL)
diff --git a/src/daemon/rrset-factory.hpp b/src/daemon/rrset-factory.hpp
index 1773fe0..bab99ca 100644
--- a/src/daemon/rrset-factory.hpp
+++ b/src/daemon/rrset-factory.hpp
@@ -20,7 +20,6 @@
#ifndef NDNS_DAEMON_RRSET_FACTORY_HPP
#define NDNS_DAEMON_RRSET_FACTORY_HPP
-#include "common.hpp"
#include "rrset.hpp"
#include "logger.hpp"
#include "daemon/db-mgr.hpp"
@@ -29,9 +28,7 @@
#include <ndn-cxx/link.hpp>
#include <ndn-cxx/security/key-chain.hpp>
-#include <vector>
-#include <string>
-#include <boost/filesystem.hpp>
+#include <boost/filesystem/path.hpp>
namespace ndn {
namespace ndns {
@@ -44,10 +41,7 @@
class Error : public std::runtime_error
{
public:
- explicit
- Error(const std::string& what) : std::runtime_error(what)
- {
- }
+ using std::runtime_error::runtime_error;
};
public:
@@ -138,4 +132,3 @@
} // namespace ndn
#endif // NDNS_DAEMON_RRSET_FACTORY_HPP
-
diff --git a/src/daemon/rrset.cpp b/src/daemon/rrset.cpp
index 75c4d81..5c95a8f 100644
--- a/src/daemon/rrset.cpp
+++ b/src/daemon/rrset.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California.
+ * Copyright (c) 2014-2020, Regents of the University of California.
*
* This file is part of NDNS (Named Data Networking Domain Name Service).
* See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -62,7 +62,7 @@
{
if (getZone() != other.getZone() ||
(getZone() != nullptr && *getZone() != *other.getZone())) {
- BOOST_THROW_EXCEPTION(std::runtime_error("Cannot compare Rrset that belong to different zones"));
+ NDN_THROW(std::runtime_error("Cannot compare Rrset that belong to different zones"));
}
bool isLess = getLabel() < other.getLabel();
diff --git a/src/daemon/zone.hpp b/src/daemon/zone.hpp
index e3a15d4..854523a 100644
--- a/src/daemon/zone.hpp
+++ b/src/daemon/zone.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California.
+/*
+ * Copyright (c) 2014-2020, Regents of the University of California.
*
* This file is part of NDNS (Named Data Networking Domain Name Service).
* See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -20,9 +20,7 @@
#ifndef NDNS_DAEMON_ZONE_HPP
#define NDNS_DAEMON_ZONE_HPP
-#include <ndn-cxx/name.hpp>
-
-#include <iostream>
+#include "common.hpp"
namespace ndn {
namespace ndns {
@@ -32,8 +30,8 @@
* @see http://en.wikipedia.org/wiki/DNS_zone
* @see http://irl.cs.ucla.edu/data/files/theses/afanasyev-thesis.pdf
*
- * The class is copyable, since it may be assigned to another Zone instance
- * when resolving Response or Query from database
+ * This class is copyable, since it may be assigned to another Zone instance
+ * when resolving Response or Query from database
*/
class Zone
{