Class KeyBound (2.21.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
NameDescription
KeyBound const &

KeyBound(KeyBound &&)

Copy and move semantics.

Parameter
NameDescription
KeyBound &&

KeyBound()

Not default constructible.

KeyBound(Key, Bound)

Constructs an instance with the given key and bound.

Parameters
NameDescription
key Key
bound Bound

Operators

operator=(KeyBound const &)

Copy and move semantics.

Parameter
NameDescription
KeyBound const &
Returns
TypeDescription
KeyBound &

operator=(KeyBound &&)

Copy and move semantics.

Parameter
NameDescription
KeyBound &&
Returns
TypeDescription
KeyBound &

Functions

key() const &

Returns the Key.

Returns
TypeDescription
Key const &

key() &&

Returns the Key (by move).

Returns
TypeDescription
Key &&

bound() const

Returns the Bound.

Returns
TypeDescription
Bound

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

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