Prevent copy & move of abstract classes

To prevent slicing, following C++ Core Guidelines C.21 and C.67.
This commit is contained in:
Oliver Hamlet
2026-01-01 22:26:09 +00:00
parent cdf3050503
commit 364e2d25c0
3 changed files with 21 additions and 0 deletions
+7
View File
@@ -39,8 +39,15 @@ namespace loot {
/** @brief The interface provided by API's database handle. */
class DatabaseInterface {
public:
DatabaseInterface() = default;
DatabaseInterface(const DatabaseInterface&) = delete;
DatabaseInterface(DatabaseInterface&&) = delete;
virtual ~DatabaseInterface() = default;
DatabaseInterface& operator=(const DatabaseInterface&) = delete;
DatabaseInterface& operator=(DatabaseInterface&&) = delete;
/**
* @name Data Reading & Writing
* @{
+7
View File
@@ -32,8 +32,15 @@ namespace loot {
/** @brief The interface provided for accessing game-specific functionality. */
class GameInterface {
public:
GameInterface() = default;
GameInterface(const GameInterface&) = delete;
GameInterface(GameInterface&&) = delete;
virtual ~GameInterface() = default;
GameInterface& operator=(const GameInterface&) = delete;
GameInterface& operator=(GameInterface&&) = delete;
/**
* @brief Get the game's type.
* @returns The game's type.
+7
View File
@@ -40,8 +40,15 @@ namespace loot {
*/
class PluginInterface {
public:
PluginInterface() = default;
PluginInterface(const PluginInterface&) = delete;
PluginInterface(PluginInterface&&) = delete;
virtual ~PluginInterface() = default;
PluginInterface& operator=(const PluginInterface&) = delete;
PluginInterface& operator=(PluginInterface&&) = delete;
/**
* Get the plugin's filename.
* @return The plugin filename. If the plugin was ghosted when it was loaded,