Skip to content
Open
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
34 changes: 34 additions & 0 deletions .github/workflows/psv_pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,21 @@ jobs:
run: ./scripts/linux/psv/test_psv.sh
shell: bash

psv-linux-22-04-gcc11-build-no-exceptions:
name: PSV.Linux.22.04.gcc11.OLP_SDK_NO_EXCEPTION=ON
runs-on: ubuntu-22.04
env:
BUILD_TYPE: RelWithDebInfo
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Ubuntu dependencies
run: sudo apt-get update && sudo apt-get install -y ccache libssl-dev libcurl4-openssl-dev --no-install-recommends
shell: bash
- name: Compile project with cmake and ccache
run: gcc --version && ./scripts/linux/psv/build_psv_no_exceptions.sh
shell: bash

psv-linux-latest-gcc14-build-no-cache:
name: PSV.Linux.latest.gcc14.OLP_SDK_ENABLE_DEFAULT_CACHE=OFF
runs-on: ubuntu-latest
Expand Down Expand Up @@ -181,6 +196,25 @@ jobs:
run: scripts/linux/psv/test_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
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ The table below lists the dependencies of the Data SDK.
| Boost (headers only) | 1.82.0 |
| LevelDB | 1.21 |
| Snappy | 1.1.7 |
| RapidJSON | latest |
| Zlib | 1.3.1 |

### Linux dependencies
Expand Down
2 changes: 1 addition & 1 deletion docs/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ cmake --build . --target install

<a href="https://cmake.org/download/" target="_blank">CMake</a> is the main build system. The minimal required version of CMake is 3.9.

CMake downloads <a href="https://github.com/google/leveldb" target="_blank">LevelDB</a>, <a href="https://github.com/google/snappy" target="_blank">Snappy</a>, <a href="https://github.com/Tencent/rapidjson" target="_blank">RapidJSON</a>, and <a href="https://www.boost.org/" target="_blank">Boost</a>. To disable downloading, set `OLP_SDK_BUILD_EXTERNAL_DEPS` to `OFF`. For details on CMake flags, see the [related](#cmake-flags) section.
CMake downloads <a href="https://github.com/google/leveldb" target="_blank">LevelDB</a>, <a href="https://github.com/google/snappy" target="_blank">Snappy</a>, and <a href="https://www.boost.org/" target="_blank">Boost</a>. To disable downloading, set `OLP_SDK_BUILD_EXTERNAL_DEPS` to `OFF`. For details on CMake flags, see the [related](#cmake-flags) section.

**To build the Data SDK:**

Expand Down
2 changes: 1 addition & 1 deletion docs/work-with-data-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ The example below demonstrates how to use the `olp::client::OlpClient` class fro
}
```

5. If the check passed and the status of the received `olp::client::HttpResponse` is `olp::http::HttpStatusCode::OK` (that is 200 OK), extract the encoded JSON from the response and parse it using RapidJSON or any other JSON parsing library.
5. If the check passed and the status of the received `olp::client::HttpResponse` is `olp::http::HttpStatusCode::OK` (that is 200 OK), extract the encoded JSON from the response and parse it using JSON parsing library.

```cpp
std::string response_json;
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);
9 changes: 0 additions & 9 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ set(OLP_SDK_CPP_SNAPPY_TAG "1.1.7")
set(OLP_SDK_CPP_LEVELDB_URL "https://github.com/google/leveldb.git")
set(OLP_SDK_CPP_LEVELDB_TAG "1.21")

set(OLP_SDK_CPP_RAPIDJSON_URL "https://github.com/Tencent/rapidjson.git")
# Next commit after that breaks our build
set(OLP_SDK_CPP_RAPIDJSON_TAG "d621dc9e9c77f81e5c8a35b8dcc16dcd63351321")

set(OLP_SDK_CPP_BOOST_URL "https://github.com/boostorg/boost.git")
set(OLP_SDK_CPP_BOOST_TAG "boost-1.82.0")

Expand All @@ -73,11 +69,6 @@ if(NOT TARGET GTest AND NOT GTest_FOUND)
add_subdirectory(googletest)
endif()

find_package(RapidJSON 1.1.0 QUIET)
if(NOT TARGET RapidJSON AND NOT RapidJSON_FOUND)
add_subdirectory(rapidjson)
endif()

