mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Prevent copy & move of abstract classes
To prevent slicing, following C++ Core Guidelines C.21 and C.67.
This commit is contained in:
@@ -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
|
||||
* @{
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user