Table Of Contents

Previous topic

NotifyEvent

Next topic

OperatingSystemId

This Page

phoenix_title Object

This is the root class of many of the wxWidgets classes.

It declares a virtual destructor which ensures that destructors get called for all derived class objects where necessary.

Object 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.

Object can be used to implement reference counted objects, such as Pen, Bitmap and others (see this list). See RefCounter and Reference Counting for more info about reference counting.

See also

ClassInfo, Reference Counting, ObjectDataRef, ObjectDataPtr


class_hierarchy Inheritance Diagram

Inheritance diagram for class Object

Inheritance diagram of Object


sub_classes Known Subclasses

AcceleratorTable, Accessible, ArchiveClassFactory, ArchiveEntry, ArtProvider, AutomationObject, BitmapHandler, Client, Clipboard, Colour, ColourData, Command, CommandProcessor, ConfigBase, Connection, ConnectionBase, ContextHelp, DataViewIconText, DataViewRenderer, DC, DDEClient, DocTemplate, DragImage, EncodingConverter, Event, EvtHandler, FileHistory, FileSystem, FileSystemHandler, FilterClassFactory, FindReplaceData, FontData, FSFile, GDIObject, GLContext, GraphicsObject, GraphicsRenderer, GridTableBase, HashTable, HelpControllerBase, HtmlCell, HtmlDCRenderer, HtmlEasyPrinting, HtmlFilter, HtmlHelpData, HtmlLinkInfo, HtmlTagHandler, Image, ImageHandler, ImageList, IndividualLayoutConstraint, Joystick, LayoutAlgorithm, LayoutConstraints, ListItem, Mask, MenuItem, Metafile, Module, PageSetupDialog, PageSetupDialogData, PGCell, PGEditor, PGProperty, PrintData, PrintDialog, PrintDialogData, Printer, Printout, PrintPreview, Quantize, RegionIterator, RichTextAction, RichTextDrawingContext, RichTextDrawingHandler, RichTextFieldType, RichTextFileHandler, RichTextFontTable, RichTextFormattingDialogFactory, RichTextHeaderFooterData, RichTextImageBlock, RichTextObject, RichTextPrinting, RichTextProperties, RichTextRenderer, RichTextStyleDefinition, RichTextStyleSheet, Sizer, SizerItem, SockAddress, SocketBase, Sound, StringTokenizer, SystemOptions, SystemSettings, TCPClient, TCPConnection, TCPServer, ToolBarToolBase, ToolTip, URI, Variant, XmlDocument, XmlResource, XmlResourceHandler


method_summary Methods Summary

__init__ Default constructor; initializes to None the internal reference data.
Destroy Deletes the C++ object this Python object is a proxy for.
GetClassName Returns the class name of the C++ class using RTTI.
GetRefData Returns the Object.m_refData pointer, i.e.
IsSameAs Returns True if this object has the same data pointer as obj.
Ref Makes this object refer to the data in clone.
SetRefData Sets the Object.m_refData pointer.
UnRef Decrements the reference count in the associated data, and if it is zero, deletes the data.
UnShare This is the same of AllocExclusive but this method is public.

property_summary Properties Summary

ClassName See GetClassName
RefData See GetRefData and SetRefData

api Class API



class Object(object)

This is the root class of many of the wxWidgets classes.

Possible constructors:

Object()

Object(other)

Methods



__init__(self, *args, **kw)

overload Overloaded Implementations:



__init__ (self)

Default constructor; initializes to None the internal reference data.



__init__ (self, other)

Copy constructor.

Sets the internal Object.m_refData pointer to point to the same instance of the ObjectRefData-derived class pointed by other and increments the refcount of Object.m_refData.

Parameters:other (Object) –





Destroy(self)

Deletes the C++ object this Python object is a proxy for.



GetClassName(self)

Returns the class name of the C++ class using RTTI.

Return type:string


GetRefData(self)

Returns the Object.m_refData pointer, i.e.

the data referenced by this object.

Return type:ObjectRefData

See also

Ref , UnRef , Object.m_refData, SetRefData , ObjectRefData



IsSameAs(self, obj)

Returns True if this object has the same data pointer as obj.

Notice that True is returned if the data pointers are None 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.

Parameters:obj (Object) –
Return type:bool


Ref(self, clone)

Makes this object refer to the data in clone.

Parameters:clone (Object) – The object to ‘clone’.

Note

First this function calls UnRef on itself to decrement (and perhaps free) the data it is currently referring to. It then sets its own Object.m_refData to point to that of clone, and increments the reference count inside the data.

See also

UnRef , SetRefData , GetRefData , ObjectRefData



SetRefData(self, data)

Sets the Object.m_refData pointer.

Parameters:data (ObjectRefData) –

See also

Ref , UnRef , GetRefData , ObjectRefData



UnRef(self)

Decrements the reference count in the associated data, and if it is zero, deletes the data.

The Object.m_refData member is set to None.

See also

Ref , SetRefData , GetRefData , ObjectRefData



UnShare(self)

This is the same of AllocExclusive but this method is public.


Properties



ClassName

See GetClassName



RefData

See GetRefData and SetRefData