mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 14:31:31 +00:00
ICU-2244 change internal classes to inherit UMemory, not UObject
X-SVN-Rev: 9967
This commit is contained in:
parent
2385580041
commit
a3adeb8632
8 changed files with 14 additions and 119 deletions
|
@ -20,10 +20,8 @@
|
|||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
const char TransliterationRuleData::fgClassID=0;
|
||||
|
||||
TransliterationRuleData::TransliterationRuleData(UErrorCode& status)
|
||||
: UObject(), ruleSet(status),
|
||||
: UMemory(), ruleSet(status),
|
||||
variableNames(0), variables(0)
|
||||
{
|
||||
if (U_FAILURE(status)) {
|
||||
|
@ -43,7 +41,7 @@ TransliterationRuleData::TransliterationRuleData(UErrorCode& status)
|
|||
}
|
||||
|
||||
TransliterationRuleData::TransliterationRuleData(const TransliterationRuleData& other) :
|
||||
UObject(other), ruleSet(other.ruleSet),
|
||||
UMemory(other), ruleSet(other.ruleSet),
|
||||
variablesBase(other.variablesBase),
|
||||
variablesLength(other.variablesLength)
|
||||
{
|
||||
|
|
|
@ -40,7 +40,7 @@ class Hashtable;
|
|||
* data structure handles this. See the parsing code for more
|
||||
* details.
|
||||
*/
|
||||
class U_I18N_API TransliterationRuleData : public UObject {
|
||||
class U_I18N_API TransliterationRuleData : public UMemory {
|
||||
|
||||
public:
|
||||
|
||||
|
@ -129,27 +129,8 @@ public:
|
|||
*/
|
||||
UnicodeReplacer* lookupReplacer(UChar32 standIn) 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;
|
||||
TransliterationRuleData &operator=(const TransliterationRuleData &other); // forbid copying of this class
|
||||
};
|
||||
|
||||
U_NAMESPACE_END
|
||||
|
|
|
@ -224,7 +224,7 @@ UBool ParseData::isReplacer(UChar32 ch) {
|
|||
* parse half of a rule. It is tightly coupled to the method
|
||||
* RuleBasedTransliterator.Parser.parseRule().
|
||||
*/
|
||||
class RuleHalf : public UObject {
|
||||
class RuleHalf : public UMemory {
|
||||
|
||||
public:
|
||||
|
||||
|
@ -298,34 +298,12 @@ public:
|
|||
return parser.syntaxError(code, rule, start);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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:
|
||||
// Disallowed methods; no impl.
|
||||
RuleHalf(const RuleHalf&);
|
||||
RuleHalf& operator=(const RuleHalf&);
|
||||
|
||||
/**
|
||||
* The address of this static class variable serves as this class's ID
|
||||
* for ICU "poor man's RTTI".
|
||||
*/
|
||||
static const char fgClassID;
|
||||
};
|
||||
|
||||
const char RuleHalf::fgClassID=0;
|
||||
|
||||
RuleHalf::RuleHalf(TransliteratorParser& p) :
|
||||
ec(U_ZERO_ERROR),
|
||||
parser(p)
|
||||
|
@ -797,8 +775,6 @@ UBool RuleHalf::isValidInput(TransliteratorParser& transParser) {
|
|||
// PUBLIC API
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
const char TransliteratorParser::fgClassID=0;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
|
|
|
@ -27,7 +27,7 @@ class ParsePosition;
|
|||
class UVector;
|
||||
class StringMatcher;
|
||||
|
||||
class TransliteratorParser : public UObject {
|
||||
class TransliteratorParser : public UMemory {
|
||||
|
||||
public:
|
||||
|
||||
|
@ -182,20 +182,6 @@ public:
|
|||
*/
|
||||
TransliterationRuleData* orphanData();
|
||||
|
||||
/**
|
||||
* 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:
|
||||
|
||||
/**
|
||||
|
@ -354,12 +340,6 @@ private:
|
|||
* Assignment operator
|
||||
*/
|
||||
TransliteratorParser& operator=(const TransliteratorParser&);
|
||||
|
||||
/**
|
||||
* The address of this static class variable serves as this class's ID
|
||||
* for ICU "poor man's RTTI".
|
||||
*/
|
||||
static const char fgClassID;
|
||||
};
|
||||
|
||||
U_NAMESPACE_END
|
||||
|
|
|
@ -26,8 +26,6 @@ static const UChar FORWARD_OP[] = {32,62,32,0}; // " > "
|
|||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
const char TransliterationRule::fgClassID=0;
|
||||
|
||||
/**
|
||||
* Construct a new rule with the given input, output text, and other
|
||||
* attributes. A cursor position may be specified for the output text.
|
||||
|
@ -62,7 +60,7 @@ TransliterationRule::TransliterationRule(const UnicodeString& input,
|
|||
UBool anchorStart, UBool anchorEnd,
|
||||
const TransliterationRuleData* theData,
|
||||
UErrorCode& status) :
|
||||
UObject(),
|
||||
UMemory(),
|
||||
segments(0),
|
||||
data(theData) {
|
||||
|
||||
|
@ -160,7 +158,7 @@ TransliterationRule::TransliterationRule(const UnicodeString& input,
|
|||
* Copy constructor.
|
||||
*/
|
||||
TransliterationRule::TransliterationRule(TransliterationRule& other) :
|
||||
UObject(other),
|
||||
UMemory(other),
|
||||
anteContext(NULL),
|
||||
key(NULL),
|
||||
postContext(NULL),
|
||||
|
|
|
@ -52,7 +52,7 @@ class UnicodeFunctor;
|
|||
*
|
||||
* @author Alan Liu
|
||||
*/
|
||||
class TransliterationRule : public UObject {
|
||||
class TransliterationRule : public UMemory {
|
||||
|
||||
private:
|
||||
|
||||
|
@ -281,20 +281,6 @@ public:
|
|||
*/
|
||||
virtual UnicodeString& toRule(UnicodeString& pat,
|
||||
UBool escapeUnprintable) 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; }
|
||||
|
||||
|
||||
/**
|
||||
* Union the set of all characters that may be modified by this rule
|
||||
|
@ -312,11 +298,7 @@ public:
|
|||
|
||||
friend class StringMatcher;
|
||||
|
||||
/**
|
||||
* The address of this static class variable serves as this class's ID
|
||||
* for ICU "poor man's RTTI".
|
||||
*/
|
||||
static const char fgClassID;
|
||||
TransliterationRule &operator=(const TransliterationRule &other); // forbid copying of this class
|
||||
};
|
||||
|
||||
U_NAMESPACE_END
|
||||
|
|
|
@ -156,12 +156,10 @@ static void maskingError(const U_NAMESPACE_QUALIFIER TransliterationRule& rule1,
|
|||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
const char TransliterationRuleSet::fgClassID=0;
|
||||
|
||||
/**
|
||||
* Construct a new empty rule set.
|
||||
*/
|
||||
TransliterationRuleSet::TransliterationRuleSet(UErrorCode& status) : UObject() {
|
||||
TransliterationRuleSet::TransliterationRuleSet(UErrorCode& status) : UMemory() {
|
||||
ruleVector = new UVector(&_deleteRule, NULL, status);
|
||||
rules = NULL;
|
||||
maxContextLength = 0;
|
||||
|
@ -174,7 +172,7 @@ TransliterationRuleSet::TransliterationRuleSet(UErrorCode& status) : UObject() {
|
|||
* Copy constructor.
|
||||
*/
|
||||
TransliterationRuleSet::TransliterationRuleSet(const TransliterationRuleSet& other) :
|
||||
UObject(other),
|
||||
UMemory(other),
|
||||
ruleVector(0),
|
||||
rules(0),
|
||||
maxContextLength(other.maxContextLength) {
|
||||
|
|
|
@ -29,7 +29,7 @@ class UnicodeSet;
|
|||
* A set of rules for a <code>RuleBasedTransliterator</code>.
|
||||
* @author Alan Liu
|
||||
*/
|
||||
class U_I18N_API TransliterationRuleSet : public UObject {
|
||||
class U_I18N_API TransliterationRuleSet : public UMemory {
|
||||
/**
|
||||
* Vector of rules, in the order added. This is used while the
|
||||
* rule set is getting built. After that, freeze() reorders and
|
||||
|
@ -144,20 +144,6 @@ public:
|
|||
virtual UnicodeString& toRules(UnicodeString& result,
|
||||
UBool escapeUnprintable) 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; }
|
||||
|
||||
/**
|
||||
* Return the set of all characters that may be modified
|
||||
* (getTarget=false) or emitted (getTarget=true) by this set.
|
||||
|
@ -167,11 +153,7 @@ public:
|
|||
|
||||
private:
|
||||
|
||||
/**
|
||||
* The address of this static class variable serves as this class's ID
|
||||
* for ICU "poor man's RTTI".
|
||||
*/
|
||||
static const char fgClassID;
|
||||
TransliterationRuleSet &operator=(const TransliterationRuleSet &other); // forbid copying of this class
|
||||
};
|
||||
|
||||
U_NAMESPACE_END
|
||||
|
|
Loading…
Add table
Reference in a new issue