ICU-2244 change internal classes to inherit UMemory, not UObject

X-SVN-Rev: 9970
This commit is contained in:
Markus Scherer 2002-10-04 19:27:01 +00:00
parent 990d64560c
commit c531727da2
20 changed files with 35 additions and 219 deletions

View File

@ -24,38 +24,19 @@
U_NAMESPACE_BEGIN
class CharSubstitutionFilter : public UObject, public LEGlyphFilter
class CharSubstitutionFilter : public UMemory, public LEGlyphFilter
{
private:
const LEFontInstance *fFontInstance;
/**
* The address of this static class variable serves as this class's ID
* for ICU "poor man's RTTI".
*/
static const char fgClassID;
CharSubstitutionFilter(const CharSubstitutionFilter &other); // forbid copying of this class
CharSubstitutionFilter &operator=(const CharSubstitutionFilter &other); // forbid copying of this class
public:
CharSubstitutionFilter(const LEFontInstance *fontInstance);
le_bool accept(LEGlyphID glyph) const;
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class.
*
* @draft ICU 2.2
*/
virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); }
/**
* ICU "poor man's RTTI", returns a UClassID for this class.
*
* @draft ICU 2.2
*/
static inline UClassID getStaticClassID() { return (UClassID)&fgClassID; }
};
const char CharSubstitutionFilter::fgClassID=0;
CharSubstitutionFilter::CharSubstitutionFilter(const LEFontInstance *fontInstance)
: fFontInstance(fontInstance)
{
@ -176,7 +157,7 @@ UnicodeArabicOpenTypeLayoutEngine::UnicodeArabicOpenTypeLayoutEngine(const LEFon
UnicodeArabicOpenTypeLayoutEngine::~UnicodeArabicOpenTypeLayoutEngine()
{
delete (CharSubstitutionFilter *)fSubstitutionFilter;
delete fSubstitutionFilter;
}
// "glyphs", "indices" -> glyphs, indices

View File

@ -12,8 +12,6 @@
U_NAMESPACE_BEGIN
const char GDEFMarkFilter::fgClassID=0;
GDEFMarkFilter::GDEFMarkFilter(const GlyphDefinitionTableHeader *gdefTable)
{
classDefTable = gdefTable->getGlyphClassDefinitionTable();

View File

@ -14,36 +14,19 @@
U_NAMESPACE_BEGIN
class GDEFMarkFilter : public UObject, public LEGlyphFilter
class GDEFMarkFilter : public UMemory, public LEGlyphFilter
{
private:
const GlyphClassDefinitionTable *classDefTable;
/**
* The address of this static class variable serves as this class's ID
* for ICU "poor man's RTTI".
*/
static const char fgClassID;
GDEFMarkFilter(const GDEFMarkFilter &other); // forbid copying of this class
GDEFMarkFilter &operator=(const GDEFMarkFilter &other); // forbid copying of this class
public:
GDEFMarkFilter(const GlyphDefinitionTableHeader *gdefTable);
virtual ~GDEFMarkFilter();
virtual le_bool accept(LEGlyphID glyph) const;
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class.
*
* @draft ICU 2.2
*/
virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); }
/**
* ICU "poor man's RTTI", returns a UClassID for this class.
*
* @draft ICU 2.2
*/
static inline UClassID getStaticClassID() { return (UClassID)&fgClassID; }
};
U_NAMESPACE_END

View File

@ -15,8 +15,6 @@
U_NAMESPACE_BEGIN
const char GlyphIterator::fgClassID=0;
GlyphIterator::GlyphIterator(LEGlyphID *theGlyphs, GlyphPositionAdjustment *theGlyphPositionAdjustments, le_int32 theGlyphCount,
le_bool rightToLeft, le_uint16 theLookupFlags, LETag theFeatureTag, const LETag *theGlyphTags[],
const GlyphDefinitionTableHeader *theGlyphDefinitionTableHeader)

View File

@ -16,7 +16,7 @@
U_NAMESPACE_BEGIN
class GlyphIterator : public UObject {
class GlyphIterator : public UMemory {
public:
GlyphIterator(LEGlyphID *theGlyphs, GlyphPositionAdjustment *theGlyphPositionAdjustments, le_int32 theGlyphCount,
le_bool rightToLeft, le_uint16 theLookupFlags, LETag theFeatureTag, const LETag *theGlyphTags[],
@ -65,20 +65,6 @@ public:
void adjustCursiveLastGlyphPositionAdjustment(float xPlacmentAdjust, float yPlacementAdjust,
float xAdvanceAdjust, float yAdvanceAdjust);
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class.
*
* @draft ICU 2.2
*/
virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); }
/**
* ICU "poor man's RTTI", returns a UClassID for this class.
*
* @draft ICU 2.2
*/
static inline UClassID getStaticClassID() { return (UClassID)&fgClassID; }
private:
GlyphIterator();
le_bool filterGlyph(le_uint32 index) const;
@ -102,11 +88,7 @@ private:
const GlyphClassDefinitionTable *glyphClassDefinitionTable;
const MarkAttachClassDefinitionTable *markAttachClassDefinitionTable;
/**
* The address of this static class variable serves as this class's ID
* for ICU "poor man's RTTI".
*/
static const char fgClassID;
GlyphIterator &operator=(const GlyphIterator &other); // forbid copying of this class
};
U_NAMESPACE_END

View File

@ -13,7 +13,7 @@
U_NAMESPACE_BEGIN
class GlyphPositionAdjustment : public UObject {
class GlyphPositionAdjustment : public UMemory {
public:
GlyphPositionAdjustment();
@ -39,20 +39,6 @@ public:
void adjustXAdvance(float xAdjustment);
void adjustYAdvance(float yAdjustment);
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class.
*
* @draft ICU 2.2
*/
virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); }
/**
* ICU "poor man's RTTI", returns a UClassID for this class.
*
* @draft ICU 2.2
*/
static inline UClassID getStaticClassID() { return (UClassID)&fgClassID; }
private:
float xPlacement;
float yPlacement;
@ -61,11 +47,7 @@ private:
le_int32 baseOffset;
/**
* The address of this static class variable serves as this class's ID
* for ICU "poor man's RTTI".
*/
static const char fgClassID;
// allow copying of this class because all of its fields are simple types
};
inline GlyphPositionAdjustment::GlyphPositionAdjustment()

