icu::message2::data_model::Binding Class Reference

A `Binding` pairs a variable name with an expression. More...

`#include <messageformat2_data_model.h>`

Inheritance diagram for icu::message2::data_model::Binding:

## Public Member Functions

const Expression & | getValue () const
| Accesses the right-hand side of a binding. More...
const VariableName & | getVariable () const
| Accesses the left-hand side of the binding. More...
UBool | isLocal () const
| Returns true if and only if this binding represents a local declaration. More...
| Binding (const VariableName &v, Expression &&e)
| Constructor. More...
| Binding (const Binding &other)
| Copy constructor. More...
Binding & | operator= (Binding) noexcept
| Copy assignment operator. More...
| Binding ()
| Default constructor. More...
virtual | ~Binding ()
| 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...

## Static Public Member Functions

static Binding | input (UnicodeString &&variableName, Expression &&rhs, UErrorCode &errorCode)
| Constructor for input binding. More...

## Friends

class | message2::Checker
class | message2::MessageFormatter
class | message2::Parser
class | message2::Serializer
void | swap (Binding &b1, Binding &b2) noexcept
| Non-member swap function. More...

## Detailed Description

A `Binding` pairs a variable name with an expression.

It corresponds to the `Declaration` interface defined in https://github.com/unicode-org/message-format-wg/blob/main/spec/data-model.md#messages

`Binding` is immutable and copyable. It is not 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 2034 of file messageformat2_data_model.h.

## Constructor & Destructor Documentation

## Binding() [1/3]

icu::message2::data_model::Binding::Binding | ( | const VariableName & | v,
|  | Expression && | e
| ) |  |

inline

Constructor.

Parameters

  v | A variable name.
  e | An expression.

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 2086 of file messageformat2_data_model.h.

## Binding() [2/3]

icu::message2::data_model::Binding::Binding | ( | const Binding & | other | ) |

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.

## Binding() [3/3]

icu::message2::data_model::Binding::Binding | ( |  | ) |

inline

Default constructor.

Puts the Binding 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 2125 of file messageformat2_data_model.h.

## ~Binding()

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

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

## getValue()

const Expression& icu::message2::data_model::Binding::getValue | ( |  | ) | const

Accesses the right-hand side of a binding.

Returns
  A reference to the expression.

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

Deprecated:
  This API is for technology preview only.

## getVariable()

const VariableName& icu::message2::data_model::Binding::getVariable | ( |  | ) | const

inline

Accesses the left-hand side of the binding.

Returns
  A reference to the variable name.

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 2053 of file messageformat2_data_model.h.

## input()

static Binding icu::message2::data_model::Binding::input | ( | UnicodeString && | variableName,
|  | Expression && | rhs,
|  | UErrorCode & | errorCode
| ) |  |

static

Constructor for input binding.

Parameters

  variableName | The variable name (left-hand side) of the binding. Passed by move.
  rhs | The right-hand side of the input binding. Passed by move. `rhs` must have an operand that is a variable reference to `variableName`. If `rhs` has an operator, it must be a function call. If either of these properties is violated, `errorCode` is set to U_INVALID_STATE_ERROR.
  errorCode | Input/output error code

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

Deprecated:
  This API is for technology preview only.

## isLocal()

UBool icu::message2::data_model::Binding::isLocal | ( |  | ) | const

inline

Returns true if and only if this binding represents a local declaration.

Otherwise, it's an input declaration.

Returns
  True if this binding represents a variable and expression; false if it represents a variable plus an annotation.

Definition at line 2076 of file messageformat2_data_model.h.

## operator=()

Binding& icu::message2::data_model::Binding::operator= | ( | Binding |  | ) |

noexcept

Copy 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 | ( | Binding & | b1,
|  | Binding & | b2
| ) |  |

friend

Non-member swap function.

Parameters

  b1 | will get b2's contents
  b2 | will get b1'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 2095 of file messageformat2_data_model.h.

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

- i18n/unicode/messageformat2_data_model.h