olp-cpp-sdk  1.22.0
StreamOffsets.h
1 /*
2  * Copyright (C) 2020-2021 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 #include <vector>
24 
25 #include <olp/dataservice/read/DataServiceReadApi.h>
26 
27 namespace olp {
28 namespace dataservice {
29 namespace read {
30 namespace model {
31 
35 class DATASERVICE_READ_API StreamOffset final {
36  public:
37  StreamOffset() = default;
38 
45  int32_t GetPartition() const { return partition_; }
52  void SetPartition(int32_t value) { partition_ = value; }
53 
59  int64_t GetOffset() const { return offset_; }
65  void SetOffset(int64_t value) { offset_ = value; }
66 
67  private:
71  int32_t partition_;
72 
74  int64_t offset_;
75 };
76 
80 class DATASERVICE_READ_API StreamOffsets final {
81  public:
82  StreamOffsets() = default;
83 
89  const std::vector<StreamOffset>& GetOffsets() const { return offsets_; }
95  void SetOffsets(std::vector<StreamOffset> value) {
96  offsets_ = std::move(value);
97  }
98 
99  private:
100  std::vector<StreamOffset> offsets_;
101 };
102 
103 } // namespace model
104 } // namespace read
105 } // namespace dataservice
106 } // namespace olp
An offset in a specific partition of a stream layer.
Definition: StreamOffsets.h:35
void SetOffset(int64_t value)
Sets the offset for the request.
Definition: StreamOffsets.h:65
int32_t GetPartition() const
Gets the partition of the stream layer for which this offset applies.
Definition: StreamOffsets.h:45
void SetPartition(int32_t value)
Sets the partition of the stream layer.
Definition: StreamOffsets.h:52
int64_t GetOffset() const
Gets the offset in the partition of the stream layer.
Definition: StreamOffsets.h:59
Represents a list of offsets.
Definition: StreamOffsets.h:80
void SetOffsets(std::vector< StreamOffset > value)
Sets the list of offsets.
Definition: StreamOffsets.h:95
const std::vector< StreamOffset > & GetOffsets() const
Gets the list of offsets.
Definition: StreamOffsets.h:89
Rules all the other namespaces.
Definition: AppleSignInProperties.h:24