UClassID is used to identify classes without using RTTI, since RTTI is not yet supported by all C++ compilers. Each class hierarchy which needs to implement polymorphic clone() or operator==() defines two methods, described in detail below. UClassID values can be compared using operator==(). Nothing else should be done with them.
class Base { public: virtual UClassID getDynamicClassID() const = 0; } class Derived { public: virtual UClassID getDynamicClassID() const { return Derived::getStaticClassID(); } } Each concrete class implements getStaticClassID() as well, which allows clients to test for a specific type. ICU 2.0
|