]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5487] Spelling, missing override, more C++11 feature checks
authorFrancis Dupont <fdupont@isc.org>
Thu, 25 Jan 2018 10:13:17 +0000 (11:13 +0100)
committerFrancis Dupont <fdupont@isc.org>
Thu, 25 Jan 2018 10:13:17 +0000 (11:13 +0100)
m4macros/ax_cpp11.m4
src/lib/dhcpsrv/Makefile.am
src/lib/dhcpsrv/cql_host_data_source.cc
src/lib/dhcpsrv/cql_host_data_source.h
src/lib/dhcpsrv/cql_lease_mgr.cc
src/lib/dhcpsrv/cql_lease_mgr.h
src/lib/dhcpsrv/lease_mgr.h

index cf6b2ba6d6487beb292d1690697a8e9102543793..9f3025ebffde110cf4fd005946b38590e6d81f29 100644 (file)
@@ -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(
index a9c5ea7c36da8612ced65dcd302028809ba7dd09..5dd692fb9c5a7bac7662235343cbe0cf3b587b23 100644 (file)
@@ -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)
index 13c1a594cc063697401c272116e5207310447d4b..0ef556591e6415e515079ed943d5fdd2665c74c7 100644 (file)
@@ -1,4 +1,4 @@
-// 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(
index 60ea0a805c965b687d314d3dae1ec6e363384694..3b062b4037c26acf40eeacdb76a890c2bbb6e39c 100644 (file)
@@ -1,4 +1,4 @@
-// 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.
     ///
index e40638e514557edd2441acccb00caad595358fe6..54db1a3c43ccd7533e6fbd356d0f77aa74e775b3 100644 (file)
@@ -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)
index 03c68938d024efc41700b97de2d10389a2e0ee26..5bcc193229cdae3363200e7aceb431c300fa5847 100644 (file)
@@ -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
     ///
index 7911be567b12957f305c9a94b637fe3c28cd58fa..3c60e09a22eff71f5bcf58f1231434f24551a501 100644 (file)
@@ -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