ICU-2244 change SymbolTable subclasses to inherit both UObject or UMemory _and_ SymbolTable because SymbolTable is an interface/mixin class; UMemory is sufficient for internal classes

X-SVN-Rev: 9964
This commit is contained in:
Markus Scherer 2002-10-04 17:30:36 +00:00
parent 043d14576c
commit bedf26bf18
3 changed files with 6 additions and 48 deletions

View file

@ -52,7 +52,7 @@ private:
};
class RBBISymbolTable : public SymbolTable {
class RBBISymbolTable : public UMemory, public SymbolTable {
private:
const UnicodeString &fRules;
UHashtable *fHashTable;
@ -80,27 +80,9 @@ public:
virtual void print() 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; }
private:
/**
* The address of this static class variable serves as this class's ID
* for ICU "poor man's RTTI".
*/
static const char fgClassID;
RBBISymbolTable(const RBBISymbolTable &other); // forbid copying of this class
RBBISymbolTable &operator=(const RBBISymbolTable &other); // forbid copying of this class
};

View file

@ -38,10 +38,6 @@ U_CDECL_END
U_NAMESPACE_BEGIN
const char RBBISymbolTable::fgClassID=0;
RBBISymbolTable::RBBISymbolTable(RBBIRuleScanner *rs, const UnicodeString &rules, UErrorCode &status)
:fRules(rules), fRuleScanner(rs), ffffString(UChar(0xffff))
{

View file

@ -106,7 +106,7 @@ U_NAMESPACE_BEGIN
* have been defined so far. Note that it uses variablesVector,
* _not_ data.setVariables.
*/
class ParseData : public SymbolTable {
class ParseData : public UMemory, public SymbolTable {
public:
const TransliterationRuleData* data; // alias
@ -133,31 +133,11 @@ public:
*/
UBool isReplacer(UChar32 ch);
/**
* 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:
/**
* The address of this static class variable serves as this class's ID
* for ICU "poor man's RTTI".
*/
static const char fgClassID;
ParseData(const ParseData &other); // forbid copying of this class
ParseData &operator=(const ParseData &other); // forbid copying of this class
};
const char ParseData::fgClassID=0;
ParseData::ParseData(const TransliterationRuleData* d,
const UVector* sets) :
data(d), variablesVector(sets) {}