You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by jb...@apache.org on 2017/06/06 17:56:49 UTC
[23/23] geode-native git commit: GEODE-2741: Code cleanup to move to
std::shared_ptr
GEODE-2741: Code cleanup to move to std::shared_ptr
- Removed the following custom objects:
- HashMapT
- VectorT
- HashMapOfSharedBase
- HashSetT
Project: http://git-wip-us.apache.org/repos/asf/geode-native/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode-native/commit/11467dd9
Tree: http://git-wip-us.apache.org/repos/asf/geode-native/tree/11467dd9
Diff: http://git-wip-us.apache.org/repos/asf/geode-native/diff/11467dd9
Branch: refs/heads/develop
Commit: 11467dd9bb5988352b85fd723c93c97f15f7b82d
Parents: ac38453
Author: Jacob Barrett <jb...@pivotal.io>
Authored: Wed May 17 20:25:02 2017 +0000
Committer: Jacob Barrett <jb...@pivotal.io>
Committed: Tue Jun 6 10:51:46 2017 +0000
----------------------------------------------------------------------
src/clicache/src/CacheableHashSet.hpp | 42 +-
src/clicache/src/LocalRegion.cpp | 12 +-
src/clicache/src/PoolManager.cpp | 6 +-
src/clicache/src/QueryService.cpp | 5 +-
src/clicache/src/Region.cpp | 66 +-
src/cppcache/include/geode/Cache.hpp | 44 +-
src/cppcache/include/geode/CacheFactory.hpp | 8 +-
.../include/geode/CacheableBuiltins.hpp | 75 +-
.../include/geode/CacheableFileName.hpp | 4 +-
src/cppcache/include/geode/CacheableKey.hpp | 46 ++
.../include/geode/CacheableObjectArray.hpp | 7 +-
src/cppcache/include/geode/CacheableString.hpp | 10 +-
src/cppcache/include/geode/DataInput.hpp | 62 +-
src/cppcache/include/geode/DataOutput.hpp | 58 +-
.../include/geode/DistributedSystem.hpp | 2 +-
src/cppcache/include/geode/Exception.hpp | 12 +-
src/cppcache/include/geode/ExceptionTypes.hpp | 92 +--
.../include/geode/HashMapOfSharedBase.hpp | 161 -----
src/cppcache/include/geode/HashMapT.hpp | 207 +-----
.../include/geode/HashSetOfSharedBase.hpp | 153 ----
src/cppcache/include/geode/HashSetT.hpp | 164 +----
.../include/geode/PdxInstanceFactory.hpp | 602 ++++++++--------
src/cppcache/include/geode/PdxReader.hpp | 2 +-
src/cppcache/include/geode/PdxSerializer.hpp | 2 +-
src/cppcache/include/geode/PdxWrapper.hpp | 62 +-
src/cppcache/include/geode/PdxWriter.hpp | 58 +-
src/cppcache/include/geode/PoolManager.hpp | 17 +-
src/cppcache/include/geode/RegionAttributes.hpp | 34 +-
src/cppcache/include/geode/SelectResults.hpp | 2 +-
src/cppcache/include/geode/Serializable.hpp | 5 +-
src/cppcache/include/geode/Serializer.hpp | 116 ++-
src/cppcache/include/geode/SharedPtrHelper.hpp | 4 +-
src/cppcache/include/geode/Struct.hpp | 29 +-
src/cppcache/include/geode/StructSet.hpp | 2 +-
src/cppcache/include/geode/SystemProperties.hpp | 90 +--
src/cppcache/include/geode/VectorT.hpp | 239 +------
src/cppcache/include/geode/geode_base.hpp | 12 +-
.../geode/statistics/StatisticsFactory.hpp | 12 +-
src/cppcache/include/geode/utils.hpp | 80 +++
.../integration-test/BBNamingContext.cpp | 20 +-
.../integration-test/BBNamingContext.hpp | 4 +-
.../BuiltinCacheableWrappers.hpp | 105 ++-
src/cppcache/integration-test/CacheHelper.cpp | 142 ++--
src/cppcache/integration-test/CacheHelper.hpp | 24 +-
.../integration-test/CacheImplHelper.hpp | 7 +-
.../integration-test/CacheableWrapper.hpp | 2 +-
src/cppcache/integration-test/LocatorHelper.hpp | 7 +-
src/cppcache/integration-test/QueryHelper.hpp | 21 +-
src/cppcache/integration-test/QueryStrings.hpp | 40 +-
.../integration-test/ThinClientDistOps.hpp | 47 +-
.../integration-test/ThinClientDistOps2.hpp | 32 +-
.../integration-test/ThinClientDurable.hpp | 21 +-
.../ThinClientDurableFailover.hpp | 21 +-
.../integration-test/ThinClientDurableInit.hpp | 4 +-
.../ThinClientDurableInterest.hpp | 21 +-
.../integration-test/ThinClientFailover.hpp | 22 +-
.../integration-test/ThinClientFailover2.hpp | 22 +-
.../integration-test/ThinClientFailover3.hpp | 26 +-
.../ThinClientFailoverInterest.hpp | 26 +-
.../ThinClientFailoverInterest2.hpp | 26 +-
.../ThinClientFailoverInterestAllWithCache.hpp | 66 +-
.../ThinClientFailoverRegex.hpp | 26 +-
.../integration-test/ThinClientGatewayTest.hpp | 9 +-
.../integration-test/ThinClientHeapLRU.hpp | 31 +-
.../integration-test/ThinClientHelper.hpp | 38 +-
.../integration-test/ThinClientInterestList.hpp | 31 +-
.../ThinClientInterestList2.hpp | 31 +-
.../integration-test/ThinClientListenerInit.hpp | 6 +-
.../ThinClientListenerWriter.hpp | 2 +-
.../ThinClientLocalCacheLoader.hpp | 6 +-
.../integration-test/ThinClientNotification.hpp | 22 +-
.../ThinClientPdxSerializer.hpp | 4 +-
.../ThinClientPdxSerializers.hpp | 7 +-
.../integration-test/ThinClientPutAll.hpp | 82 +--
.../ThinClientPutAllTimeout.hpp | 12 +-
.../ThinClientPutAllWithCallBack.hpp | 77 +-
.../integration-test/ThinClientPutGetAll.hpp | 61 +-
.../ThinClientRIwithlocalRegionDestroy.hpp | 10 +-
.../integration-test/ThinClientRegex.hpp | 31 +-
.../integration-test/ThinClientRegex2.hpp | 31 +-
.../integration-test/ThinClientRegex3.hpp | 27 +-
.../integration-test/ThinClientRemoveAll.hpp | 32 +-
src/cppcache/integration-test/ThinClientSSL.hpp | 16 +-
.../ThinClientSSLWithPassword.hpp | 22 +-
.../ThinClientSecurityHelper.hpp | 13 +-
.../integration-test/ThinClientTXFailover.hpp | 22 +-
.../integration-test/ThinClientTransactions.hpp | 20 +-
.../ThinClientTransactionsXA.hpp | 20 +-
.../integration-test/ThinClientVersionedOps.hpp | 35 +-
src/cppcache/integration-test/TimeBomb.hpp | 6 +-
src/cppcache/integration-test/fw_dunit.cpp | 38 +-
src/cppcache/integration-test/testCache.cpp | 2 +-
.../testCreateAndDestroyPool.cpp | 14 +-
.../integration-test/testDataOutput.cpp | 8 +-
.../integration-test/testEntriesMap.cpp | 68 +-
.../testEntriesMapForVersioning.cpp | 27 +-
.../integration-test/testExpiration.cpp | 34 +-
src/cppcache/integration-test/testLRUList.cpp | 13 +-
src/cppcache/integration-test/testLogger.cpp | 2 +-
.../testOverflowPutGetSqLite.cpp | 70 +-
.../testRegionAccessThreadSafe.cpp | 2 +-
.../integration-test/testSerialization.cpp | 2 +-
.../integration-test/testSystemProperties.cpp | 6 +-
.../testThinClientAfterRegionLive.cpp | 2 +-
.../integration-test/testThinClientBigValue.cpp | 25 +-
.../testThinClientCacheables.cpp | 37 +-
.../testThinClientCacheablesLimits.cpp | 24 +-
.../testThinClientConflation.cpp | 5 +-
.../integration-test/testThinClientCq.cpp | 44 +-
.../integration-test/testThinClientCqDelta.cpp | 13 +-
.../testThinClientCqDurable.cpp | 36 +-
.../testThinClientCqFailover.cpp | 12 +-
.../testThinClientCqHAFailover.cpp | 12 +-
.../integration-test/testThinClientCqIR.cpp | 5 +-
.../testThinClientDeltaWithNotification.cpp | 12 +-
.../testThinClientDisconnectionListioner.cpp | 2 +-
.../testThinClientExecuteFunctionPrSHOP.cpp | 91 +--
.../testThinClientFixedPartitionResolver.cpp | 23 +-
.../testThinClientGetInterests.cpp | 15 +-
.../testThinClientHADistOps.cpp | 39 +-
.../testThinClientHAEventIDMap.cpp | 39 +-
.../testThinClientHAFailover.cpp | 30 +-
.../testThinClientHAFailoverRegex.cpp | 26 +-
.../testThinClientHAMixedRedundancy.cpp | 30 +-
.../testThinClientHAPeriodicAck.cpp | 41 +-
.../testThinClientHAQueryFailover.cpp | 16 +-
.../integration-test/testThinClientHeapLRU.cpp | 13 +-
.../testThinClientIntResPolKeysInv.cpp | 31 +-
.../testThinClientLRUExpiration.cpp | 115 +--
.../integration-test/testThinClientLocator.cpp | 4 +-
.../testThinClientLocatorFailover.cpp | 8 +-
.../integration-test/testThinClientMultiDS.cpp | 30 +-
...nClientNotificationWithDeltaWithoutcache.cpp | 10 +-
.../testThinClientPRPutAllFailover.cpp | 35 +-
.../testThinClientPRSingleHop.cpp | 47 +-
.../testThinClientPRSingleHopServerGroup.cpp | 131 +---
.../testThinClientPartitionResolver.cpp | 9 +-
.../testThinClientPdxDeltaWithNotification.cpp | 16 +-
.../integration-test/testThinClientPdxEnum.cpp | 18 +-
.../testThinClientPdxInstance.cpp | 138 ++--
.../integration-test/testThinClientPdxTests.cpp | 292 ++++----
.../testThinClientPoolExecuteFunction.cpp | 90 +--
...ExecuteFunctionDisableChunkHandlerThread.cpp | 27 +-
.../testThinClientPoolExecuteFunctionPrSHOP.cpp | 89 +--
...ClientPoolExecuteFunctionThrowsException.cpp | 18 +-
.../testThinClientPoolExecuteHAFunction.cpp | 24 +-
...estThinClientPoolExecuteHAFunctionPrSHOP.cpp | 18 +-
.../testThinClientPoolLocator.cpp | 6 +-
.../testThinClientPoolRedundancy.cpp | 15 +-
.../testThinClientPoolServer.cpp | 2 +-
.../testThinClientPutAllPRSingleHop.cpp | 8 +-
.../testThinClientPutWithDelta.cpp | 14 +-
...nClientRegionQueryDifferentServerConfigs.cpp | 2 +-
.../testThinClientRegionQueryExclusiveness.cpp | 16 +-
.../testThinClientRemoteQueryFailover.cpp | 26 +-
.../testThinClientRemoteQueryFailoverPdx.cpp | 26 +-
.../testThinClientRemoteQueryRS.cpp | 52 +-
.../testThinClientRemoteQuerySS.cpp | 78 +-
.../testThinClientRemoteQueryTimeout.cpp | 23 +-
.../testThinClientRemoteRegionQuery.cpp | 27 +-
.../testThinClientRemoveOps.cpp | 70 +-
.../testThinClientSSLAuthCorrupt.cpp | 24 +-
.../testThinClientSSLAuthFail.cpp | 24 +-
.../testThinClientSSLAuthUntrusted.cpp | 24 +-
.../testThinClientSSLWithSecurityAuthz.cpp | 23 +-
.../testThinClientSecurityAuthentication.cpp | 25 +-
.../testThinClientSecurityAuthenticationMU.cpp | 32 +-
.../testThinClientSecurityAuthorization.cpp | 29 +-
.../testThinClientSecurityAuthorizationMU.cpp | 52 +-
.../testThinClientSecurityCQAuthorization.cpp | 8 +-
.../testThinClientSecurityCQAuthorizationMU.cpp | 10 +-
.../testThinClientSecurityDH.cpp | 12 +-
.../testThinClientSecurityDH_MU.cpp | 15 +-
...inClientSecurityDurableCQAuthorizationMU.cpp | 10 +-
.../testThinClientSecurityMultiUserTest.cpp | 4 +-
.../testThinClientSecurityPostAuthorization.cpp | 25 +-
.../testThinClientStatistics.cpp | 46 +-
.../testThinClientTicket304.cpp | 2 +-
.../integration-test/testThinClientTracking.cpp | 4 +-
.../testThinClientWriterException.cpp | 6 +-
src/cppcache/integration-test/testUtils.hpp | 26 +-
.../testXmlCacheCreationWithPools.cpp | 14 +-
src/cppcache/src/AdminRegion.cpp | 8 +-
src/cppcache/src/AdminRegion.hpp | 10 +-
src/cppcache/src/Assert.cpp | 2 +-
src/cppcache/src/AttributesFactory.cpp | 6 +-
src/cppcache/src/BucketServerLocation.hpp | 18 +-
src/cppcache/src/Cache.cpp | 36 +-
src/cppcache/src/CacheAttributes.cpp | 14 +-
src/cppcache/src/CacheConfig.cpp | 28 +-
src/cppcache/src/CacheFactory.cpp | 20 +-
src/cppcache/src/CacheImpl.cpp | 161 ++---
src/cppcache/src/CacheImpl.hpp | 6 +-
src/cppcache/src/CachePerfStats.hpp | 6 +-
.../src/CacheTransactionManagerImpl.cpp | 79 ++-
.../src/CacheTransactionManagerImpl.hpp | 2 +-
src/cppcache/src/CacheXmlCreation.cpp | 4 +-
src/cppcache/src/CacheXmlCreation.hpp | 2 +-
src/cppcache/src/CacheXmlParser.cpp | 258 +++----
src/cppcache/src/CacheableEnum.cpp | 2 +-
src/cppcache/src/CacheableKey.cpp | 4 +-
src/cppcache/src/CacheableObjectArray.cpp | 10 +-
src/cppcache/src/CacheableObjectPartList.cpp | 14 +-
src/cppcache/src/CacheableObjectPartList.hpp | 8 +-
src/cppcache/src/CacheableString.cpp | 18 +-
src/cppcache/src/ClientConnectionRequest.cpp | 4 +-
src/cppcache/src/ClientHealthStats.cpp | 4 +-
src/cppcache/src/ClientMetadata.cpp | 9 +-
src/cppcache/src/ClientMetadataService.cpp | 612 +++++++---------
src/cppcache/src/ClientMetadataService.hpp | 98 ++-
src/cppcache/src/ClientProxyMembershipID.cpp | 20 +-
src/cppcache/src/ClientProxyMembershipID.hpp | 7 +-
src/cppcache/src/ClientReplacementRequest.cpp | 4 +-
src/cppcache/src/ConcurrentEntriesMap.cpp | 2 +-
src/cppcache/src/ConcurrentEntriesMap.hpp | 5 +-
src/cppcache/src/CppCacheLibrary.cpp | 19 +-
src/cppcache/src/CqEventImpl.cpp | 2 +-
src/cppcache/src/CqQueryVsdStats.cpp | 18 +-
src/cppcache/src/CqService.cpp | 40 +-
src/cppcache/src/CqServiceVsdStats.cpp | 18 +-
src/cppcache/src/DataOutput.cpp | 5 +-
src/cppcache/src/DiffieHellman.cpp | 16 +-
src/cppcache/src/DiskPolicyType.cpp | 4 +-
src/cppcache/src/DistributedSystem.cpp | 66 +-
src/cppcache/src/DistributedSystemImpl.cpp | 6 +-
src/cppcache/src/EntriesMap.hpp | 6 +-
src/cppcache/src/EntriesMapFactory.cpp | 4 +-
src/cppcache/src/EventIdMap.cpp | 105 +--
src/cppcache/src/EventIdMap.hpp | 78 +-
src/cppcache/src/EventSource.cpp | 87 +++
src/cppcache/src/EventSource.hpp | 116 +++
src/cppcache/src/EvictionController.cpp | 2 +-
src/cppcache/src/Exception.cpp | 2 +-
src/cppcache/src/ExceptionTypes.cpp | 229 +++---
src/cppcache/src/ExecutionImpl.cpp | 106 +--
src/cppcache/src/ExpMapEntry.cpp | 2 +-
src/cppcache/src/ExpirationAction.cpp | 6 +-
src/cppcache/src/ExpiryTaskManager.cpp | 12 +-
src/cppcache/src/ExpiryTaskManager.hpp | 19 +-
src/cppcache/src/FairQueue.hpp | 12 +-
src/cppcache/src/FarSideEntryOp.cpp | 2 +-
src/cppcache/src/FunctionService.cpp | 12 +-
src/cppcache/src/HashMapOfSharedBase.cpp | 171 -----
src/cppcache/src/HashSetOfSharedBase.cpp | 167 -----
.../InternalCacheTransactionManager2PCImpl.cpp | 21 +-
src/cppcache/src/LRUAction.cpp | 6 +-
src/cppcache/src/LRUEntriesMap.cpp | 34 +-
src/cppcache/src/LRUEntriesMap.hpp | 6 +-
src/cppcache/src/LRUExpMapEntry.cpp | 2 +-
src/cppcache/src/LRUList.cpp | 12 +-
src/cppcache/src/LRUList.hpp | 6 +-
src/cppcache/src/LRUMapEntry.cpp | 2 +-
src/cppcache/src/LocalRegion.cpp | 171 +++--
src/cppcache/src/LocalRegion.hpp | 75 +-
src/cppcache/src/LocatorListRequest.cpp | 2 +-
src/cppcache/src/Log.cpp | 58 +-
src/cppcache/src/MapEntry.cpp | 2 +-
src/cppcache/src/MapSegment.cpp | 22 +-
src/cppcache/src/MapSegment.hpp | 18 +-
src/cppcache/src/MapWithLock.hpp | 28 +-
src/cppcache/src/PdxFieldType.cpp | 8 +-
src/cppcache/src/PdxHelper.cpp | 14 +-
src/cppcache/src/PdxInstanceFactoryImpl.cpp | 8 +-
src/cppcache/src/PdxInstanceFactoryImpl.hpp | 598 ++++++++--------
src/cppcache/src/PdxInstanceImpl.cpp | 703 +++++++++----------
src/cppcache/src/PdxLocalReader.cpp | 44 +-
src/cppcache/src/PdxLocalWriter.cpp | 51 +-
src/cppcache/src/PdxLocalWriter.hpp | 4 +-
src/cppcache/src/PdxReaderWithTypeCollector.cpp | 68 +-
src/cppcache/src/PdxRemoteReader.cpp | 58 +-
src/cppcache/src/PdxRemoteReader.hpp | 8 +-
src/cppcache/src/PdxType.cpp | 65 +-
src/cppcache/src/PdxType.hpp | 14 +-
src/cppcache/src/PdxTypeRegistry.cpp | 96 +--
src/cppcache/src/PdxTypeRegistry.hpp | 31 +-
src/cppcache/src/PdxWrapper.cpp | 26 +-
src/cppcache/src/PdxWriterWithTypeCollector.cpp | 2 +-
src/cppcache/src/Pool.cpp | 4 +-
src/cppcache/src/PoolAttributes.cpp | 6 +-
src/cppcache/src/PoolFactory.cpp | 7 +-
src/cppcache/src/PoolManager.cpp | 31 +-
src/cppcache/src/PoolStatistics.cpp | 16 +-
src/cppcache/src/PoolXmlCreation.hpp | 4 +-
src/cppcache/src/PreservedDataExpiryHandler.cpp | 14 +-
src/cppcache/src/Properties.cpp | 27 +-
src/cppcache/src/PutAllPartialResult.hpp | 2 +-
.../src/PutAllPartialResultServerException.cpp | 2 +-
src/cppcache/src/QueueConnectionRequest.cpp | 2 +-
src/cppcache/src/RegionAttributes.cpp | 140 ++--
src/cppcache/src/RegionFactory.cpp | 2 +-
src/cppcache/src/RegionInternal.hpp | 20 +-
src/cppcache/src/RegionStats.cpp | 18 +-
src/cppcache/src/RegionXmlCreation.cpp | 6 +-
src/cppcache/src/RegionXmlCreation.hpp | 6 +-
src/cppcache/src/RemoteQuery.cpp | 8 +-
src/cppcache/src/RemoteQueryService.cpp | 2 +-
src/cppcache/src/SerializationRegistry.cpp | 43 +-
src/cppcache/src/SerializationRegistry.hpp | 2 +-
src/cppcache/src/ServerLocation.hpp | 30 +-
src/cppcache/src/SharedPtr.cpp | 4 +-
src/cppcache/src/SslSockStream.cpp | 22 +-
src/cppcache/src/StackFrame.hpp | 9 +-
src/cppcache/src/StackTrace.cpp | 4 +-
src/cppcache/src/Struct.cpp | 39 +-
src/cppcache/src/StructSetImpl.cpp | 10 +-
src/cppcache/src/SystemProperties.cpp | 72 +-
src/cppcache/src/TSSTXStateWrapper.cpp | 4 +-
src/cppcache/src/TXCleaner.cpp | 13 +-
src/cppcache/src/TXCommitMessage.cpp | 11 +-
src/cppcache/src/TXRegionState.cpp | 39 -
src/cppcache/src/TXRegionState.hpp | 53 --
src/cppcache/src/TXState.cpp | 14 +-
src/cppcache/src/TXState.hpp | 3 +-
src/cppcache/src/TcpConn.cpp | 38 +-
src/cppcache/src/TcpConn.hpp | 2 +-
src/cppcache/src/TcpSslConn.cpp | 16 +-
src/cppcache/src/TcpSslConn.hpp | 8 +-
src/cppcache/src/TcrChunkedContext.hpp | 8 +-
src/cppcache/src/TcrConnection.cpp | 73 +-
src/cppcache/src/TcrConnection.hpp | 269 +++----
src/cppcache/src/TcrConnectionManager.cpp | 30 +-
src/cppcache/src/TcrConnectionManager.hpp | 11 +-
src/cppcache/src/TcrDistributionManager.cpp | 2 +-
src/cppcache/src/TcrEndpoint.cpp | 44 +-
src/cppcache/src/TcrEndpoint.hpp | 12 +-
src/cppcache/src/TcrHADistributionManager.cpp | 4 +-
src/cppcache/src/TcrHADistributionManager.hpp | 2 +-
src/cppcache/src/TcrMessage.cpp | 220 +++---
src/cppcache/src/TcrMessage.hpp | 59 +-
src/cppcache/src/TcrPoolEndPoint.hpp | 6 +-
src/cppcache/src/ThinClientBaseDM.cpp | 37 +-
src/cppcache/src/ThinClientBaseDM.hpp | 16 +-
.../src/ThinClientCacheDistributionManager.cpp | 4 +-
.../src/ThinClientDistributionManager.cpp | 6 +-
src/cppcache/src/ThinClientHARegion.cpp | 6 +-
src/cppcache/src/ThinClientHARegion.hpp | 2 +-
src/cppcache/src/ThinClientLocatorHelper.cpp | 30 +-
src/cppcache/src/ThinClientLocatorHelper.hpp | 14 +-
src/cppcache/src/ThinClientPoolDM.cpp | 182 +++--
src/cppcache/src/ThinClientPoolDM.hpp | 75 +-
src/cppcache/src/ThinClientPoolHADM.cpp | 6 +-
src/cppcache/src/ThinClientPoolHADM.hpp | 2 +-
src/cppcache/src/ThinClientPoolRegion.cpp | 2 +-
src/cppcache/src/ThinClientPoolStickyDM.cpp | 19 +-
src/cppcache/src/ThinClientPoolStickyDM.hpp | 2 +-
src/cppcache/src/ThinClientPoolStickyHADM.cpp | 4 +-
src/cppcache/src/ThinClientPoolStickyHADM.hpp | 2 +-
.../src/ThinClientRedundancyManager.cpp | 59 +-
.../src/ThinClientRedundancyManager.hpp | 10 +-
src/cppcache/src/ThinClientRegion.cpp | 558 +++++++--------
src/cppcache/src/ThinClientRegion.hpp | 70 +-
src/cppcache/src/ThinClientStickyManager.cpp | 39 +-
src/cppcache/src/TombstoneList.cpp | 66 +-
src/cppcache/src/TombstoneList.hpp | 37 +-
src/cppcache/src/TransactionSuspender.cpp | 2 +-
src/cppcache/src/TransactionalOperation.cpp | 14 +-
src/cppcache/src/TssConnectionWrapper.cpp | 27 +-
src/cppcache/src/UserAttributes.cpp | 12 +-
.../src/UserFunctionExecutionException.cpp | 2 +-
src/cppcache/src/Utils.cpp | 22 +-
src/cppcache/src/Utils.hpp | 15 +-
src/cppcache/src/VectorOfSharedBase.cpp | 10 +-
src/cppcache/src/VersionStamp.cpp | 2 +-
.../src/VersionedCacheableObjectPartList.cpp | 54 +-
.../src/VersionedCacheableObjectPartList.hpp | 12 +-
src/cppcache/src/dllmain.cpp | 11 +-
.../src/statistics/AtomicStatisticsImpl.cpp | 40 +-
.../src/statistics/GeodeStatisticsFactory.cpp | 24 +-
.../src/statistics/GeodeStatisticsFactory.hpp | 8 +-
src/cppcache/src/statistics/HostStatHelper.cpp | 14 +-
.../src/statistics/HostStatHelperLinux.cpp | 15 +-
.../src/statistics/HostStatHelperSolaris.cpp | 16 +-
.../src/statistics/HostStatHelperWin.cpp | 38 +-
src/cppcache/src/statistics/HostStatSampler.cpp | 51 +-
.../src/statistics/LinuxProcessStats.cpp | 10 +-
.../src/statistics/OsStatisticsImpl.cpp | 39 +-
.../src/statistics/SolarisProcessStats.cpp | 14 +-
.../src/statistics/StatArchiveWriter.cpp | 45 +-
.../src/statistics/StatArchiveWriter.hpp | 4 +-
.../src/statistics/StatSamplerStats.cpp | 12 +-
.../src/statistics/StatisticDescriptorImpl.cpp | 12 +-
src/cppcache/src/statistics/Statistics.cpp | 4 +-
.../src/statistics/StatisticsManager.cpp | 39 +-
.../src/statistics/StatisticsManager.hpp | 9 +-
.../src/statistics/StatisticsTypeImpl.cpp | 68 +-
.../src/statistics/WindowsProcessStats.cpp | 14 +-
src/cppcache/test/ByteArrayTest.cpp | 14 +-
.../test/CacheableStringEqualityTest.cpp | 178 +++++
src/cppcache/test/DataInputTest.cpp | 56 +-
src/cppcache/test/DataOutputTest.cpp | 10 +-
src/cppcache/test/TcrMessage_unittest.cpp | 114 +--
src/tests/cli/NewFwkLib/CacheServer.cs | 1 -
src/tests/cpp/fwklib/FrameworkTest.cpp | 4 +-
.../cpp/testobject/DeltaFastAssetAccount.cpp | 2 +-
.../cpp/testobject/DeltaFastAssetAccount.hpp | 9 +-
src/tests/cpp/testobject/FastAssetAccount.cpp | 2 +-
src/tests/cpp/testobject/InvalidPdxUsage.hpp | 10 +-
src/tests/cpp/testobject/NonPdxType.hpp | 10 +-
src/tests/cpp/testobject/PdxType.hpp | 10 +-
src/tests/cpp/testobject/PdxVersioned1.cpp | 14 +-
src/tests/cpp/testobject/PdxVersioned2.cpp | 14 +-
src/tests/cpp/testobject/Portfolio.cpp | 4 +-
src/tests/cpp/testobject/PortfolioPdx.cpp | 2 +-
403 files changed, 7373 insertions(+), 8405 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/clicache/src/CacheableHashSet.hpp
----------------------------------------------------------------------
diff --git a/src/clicache/src/CacheableHashSet.hpp b/src/clicache/src/CacheableHashSet.hpp
index b7fc935..9330d4a 100644
--- a/src/clicache/src/CacheableHashSet.hpp
+++ b/src/clicache/src/CacheableHashSet.hpp
@@ -58,9 +58,8 @@ namespace Apache
output->WriteArrayLen(this->Count);
auto set = static_cast<HSTYPE*>(m_nativeptr->get());
- for (typename HSTYPE::Iterator iter = set->begin();
- iter != set->end(); ++iter) {
- auto key = Serializable::GetManagedValueGeneric<Object^>((*iter));
+ for (const auto& iter : *set) {
+ auto key = Serializable::GetManagedValueGeneric<Object^>(iter);
output->WriteObject(key);
}
@@ -181,14 +180,14 @@ namespace Apache
virtual bool MoveNext()
{
auto nptr = m_nativeptr->get();
- bool isEnd = nptr->isEnd();
+ bool isEnd = static_cast<HSTYPE*>(m_set->m_nativeptr->get())->end() == *nptr;
if (!m_started) {
m_started = true;
}
else {
if (!isEnd) {
(*nptr)++;
- isEnd = nptr->isEnd();
+ isEnd = static_cast<HSTYPE*>(m_set->m_nativeptr->get())->end() == *nptr;
}
}
GC::KeepAlive(this);
@@ -203,7 +202,9 @@ namespace Apache
{
try
{
- m_nativeptr->get()->reset();
+ m_nativeptr = gcnew native_unique_ptr<typename HSTYPE::iterator>(
+ std::make_unique<typename HSTYPE::iterator>(
+ static_cast<HSTYPE*>(m_set->m_nativeptr->get())->begin()));
}
finally
{
@@ -222,10 +223,9 @@ namespace Apache
/// Internal constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline Enumerator(std::unique_ptr<typename HSTYPE::Iterator> nativeptr,
- CacheableHashSetType<TYPEID, HSTYPE>^ set)
- : m_set(set) {
- m_nativeptr = gcnew native_unique_ptr<typename HSTYPE::Iterator>(std::move(nativeptr));
+ inline Enumerator(CacheableHashSetType<TYPEID, HSTYPE>^ set)
+ : m_set(set) {
+ Reset();
}
private:
@@ -256,7 +256,7 @@ namespace Apache
CacheableHashSetType<TYPEID, HSTYPE>^ m_set;
- native_unique_ptr<typename HSTYPE::Iterator>^ m_nativeptr;
+ native_unique_ptr<typename HSTYPE::iterator>^ m_nativeptr;
};
/// <summary>
@@ -335,7 +335,7 @@ namespace Apache
{
try
{
- static_cast<HSTYPE*>(m_nativeptr->get())->resize(size);
+ static_cast<HSTYPE*>(m_nativeptr->get())->reserve(size);
}
finally
{
@@ -420,7 +420,7 @@ namespace Apache
{
try
{
- return static_cast<HSTYPE*>(m_nativeptr->get())->contains(Serializable::GetUnmanagedValueGeneric(item));
+ return static_cast<HSTYPE*>(m_nativeptr->get())->find(Serializable::GetUnmanagedValueGeneric(item)) != static_cast<HSTYPE*>(m_nativeptr->get())->end();
}
finally
{
@@ -467,9 +467,8 @@ namespace Apache
"array is less than that required to copy all the "
"elements from HashSet");
}
- for (typename HSTYPE::Iterator iter = set->begin();
- iter != set->end(); ++iter, ++index) {
- array[index] = Serializable::GetManagedValueGeneric<Object^>((*iter));
+ for (const auto& iter : *set) {
+ array[index++] = Serializable::GetManagedValueGeneric<Object^>(iter);
}
GC::KeepAlive(m_nativeptr);
@@ -547,16 +546,7 @@ namespace Apache
/// </returns>
virtual IEnumerator<Object^>^ GetEnumerator()
{
- try
- {
- auto iter = std::make_unique<typename HSTYPE::Iterator>(
- static_cast<HSTYPE*>(m_nativeptr->get())->begin());
- return gcnew Enumerator(std::move(iter), this);
- }
- finally
- {
- GC::KeepAlive(m_nativeptr);
- }
+ return gcnew Enumerator(this);
}
// End Region: IEnumerable<ICacheableKey^> Members
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/clicache/src/LocalRegion.cpp
----------------------------------------------------------------------
diff --git a/src/clicache/src/LocalRegion.cpp b/src/clicache/src/LocalRegion.cpp
index e1d6d2d..143f51a 100644
--- a/src/clicache/src/LocalRegion.cpp
+++ b/src/clicache/src/LocalRegion.cpp
@@ -136,7 +136,7 @@ namespace Apache
_GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
- auto toArray = gcnew array<KeyValuePair<TKey,TValue>>(vc.size());
+ auto toArray = gcnew array<KeyValuePair<TKey,TValue>>(static_cast<int>(vc.size()));
for( System::Int32 index = 0; index < vc.size( ); index++ )
{
auto nativeptr = vc[ index ];
@@ -166,7 +166,7 @@ namespace Apache
_GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
- auto toArray = gcnew array<Object^>(vc.size());
+ auto toArray = gcnew array<Object^>(static_cast<int>(vc.size()));
for( System::Int32 index = 0; index < vc.size( ); index++ )
{
auto nativeptr = vc[ index ];
@@ -273,7 +273,7 @@ namespace Apache
GC::KeepAlive(m_nativeptr);
}
- auto keyarr = gcnew array<TKey>( vc.size( ) );
+ auto keyarr = gcnew array<TKey>( static_cast<int>(vc.size( )) );
for( System::Int32 index = 0; index < vc.size( ); index++ )
{
auto& nativeptr = vc[ index ];
@@ -301,7 +301,7 @@ namespace Apache
}
//List<TValue>^ collectionlist = gcnew List<TValue>(vc.size());
- auto valarr = gcnew array<TValue>( vc.size( ) );
+ auto valarr = gcnew array<TValue>( static_cast<int>(vc.size( )) );
for( System::Int32 index = 0; index < vc.size( ); index++ )
{
auto& nativeptr = vc[ index ];
@@ -754,7 +754,7 @@ namespace Apache
GC::KeepAlive(m_nativeptr);
}
array<IRegion<TKey, TValue>^>^ subRegions =
- gcnew array<IRegion<TKey, TValue>^>( vsr.size( ) );
+ gcnew array<IRegion<TKey, TValue>^>( static_cast<int>(vsr.size( )) );
for( System::Int32 index = 0; index < vsr.size( ); index++ )
{
@@ -800,7 +800,7 @@ namespace Apache
{
GC::KeepAlive(m_nativeptr);
}
- auto entryarr = gcnew array<RegionEntry<TKey, TValue>^>( vc.size( ) );
+ auto entryarr = gcnew array<RegionEntry<TKey, TValue>^>( static_cast<int>(vc.size( )) );
for( System::Int32 index = 0; index < vc.size( ); index++ )
{
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/clicache/src/PoolManager.cpp
----------------------------------------------------------------------
diff --git a/src/clicache/src/PoolManager.cpp b/src/clicache/src/PoolManager.cpp
index d2aa28d..5136442 100644
--- a/src/clicache/src/PoolManager.cpp
+++ b/src/clicache/src/PoolManager.cpp
@@ -42,10 +42,10 @@ namespace Apache
{
auto pools = native::PoolManager::getAll();
auto result = gcnew Dictionary<String^, Pool^>();
- for (native::HashMapOfPools::Iterator iter = pools.begin(); iter != pools.end(); ++iter)
+ for (const auto& iter : pools)
{
- auto key = CacheableString::GetString(iter.first().get());
- auto val = Pool::Create(iter.second());
+ auto key = gcnew String(iter.first.c_str());
+ auto val = Pool::Create(iter.second);
result->Add(key, val);
}
return result;
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/clicache/src/QueryService.cpp
----------------------------------------------------------------------
diff --git a/src/clicache/src/QueryService.cpp b/src/clicache/src/QueryService.cpp
index c5b328a..acb38cf 100644
--- a/src/clicache/src/QueryService.cpp
+++ b/src/clicache/src/QueryService.cpp
@@ -212,11 +212,10 @@ namespace Apache
try
{
auto durableCqsArrayListPtr = m_nativeptr->get()->getAllDurableCqsFromServer();
- int length = durableCqsArrayListPtr != nullptr ? durableCqsArrayListPtr->length() : 0;
auto durableCqsList = gcnew System::Collections::Generic::List<String^>();
- for (int i = 0; i < length; i++)
+ for (const auto& d : *durableCqsArrayListPtr)
{
- durableCqsList->Add(CacheableString::GetString(std::static_pointer_cast<apache::geode::client::CacheableString>(durableCqsArrayListPtr->at(i))));
+ durableCqsList->Add(CacheableString::GetString(std::static_pointer_cast<apache::geode::client::CacheableString>(d)));
}
return durableCqsList;
}
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/clicache/src/Region.cpp
----------------------------------------------------------------------
diff --git a/src/clicache/src/Region.cpp b/src/clicache/src/Region.cpp
index 0ea7aa2..f7d4b23 100644
--- a/src/clicache/src/Region.cpp
+++ b/src/clicache/src/Region.cpp
@@ -173,9 +173,9 @@ namespace Apache
_GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
- auto toArray = gcnew array<KeyValuePair<TKey, TValue>>(vc.size());
+ auto toArray = gcnew array<KeyValuePair<TKey, TValue>>(static_cast<int>(vc.size()));
- for (System::Int32 index = 0; index < vc.size(); index++)
+ for (System::Int32 index = 0; index < toArray->Length; index++)
{
auto& nativeptr = vc[index];
auto key = Serializable::GetManagedValueGeneric<TKey>(nativeptr->getKey());
@@ -204,9 +204,9 @@ namespace Apache
_GF_MG_EXCEPTION_CATCH_ALL2/* due to auto replace */
- auto toArray = gcnew array<Object^>(vc.size());
+ auto toArray = gcnew array<Object^>(static_cast<int>(vc.size()));
- for (System::Int32 index = 0; index < vc.size(); index++)
+ for (System::Int32 index = 0; index < toArray->Length; index++)
{
auto& nativeptr = vc[index];
auto key = Serializable::GetManagedValueGeneric<TKey>(nativeptr->getKey());
@@ -313,8 +313,8 @@ namespace Apache
{
GC::KeepAlive(m_nativeptr);
}
- auto keyarr = gcnew array<TKey>(vc.size());
- for (System::Int32 index = 0; index < vc.size(); index++)
+ auto keyarr = gcnew array<TKey>(static_cast<int>(vc.size()));
+ for (System::Int32 index = 0; index < keyarr->Length; index++)
{
auto& nativeptr = vc[index];
keyarr[index] = Serializable::GetManagedValueGeneric<TKey>(nativeptr);
@@ -593,7 +593,7 @@ namespace Apache
{
native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(keyValPair.Key);
native::CacheablePtr valueptr = Serializable::GetUnmanagedValueGeneric<TValue>(keyValPair.Value);
- nativeMap.insert(keyptr, valueptr);
+ nativeMap.emplace(keyptr, valueptr);
}
try
{
@@ -618,7 +618,7 @@ namespace Apache
{
native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(keyValPair.Key);
native::CacheablePtr valueptr = Serializable::GetUnmanagedValueGeneric<TValue>(keyValPair.Value);
- nativeMap.insert(keyptr, valueptr);
+ nativeMap.emplace(keyptr, valueptr);
}
native::UserDataPtr callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
try
@@ -681,18 +681,16 @@ namespace Apache
GC::KeepAlive(m_nativeptr);
}
if (values != nullptr) {
- for (native::HashMapOfCacheable::Iterator iter =
- valuesPtr->begin(); iter != valuesPtr->end(); ++iter) {
- TKey key = Serializable::GetManagedValueGeneric<TKey>(iter.first());
- TValue val = Serializable::GetManagedValueGeneric<TValue>(iter.second());
+ for (const auto& iter : *valuesPtr) {
+ TKey key = Serializable::GetManagedValueGeneric<TKey>(iter.first);
+ TValue val = Serializable::GetManagedValueGeneric<TValue>(iter.second);
values->Add(key, val);
}
}
if (exceptions != nullptr) {
- for (native::HashMapOfException::Iterator iter =
- exceptionsPtr->begin(); iter != exceptionsPtr->end(); ++iter) {
- TKey key = Serializable::GetManagedValueGeneric<TKey>(iter.first());
- System::Exception^ ex = GeodeException::Get(*iter.second());
+ for (const auto& iter : *exceptionsPtr) {
+ TKey key = Serializable::GetManagedValueGeneric<TKey>(iter.first);
+ System::Exception^ ex = GeodeException::Get(*(iter.second));
exceptions->Add(key, ex);
}
}
@@ -741,18 +739,16 @@ namespace Apache
GC::KeepAlive(m_nativeptr);
}
if (values != nullptr) {
- for (native::HashMapOfCacheable::Iterator iter =
- valuesPtr->begin(); iter != valuesPtr->end(); ++iter) {
- TKey key = Serializable::GetManagedValueGeneric<TKey>(iter.first());
- TValue val = Serializable::GetManagedValueGeneric<TValue>(iter.second());
+ for (const auto& iter : *valuesPtr) {
+ TKey key = Serializable::GetManagedValueGeneric<TKey>(iter.first);
+ TValue val = Serializable::GetManagedValueGeneric<TValue>(iter.second);
values->Add(key, val);
}
}
if (exceptions != nullptr) {
- for (native::HashMapOfException::Iterator iter =
- exceptionsPtr->begin(); iter != exceptionsPtr->end(); ++iter) {
- TKey key = Serializable::GetManagedValueGeneric<TKey>(iter.first());
- System::Exception^ ex = GeodeException::Get(*iter.second());
+ for (const auto& iter : *exceptionsPtr) {
+ TKey key = Serializable::GetManagedValueGeneric<TKey>(iter.first);
+ System::Exception^ ex = GeodeException::Get(*(iter.second));
exceptions->Add(key, ex);
}
}
@@ -951,10 +947,10 @@ namespace Apache
{
GC::KeepAlive(m_nativeptr);
}
- array<IRegion<TKey, TValue>^>^ subRegions =
- gcnew array<IRegion<TKey, TValue>^>(vsr.size());
+ auto subRegions =
+ gcnew array<IRegion<TKey, TValue>^>(static_cast<int>(vsr.size()));
- for (System::Int32 index = 0; index < vsr.size(); index++)
+ for (System::Int32 index = 0; index < subRegions->Length; index++)
{
auto subRegion = vsr[index];
subRegions[index] = Region<TKey, TValue>::Create(subRegion);
@@ -989,7 +985,7 @@ namespace Apache
{
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
- native::VectorOfRegionEntry vc;
+ native::VectorOfRegionEntry vc;
try
{
m_nativeptr->get()->entries(vc, recursive);
@@ -998,9 +994,9 @@ namespace Apache
{
GC::KeepAlive(m_nativeptr);
}
- array<RegionEntry<TKey, TValue>^>^ entryarr = gcnew array<RegionEntry<TKey, TValue>^>(vc.size());
+ auto entryarr = gcnew array<RegionEntry<TKey, TValue>^>(static_cast<int>(vc.size()));
- for (System::Int32 index = 0; index < vc.size(); index++)
+ for (System::Int32 index = 0; index < entryarr->Length; index++)
{
auto& nativeptr = vc[index];
entryarr[index] = RegionEntry<TKey, TValue>::Create(nativeptr);
@@ -1290,8 +1286,8 @@ namespace Apache
{
GC::KeepAlive(m_nativeptr);
}
- auto keyarr = gcnew array<TKey>(vc.size());
- for (System::Int32 index = 0; index < vc.size(); index++)
+ auto keyarr = gcnew array<TKey>(static_cast<int>(vc.size()));
+ for (System::Int32 index = 0; index < keyarr->Length; index++)
{
auto& nativeptr = vc[index];
keyarr[index] = Serializable::GetManagedValueGeneric<TKey>(nativeptr);
@@ -1317,10 +1313,8 @@ namespace Apache
{
GC::KeepAlive(m_nativeptr);
}
- array<String^>^ strarr =
- gcnew array<String^>(vc.size());
- //List<String>^ collectionlist = gcnew List<String>(vc.size());
- for (System::Int32 index = 0; index < vc.size(); index++)
+ auto strarr = gcnew array<String^>(static_cast<int>(vc.size()));
+ for (System::Int32 index = 0; index < strarr->Length; index++)
{
strarr[index] = ManagedString::Get(vc[index]->asChar());
//collectionlist[ index ] = Serializable::GetManagedValue<TValue>(nativeptr);
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/include/geode/Cache.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/Cache.hpp b/src/cppcache/include/geode/Cache.hpp
index 569c85a..95b6ed8 100644
--- a/src/cppcache/include/geode/Cache.hpp
+++ b/src/cppcache/include/geode/Cache.hpp
@@ -148,18 +148,18 @@ class CPPCACHE_EXPORT Cache : public GeodeCache,
virtual void rootRegions(VectorOfRegion& regions);
/**
- * Gets the QueryService from which a new Query can be obtained.
- * @returns A smart pointer to the QueryService.
- */
+ * Gets the QueryService from which a new Query can be obtained.
+ * @returns A smart pointer to the QueryService.
+ */
virtual QueryServicePtr getQueryService();
/**
- * Gets the QueryService from which a new Query can be obtained.
- * @param poolName
- * Pass poolname if pool is created from cache.xml or {@link
- * PoolManager}
- * @returns A smart pointer to the QueryService.
- */
+ * Gets the QueryService from which a new Query can be obtained.
+ * @param poolName
+ * Pass poolname if pool is created from cache.xml or {@link
+ * PoolManager}
+ * @returns A smart pointer to the QueryService.
+ */
virtual QueryServicePtr getQueryService(const char* poolName);
/**
@@ -191,24 +191,24 @@ class CPPCACHE_EXPORT Cache : public GeodeCache,
*/
virtual RegionServicePtr createAuthenticatedView(
- PropertiesPtr userSecurityProperties, const char* poolName = NULL);
+ PropertiesPtr userSecurityProperties, const char* poolName = nullptr);
/**
- * Get the CacheTransactionManager instance for this Cache.
- * @return The CacheTransactionManager instance.
- * @throws CacheClosedException if the cache is closed.
- */
+ * Get the CacheTransactionManager instance for this Cache.
+ * @return The CacheTransactionManager instance.
+ * @throws CacheClosedException if the cache is closed.
+ */
virtual CacheTransactionManagerPtr getCacheTransactionManager();
/**
- * Returns whether Cache saves unread fields for Pdx types.
- */
+ * Returns whether Cache saves unread fields for Pdx types.
+ */
virtual bool getPdxIgnoreUnreadFields();
/**
- * Returns whether { @link PdxInstance} is preferred for PDX types instead of
- * C++ object.
- */
+ * Returns whether { @link PdxInstance} is preferred for PDX types instead of
+ * C++ object.
+ */
virtual bool getPdxReadSerialized();
/**
@@ -216,14 +216,14 @@ class CPPCACHE_EXPORT Cache : public GeodeCache,
* @param className the fully qualified class name that the PdxInstance will
* become
* when it is fully deserialized.
- * @throws IllegalStateException if the className is NULL or invalid.
+ * @throws IllegalStateException if the className is nullptr or invalid.
* @return the factory
*/
virtual PdxInstanceFactoryPtr createPdxInstanceFactory(const char* className);
/**
- * @brief destructor
- */
+ * @brief destructor
+ */
virtual ~Cache();
private:
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/include/geode/CacheFactory.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/CacheFactory.hpp b/src/cppcache/include/geode/CacheFactory.hpp
index b9c149d..0bf6b47 100644
--- a/src/cppcache/include/geode/CacheFactory.hpp
+++ b/src/cppcache/include/geode/CacheFactory.hpp
@@ -480,12 +480,8 @@ class CPPCACHE_EXPORT CacheFactory
CacheFactory();
CacheFactory(const PropertiesPtr dsProps);
- public:
- // TODO shared_ptr - this should be private, fix friend
- ~CacheFactory();
-
private:
- FRIEND_STD_SHARED_PTR(CacheFactory)
+ ~CacheFactory();
PoolPtr determineDefaultPool(CachePtr cachePtr);
@@ -506,6 +502,8 @@ class CPPCACHE_EXPORT CacheFactory
friend class RegionFactory;
friend class RegionXmlCreation;
friend class CacheXmlCreation;
+
+ FRIEND_STD_SHARED_PTR(CacheFactory)
};
} // namespace client
} // namespace geode
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/include/geode/CacheableBuiltins.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/CacheableBuiltins.hpp b/src/cppcache/include/geode/CacheableBuiltins.hpp
index 3abbab3..eda1611 100644
--- a/src/cppcache/include/geode/CacheableBuiltins.hpp
+++ b/src/cppcache/include/geode/CacheableBuiltins.hpp
@@ -176,7 +176,7 @@ class CacheableArrayType : public Cacheable {
TObj* m_value;
int32_t m_length;
- inline CacheableArrayType() : m_value(NULL), m_length(0) {}
+ inline CacheableArrayType() : m_value(nullptr), m_length(0) {}
inline CacheableArrayType(int32_t length) : m_length(length) {
if (length > 0) {
@@ -188,7 +188,7 @@ class CacheableArrayType : public Cacheable {
: m_value(value), m_length(length) {}
inline CacheableArrayType(const TObj* value, int32_t length, bool copy)
- : m_value(NULL), m_length(length) {
+ : m_value(nullptr), m_length(length) {
if (length > 0) {
GF_NEW(m_value, TObj[length]);
copyArray(m_value, value, length);
@@ -320,7 +320,7 @@ class CacheableContainerType : public Cacheable, public TBase {
sizeof(CacheableContainerType) +
apache::geode::client::serializer::objectSize(*this));
}
- };
+};
#ifdef _SOLARIS
#define TEMPLATE_EXPORT template class
@@ -404,27 +404,13 @@ class CacheableContainerType : public Cacheable, public TBase {
return nullptr == value ? nullptr \
: std::make_shared<c>(value, length, true); \
} \
- /** \ \
- * \ \
- * \ \ \
- * Create a cacheable array taking ownership of the given array \ \
- * \ \
- * \ \ \
- * without creating a copy. \ \
- * \ \
- * \ \ \
- * \ \
- * \ \
- * \ \ \
- * Note that the application has to ensure that the given array is \ \
- * \ \
- * \ \ \
- * not deleted (apart from this class) and is allocated on the heap \ \
- * \ \
- * \ \ \
- * using the "new" operator. \ \
- * \ \
- * \ \ \
+ /** \
+ * Create a cacheable array taking ownership of the given array \
+ * without creating a copy. \
+ * \
+ * Note that the application has to ensure that the given array is \
+ * not deleted (apart from this class) and is allocated on the heap \
+ * using the "new" operator. \
*/ \
inline static c##Ptr createNoCopy(p* value, int32_t length) { \
return nullptr == value ? nullptr : std::make_shared<c>(value, length); \
@@ -435,7 +421,7 @@ class CacheableContainerType : public Cacheable, public TBase {
TEMPLATE_EXPORT CacheableContainerType<p, GeodeTypeIds::c>; \
typedef CacheableContainerType<p, GeodeTypeIds::c> _##c; \
class CPPCACHE_EXPORT c; \
- typedef SharedPtr<c> c##Ptr;
+ typedef std::shared_ptr<c> c##Ptr;
// use a class instead of typedef for bug #283
#define _GF_CACHEABLE_CONTAINER_TYPE_(p, c) \
@@ -447,8 +433,6 @@ class CacheableContainerType : public Cacheable, public TBase {
FRIEND_STD_SHARED_PTR(c) \
\
public: \
- /** Iterator for this type. */ \
- typedef p::Iterator Iterator; \
/** Factory function registered with serialization registry. */ \
static Serializable* createDeserializable() { return new c(); } \
/** Factory function to create a default instance. */ \
@@ -584,58 +568,57 @@ _GF_CACHEABLE_ARRAY_TYPE_(CacheableStringPtr, CacheableStringArray);
// Instantiations for container types (Vector/HashMap/HashSet) Cacheables
-_GF_CACHEABLE_CONTAINER_TYPE_DEF_(_VectorOfCacheable, CacheableVector);
+_GF_CACHEABLE_CONTAINER_TYPE_DEF_(VectorOfCacheable, CacheableVector);
/**
* A mutable <code>Cacheable</code> vector wrapper that can serve as
* a distributable object for caching.
*/
-_GF_CACHEABLE_CONTAINER_TYPE_(_VectorOfCacheable, CacheableVector);
+_GF_CACHEABLE_CONTAINER_TYPE_(VectorOfCacheable, CacheableVector);
-_GF_CACHEABLE_CONTAINER_TYPE_DEF_(_HashMapOfCacheable, CacheableHashMap);
+_GF_CACHEABLE_CONTAINER_TYPE_DEF_(HashMapOfCacheable, CacheableHashMap);
/**
* A mutable <code>CacheableKey</code> to <code>Serializable</code>
* hash map that can serve as a distributable object for caching.
*/
-_GF_CACHEABLE_CONTAINER_TYPE_(_HashMapOfCacheable, CacheableHashMap);
+_GF_CACHEABLE_CONTAINER_TYPE_(HashMapOfCacheable, CacheableHashMap);
-_GF_CACHEABLE_CONTAINER_TYPE_DEF_(_HashSetOfCacheableKey, CacheableHashSet);
+_GF_CACHEABLE_CONTAINER_TYPE_DEF_(HashSetOfCacheableKey, CacheableHashSet);
/**
* A mutable <code>CacheableKey</code> hash set wrapper that can serve as
* a distributable object for caching.
*/
-_GF_CACHEABLE_CONTAINER_TYPE_(_HashSetOfCacheableKey, CacheableHashSet);
+_GF_CACHEABLE_CONTAINER_TYPE_(HashSetOfCacheableKey, CacheableHashSet);
-_GF_CACHEABLE_CONTAINER_TYPE_DEF_(_VectorOfCacheable, CacheableArrayList);
+_GF_CACHEABLE_CONTAINER_TYPE_DEF_(VectorOfCacheable, CacheableArrayList);
/**
* A mutable <code>Cacheable</code> array list wrapper that can serve as
* a distributable object for caching.
*/
-_GF_CACHEABLE_CONTAINER_TYPE_(_VectorOfCacheable, CacheableArrayList);
+_GF_CACHEABLE_CONTAINER_TYPE_(VectorOfCacheable, CacheableArrayList);
// linketlist for JSON formattor issue
-_GF_CACHEABLE_CONTAINER_TYPE_DEF_(_VectorOfCacheable, CacheableLinkedList);
+_GF_CACHEABLE_CONTAINER_TYPE_DEF_(VectorOfCacheable, CacheableLinkedList);
/**
* A mutable <code>Cacheable</code> array list wrapper that can serve as
* a distributable object for caching.
*/
-_GF_CACHEABLE_CONTAINER_TYPE_(_VectorOfCacheable, CacheableLinkedList);
+_GF_CACHEABLE_CONTAINER_TYPE_(VectorOfCacheable, CacheableLinkedList);
-_GF_CACHEABLE_CONTAINER_TYPE_DEF_(_VectorOfCacheable, CacheableStack);
+_GF_CACHEABLE_CONTAINER_TYPE_DEF_(VectorOfCacheable, CacheableStack);
/**
* A mutable <code>Cacheable</code> stack wrapper that can serve as
* a distributable object for caching.
*/
-_GF_CACHEABLE_CONTAINER_TYPE_(_VectorOfCacheable, CacheableStack);
+_GF_CACHEABLE_CONTAINER_TYPE_(VectorOfCacheable, CacheableStack);
-_GF_CACHEABLE_CONTAINER_TYPE_DEF_(_HashMapOfCacheable, CacheableHashTable);
+_GF_CACHEABLE_CONTAINER_TYPE_DEF_(HashMapOfCacheable, CacheableHashTable);
/**
* A mutable <code>CacheableKey</code> to <code>Serializable</code>
* hash map that can serve as a distributable object for caching.
*/
-_GF_CACHEABLE_CONTAINER_TYPE_(_HashMapOfCacheable, CacheableHashTable);
+_GF_CACHEABLE_CONTAINER_TYPE_(HashMapOfCacheable, CacheableHashTable);
-_GF_CACHEABLE_CONTAINER_TYPE_DEF_(_HashMapOfCacheable,
- CacheableIdentityHashMap);
+_GF_CACHEABLE_CONTAINER_TYPE_DEF_(HashMapOfCacheable, CacheableIdentityHashMap);
/**
* A mutable <code>CacheableKey</code> to <code>Serializable</code>
* hash map that can serve as a distributable object for caching. This is
@@ -643,9 +626,9 @@ _GF_CACHEABLE_CONTAINER_TYPE_DEF_(_HashMapOfCacheable,
* to <code>CacheableHashMap</code> i.e. does not provide the semantics of
* java <code>IdentityHashMap</code>.
*/
-_GF_CACHEABLE_CONTAINER_TYPE_(_HashMapOfCacheable, CacheableIdentityHashMap);
+_GF_CACHEABLE_CONTAINER_TYPE_(HashMapOfCacheable, CacheableIdentityHashMap);
-_GF_CACHEABLE_CONTAINER_TYPE_DEF_(_HashSetOfCacheableKey,
+_GF_CACHEABLE_CONTAINER_TYPE_DEF_(HashSetOfCacheableKey,
CacheableLinkedHashSet);
/**
* A mutable <code>CacheableKey</code> hash set wrapper that can serve as
@@ -654,7 +637,7 @@ _GF_CACHEABLE_CONTAINER_TYPE_DEF_(_HashSetOfCacheableKey,
* <code>CacheableHashSet</code> i.e. does not provide the predictable
* iteration semantics of java <code>LinkedHashSet</code>.
*/
-_GF_CACHEABLE_CONTAINER_TYPE_(_HashSetOfCacheableKey, CacheableLinkedHashSet);
+_GF_CACHEABLE_CONTAINER_TYPE_(HashSetOfCacheableKey, CacheableLinkedHashSet);
} // namespace client
} // namespace geode
} // namespace apache
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/include/geode/CacheableFileName.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/CacheableFileName.hpp b/src/cppcache/include/geode/CacheableFileName.hpp
index 70ae217..5db13c1 100644
--- a/src/cppcache/include/geode/CacheableFileName.hpp
+++ b/src/cppcache/include/geode/CacheableFileName.hpp
@@ -76,7 +76,7 @@ class CPPCACHE_EXPORT CacheableFileName : public CacheableString {
*/
static CacheableFileNamePtr create(const char* value, int32_t len = 0) {
CacheableFileNamePtr str = nullptr;
- if (value != NULL) {
+ if (value != nullptr) {
str = std::make_shared<CacheableFileName>();
str->initString(value, len);
}
@@ -89,7 +89,7 @@ class CPPCACHE_EXPORT CacheableFileName : public CacheableString {
*/
static CacheableFileNamePtr create(const wchar_t* value, int32_t len = 0) {
CacheableFileNamePtr str = nullptr;
- if (value != NULL) {
+ if (value != nullptr) {
str = std::make_shared<CacheableFileName>();
str->initString(value, len);
}
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/include/geode/CacheableKey.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/CacheableKey.hpp b/src/cppcache/include/geode/CacheableKey.hpp
index ae5e1e3..9666f24 100644
--- a/src/cppcache/include/geode/CacheableKey.hpp
+++ b/src/cppcache/include/geode/CacheableKey.hpp
@@ -20,6 +20,8 @@
* limitations under the License.
*/
+#include <functional>
+
#include "geode_globals.hpp"
#include "geode_types.hpp"
#include "Cacheable.hpp"
@@ -71,6 +73,37 @@ class CPPCACHE_EXPORT CacheableKey : public Cacheable {
template <class PRIM>
inline static CacheableKeyPtr create(const PRIM value);
+ struct hash {
+ inline std::size_t operator()(const CacheableKey& s) const {
+ return s.hashcode();
+ }
+
+ inline std::size_t operator()(const CacheableKey*& s) const {
+ return s->hashcode();
+ }
+
+ inline std::size_t operator()(const std::shared_ptr<CacheableKey>& s) const {
+ return s->hashcode();
+ }
+ };
+
+ struct equal_to {
+ inline bool operator()(const CacheableKey &lhs,
+ const CacheableKey &rhs) const {
+ return lhs == rhs;
+ }
+
+ inline bool operator()(const CacheableKey* &lhs,
+ const CacheableKey* &rhs) const {
+ return (*lhs) == (*rhs);
+ }
+
+ inline bool operator()(const std::shared_ptr<CacheableKey> &lhs,
+ const std::shared_ptr<CacheableKey> &rhs) const {
+ return (*lhs) == (*rhs);
+ }
+ };
+
private:
// Never defined.
CacheableKey(const CacheableKey& other);
@@ -86,4 +119,17 @@ inline CacheableKeyPtr createKey(const TKEY* value);
} // namespace geode
} // namespace apache
+namespace std {
+
+template <>
+struct hash<apache::geode::client::CacheableKey> {
+ typedef apache::geode::client::CacheableKey argument_type;
+ typedef size_t result_type;
+ result_type operator()(const argument_type& val) const {
+ return val.hashcode();
+ }
+};
+
+} // namespace std
+
#endif // GEODE_CACHEABLEKEY_H_
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/include/geode/CacheableObjectArray.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/CacheableObjectArray.hpp b/src/cppcache/include/geode/CacheableObjectArray.hpp
index b97ac25..a3f1745 100644
--- a/src/cppcache/include/geode/CacheableObjectArray.hpp
+++ b/src/cppcache/include/geode/CacheableObjectArray.hpp
@@ -36,9 +36,8 @@ namespace client {
* that can serve as a distributable object for caching.
*/
class CPPCACHE_EXPORT CacheableObjectArray : public Cacheable,
- public _VectorOfCacheable {
+ public VectorOfCacheable {
public:
- typedef _VectorOfCacheable::Iterator Iterator;
/**
*@brief serialize this object
@@ -90,9 +89,9 @@ class CPPCACHE_EXPORT CacheableObjectArray : public Cacheable,
protected:
/** Constructor, used for deserialization. */
- inline CacheableObjectArray() : _VectorOfCacheable() {}
+ inline CacheableObjectArray() : VectorOfCacheable() {}
/** Create a vector with n elements allocated. */
- inline CacheableObjectArray(int32_t n) : _VectorOfCacheable(n) {}
+ inline CacheableObjectArray(int32_t n) : VectorOfCacheable(n) {}
private:
// never implemented.
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/include/geode/CacheableString.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/CacheableString.hpp b/src/cppcache/include/geode/CacheableString.hpp
index 9a754b9..3af78d2 100644
--- a/src/cppcache/include/geode/CacheableString.hpp
+++ b/src/cppcache/include/geode/CacheableString.hpp
@@ -280,7 +280,7 @@ class CPPCACHE_EXPORT CacheableString : public CacheableKey {
char* getASCIIString(const wchar_t* value, int32_t& len, int32_t& encodedLen);
/** Default constructor. */
inline CacheableString(int8_t type = GF_STRING)
- : m_str(NULL), m_type(type), m_len(0), m_hashcode(0) {}
+ : m_str(nullptr), m_type(type), m_len(0), m_hashcode(0) {}
private:
// never implemented.
@@ -311,4 +311,12 @@ inline CacheablePtr createValueArr(const wchar_t* value) {
} // namespace geode
} // namespace apache
+namespace std {
+
+template <>
+struct hash<apache::geode::client::CacheableString>
+ : hash<apache::geode::client::CacheableKey> {};
+
+} // namespace std
+
#endif // GEODE_CACHEABLESTRING_H_
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/include/geode/DataInput.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/DataInput.hpp b/src/cppcache/include/geode/DataInput.hpp
index 8886539..cfc3e1d 100644
--- a/src/cppcache/include/geode/DataInput.hpp
+++ b/src/cppcache/include/geode/DataInput.hpp
@@ -50,7 +50,7 @@ extern int gf_sprintf(char* buffer, const char* fmt, ...);
* Provide operations for reading primitive data values, byte arrays,
* strings, <code>Serializable</code> objects from a byte stream.
* This class is intentionally not thread safe.
- * @remarks None of the output parameters in the methods below can be NULL
+ * @remarks None of the output parameters in the methods below can be nullptr
* unless otherwise noted.
*/
class CPPCACHE_EXPORT DataInput {
@@ -136,7 +136,7 @@ class CPPCACHE_EXPORT DataInput {
int32_t length;
readArrayLen(&length);
*len = length;
- uint8_t* buffer = NULL;
+ uint8_t* buffer = nullptr;
if (length > 0) {
checkBufferSize(length);
GF_NEW(buffer, uint8_t[length]);
@@ -160,7 +160,7 @@ class CPPCACHE_EXPORT DataInput {
int32_t length;
readArrayLen(&length);
*len = length;
- int8_t* buffer = NULL;
+ int8_t* buffer = nullptr;
if (length > 0) {
checkBufferSize(length);
GF_NEW(buffer, int8_t[length]);
@@ -377,13 +377,13 @@ class CPPCACHE_EXPORT DataInput {
* @param value output C string to hold the read characters; it is allocated
* by this method
* @param len output parameter to hold the number of characters read from
- * stream; not set if NULL
+ * stream; not set if nullptr
*/
- inline void readASCII(char** value, uint16_t* len = NULL) {
+ inline void readASCII(char** value, uint16_t* len = nullptr) {
uint16_t length;
readInt(&length);
checkBufferSize(length);
- if (len != NULL) {
+ if (len != nullptr) {
*len = length;
}
char* str;
@@ -405,12 +405,12 @@ class CPPCACHE_EXPORT DataInput {
* @param value output C string to hold the read characters; it is allocated
* by this method
* @param len output parameter to hold the number of characters read from
- * stream; not set if NULL
+ * stream; not set if nullptr
*/
- inline void readASCIIHuge(char** value, uint32_t* len = NULL) {
+ inline void readASCIIHuge(char** value, uint32_t* len = nullptr) {
uint32_t length;
readInt(&length);
- if (len != NULL) {
+ if (len != nullptr) {
*len = length;
}
char* str;
@@ -434,15 +434,15 @@ class CPPCACHE_EXPORT DataInput {
* @param value output C string to hold the read characters; it is allocated
* by this method
* @param len output parameter to hold the number of characters read from
- * stream; not set if NULL
+ * stream; not set if nullptr
*/
- inline void readUTF(char** value, uint16_t* len = NULL) {
+ inline void readUTF(char** value, uint16_t* len = nullptr) {
uint16_t length;
readInt(&length);
checkBufferSize(length);
uint16_t decodedLen =
static_cast<uint16_t>(getDecodedLength(m_buf, length));
- if (len != NULL) {
+ if (len != nullptr) {
*len = decodedLen;
}
char* str;
@@ -461,7 +461,7 @@ class CPPCACHE_EXPORT DataInput {
* length to hold the length of the string. Value is modified to point to the
* new allocation. The chars are allocated as an array, so the caller must
* use freeUTFMemory when done.
- * If len == NULL, then the decoded string length is not set.
+ * If len == nullptr, then the decoded string length is not set.
*/
inline void readUTFNoLen(wchar_t** value, uint16_t decodedLen) {
wchar_t* str;
@@ -485,12 +485,12 @@ class CPPCACHE_EXPORT DataInput {
* @param value output C string to hold the read characters; it is allocated
* by this method
* @param len output parameter to hold the number of characters read from
- * stream; not set if NULL
+ * stream; not set if nullptr
*/
- inline void readUTFHuge(char** value, uint32_t* len = NULL) {
+ inline void readUTFHuge(char** value, uint32_t* len = nullptr) {
uint32_t length;
readInt(&length);
- if (len != NULL) {
+ if (len != nullptr) {
*len = length;
}
char* str;
@@ -520,15 +520,15 @@ class CPPCACHE_EXPORT DataInput {
* @param value output wide-character string to hold the read characters;
* it is allocated by this method
* @param len output parameter to hold the number of characters read from
- * stream; not set if NULL
+ * stream; not set if nullptr
*/
- inline void readUTF(wchar_t** value, uint16_t* len = NULL) {
+ inline void readUTF(wchar_t** value, uint16_t* len = nullptr) {
uint16_t length;
readInt(&length);
checkBufferSize(length);
uint16_t decodedLen =
static_cast<uint16_t>(getDecodedLength(m_buf, length));
- if (len != NULL) {
+ if (len != nullptr) {
*len = decodedLen;
}
wchar_t* str;
@@ -552,12 +552,12 @@ class CPPCACHE_EXPORT DataInput {
* @param value output wide-character string to hold the read characters;
* it is allocated by this method
* @param len output parameter to hold the number of characters read from
- * stream; not set if NULL
+ * stream; not set if nullptr
*/
- inline void readUTFHuge(wchar_t** value, uint32_t* len = NULL) {
+ inline void readUTFHuge(wchar_t** value, uint32_t* len = nullptr) {
uint32_t length;
readInt(&length);
- if (len != NULL) {
+ if (len != nullptr) {
*len = length;
}
wchar_t* str;
@@ -695,7 +695,7 @@ class CPPCACHE_EXPORT DataInput {
int arrayLen = 0;
readArrayLen(&arrayLen);
length = arrayLen;
- char* objArray = NULL;
+ char* objArray = nullptr;
if (arrayLen > 0) {
objArray = new char[arrayLen];
int i = 0;
@@ -744,9 +744,9 @@ class CPPCACHE_EXPORT DataInput {
int8_t typeId;
read(&typeId);
- // Check for NULL String
+ // Check for nullptr String
if (typeId == GeodeTypeIds::CacheableNullString) {
- *value = NULL;
+ *value = nullptr;
return;
}
/*
@@ -777,9 +777,9 @@ class CPPCACHE_EXPORT DataInput {
int8_t typeId;
read(&typeId);
- // Check for NULL String
+ // Check for nullptr String
if (typeId == GeodeTypeIds::CacheableNullString) {
- *value = NULL;
+ *value = nullptr;
return;
}
@@ -803,7 +803,7 @@ class CPPCACHE_EXPORT DataInput {
readArrayLen(&arrLen);
length = arrLen;
if (arrLen == -1) {
- *strArray = NULL;
+ *strArray = nullptr;
return;
} else {
char** tmpArray;
@@ -820,7 +820,7 @@ class CPPCACHE_EXPORT DataInput {
readArrayLen(&arrLen);
length = arrLen;
if (arrLen == -1) {
- *strArray = NULL;
+ *strArray = nullptr;
return;
} else {
wchar_t** tmpArray;
@@ -840,7 +840,7 @@ class CPPCACHE_EXPORT DataInput {
arrayLength = arrLen;
if (arrLen == -1) {
- *arrayofBytearr = NULL;
+ *arrayofBytearr = nullptr;
return;
} else {
int8_t** tmpArray;
@@ -896,7 +896,7 @@ class CPPCACHE_EXPORT DataInput {
: m_buf(m_buffer),
m_bufHead(m_buffer),
m_bufLength(len),
- m_poolName(NULL) {}
+ m_poolName(nullptr) {}
/** destructor */
~DataInput() {}
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/include/geode/DataOutput.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/DataOutput.hpp b/src/cppcache/include/geode/DataOutput.hpp
index 0e4f55d..bba752f 100644
--- a/src/cppcache/include/geode/DataOutput.hpp
+++ b/src/cppcache/include/geode/DataOutput.hpp
@@ -45,7 +45,7 @@ namespace client {
#define GF_ALLOC(v, t, s) \
{ \
v = (t*)malloc((s) * sizeof(t)); \
- if ((v) == NULL) { \
+ if ((v) == nullptr) { \
throw OutOfMemoryException( \
"Out of Memory while allocating buffer for " #t " of size " #s); \
} \
@@ -58,7 +58,7 @@ namespace client {
#define GF_RESIZE(v, t, s) \
{ \
v = (t*)realloc(v, (s) * sizeof(t)); \
- if ((v) == NULL) { \
+ if ((v) == nullptr) { \
throw OutOfMemoryException( \
"Out of Memory while resizing buffer for " #t); \
} \
@@ -111,8 +111,8 @@ class CPPCACHE_EXPORT DataOutput {
inline void writeBytes(const uint8_t* bytes, int32_t len) {
if (len >= 0) {
ensureCapacity(len + 5);
- writeArrayLen(bytes == NULL ? 0 : len); // length of bytes...
- if (len > 0 && bytes != NULL) {
+ writeArrayLen(bytes == nullptr ? 0 : len); // length of bytes...
+ if (len > 0 && bytes != nullptr) {
std::memcpy(m_buf, bytes, len);
m_buf += len;
}
@@ -322,7 +322,7 @@ class CPPCACHE_EXPORT DataOutput {
* written; the default value of 0 implies the complete string
*/
inline void writeASCII(const char* value, uint32_t length = 0) {
- if (value != NULL) {
+ if (value != nullptr) {
if (length == 0) {
length = static_cast<uint32_t>(strlen(value));
}
@@ -355,7 +355,7 @@ class CPPCACHE_EXPORT DataOutput {
* written; the default value of 0 implies the complete string
*/
inline void writeASCIIHuge(const char* value, uint32_t length = 0) {
- if (value != NULL) {
+ if (value != nullptr) {
if (length == 0) {
length = static_cast<uint32_t>(strlen(value));
}
@@ -367,17 +367,17 @@ class CPPCACHE_EXPORT DataOutput {
}
/**
- * Writes the given given string using java modified UTF-8 encoding
- * supporting maximum encoded length of 64K (i.e. unsigned 16-bit integer).
- * @remarks The string will be truncated if greater than the maximum
- * permissible length of 64K. Use <code>writeUTFHuge</code> to write
- * strings of length larger than this.
- *
- * @param value the C string to be written
- *
- */
+ * Writes the given given string using java modified UTF-8 encoding
+ * supporting maximum encoded length of 64K (i.e. unsigned 16-bit integer).
+ * @remarks The string will be truncated if greater than the maximum
+ * permissible length of 64K. Use <code>writeUTFHuge</code> to write
+ * strings of length larger than this.
+ *
+ * @param value the C string to be written
+ *
+ */
inline void writeFullUTF(const char* value, uint32_t length = 0) {
- if (value != NULL) {
+ if (value != nullptr) {
int32_t encodedLen = getEncodedLength(value, length);
writeInt(encodedLen);
ensureCapacity(encodedLen);
@@ -404,7 +404,7 @@ class CPPCACHE_EXPORT DataOutput {
* written; the default value of 0 implies the complete string
*/
inline void writeUTF(const char* value, uint32_t length = 0) {
- if (value != NULL) {
+ if (value != nullptr) {
int32_t len = getEncodedLength(value, length);
uint16_t encodedLen = static_cast<uint16_t>(len > 0xFFFF ? 0xFFFF : len);
writeInt(encodedLen);
@@ -432,7 +432,7 @@ class CPPCACHE_EXPORT DataOutput {
* that the UTF string does not contain any null characters
*/
inline void writeUTFHuge(const char* value, uint32_t length = 0) {
- if (value != NULL) {
+ if (value != nullptr) {
if (length == 0) {
length = static_cast<uint32_t>(strlen(value));
}
@@ -459,7 +459,7 @@ class CPPCACHE_EXPORT DataOutput {
* written; the default value of 0 implies the complete string
*/
inline void writeUTF(const wchar_t* value, uint32_t length = 0) {
- if (value != NULL) {
+ if (value != nullptr) {
int32_t len = getEncodedLength(value, length);
uint16_t encodedLen = static_cast<uint16_t>(len > 0xFFFF ? 0xFFFF : len);
writeInt(encodedLen);
@@ -485,7 +485,7 @@ class CPPCACHE_EXPORT DataOutput {
* written; the default value of 0 implies the complete string
*/
inline void writeUTFHuge(const wchar_t* value, uint32_t length = 0) {
- if (value != NULL) {
+ if (value != nullptr) {
if (length == 0) {
length = static_cast<uint32_t>(wcslen(value));
}
@@ -512,8 +512,8 @@ class CPPCACHE_EXPORT DataOutput {
* @see DataInput::getDecodedLength
*/
inline static int32_t getEncodedLength(const char* value, int32_t length = 0,
- uint32_t* valLength = NULL) {
- if (value == NULL) return 0;
+ uint32_t* valLength = nullptr) {
+ if (value == nullptr) return 0;
char currentChar;
int32_t encodedLen = 0;
const char* start = value;
@@ -530,7 +530,7 @@ class CPPCACHE_EXPORT DataOutput {
value++;
}
}
- if (valLength != NULL) {
+ if (valLength != nullptr) {
*valLength = static_cast<uint32_t>(value - start);
}
return encodedLen;
@@ -548,8 +548,8 @@ class CPPCACHE_EXPORT DataOutput {
*/
inline static int32_t getEncodedLength(const wchar_t* value,
int32_t length = 0,
- uint32_t* valLength = NULL) {
- if (value == NULL) return 0;
+ uint32_t* valLength = nullptr) {
+ if (value == nullptr) return 0;
wchar_t currentChar;
int32_t encodedLen = 0;
const wchar_t* start = value;
@@ -566,7 +566,7 @@ class CPPCACHE_EXPORT DataOutput {
value++;
}
}
- if (valLength != NULL) {
+ if (valLength != nullptr) {
*valLength = static_cast<uint32_t>(value - start);
}
return encodedLen;
@@ -645,7 +645,7 @@ class CPPCACHE_EXPORT DataOutput {
* Get a pointer to the internal buffer of <code>DataOutput</code>.
*
* @param rsize the size of buffer is filled in this output parameter;
- * should not be NULL
+ * should not be nullptr
*/
inline const uint8_t* getBuffer(uint32_t* rsize) const {
*rsize = static_cast<uint32_t>(m_buf - m_bytes);
@@ -705,8 +705,8 @@ class CPPCACHE_EXPORT DataOutput {
}
/*
- * This is for internal use
- */
+ * This is for internal use
+ */
const char* getPoolName() { return m_poolName; }
/*
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/include/geode/DistributedSystem.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/DistributedSystem.hpp b/src/cppcache/include/geode/DistributedSystem.hpp
index 1f02c76..601c0f9 100644
--- a/src/cppcache/include/geode/DistributedSystem.hpp
+++ b/src/cppcache/include/geode/DistributedSystem.hpp
@@ -59,7 +59,7 @@ class CPPCACHE_EXPORT DistributedSystem : public SharedBase {
* @throws LicenseException if no valid license is found.
* @throws IllegalStateException if GFCPP variable is not set and
* product installation directory cannot be determined
- * @throws IllegalArgument exception if DS name is NULL
+ * @throws IllegalArgument exception if DS name is nullptr
* @throws AlreadyConnectedException if this call has succeeded once before
*for this process
**/
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/include/geode/Exception.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/Exception.hpp b/src/cppcache/include/geode/Exception.hpp
index 508bd8e..f712dc4 100644
--- a/src/cppcache/include/geode/Exception.hpp
+++ b/src/cppcache/include/geode/Exception.hpp
@@ -55,8 +55,8 @@ class CPPCACHE_EXPORT Exception : public SharedBase {
* @param cause optional cause of the exception which can be later
* retrieved using <code>getCause</code>
**/
- Exception(const char* msg1, const char* msg2 = NULL, bool forceTrace = false,
- const ExceptionPtr& cause = nullptr);
+ Exception(const char* msg1, const char* msg2 = nullptr,
+ bool forceTrace = false, const ExceptionPtr& cause = nullptr);
/** Creates an exception as a copy of the given other exception.
* @param other the original exception.
@@ -83,14 +83,14 @@ class CPPCACHE_EXPORT Exception : public SharedBase {
virtual void showMessage() const;
/** On some platforms, print a stacktrace from the location the exception
- * was created.
- */
+ * was created.
+ */
virtual void printStackTrace() const;
#ifndef _SOLARIS
/** On some platforms, get a stacktrace string from the location the
- * exception was created.
- */
+ * exception was created.
+ */
virtual size_t getStackTrace(char* buffer, size_t maxLength) const;
#endif
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/include/geode/ExceptionTypes.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/ExceptionTypes.hpp b/src/cppcache/include/geode/ExceptionTypes.hpp
index 18a2d69..19e0346 100644
--- a/src/cppcache/include/geode/ExceptionTypes.hpp
+++ b/src/cppcache/include/geode/ExceptionTypes.hpp
@@ -31,30 +31,30 @@ namespace apache {
namespace geode {
namespace client {
-#define _GF_EXCEPTION_DEF(x) \
- const char _exception_name_##x[] = "apache::geode::client::" #x; \
- class x; \
- typedef SharedPtr<x> x##Ptr; \
- class CPPCACHE_EXPORT x : public apache::geode::client::Exception { \
- public: \
- x(const char* msg1, const char* msg2 = NULL, bool forceStack = false, \
- const ExceptionPtr& cause = nullptr) \
- : Exception(msg1, msg2, forceStack, cause) {} \
- x(const x& other) : Exception(other) {} \
- virtual Exception* clone() const { \
- return new x(m_message, m_stack, m_cause); \
- } \
- virtual ~x() {} \
- virtual const char* getName() const { return _exception_name_##x; } \
- virtual void raise() { throw * this; } \
- \
- protected: \
- x(const CacheableStringPtr& message, const StackTracePtr& stack, \
- const ExceptionPtr& cause) \
- : Exception(message, stack, cause) {} \
- \
- private: \
- const x& operator=(const x&); \
+#define _GF_EXCEPTION_DEF(x) \
+ const char _exception_name_##x[] = "apache::geode::client::" #x; \
+ class x; \
+ typedef SharedPtr<x> x##Ptr; \
+ class CPPCACHE_EXPORT x : public apache::geode::client::Exception { \
+ public: \
+ x(const char* msg1, const char* msg2 = nullptr, bool forceStack = false, \
+ const ExceptionPtr& cause = nullptr) \
+ : Exception(msg1, msg2, forceStack, cause) {} \
+ x(const x& other) : Exception(other) {} \
+ virtual Exception* clone() const { \
+ return new x(m_message, m_stack, m_cause); \
+ } \
+ virtual ~x() {} \
+ virtual const char* getName() const { return _exception_name_##x; } \
+ virtual void raise() { throw * this; } \
+ \
+ protected: \
+ x(const CacheableStringPtr& message, const StackTracePtr& stack, \
+ const ExceptionPtr& cause) \
+ : Exception(message, stack, cause) {} \
+ \
+ private: \
+ const x& operator=(const x&); \
}
/*
@@ -241,7 +241,7 @@ _GF_EXCEPTION_DEF(RegionCreationFailedException);
/**
*@brief Thrown when there is a fatal internal exception in geode.
- */
+ */
_GF_EXCEPTION_DEF(FatalInternalException);
/**
@@ -358,38 +358,38 @@ _GF_EXCEPTION_DEF(InvalidDeltaException);
**/
_GF_EXCEPTION_DEF(KeyNotFoundException);
/**
-* @brief This is for all Exceptions that may be thrown
-* by a Geode transaction.
-**/
+ * @brief This is for all Exceptions that may be thrown
+ * by a Geode transaction.
+ **/
_GF_EXCEPTION_DEF(TransactionException);
/**
-* @brief The RollbackException exception indicates that either the transaction
-* has been rolled back or an operation cannot complete because the
-* transaction is marked for rollback only.
-**/
+ * @brief The RollbackException exception indicates that either the transaction
+ * has been rolled back or an operation cannot complete because the
+ * transaction is marked for rollback only.
+ **/
_GF_EXCEPTION_DEF(RollbackException);
/**
-* @brief Thrown when a commit fails due to a write conflict.
-* @see CacheTransactionManager#commit
-**/
+ * @brief Thrown when a commit fails due to a write conflict.
+ * @see CacheTransactionManager#commit
+ **/
_GF_EXCEPTION_DEF(CommitConflictException);
/**
-* @brief Thrown when the transactional data host has shutdown or no longer has
-*the data
-* being modified by the transaction.
-* This can be thrown while doing transactional operations or during commit.
-**/
+ * @brief Thrown when the transactional data host has shutdown or no longer has
+ *the data
+ * being modified by the transaction.
+ * This can be thrown while doing transactional operations or during commit.
+ **/
_GF_EXCEPTION_DEF(TransactionDataNodeHasDepartedException);
/**
-* @brief Thrown when a {@link RebalanceOperation} occurs concurrently with a
-*transaction.
-* This can be thrown while doing transactional operations or during commit.
-**/
+ * @brief Thrown when a {@link RebalanceOperation} occurs concurrently with a
+ *transaction.
+ * This can be thrown while doing transactional operations or during commit.
+ **/
_GF_EXCEPTION_DEF(TransactionDataRebalancedException);
/**
-* @brief Thrown if putAll operation with single hop succeeded partially.
-**/
+ * @brief Thrown if putAll operation with single hop succeeded partially.
+ **/
_GF_EXCEPTION_DEF(PutAllPartialResultException);
/**