Skip to content

Commit

Permalink
Fixes ABI compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
jake-at-work committed Jan 11, 2021
1 parent d906f8d commit 0d5b80c
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 25 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ option(USE_PCH "Use precompiled headers (PCH)." OFF)
option(USE_CPP_COVERAGE "Enable profiling and coverage report analysis for apache-geode cpp library." OFF)
option(USE_RAT "Enable Apache Rat checking." OFF)
option(WITH_IPV6 "Enable IPv6 support." OFF)
option(WITH_ABI_COMPATIBILITY "Enforce ABI compatibility." ON)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)

Expand Down
4 changes: 4 additions & 0 deletions cppcache/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ set(SOURCES_ALL ${SOURCES} ${PRIVATE_HEADERS} ${PUBLIC_HEADERS} ${CONFIGURE_IN_F

add_library(_apache-geode INTERFACE)

target_compile_definitions(_apache-geode INTERFACE
APACHE_GEODE_ABI_COMPATIBILITY=$<BOOL:${WITH_ABI_COMPATIBILITY}>
)

if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
target_link_libraries(_apache-geode INTERFACE
demangle
Expand Down
10 changes: 4 additions & 6 deletions cppcache/include/geode/AuthenticatedView.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,12 @@ class APACHE_GEODE_EXPORT AuthenticatedView : public RegionService {
*/
std::vector<std::shared_ptr<Region>> rootRegions() const override;

/**
* @brief destructor
*/
#if (APACHE_GEODE_ABI_COMPATIBILITY)
virtual ~AuthenticatedView();
#else
~AuthenticatedView() override;
#endif

/**
* @brief constructors
*/
AuthenticatedView(std::shared_ptr<Properties> credentials,
std::shared_ptr<Pool> pool, CacheImpl* cacheImpl);
AuthenticatedView(AuthenticatedView&& other) = default;
Expand Down
6 changes: 6 additions & 0 deletions cppcache/include/geode/Cache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,13 @@ class APACHE_GEODE_EXPORT Cache : public GeodeCache {
LogLevel getLogLevel();

Cache() = delete;

#if (APACHE_GEODE_ABI_COMPATIBILITY)
virtual ~Cache();
#else
~Cache() override;
#endif

Cache(const Cache& other) = delete;
Cache& operator=(const Cache& other) = delete;
Cache(Cache&& other) noexcept;
Expand Down
18 changes: 8 additions & 10 deletions cppcache/include/geode/GeodeCache.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 {
Expand All @@ -47,7 +43,9 @@ class SystemProperties;

class APACHE_GEODE_EXPORT GeodeCache : public RegionService {
public:
~GeodeCache() override = default;
#if (!APACHE_GEODE_ABI_COMPATIBILITY)
~GeodeCache() override = 0;
#endif

/** Returns the name of this cache.
* @return the string name of this cache
Expand Down
12 changes: 4 additions & 8 deletions cppcache/include/geode/RegionService.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
#include "PdxInstanceFactory.hpp"
#include "internal/geode_globals.hpp"

/**
* @file
*/

namespace apache {
namespace geode {
namespace client {
Expand Down Expand Up @@ -60,11 +56,10 @@ class QueryService;
*/

class APACHE_GEODE_EXPORT RegionService {
/**
* @brief public methods
*/
public:
virtual ~RegionService() = default;
#if (!APACHE_GEODE_ABI_COMPATIBILITY)
virtual ~RegionService() = 0;
#endif

/**
* Indicates if this cache has been closed.
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions cppcache/include/geode/internal/geode_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@

#include "apache-geode_export.h"

#ifndef APACHE_GEODE_ABI_COMPATIBILITY
#define APACHE_GEODE_ABI_COMPATIBILITY 1
#endif

/**@namespace geode This namespace contains all the Geode
* C++ API classes, enumerations and globals.
*/
Expand Down
2 changes: 1 addition & 1 deletion cppcache/src/AuthenticatedView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ AuthenticatedView::AuthenticatedView(std::shared_ptr<Properties> credentials,
m_remoteQueryService(nullptr),
m_cacheImpl(cacheImpl) {}

AuthenticatedView::~AuthenticatedView() {}
AuthenticatedView::~AuthenticatedView() = default;

PdxInstanceFactory AuthenticatedView::createPdxInstanceFactory(
const std::string& className, bool expectDomainClass) const {
Expand Down
30 changes: 30 additions & 0 deletions cppcache/src/GeodeCache.cpp
Original file line number Diff line number Diff line change
@@ -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 <geode/GeodeCache.hpp>

namespace apache {
namespace geode {
namespace client {

#if (!APACHE_GEODE_ABI_COMPATIBILITY)
GeodeCache::~GeodeCache() = default;
#endif

} // namespace client
} // namespace geode
} // namespace apache
30 changes: 30 additions & 0 deletions cppcache/src/RegionService.cpp
Original file line number Diff line number Diff line change
@@ -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 <geode/RegionService.hpp>

namespace apache {
namespace geode {
namespace client {

#if (!APACHE_GEODE_ABI_COMPATIBILITY)
RegionService::~RegionService() = default;
#endif

} // namespace client
} // namespace geode
} // namespace apache

0 comments on commit 0d5b80c

Please sign in to comment.