Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/psv_pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,25 @@ jobs:
run: scripts/linux/psv/build_psv.sh
shell: bash

psv-linux-22-04-clang-hidden-build:
name: PSV.Linux.22.04.clang.hidden
runs-on: ubuntu-22.04
env:
BUILD_TYPE: RelWithDebInfo
CC: clang-11
CXX: clang++-11
CXXFLAGS: -Wno-deprecated-copy
EXTRA_CMAKE_OPTIONS: -DCMAKE_CXX_VISIBILITY_PRESET=hidden -DOLP_SDK_ENABLE_TESTING=OFF
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Ubuntu dependencies
run: sudo apt-get update -y && sudo apt-get install clang-11 ccache libcurl4-openssl-dev -y --no-install-recommends --fix-missing
shell: bash
- name: Compile project on Clang
run: scripts/linux/psv/build_psv.sh
shell: bash

psv-android-22-04-build:
name: PSV.Linux.Android.22.04
runs-on: ubuntu-22.04
Expand Down
21 changes: 20 additions & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2019-2020 HERE Europe B.V.
# Copyright (C) 2019-2026 HERE Europe B.V.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -81,6 +81,25 @@ else()
olp-cpp-sdk-authentication
olp-cpp-sdk-dataservice-read)

target_compile_definitions(${OLP_SDK_DATASERVICE_READ_EXAMPLE_TARGET}
PRIVATE EXAMPLES_LIBRARY)
target_compile_definitions(${OLP_SDK_DATASERVICE_WRITE_EXAMPLE_TARGET}
PRIVATE EXAMPLES_LIBRARY)
target_compile_definitions(${OLP_SDK_DATASERVICE_CACHE_EXAMPLE_TARGET}
PRIVATE EXAMPLES_LIBRARY)
target_compile_definitions(${OLP_SDK_DATASERVICE_READ_STREAM_LAYER_EXAMPLE_TARGET}
PRIVATE EXAMPLES_LIBRARY)
if(BUILD_SHARED_LIBS)
target_compile_definitions(${OLP_SDK_DATASERVICE_READ_EXAMPLE_TARGET}
PUBLIC EXAMPLES_SHARED_LIBRARY)
target_compile_definitions(${OLP_SDK_DATASERVICE_WRITE_EXAMPLE_TARGET}
PUBLIC EXAMPLES_SHARED_LIBRARY)
target_compile_definitions(${OLP_SDK_DATASERVICE_CACHE_EXAMPLE_TARGET}
PUBLIC EXAMPLES_SHARED_LIBRARY)
target_compile_definitions(${OLP_SDK_DATASERVICE_READ_STREAM_LAYER_EXAMPLE_TARGET}
PUBLIC EXAMPLES_SHARED_LIBRARY)
endif()

add_executable(${OLP_SDK_DATASERVICE_EXAMPLE_TARGET}
./main.cpp
./Examples.h
Expand Down
17 changes: 14 additions & 3 deletions examples/Examples.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2020 HERE Europe B.V.
* Copyright (C) 2019-2026 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,10 +19,21 @@

#pragma once

#include <olp/core/porting/export.h>

#ifdef EXAMPLES_SHARED_LIBRARY
#ifdef EXAMPLES_LIBRARY
#define EXAMPLES_API OLP_CPP_SDK_DECL_EXPORT
#else
#define EXAMPLES_API OLP_CPP_SDK_DECL_IMPORT
#endif // EXAMPLES_LIBRARY
#else
#define EXAMPLES_API
#endif // EXAMPLES_SHARED_LIBRARY

#include <string>

struct AccessKey
{
struct AccessKey {
std::string id; // Your here.access.key.id
std::string secret; // Your here.access.key.secret
};
19 changes: 12 additions & 7 deletions examples/ProtectedCacheExample.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 HERE Europe B.V.
* Copyright (C) 2020-2026 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,14 +21,19 @@

#include "Examples.h"

#include <string>

/**
* @brief Dataservice cache example.
* @brief Dataservice cache example.
*
* Gets the partition data using the HERE Open Location Platform with mutable cache.
* Makes the mutable cache path
* protected. Reads the same data from the protected cache.
* Gets the partition data using the HERE Open Location Platform with mutable
* cache. Makes the mutable cache path protected. Reads the same data from the
* protected cache.
* @param access_key Your access key ID and access key secret.
* @param The HERE Resource Name (HRN) of the catalog from which you want to read data.
* @param The HERE Resource Name (HRN) of the catalog from which you want to
* read data.
* @return 0 if data was published successfully.
*/
int RunExampleProtectedCache(const AccessKey& access_key, const std::string& catalog);
EXAMPLES_API
int RunExampleProtectedCache(const AccessKey& access_key,
const std::string& catalog);
4 changes: 3 additions & 1 deletion examples/ReadExample.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2020 HERE Europe B.V.
* Copyright (C) 2019-2026 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,6 +22,7 @@
#include "Examples.h"

#include <olp/core/porting/optional.h>
#include <string>

/**
* @brief Dataservice read example. Authenticate client using access key id and
Expand All @@ -33,6 +34,7 @@
* @param catalog_version The desired version of the catalog.
* @return result of publish data(0 - if succeed)
*/
EXAMPLES_API
int RunExampleRead(const AccessKey& access_key, const std::string& catalog,
const olp::porting::optional<int64_t>& catalog_version =
olp::porting::none);
4 changes: 3 additions & 1 deletion examples/StreamLayerReadExample.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2020 HERE Europe B.V.
* Copyright (C) 2019-2026 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,6 +22,7 @@
#include "Examples.h"

#include <olp/dataservice/read/SubscribeRequest.h>
#include <string>

/**
* @brief Dataservice read from stream layer example. Authenticate client using
Expand All @@ -34,6 +35,7 @@
* @param subscription_mode The type of client subscription.
* @return 0 on success, -1 otherwise.
*/
EXAMPLES_API
int RunStreamLayerExampleRead(
const AccessKey& access_key, const std::string& catalog,
const std::string& layer_id,
Expand Down
11 changes: 8 additions & 3 deletions examples/WriteExample.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2020 HERE Europe B.V.
* Copyright (C) 2019-2026 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,13 +21,18 @@

#include "Examples.h"

#include <string>

/**
* @brief Dataservice write example. Authenticate client using access key id and
* secret. Publish data to some layer in HRN catalog.
* @param access_key Your access key ID and access key secret.
* @param The HERE Resource Name (HRN) of the catalog to which you want to publish data.
* @param layer_id The layer ID of the catalog to which you want to publish data.
* @param The HERE Resource Name (HRN) of the catalog to which you want to
* publish data.
* @param layer_id The layer ID of the catalog to which you want to publish
* data.
* @return result of publish data(0 - if succeed)
*/
EXAMPLES_API
int RunExampleWrite(const AccessKey& access_key, const std::string& catalog,
const std::string& layer_id);
20 changes: 20 additions & 0 deletions olp-cpp-sdk-dataservice-read/src/utils/BoostJsonSrc.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright (C) 2026 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
* License-Filename: LICENSE
*/

#include <boost/json/src.hpp>
3 changes: 2 additions & 1 deletion scripts/linux/psv/build_psv.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -ex
#
# Copyright (C) 2019-2020 HERE Europe B.V.
# Copyright (C) 2019-2026 HERE Europe B.V.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,6 +30,7 @@ cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DOLP_SDK_BUILD_EXAMPLES=ON \
-DBUILD_SHARED_LIBS=ON \
$EXTRA_CMAKE_OPTIONS \
..

make -j$(nproc)
Expand Down
Loading