Google Cloud Bigtable C++ Client  0.11.0
A C++ Client Library for Google Cloud Bigtable
Public Member Functions | Static Public Member Functions | List of all members
google::cloud::bigtable::v0::RowRange Class Reference

Define the interfaces to create row key ranges. More...

#include <google/cloud/bigtable/row_range.h>

Public Member Functions

 RowRange (::google::bigtable::v2::RowRange rhs)
 
 RowRange (RowRange &&) noexcept=default
 
RowRangeoperator= (RowRange &&) noexcept=default
 
 RowRange (RowRange const &)=default
 
RowRangeoperator= (RowRange const &)=default
 
bool IsEmpty () const
 Return true if the range is empty. More...
 
template<typename T >
bool Contains (T const &key) const
 Return true if key is in the range. More...
 
std::pair< bool, RowRangeIntersect (RowRange const &range) const
 Compute the intersection against another RowRange. More...
 
::google::bigtable::v2::RowRange const & as_proto () const &
 Return the filter expression as a protobuf. More...
 
::google::bigtable::v2::RowRange && as_proto () &&
 Move out the underlying protobuf value. More...
 

Static Public Member Functions

static RowRange InfiniteRange ()
 Return the infinite range, i.e., a range including all possible keys. More...
 
template<typename T >
static RowRange StartingAt (T &&begin)
 Return the range starting at begin (included), with no upper limit. More...
 
template<typename T >
static RowRange EndingAt (T &&end)
 Return the range ending at end (included), with no lower limit. More...
 
static RowRange Empty ()
 Return an empty range. More...
 
template<typename T , typename U >
static RowRange Range (T &&begin, U &&end)
 Return the range representing the interval [begin, end). More...
 
template<typename T >
static RowRange Prefix (T &&prefix)
 Return a range that contains all the keys starting with prefix. More...
 
Less common, yet sometimes useful, ranges.

Return a range representing the interval [begin, end).

template<typename T , typename U >
static RowRange RightOpen (T &&begin, U &&end)
 
template<typename T , typename U >
static RowRange LeftOpen (T &&begin, U &&end)
 Return a range representing the interval (begin, end]. More...
 
template<typename T , typename U >
static RowRange Open (T &&begin, U &&end)
 Return a range representing the interval (begin, end). More...
 
template<typename T , typename U >
static RowRange Closed (T &&begin, U &&end)
 Return a range representing the interval [begin, end]. More...
 

Detailed Description

Define the interfaces to create row key ranges.

Example:

// Create a range for the keys starting with the given prefix.
auto range = bigtable::RowRange("foo/");

Definition at line 38 of file row_range.h.

Constructor & Destructor Documentation

◆ RowRange() [1/3]

google::cloud::bigtable::v0::RowRange::RowRange ( ::google::bigtable::v2::RowRange  rhs)
inlineexplicit

Definition at line 40 of file row_range.h.

◆ RowRange() [2/3]

google::cloud::bigtable::v0::RowRange::RowRange ( RowRange &&  )
defaultnoexcept

◆ RowRange() [3/3]

google::cloud::bigtable::v0::RowRange::RowRange ( RowRange const &  )
default

Member Function Documentation

◆ as_proto() [1/2]

::google::bigtable::v2::RowRange const& google::cloud::bigtable::v0::RowRange::as_proto ( ) const &
inline

Return the filter expression as a protobuf.

Definition at line 162 of file row_range.h.

◆ as_proto() [2/2]

::google::bigtable::v2::RowRange&& google::cloud::bigtable::v0::RowRange::as_proto ( ) &&
inline

Move out the underlying protobuf value.

Definition at line 167 of file row_range.h.

◆ Closed()

template<typename T , typename U >
static RowRange google::cloud::bigtable::v0::RowRange::Closed ( T &&  begin,
U &&  end 
)
inlinestatic

Return a range representing the interval [begin, end].

Definition at line 127 of file row_range.h.

◆ Contains()

template<typename T >
bool google::cloud::bigtable::v0::RowRange::Contains ( T const &  key) const
inline

Return true if key is in the range.

Definition at line 147 of file row_range.h.

◆ Empty()

static RowRange google::cloud::bigtable::v0::RowRange::Empty ( )
inlinestatic

Return an empty range.

Definition at line 68 of file row_range.h.

◆ EndingAt()

template<typename T >
static RowRange google::cloud::bigtable::v0::RowRange::EndingAt ( T &&  end)
inlinestatic

Return the range ending at end (included), with no lower limit.

Definition at line 61 of file row_range.h.

◆ InfiniteRange()

static RowRange google::cloud::bigtable::v0::RowRange::InfiniteRange ( )
inlinestatic

Return the infinite range, i.e., a range including all possible keys.

Definition at line 49 of file row_range.h.

◆ Intersect()

std::pair< bool, RowRange > google::cloud::bigtable::v0::RowRange::Intersect ( RowRange const &  range) const

Compute the intersection against another RowRange.

Returns
a 2-tuple, the first element is a boolean, with value true if there is some intersection, the second element is the intersection. If there is no intersection the first element is false and the second element has a valid, but unspecified value.

Definition at line 94 of file row_range.cc.

◆ IsEmpty()

bool google::cloud::bigtable::v0::RowRange::IsEmpty ( ) const

Return true if the range is empty.

Note that some ranges (such as ["", ""]) are not empty but only include invalid row keys.

Definition at line 23 of file row_range.cc.

◆ LeftOpen()

template<typename T , typename U >
static RowRange google::cloud::bigtable::v0::RowRange::LeftOpen ( T &&  begin,
U &&  end 
)
inlinestatic

Return a range representing the interval (begin, end].

Definition at line 105 of file row_range.h.

◆ Open()

template<typename T , typename U >
static RowRange google::cloud::bigtable::v0::RowRange::Open ( T &&  begin,
U &&  end 
)
inlinestatic

Return a range representing the interval (begin, end).

Definition at line 116 of file row_range.h.

◆ operator=() [1/2]

RowRange& google::cloud::bigtable::v0::RowRange::operator= ( RowRange &&  )
defaultnoexcept

◆ operator=() [2/2]

RowRange& google::cloud::bigtable::v0::RowRange::operator= ( RowRange const &  )
default

◆ Prefix()

template<typename T >
static RowRange google::cloud::bigtable::v0::RowRange::Prefix ( T &&  prefix)
inlinestatic

Return a range that contains all the keys starting with prefix.

Definition at line 85 of file row_range.h.

◆ Range()

template<typename T , typename U >
static RowRange google::cloud::bigtable::v0::RowRange::Range ( T &&  begin,
U &&  end 
)
inlinestatic

Return the range representing the interval [begin, end).

Definition at line 79 of file row_range.h.

◆ RightOpen()

template<typename T , typename U >
static RowRange google::cloud::bigtable::v0::RowRange::RightOpen ( T &&  begin,
U &&  end 
)
inlinestatic

Definition at line 94 of file row_range.h.

◆ StartingAt()

template<typename T >
static RowRange google::cloud::bigtable::v0::RowRange::StartingAt ( T &&  begin)
inlinestatic

Return the range starting at begin (included), with no upper limit.

Definition at line 53 of file row_range.h.