ICU 75.1 75.1

Data Structures | Public Member Functions | Friends
icu::message2::data_model::Operator Class Reference

The `Operator` class corresponds to the `FunctionRef | Reserved` type in the `Expression` interface defined in https://github.com/unicode-org/message-format-wg/blob/main/spec/data-model.md#patterns. More...

`#include <messageformat2_data_model.h>`

Inheritance diagram for icu::message2::data_model::Operator:

## Data Structures
class | Builder
| The mutable `Operator::Builder` class allows the operator to be constructed incrementally. More...

## Public Member Functions
UBool | isReserved () const
| Determines if this operator is a reserved annotation. More...
const FunctionName & | getFunctionName () const
| Accesses the function name. More...
const Reserved & | asReserved () const
| Accesses the underlying reserved sequence. More...
std::vector< Option > | getOptions () const
| Accesses function options. More...
| Operator (const Operator &other) noexcept
| Copy constructor. More...
Operator & | operator= (Operator) noexcept
| Assignment operator. More...
| Operator ()
| Default constructor. More...
virtual | ~Operator ()
| Destructor. More...
Public Member Functions inherited from icu::UObject
virtual | ~UObject ()
| Destructor. More...
virtual UClassID | getDynamicClassID () const
| ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class. More...

## Friends
class | Binding
class | Builder
class | message2::Checker
class | message2::MessageFormatter
class | message2::Serializer
void | swap (Operator &o1, Operator &o2) noexcept
| Non-member swap function. More...

## Detailed Description

The `Operator` class corresponds to the `FunctionRef | Reserved` type in the `Expression` interface defined in https://github.com/unicode-org/message-format-wg/blob/main/spec/data-model.md#patterns.

It represents the annotation that an expression can have: either a function name paired with a map from option names to operands (possibly empty), or a reserved sequence, which has no meaning and results in an error if the formatter is invoked.

`Operator` is immutable, copyable and movable.

Internal:
  Do not use. This API is for internal use only. ICU 75 technology preview

Deprecated:
  This API is for technology preview only.

Definition at line 1049 of file messageformat2_data_model.h.

## Constructor & Destructor Documentation

## ◆ Operator() [1/2]

icu::message2::data_model::Operator::Operator | ( | const Operator & | other | ) |
| noexcept

Copy constructor.

Internal:
  Do not use. This API is for internal use only. ICU 75 technology preview

Deprecated:
  This API is for technology preview only.

## ◆ Operator() [2/2]

icu::message2::data_model::Operator::Operator | ( |  | ) |
| inline

Default constructor.

Puts the Operator into a valid but undefined state.

Internal:
  Do not use. This API is for internal use only. ICU 75 technology preview

Deprecated:
  This API is for technology preview only.

Definition at line 1228 of file messageformat2_data_model.h.

## ◆ ~Operator()

virtual icu::message2::data_model::Operator::~Operator | ( |  | ) |
| virtual

Destructor.

Internal:
  Do not use. This API is for internal use only. ICU 75 technology preview

Deprecated:
  This API is for technology preview only.

## Member Function Documentation

## ◆ asReserved()

const Reserved& icu::message2::data_model::Operator::asReserved | ( |  | ) | const

Accesses the underlying reserved sequence.

Precondition: isReserved()

Returns
  The reserved sequence represented by this operator.

Internal:
  Do not use. This API is for internal use only. ICU 75 technology preview

Deprecated:
  This API is for technology preview only.

## ◆ getFunctionName()

const FunctionName& icu::message2::data_model::Operator::getFunctionName | ( |  | ) | const

Accesses the function name.

Precondition: !isReserved()

Returns
  The function name of this operator.

Internal:
  Do not use. This API is for internal use only. ICU 75 technology preview

Deprecated:
  This API is for technology preview only.

## ◆ getOptions()

std::vector<Option> icu::message2::data_model::Operator::getOptions | ( |  | ) | const
| inline

Accesses function options.

Precondition: !isReserved()

Returns
  A vector of function options for this operator.

Internal:
  Do not use. This API is for internal use only. ICU 75 technology preview

Deprecated:
  This API is for technology preview only.

Definition at line 1089 of file messageformat2_data_model.h.

## ◆ isReserved()

UBool icu::message2::data_model::Operator::isReserved | ( |  | ) | const
| inline

Determines if this operator is a reserved annotation.

Returns
  true if and only if this operator represents a reserved sequence.

Internal:
  Do not use. This API is for internal use only. ICU 75 technology preview

Deprecated:
  This API is for technology preview only.

Definition at line 1059 of file messageformat2_data_model.h.

## ◆ operator=()

Operator& icu::message2::data_model::Operator::operator= | ( | Operator |  | ) |
| noexcept

Assignment operator.

Internal:
  Do not use. This API is for internal use only. ICU 75 technology preview

Deprecated:
  This API is for technology preview only.

## Friends And Related Function Documentation

## ◆ swap

void swap | ( | Operator & | o1,
|  | Operator & | o2
| ) |  |
| friend

Non-member swap function.

Parameters

  o1 | will get o2's contents
  o2 | will get o1's contents

Internal:
  Do not use. This API is for internal use only. ICU 75 technology preview

Deprecated:
  This API is for technology preview only.

Definition at line 1209 of file messageformat2_data_model.h.

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

- i18n/unicode/messageformat2_data_model.h