#include <wx/object.h>

It declares a virtual destructor which ensures that destructors get called for all derived class objects where necessary.
wxObject is the hub of a dynamic object creation scheme, enabling a program to create instances of a class only knowing its string class name, and to query the class hierarchy.
The class contains optional debugging versions of new and delete, which can help trace memory allocation and deallocation problems.
wxObject can be used to implement reference counted objects, such as wxPen, wxBitmap and others (see this list).
Public Member Functions | |
| wxObject () | |
| wxObject (const wxObject &other) | |
| wxObject () | |
| void | Dump (ostream &stream) |
| wxClassInfo * | GetClassInfo () |
| wxObjectRefData * | GetRefData () const |
| bool | IsKindOf (wxClassInfo *info) |
| bool | IsSameAs (const wxObject &obj) |
| void | Ref (const wxObject &clone) |
| void | SetRefData (wxObjectRefData *data) |
| void | UnRef () |
| void | UnShare () |
| void | operator delete (void *buf) |
| void * | operator new (size_t size, const wxString &filename=NULL, int lineNum=0) |
Protected Attributes | |
| wxObjectRefData * | m_refData |
| wxObject::wxObject | ( | ) |
| wxObject::wxObject | ( | const wxObject & | other | ) |
Copy ctor.
| wxObject::wxObject | ( | ) |
Destructor.
Performs dereferencing, for those objects that use reference counting.
| void wxObject::Dump | ( | ostream & | stream | ) |
A virtual function that may be redefined by derived classes to allow dumping of memory states.
This function is only defined in debug build and exists only if __WXDEBUG__ is defined.
| stream | Stream on which to output dump information. |
| wxClassInfo* wxObject::GetClassInfo | ( | ) |
This virtual function is redefined for every class that requires run-time type information, when using the DECLARE_CLASS macro (or similar).
| wxObjectRefData* wxObject::GetRefData | ( | ) | const |
Returns the wxObject::m_refData pointer, i.e. the data referenced by this object.
| bool wxObject::IsKindOf | ( | wxClassInfo * | info | ) |
Determines whether this class is a subclass of (or the same class as) the given class.
Example:
| info | A pointer to a class information object, which may be obtained by using the CLASSINFO macro. |
| bool wxObject::IsSameAs | ( | const wxObject & | obj | ) |
Returns true if this object has the same data pointer as obj.
Notice that true is returned if the data pointers are NULL in both objects.
This function only does a shallow comparison, i.e. it doesn't compare the objects pointed to by the data pointers of these objects.
| void wxObject::Ref | ( | const wxObject & | clone | ) |
Makes this object refer to the data in clone.
| clone | The object to 'clone'. |
| void wxObject::SetRefData | ( | wxObjectRefData * | data | ) |
| void wxObject::UnRef | ( | ) |
Decrements the reference count in the associated data, and if it is zero, deletes the data.
The wxObject::m_refData member is set to NULL.
| void wxObject::UnShare | ( | ) |
Ensure that this object's data is not shared with any other object.
If we have no data, it is created using CreateRefData() below, if we have shared data, it is copied using CloneRefData(), otherwise nothing is done.
| void wxObject::operator delete | ( | void * | buf | ) |
The delete operator is defined for debugging versions of the library only, when the identifier __WXDEBUG__ is defined.
It takes over memory deallocation, allowing wxDebugContext operations.
| void* wxObject::operator new | ( | size_t | size, | |
| const wxString & | filename = NULL, |
|||
| int | lineNum = 0 | |||
| ) |
The new operator is defined for debugging versions of the library only, when the identifier __WXDEBUG__ is defined.
It takes over memory allocation, allowing wxDebugContext operations.
wxObjectRefData* wxObject::m_refData [protected] |
Pointer to an object which is the object's reference-counted data.
|
[ top ] |