View File

@ -16,8 +16,6 @@
U_NAMESPACE_BEGIN
const char GlyphPositionAdjustment::fgClassID=0;
void GlyphPositioningTableHeader::process(LEGlyphID *glyphs, GlyphPositionAdjustment *glyphPositionAdjustments,
const LETag **glyphTags, le_int32 glyphCount, le_bool rightToLeft,
LETag scriptTag, LETag languageTag,

View File

@ -32,8 +32,6 @@ U_NAMESPACE_BEGIN
typedef ContextualSubstitutionSubtable ContextualPositioningSubtable;
typedef ChainingContextualSubstitutionSubtable ChainingContextualPositioningSubtable;
const char GlyphPositioningLookupProcessor::fgClassID=0;
GlyphPositioningLookupProcessor::GlyphPositioningLookupProcessor(
const GlyphPositioningTableHeader *glyphPositioningTableHeader,
LETag scriptTag, LETag languageTag, const LETag *featureOrder)

View File

@ -31,30 +31,13 @@ public:
virtual le_uint32 applySubtable(const LookupSubtable *lookupSubtable, le_uint16 lookupType, GlyphIterator *glyphIterator,
const LEFontInstance *fontInstance) const;
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class.
*
* @draft ICU 2.2
*/
virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); }
/**
* ICU "poor man's RTTI", returns a UClassID for this class.
*
* @draft ICU 2.2
*/
static inline UClassID getStaticClassID() { return (UClassID)&fgClassID; }
protected:
GlyphPositioningLookupProcessor();
private:
/**
* The address of this static class variable serves as this class's ID
* for ICU "poor man's RTTI".
*/
static const char fgClassID;
GlyphPositioningLookupProcessor(const GlyphPositioningLookupProcessor &other); // forbid copying of this class
GlyphPositioningLookupProcessor &operator=(const GlyphPositioningLookupProcessor &other); // forbid copying of this class
};
U_NAMESPACE_END

