From b4ab4fec728f7c5b0c520111942ebe87a49a4d05 Mon Sep 17 00:00:00 2001 From: Jacob Barrett Date: Fri, 8 Jan 2021 14:36:19 -0800 Subject: [PATCH] Fixes ABI compatibility. --- cppcache/include/geode/AuthenticatedView.hpp | 10 +++---- cppcache/include/geode/Cache.hpp | 6 ++++ cppcache/include/geode/GeodeCache.hpp | 18 +++++------ cppcache/include/geode/RegionService.hpp | 12 +++----- .../include/geode/internal/geode_base.hpp | 4 +++ cppcache/src/AuthenticatedView.cpp | 2 +- cppcache/src/GeodeCache.cpp | 30 +++++++++++++++++++ cppcache/src/RegionService.cpp | 30 +++++++++++++++++++ 8 files changed, 87 insertions(+), 25 deletions(-) create mode 100644 cppcache/src/GeodeCache.cpp create mode 100644 cppcache/src/RegionService.cpp diff --git a/cppcache/include/geode/AuthenticatedView.hpp b/cppcache/include/geode/AuthenticatedView.hpp index f002885d7f..04bb1914a0 100644 --- a/cppcache/include/geode/AuthenticatedView.hpp +++ b/cppcache/include/geode/AuthenticatedView.hpp @@ -87,14 +87,12 @@ class APACHE_GEODE_EXPORT AuthenticatedView : public RegionService { */ std::vector> rootRegions() const override; - /** - * @brief destructor - */ +#if (APACHE_GEODE_ABI_VERSION > 1) ~AuthenticatedView() override; +#else + virtual ~AuthenticatedView(); +#endif - /** - * @brief constructors - */ AuthenticatedView(std::shared_ptr credentials, std::shared_ptr pool, CacheImpl* cacheImpl); AuthenticatedView(AuthenticatedView&& other) = default; diff --git a/cppcache/include/geode/Cache.hpp b/cppcache/include/geode/Cache.hpp index 15ea3aa036..f59e457cf7 100644 --- a/cppcache/include/geode/Cache.hpp +++ b/cppcache/include/geode/Cache.hpp @@ -254,7 +254,13 @@ class APACHE_GEODE_EXPORT Cache : public GeodeCache { LogLevel getLogLevel(); Cache() = delete; + +#if (APACHE_GEODE_ABI_VERSION > 1) ~Cache() override; +#else + virtual ~Cache(); +#endif + Cache(const Cache& other) = delete; Cache& operator=(const Cache& other) = delete; Cache(Cache&& other) noexcept; diff --git a/cppcache/include/geode/GeodeCache.hpp b/cppcache/include/geode/GeodeCache.hpp index 711cec9301..7eec7e32f3 100644 --- a/cppcache/include/geode/GeodeCache.hpp +++ b/cppcache/include/geode/GeodeCache.hpp @@ -1,8 +1,3 @@ -#pragma once - -#ifndef GEODE_GEMFIRECACHE_H_ -#define GEODE_GEMFIRECACHE_H_ - /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -20,13 +15,14 @@ * limitations under the License. */ +#pragma once + +#ifndef GEODE_GEMFIRECACHE_H_ +#define GEODE_GEMFIRECACHE_H_ + #include "RegionService.hpp" #include "internal/geode_globals.hpp" -/** - * @file - */ - namespace apache { namespace geode { namespace client { @@ -47,7 +43,9 @@ class SystemProperties; class APACHE_GEODE_EXPORT GeodeCache : public RegionService { public: - ~GeodeCache() override = default; +#if (APACHE_GEODE_ABI_VERSION > 1) + ~GeodeCache() override = 0; +#endif /** Returns the name of this cache. * @return the string name of this cache diff --git a/cppcache/include/geode/RegionService.hpp b/cppcache/include/geode/RegionService.hpp index d1ff18a944..0bbe077307 100644 --- a/cppcache/include/geode/RegionService.hpp +++ b/cppcache/include/geode/RegionService.hpp @@ -26,10 +26,6 @@ #include "PdxInstanceFactory.hpp" #include "internal/geode_globals.hpp" -/** - * @file - */ - namespace apache { namespace geode { namespace client { @@ -60,11 +56,10 @@ class QueryService; */ class APACHE_GEODE_EXPORT RegionService { - /** - * @brief public methods - */ public: - virtual ~RegionService() = default; +#if (APACHE_GEODE_ABI_VERSION > 1) + virtual ~RegionService() = 0; +#endif /** * Indicates if this cache has been closed. @@ -129,6 +124,7 @@ class APACHE_GEODE_EXPORT RegionService { virtual PdxInstanceFactory createPdxInstanceFactory( const std::string& className, bool expectDomainClass) const = 0; }; + } // namespace client } // namespace geode } // namespace apache diff --git a/cppcache/include/geode/internal/geode_base.hpp b/cppcache/include/geode/internal/geode_base.hpp index c253e2bb3c..0a16c7252b 100644 --- a/cppcache/include/geode/internal/geode_base.hpp +++ b/cppcache/include/geode/internal/geode_base.hpp @@ -22,6 +22,10 @@ #include "apache-geode_export.h" +#ifndef APACHE_GEODE_ABI_VERSION +#define APACHE_GEODE_ABI_VERSION 0 +#endif + /**@namespace geode This namespace contains all the Geode * C++ API classes, enumerations and globals. */ diff --git a/cppcache/src/AuthenticatedView.cpp b/cppcache/src/AuthenticatedView.cpp index 888e68c712..6880a769da 100644 --- a/cppcache/src/AuthenticatedView.cpp +++ b/cppcache/src/AuthenticatedView.cpp @@ -161,7 +161,7 @@ AuthenticatedView::AuthenticatedView(std::shared_ptr credentials, m_remoteQueryService(nullptr), m_cacheImpl(cacheImpl) {} -AuthenticatedView::~AuthenticatedView() {} +AuthenticatedView::~AuthenticatedView() = default; PdxInstanceFactory AuthenticatedView::createPdxInstanceFactory( const std::string& className, bool expectDomainClass) const { diff --git a/cppcache/src/GeodeCache.cpp b/cppcache/src/GeodeCache.cpp new file mode 100644 index 0000000000..5ffb3b479e --- /dev/null +++ b/cppcache/src/GeodeCache.cpp @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#include + +namespace apache { +namespace geode { +namespace client { + +#if (APACHE_GEODE_ABI_VERSION > 1) +GeodeCache::~GeodeCache() = default; +#endif + +} // namespace client +} // namespace geode +} // namespace apache diff --git a/cppcache/src/RegionService.cpp b/cppcache/src/RegionService.cpp new file mode 100644 index 0000000000..1d5bd22560 --- /dev/null +++ b/cppcache/src/RegionService.cpp @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#include + +namespace apache { +namespace geode { +namespace client { + +#if (APACHE_GEODE_ABI_VERSION > 1) +virtual RegionService::~RegionService() = default; +#endif + +} // namespace client +} // namespace geode +} // namespace apache