C26432, rule-of-five (if you define one of destruct/copy/move, then define them all)

This commit is contained in:
Michael Niksa 2019-09-03 13:45:16 -07:00
parent d8bc94f13c
commit 2d3f285894
13 changed files with 53 additions and 8 deletions

View file

@ -28,8 +28,6 @@ public:
TextBufferCellIterator(const TextBuffer& buffer, COORD pos);
TextBufferCellIterator(const TextBuffer& buffer, COORD pos, const Microsoft::Console::Types::Viewport limits);
~TextBufferCellIterator() = default;
operator bool() const noexcept;
bool operator==(const TextBufferCellIterator& it) const;

View file

@ -22,6 +22,7 @@
<ClInclude Include="..\..\inc\IRenderData.hpp" />
<ClInclude Include="..\..\inc\IRenderEngine.hpp" />
<ClInclude Include="..\..\inc\IRenderer.hpp" />
<ClInclude Include="..\..\inc\IRenderTarget.hpp" />
<ClInclude Include="..\..\inc\RenderEngineBase.hpp" />
<ClInclude Include="..\precomp.h" />
<ClInclude Include="..\renderer.hpp" />

View file

@ -80,6 +80,9 @@
<ClInclude Include="..\..\inc\Cluster.hpp">
<Filter>Header Files\inc</Filter>
</ClInclude>
<ClInclude Include="..\..\inc\IRenderTarget.hpp">
<Filter>Header Files\inc</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Natvis Include="$(SolutionDir)tools\ConsoleTypes.natvis" />

View file

@ -32,6 +32,10 @@ namespace Microsoft::Console::Render
public:
DxEngine();
virtual ~DxEngine() override;
DxEngine(const DxEngine&) = default;
DxEngine(DxEngine&&) = default;
DxEngine& operator=(const DxEngine&) = default;
DxEngine& operator=(DxEngine&&) = default;
// Used to release device resources so that another instance of
// conhost can render to the screen (i.e. only one DirectX

View file

@ -64,6 +64,14 @@ namespace Microsoft::Console::Render
virtual ~IRenderEngine() = 0;
protected:
IRenderEngine() = default;
IRenderEngine(const IRenderEngine&) = default;
IRenderEngine(IRenderEngine&&) = default;
IRenderEngine& operator=(const IRenderEngine&) = default;
IRenderEngine& operator=(IRenderEngine&&) = default;
public:
[[nodiscard]] virtual HRESULT StartPaint() noexcept = 0;
[[nodiscard]] virtual HRESULT EndPaint() noexcept = 0;
[[nodiscard]] virtual HRESULT Present() noexcept = 0;

View file

@ -24,6 +24,13 @@ namespace Microsoft::Console::Render
{
public:
virtual ~IRenderTarget() = 0;
protected:
IRenderTarget() = default;
IRenderTarget(const IRenderTarget&) = default;
IRenderTarget(IRenderTarget&&) = default;
IRenderTarget& operator=(const IRenderTarget&) = default;
IRenderTarget& operator=(IRenderTarget&&) = default;
public:
virtual void TriggerRedraw(const Microsoft::Console::Types::Viewport& region) = 0;
virtual void TriggerRedraw(const COORD* const pcoord) = 0;

View file

@ -24,8 +24,14 @@ namespace Microsoft::Console::Render
class RenderEngineBase : public IRenderEngine
{
public:
~RenderEngineBase() = 0;
protected:
RenderEngineBase();
virtual ~RenderEngineBase() = 0;
RenderEngineBase(const RenderEngineBase&) = default;
RenderEngineBase(RenderEngineBase&&) = default;
RenderEngineBase& operator=(const RenderEngineBase&) = default;
RenderEngineBase& operator=(RenderEngineBase&&) = default;
public:
[[nodiscard]] HRESULT InvalidateTitle(const std::wstring& proposedTitle) noexcept override;

View file

@ -24,6 +24,13 @@ namespace Microsoft::Console::Types
{
public:
virtual ~IBaseData() = 0;
protected:
IBaseData() = default;
IBaseData(const IBaseData&) = default;
IBaseData(IBaseData&&) = default;
IBaseData& operator=(const IBaseData&) = default;
IBaseData& operator=(IBaseData&&) = default;
public:
virtual Microsoft::Console::Types::Viewport GetViewport() noexcept = 0;
virtual const TextBuffer& GetTextBuffer() noexcept = 0;
virtual const FontInfo& GetFontInfo() noexcept = 0;

View file

@ -24,6 +24,13 @@ namespace Microsoft::Console::Types
{
public:
virtual ~IUiaData() = 0;
protected:
IUiaData() = default;
IUiaData(const IUiaData&) = default;
IUiaData(IUiaData&&) = default;
IUiaData& operator=(const IUiaData&) = default;
IUiaData& operator=(IUiaData&&) = default;
public:
virtual const bool IsSelectionActive() const = 0;
virtual void ClearSelection() = 0;

View file

@ -38,10 +38,6 @@ ScreenInfoUiaProviderBase::ScreenInfoUiaProviderBase(_In_ IUiaData* pData) :
//Tracing::s_TraceUia(nullptr, ApiCall::Constructor, nullptr);
}
ScreenInfoUiaProviderBase::~ScreenInfoUiaProviderBase()
{
}
[[nodiscard]] HRESULT ScreenInfoUiaProviderBase::Signal(_In_ EVENTID id)
{
HRESULT hr = S_OK;

View file

@ -38,7 +38,11 @@ namespace Microsoft::Console::Types
{
public:
ScreenInfoUiaProviderBase(_In_ IUiaData* pData);
virtual ~ScreenInfoUiaProviderBase();
ScreenInfoUiaProviderBase(const ScreenInfoUiaProviderBase&) = default;
ScreenInfoUiaProviderBase(ScreenInfoUiaProviderBase&&) = default;
ScreenInfoUiaProviderBase& operator=(const ScreenInfoUiaProviderBase&) = default;
ScreenInfoUiaProviderBase& operator=(ScreenInfoUiaProviderBase&&) = default;
virtual ~ScreenInfoUiaProviderBase() = default;
[[nodiscard]] HRESULT Signal(_In_ EVENTID id);

View file

@ -137,6 +137,9 @@ namespace Microsoft::Console::Types
};
public:
UiaTextRangeBase(UiaTextRangeBase&&) = default;
UiaTextRangeBase& operator=(const UiaTextRangeBase&) = default;
UiaTextRangeBase& operator=(UiaTextRangeBase&&) = default;
virtual ~UiaTextRangeBase() = default;
const IdType GetId() const noexcept;

View file

@ -28,6 +28,7 @@ public:
CodepointWidthDetector(CodepointWidthDetector&&) = delete;
~CodepointWidthDetector() = default;
CodepointWidthDetector& operator=(const CodepointWidthDetector&) = delete;
CodepointWidthDetector& operator=(CodepointWidthDetector&&) = delete;
CodepointWidth GetWidth(const std::wstring_view glyph) const;
bool IsWide(const std::wstring_view glyph) const;