if(OLP_SDK_ENABLE_DEFAULT_CACHE)
find_package(leveldb QUIET)
if(NOT TARGET leveldb AND NOT leveldb_FOUND)
Expand Down
4 changes: 3 additions & 1 deletion external/boost/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 @@ -32,6 +32,8 @@ else()
set(B2_CMD ./b2)
endif()

set(PATCH_BOOST_CMD "git apply -v ${CMAKE_CURRENT_SOURCE_DIR}/boost_182_json_noexceptions.diff")

configure_file(CMakeLists.txt.boost.in download/CMakeLists.txt @ONLY)

set(CMAKE_VERBOSE_MAKEFILE ON)
Expand Down
12 changes: 9 additions & 3 deletions external/boost/CMakeLists.txt.boost.in
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 All @@ -25,6 +25,7 @@ ExternalProject_Add(boost-download
GIT_REPOSITORY @OLP_SDK_CPP_BOOST_URL@
GIT_TAG @OLP_SDK_CPP_BOOST_TAG@
GIT_SUBMODULES libs/algorithm
libs/align
libs/any
libs/array
libs/assert
Expand All @@ -34,18 +35,20 @@ ExternalProject_Add(boost-download
libs/container_hash
libs/core
libs/date_time
libs/detail
libs/describe
libs/detail
libs/format
libs/function_types
libs/headers
libs/integer
libs/intrusive
libs/io
libs/iterator
libs/json
libs/lexical_cast
libs/move
libs/mpl
libs/mp11
libs/mpl
libs/numeric/conversion
libs/optional
libs/predef
Expand All @@ -55,18 +58,21 @@ ExternalProject_Add(boost-download
libs/serialization
libs/smart_ptr
libs/static_assert
libs/system
libs/throw_exception
libs/tokenizer
libs/tti
libs/type_index
libs/type_traits
libs/utility
libs/uuid
libs/variant2
libs/winapi
tools/build
tools/boost_install
GIT_SHALLOW 1
SOURCE_DIR "@CMAKE_CURRENT_BINARY_DIR@/external_boost"
PATCH_COMMAND @PATCH_BOOST_CMD@
BUILD_IN_SOURCE 1
UPDATE_COMMAND ""
CONFIGURE_COMMAND @BOOTSTRAP_CMD@
Expand Down
56 changes: 56 additions & 0 deletions external/boost/boost_182_json_noexceptions.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
diff --git a/libs/json/include/boost/json/detail/value_to.hpp b/libs/json/include/boost/json/detail/value_to.hpp
index 7cb779e..6df1c9d 100644
--- a/libs/json/include/boost/json/detail/value_to.hpp
+++ b/libs/json/include/boost/json/detail/value_to.hpp
@@ -652,10 +652,13 @@ value_to_impl(
value const& jv,
user_conversion_tag)
{
+#ifndef BOOST_NO_EXCEPTIONS
try
{
+#endif // BOOST_NO_EXCEPTIONS
return {
boost::system::in_place_value, tag_invoke(value_to_tag<T>(), jv)};
+#ifndef BOOST_NO_EXCEPTIONS
}
catch( std::bad_alloc const&)
{
@@ -671,6 +674,7 @@ value_to_impl(
BOOST_JSON_FAIL(ec, error::exception);
return {boost::system::in_place_error, ec};
}
+#endif // BOOST_NO_EXCEPTIONS
}

// no suitable conversion implementation
diff --git a/libs/json/include/boost/json/impl/value.ipp b/libs/json/include/boost/json/impl/value.ipp
index 7460c02..7513b38 100644
--- a/libs/json/include/boost/json/impl/value.ipp
+++ b/libs/json/include/boost/json/impl/value.ipp
@@ -381,7 +381,9 @@ operator>>(
char read_buf[BOOST_JSON_STACK_BUFFER_SIZE / 2];
std::streambuf& buf = *is.rdbuf();
std::ios::iostate err = std::ios::goodbit;
+#ifndef BOOST_NO_EXCEPTIONS
try
+#endif
{
while( true )
{
@@ -437,6 +439,7 @@ operator>>(
break;
}
}
+#ifndef BOOST_NO_EXCEPTIONS
catch(...)
{
try
@@ -450,6 +453,7 @@ operator>>(
if( is.exceptions() & std::ios::badbit )
throw;
}
+#endif

is.setstate(err | std::ios::failbit);
return is;
Loading
Loading