mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-13 07:35:41 +08:00
Ref T709 Prevent instantiation of CXSwiftBusSettingsQtFree, to avoid slicing.
- Constructors and destructor are protected. - Therefore destructor doesn't need to be virtual. - objectUpdated is pure virtual, so the class is abstract. - Both derived classes are declared final.
This commit is contained in:
@@ -18,7 +18,7 @@ namespace XSwiftBus
|
||||
/*!
|
||||
* XSwiftBus/swift side settings class, JSON capable, shared among all services
|
||||
*/
|
||||
class CSettings : public BlackMisc::Simulation::Settings::CXSwiftBusSettingsQtFree
|
||||
class CSettings final : public BlackMisc::Simulation::Settings::CXSwiftBusSettingsQtFree
|
||||
{
|
||||
public:
|
||||
//! Constructor.
|
||||
@@ -27,8 +27,9 @@ namespace XSwiftBus
|
||||
//! JSON constructor
|
||||
CSettings(const std::string &json);
|
||||
|
||||
//! Destructor;
|
||||
virtual ~CSettings() {}
|
||||
protected:
|
||||
//! \copydoc CXSwiftBusSettingsQtFree::objectUpdated
|
||||
virtual void objectUpdated() override final {}
|
||||
};
|
||||
|
||||
//! Something owning the settings
|
||||
|
||||
Reference in New Issue
Block a user