2000-01-08 02:05:05 +00:00
|
|
|
/*
|
|
|
|
**********************************************************************
|
2002-06-25 17:23:07 +00:00
|
|
|
* Copyright (C) 1999-2002 IBM Corp. All rights reserved.
|
2000-01-08 02:05:05 +00:00
|
|
|
**********************************************************************
|
|
|
|
* Date Name Description
|
|
|
|
* 12/1/99 rgillam Complete port from Java.
|
2000-01-14 00:13:59 +00:00
|
|
|
* 01/13/2000 helena Added UErrorCode to ctors.
|
2002-06-25 17:23:07 +00:00
|
|
|
* 06/14/2002 andy Gutted for new RBBI impl.
|
2000-01-08 02:05:05 +00:00
|
|
|
**********************************************************************
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "dbbi_tbl.h"
|
2000-01-10 21:21:52 +00:00
|
|
|
#include "unicode/dbbi.h"
|
2002-06-25 17:23:07 +00:00
|
|
|
#include "umutex.h"
|
2000-01-08 02:05:05 +00:00
|
|
|
|
2001-10-08 23:26:58 +00:00
|
|
|
U_NAMESPACE_BEGIN
|
|
|
|
|
2002-06-29 00:04:16 +00:00
|
|
|
const char DictionaryBasedBreakIteratorTables::fgClassID=0;
|
2002-06-25 17:23:07 +00:00
|
|
|
|
2000-01-08 02:05:05 +00:00
|
|
|
//=======================================================================
|
|
|
|
// constructor
|
|
|
|
//=======================================================================
|
|
|
|
|
|
|
|
DictionaryBasedBreakIteratorTables::DictionaryBasedBreakIteratorTables(
|
2001-10-09 22:57:29 +00:00
|
|
|
const char* dictionaryFilename,
|
2002-06-25 17:23:07 +00:00
|
|
|
UErrorCode &status) {
|
|
|
|
fDictionary = new BreakDictionary(dictionaryFilename, status);
|
|
|
|
fRefCount = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DictionaryBasedBreakIteratorTables::addReference() {
|
|
|
|
umtx_atomic_inc(&fRefCount);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DictionaryBasedBreakIteratorTables::removeReference() {
|
|
|
|
if (umtx_atomic_dec(&fRefCount) == 0) {
|
|
|
|
delete this;
|
2001-10-09 22:57:29 +00:00
|
|
|
}
|
2000-01-08 02:05:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destructor
|
|
|
|
*/
|
|
|
|
DictionaryBasedBreakIteratorTables::~DictionaryBasedBreakIteratorTables() {
|
2002-06-25 17:23:07 +00:00
|
|
|
delete fDictionary;
|
|
|
|
fDictionary = NULL;
|
2000-01-08 02:05:05 +00:00
|
|
|
}
|
|
|
|
|
2001-10-08 23:26:58 +00:00
|
|
|
|
|
|
|
U_NAMESPACE_END
|
|
|
|
|
|
|
|
/* eof */
|