Skip to content

Commit 9aefe2b

Browse files
Replace boost::optional with std::optional and boost::any with std::variant
Migrated all uses of boost::optional to std::optional and updated related code to use .value() and .has_value() instead of .get() and .is_initialized(). Refactored union types to use std::variant instead of boost::any, and updated Avro codec_traits for std::optional. Also updated usages in example, protocol handlers, and data array handlers to match new APIs.
1 parent 5f18443 commit 9aefe2b

10 files changed

Lines changed: 218 additions & 603 deletions

File tree

.github/workflows/github-actions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ jobs:
331331
make &&
332332
make install &&
333333
cd ${{ github.workspace }}/.. &&
334-
wget --no-verbose https://downloads.apache.org/avro/avro-1.11.3/cpp/avro-cpp-1.11.3.tar.gz &&
334+
wget --no-verbose https://archive.apache.org/dist/avro/avro-1.11.3/cpp/avro-cpp-1.11.3.tar.gz &&
335335
tar xf avro-cpp-1.11.3.tar.gz &&
336336
sed -i '' 's/cmake_minimum_required (VERSION 3.1)/cmake_minimum_required (VERSION 3.5)/' avro-cpp-1.11.3/CMakeLists.txt &&
337337
sed -i '' 's/if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.0)/if (APPLE)/' avro-cpp-1.11.3/CMakeLists.txt &&

cmake/pyproject.toml.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ keywords = [
4343
]
4444
requires-python = ">=3.8"
4545
dependencies = [
46-
'fesapi==2.12.1',
46+
'fesapi==2.13.0',
4747
]
4848

4949
[project.urls]

example/withFesapi/etpClient.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ void askUser(std::shared_ptr<ETP_NS::AbstractSession> session, COMMON_NS::DataOb
196196
const auto resources = session->getResources(mb.context, mb.scope);
197197
for (auto& resource : resources) {
198198
std::cout << resource.uri << std::endl;
199-
if (resource.has_sourceCount()) std::cout << "Source count: " << resource.sourceCount.get() << std::endl;
200-
if (resource.has_targetCount()) std::cout << "Target count: " << resource.targetCount.get() << std::endl;
199+
if (resource.has_sourceCount()) std::cout << "Source count: " << resource.sourceCount.value() << std::endl;
200+
if (resource.has_targetCount()) std::cout << "Target count: " << resource.targetCount.value() << std::endl;
201201
}
202202
continue;
203203
}
@@ -680,7 +680,7 @@ void askUser(std::shared_ptr<ETP_NS::AbstractSession> session, COMMON_NS::DataOb
680680
Energistics::Etp::v12::Datatypes::AnyArray data;
681681
Energistics::Etp::v12::Datatypes::ArrayOfInt arrayOfInt;
682682
arrayOfInt.values = { 0,1,2,3,4,5,6,7,8,9 };
683-
data.item.set_ArrayOfInt(arrayOfInt);
683+
data.item.set_ArrayOfInt(std::move(arrayOfInt));
684684
pda.dataArrays["0"].array.data = data;
685685
std::cout << "Start sending the array" << std::endl;
686686

python/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ if (WITH_FESAPI)
5858
set (FESAPI_LIBRARY_RELEASE_WLE ",'${FESAPI_LIBRARY_RELEASE_WLE}'")
5959
endif ()
6060
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
61-
set (EXTRA_COMPILE_ARGS "extra-compile-args=['/DSWIG_TYPE_TABLE=FESTAPI', '/utf-8']")
61+
set (EXTRA_COMPILE_ARGS "extra-compile-args=['/DSWIG_TYPE_TABLE=FESTAPI', '/std:c++17', '/utf-8']")
6262
else ()
6363
set (EXTRA_COMPILE_ARGS "extra-compile-args=['-DSWIG_TYPE_TABLE=FESTAPI', '-std=c++17']")
6464
endif()

0 commit comments

Comments
 (0)