Google Cloud Spanner C++ Client 2.13.0
A C++ Client Library for Google Cloud Spanner
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
google::cloud::spanner::KeyBound Class Reference

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

#include <google/cloud/spanner/keys.h>

Public Types

enum class  Bound { kClosed , kOpen }
 An enum indicating whether the Key is included (closed) or excluded (open). More...
 

Public Member Functions

 KeyBound ()=delete
 Not default constructible. More...
 
 KeyBound (Key key, Bound bound)
 Constructs an instance with the given key and bound. More...
 
Key const & key () const &
 Returns the Key. More...
 
Key && key () &&
 Returns the Key (by move). More...
 
Bound bound () const
 Returns the Bound. More...
 
Copy and move semantics.
 KeyBound (KeyBound const &)=default
 
KeyBoundoperator= (KeyBound const &)=default
 
 KeyBound (KeyBound &&)=default
 
KeyBoundoperator= (KeyBound &&)=default
 

Friends

Equality.
bool operator== (KeyBound const &a, KeyBound const &b)
 
bool operator!= (KeyBound const &a, KeyBound const &b)
 

Detailed Description

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
The KeySet class is a regular type that represents a collection of Keys.
Definition: keys.h:157
KeySet & AddRange(KeyBound start, KeyBound end)
Adds a range of keys defined by the given KeyBounds.
KeyBound MakeKeyBoundOpen(Ts &&... ts)
Returns an "open" KeyBound with a Key constructed from the given arguments.
Definition: keys.h:136
Example
auto delete_singers_range =
"Singers", spanner::KeySet().AddRange(spanner::MakeKeyBoundClosed(3),
.Build();
KeyBound MakeKeyBoundClosed(Ts &&... ts)
Returns a "closed" KeyBound with a Key constructed from the given arguments.
Definition: keys.h:124
spanner_internal::DeleteMutationBuilder DeleteMutationBuilder
A helper class to construct "delete" mutations.
Definition: mutations.h:355

Member Enumeration Documentation

◆ Bound

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

Enumerator
kClosed 
kOpen 

Constructor & Destructor Documentation

◆ KeyBound() [1/4]

google::cloud::spanner::KeyBound::KeyBound ( )
delete

Not default constructible.

◆ KeyBound() [2/4]

google::cloud::spanner::KeyBound::KeyBound ( Key  key,
Bound  bound 
)
inline

Constructs an instance with the given key and bound.

◆ KeyBound() [3/4]

google::cloud::spanner::KeyBound::KeyBound ( KeyBound const &  )
default

◆ KeyBound() [4/4]

google::cloud::spanner::KeyBound::KeyBound ( KeyBound &&  )
default

Member Function Documentation

◆ bound()

Bound google::cloud::spanner::KeyBound::bound ( ) const
inline

Returns the Bound.

◆ key() [1/2]

Key && google::cloud::spanner::KeyBound::key ( ) &&
inline

Returns the Key (by move).

◆ key() [2/2]

Key const & google::cloud::spanner::KeyBound::key ( ) const &
inline

Returns the Key.

◆ operator=() [1/2]

KeyBound & google::cloud::spanner::KeyBound::operator= ( KeyBound &&  )
default

◆ operator=() [2/2]

KeyBound & google::cloud::spanner::KeyBound::operator= ( KeyBound const &  )
default

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( KeyBound const &  a,
KeyBound const &  b 
)
friend

◆ operator==

bool operator== ( KeyBound const &  a,
KeyBound const &  b 
)
friend