ICU 74.2: icu::ValueRuns Class Reference

ICU 74.2 74.2

Public Member Functions | Static Public Member Functions | Protected Member Functions
icu::ValueRuns Class Reference

The `ValueRuns` class associates integer values with runs of text. More...

`#include <RunArrays.h>`

Inheritance diagram for icu::ValueRuns:

## Public Member Functions
| ValueRuns (const le_int32 *values, const le_int32 *limits, le_int32 count)
| Construct a `ValueRuns` object from pre-existing arrays of values and limit indices.
| ValueRuns (le_int32 initialCapacity)
| Construct an empty `ValueRuns` object.
virtual | ~ValueRuns ()
| The destructor; virtual so that subclass destructors are invoked as well.
le_int32 | getValue (le_int32 run) const
| Get the integer value associated with the given run of text.
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 was stored.
virtual UClassID | getDynamicClassID () const
| ICU "poor man's RTTI", returns a UClassID for the actual class.
Public Member Functions inherited from icu::RunArray
| RunArray (const le_int32 *limits, le_int32 count)
| Construct a `RunArray` object from a pre-existing array of limit indices.
| RunArray (le_int32 initialCapacity)
| Construct an empty `RunArray` object.
virtual | ~RunArray ()
| The destructor; virtual so that subclass destructors are invoked as well.
le_int32 | getCount () const
| Get the number of entries in the limit indices array.
void | reset ()
| Reset the limit indices array.
le_int32 | getLimit () const
| Get the last limit index.
le_int32 | getLimit (le_int32 run) const
| Get the limit index for a particular run of text.
le_int32 | add (le_int32 limit)
| Add a limit index to the limit indices array and return the run index where it was stored.
virtual UClassID | getDynamicClassID () const
| ICU "poor man's RTTI", returns a UClassID for the actual class.
Public Member Functions inherited from icu::UObject
virtual | ~UObject ()
| Destructor.
virtual UClassID | getDynamicClassID () const
| ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class.

## Static Public Member Functions
static UClassID | getStaticClassID ()
| ICU "poor man's RTTI", returns a UClassID for this class.
Static Public Member Functions inherited from icu::RunArray
static UClassID | getStaticClassID ()
| ICU "poor man's RTTI", returns a UClassID for this class.

## Protected Member Functions
virtual void | init (le_int32 capacity)
| Create a data array with the given initial size.
virtual void | grow (le_int32 capacity)
| Grow a data array to the given initial size.
virtual void | init (le_int32 capacity)
| Create a data array with the given initial size.
virtual void | grow (le_int32 capacity)
| Grow a data array to the given initial size.

## Additional Inherited Members
Protected Attributes inherited from icu::RunArray
le_bool | fClientArrays
| Set by the constructors to indicate whether or not the client supplied the data arrays.

## Detailed Description

The `ValueRuns` class associates integer values with runs of text.

Stable:
  ICU 3.2

Definition at line 548 of file RunArrays.h.

## Constructor & Destructor Documentation

## ◆ ValueRuns() [1/2]

icu::ValueRuns::ValueRuns | ( | const le_int32 * | values,
|  | const le_int32 * | limits,
|  | le_int32 | count
| ) |  |
| inline

Construct a `ValueRuns` object from pre-existing arrays of values and limit indices.

Parameters

  values | is the address of an array of integer. This array must remain valid until the `ValueRuns` object is destroyed.
  limits | is the address of an array of limit indices. This array must remain valid until the `ValueRuns` object is destroyed.
  count | is the number of entries in the two arrays.

Stable:
  ICU 3.2

Definition at line 671 of file RunArrays.h.

## ◆ ValueRuns() [2/2]

icu::ValueRuns::ValueRuns | ( | le_int32 | initialCapacity | ) |

Construct an empty `ValueRuns` object.

Clients can add value and limit indices arrays using the `add` method.

Parameters

  initialCapacity | is the initial size of the value and limit indices arrays. If this value is zero, no arrays will be allocated.

See also
  add

Stable:
  ICU 3.2

## ◆ ~ValueRuns()

virtual icu::ValueRuns::~ValueRuns | ( |  | ) |
| virtual

The destructor; virtual so that subclass destructors are invoked as well.

Stable:
  ICU 3.2

## Member Function Documentation

## ◆ add()

le_int32 icu::ValueRuns::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 was stored.

This method calls `RunArray::add(limit)` which will create or grow the arrays as needed.

If the `ValueRuns` object was created with a client-supplied font and limit indices arrays, this method will return a run index of -1.

Subclasses should not override this method. Rather they should provide a new `add` method which takes an integer value and a limit index along with whatever other data they implement. The new `add` method should first call this method to grow the font and limit indices arrays, and use the returned run index to store data their own arrays.

Parameters

  value | is the integer value to add
  limit | is the limit index to add

Returns
  the run index where the value and limit index were stored, or -1 if the data cannot be stored.

Stable:
  ICU 3.2

## ◆ getDynamicClassID()

virtual UClassID icu::ValueRuns::getDynamicClassID | ( | void |  | ) | const
| inlinevirtual

ICU "poor man's RTTI", returns a UClassID for the actual class.

Stable:
  ICU 3.2

Reimplemented from icu::RunArray.

Definition at line 638 of file RunArrays.h.

## ◆ getStaticClassID()

static UClassID icu::ValueRuns::getStaticClassID | ( |  | ) |
| inlinestatic

ICU "poor man's RTTI", returns a UClassID for this class.

Stable:
  ICU 3.2

Definition at line 631 of file RunArrays.h.

## ◆ getValue()

le_int32 icu::ValueRuns::getValue | ( | le_int32 | run | ) | const

Get the integer value associated with the given run of text.

Use `RunArray::getLimit(run)` to get the corresponding limit index.

Parameters

  run | is the index into the font and limit indices arrays.

Returns
  the integer value associated with the given text run.

See also
  RunArray::getLimit

Stable:
  ICU 3.2

## ◆ grow()

virtual void icu::ValueRuns::grow | ( | le_int32 | capacity | ) |
| protectedvirtual

Grow a data array to the given initial size.

This method will be called by the `add` method if the limit indices array is full. Subclasses which override this method must also call it from the overriding method to grow the limit indices array.

Parameters

  capacity | is the initial size of the data array.

See also
  add

Stable:
  ICU 3.2

Reimplemented from icu::RunArray.

## ◆ init()

virtual void icu::ValueRuns::init | ( | le_int32 | capacity | ) |
| protectedvirtual

Create a data array with the given initial size.

This method will be called by the `add` method if there is no limit indices array. Subclasses which override this method must also call it from the overriding method to create the limit indices array.

Parameters

  capacity | is the initial size of the data array.

See also
  add

Stable:
  ICU 3.2

Reimplemented from icu::RunArray.

The documentation for this class was generated from the following file:

- layoutex/layout/RunArrays.h