Google Cloud Bigtable C++ Client  1.1.0
A C++ Client Library for Google Cloud Bigtable
row.h
Go to the documentation of this file.
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 // http://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 
23 namespace google {
24 namespace cloud {
25 namespace bigtable {
26 inline namespace BIGTABLE_CLIENT_NS {
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  */
34 class 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 
48  private:
49  RowKeyType row_key_;
50  std::vector<Cell> cells_;
51 };
52 
53 } // namespace BIGTABLE_CLIENT_NS
54 } // namespace bigtable
55 } // namespace cloud
56 } // namespace google
57 
58 #endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_ROW_H_
#define BIGTABLE_CLIENT_NS
Definition: version.h:22
Contains all the Cloud Bigtable C++ client APIs.