Class KeyBound (2.32.0)

The KeyBound class is a regular type that represents an open or closed endpoint for a range of keys.

A range of keys is defined by a starting KeyBound and an ending KeyBound, and it logically includes all intermediate keys, optionally including/excluding the bounds.

KeyBounds can be "open", meaning the matching row will be excluded from the results, or "closed" meaning the matching row will be included. KeyBound instances should be created with the MakeKeyBoundOpen() or MakeKeyBoundClosed() factory functions.

Example
  auto key_set = spanner::KeySet().AddRange(spanner::MakeKeyBoundOpen(0),
                                            spanner::MakeKeyBoundOpen(11));
Example
  auto delete_singers_range =
      spanner::DeleteMutationBuilder(
          "Singers", spanner::KeySet().AddRange(spanner::MakeKeyBoundClosed(3),
                                                spanner::MakeKeyBoundOpen(5)))
          .Build();

Constructors

KeyBound(KeyBound const &)

Copy and move semantics.

Parameter
Name Description
KeyBound const &

KeyBound(KeyBound &&)

Copy and move semantics.

Parameter
Name Description
KeyBound &&

KeyBound()

Not default constructible.

KeyBound(Key, Bound)

Constructs an instance with the given key and bound.

Parameters
Name Description
key Key
bound Bound

Operators

operator=(KeyBound const &)

Copy and move semantics.

Parameter
Name Description
KeyBound const &
Returns
Type Description
KeyBound &

operator=(KeyBound &&)

Copy and move semantics.

Parameter
Name Description
KeyBound &&
Returns
Type Description
KeyBound &

Functions

key() const &

Returns the Key.

Returns
Type Description
Key const &

key() &&

Returns the Key (by move).

Returns
Type Description
Key &&

bound() const

Returns the Bound.

Returns
Type Description
Bound

google::cloud::spanner::KeyBound::Bound

An enum indicating whether the Key is included (closed) or excluded (open).