Add wxOVERRIDE and use it in common and wxOSX code.

Make overriding virtual methods more explicit and enable additional checks
provided by C++11 compilers when "override" is used.

Closes #16100.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76173 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-03-20 13:26:28 +00:00
parent 34e4f66d6a
commit 33ad33d447
140 changed files with 865 additions and 718 deletions

View File

@@ -247,22 +247,22 @@ public:
inline long GetValue() const { return m_value; }
inline void SetValue(long value) { m_value = value; }
virtual bool Eq(wxVariantData& data) const;
virtual bool Eq(wxVariantData& data) const wxOVERRIDE;
virtual bool Read(wxString& str);
virtual bool Write(wxString& str) const;
virtual bool Read(wxString& str) wxOVERRIDE;
virtual bool Write(wxString& str) const wxOVERRIDE;
#if wxUSE_STD_IOSTREAM
virtual bool Read(wxSTD istream& str);
virtual bool Write(wxSTD ostream& str) const;
virtual bool Read(wxSTD istream& str) wxOVERRIDE;
virtual bool Write(wxSTD ostream& str) const wxOVERRIDE;
#endif
#if wxUSE_STREAMS
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream &str) const;
#endif // wxUSE_STREAMS
wxVariantData* Clone() const { return new wxVariantDataLong(m_value); }
wxVariantData* Clone() const wxOVERRIDE { return new wxVariantDataLong(m_value); }
virtual wxString GetType() const { return wxT("long"); }
virtual wxString GetType() const wxOVERRIDE { return wxT("long"); }
#if wxUSE_ANY
// Since wxAny does not have separate type for integers shorter than
@@ -271,7 +271,7 @@ public:
#ifndef wxLongLong_t
DECLARE_WXANY_CONVERSION()
#else
bool GetAsAny(wxAny* any) const
bool GetAsAny(wxAny* any) const wxOVERRIDE
{
*any = m_value;
return true;
@@ -416,22 +416,22 @@ public:
inline double GetValue() const { return m_value; }
inline void SetValue(double value) { m_value = value; }
virtual bool Eq(wxVariantData& data) const;
virtual bool Read(wxString& str);
virtual bool Eq(wxVariantData& data) const wxOVERRIDE;
virtual bool Read(wxString& str) wxOVERRIDE;
#if wxUSE_STD_IOSTREAM
virtual bool Write(wxSTD ostream& str) const;
virtual bool Write(wxSTD ostream& str) const wxOVERRIDE;
#endif
virtual bool Write(wxString& str) const;
virtual bool Write(wxString& str) const wxOVERRIDE;
#if wxUSE_STD_IOSTREAM
virtual bool Read(wxSTD istream& str);
virtual bool Read(wxSTD istream& str) wxOVERRIDE;
#endif
#if wxUSE_STREAMS
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream &str) const;
#endif // wxUSE_STREAMS
virtual wxString GetType() const { return wxT("double"); }
virtual wxString GetType() const wxOVERRIDE { return wxT("double"); }
wxVariantData* Clone() const { return new wxVariantDoubleData(m_value); }
wxVariantData* Clone() const wxOVERRIDE { return new wxVariantDoubleData(m_value); }
DECLARE_WXANY_CONVERSION()
protected:
@@ -556,22 +556,22 @@ public:
inline bool GetValue() const { return m_value; }
inline void SetValue(bool value) { m_value = value; }
virtual bool Eq(wxVariantData& data) const;
virtual bool Eq(wxVariantData& data) const wxOVERRIDE;
#if wxUSE_STD_IOSTREAM
virtual bool Write(wxSTD ostream& str) const;
virtual bool Write(wxSTD ostream& str) const wxOVERRIDE;
#endif
virtual bool Write(wxString& str) const;
virtual bool Read(wxString& str);
virtual bool Write(wxString& str) const wxOVERRIDE;
virtual bool Read(wxString& str) wxOVERRIDE;
#if wxUSE_STD_IOSTREAM
virtual bool Read(wxSTD istream& str);
virtual bool Read(wxSTD istream& str) wxOVERRIDE;
#endif
#if wxUSE_STREAMS
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream& str) const;
#endif // wxUSE_STREAMS
virtual wxString GetType() const { return wxT("bool"); }
virtual wxString GetType() const wxOVERRIDE { return wxT("bool"); }
wxVariantData* Clone() const { return new wxVariantDataBool(m_value); }
wxVariantData* Clone() const wxOVERRIDE { return new wxVariantDataBool(m_value); }
DECLARE_WXANY_CONVERSION()
protected:
@@ -699,19 +699,19 @@ public:
inline wxUniChar GetValue() const { return m_value; }
inline void SetValue(const wxUniChar& value) { m_value = value; }
virtual bool Eq(wxVariantData& data) const;
virtual bool Eq(wxVariantData& data) const wxOVERRIDE;
#if wxUSE_STD_IOSTREAM
virtual bool Read(wxSTD istream& str);
virtual bool Write(wxSTD ostream& str) const;
virtual bool Read(wxSTD istream& str) wxOVERRIDE;
virtual bool Write(wxSTD ostream& str) const wxOVERRIDE;
#endif
virtual bool Read(wxString& str);
virtual bool Write(wxString& str) const;
virtual bool Read(wxString& str) wxOVERRIDE;
virtual bool Write(wxString& str) const wxOVERRIDE;
#if wxUSE_STREAMS
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream& str) const;
#endif // wxUSE_STREAMS
virtual wxString GetType() const { return wxT("char"); }
wxVariantData* Clone() const { return new wxVariantDataChar(m_value); }
virtual wxString GetType() const wxOVERRIDE { return wxT("char"); }
wxVariantData* Clone() const wxOVERRIDE { return new wxVariantDataChar(m_value); }
DECLARE_WXANY_CONVERSION()
protected:
@@ -852,21 +852,21 @@ public:
inline wxString GetValue() const { return m_value; }
inline void SetValue(const wxString& value) { m_value = value; }
virtual bool Eq(wxVariantData& data) const;
virtual bool Eq(wxVariantData& data) const wxOVERRIDE;
#if wxUSE_STD_IOSTREAM
virtual bool Write(wxSTD ostream& str) const;
virtual bool Write(wxSTD ostream& str) const wxOVERRIDE;
#endif
virtual bool Read(wxString& str);
virtual bool Write(wxString& str) const;
virtual bool Read(wxString& str) wxOVERRIDE;
virtual bool Write(wxString& str) const wxOVERRIDE;
#if wxUSE_STD_IOSTREAM
virtual bool Read(wxSTD istream& WXUNUSED(str)) { return false; }
virtual bool Read(wxSTD istream& WXUNUSED(str)) wxOVERRIDE { return false; }
#endif
#if wxUSE_STREAMS
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream& str) const;
#endif // wxUSE_STREAMS
virtual wxString GetType() const { return wxT("string"); }
wxVariantData* Clone() const { return new wxVariantDataString(m_value); }
virtual wxString GetType() const wxOVERRIDE { return wxT("string"); }
wxVariantData* Clone() const wxOVERRIDE { return new wxVariantDataString(m_value); }
DECLARE_WXANY_CONVERSION()
protected:
@@ -1047,19 +1047,19 @@ public:
inline wxObject* GetValue() const { return m_value; }
inline void SetValue(wxObject* value) { m_value = value; }
virtual bool Eq(wxVariantData& data) const;
virtual bool Eq(wxVariantData& data) const wxOVERRIDE;
#if wxUSE_STD_IOSTREAM
virtual bool Write(wxSTD ostream& str) const;
virtual bool Write(wxSTD ostream& str) const wxOVERRIDE;
#endif
virtual bool Write(wxString& str) const;
virtual bool Write(wxString& str) const wxOVERRIDE;
#if wxUSE_STD_IOSTREAM
virtual bool Read(wxSTD istream& str);
virtual bool Read(wxSTD istream& str) wxOVERRIDE;
#endif
virtual bool Read(wxString& str);
virtual wxString GetType() const ;
virtual wxVariantData* Clone() const { return new wxVariantDataWxObjectPtr(m_value); }
virtual bool Read(wxString& str) wxOVERRIDE;
virtual wxString GetType() const wxOVERRIDE ;
virtual wxVariantData* Clone() const wxOVERRIDE { return new wxVariantDataWxObjectPtr(m_value); }
virtual wxClassInfo* GetValueClassInfo();
virtual wxClassInfo* GetValueClassInfo() wxOVERRIDE;
DECLARE_WXANY_CONVERSION()
protected:
@@ -1171,17 +1171,17 @@ public:
inline void* GetValue() const { return m_value; }
inline void SetValue(void* value) { m_value = value; }
virtual bool Eq(wxVariantData& data) const;
virtual bool Eq(wxVariantData& data) const wxOVERRIDE;
#if wxUSE_STD_IOSTREAM
virtual bool Write(wxSTD ostream& str) const;
virtual bool Write(wxSTD ostream& str) const wxOVERRIDE;
#endif
virtual bool Write(wxString& str) const;
virtual bool Write(wxString& str) const wxOVERRIDE;
#if wxUSE_STD_IOSTREAM
virtual bool Read(wxSTD istream& str);
virtual bool Read(wxSTD istream& str) wxOVERRIDE;
#endif
virtual bool Read(wxString& str);
virtual wxString GetType() const { return wxT("void*"); }
virtual wxVariantData* Clone() const { return new wxVariantDataVoidPtr(m_value); }
virtual bool Read(wxString& str) wxOVERRIDE;
virtual wxString GetType() const wxOVERRIDE { return wxT("void*"); }
virtual wxVariantData* Clone() const wxOVERRIDE { return new wxVariantDataVoidPtr(m_value); }
DECLARE_WXANY_CONVERSION()
protected:
@@ -1286,17 +1286,17 @@ public:
inline wxDateTime GetValue() const { return m_value; }
inline void SetValue(const wxDateTime& value) { m_value = value; }
virtual bool Eq(wxVariantData& data) const;
virtual bool Eq(wxVariantData& data) const wxOVERRIDE;
#if wxUSE_STD_IOSTREAM
virtual bool Write(wxSTD ostream& str) const;
virtual bool Write(wxSTD ostream& str) const wxOVERRIDE;
#endif
virtual bool Write(wxString& str) const;
virtual bool Write(wxString& str) const wxOVERRIDE;
#if wxUSE_STD_IOSTREAM
virtual bool Read(wxSTD istream& str);
virtual bool Read(wxSTD istream& str) wxOVERRIDE;
#endif
virtual bool Read(wxString& str);
virtual wxString GetType() const { return wxT("datetime"); }
virtual wxVariantData* Clone() const { return new wxVariantDataDateTime(m_value); }
virtual bool Read(wxString& str) wxOVERRIDE;
virtual wxString GetType() const wxOVERRIDE { return wxT("datetime"); }
virtual wxVariantData* Clone() const wxOVERRIDE { return new wxVariantDataDateTime(m_value); }
DECLARE_WXANY_CONVERSION()
protected:
@@ -1419,17 +1419,17 @@ public:
wxArrayString GetValue() const { return m_value; }
void SetValue(const wxArrayString& value) { m_value = value; }
virtual bool Eq(wxVariantData& data) const;
virtual bool Eq(wxVariantData& data) const wxOVERRIDE;
#if wxUSE_STD_IOSTREAM
virtual bool Write(wxSTD ostream& str) const;
virtual bool Write(wxSTD ostream& str) const wxOVERRIDE;
#endif
virtual bool Write(wxString& str) const;
virtual bool Write(wxString& str) const wxOVERRIDE;
#if wxUSE_STD_IOSTREAM
virtual bool Read(wxSTD istream& str);
virtual bool Read(wxSTD istream& str) wxOVERRIDE;
#endif
virtual bool Read(wxString& str);
virtual wxString GetType() const { return wxT("arrstring"); }
virtual wxVariantData* Clone() const { return new wxVariantDataArrayString(m_value); }
virtual bool Read(wxString& str) wxOVERRIDE;
virtual wxString GetType() const wxOVERRIDE { return wxT("arrstring"); }
virtual wxVariantData* Clone() const wxOVERRIDE { return new wxVariantDataArrayString(m_value); }
DECLARE_WXANY_CONVERSION()
protected:
@@ -1547,25 +1547,25 @@ public:
wxLongLong GetValue() const { return m_value; }
void SetValue(wxLongLong value) { m_value = value; }
virtual bool Eq(wxVariantData& data) const;
virtual bool Eq(wxVariantData& data) const wxOVERRIDE;
virtual bool Read(wxString& str);
virtual bool Write(wxString& str) const;
virtual bool Read(wxString& str) wxOVERRIDE;
virtual bool Write(wxString& str) const wxOVERRIDE;
#if wxUSE_STD_IOSTREAM
virtual bool Read(wxSTD istream& str);
virtual bool Write(wxSTD ostream& str) const;
virtual bool Read(wxSTD istream& str) wxOVERRIDE;
virtual bool Write(wxSTD ostream& str) const wxOVERRIDE;
#endif
#if wxUSE_STREAMS
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream &str) const;
#endif // wxUSE_STREAMS
wxVariantData* Clone() const
wxVariantData* Clone() const wxOVERRIDE
{
return new wxVariantDataLongLong(m_value);
}
virtual wxString GetType() const { return wxS("longlong"); }
virtual wxString GetType() const wxOVERRIDE { return wxS("longlong"); }
DECLARE_WXANY_CONVERSION()
protected:
@@ -1746,25 +1746,25 @@ public:
wxULongLong GetValue() const { return m_value; }
void SetValue(wxULongLong value) { m_value = value; }
virtual bool Eq(wxVariantData& data) const;
virtual bool Eq(wxVariantData& data) const wxOVERRIDE;
virtual bool Read(wxString& str);
virtual bool Write(wxString& str) const;
virtual bool Read(wxString& str) wxOVERRIDE;
virtual bool Write(wxString& str) const wxOVERRIDE;
#if wxUSE_STD_IOSTREAM
virtual bool Read(wxSTD istream& str);
virtual bool Write(wxSTD ostream& str) const;
virtual bool Read(wxSTD istream& str) wxOVERRIDE;
virtual bool Write(wxSTD ostream& str) const wxOVERRIDE;
#endif
#if wxUSE_STREAMS
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream &str) const;
#endif // wxUSE_STREAMS
wxVariantData* Clone() const
wxVariantData* Clone() const wxOVERRIDE
{
return new wxVariantDataULongLong(m_value);
}
virtual wxString GetType() const { return wxS("ulonglong"); }
virtual wxString GetType() const wxOVERRIDE { return wxS("ulonglong"); }
DECLARE_WXANY_CONVERSION()
protected:
@@ -1945,20 +1945,20 @@ public:
wxVariantList& GetValue() { return m_value; }
void SetValue(const wxVariantList& value) ;
virtual bool Eq(wxVariantData& data) const;
virtual bool Eq(wxVariantData& data) const wxOVERRIDE;
#if wxUSE_STD_IOSTREAM
virtual bool Write(wxSTD ostream& str) const;
virtual bool Write(wxSTD ostream& str) const wxOVERRIDE;
#endif
virtual bool Write(wxString& str) const;
virtual bool Write(wxString& str) const wxOVERRIDE;
#if wxUSE_STD_IOSTREAM
virtual bool Read(wxSTD istream& str);
virtual bool Read(wxSTD istream& str) wxOVERRIDE;
#endif
virtual bool Read(wxString& str);
virtual wxString GetType() const { return wxT("list"); }
virtual bool Read(wxString& str) wxOVERRIDE;
virtual wxString GetType() const wxOVERRIDE { return wxT("list"); }
void Clear();
wxVariantData* Clone() const { return new wxVariantDataList(m_value); }
wxVariantData* Clone() const wxOVERRIDE { return new wxVariantDataList(m_value); }
DECLARE_WXANY_CONVERSION()
protected: