summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.clang-tidy1
-rw-r--r--http/app.hpp5
-rw-r--r--http/http_connection.hpp5
-rw-r--r--http/http_request.hpp3
-rw-r--r--http/http_response.hpp4
-rw-r--r--http/logging.hpp5
-rw-r--r--http/routing.hpp5
-rw-r--r--http/websocket.hpp5
-rw-r--r--include/async_resolve.hpp5
-rw-r--r--include/async_resp.hpp2
-rw-r--r--include/ibm/locks.hpp8
-rw-r--r--include/openbmc_dbus_rest.hpp14
-rw-r--r--include/persistent_data.hpp5
-rw-r--r--include/sessions.hpp3
-rw-r--r--include/vm_websocket.hpp5
-rw-r--r--redfish-core/include/event_service_manager.hpp1
-rw-r--r--redfish-core/include/gzfile.hpp2
-rw-r--r--redfish-core/include/rf_async_resp.hpp2
-rw-r--r--redfish-core/lib/health.hpp5
-rw-r--r--redfish-core/lib/managers.hpp11
-rw-r--r--redfish-core/lib/metric_report_definition.hpp5
-rw-r--r--redfish-core/lib/sensors.hpp5
-rw-r--r--redfish-core/lib/virtual_media.hpp7
-rw-r--r--redfish-core/ut/lock_test.cpp5
24 files changed, 118 insertions, 0 deletions
diff --git a/.clang-tidy b/.clang-tidy
index 6f3c69d70a..8a14cfa695 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -202,6 +202,7 @@ clang-analyzer-valist.ValistBase,
clang-analyzer-webkit.NoUncountedMemberChecker,
clang-analyzer-webkit.RefCntblBaseVirtualDtor,
cppcoreguidelines-init-variables,
+cppcoreguidelines-special-member-functions,
misc-misplaced-const,
#misc-no-recursion,
misc-redundant-expression,
diff --git a/http/app.hpp b/http/app.hpp
index b4ccd95e6a..8dcec48e93 100644
--- a/http/app.hpp
+++ b/http/app.hpp
@@ -44,6 +44,11 @@ class App
this->stop();
}
+ App(const App&) = delete;
+ App(App&&) = delete;
+ App& operator=(const App&) = delete;
+ App& operator=(const App&&) = delete;
+
template <typename Adaptor>
void handleUpgrade(const Request& req, Response& res, Adaptor&& adaptor)
{
diff --git a/http/http_connection.hpp b/http/http_connection.hpp
index 6de2bf7a0a..77886c5da1 100644
--- a/http/http_connection.hpp
+++ b/http/http_connection.hpp
@@ -81,6 +81,11 @@ class Connection :
<< connectionCount;
}
+ Connection(const Connection&) = delete;
+ Connection(Connection&&) = delete;
+ Connection& operator=(const Connection&) = delete;
+ Connection& operator=(Connection&&) = delete;
+
void prepareMutualTls()
{
std::error_code error;
diff --git a/http/http_request.hpp b/http/http_request.hpp
index 4567314787..be1c2a2404 100644
--- a/http/http_request.hpp
+++ b/http/http_request.hpp
@@ -46,7 +46,10 @@ struct Request
}
Request(const Request&) = delete;
+ Request(const Request&&) = delete;
Request& operator=(const Request&) = delete;
+ Request& operator=(const Request&&) = delete;
+ ~Request() = default;
boost::beast::http::verb method() const
{
diff --git a/http/http_response.hpp b/http/http_response.hpp
index a983d4ae51..08b76f2478 100644
--- a/http/http_response.hpp
+++ b/http/http_response.hpp
@@ -39,6 +39,10 @@ struct Response
Response() : stringResponse(response_type{})
{}
+ ~Response() = default;
+
+ Response(const Response&) = delete;
+ Response(Response&&) = delete;
Response& operator=(const Response& r) = delete;
Response& operator=(Response&& r) noexcept
diff --git a/http/logging.hpp b/http/logging.hpp
index 0121729542..e2bfdb1365 100644
--- a/http/logging.hpp
+++ b/http/logging.hpp
@@ -62,6 +62,11 @@ class Logger
}
}
+ Logger(const Logger&) = delete;
+ Logger(Logger&&) = delete;
+ Logger& operator=(const Logger&) = delete;
+ Logger& operator=(const Logger&&) = delete;
+
//
template <typename T>
Logger& operator<<([[maybe_unused]] T const& value)
diff --git a/http/routing.hpp b/http/routing.hpp
index 06f2a091ba..a7c0ced992 100644
--- a/http/routing.hpp
+++ b/http/routing.hpp
@@ -34,6 +34,11 @@ class BaseRule
virtual ~BaseRule() = default;
+ BaseRule(const BaseRule&) = delete;
+ BaseRule(BaseRule&&) = delete;
+ BaseRule& operator=(const BaseRule&) = delete;
+ BaseRule& operator=(const BaseRule&&) = delete;
+
virtual void validate() = 0;
std::unique_ptr<BaseRule> upgrade()
{
diff --git a/http/websocket.hpp b/http/websocket.hpp
index 30a9b9f4b5..74bce581d2 100644
--- a/http/websocket.hpp
+++ b/http/websocket.hpp
@@ -29,6 +29,11 @@ struct Connection : std::enable_shared_from_this<Connection>
req(reqIn.req), userName{std::move(user)}, userdataPtr(nullptr)
{}
+ Connection(const Connection&) = delete;
+ Connection(Connection&&) = delete;
+ Connection& operator=(const Connection&) = delete;
+ Connection& operator=(const Connection&&) = delete;
+
virtual void sendBinary(const std::string_view msg) = 0;
virtual void sendBinary(std::string&& msg) = 0;
virtual void sendText(const std::string_view msg) = 0;
diff --git a/include/async_resolve.hpp b/include/async_resolve.hpp
index 563d816ce3..c69fd87129 100644
--- a/include/async_resolve.hpp
+++ b/include/async_resolve.hpp
@@ -20,6 +20,11 @@ class Resolver
~Resolver() = default;
+ Resolver(const Resolver&) = delete;
+ Resolver(Resolver&&) = delete;
+ Resolver& operator=(const Resolver&) = delete;
+ Resolver& operator=(Resolver&&) = delete;
+
template <typename ResolveHandler>
void asyncResolve(const std::string& host, const std::string& port,
ResolveHandler&& handler)
diff --git a/include/async_resp.hpp b/include/async_resp.hpp
index 8e9584ccdf..607d168e9e 100644
--- a/include/async_resp.hpp
+++ b/include/async_resp.hpp
@@ -24,6 +24,8 @@ class AsyncResp
AsyncResp(const AsyncResp&) = delete;
AsyncResp(AsyncResp&&) = delete;
+ AsyncResp& operator=(const AsyncResp&) = delete;
+ AsyncResp& operator=(AsyncResp&&) = delete;
~AsyncResp()
{
diff --git a/include/ibm/locks.hpp b/include/ibm/locks.hpp
index fb8b396821..8e04b8424b 100644
--- a/include/ibm/locks.hpp
+++ b/include/ibm/locks.hpp
@@ -128,6 +128,14 @@ class Lock
public:
/*
+ * Explicitly deleted copy and move constructors
+ */
+ Lock(const Lock&) = delete;
+ Lock(Lock&&) = delete;
+ Lock& operator=(const Lock&) = delete;
+ Lock& operator=(Lock&&) = delete;
+
+ /*
* This function implements the logic for acquiring a lock on a
* resource if the incoming request is legitimate without any
* conflicting requirements & without any conflicting requirement
diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp
index 0b54c6592d..abcec1a982 100644
--- a/include/openbmc_dbus_rest.hpp
+++ b/include/openbmc_dbus_rest.hpp
@@ -238,6 +238,11 @@ struct InProgressEnumerateData
}
}
+ InProgressEnumerateData(const InProgressEnumerateData&) = delete;
+ InProgressEnumerateData(InProgressEnumerateData&&) = delete;
+ InProgressEnumerateData& operator=(const InProgressEnumerateData&) = delete;
+ InProgressEnumerateData& operator=(InProgressEnumerateData&&) = delete;
+
const std::string objectPath;
std::shared_ptr<GetSubTreeType> subtree;
std::shared_ptr<bmcweb::AsyncResp> asyncResp;
@@ -484,6 +489,10 @@ struct InProgressActionData
res.end();
}
+ InProgressActionData(const InProgressActionData&) = delete;
+ InProgressActionData(InProgressActionData&&) = delete;
+ InProgressActionData& operator=(const InProgressActionData&) = delete;
+ InProgressActionData& operator=(InProgressActionData&&) = delete;
void setErrorStatus(const std::string& desc)
{
@@ -1805,6 +1814,11 @@ struct AsyncPutRequest
}
}
+ AsyncPutRequest(const AsyncPutRequest&) = delete;
+ AsyncPutRequest(AsyncPutRequest&&) = delete;
+ AsyncPutRequest& operator=(const AsyncPutRequest&) = delete;
+ AsyncPutRequest& operator=(AsyncPutRequest&&) = delete;
+
void setErrorStatus(const std::string& desc)
{
setErrorResponse(asyncResp->res,
diff --git a/include/persistent_data.hpp b/include/persistent_data.hpp
index d7230cbf1c..47bb8a9f4c 100644
--- a/include/persistent_data.hpp
+++ b/include/persistent_data.hpp
@@ -43,6 +43,11 @@ class ConfigFile
}
}
+ ConfigFile(const ConfigFile&) = delete;
+ ConfigFile(ConfigFile&&) = delete;
+ ConfigFile& operator=(const ConfigFile&) = delete;
+ ConfigFile& operator=(ConfigFile&&) = delete;
+
// TODO(ed) this should really use protobuf, or some other serialization
// library, but adding another dependency is somewhat outside the scope of
// this application for the moment
diff --git a/include/sessions.hpp b/include/sessions.hpp
index a05e47b6be..79e71ced9a 100644
--- a/include/sessions.hpp
+++ b/include/sessions.hpp
@@ -404,6 +404,9 @@ class SessionStore
SessionStore(const SessionStore&) = delete;
SessionStore& operator=(const SessionStore&) = delete;
+ SessionStore(SessionStore&&) = delete;
+ SessionStore& operator=(const SessionStore&&) = delete;
+ ~SessionStore() = default;
std::unordered_map<std::string, std::shared_ptr<UserSession>,
std::hash<std::string>,
diff --git a/include/vm_websocket.hpp b/include/vm_websocket.hpp
index 34ef82ef99..2a0353be32 100644
--- a/include/vm_websocket.hpp
+++ b/include/vm_websocket.hpp
@@ -32,6 +32,11 @@ class Handler : public std::enable_shared_from_this<Handler>
~Handler() = default;
+ Handler(const Handler&) = delete;
+ Handler(Handler&&) = delete;
+ Handler& operator=(const Handler&) = delete;
+ Handler& operator=(Handler&&) = delete;
+
void doClose()
{
// boost::process::child::terminate uses SIGKILL, need to send SIGTERM
diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp
index 642a3029b5..7cb5cc7cb7 100644
--- a/redfish-core/include/event_service_manager.hpp
+++ b/redfish-core/include/event_service_manager.hpp
@@ -588,6 +588,7 @@ class EventServiceManager
EventServiceManager& operator=(const EventServiceManager&) = delete;
EventServiceManager(EventServiceManager&&) = delete;
EventServiceManager& operator=(EventServiceManager&&) = delete;
+ ~EventServiceManager() = default;
static EventServiceManager& getInstance()
{
diff --git a/redfish-core/include/gzfile.hpp b/redfish-core/include/gzfile.hpp
index 118bdb4981..2001756a74 100644
--- a/redfish-core/include/gzfile.hpp
+++ b/redfish-core/include/gzfile.hpp
@@ -207,4 +207,6 @@ class GzFileReader
~GzFileReader() = default;
GzFileReader(const GzFileReader&) = delete;
GzFileReader& operator=(const GzFileReader&) = delete;
+ GzFileReader(GzFileReader&&) = delete;
+ GzFileReader& operator=(GzFileReader&&) = delete;
};
diff --git a/redfish-core/include/rf_async_resp.hpp b/redfish-core/include/rf_async_resp.hpp
index b6dacc7b59..5eb7a3f019 100644
--- a/redfish-core/include/rf_async_resp.hpp
+++ b/redfish-core/include/rf_async_resp.hpp
@@ -17,6 +17,8 @@ class AsyncResp
AsyncResp(const AsyncResp&) = delete;
AsyncResp(AsyncResp&&) = delete;
+ AsyncResp& operator=(const AsyncResp&) = delete;
+ AsyncResp& operator=(AsyncResp&&) = delete;
~AsyncResp()
{
diff --git a/redfish-core/lib/health.hpp b/redfish-core/lib/health.hpp
index 02edfdca9e..c2e40c7a87 100644
--- a/redfish-core/lib/health.hpp
+++ b/redfish-core/lib/health.hpp
@@ -40,6 +40,11 @@ struct HealthPopulate : std::enable_shared_from_this<HealthPopulate>
jsonStatus(status)
{}
+ HealthPopulate(const HealthPopulate&) = delete;
+ HealthPopulate(HealthPopulate&&) = delete;
+ HealthPopulate& operator=(const HealthPopulate&) = delete;
+ HealthPopulate& operator=(const HealthPopulate&&) = delete;
+
~HealthPopulate()
{
nlohmann::json& health = jsonStatus["Health"];
diff --git a/redfish-core/lib/managers.hpp b/redfish-core/lib/managers.hpp
index ad5c5e3829..201f2f41a3 100644
--- a/redfish-core/lib/managers.hpp
+++ b/redfish-core/lib/managers.hpp
@@ -1317,6 +1317,11 @@ struct GetPIDValues : std::enable_shared_from_this<GetPIDValues>
}
}
+ GetPIDValues(const GetPIDValues&) = delete;
+ GetPIDValues(GetPIDValues&&) = delete;
+ GetPIDValues& operator=(const GetPIDValues&) = delete;
+ GetPIDValues& operator=(GetPIDValues&&) = delete;
+
std::vector<std::string> supportedProfiles;
std::string currentProfile;
crow::openbmc_mapper::GetSubTreeType subtree;
@@ -1353,6 +1358,12 @@ struct SetPIDValues : std::enable_shared_from_this<SetPIDValues>
configuration.emplace_back("StepwiseControllers",
std::move(stepwiseControllers));
}
+
+ SetPIDValues(const SetPIDValues&) = delete;
+ SetPIDValues(SetPIDValues&&) = delete;
+ SetPIDValues& operator=(const SetPIDValues&) = delete;
+ SetPIDValues& operator=(SetPIDValues&&) = delete;
+
void run()
{
if (asyncResp->res.result() != boost::beast::http::status::ok)
diff --git a/redfish-core/lib/metric_report_definition.hpp b/redfish-core/lib/metric_report_definition.hpp
index 1461fd84e7..745fad8186 100644
--- a/redfish-core/lib/metric_report_definition.hpp
+++ b/redfish-core/lib/metric_report_definition.hpp
@@ -335,6 +335,11 @@ class AddReport
args.interval, readingParams);
}
+ AddReport(const AddReport&) = delete;
+ AddReport(AddReport&&) = delete;
+ AddReport& operator=(const AddReport&) = delete;
+ AddReport& operator=(AddReport&&) = delete;
+
void insert(const boost::container::flat_map<std::string, std::string>& el)
{
uriToDbus.insert(el.begin(), el.end());
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
index 99dfc8185d..52d1fc0574 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -227,6 +227,11 @@ class SensorsAsyncResp
}
}
+ SensorsAsyncResp(const SensorsAsyncResp&) = delete;
+ SensorsAsyncResp(SensorsAsyncResp&&) = delete;
+ SensorsAsyncResp& operator=(const SensorsAsyncResp&) = delete;
+ SensorsAsyncResp& operator=(SensorsAsyncResp&&) = delete;
+
void addMetadata(const nlohmann::json& sensorObject,
const std::string& valueKey, const std::string& dbusPath)
{
diff --git a/redfish-core/lib/virtual_media.hpp b/redfish-core/lib/virtual_media.hpp
index a682486a70..00c3ecf5ae 100644
--- a/redfish-core/lib/virtual_media.hpp
+++ b/redfish-core/lib/virtual_media.hpp
@@ -531,6 +531,8 @@ class Credentials
Credentials() = delete;
Credentials(const Credentials&) = delete;
Credentials& operator=(const Credentials&) = delete;
+ Credentials(Credentials&&) = delete;
+ Credentials& operator=(Credentials&&) = delete;
private:
std::string userBuf;
@@ -606,6 +608,11 @@ class Pipe
impl.close();
}
+ Pipe(const Pipe&) = delete;
+ Pipe(Pipe&&) = delete;
+ Pipe& operator=(const Pipe&) = delete;
+ Pipe& operator=(Pipe&&) = delete;
+
unix_fd fd()
{
return unix_fd{impl.native_source()};
diff --git a/redfish-core/ut/lock_test.cpp b/redfish-core/ut/lock_test.cpp
index 603422a868..e89377df16 100644
--- a/redfish-core/ut/lock_test.cpp
+++ b/redfish-core/ut/lock_test.cpp
@@ -58,6 +58,11 @@ class LockTest : public ::testing::Test
}
~LockTest() override = default;
+
+ LockTest(const LockTest&) = delete;
+ LockTest(LockTest&&) = delete;
+ LockTest& operator=(const LockTest&) = delete;
+ LockTest& operator=(const LockTest&&) = delete;
};
class MockLock : public crow::ibm_mc_lock::Lock