Commit f81e8464 authored by Francis Dupont's avatar Francis Dupont

[5487] Spelling, missing override, more C++11 feature checks

parent 0aa3bc07
......@@ -58,6 +58,24 @@ for retry in "none" "--std=c++11" "--std=c++0x" "--std=c++1x" "fail"; do
[AC_MSG_RESULT([no])
continue])
AC_MSG_CHECKING(override method support)
feature="override method"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[class Foo {
public:
virtual ~Foo() {};
virtual void foobar();
};
class Bar : public Foo {
public:
virtual ~Bar() {};
virtual void foobar() override;
};],[])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
continue])
AC_MSG_CHECKING(aggregate initialization support)
feature="aggregate initialization"
AC_COMPILE_IFELSE(
......@@ -107,6 +125,19 @@ for retry in "none" "--std=c++11" "--std=c++0x" "--std=c++1x" "fail"; do
[AC_MSG_RESULT([no])
continue])
AC_MSG_CHECKING(constexpr support)
feature="constexpr"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[#include <string>
typedef char const* const Tag;
constexpr Tag FOOBAR = "FOOBAR";],
[const std::string foobar(FOOBAR);
return static_cast<int>(foobar.length());])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
continue])
AC_MSG_CHECKING(lambda support)
feature="lambda"
AC_COMPILE_IFELSE(
......
......@@ -17,7 +17,7 @@ if HAVE_PGSQL
AM_CPPFLAGS += $(PGSQL_CPPFLAGS)
endif
if HAVE_CQL
AM_CPPFLAGS += $(CQL_CPPFLAGS)
AM_CPPFLAGS += $(CQL_CPPFLAGS) $(CRYPTO_INCLUDES)
endif
AM_CXXFLAGS = $(KEA_CXXFLAGS)
......
// Copyright (C) 2016-2017 Deutsche Telekom AG.
// Copyright (C) 2016-2018 Deutsche Telekom AG.
//
// Author: Andrei Pavel <andrei.pavel@qualitance.com>
//
......@@ -142,8 +142,7 @@ public:
/// @brief Constructor
///
/// Specifies table columns.
/// @param connection specifies the connection to conduct this exchange on
CqlHostExchange(CqlConnection& connection);
CqlHostExchange();
/// @brief Virtual destructor.
virtual ~CqlHostExchange();
......@@ -272,9 +271,6 @@ private:
/// Pointer to Host object holding information being inserted into database.
HostPtr host_;
/// @brief Connection to the Cassandra database
CqlConnection& connection_;
/// @brief Primary key. Aggregates: host_identifier, host_identifier_type,
/// reserved_ipv6_prefix_address, reserved_ipv6_prefix_length, option_code,
/// option_space.
......@@ -602,9 +598,9 @@ StatementMap CqlHostExchange::tagged_statements_ = {
};
CqlHostExchange::CqlHostExchange(CqlConnection& connection)
: host_(NULL), connection_(connection), id_(0), host_identifier_type_(0),
host_ipv4_subnet_id_(0), host_ipv6_subnet_id_(0), host_ipv4_address_(0),
CqlHostExchange::CqlHostExchange()
: host_(NULL), id_(0), host_identifier_type_(0), host_ipv4_subnet_id_(0),
host_ipv6_subnet_id_(0), host_ipv4_address_(0),
reserved_ipv6_prefix_length_(NULL_RESERVED_IPV6_PREFIX_LENGTH),
reserved_ipv6_prefix_address_type_(NULL_RESERVED_IPV6_PREFIX_ADDRESS_TYPE),
iaid_(NULL_IAID), option_universe_(NULL_OPTION_UNIVERSE),
......@@ -1731,7 +1727,7 @@ CqlHostDataSourceImpl::getHostCollection(StatementTag statement_tag,
AnyArray& where_values) const {
// Run statement.
std::unique_ptr<CqlHostExchange> host_exchange(new CqlHostExchange(dbconn_));
std::unique_ptr<CqlHostExchange> host_exchange(new CqlHostExchange());
AnyArray collection = host_exchange->executeSelect(dbconn_, where_values,
statement_tag, false);
......@@ -1772,7 +1768,7 @@ CqlHostDataSourceImpl::insertHost(const HostPtr& host,
const OptionDescriptor& option_descriptor) {
AnyArray assigned_values;
std::unique_ptr<CqlHostExchange> host_exchange(new CqlHostExchange(dbconn_));
std::unique_ptr<CqlHostExchange> host_exchange(new CqlHostExchange());
try {
host_exchange->createBindForMutation(
......
// Copyright (C) 2016-2017 Deutsche Telekom AG.
// Copyright (C) 2016-2018 Deutsche Telekom AG.
//
// Author: Andrei Pavel <andrei.pavel@qualitance.com>
//
......@@ -274,7 +274,7 @@ public:
/// there.
/// @throw various exceptions in case of errors
virtual bool del(const SubnetID& subnet_id,
const asiolink::IOAddress& addr);
const asiolink::IOAddress& addr) override;
/// @brief Attempts to delete a host by (subnet-id4, identifier-type,
/// identifier).
......@@ -292,7 +292,7 @@ public:
virtual bool del4(const SubnetID& subnet_id,
const Host::IdentifierType& identifier_type,
const uint8_t* identifier_begin,
const size_t identifier_len);
const size_t identifier_len) override;
/// @brief Attempts to delete a host by (subnet-id6, identifier-type,
/// identifier).
......@@ -310,7 +310,7 @@ public:
virtual bool del6(const SubnetID& subnet_id,
const Host::IdentifierType& identifier_type,
const uint8_t* identifier_begin,
const size_t identifier_len);
const size_t identifier_len) override;
/// @brief Returns textual description of the backend.
///
......
......@@ -1447,7 +1447,7 @@ class CqlLeaseStatsQuery : public LeaseStatsQuery {
public:
/// @brief Constructor
///
/// @param conn A open connection to the database housing the lease data
/// @param conn An open connection to the database housing the lease data
/// @param statement The lease data SQL prepared statement tag to execute
/// @param fetch_type Indicates whether or not lease_type should be
/// fetched from the result set (should be true for v6)
......
......@@ -203,12 +203,12 @@ public:
/// @param subnet_id subnet identifier.
///
/// @return Lease collection (may be empty if no IPv4 lease found).
virtual Lease4Collection getLeases4(SubnetID subnet_id) const;
virtual Lease4Collection getLeases4(SubnetID subnet_id) const override;
/// @brief Returns all IPv4 leases.
///
/// @return Lease collection (may be empty if no IPv4 lease found).
virtual Lease4Collection getLeases4() const;
virtual Lease4Collection getLeases4() const override;
/// @brief Returns existing IPv6 lease for a given IPv6 address.
///
......@@ -330,7 +330,7 @@ public:
///
/// @throw isc::dhcp::DbOperationError An operation on the open database has
/// failed.
virtual bool deleteLease(const isc::asiolink::IOAddress& addr);
virtual bool deleteLease(const isc::asiolink::IOAddress& addr) override;
/// @brief Deletes all expired and reclaimed DHCPv4 leases.
///
......@@ -360,7 +360,7 @@ public:
/// The query object is then returned.
///
/// @return The populated query as a pointer to an LeaseStatsQuery
virtual LeaseStatsQueryPtr startLeaseStatsQuery4();
virtual LeaseStatsQueryPtr startLeaseStatsQuery4() override;
/// @brief Creates and runs the IPv6 lease stats query
///
......@@ -370,7 +370,7 @@ public:
/// The query object is then returned.
///
/// @return The populated query as a pointer to an LeaseStatsQuery
virtual LeaseStatsQueryPtr startLeaseStatsQuery6();
virtual LeaseStatsQueryPtr startLeaseStatsQuery6() override;
/// @brief Removes specified IPv4 leases.
///
......@@ -381,7 +381,7 @@ public:
///
/// @param subnet_id identifier of the subnet
/// @return number of leases removed.
virtual size_t wipeLeases4(const SubnetID& subnet_id);
virtual size_t wipeLeases4(const SubnetID& subnet_id) override;
/// @brief Removed specified IPv6 leases.
///
......@@ -392,7 +392,7 @@ public:
///
/// @param subnet_id identifier of the subnet
/// @return number of leases removed.
virtual size_t wipeLeases6(const SubnetID& subnet_id);
virtual size_t wipeLeases6(const SubnetID& subnet_id) override;
/// @brief Return backend type
///
......
......@@ -134,7 +134,7 @@ struct LeaseStatsRow {
/// @brief Base class for fulfilling a statistical lease data query
///
/// LeaseMgr derivations implement this class such that it provides
/// upto date statistical lease data organized as rows of LeaseStatsRow
/// up to date statistical lease data organized as rows of LeaseStatsRow
/// instances. The rows must be accessible in ascending order by subnet id.
class LeaseStatsQuery {
public:
......@@ -457,7 +457,7 @@ public:
///
/// LeaseMgr derivations implement this method such that it creates and
/// returns an instance of an LeaseStatsQuery whose result set has been
/// populated with upto date IPv4 lease statistical data. Each row of the
/// populated with up to date IPv4 lease statistical data. Each row of the
/// result set is an LeaseStatRow which ordered ascending by subnet ID.
///
/// @return A populated LeaseStatsQuery
......@@ -488,7 +488,7 @@ public:
///
/// LeaseMgr derivations implement this method such that it creates and
/// returns an instance of an LeaseStatsQuery whose result set has been
/// populated with upto date IPv6 lease statistical data. Each row of the
/// populated with up to date IPv6 lease statistical data. Each row of the
/// result set is an LeaseStatRow which ordered ascending by subnet ID.
///
/// @return A populated LeaseStatsQuery
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment