Google Cloud Bigtable C++ Client 2.13.0
A C++ Client Library for Google Cloud Bigtable
Loading...
Searching...
No Matches
row.h
1// Copyright 2017 Google Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ROW_H
16#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ROW_H
17
18#include "google/cloud/bigtable/cell.h"
19#include "google/cloud/bigtable/row_key.h"
20#include "google/cloud/bigtable/version.h"
21#include <vector>
22
23namespace google {
24namespace cloud {
25namespace bigtable {
26GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
27/**
28 * The in-memory representation of a Bigtable row.
29 *
30 * Notice that a row returned by the Bigtable Client may have been filtered by
31 * any filtering expressions provided by the application, and may not contain
32 * all the data available.
33 */
34class Row {
35 public:
36 /// Create a row from a list of cells.
37 template <typename T>
38 Row(T&& row_key, std::vector<Cell> cells)
39 : row_key_(std::forward<T>(row_key)), cells_(std::move(cells)) {}
40
41 /// Return the row key. The returned value is not valid
42 /// after this object is deleted.
43 RowKeyType const& row_key() const { return row_key_; }
44
45 /// Return all cells.
46 std::vector<Cell> const& cells() const& { return cells_; }
47 /// Return all cells.
48 std::vector<Cell>&& cells() && { return std::move(cells_); }
49
50 private:
51 RowKeyType row_key_;
52 std::vector<Cell> cells_;
53};
54
55GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
56} // namespace bigtable
57} // namespace cloud
58} // namespace google
59
60#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ROW_H
The in-memory representation of a Bigtable cell.
Definition: cell.h:90
The in-memory representation of a Bigtable row.
Definition: row.h:34
RowKeyType const & row_key() const
Return the row key.
Definition: row.h:43
Row(T &&row_key, std::vector< Cell > cells)
Create a row from a list of cells.
Definition: row.h:38
std::vector< Cell > const & cells() const &
Return all cells.
Definition: row.h:46
std::vector< Cell > && cells() &&
Return all cells.
Definition: row.h:48
Contains all the Cloud Bigtable C++ client APIs.
Definition: admin_client.h:28