olp-cpp-sdk 1.24.0
Loading...
Searching...
No Matches
KeyGenerator.h
1/*
2 * Copyright (C) 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 <string>
23
24#include <olp/core/CoreApi.h>
25#include <olp/core/geo/tiling/TileKey.h>
26#include <olp/core/porting/optional.h>
27
28namespace olp {
29namespace cache {
30
34class CORE_API KeyGenerator {
35 public:
45 static std::string CreateApiKey(const std::string& hrn,
46 const std::string& service,
47 const std::string& version);
48
56 static std::string CreateCatalogKey(const std::string& hrn);
57
65 static std::string CreateLatestVersionKey(const std::string& hrn);
66
77 static std::string CreatePartitionKey(
78 const std::string& hrn, const std::string& layer_id,
79 const std::string& partition_id,
80 const porting::optional<int64_t>& version);
81
91 static std::string CreatePartitionsKey(
92 const std::string& hrn, const std::string& layer_id,
93 const porting::optional<int64_t>& version);
94
103 static std::string CreateLayerVersionsKey(const std::string& hrn,
104 const int64_t version);
105
117 static std::string CreateQuadTreeKey(
118 const std::string& hrn, const std::string& layer_id,
119 olp::geo::TileKey root, const porting::optional<int64_t>& version,
120 int32_t depth);
121
131 static std::string CreateDataHandleKey(const std::string& hrn,
132 const std::string& layer_id,
133 const std::string& data_handle);
134};
135
136} // namespace cache
137} // namespace olp
Helper class to generate cache keys for different entities.
Definition KeyGenerator.h:34
static std::string CreatePartitionKey(const std::string &hrn, const std::string &layer_id, const std::string &partition_id, const porting::optional< int64_t > &version)
Generates cache key for storing partition data.
static std::string CreateApiKey(const std::string &hrn, const std::string &service, const std::string &version)
Generates cache key for service API.
static std::string CreatePartitionsKey(const std::string &hrn, const std::string &layer_id, const porting::optional< int64_t > &version)
Generates cache key for storing list of partitions.
static std::string CreateQuadTreeKey(const std::string &hrn, const std::string &layer_id, olp::geo::TileKey root, const porting::optional< int64_t > &version, int32_t depth)
Generates cache key for storing quadtree metadata.
static std::string CreateLatestVersionKey(const std::string &hrn)
Generates cache key to store latest catalog version.
static std::string CreateLayerVersionsKey(const std::string &hrn, const int64_t version)
Generates cache key for storing list of available layer versions.
static std::string CreateCatalogKey(const std::string &hrn)
Generates cache key for catalog data.
static std::string CreateDataHandleKey(const std::string &hrn, const std::string &layer_id, const std::string &data_handle)
Generates cache key for data handle entities.
Addresses a tile in a quadtree.
Definition TileKey.h:63
Rules all the other namespaces.
Definition AppleSignInProperties.h:24