View File

@ -25,8 +25,6 @@
U_NAMESPACE_BEGIN
const char GlyphSubstitutionLookupProcessor::fgClassID=0;
GlyphSubstitutionLookupProcessor::GlyphSubstitutionLookupProcessor(
const GlyphSubstitutionTableHeader *glyphSubstitutionTableHeader,
LETag scriptTag, LETag languageTag, const LEGlyphFilter *filter, const LETag *featureOrder)

View File

@ -32,31 +32,14 @@ public:
virtual le_uint32 applySubtable(const LookupSubtable *lookupSubtable, le_uint16 lookupType, GlyphIterator *glyphIterator,
const LEFontInstance *fontInstance) const;
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class.
*
* @draft ICU 2.2
*/
virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); }
/**
* ICU "poor man's RTTI", returns a UClassID for this class.
*
* @draft ICU 2.2
*/
static inline UClassID getStaticClassID() { return (UClassID)&fgClassID; }
protected:
GlyphSubstitutionLookupProcessor();
private:
const LEGlyphFilter *fFilter;
/**
* The address of this static class variable serves as this class's ID
* for ICU "poor man's RTTI".
*/
static const char fgClassID;
GlyphSubstitutionLookupProcessor(const GlyphSubstitutionLookupProcessor &other); // forbid copying of this class
GlyphSubstitutionLookupProcessor &operator=(const GlyphSubstitutionLookupProcessor &other); // forbid copying of this class
};
U_NAMESPACE_END

View File

@ -12,7 +12,7 @@
U_NAMESPACE_BEGIN
class ReorderingOutput : public UObject {
class ReorderingOutput : public UMemory {
private:
le_int32 fOutIndex;
@ -44,11 +44,8 @@ private:
}
}
/**
* The address of this static class variable serves as this class's ID
* for ICU "poor man's RTTI".
*/
static const char fgClassID;
ReorderingOutput(const ReorderingOutput &other); // forbid copying of this class
ReorderingOutput &operator=(const ReorderingOutput &other); // forbid copying of this class
public:
ReorderingOutput(LEUnicode *outChars, le_int32 *charIndices, const LETag **charTags)
@ -137,24 +134,8 @@ public:
{
return fOutIndex;
}
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class.
*
* @draft ICU 2.2
*/
virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); }
/**
* ICU "poor man's RTTI", returns a UClassID for this class.
*
* @draft ICU 2.2
*/
static inline UClassID getStaticClassID() { return (UClassID)&fgClassID; }
};
const char ReorderingOutput::fgClassID=0;
enum
{
C_DOTTED_CIRCLE = 0x25CC

View File

@ -19,8 +19,6 @@
U_NAMESPACE_BEGIN
const char LookupProcessor::fgClassID=0;
const LETag LookupProcessor::notSelected = 0x00000000;
const LETag LookupProcessor::defaultFeature = 0xFFFFFFFF;

View File

@ -19,7 +19,7 @@
U_NAMESPACE_BEGIN
class LookupProcessor : public UObject {
class LookupProcessor : public UMemory {
public:
static const LETag notSelected;
static const LETag defaultFeature;
@ -36,20 +36,6 @@ public:
virtual ~LookupProcessor();
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class.
*
* @draft ICU 2.2
*/
virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); }
/**
* ICU "poor man's RTTI", returns a UClassID for this class.
*
* @draft ICU 2.2
*/
static inline UClassID getStaticClassID() { return (UClassID)&fgClassID; }
protected:
LookupProcessor(const char *baseAddress,
Offset scriptListOffset, Offset featureListOffset, Offset lookupListOffset,
@ -70,11 +56,8 @@ protected:
private:
/**
* The address of this static class variable serves as this class's ID
* for ICU "poor man's RTTI".
*/
static const char fgClassID;
LookupProcessor(const LookupProcessor &other); // forbid copying of this class
LookupProcessor &operator=(const LookupProcessor &other); // forbid copying of this class
};
U_NAMESPACE_END

View File

@ -27,6 +27,10 @@ protected:
NonContextualGlyphSubstitutionProcessor(const MorphSubtableHeader *morphSubtableHeader);
virtual ~NonContextualGlyphSubstitutionProcessor();
private:
NonContextualGlyphSubstitutionProcessor(const NonContextualGlyphSubstitutionProcessor &other); // forbid copying of this class
NonContextualGlyphSubstitutionProcessor &operator=(const NonContextualGlyphSubstitutionProcessor &other); // forbid copying of this class
};
U_NAMESPACE_END

