olp-cpp-sdk  1.22.0
FlushRequest.h
1 /*
2  * Copyright (C) 2019-2023 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 <olp/dataservice/write/DataServiceWriteApi.h>
23 
24 namespace olp {
25 namespace dataservice {
26 namespace write {
27 namespace model {
29 class DATASERVICE_WRITE_API FlushRequest {
30  public:
31  FlushRequest() = default;
32  FlushRequest(const FlushRequest&) = default;
33  FlushRequest(FlushRequest&&) = default;
34  FlushRequest& operator=(const FlushRequest&) = default;
35  FlushRequest& operator=(FlushRequest&&) = default;
36  virtual ~FlushRequest() = default;
37 
46  inline int GetNumberOfRequestsToFlush() const {
47  return num_requests_per_flush_;
48  }
49 
57  inline FlushRequest& WithNumberOfRequestsToFlush(int num_requests) {
58  num_requests_per_flush_ = num_requests;
59  return *this;
60  }
61 
62  private:
64  int num_requests_per_flush_ = 0;
65 };
66 
67 } // namespace model
68 } // namespace write
69 } // namespace dataservice
70 } // namespace olp
Flushes requests in a stream layer.
Definition: FlushRequest.h:29
FlushRequest & WithNumberOfRequestsToFlush(int num_requests)
Sets the number of partitions (PublishDataRequest) to be flushed.
Definition: FlushRequest.h:57
int GetNumberOfRequestsToFlush() const
Gets the number of partitions (PublishDataRequest) to be flushed.
Definition: FlushRequest.h:46
Rules all the other namespaces.
Definition: AppleSignInProperties.h:24