some const correctness for wxClassInfo
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9799 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -52,42 +52,47 @@ typedef wxObject * (*wxObjectConstructorFn) (void);
|
|||||||
|
|
||||||
class WXDLLEXPORT wxClassInfo
|
class WXDLLEXPORT wxClassInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxClassInfo(wxChar *cName, wxChar *baseName1, wxChar *baseName2, int sz, wxObjectConstructorFn fn);
|
wxClassInfo(const wxChar *cName,
|
||||||
|
const wxChar *baseName1,
|
||||||
|
const wxChar *baseName2,
|
||||||
|
int sz,
|
||||||
|
wxObjectConstructorFn fn);
|
||||||
|
|
||||||
wxObject *CreateObject(void);
|
wxObject *CreateObject(void);
|
||||||
|
|
||||||
inline wxChar *GetClassName(void) const { return m_className; }
|
const wxChar *GetClassName() const { return m_className; }
|
||||||
inline wxChar *GetBaseClassName1(void) const { return m_baseClassName1; }
|
const wxChar *GetBaseClassName1() const { return m_baseClassName1; }
|
||||||
inline wxChar *GetBaseClassName2(void) const { return m_baseClassName2; }
|
const wxChar *GetBaseClassName2() const { return m_baseClassName2; }
|
||||||
inline wxClassInfo* GetBaseClass1() const { return m_baseInfo1; }
|
const wxClassInfo* GetBaseClass1() const { return m_baseInfo1; }
|
||||||
inline wxClassInfo* GetBaseClass2() const { return m_baseInfo2; }
|
const wxClassInfo* GetBaseClass2() const { return m_baseInfo2; }
|
||||||
inline int GetSize(void) const { return m_objectSize; }
|
int GetSize() const { return m_objectSize; }
|
||||||
inline wxObjectConstructorFn GetConstructor() const { return m_objectConstructor; }
|
wxObjectConstructorFn GetConstructor() const { return m_objectConstructor; }
|
||||||
static inline wxClassInfo* GetFirst() { return sm_first; }
|
static const wxClassInfo* GetFirst() { return sm_first; }
|
||||||
inline wxClassInfo* GetNext() const { return m_next; }
|
const wxClassInfo* GetNext() const { return m_next; }
|
||||||
bool IsKindOf(wxClassInfo *info) const;
|
bool IsKindOf(const wxClassInfo *info) const;
|
||||||
|
|
||||||
static wxClassInfo *FindClass(wxChar *c);
|
static wxClassInfo *FindClass(const wxChar *c);
|
||||||
|
|
||||||
// Initializes parent pointers and hash table for fast searching.
|
// Initializes parent pointers and hash table for fast searching.
|
||||||
static void InitializeClasses(void);
|
static void InitializeClasses();
|
||||||
|
|
||||||
// Cleans up hash table used for fast searching.
|
// Cleans up hash table used for fast searching.
|
||||||
static void CleanUpClasses(void);
|
static void CleanUpClasses();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxChar* m_className;
|
const wxChar* m_className;
|
||||||
wxChar* m_baseClassName1;
|
const wxChar* m_baseClassName1;
|
||||||
wxChar* m_baseClassName2;
|
const wxChar* m_baseClassName2;
|
||||||
int m_objectSize;
|
int m_objectSize;
|
||||||
wxObjectConstructorFn m_objectConstructor;
|
wxObjectConstructorFn m_objectConstructor;
|
||||||
|
|
||||||
// Pointers to base wxClassInfos: set in InitializeClasses
|
// Pointers to base wxClassInfos: set in InitializeClasses
|
||||||
// called from wx_main.cc
|
const wxClassInfo* m_baseInfo1;
|
||||||
wxClassInfo* m_baseInfo1;
|
const wxClassInfo* m_baseInfo2;
|
||||||
wxClassInfo* m_baseInfo2;
|
|
||||||
|
|
||||||
|
// class info object live in a linked list: pointers to its head and the
|
||||||
|
// next element in it
|
||||||
static wxClassInfo* sm_first;
|
static wxClassInfo* sm_first;
|
||||||
wxClassInfo* m_next;
|
wxClassInfo* m_next;
|
||||||
|
|
||||||
@@ -115,7 +120,6 @@ WXDLLEXPORT wxObject* wxCreateStoredObject( wxInputStream& stream );
|
|||||||
|
|
||||||
// Single inheritance with one base class
|
// Single inheritance with one base class
|
||||||
#define IMPLEMENT_DYNAMIC_CLASS(name, basename) \
|
#define IMPLEMENT_DYNAMIC_CLASS(name, basename) \
|
||||||
wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void); \
|
|
||||||
wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \
|
wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \
|
||||||
{ return new name; }\
|
{ return new name; }\
|
||||||
wxClassInfo name::sm_class##name((wxChar *) wxT(#name), (wxChar *) wxT(#basename), (wxChar *) NULL, (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name);
|
wxClassInfo name::sm_class##name((wxChar *) wxT(#name), (wxChar *) wxT(#basename), (wxChar *) NULL, (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name);
|
||||||
@@ -215,15 +219,7 @@ class WXDLLEXPORT wxObject
|
|||||||
|
|
||||||
#if defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING
|
#if defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING
|
||||||
void * operator new (size_t size, wxChar * fileName = NULL, int lineNum = 0);
|
void * operator new (size_t size, wxChar * fileName = NULL, int lineNum = 0);
|
||||||
|
|
||||||
#if defined(__VISAGECPP__)
|
|
||||||
#if __DEBUG_ALLOC__
|
|
||||||
void operator delete (void * buf,const char * _fname, size_t _line);
|
|
||||||
#endif //__DEBUG_ALLOC__
|
|
||||||
#else
|
|
||||||
void operator delete (void * buf);
|
void operator delete (void * buf);
|
||||||
#endif
|
|
||||||
// defined(__VISAGECPP__)
|
|
||||||
|
|
||||||
// VC++ 6.0
|
// VC++ 6.0
|
||||||
#if defined(__VISUALC__) && (__VISUALC__ >= 1200)
|
#if defined(__VISUALC__) && (__VISUALC__ >= 1200)
|
||||||
@@ -262,14 +258,6 @@ class WXDLLEXPORT wxObject
|
|||||||
inline wxObjectRefData *GetRefData(void) const { return m_refData; }
|
inline wxObjectRefData *GetRefData(void) const { return m_refData; }
|
||||||
inline void SetRefData(wxObjectRefData *data) { m_refData = data; }
|
inline void SetRefData(wxObjectRefData *data) { m_refData = data; }
|
||||||
|
|
||||||
//EK
|
|
||||||
#if defined(__WXDEBUG__) && defined(__VISAGECPP__)
|
|
||||||
public:
|
|
||||||
static int N;
|
|
||||||
static int Nid; // total number of objects and serial counter
|
|
||||||
int id; // serial number for current object
|
|
||||||
#endif // __WXDEBUG__
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxObjectRefData* m_refData;
|
wxObjectRefData* m_refData;
|
||||||
#if wxUSE_SERIAL
|
#if wxUSE_SERIAL
|
||||||
|
Reference in New Issue
Block a user