Movatterモバイル変換


[0]ホーム

URL:


ICU 77.1  77.1
RunArrays.h
Go to the documentation of this file.
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4  **********************************************************************
5  * Copyright (C) 2003-2008, International Business Machines
6  * Corporation and others. All Rights Reserved.
7  **********************************************************************
8  */
9 
10 #ifndef __RUNARRAYS_H
11 
12 #define __RUNARRAYS_H
13 
14 #include "layout/LETypes.h"
15 #include "layout/LEFontInstance.h"
16 
17 #include "unicode/utypes.h"
18 #include "unicode/locid.h"
19 
25 U_NAMESPACE_BEGIN
26 
32 #define INITIAL_CAPACITY 16
33 
40 #define CAPACITY_GROW_LIMIT 128
41 
50 classU_LAYOUTEX_APIRunArray :publicUObject
51 {
52 public:
64 inlineRunArray(const le_int32 *limits, le_int32 count);
65 
77 RunArray(le_int32 initialCapacity);
78 
84 virtual~RunArray();
85 
93 inline le_int32 getCount()const;
94 
103 inlinevoid reset();
104 
113 inline le_int32 getLimit()const;
114 
124 inline le_int32 getLimit(le_int32 run)const;
125 
150  le_int32add(le_int32 limit);
151 
157 staticinlineUClassIDgetStaticClassID() {return (UClassID)&fgClassID; }
158 
164 inlineUClassIDgetDynamicClassID() const override{return getStaticClassID(); }
165 
166 protected:
179 virtualvoidinit(le_int32 capacity);
180 
193 virtualvoidgrow(le_int32 capacity);
194 
204  le_boolfClientArrays;
205 
206 private:
211 staticconstchar fgClassID;
212 
213  le_int32 ensureCapacity();
214 
215 inlineRunArray();
216 inlineRunArray(constRunArray &/*other*/);
217 inlineRunArray &operator=(constRunArray &/*other*/) {return *this; }
218 
219 const le_int32 *fLimits;
220  le_int32 fCount;
221  le_int32 fCapacity;
222 };
223 
224 inline RunArray::RunArray()
225  : UObject(), fClientArrays(false), fLimits(nullptr), fCount(0), fCapacity(0)
226 {
227 // nothing else to do...
228 }
229 
230 inline RunArray::RunArray(const RunArray &/*other*/)
231  : UObject(), fClientArrays(false), fLimits(nullptr), fCount(0), fCapacity(0)
232 {
233 // nothing else to do...
234 }
235 
236 inline RunArray::RunArray(const le_int32 *limits, le_int32 count)
237  :UObject(), fClientArrays(true), fLimits(limits), fCount(count), fCapacity(count)
238 {
239 // nothing else to do...
240 }
241 
242 inline le_int32RunArray::getCount() const
243 {
244 return fCount;
245 }
246 
247 inlinevoidRunArray::reset()
248 {
249  fCount = 0;
250 }
251 
252 inline le_int32RunArray::getLimit(le_int32 run) const
253 {
254 if (run < 0 || run >= fCount) {
255 return -1;
256  }
257 
258 return fLimits[run];
259 }
260 
261 inline le_int32RunArray::getLimit() const
262 {
263 returngetLimit(fCount - 1);
264 }
265 
272 classU_LAYOUTEX_APIFontRuns :publicRunArray
273 {
274 public:
290 inlineFontRuns(const LEFontInstance **fonts,const le_int32 *limits, le_int32 count);
291 
303 FontRuns(le_int32 initialCapacity);
304 
310 virtual~FontRuns();
311 
325 const LEFontInstance *getFont(le_int32 run)const;
326 
327 
350  le_int32add(const LEFontInstance *font, le_int32 limit);
351 
357 staticinlineUClassIDgetStaticClassID() {return (UClassID)&fgClassID; }
358 
364 inlineUClassIDgetDynamicClassID() const override{return getStaticClassID(); }
365 
366 protected:
367 voidinit(le_int32 capacity)override;
368 voidgrow(le_int32 capacity)override;
369 
370 private:
371 
372 inlineFontRuns();
373 inlineFontRuns(constFontRuns &other);
374 inlineFontRuns &operator=(constFontRuns &/*other*/) {return *this; }
375 
380 staticconstchar fgClassID;
381 
382 const LEFontInstance **fFonts;
383 };
384 
385 inline FontRuns::FontRuns()
386  : RunArray(0), fFonts(nullptr)
387 {
388 // nothing else to do...
389 }
390 
391 inline FontRuns::FontRuns(const FontRuns &/*other*/)
392  : RunArray(0), fFonts(nullptr)
393 {
394 // nothing else to do...
395 }
396 
397 inline FontRuns::FontRuns(const LEFontInstance **fonts,const le_int32 *limits, le_int32 count)
398  :RunArray(limits, count), fFonts(fonts)
399 {
400 // nothing else to do...
401 }
402 
409 classU_LAYOUTEX_APILocaleRuns :publicRunArray
410 {
411 public:
427 inlineLocaleRuns(constLocale **locales,const le_int32 *limits, le_int32 count);
428 
440 LocaleRuns(le_int32 initialCapacity);
441 
447 virtual~LocaleRuns();
448 
462 constLocale *getLocale(le_int32 run)const;
463 
464 
487  le_int32add(constLocale *locale, le_int32 limit);
488 
494 staticinlineUClassIDgetStaticClassID() {return (UClassID)&fgClassID; }
495 
501 inlineUClassIDgetDynamicClassID() const override{return getStaticClassID(); }
502 
503 protected:
504 voidinit(le_int32 capacity)override;
505 voidgrow(le_int32 capacity)override;
506 
510 constLocale **fLocales;
511 
512 private:
513 
514 inlineLocaleRuns();
515 inlineLocaleRuns(constLocaleRuns &other);
516 inlineLocaleRuns &operator=(constLocaleRuns &/*other*/) {return *this; }
517 
522 staticconstchar fgClassID;
523 };
524 
525 inline LocaleRuns::LocaleRuns()
526  : RunArray(0), fLocales(nullptr)
527 {
528 // nothing else to do...
529 }
530 
531 inline LocaleRuns::LocaleRuns(const LocaleRuns &/*other*/)
532  : RunArray(0), fLocales(nullptr)
533 {
534 // nothing else to do...
535 }
536 
537 inline LocaleRuns::LocaleRuns(constLocale **locales,const le_int32 *limits, le_int32 count)
538  :RunArray(limits, count), fLocales(locales)
539 {
540 // nothing else to do...
541 }
542 
548 classU_LAYOUTEX_APIValueRuns :publicRunArray
549 {
550 public:
565 inlineValueRuns(const le_int32 *values,const le_int32 *limits, le_int32 count);
566 
578 ValueRuns(le_int32 initialCapacity);
579 
585 virtual~ValueRuns();
586 
600  le_int32getValue(le_int32 run)const;
601 
602 
624  le_int32add(le_int32 value, le_int32 limit);
625 
631 staticinlineUClassIDgetStaticClassID() {return (UClassID)&fgClassID; }
632 
638 inlineUClassIDgetDynamicClassID() const override{return getStaticClassID(); }
639 
640 protected:
641 voidinit(le_int32 capacity)override;
642 voidgrow(le_int32 capacity)override;
643 
644 private:
645 
646 inlineValueRuns();
647 inlineValueRuns(constValueRuns &other);
648 inlineValueRuns &operator=(constValueRuns &/*other*/) {return *this; }
649 
654 staticconstchar fgClassID;
655 
656 const le_int32 *fValues;
657 };
658 
659 inline ValueRuns::ValueRuns()
660  : RunArray(0), fValues(nullptr)
661 {
662 // nothing else to do...
663 }
664 
665 inline ValueRuns::ValueRuns(const ValueRuns &/*other*/)
666  : RunArray(0), fValues(nullptr)
667 {
668 // nothing else to do...
669 }
670 
671 inline ValueRuns::ValueRuns(const le_int32 *values,const le_int32 *limits, le_int32 count)
672  :RunArray(limits, count), fValues(values)
673 {
674 // nothing else to do...
675 }
676 
677 U_NAMESPACE_END
678 #endif
icu::FontRuns
The FontRuns class associates pointers to LEFontInstance objects with runs of text.
Definition:RunArrays.h:273
icu::FontRuns::grow
void grow(le_int32 capacity) override
Grow a data array to the given initial size.
icu::FontRuns::~FontRuns
virtual ~FontRuns()
The destructor; virtual so that subclass destructors are invoked as well.
icu::FontRuns::getDynamicClassID
UClassID getDynamicClassID() const override
ICU "poor man's RTTI", returns a UClassID for the actual class.
Definition:RunArrays.h:364
icu::FontRuns::getFont
const LEFontInstance * getFont(le_int32 run) const
Get the LEFontInstance object associated with the given run of text.
icu::FontRuns::FontRuns
FontRuns(le_int32 initialCapacity)
Construct an empty FontRuns object.
icu::FontRuns::init
void init(le_int32 capacity) override
Create a data array with the given initial size.
icu::FontRuns::add
le_int32 add(const LEFontInstance *font, le_int32 limit)
Add an LEFontInstance and limit index pair to the data arrays and return the run index where the data...
icu::FontRuns::getStaticClassID
static UClassID getStaticClassID()
ICU "poor man's RTTI", returns a UClassID for this class.
Definition:RunArrays.h:357
icu::LocaleRuns
The LocaleRuns class associates pointers to Locale objects with runs of text.
Definition:RunArrays.h:410
icu::LocaleRuns::~LocaleRuns
virtual ~LocaleRuns()
The destructor; virtual so that subclass destructors are invoked as well.
icu::LocaleRuns::init
void init(le_int32 capacity) override
Create a data array with the given initial size.
icu::LocaleRuns::getStaticClassID
static UClassID getStaticClassID()
ICU "poor man's RTTI", returns a UClassID for this class.
Definition:RunArrays.h:494
icu::LocaleRuns::getDynamicClassID
UClassID getDynamicClassID() const override
ICU "poor man's RTTI", returns a UClassID for the actual class.
Definition:RunArrays.h:501
icu::LocaleRuns::LocaleRuns
LocaleRuns(le_int32 initialCapacity)
Construct an empty LocaleRuns object.
icu::LocaleRuns::fLocales
const Locale ** fLocales
Definition:RunArrays.h:510
icu::LocaleRuns::getLocale
const Locale * getLocale(le_int32 run) const
Get the Locale object associated with the given run of text.
icu::LocaleRuns::grow
void grow(le_int32 capacity) override
Grow a data array to the given initial size.
icu::LocaleRuns::add
le_int32 add(const Locale *locale, le_int32 limit)
Add a Locale and limit index pair to the data arrays and return the run index where the data was stor...
icu::Locale
A Locale object represents a specific geographical, political, or cultural region.
Definition:locid.h:195
icu::RunArray
The RunArray class is a base class for building classes which represent data that is associated with ...
Definition:RunArrays.h:51
icu::RunArray::~RunArray
virtual ~RunArray()
The destructor; virtual so that subclass destructors are invoked as well.
icu::RunArray::getLimit
le_int32 getLimit() const
Get the last limit index.
Definition:RunArrays.h:261
icu::RunArray::grow
virtual void grow(le_int32 capacity)
Grow a data array to the given initial size.
icu::RunArray::fClientArrays
le_bool fClientArrays
Set by the constructors to indicate whether or not the client supplied the data arrays.
Definition:RunArrays.h:204
icu::RunArray::reset
void reset()
Reset the limit indices array.
Definition:RunArrays.h:247
icu::RunArray::getDynamicClassID
UClassID getDynamicClassID() const override
ICU "poor man's RTTI", returns a UClassID for the actual class.
Definition:RunArrays.h:164
icu::RunArray::init
virtual void init(le_int32 capacity)
Create a data array with the given initial size.
icu::RunArray::RunArray
RunArray(le_int32 initialCapacity)
Construct an empty RunArray object.
icu::RunArray::getStaticClassID
static UClassID getStaticClassID()
ICU "poor man's RTTI", returns a UClassID for this class.
Definition:RunArrays.h:157
icu::RunArray::getCount
le_int32 getCount() const
Get the number of entries in the limit indices array.
Definition:RunArrays.h:242
icu::RunArray::add
le_int32 add(le_int32 limit)
Add a limit index to the limit indices array and return the run index where it was stored.
icu::UObject
UObject is the common ICU "boilerplate" class.
Definition:uobject.h:223
icu::ValueRuns
The ValueRuns class associates integer values with runs of text.
Definition:RunArrays.h:549
icu::ValueRuns::~ValueRuns
virtual ~ValueRuns()
The destructor; virtual so that subclass destructors are invoked as well.
icu::ValueRuns::init
void init(le_int32 capacity) override
Create a data array with the given initial size.
icu::ValueRuns::getDynamicClassID
UClassID getDynamicClassID() const override
ICU "poor man's RTTI", returns a UClassID for the actual class.
Definition:RunArrays.h:638
icu::ValueRuns::add
le_int32 add(le_int32 value, le_int32 limit)
Add an integer value and limit index pair to the data arrays and return the run index where the data ...
icu::ValueRuns::getValue
le_int32 getValue(le_int32 run) const
Get the integer value associated with the given run of text.
icu::ValueRuns::grow
void grow(le_int32 capacity) override
Grow a data array to the given initial size.
icu::ValueRuns::getStaticClassID
static UClassID getStaticClassID()
ICU "poor man's RTTI", returns a UClassID for this class.
Definition:RunArrays.h:631
icu::ValueRuns::ValueRuns
ValueRuns(le_int32 initialCapacity)
Construct an empty ValueRuns object.
locid.h
C++ API: Locale ID object.
UClassID
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition:uobject.h:96
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
U_LAYOUTEX_API
#define U_LAYOUTEX_API
Set to export library symbols from inside the layout extensions library, and to import them from outs...
Definition:utypes.h:318

Generated by doxygen 1.9.1
[8]ページ先頭

©2009-2025 Movatter.jp