// Copyright (C) 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html // file: rbbi_cache.h // #ifndef RBBI_CACHE_H #define RBBI_CACHE_H #include "unicode/utypes.h" #if !UCONFIG_NO_BREAK_ITERATION #include "unicode/rbbi.h" #include "unicode/uobject.h" #include "uvectr32.h" U_NAMESPACE_BEGIN /* DictionaryCache stores the boundaries obtained from a run of dictionary characters. * Dictionary boundaries are moved first to this cache, then from here * to the main BreakCache, where they may inter-leave with non-dictionary * boundaries. The public BreakIterator API always fetches directly * from the main BreakCache, not from here. * * In common situations, the number of boundaries in a single dictionary run * should be quite small, it will be terminated by punctuation, spaces, * or any other non-dictionary characters. The main BreakCache may end * up with boundaries from multiple dictionary based runs. * * The boundaries are stored in a simple ArrayList (vector), with the * assumption that they will be accessed sequentially. */ class RuleBasedBreakIterator::DictionaryCache: public UMemory { … }; /* * class BreakCache * * Cache of break boundary positions and rule status values. * Break iterator API functions, next(), previous(), etc., will use cached results * when possible, and otherwise cache new results as they are obtained. * * Uniformly caches both dictionary and rule based (non-dictionary) boundaries. * * The cache is implemented as a single circular buffer. */ /* * size of the circular cache buffer. */ class RuleBasedBreakIterator::BreakCache: public UMemory { … }; U_NAMESPACE_END #endif // #if !UCONFIG_NO_BREAK_ITERATION #endif // RBBI_CACHE_H