#include "unicode/utypes.h"
#if !UCONFIG_NO_BREAK_ITERATION
#include "dbbi_tbl.h"
#include "unicode/dbbi.h"
#include "umutex.h"
U_NAMESPACE_BEGIN
DictionaryBasedBreakIteratorTables::DictionaryBasedBreakIteratorTables(
const char* dictionaryFilename,
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;
}
}
DictionaryBasedBreakIteratorTables::~DictionaryBasedBreakIteratorTables() {
delete fDictionary;
fDictionary = NULL;
}
U_NAMESPACE_END
#endif