olp-cpp-sdk  1.22.0
CatalogClient.h
1 /*
2  * Copyright (C) 2019-2022 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 <functional>
23 #include <memory>
24 
25 #include <olp/core/client/OlpClientSettings.h>
26 #include <olp/core/geo/tiling/TileKey.h>
27 #include <olp/core/porting/deprecated.h>
28 #include <olp/dataservice/read/CatalogRequest.h>
29 #include <olp/dataservice/read/CatalogVersionRequest.h>
30 #include <olp/dataservice/read/CompatibleVersionsRequest.h>
31 #include <olp/dataservice/read/DataRequest.h>
32 #include <olp/dataservice/read/DataServiceReadApi.h>
33 #include <olp/dataservice/read/PartitionsRequest.h>
34 #include <olp/dataservice/read/Types.h>
35 #include <olp/dataservice/read/VersionsRequest.h>
36 
37 namespace olp {
38 
39 namespace client {
40 class HRN;
41 } // namespace client
42 
43 namespace dataservice {
44 namespace read {
45 
46 class CatalogClientImpl;
47 
66 class DATASERVICE_READ_API CatalogClient final {
67  public:
75 
77  CatalogClient(const CatalogClient& other) = delete;
78 
80  CatalogClient(CatalogClient&& other) noexcept;
81  CatalogClient& operator=(const CatalogClient& other) = delete;
82 
85 
86  ~CatalogClient();
87 
94 
106  CatalogResponseCallback callback);
107 
119 
139  CatalogVersionCallback callback);
140 
160  CatalogVersionRequest request);
161 
175  VersionsResponseCallback callback);
176 
190  VersionsRequest request);
191 
207  CompatibleVersionsRequest request, CompatibleVersionsCallback callback);
208 
224  CompatibleVersionsRequest request);
225 
226  private:
227  std::unique_ptr<CatalogClientImpl> impl_;
228 };
229 
230 } // namespace read
231 } // namespace dataservice
232 } // namespace olp
A wrapper template that you can use to cancel a request or wait for it to finalize.
Definition: ApiResponse.h:281
Cancels service requests.
Definition: CancellationToken.h:33
Allows a Here Resource Name (HRN) to be passed to the operations that require it.
Definition: HRN.h:34
Provides a high-level interface to access data hosted on OLP using the Data API.
Definition: CatalogClient.h:66
bool CancelPendingRequests()
Cancels the currently active requests.
client::CancellationToken GetCompatibleVersions(CompatibleVersionsRequest request, CompatibleVersionsCallback callback)
Gets the list of the current catalog versions that are compatible with the dependencies provided by t...
CatalogClient & operator=(CatalogClient &&other) noexcept
A copy assignment operator.
client::CancellableFuture< CatalogResponse > GetCatalog(CatalogRequest request)
Gets the catalog configuration asynchronously.
CatalogClient(const CatalogClient &other)=delete
A copy constructor.
client::CancellableFuture< CompatibleVersionsResponse > GetCompatibleVersions(CompatibleVersionsRequest request)
Gets the list of the current catalog versions that are compatible with the dependencies provided by t...
client::CancellationToken GetLatestVersion(CatalogVersionRequest request, CatalogVersionCallback callback)
Gets the catalog version asynchronously.
client::CancellableFuture< CatalogVersionResponse > GetLatestVersion(CatalogVersionRequest request)
Gets the catalog version asynchronously.
CatalogClient(CatalogClient &&other) noexcept
A default move constructor.
client::CancellationToken ListVersions(VersionsRequest request, VersionsResponseCallback callback)
Gets the catalog versions list.
client::CancellationToken GetCatalog(CatalogRequest request, CatalogResponseCallback callback)
Gets the catalog configuration asynchronously.
CatalogClient(client::HRN catalog, client::OlpClientSettings settings)
Creates the CatalogClient instance.
client::CancellableFuture< VersionsResponse > ListVersions(VersionsRequest request)
Gets the catalog versions list.
Encapsulates the fields required to request catalog configuration.
Definition: CatalogRequest.h:37
Encapsulates the fields required to request catalog configuration.
Definition: CatalogVersionRequest.h:38
Contains fields required to request compatible versions for the given catalog.
Definition: CompatibleVersionsRequest.h:36
Encapsulates the fields required to request a list of versions for the given catalog.
Definition: VersionsRequest.h:39
Rules all the other namespaces.
Definition: AppleSignInProperties.h:24
Configures the behavior of the OlpClient class.
Definition: OlpClientSettings.h:180