View File

@ -43,6 +43,10 @@ protected:
le_int16 lastGlyph;
const MorphStateTableHeader *stateTableHeader;
private:
StateTableProcessor(const StateTableProcessor &other); // forbid copying of this class
StateTableProcessor &operator=(const StateTableProcessor &other); // forbid copying of this class
};
U_NAMESPACE_END

View File

@ -12,8 +12,6 @@
U_NAMESPACE_BEGIN
const char SubtableProcessor::fgClassID=0;
SubtableProcessor::SubtableProcessor()
{
}

View File

@ -13,25 +13,11 @@
U_NAMESPACE_BEGIN
class SubtableProcessor : public UObject {
class SubtableProcessor : public UMemory {
public:
virtual void process(LEGlyphID *glyphs, le_int32 *charIndices, le_int32 glyph) = 0;
virtual ~SubtableProcessor();
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class.
*
* @draft ICU 2.2
*/
virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); }
/**
* ICU "poor man's RTTI", returns a UClassID for this class.
*
* @draft ICU 2.2
*/
static inline UClassID getStaticClassID() { return (UClassID)&fgClassID; }
protected:
SubtableProcessor(const MorphSubtableHeader *morphSubtableHeader);
@ -45,11 +31,8 @@ protected:
private:
/**
* The address of this static class variable serves as this class's ID
* for ICU "poor man's RTTI".
*/
static const char fgClassID;
SubtableProcessor(const SubtableProcessor &other); // forbid copying of this class
SubtableProcessor &operator=(const SubtableProcessor &other); // forbid copying of this class
};
U_NAMESPACE_END

View File

@ -302,8 +302,6 @@ le_int32 ThaiShaping::compose(const LEUnicode *input, le_int32 offset, le_int32
return outputIndex;
}
const char ThaiMarkFilter::fgClassID=0;
ThaiMarkFilter::ThaiMarkFilter(le_uint8 glyphSet)
: rangeList(NULL)
{

View File

@ -14,7 +14,7 @@
U_NAMESPACE_BEGIN
class ThaiMarkFilter : public UObject, public LEGlyphFilter
class ThaiMarkFilter : public UMemory, public LEGlyphFilter
{
private:
struct MarkRange
@ -25,31 +25,14 @@ private:
MarkRange *rangeList;
/**
* The address of this static class variable serves as this class's ID
* for ICU "poor man's RTTI".
*/
static const char fgClassID;
ThaiMarkFilter(const ThaiMarkFilter &other); // forbid copying of this class
ThaiMarkFilter &operator=(const ThaiMarkFilter &other); // forbid copying of this class
public:
ThaiMarkFilter(le_uint8 glyphSet);
~ThaiMarkFilter();
virtual le_bool filter(LEGlyphID glyph);
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class.
*
* @draft ICU 2.2
*/
virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); }
/**
* ICU "poor man's RTTI", returns a UClassID for this class.
*
* @draft ICU 2.2
*/
static inline UClassID getStaticClassID() { return (UClassID)&fgClassID; }
};
class ThaiShaping /* not : public UObject because all methods are static */ {