ICU 64.2
64.2
|
C++ API: Common ICU base class UObject. More...
Go to the source code of this file.
Data Structures | |
class | icu::UMemory |
UMemory is the common ICU base class. More... | |
class | icu::UObject |
UObject is the common ICU "boilerplate" class. More... | |
Namespaces | |
icu | |
File coll.h. | |
Macros | |
#define | U_NO_THROW throw() |
Since ICU 64, use U_NOEXCEPT instead.More... | |
#define | UOBJECT_DEFINE_RTTI_IMPLEMENTATION(myClass) |
This is a simple macro to add ICU RTTI to an ICU object implementation. More... | |
#define | UOBJECT_DEFINE_ABSTRACT_RTTI_IMPLEMENTATION(myClass) |
This macro adds ICU RTTI to an ICU abstract class implementation. More... | |
Typedefs | |
typedef void * | UClassID |
UClassID is used to identify classes without using the compiler's RTTI. More... | |
C++ API: Common ICU base class UObject.
Definition in file uobject.h.
#define U_NO_THROW throw() |
Since ICU 64, use U_NOEXCEPT instead.
Previously, define this to define the throw() specification so certain functions do not throw any exceptions
UMemory operator new methods should have the throw() specification appended to them, so that the compiler adds the additional NULL check before calling constructors. Without, if operator new
returns NULL the constructor is still called, and if the constructor references member data, (which it typically does), the result is a segmentation violation.
#define UOBJECT_DEFINE_ABSTRACT_RTTI_IMPLEMENTATION | ( | myClass | ) |
This macro adds ICU RTTI to an ICU abstract class implementation.
This macro should be invoked in *.cpp files. The corresponding header should declare getStaticClassID.
myClass | The name of the class that needs RTTI defined. |
#define UOBJECT_DEFINE_RTTI_IMPLEMENTATION | ( | myClass | ) |
This is a simple macro to add ICU RTTI to an ICU object implementation.
This does not go into the header. This should only be used in *.cpp files.
myClass | The name of the class that needs RTTI defined. |
typedef void* UClassID |
UClassID is used to identify classes without using the compiler's RTTI.
This was used before C++ compilers consistently supported RTTI. ICU 4.6 requires compiler RTTI to be turned on.
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.
Each concrete class implements getStaticClassID() as well, which allows clients to test for a specific type.