a2dIdBase Class Reference
[base classes used for many others]

A class for id's of various kinds. More...

#include <id.h>

Inheritance diagram for a2dIdBase:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual wxString GetIdClassName ()


Detailed Description

A class for id's of various kinds.

a2dIdBase is used in situations, where traditionally an enumeration type is used. The disadvantage of an enumeration is, that it cannot easily be expanded by derived classes. If this would be done, all derived classes would share the same id range and would have to know each other. a2dIdBase solves this. Instead of a enum value, a distinct a2dIdBase object is used for identification. The identification is usually done by address. The a2dIdBase objects are generally static members of a class of global variables, so that they are accessable by all objects requiring the id. A a2dIdBase should always be derived of, so that different ID classes cannot be inadvertedly intermixed. A a2dIdBase cannot easily be serialized, because the address will change. To do this, it must be converted to a string form. Derived classes will have ways to do this. Another way to have unique IDs is to use wxNewId. The advantage of a2dIdBase is, that it can be extended to be serialized and that it need not be initialized.

Definition at line 59 of file id.h.


The documentation for this class was generated from the following file:
a2dIdBase Class Reference -- Tue Aug 31 18:28:09 2010 -- 31 Aug 2010 -- 1.5.5 -- wxArt2D -- . -- Main Page Reference Documentation