olp-cpp-sdk  1.22.0
AggregatedDataResult.h
1 /*
2  * Copyright (C) 2020 HERE Europe B.V.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * SPDX-License-Identifier: Apache-2.0
17  * License-Filename: LICENSE
18  */
19 
20 #pragma once
21 
22 #include <utility>
23 
24 #include <olp/core/geo/tiling/TileKey.h>
25 #include <olp/dataservice/read/DataServiceReadApi.h>
26 #include <olp/dataservice/read/model/Data.h>
27 
28 namespace olp {
29 namespace dataservice {
30 namespace read {
31 
35 class DATASERVICE_READ_API AggregatedDataResult {
36  public:
37  AggregatedDataResult() = default;
38 
39  virtual ~AggregatedDataResult() = default;
40 
46  void SetTile(const geo::TileKey& tile_key) { tile_key_ = tile_key; }
47 
54  const geo::TileKey& GetTile() const { return tile_key_; }
55 
61  void SetData(model::Data data) { data_ = std::move(data); }
62 
68  const model::Data& GetData() const { return data_; }
69 
75  model::Data&& MoveData() { return std::move(data_); }
76 
77  private:
78  geo::TileKey tile_key_;
79  model::Data data_;
80 };
81 
82 } // namespace read
83 } // namespace dataservice
84 } // namespace olp
Represents the result of a aggregated data operation.
Definition: AggregatedDataResult.h:35
const geo::TileKey & GetTile() const
Gets the requested TileKey or any of it's closest ancestor which contains the related data.
Definition: AggregatedDataResult.h:54
void SetData(model::Data data)
Sets the data of the tile.
Definition: AggregatedDataResult.h:61
model::Data && MoveData()
Moves the data.
Definition: AggregatedDataResult.h:75
const model::Data & GetData() const
Gets the data of the tile.
Definition: AggregatedDataResult.h:68
void SetTile(const geo::TileKey &tile_key)
Sets the TileKey instance of this content.
Definition: AggregatedDataResult.h:46
Addresses a tile in a quadtree.
Definition: TileKey.h:63
Rules all the other namespaces.
Definition: AppleSignInProperties.h:24