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/11/15 05:56:05 UTC
[geode-native] branch develop updated: GEODE-3149: Code cleanup
(#149)
This is an automated email from the ASF dual-hosted git repository.
jbarrett pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git
The following commit(s) were added to refs/heads/develop by this push:
new 45932fa GEODE-3149: Code cleanup (#149)
45932fa is described below
commit 45932fa36d20fa5cb2d366f889d7786ed669a241
Author: mhansonp <mh...@pivotal.io>
AuthorDate: Tue Nov 14 21:56:03 2017 -0800
GEODE-3149: Code cleanup (#149)
-Removed VectorT.hpp
-Removed GeodeCppCache.hpp
-Cleaned out geode_types.hpp
-Converted *Ptr types to shared_ptr<*> types
-Variable conversion to auto
---
clicache/src/AttributesFactory.cpp | 12 +-
clicache/src/AttributesMutator.cpp | 6 +-
clicache/src/AttributesMutator.hpp | 4 +-
clicache/src/Cache.cpp | 6 +-
clicache/src/Cache.hpp | 6 +-
clicache/src/CacheFactory.cpp | 2 +-
clicache/src/CacheFactory.hpp | 2 +-
clicache/src/CacheStatistics.hpp | 4 +-
clicache/src/CacheTransactionManager.cpp | 8 +-
clicache/src/CacheTransactionManager.hpp | 4 +-
clicache/src/CacheableBuiltins.hpp | 14 +-
clicache/src/CacheableHashSet.hpp | 6 +-
clicache/src/CacheableKey.hpp | 2 +-
clicache/src/CacheableString.cpp | 4 +-
clicache/src/CacheableString.hpp | 8 +-
clicache/src/CacheableStringArray.hpp | 4 +-
clicache/src/CqAttributes.hpp | 4 +-
clicache/src/CqAttributesMutator.cpp | 4 +-
clicache/src/CqAttributesMutator.hpp | 4 +-
clicache/src/CqEvent.cpp | 6 +-
clicache/src/CqQuery.hpp | 4 +-
clicache/src/CqServiceStatistics.hpp | 4 +-
clicache/src/CqStatistics.hpp | 4 +-
clicache/src/EntryEvent.cpp | 10 +-
clicache/src/ExceptionTypes.hpp | 14 +-
clicache/src/Execution.cpp | 2 +-
clicache/src/Execution.hpp | 4 +-
clicache/src/LocalRegion.cpp | 74 +-
clicache/src/LocalRegion.hpp | 8 +-
clicache/src/Pool.hpp | 4 +-
clicache/src/PoolFactory.hpp | 4 +-
clicache/src/Properties.cpp | 10 +-
clicache/src/Properties.hpp | 10 +-
clicache/src/Query.cpp | 2 +-
clicache/src/Query.hpp | 6 +-
clicache/src/QueryService.hpp | 4 +-
clicache/src/Region.cpp | 118 +-
clicache/src/Region.hpp | 10 +-
clicache/src/RegionAttributes.hpp | 4 +-
clicache/src/RegionEntry.cpp | 2 +-
clicache/src/RegionEntry.hpp | 4 +-
clicache/src/RegionEvent.cpp | 2 +-
clicache/src/RegionFactory.cpp | 10 +-
clicache/src/ResultCollector.hpp | 2 +-
clicache/src/ResultSet.hpp | 4 +-
clicache/src/Serializable.cpp | 126 +-
clicache/src/Serializable.hpp | 72 +-
clicache/src/Struct.hpp | 4 +-
clicache/src/StructSet.hpp | 4 +-
clicache/src/TransactionEvent.cpp | 6 +-
clicache/src/TransactionId.hpp | 4 +-
clicache/src/UserFunctionExecutionException.hpp | 2 +-
clicache/src/impl/AuthenticatedCache.cpp | 2 +-
clicache/src/impl/AuthenticatedCache.hpp | 4 +-
clicache/src/impl/CacheLoader.hpp | 12 +-
clicache/src/impl/FixedPartitionResolver.hpp | 4 +-
clicache/src/impl/ManagedAuthInitialize.cpp | 2 +-
clicache/src/impl/ManagedAuthInitialize.hpp | 2 +-
clicache/src/impl/ManagedCacheListener.cpp | 4 +-
clicache/src/impl/ManagedCacheListener.hpp | 4 +-
clicache/src/impl/ManagedCacheLoader.cpp | 6 +-
clicache/src/impl/ManagedCacheLoader.hpp | 6 +-
clicache/src/impl/ManagedCacheWriter.cpp | 2 +-
clicache/src/impl/ManagedCacheWriter.hpp | 2 +-
clicache/src/impl/ManagedCacheableDelta.cpp | 4 +-
clicache/src/impl/ManagedCacheableDelta.hpp | 2 +-
clicache/src/impl/ManagedCacheableKey.cpp | 4 +-
clicache/src/impl/ManagedCacheableKey.hpp | 2 +-
.../src/impl/ManagedFixedPartitionResolver.cpp | 2 +-
.../src/impl/ManagedFixedPartitionResolver.hpp | 2 +-
clicache/src/impl/ManagedPartitionResolver.cpp | 2 +-
clicache/src/impl/ManagedPartitionResolver.hpp | 2 +-
clicache/src/impl/ManagedPersistenceManager.cpp | 8 +-
clicache/src/impl/ManagedPersistenceManager.hpp | 8 +-
clicache/src/impl/ManagedResultCollector.cpp | 10 +-
clicache/src/impl/ManagedResultCollector.hpp | 4 +-
clicache/src/impl/ManagedTransactionListener.cpp | 6 +-
clicache/src/impl/ManagedTransactionListener.hpp | 6 +-
clicache/src/impl/ManagedTransactionWriter.cpp | 2 +-
clicache/src/impl/ManagedTransactionWriter.hpp | 2 +-
clicache/src/impl/ManagedVisitor.cpp | 2 +-
clicache/src/impl/ManagedVisitor.hpp | 2 +-
clicache/src/impl/PartitionResolver.hpp | 4 +-
clicache/src/impl/PdxManagedCacheableKey.cpp | 8 +-
clicache/src/impl/PdxManagedCacheableKey.hpp | 4 +-
clicache/src/impl/PersistenceManagerProxy.hpp | 21 +-
clicache/src/impl/ResultCollectorProxy.hpp | 2 +-
clicache/src/impl/SafeConvert.hpp | 8 +-
.../src/impl/CPPCodeGenerator.cpp | 6 +-
cppcache/include/geode/AttributesFactory.hpp | 21 +-
cppcache/include/geode/AttributesMutator.hpp | 12 +-
cppcache/include/geode/AuthInitialize.hpp | 6 +-
cppcache/include/geode/Cache.hpp | 27 +-
cppcache/include/geode/CacheAttributes.hpp | 4 +-
cppcache/include/geode/CacheFactory.hpp | 29 +-
cppcache/include/geode/CacheListener.hpp | 8 +-
cppcache/include/geode/CacheLoader.hpp | 9 +-
cppcache/include/geode/CacheTransactionManager.hpp | 65 +-
cppcache/include/geode/CacheWriter.hpp | 25 +-
cppcache/include/geode/Cacheable.hpp | 5 +-
cppcache/include/geode/CacheableBuiltins.hpp | 115 +-
cppcache/include/geode/CacheableDate.hpp | 18 +-
cppcache/include/geode/CacheableEnum.hpp | 11 +-
cppcache/include/geode/CacheableFileName.hpp | 10 +-
cppcache/include/geode/CacheableKey.hpp | 2 +-
cppcache/include/geode/CacheableObjectArray.hpp | 18 +-
cppcache/include/geode/CacheableString.hpp | 43 +-
cppcache/include/geode/CacheableUndefined.hpp | 2 +-
cppcache/include/geode/CqAttributes.hpp | 3 +-
cppcache/include/geode/CqAttributesFactory.hpp | 11 +-
cppcache/include/geode/CqAttributesMutator.hpp | 11 +-
cppcache/include/geode/CqEvent.hpp | 10 +-
cppcache/include/geode/CqListener.hpp | 2 +-
cppcache/include/geode/CqQuery.hpp | 11 +-
cppcache/include/geode/DataInput.hpp | 24 +-
cppcache/include/geode/DataOutput.hpp | 2 +-
cppcache/include/geode/DefaultResultCollector.hpp | 7 +-
cppcache/include/geode/Delta.hpp | 16 +-
cppcache/include/geode/DistributedSystem.hpp | 3 +-
cppcache/include/geode/EntryEvent.hpp | 31 +-
cppcache/include/geode/Exception.hpp | 21 +-
cppcache/include/geode/ExceptionTypes.hpp | 14 +-
cppcache/include/geode/Execution.hpp | 18 +-
cppcache/include/geode/FixedPartitionResolver.hpp | 4 +-
cppcache/include/geode/FunctionService.hpp | 25 +-
cppcache/include/geode/GeodeCppCache.hpp | 84 --
cppcache/include/geode/HashFunction.hpp | 12 +-
cppcache/include/geode/HashMapT.hpp | 16 +-
cppcache/include/geode/HashSetT.hpp | 6 +-
cppcache/include/geode/PartitionResolver.hpp | 5 +-
cppcache/include/geode/PdxInstance.hpp | 52 +-
cppcache/include/geode/PdxInstanceFactory.hpp | 121 +-
cppcache/include/geode/PdxReader.hpp | 35 +-
cppcache/include/geode/PdxSerializable.hpp | 12 +-
cppcache/include/geode/PdxSerializer.hpp | 5 +-
cppcache/include/geode/PdxWrapper.hpp | 13 +-
cppcache/include/geode/PdxWriter.hpp | 127 ++-
cppcache/include/geode/PersistenceManager.hpp | 73 +-
cppcache/include/geode/Pool.hpp | 14 +-
cppcache/include/geode/PoolFactory.hpp | 6 +-
cppcache/include/geode/PoolManager.hpp | 14 +-
cppcache/include/geode/Properties.hpp | 17 +-
cppcache/include/geode/Query.hpp | 6 +-
cppcache/include/geode/QueryService.hpp | 21 +-
cppcache/include/geode/Region.hpp | 252 ++--
cppcache/include/geode/RegionAttributes.hpp | 26 +-
cppcache/include/geode/RegionEntry.hpp | 23 +-
cppcache/include/geode/RegionEvent.hpp | 13 +-
cppcache/include/geode/RegionFactory.hpp | 26 +-
cppcache/include/geode/RegionService.hpp | 12 +-
cppcache/include/geode/ResultCollector.hpp | 9 +-
cppcache/include/geode/ResultSet.hpp | 3 +-
cppcache/include/geode/SelectResults.hpp | 3 +-
cppcache/include/geode/SelectResultsIterator.hpp | 12 +-
cppcache/include/geode/Serializable.hpp | 9 +-
cppcache/include/geode/Serializer.hpp | 9 +-
cppcache/include/geode/Struct.hpp | 14 +-
cppcache/include/geode/StructSet.hpp | 3 +-
cppcache/include/geode/SystemProperties.hpp | 12 +-
cppcache/include/geode/TypeRegistry.hpp | 3 +-
.../geode/UserFunctionExecutionException.hpp | 20 +-
cppcache/include/geode/VectorT.hpp | 47 -
cppcache/include/geode/WritablePdxInstance.hpp | 26 +-
cppcache/include/geode/geode_types.hpp | 72 --
.../integration-test/BuiltinCacheableWrappers.hpp | 88 +-
cppcache/integration-test/CacheHelper.cpp | 309 +++--
cppcache/integration-test/CacheHelper.hpp | 151 +--
cppcache/integration-test/CacheImplHelper.hpp | 13 +-
cppcache/integration-test/CacheableWrapper.hpp | 12 +-
cppcache/integration-test/DeltaEx.hpp | 19 +-
cppcache/integration-test/QueryHelper.hpp | 86 +-
cppcache/integration-test/TallyListener.hpp | 17 +-
cppcache/integration-test/TallyLoader.hpp | 12 +-
cppcache/integration-test/TallyWriter.hpp | 18 +-
cppcache/integration-test/ThinClientCQ.hpp | 13 +-
.../integration-test/ThinClientCallbackArg.hpp | 24 +-
cppcache/integration-test/ThinClientDistOps.hpp | 96 +-
cppcache/integration-test/ThinClientDistOps2.hpp | 33 +-
cppcache/integration-test/ThinClientDurable.hpp | 41 +-
.../integration-test/ThinClientDurableConnect.hpp | 4 +-
.../integration-test/ThinClientDurableFailover.hpp | 20 +-
.../integration-test/ThinClientDurableInit.hpp | 10 +-
.../integration-test/ThinClientDurableInterest.hpp | 26 +-
.../ThinClientDurableReconnect.hpp | 17 +-
cppcache/integration-test/ThinClientFailover.hpp | 29 +-
cppcache/integration-test/ThinClientFailover2.hpp | 45 +-
cppcache/integration-test/ThinClientFailover3.hpp | 23 +-
.../ThinClientFailoverInterest.hpp | 37 +-
.../ThinClientFailoverInterest2.hpp | 35 +-
.../ThinClientFailoverInterestAllWithCache.hpp | 45 +-
.../integration-test/ThinClientFailoverRegex.hpp | 47 +-
.../integration-test/ThinClientGatewayTest.hpp | 30 +-
cppcache/integration-test/ThinClientHeapLRU.hpp | 13 +-
cppcache/integration-test/ThinClientHelper.hpp | 238 ++--
cppcache/integration-test/ThinClientInterest1.hpp | 10 +-
cppcache/integration-test/ThinClientInterest2.hpp | 12 +-
cppcache/integration-test/ThinClientInterest3.hpp | 32 +-
.../ThinClientInterest3Cacheless.hpp | 26 +-
.../integration-test/ThinClientInterestList.hpp | 53 +-
.../integration-test/ThinClientInterestList2.hpp | 39 +-
.../integration-test/ThinClientListenerInit.hpp | 67 +-
.../integration-test/ThinClientListenerWriter.hpp | 262 +++--
.../ThinClientLocalCacheLoader.hpp | 211 ++--
.../integration-test/ThinClientMultipleCaches.hpp | 4 +-
.../integration-test/ThinClientNotification.hpp | 39 +-
.../integration-test/ThinClientPdxSerializer.hpp | 23 +-
.../integration-test/ThinClientPdxSerializers.hpp | 9 +-
cppcache/integration-test/ThinClientPutAll.hpp | 89 +-
.../integration-test/ThinClientPutAllTimeout.hpp | 22 +-
.../ThinClientPutAllWithCallBack.hpp | 83 +-
cppcache/integration-test/ThinClientPutGetAll.hpp | 47 +-
.../ThinClientRIwithlocalRegionDestroy.hpp | 216 ++--
cppcache/integration-test/ThinClientRegex.hpp | 35 +-
cppcache/integration-test/ThinClientRegex2.hpp | 31 +-
cppcache/integration-test/ThinClientRegex3.hpp | 35 +-
cppcache/integration-test/ThinClientRemoveAll.hpp | 36 +-
cppcache/integration-test/ThinClientSSL.hpp | 41 +-
.../integration-test/ThinClientSSLWithPassword.hpp | 45 +-
cppcache/integration-test/ThinClientSecurity.hpp | 30 +-
.../integration-test/ThinClientSecurityHelper.hpp | 100 +-
cppcache/integration-test/ThinClientTXFailover.hpp | 29 +-
.../integration-test/ThinClientTransactions.hpp | 146 ++-
.../integration-test/ThinClientTransactionsXA.hpp | 122 +-
.../integration-test/ThinClientVersionedOps.hpp | 384 +++----
cppcache/integration-test/fw_perf.hpp | 2 +-
.../integration-test/testAttributesFactory.cpp | 1 -
.../integration-test/testAttributesMutator.cpp | 11 +-
cppcache/integration-test/testCache.cpp | 19 +-
cppcache/integration-test/testCacheless.cpp | 32 +-
cppcache/integration-test/testConnect.cpp | 6 +-
.../integration-test/testCreateAndDestroyPool.cpp | 1 -
cppcache/integration-test/testDunit.cpp | 1 -
cppcache/integration-test/testExpiration.cpp | 112 +-
cppcache/integration-test/testFwPerf.cpp | 1 -
cppcache/integration-test/testLRUList.cpp | 22 +-
cppcache/integration-test/testLinkage.cpp | 28 +-
cppcache/integration-test/testLogger.cpp | 2 +-
.../integration-test/testOverflowPutGetSqLite.cpp | 127 ++-
.../testRegionAccessThreadSafe.cpp | 13 +-
cppcache/integration-test/testRegionMap.cpp | 72 +-
.../integration-test/testRegionTemplateArgs.cpp | 30 +-
cppcache/integration-test/testSerialization.cpp | 14 +-
cppcache/integration-test/testSpinLock.cpp | 1 -
cppcache/integration-test/testSystemProperties.cpp | 10 +-
.../testThinClientAfterRegionLive.cpp | 32 +-
.../integration-test/testThinClientBigValue.cpp | 46 +-
.../testThinClientCacheableStringArray.cpp | 38 +-
.../integration-test/testThinClientCacheables.cpp | 45 +-
.../testThinClientCacheablesLimits.cpp | 20 +-
.../integration-test/testThinClientClearRegion.cpp | 28 +-
.../integration-test/testThinClientConflation.cpp | 20 +-
.../testThinClientContainsKeyOnServer.cpp | 18 +-
cppcache/integration-test/testThinClientCq.cpp | 745 ++++++------
.../integration-test/testThinClientCqDelta.cpp | 54 +-
.../integration-test/testThinClientCqDurable.cpp | 118 +-
.../integration-test/testThinClientCqFailover.cpp | 43 +-
.../testThinClientCqHAFailover.cpp | 70 +-
cppcache/integration-test/testThinClientCqIR.cpp | 35 +-
.../testThinClientDeltaWithNotification.cpp | 48 +-
.../testThinClientDisconnectionListioner.cpp | 8 +-
.../testThinClientExecuteFunctionPrSHOP.cpp | 88 +-
.../testThinClientFixedPartitionResolver.cpp | 11 +-
.../testThinClientGetInterests.cpp | 20 +-
.../integration-test/testThinClientHADistOps.cpp | 69 +-
.../testThinClientHAEventIDMap.cpp | 53 +-
.../integration-test/testThinClientHAFailover.cpp | 47 +-
.../testThinClientHAFailoverRegex.cpp | 37 +-
.../testThinClientHAMixedRedundancy.cpp | 57 +-
.../testThinClientHAPeriodicAck.cpp | 55 +-
.../testThinClientHAQueryFailover.cpp | 19 +-
.../integration-test/testThinClientHeapLRU.cpp | 15 +-
.../testThinClientIntResPolKeysInv.cpp | 39 +-
.../testThinClientInterest1Cacheless.cpp | 21 +-
.../testThinClientInterest1_Bug1001.cpp | 504 ++++----
.../testThinClientInterestNotify.cpp | 40 +-
.../testThinClientLRUExpiration.cpp | 143 ++-
.../testThinClientListenerCallbackArgTest.cpp | 401 ++++---
.../testThinClientListenerEvents.cpp | 58 +-
.../integration-test/testThinClientMultiDS.cpp | 35 +-
...ThinClientNotificationWithDeltaWithoutcache.cpp | 37 +-
.../testThinClientPRPutAllFailover.cpp | 396 ++++---
.../integration-test/testThinClientPRSingleHop.cpp | 47 +-
.../testThinClientPRSingleHopServerGroup.cpp | 20 +-
.../testThinClientPartitionResolver.cpp | 16 +-
.../testThinClientPdxDeltaWithNotification.cpp | 52 +-
.../integration-test/testThinClientPdxEnum.cpp | 17 +-
.../integration-test/testThinClientPdxInstance.cpp | 217 ++--
.../integration-test/testThinClientPdxTests.cpp | 720 +++++++-----
.../testThinClientPoolAttrTest.cpp | 170 ++-
.../testThinClientPoolExecuteFunction.cpp | 57 +-
...oolExecuteFunctionDisableChunkHandlerThread.cpp | 52 +-
.../testThinClientPoolExecuteFunctionPrSHOP.cpp | 39 +-
...hinClientPoolExecuteFunctionThrowsException.cpp | 149 +--
.../testThinClientPoolExecuteHAFunction.cpp | 12 +-
.../testThinClientPoolExecuteHAFunctionPrSHOP.cpp | 14 +-
.../testThinClientPoolRedundancy.cpp | 28 +-
.../testThinClientPoolRegInterest.cpp | 2 +-
.../testThinClientPutAllPRSingleHop.cpp | 20 +-
.../testThinClientPutWithDelta.cpp | 18 +-
...ThinClientRegionQueryDifferentServerConfigs.cpp | 25 +-
.../testThinClientRegionQueryExclusiveness.cpp | 17 +-
.../testThinClientRemoteQueryFailover.cpp | 15 +-
.../testThinClientRemoteQueryFailoverPdx.cpp | 15 +-
.../testThinClientRemoteQueryRS.cpp | 108 +-
.../testThinClientRemoteQuerySS.cpp | 208 ++--
.../testThinClientRemoteQueryTimeout.cpp | 89 +-
.../testThinClientRemoteRegionQuery.cpp | 49 +-
.../integration-test/testThinClientRemoveOps.cpp | 165 +--
.../testThinClientSSLAuthCorrupt.cpp | 5 +-
.../integration-test/testThinClientSSLAuthFail.cpp | 13 +-
.../testThinClientSSLAuthUntrusted.cpp | 5 +-
.../testThinClientSSLWithSecurityAuthz.cpp | 54 +-
.../testThinClientSecurityAuthentication.cpp | 180 ++-
.../testThinClientSecurityAuthenticationMU.cpp | 96 +-
...ientSecurityAuthenticationSetAuthInitialize.cpp | 33 +-
.../testThinClientSecurityAuthorization.cpp | 63 +-
.../testThinClientSecurityAuthorizationMU.cpp | 259 +++--
.../testThinClientSecurityCQAuthorizationMU.cpp | 228 ++--
.../integration-test/testThinClientSecurityDH.cpp | 29 +-
.../testThinClientSecurityDH_MU.cpp | 141 ++-
...tThinClientSecurityDurableCQAuthorizationMU.cpp | 249 ++--
.../testThinClientSecurityMultiUserTest.cpp | 420 +++----
.../testThinClientSecurityPostAuthorization.cpp | 41 +-
.../integration-test/testThinClientStatistics.cpp | 22 +-
.../integration-test/testThinClientTicket303.cpp | 4 +-
.../integration-test/testThinClientTicket304.cpp | 14 +-
.../integration-test/testThinClientTicket317.cpp | 8 +-
.../integration-test/testThinClientTracking.cpp | 18 +-
.../testThinClientWriterException.cpp | 97 +-
cppcache/integration-test/testUtils.hpp | 39 +-
.../testXmlCacheCreationWithOverFlow.cpp | 26 +-
.../testXmlCacheCreationWithPools.cpp | 41 +-
.../testXmlCacheCreationWithRefid.cpp | 20 +-
cppcache/src/AdminRegion.cpp | 13 +-
cppcache/src/AdminRegion.hpp | 9 +-
cppcache/src/AttributesFactory.cpp | 24 +-
cppcache/src/AttributesMutator.cpp | 11 +-
cppcache/src/BucketServerLocation.hpp | 15 +-
cppcache/src/Cache.cpp | 134 ++-
cppcache/src/CacheConfig.hpp | 2 +-
cppcache/src/CacheFactory.cpp | 91 +-
cppcache/src/CacheImpl.cpp | 128 +--
cppcache/src/CacheImpl.hpp | 55 +-
cppcache/src/CacheListener.cpp | 5 +-
cppcache/src/CacheLoader.cpp | 2 +-
cppcache/src/CacheTransactionManagerImpl.cpp | 73 +-
cppcache/src/CacheTransactionManagerImpl.hpp | 18 +-
cppcache/src/CacheWriter.cpp | 2 +-
cppcache/src/CacheXmlParser.cpp | 4 +-
cppcache/src/CacheXmlParser.hpp | 4 +-
cppcache/src/CacheableDate.cpp | 3 +-
cppcache/src/CacheableObjectArray.cpp | 2 +-
cppcache/src/CacheableObjectPartList.cpp | 12 +-
cppcache/src/CacheableObjectPartList.hpp | 27 +-
cppcache/src/CacheableToken.cpp | 12 +-
cppcache/src/CacheableToken.hpp | 35 +-
cppcache/src/ClientConnectionResponse.hpp | 1 -
cppcache/src/ClientHealthStats.hpp | 12 +-
cppcache/src/ClientMetadata.cpp | 115 +-
cppcache/src/ClientMetadata.hpp | 43 +-
cppcache/src/ClientMetadataService.cpp | 214 ++--
cppcache/src/ClientMetadataService.hpp | 116 +-
cppcache/src/ClientProxyMembershipID.cpp | 4 +-
cppcache/src/ClientProxyMembershipID.hpp | 9 +-
cppcache/src/ConcurrentEntriesMap.cpp | 83 +-
cppcache/src/ConcurrentEntriesMap.hpp | 74 +-
cppcache/src/CqAttributesFactory.cpp | 11 +-
cppcache/src/CqAttributesImpl.cpp | 10 +-
cppcache/src/CqAttributesImpl.hpp | 6 +-
cppcache/src/CqAttributesMutatorImpl.cpp | 9 +-
cppcache/src/CqAttributesMutatorImpl.hpp | 11 +-
cppcache/src/CqEventImpl.cpp | 30 +-
cppcache/src/CqEventImpl.hpp | 31 +-
cppcache/src/CqQueryImpl.cpp | 29 +-
cppcache/src/CqQueryImpl.hpp | 42 +-
cppcache/src/CqService.cpp | 55 +-
cppcache/src/CqService.hpp | 28 +-
cppcache/src/DSMemberForVersionStamp.hpp | 1 -
cppcache/src/DataInput.cpp | 3 +-
cppcache/src/DefaultResultCollector.cpp | 5 +-
cppcache/src/Delta.cpp | 5 +-
cppcache/src/DiffieHellman.cpp | 39 +-
cppcache/src/DiffieHellman.hpp | 28 +-
cppcache/src/DiskVersionTag.hpp | 1 -
cppcache/src/DistributedSystem.cpp | 3 +-
cppcache/src/DistributedSystemImpl.hpp | 1 -
cppcache/src/EntriesMap.hpp | 80 +-
cppcache/src/EntriesMapFactory.cpp | 4 +-
cppcache/src/EntriesMapFactory.hpp | 2 +-
cppcache/src/EntryEvent.cpp | 9 +-
cppcache/src/EntryExpiryHandler.cpp | 10 +-
cppcache/src/EntryExpiryHandler.hpp | 9 +-
cppcache/src/EnumInfo.hpp | 13 +-
cppcache/src/EventId.hpp | 6 +-
cppcache/src/EventIdMap.cpp | 12 +-
cppcache/src/EventIdMap.hpp | 25 +-
cppcache/src/EventSource.hpp | 2 -
cppcache/src/EvictionController.cpp | 2 +-
cppcache/src/EvictionController.hpp | 1 -
cppcache/src/Exception.cpp | 7 +-
cppcache/src/ExecutionImpl.cpp | 68 +-
cppcache/src/ExecutionImpl.hpp | 62 +-
cppcache/src/ExpMapEntry.cpp | 4 +-
cppcache/src/ExpMapEntry.hpp | 12 +-
cppcache/src/FarSideEntryOp.cpp | 13 +-
cppcache/src/FarSideEntryOp.hpp | 17 +-
cppcache/src/FixedPartitionAttributesImpl.hpp | 4 +-
cppcache/src/FunctionService.cpp | 85 +-
cppcache/src/FunctionServiceImpl.cpp | 8 +-
cppcache/src/FunctionServiceImpl.hpp | 11 +-
cppcache/src/GetAllServersRequest.hpp | 2 +-
cppcache/src/GetAllServersResponse.hpp | 1 -
.../src/InternalCacheTransactionManager2PCImpl.cpp | 2 +-
cppcache/src/LRUAction.cpp | 16 +-
cppcache/src/LRUAction.hpp | 12 +-
cppcache/src/LRUEntriesMap.cpp | 84 +-
cppcache/src/LRUEntriesMap.hpp | 50 +-
cppcache/src/LRUExpMapEntry.cpp | 7 +-
cppcache/src/LRUExpMapEntry.hpp | 12 +-
cppcache/src/LRUList.cpp | 10 +-
cppcache/src/LRUList.hpp | 12 +-
cppcache/src/LRULocalDestroyAction.cpp | 6 +-
cppcache/src/LRULocalDestroyAction.hpp | 2 +-
cppcache/src/LRUMapEntry.cpp | 4 +-
cppcache/src/LRUMapEntry.hpp | 13 +-
cppcache/src/LocalRegion.cpp | 874 +++++++-------
cppcache/src/LocalRegion.hpp | 538 +++++----
cppcache/src/LocatorListResponse.hpp | 1 -
cppcache/src/MapEntry.cpp | 7 +-
cppcache/src/MapEntry.hpp | 53 +-
cppcache/src/MapEntryT.hpp | 26 +-
cppcache/src/MapSegment.cpp | 168 +--
cppcache/src/MapSegment.hpp | 118 +-
cppcache/src/MapWithLock.hpp | 20 +-
cppcache/src/MemberListForVersionStamp.cpp | 8 +-
cppcache/src/MemberListForVersionStamp.hpp | 13 +-
cppcache/src/NoResult.hpp | 5 +-
cppcache/src/PdxFieldType.cpp | 5 +-
cppcache/src/PdxFieldType.hpp | 5 +-
cppcache/src/PdxHelper.cpp | 198 ++--
cppcache/src/PdxHelper.hpp | 22 +-
cppcache/src/PdxInstanceFactoryImpl.cpp | 421 ++++---
cppcache/src/PdxInstanceFactoryImpl.hpp | 120 +-
cppcache/src/PdxInstanceImpl.cpp | 1200 ++++++++++----------
cppcache/src/PdxInstanceImpl.hpp | 191 ++--
cppcache/src/PdxLocalReader.cpp | 153 ++-
cppcache/src/PdxLocalReader.hpp | 33 +-
cppcache/src/PdxLocalWriter.cpp | 224 ++--
cppcache/src/PdxLocalWriter.hpp | 128 ++-
cppcache/src/PdxReaderWithTypeCollector.cpp | 56 +-
cppcache/src/PdxReaderWithTypeCollector.hpp | 21 +-
cppcache/src/PdxRemotePreservedData.hpp | 13 +-
cppcache/src/PdxRemoteReader.cpp | 51 +-
cppcache/src/PdxRemoteReader.hpp | 15 +-
cppcache/src/PdxRemoteWriter.cpp | 287 +++--
cppcache/src/PdxRemoteWriter.hpp | 115 +-
cppcache/src/PdxSerializable.cpp | 3 +-
cppcache/src/PdxType.cpp | 184 ++-
cppcache/src/PdxType.hpp | 36 +-
cppcache/src/PdxTypeRegistry.cpp | 60 +-
cppcache/src/PdxTypeRegistry.hpp | 51 +-
cppcache/src/PdxWrapper.cpp | 12 +-
cppcache/src/PdxWriterWithTypeCollector.cpp | 248 ++--
cppcache/src/PdxWriterWithTypeCollector.hpp | 112 +-
cppcache/src/PersistenceManager.cpp | 2 +-
cppcache/src/Pool.cpp | 7 +-
cppcache/src/PoolAttributes.cpp | 3 +-
cppcache/src/PoolAttributes.hpp | 2 +-
cppcache/src/PoolFactory.cpp | 11 +-
cppcache/src/PoolManager.cpp | 94 +-
cppcache/src/PoolXmlCreation.cpp | 5 +-
cppcache/src/PoolXmlCreation.hpp | 6 +-
cppcache/src/PreservedDataExpiryHandler.cpp | 6 +-
cppcache/src/PreservedDataExpiryHandler.hpp | 8 +-
cppcache/src/Properties.cpp | 72 +-
cppcache/src/ProxyCache.cpp | 79 +-
cppcache/src/ProxyCache.hpp | 15 +-
cppcache/src/ProxyRegion.hpp | 309 ++---
cppcache/src/ProxyRemoteQueryService.cpp | 43 +-
cppcache/src/ProxyRemoteQueryService.hpp | 28 +-
cppcache/src/PutAllPartialResult.cpp | 13 +-
cppcache/src/PutAllPartialResult.hpp | 23 +-
.../src/PutAllPartialResultServerException.cpp | 54 +-
.../src/PutAllPartialResultServerException.hpp | 32 +-
cppcache/src/QueueConnectionRequest.cpp | 2 +-
cppcache/src/QueueConnectionResponse.hpp | 1 -
cppcache/src/Region.cpp | 2 +-
cppcache/src/RegionAttributes.cpp | 52 +-
cppcache/src/RegionCommit.cpp | 6 +-
cppcache/src/RegionCommit.hpp | 17 +-
cppcache/src/RegionConfig.hpp | 1 -
cppcache/src/RegionEntry.cpp | 19 +-
cppcache/src/RegionEvent.cpp | 4 +-
cppcache/src/RegionExpiryHandler.cpp | 4 +-
cppcache/src/RegionExpiryHandler.hpp | 6 +-
cppcache/src/RegionFactory.cpp | 23 +-
cppcache/src/RegionInternal.cpp | 61 +-
cppcache/src/RegionInternal.hpp | 172 +--
cppcache/src/RegionXmlCreation.cpp | 16 +-
cppcache/src/RegionXmlCreation.hpp | 10 +-
cppcache/src/RemoteQuery.cpp | 37 +-
cppcache/src/RemoteQuery.hpp | 31 +-
cppcache/src/RemoteQueryService.cpp | 34 +-
cppcache/src/RemoteQueryService.hpp | 22 +-
cppcache/src/ResultSetImpl.cpp | 5 +-
cppcache/src/ResultSetImpl.hpp | 6 +-
cppcache/src/SelectResultsIterator.cpp | 9 +-
cppcache/src/Serializable.cpp | 3 +-
cppcache/src/SerializationRegistry.cpp | 38 +-
cppcache/src/SerializationRegistry.hpp | 27 +-
cppcache/src/ServerLocation.hpp | 4 +-
cppcache/src/StackTrace.hpp | 1 -
cppcache/src/Struct.cpp | 18 +-
cppcache/src/StructSetImpl.cpp | 9 +-
cppcache/src/StructSetImpl.hpp | 9 +-
cppcache/src/SuspendedTxExpiryHandler.cpp | 2 +-
cppcache/src/SuspendedTxExpiryHandler.hpp | 4 +-
cppcache/src/SystemProperties.cpp | 21 +-
cppcache/src/TXCommitMessage.cpp | 8 +-
cppcache/src/TXCommitMessage.hpp | 4 +-
cppcache/src/TXEntryState.hpp | 3 +-
cppcache/src/TXId.hpp | 2 -
cppcache/src/TXState.cpp | 96 +-
cppcache/src/TXState.hpp | 16 +-
cppcache/src/TcrChunkedContext.hpp | 6 +-
cppcache/src/TcrConnection.cpp | 89 +-
cppcache/src/TcrConnection.hpp | 16 +-
cppcache/src/TcrConnectionManager.cpp | 4 +-
cppcache/src/TcrConnectionManager.hpp | 2 +-
cppcache/src/TcrEndpoint.cpp | 42 +-
cppcache/src/TcrEndpoint.hpp | 7 +-
cppcache/src/TcrHADistributionManager.cpp | 2 +-
cppcache/src/TcrHADistributionManager.hpp | 4 +-
cppcache/src/TcrMessage.cpp | 355 +++---
cppcache/src/TcrMessage.hpp | 209 ++--
cppcache/src/TcrPoolEndPoint.cpp | 4 +-
cppcache/src/TcrPoolEndPoint.hpp | 4 +-
cppcache/src/ThinClientBaseDM.cpp | 7 +-
cppcache/src/ThinClientBaseDM.hpp | 2 +-
.../src/ThinClientCacheDistributionManager.hpp | 2 -
cppcache/src/ThinClientDistributionManager.cpp | 6 +-
cppcache/src/ThinClientDistributionManager.hpp | 5 +-
cppcache/src/ThinClientHARegion.cpp | 18 +-
cppcache/src/ThinClientHARegion.hpp | 16 +-
cppcache/src/ThinClientLocatorHelper.cpp | 8 +-
cppcache/src/ThinClientPoolDM.cpp | 207 ++--
cppcache/src/ThinClientPoolDM.hpp | 104 +-
cppcache/src/ThinClientPoolHADM.cpp | 2 +-
cppcache/src/ThinClientPoolHADM.hpp | 5 +-
cppcache/src/ThinClientPoolRegion.cpp | 7 +-
cppcache/src/ThinClientPoolRegion.hpp | 7 +-
cppcache/src/ThinClientPoolStickyDM.cpp | 4 +-
cppcache/src/ThinClientPoolStickyDM.hpp | 6 +-
cppcache/src/ThinClientPoolStickyHADM.hpp | 4 +-
cppcache/src/ThinClientRedundancyManager.cpp | 22 +-
cppcache/src/ThinClientRedundancyManager.hpp | 6 +-
cppcache/src/ThinClientRegion.cpp | 605 +++++-----
cppcache/src/ThinClientRegion.hpp | 391 ++++---
cppcache/src/ThinClientStickyManager.cpp | 2 +-
cppcache/src/TombstoneExpiryHandler.cpp | 6 +-
cppcache/src/TombstoneExpiryHandler.hpp | 10 +-
cppcache/src/TombstoneList.cpp | 27 +-
cppcache/src/TombstoneList.hpp | 33 +-
cppcache/src/TrackedMapEntry.cpp | 6 +-
cppcache/src/TrackedMapEntry.hpp | 20 +-
cppcache/src/TransactionalOperation.cpp | 23 +-
cppcache/src/TransactionalOperation.hpp | 14 +-
cppcache/src/TssConnectionWrapper.cpp | 6 +-
cppcache/src/TssConnectionWrapper.hpp | 10 +-
cppcache/src/TypeRegistry.cpp | 3 +-
cppcache/src/UserAttributes.cpp | 49 +-
cppcache/src/UserAttributes.hpp | 31 +-
cppcache/src/UserFunctionExecutionException.cpp | 2 +-
cppcache/src/Utils.cpp | 6 +-
cppcache/src/Utils.hpp | 21 +-
cppcache/src/VersionStamp.cpp | 20 +-
cppcache/src/VersionStamp.hpp | 11 +-
cppcache/src/VersionTag.cpp | 2 +-
cppcache/src/VersionTag.hpp | 1 -
cppcache/src/VersionedCacheableObjectPartList.cpp | 58 +-
cppcache/src/VersionedCacheableObjectPartList.hpp | 60 +-
cppcache/src/statistics/HostStatSampler.cpp | 8 +-
cppcache/src/statistics/PoolStatsSampler.cpp | 6 +-
cppcache/src/statistics/StatisticsManager.hpp | 6 +-
cppcache/test/AttributesFactoryTest.cpp | 12 +-
cppcache/test/DataInputTest.cpp | 16 +-
cppcache/test/DataOutputTest.cpp | 6 +-
cppcache/test/PdxLocalReaderTest.cpp | 10 +-
cppcache/test/StructSetTest.cpp | 18 +-
cppcache/test/TcrMessage_unittest.cpp | 70 +-
cryptoimpl/DHImpl.cpp | 3 +-
dhimpl/DHImpl.cpp | 3 +-
quickstart/cpp/BasicOperations.cpp | 18 +-
quickstart/cpp/CqQuery.cpp | 43 +-
quickstart/cpp/DataExpiration.cpp | 20 +-
quickstart/cpp/Delta.cpp | 77 +-
quickstart/cpp/DistributedSystem.cpp | 23 +-
quickstart/cpp/DurableClient.cpp | 29 +-
quickstart/cpp/Exceptions.cpp | 29 +-
quickstart/cpp/ExecuteFunctions.cpp | 34 +-
quickstart/cpp/HACache.cpp | 13 +-
quickstart/cpp/LoaderListenerWriter.cpp | 17 +-
quickstart/cpp/MultiuserSecurity.cpp | 51 +-
quickstart/cpp/PdxInstance.cpp | 15 +-
quickstart/cpp/PdxRemoteQuery.cpp | 24 +-
quickstart/cpp/PdxSerializer.cpp | 30 +-
quickstart/cpp/PoolCqQuery.cpp | 39 +-
quickstart/cpp/PoolRemoteQuery.cpp | 21 +-
quickstart/cpp/PoolWithEndpoints.cpp | 22 +-
quickstart/cpp/PutAllGetAllOperations.cpp | 12 +-
quickstart/cpp/RefIDExample.cpp | 23 +-
quickstart/cpp/RegisterInterest.cpp | 11 +-
quickstart/cpp/RemoteQuery.cpp | 30 +-
quickstart/cpp/Security.cpp | 11 +-
quickstart/cpp/Transactions.cpp | 15 +-
quickstart/cpp/TransactionsXA.cpp | 18 +-
quickstart/cpp/deltaobjects/DeltaExample.hpp | 6 +-
quickstart/cpp/plugins/DurableCacheListener.hpp | 1 -
quickstart/cpp/plugins/SimpleCacheListener.cpp | 2 +-
quickstart/cpp/plugins/SimpleCacheListener.hpp | 3 +-
quickstart/cpp/plugins/SimpleCacheLoader.cpp | 12 +-
quickstart/cpp/plugins/SimpleCacheLoader.hpp | 9 +-
quickstart/cpp/plugins/SimpleCacheWriter.cpp | 2 +-
quickstart/cpp/plugins/SimpleCacheWriter.hpp | 3 +-
quickstart/cpp/queryobjects/Portfolio.cpp | 6 +-
quickstart/cpp/queryobjects/Portfolio.hpp | 35 +-
quickstart/cpp/queryobjects/PortfolioPdx.cpp | 7 +-
quickstart/cpp/queryobjects/PortfolioPdx.hpp | 23 +-
quickstart/cpp/queryobjects/PortfolioPdxAuto.cpp | 3 +-
quickstart/cpp/queryobjects/PortfolioPdxAuto.hpp | 24 +-
quickstart/cpp/queryobjects/Position.cpp | 3 +-
quickstart/cpp/queryobjects/Position.hpp | 16 +-
quickstart/cpp/queryobjects/PositionPdx.cpp | 7 +-
quickstart/cpp/queryobjects/PositionPdx.hpp | 8 +-
quickstart/cpp/queryobjects/PositionPdxAuto.cpp | 3 +-
quickstart/cpp/queryobjects/PositionPdxAuto.hpp | 9 +-
sqliteimpl/SqLiteHelper.hpp | 1 -
sqliteimpl/SqLiteImpl.cpp | 25 +-
sqliteimpl/SqLiteImpl.hpp | 18 +-
templates/security/PkcsAuthInit.cpp | 15 +-
templates/security/PkcsAuthInit.hpp | 4 +-
templates/security/UserPasswordAuthInit.cpp | 29 +-
templates/security/UserPasswordAuthInit.hpp | 4 +-
tests/cpp/fwk/UdpIpc.cpp | 3 +-
tests/cpp/fwk/UdpIpc.hpp | 1 -
tests/cpp/fwklib/ClientTask.hpp | 1 -
tests/cpp/fwklib/FrameworkTest.cpp | 22 +-
tests/cpp/fwklib/FrameworkTest.hpp | 17 +-
tests/cpp/fwklib/FwkObjects.hpp | 16 +-
tests/cpp/fwklib/PoolHelper.hpp | 15 +-
tests/cpp/fwklib/QueryHelper.hpp | 158 +--
tests/cpp/fwklib/RegionHelper.hpp | 19 +-
tests/cpp/security/CredentialGenerator.cpp | 27 +-
tests/cpp/security/CredentialGenerator.hpp | 19 +-
tests/cpp/security/DummyCredentialGenerator.hpp | 10 +-
tests/cpp/security/DummyCredentialGenerator2.hpp | 10 +-
tests/cpp/security/DummyCredentialGenerator3.hpp | 10 +-
tests/cpp/security/LdapUserCredentialGenerator.hpp | 10 +-
tests/cpp/security/PkcsAuthInit.cpp | 20 +-
tests/cpp/security/PkcsAuthInit.hpp | 4 +-
tests/cpp/security/PkcsCredentialGenerator.hpp | 15 +-
tests/cpp/security/Security.cpp | 318 +++---
tests/cpp/security/Security.hpp | 15 +-
tests/cpp/security/XmlAuthzCredentialGenerator.hpp | 10 +-
tests/cpp/testobject/ArrayOfByte.hpp | 9 +-
tests/cpp/testobject/BatchObject.cpp | 3 +-
tests/cpp/testobject/BatchObject.hpp | 9 +-
tests/cpp/testobject/DeltaFastAssetAccount.hpp | 26 +-
tests/cpp/testobject/DeltaPSTObject.cpp | 3 +-
tests/cpp/testobject/DeltaPSTObject.hpp | 8 +-
tests/cpp/testobject/DeltaTestImpl.cpp | 15 +-
tests/cpp/testobject/DeltaTestImpl.hpp | 32 +-
tests/cpp/testobject/DeltaTestObj.hpp | 7 +-
tests/cpp/testobject/EqStruct.cpp | 3 +-
tests/cpp/testobject/EqStruct.hpp | 7 +-
tests/cpp/testobject/FastAsset.hpp | 10 +-
tests/cpp/testobject/FastAssetAccount.cpp | 2 +-
tests/cpp/testobject/FastAssetAccount.hpp | 15 +-
tests/cpp/testobject/InvalidPdxUsage.cpp | 7 +-
tests/cpp/testobject/InvalidPdxUsage.hpp | 109 +-
tests/cpp/testobject/NestedPdxObject.cpp | 142 ++-
tests/cpp/testobject/NestedPdxObject.hpp | 44 +-
tests/cpp/testobject/NonPdxType.hpp | 110 +-
tests/cpp/testobject/NoopAuthInit.cpp | 7 +-
tests/cpp/testobject/NoopAuthInit.hpp | 4 +-
tests/cpp/testobject/PSTObject.cpp | 3 +-
tests/cpp/testobject/PSTObject.hpp | 9 +-
tests/cpp/testobject/PdxClassV1.cpp | 274 +++--
tests/cpp/testobject/PdxClassV1.hpp | 98 +-
tests/cpp/testobject/PdxClassV2.cpp | 109 +-
tests/cpp/testobject/PdxClassV2.hpp | 97 +-
tests/cpp/testobject/PdxType.cpp | 7 +-
tests/cpp/testobject/PdxType.hpp | 155 ++-
tests/cpp/testobject/PdxVersioned1.cpp | 7 +-
tests/cpp/testobject/PdxVersioned1.hpp | 26 +-
tests/cpp/testobject/PdxVersioned2.cpp | 7 +-
tests/cpp/testobject/PdxVersioned2.hpp | 26 +-
tests/cpp/testobject/Portfolio.cpp | 6 +-
tests/cpp/testobject/Portfolio.hpp | 37 +-
tests/cpp/testobject/PortfolioPdx.cpp | 7 +-
tests/cpp/testobject/PortfolioPdx.hpp | 23 +-
tests/cpp/testobject/Position.cpp | 5 +-
tests/cpp/testobject/Position.hpp | 21 +-
tests/cpp/testobject/PositionPdx.cpp | 7 +-
tests/cpp/testobject/PositionPdx.hpp | 8 +-
tests/cpp/testobject/TestObject1.hpp | 8 +-
tests/cpp/testobject/TimestampedObject.hpp | 3 -
tests/cpp/testobject/VariousPdxTypes.cpp | 215 ++--
tests/cpp/testobject/VariousPdxTypes.hpp | 130 +--
709 files changed, 15539 insertions(+), 15502 deletions(-)
diff --git a/clicache/src/AttributesFactory.cpp b/clicache/src/AttributesFactory.cpp
index 05559a7..1627150 100644
--- a/clicache/src/AttributesFactory.cpp
+++ b/clicache/src/AttributesFactory.cpp
@@ -65,7 +65,7 @@ namespace Apache
generic<class TKey, class TValue>
void AttributesFactory<TKey, TValue>::SetCacheLoader( ICacheLoader<TKey, TValue>^ cacheLoader )
{
- native::CacheLoaderPtr loaderptr;
+ std::shared_ptr<native::CacheLoader> loaderptr;
if ( cacheLoader != nullptr ) {
CacheLoaderGeneric<TKey, TValue>^ clg = gcnew CacheLoaderGeneric<TKey, TValue>();
clg->SetCacheLoader(cacheLoader);
@@ -85,7 +85,7 @@ namespace Apache
generic<class TKey, class TValue>
void AttributesFactory<TKey, TValue>::SetCacheWriter( ICacheWriter<TKey, TValue>^ cacheWriter )
{
- native::CacheWriterPtr writerptr;
+ std::shared_ptr<native::CacheWriter> writerptr;
if ( cacheWriter != nullptr ) {
CacheWriterGeneric<TKey, TValue>^ cwg = gcnew CacheWriterGeneric<TKey, TValue>();
cwg->SetCacheWriter(cacheWriter);
@@ -105,7 +105,7 @@ namespace Apache
generic<class TKey, class TValue>
void AttributesFactory<TKey, TValue>::SetCacheListener( ICacheListener<TKey, TValue>^ cacheListener )
{
- native::CacheListenerPtr listenerptr;
+ std::shared_ptr<native::CacheListener> listenerptr;
if ( cacheListener != nullptr ) {
CacheListenerGeneric<TKey, TValue>^ clg = gcnew CacheListenerGeneric<TKey, TValue>();
clg->SetCacheListener(cacheListener);
@@ -125,7 +125,7 @@ namespace Apache
generic<class TKey, class TValue>
void AttributesFactory<TKey, TValue>::SetPartitionResolver( IPartitionResolver<TKey, TValue>^ partitionresolver )
{
- native::PartitionResolverPtr resolverptr;
+ std::shared_ptr<native::PartitionResolver> resolverptr;
if ( partitionresolver != nullptr ) {
Client::IFixedPartitionResolver<TKey, TValue>^ resolver =
dynamic_cast<Client::IFixedPartitionResolver<TKey, TValue>^>(partitionresolver);
@@ -278,7 +278,7 @@ namespace Apache
generic<class TKey, class TValue>
void AttributesFactory<TKey, TValue>::SetPersistenceManager(IPersistenceManager<TKey, TValue>^ persistenceManager, Properties<String^, String^>^ config )
{
- native::PersistenceManagerPtr persistenceManagerptr;
+ std::shared_ptr<native::PersistenceManager> persistenceManagerptr;
if ( persistenceManager != nullptr ) {
PersistenceManagerGeneric<TKey, TValue>^ clg = gcnew PersistenceManagerGeneric<TKey, TValue>();
clg->SetPersistenceManager(persistenceManager);
@@ -469,7 +469,7 @@ namespace Apache
try
{
- native::RegionAttributesPtr nativeptr = m_nativeptr->get()->createRegionAttributes();
+ std::shared_ptr<native::RegionAttributes> nativeptr = m_nativeptr->get()->createRegionAttributes();
return Apache::Geode::Client::RegionAttributes<TKey, TValue>::Create(nativeptr);
}
finally
diff --git a/clicache/src/AttributesMutator.cpp b/clicache/src/AttributesMutator.cpp
index 92a1605..aa106ca 100644
--- a/clicache/src/AttributesMutator.cpp
+++ b/clicache/src/AttributesMutator.cpp
@@ -167,7 +167,7 @@ namespace Apache
generic<class TKey, class TValue>
void AttributesMutator<TKey, TValue>::SetCacheListener( ICacheListener<TKey, TValue>^ cacheListener )
{
- native::CacheListenerPtr listenerptr;
+ std::shared_ptr<native::CacheListener> listenerptr;
if (cacheListener != nullptr)
{
auto clg = gcnew CacheListenerGeneric<TKey, TValue>();
@@ -195,7 +195,7 @@ namespace Apache
generic<class TKey, class TValue>
void AttributesMutator<TKey, TValue>::SetCacheLoader( ICacheLoader<TKey, TValue>^ cacheLoader )
{
- native::CacheLoaderPtr loaderptr;
+ std::shared_ptr<native::CacheLoader> loaderptr;
if (cacheLoader != nullptr)
{
auto clg = gcnew CacheLoaderGeneric<TKey, TValue>();
@@ -223,7 +223,7 @@ namespace Apache
generic<class TKey, class TValue>
void AttributesMutator<TKey, TValue>::SetCacheWriter( ICacheWriter<TKey, TValue>^ cacheWriter )
{
- native::CacheWriterPtr writerptr;
+ std::shared_ptr<native::CacheWriter> writerptr;
if (cacheWriter != nullptr)
{
auto cwg = gcnew CacheWriterGeneric<TKey, TValue>();
diff --git a/clicache/src/AttributesMutator.hpp b/clicache/src/AttributesMutator.hpp
index 3421ef7..443cdfc 100644
--- a/clicache/src/AttributesMutator.hpp
+++ b/clicache/src/AttributesMutator.hpp
@@ -244,7 +244,7 @@ namespace Apache
/// <returns>
/// The managed wrapper object; null if the native pointer is null.
/// </returns>
- inline static AttributesMutator<TKey, TValue>^ Create( native::AttributesMutatorPtr nativeptr )
+ inline static AttributesMutator<TKey, TValue>^ Create( std::shared_ptr<native::AttributesMutator> nativeptr )
{
return __nullptr == nativeptr ? nullptr :
gcnew AttributesMutator<TKey, TValue>( nativeptr );
@@ -257,7 +257,7 @@ namespace Apache
/// Private constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline AttributesMutator<TKey, TValue>( native::AttributesMutatorPtr nativeptr )
+ inline AttributesMutator<TKey, TValue>( std::shared_ptr<native::AttributesMutator> nativeptr )
{
m_nativeptr = gcnew native_shared_ptr<native::AttributesMutator>(nativeptr);
}
diff --git a/clicache/src/Cache.cpp b/clicache/src/Cache.cpp
index d15c25b..d7a1111 100644
--- a/clicache/src/Cache.cpp
+++ b/clicache/src/Cache.cpp
@@ -48,7 +48,7 @@ namespace Apache
{
namespace native = apache::geode::client;
- Cache::Cache(native::CachePtr nativeptr)
+ Cache::Cache(std::shared_ptr<native::Cache> nativeptr)
{
m_nativeptr = gcnew native_shared_ptr<native::Cache>(nativeptr);
m_pdxTypeRegistry = gcnew Apache::Geode::Client::Internal::PdxTypeRegistry(this);
@@ -181,7 +181,7 @@ namespace Apache
generic<class TKey, class TValue>
array<Client::IRegion<TKey, TValue>^>^ Cache::RootRegions( )
{
- apache::geode::client::VectorOfRegion vrr;
+ std::vector<std::shared_ptr<apache::geode::client::Region>> vrr;
try
{
vrr = m_nativeptr->get()->rootRegions( );
@@ -195,7 +195,7 @@ namespace Apache
for( System::Int32 index = 0; index < vrr.size( ); index++ )
{
- apache::geode::client::RegionPtr& nativeptr( vrr[ index ] );
+ std::shared_ptr<apache::geode::client::Region>& nativeptr( vrr[ index ] );
rootRegions[ index ] = Client::Region<TKey, TValue>::Create( nativeptr );
}
return rootRegions;
diff --git a/clicache/src/Cache.hpp b/clicache/src/Cache.hpp
index 20edfc2..78b53ed 100644
--- a/clicache/src/Cache.hpp
+++ b/clicache/src/Cache.hpp
@@ -178,7 +178,7 @@ namespace Apache
/// </summary>
/// <remarks>
/// If Pool attached with Region is in multiusersecure mode then don't use return instance of region as no credential are attached with this instance.
- /// Get region from RegionService instance of Cache.<see cref="Cache.CreateAuthenticatedView(PropertiesPtr)" />.
+ /// Get region from RegionService instance of Cache.<see cref="Cache.CreateAuthenticatedView(std::shared_ptr<PropertiesPtr>)" />.
/// </remarks>
/// <param name="path">the pathname of the region</param>
/// <returns>the region</returns>
@@ -288,7 +288,7 @@ namespace Apache
/// <returns>
/// The managed wrapper object; null if the native pointer is null.
/// </returns>
- inline static Cache^ Create(native::CachePtr nativeptr)
+ inline static Cache^ Create(std::shared_ptr<native::Cache> nativeptr)
{
return __nullptr == nativeptr ? nullptr :
gcnew Cache( nativeptr );
@@ -310,7 +310,7 @@ namespace Apache
/// Private constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- Cache(native::CachePtr nativeptr);
+ Cache(std::shared_ptr<native::Cache> nativeptr);
native_shared_ptr<native::Cache>^ m_nativeptr;
diff --git a/clicache/src/CacheFactory.cpp b/clicache/src/CacheFactory.cpp
index c95e6a7..f2f6300 100644
--- a/clicache/src/CacheFactory.cpp
+++ b/clicache/src/CacheFactory.cpp
@@ -60,7 +60,7 @@ namespace Apache
bool pdxIgnoreUnreadFields = false;
bool pdxReadSerialized = false;
bool appDomainEnable = false;
- native::CachePtr nativeCache = nullptr;
+ std::shared_ptr<native::Cache> nativeCache = nullptr;
_GF_MG_EXCEPTION_TRY2
//msclr::lock lockInstance(m_singletonSync);
DistributedSystem::acquireDisconnectLock();
diff --git a/clicache/src/CacheFactory.hpp b/clicache/src/CacheFactory.hpp
index 5c18828..3af6792 100644
--- a/clicache/src/CacheFactory.hpp
+++ b/clicache/src/CacheFactory.hpp
@@ -169,7 +169,7 @@ namespace Apache
/// Private constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline CacheFactory(native::CacheFactoryPtr nativeptr, Properties<String^, String^>^ dsProps)
+ inline CacheFactory(std::shared_ptr<native::CacheFactory> nativeptr, Properties<String^, String^>^ dsProps)
{
m_nativeptr = gcnew native_shared_ptr<native::CacheFactory>(nativeptr);
m_dsProps = dsProps;
diff --git a/clicache/src/CacheStatistics.hpp b/clicache/src/CacheStatistics.hpp
index ec006ac..8a1dece 100644
--- a/clicache/src/CacheStatistics.hpp
+++ b/clicache/src/CacheStatistics.hpp
@@ -134,7 +134,7 @@ namespace Apache
/// <returns>
/// The managed wrapper object; null if the native pointer is null.
/// </returns>
- inline static CacheStatistics^ Create( apache::geode::client::CacheStatisticsPtr nativeptr )
+ inline static CacheStatistics^ Create( std::shared_ptr<apache::geode::client::CacheStatistics> nativeptr )
{
return __nullptr == nativeptr ? nullptr :
gcnew CacheStatistics( nativeptr );
@@ -147,7 +147,7 @@ namespace Apache
/// Private constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline CacheStatistics( apache::geode::client::CacheStatisticsPtr nativeptr )
+ inline CacheStatistics( std::shared_ptr<apache::geode::client::CacheStatistics> nativeptr )
{
m_nativeptr = gcnew native_shared_ptr<native::CacheStatistics>(nativeptr);
}
diff --git a/clicache/src/CacheTransactionManager.cpp b/clicache/src/CacheTransactionManager.cpp
index e812c43..1159c86 100644
--- a/clicache/src/CacheTransactionManager.cpp
+++ b/clicache/src/CacheTransactionManager.cpp
@@ -219,7 +219,7 @@ namespace Apache
_GF_MG_EXCEPTION_TRY2
// Conver the unmanaged object to managed generic object
- apache::geode::client::TransactionWriterPtr& writerPtr( m_nativeptr->getGCKeepAlive()->getWriter( ) );
+ std::shared_ptr<apache::geode::client::TransactionWriter>& writerPtr( m_nativeptr->getGCKeepAlive()->getWriter( ) );
apache::geode::client::ManagedTransactionWriterGeneric* twg =
dynamic_cast<apache::geode::client::ManagedTransactionWriterGeneric*>( writerPtr.get() );
@@ -239,7 +239,7 @@ namespace Apache
_GF_MG_EXCEPTION_TRY2
// Create a unmanaged object using the ManagedTransactionWriterGeneric.
// Set the generic object inside the TransactionWriterGeneric that is a non generic object
- apache::geode::client::TransactionWriterPtr writerPtr;
+ std::shared_ptr<apache::geode::client::TransactionWriter> writerPtr;
if ( transactionWriter != nullptr )
{
TransactionWriterGeneric<TKey, TValue>^ twg = gcnew TransactionWriterGeneric<TKey, TValue> ();
@@ -258,7 +258,7 @@ namespace Apache
_GF_MG_EXCEPTION_TRY2
// Create a unmanaged object using the ManagedTransactionListenerGeneric.
// Set the generic object inside the TransactionListenerGeneric that is a non generic object
- apache::geode::client::TransactionListenerPtr listenerPtr;
+ std::shared_ptr<apache::geode::client::TransactionListener> listenerPtr;
if ( transactionListener != nullptr )
{
TransactionListenerGeneric<TKey, TValue>^ twg = gcnew TransactionListenerGeneric<TKey, TValue> ();
@@ -277,7 +277,7 @@ namespace Apache
_GF_MG_EXCEPTION_TRY2
// Create an unmanaged non generic object using the managed generic object
// use this to call the remove listener
- apache::geode::client::TransactionListenerPtr listenerPtr;
+ std::shared_ptr<apache::geode::client::TransactionListener> listenerPtr;
if ( transactionListener != nullptr )
{
TransactionListenerGeneric<TKey, TValue>^ twg = gcnew TransactionListenerGeneric<TKey, TValue> ();
diff --git a/clicache/src/CacheTransactionManager.hpp b/clicache/src/CacheTransactionManager.hpp
index 8638bae..acca776 100644
--- a/clicache/src/CacheTransactionManager.hpp
+++ b/clicache/src/CacheTransactionManager.hpp
@@ -203,7 +203,7 @@ namespace Apache
internal:
- inline static CacheTransactionManager^ Create( native::InternalCacheTransactionManager2PCPtr nativeptr )
+ inline static CacheTransactionManager^ Create( std::shared_ptr<native::InternalCacheTransactionManager2PC> nativeptr )
{
return ( nativeptr != nullptr ?
gcnew CacheTransactionManager( nativeptr ) : nullptr );
@@ -216,7 +216,7 @@ namespace Apache
/// Private constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline CacheTransactionManager( native::InternalCacheTransactionManager2PCPtr nativeptr )
+ inline CacheTransactionManager( std::shared_ptr<native::InternalCacheTransactionManager2PC> nativeptr )
{
m_nativeptr = gcnew native_shared_ptr<native::InternalCacheTransactionManager2PC>(nativeptr);
}
diff --git a/clicache/src/CacheableBuiltins.hpp b/clicache/src/CacheableBuiltins.hpp
index fdb845a..dc07e94 100644
--- a/clicache/src/CacheableBuiltins.hpp
+++ b/clicache/src/CacheableBuiltins.hpp
@@ -176,7 +176,7 @@ namespace Apache
/// Protected constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline CacheableBuiltinKey(native::SerializablePtr nativeptr)
+ inline CacheableBuiltinKey(std::shared_ptr<native::Serializable> nativeptr)
: CacheableKey(nativeptr) { }
};
@@ -279,7 +279,7 @@ namespace Apache
/// Protected constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline CacheableBuiltinArray(native::SerializablePtr nptr)
+ inline CacheableBuiltinArray(std::shared_ptr<native::Serializable> nptr)
: Serializable(nptr)
{
auto nativeptr = std::static_pointer_cast<TNative>(nptr);
@@ -386,20 +386,20 @@ namespace Apache
} \
\
internal: \
- static IGeodeSerializable^ Create(native::SerializablePtr obj) \
+ static IGeodeSerializable^ Create(std::shared_ptr<native::Serializable> obj) \
{ \
return (obj != nullptr ? gcnew m(obj) : nullptr); \
} \
\
private: \
- inline m(native::SerializablePtr nativeptr) \
+ inline m(std::shared_ptr<native::Serializable> nativeptr) \
: CacheableBuiltinKey(nativeptr) { } \
};
#define _GFCLI_CACHEABLE_ARRAY_DEF_NEW(m, mt) \
ref class m : public CacheableBuiltinArray< \
- native::m, native::m##Ptr, mt, GeodeClassIds::m> \
+ native::m, native::m, mt, GeodeClassIds::m> \
{ \
public: \
/** <summary>
@@ -449,7 +449,7 @@ namespace Apache
} \
\
internal: \
- static IGeodeSerializable^ Create(native::SerializablePtr obj) \
+ static IGeodeSerializable^ Create(std::shared_ptr<native::Serializable> obj) \
{ \
return (obj != nullptr ? gcnew m(obj) : nullptr); \
} \
@@ -482,7 +482,7 @@ namespace Apache
*/ \
inline m(array<mt>^ value, System::Int32 length) \
: CacheableBuiltinArray(value, length) { } \
- inline m(native::SerializablePtr nativeptr) \
+ inline m(std::shared_ptr<native::Serializable> nativeptr) \
: CacheableBuiltinArray(nativeptr) { } \
};
diff --git a/clicache/src/CacheableHashSet.hpp b/clicache/src/CacheableHashSet.hpp
index 3b5e97e..60f5d71 100644
--- a/clicache/src/CacheableHashSet.hpp
+++ b/clicache/src/CacheableHashSet.hpp
@@ -583,7 +583,7 @@ namespace Apache
/// Private constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline CacheableHashSetType<TYPEID, HSTYPE>(apache::geode::client::SerializablePtr nativeptr)
+ inline CacheableHashSetType<TYPEID, HSTYPE>(std::shared_ptr<apache::geode::client::Serializable> nativeptr)
: Serializable(nativeptr) { }
/// <summary>
@@ -650,13 +650,13 @@ namespace Apache
} \
\
internal: \
- static IGeodeSerializable^ Create(apache::geode::client::SerializablePtr obj) \
+ static IGeodeSerializable^ Create(std::shared_ptr<apache::geode::client::Serializable> obj) \
{ \
return gcnew m(obj); \
} \
\
private: \
- inline m(apache::geode::client::SerializablePtr nativeptr) \
+ inline m(std::shared_ptr<apache::geode::client::Serializable> nativeptr) \
: Internal::CacheableHashSetType<Apache::Geode::Client::GeodeClassIds::m, HSTYPE>(nativeptr) { } \
};
diff --git a/clicache/src/CacheableKey.hpp b/clicache/src/CacheableKey.hpp
index 39bf3e5..752fbeb 100644
--- a/clicache/src/CacheableKey.hpp
+++ b/clicache/src/CacheableKey.hpp
@@ -131,7 +131,7 @@ namespace Apache
/// Internal constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline CacheableKey(apache::geode::client::SerializablePtr nativeptr)
+ inline CacheableKey(std::shared_ptr<apache::geode::client::Serializable> nativeptr)
: Client::Serializable(nativeptr) { }
};
} // namespace Client
diff --git a/clicache/src/CacheableString.cpp b/clicache/src/CacheableString.cpp
index 7f7a227..2b653be 100644
--- a/clicache/src/CacheableString.cpp
+++ b/clicache/src/CacheableString.cpp
@@ -69,7 +69,7 @@ namespace Apache
inline void CacheableString::GetCacheableString(String^ value,
- apache::geode::client::CacheableStringPtr& cStr)
+ std::shared_ptr<apache::geode::client::CacheableString>& cStr)
{
size_t len;
if (value != nullptr && (len = value->Length) > 0) {
@@ -83,7 +83,7 @@ namespace Apache
}
inline void CacheableString::GetCacheableString(array<Char>^ value,
- apache::geode::client::CacheableStringPtr& cStr)
+ std::shared_ptr<apache::geode::client::CacheableString>& cStr)
{
size_t len;
if (value != nullptr && (len = value->Length) > 0) {
diff --git a/clicache/src/CacheableString.hpp b/clicache/src/CacheableString.hpp
index 2109258..f469af5 100644
--- a/clicache/src/CacheableString.hpp
+++ b/clicache/src/CacheableString.hpp
@@ -242,7 +242,7 @@ namespace Apache
/// <summary>
/// Factory function to register wrapper
/// </summary>
- static IGeodeSerializable^ Create(apache::geode::client::SerializablePtr obj)
+ static IGeodeSerializable^ Create(std::shared_ptr<apache::geode::client::Serializable> obj)
{
return (obj != nullptr ?
gcnew CacheableString(obj) : nullptr);
@@ -253,14 +253,14 @@ namespace Apache
/// from the given managed string.
/// </summary>
static void GetCacheableString(String^ value,
- apache::geode::client::CacheableStringPtr& cStr);
+ std::shared_ptr<apache::geode::client::CacheableString>& cStr);
/// <summary>
/// Internal function to create a <c>apache::geode::client::CacheableString</c>
/// from the given managed array of characters.
/// </summary>
static void GetCacheableString(array<Char>^ value,
- apache::geode::client::CacheableStringPtr& cStr);
+ std::shared_ptr<apache::geode::client::CacheableString>& cStr);
/// <summary>
/// Get the <c>System.String</c> from the given
@@ -316,7 +316,7 @@ namespace Apache
/// Private constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline CacheableString(apache::geode::client::SerializablePtr nativeptr)
+ inline CacheableString(std::shared_ptr<apache::geode::client::Serializable> nativeptr)
: CacheableKey(nativeptr) { }
};
} // namespace Client
diff --git a/clicache/src/CacheableStringArray.hpp b/clicache/src/CacheableStringArray.hpp
index 36bcd97..cfbb37c 100644
--- a/clicache/src/CacheableStringArray.hpp
+++ b/clicache/src/CacheableStringArray.hpp
@@ -155,7 +155,7 @@ namespace Apache
/// <summary>
/// Factory function to register wrapper
/// </summary>
- static IGeodeSerializable^ Create(apache::geode::client::SerializablePtr obj)
+ static IGeodeSerializable^ Create(std::shared_ptr<apache::geode::client::Serializable> obj)
{
return (obj != nullptr ?
gcnew CacheableStringArray(obj) : nullptr);
@@ -183,7 +183,7 @@ namespace Apache
/// Private constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline CacheableStringArray(apache::geode::client::SerializablePtr nativeptr)
+ inline CacheableStringArray(std::shared_ptr<apache::geode::client::Serializable> nativeptr)
: Serializable(nativeptr) { }
};
} // namespace Client
diff --git a/clicache/src/CqAttributes.hpp b/clicache/src/CqAttributes.hpp
index cf3fb56..c0d3447 100644
--- a/clicache/src/CqAttributes.hpp
+++ b/clicache/src/CqAttributes.hpp
@@ -61,7 +61,7 @@ namespace Apache
/// <returns>
/// The managed wrapper object; null if the native pointer is null.
/// </returns>
- inline static CqAttributes<TKey, TResult>^ Create( native::CqAttributesPtr nativeptr )
+ inline static CqAttributes<TKey, TResult>^ Create( std::shared_ptr<native::CqAttributes> nativeptr )
{
return __nullptr == nativeptr ? nullptr :
gcnew CqAttributes( nativeptr );
@@ -78,7 +78,7 @@ namespace Apache
/// Private constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline CqAttributes( native::CqAttributesPtr nativeptr )
+ inline CqAttributes( std::shared_ptr<native::CqAttributes> nativeptr )
{
m_nativeptr = gcnew native_shared_ptr<native::CqAttributes>(nativeptr);
}
diff --git a/clicache/src/CqAttributesMutator.cpp b/clicache/src/CqAttributesMutator.cpp
index d728746..9e7d935 100644
--- a/clicache/src/CqAttributesMutator.cpp
+++ b/clicache/src/CqAttributesMutator.cpp
@@ -93,7 +93,7 @@ namespace Apache
if (auto lister = dynamic_cast<Client::ICqStatusListener<TKey, TResult>^>(cqListener)) {
auto cqlg = gcnew CqStatusListenerGeneric<TKey, TResult>();
cqlg->AddCqListener(cqListener);
- native::CqStatusListenerPtr lptr = std::shared_ptr<native::ManagedCqStatusListenerGeneric>(
+ std::shared_ptr<native::CqStatusListener> lptr = std::shared_ptr<native::ManagedCqStatusListenerGeneric>(
new native::ManagedCqStatusListenerGeneric(lister));
((native::ManagedCqStatusListenerGeneric*)lptr.get())->setptr(cqlg);
try {
@@ -116,7 +116,7 @@ namespace Apache
else {
auto cqlg = gcnew CqListenerGeneric<TKey, TResult>();
cqlg->AddCqListener(cqListener);
- native::CqListenerPtr lptr = std::shared_ptr<native::ManagedCqListenerGeneric>(
+ std::shared_ptr<native::CqListener> lptr = std::shared_ptr<native::ManagedCqListenerGeneric>(
new native::ManagedCqListenerGeneric(cqListener));
((native::ManagedCqListenerGeneric*)lptr.get())->setptr(cqlg);
try {
diff --git a/clicache/src/CqAttributesMutator.hpp b/clicache/src/CqAttributesMutator.hpp
index 7e04b65..c814ff0 100644
--- a/clicache/src/CqAttributesMutator.hpp
+++ b/clicache/src/CqAttributesMutator.hpp
@@ -91,7 +91,7 @@ namespace Apache
/// <returns>
/// The managed wrapper object; null if the native pointer is null.
/// </returns>
- inline static Client::CqAttributesMutator<TKey, TResult>^ Create( native::CqAttributesMutatorPtr nativeptr )
+ inline static Client::CqAttributesMutator<TKey, TResult>^ Create( std::shared_ptr<native::CqAttributesMutator> nativeptr )
{
return __nullptr == nativeptr ? nullptr :
gcnew Client::CqAttributesMutator<TKey, TResult>( nativeptr );
@@ -104,7 +104,7 @@ namespace Apache
/// Private constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline CqAttributesMutator<TKey, TResult>( native::CqAttributesMutatorPtr nativeptr )
+ inline CqAttributesMutator<TKey, TResult>( std::shared_ptr<native::CqAttributesMutator> nativeptr )
{
m_nativeptr = gcnew native_shared_ptr<native::CqAttributesMutator>(nativeptr);
}
diff --git a/clicache/src/CqEvent.cpp b/clicache/src/CqEvent.cpp
index ae1c668..a98003f 100644
--- a/clicache/src/CqEvent.cpp
+++ b/clicache/src/CqEvent.cpp
@@ -33,7 +33,7 @@ namespace Apache
generic<class TKey, class TResult>
CqQuery<TKey, TResult>^ CqEvent<TKey, TResult>::getCq( )
{
- native::CqQueryPtr& cQueryptr( m_nativeptr->getCq( ) );
+ std::shared_ptr<native::CqQuery>& cQueryptr( m_nativeptr->getCq( ) );
return CqQuery<TKey, TResult>::Create( cQueryptr);
}
@@ -52,14 +52,14 @@ namespace Apache
generic<class TKey, class TResult>
TKey CqEvent<TKey, TResult>::getKey( )
{
- native::CacheableKeyPtr& keyptr( m_nativeptr->getKey( ) );
+ std::shared_ptr<native::CacheableKey>& keyptr( m_nativeptr->getKey( ) );
return Serializable::GetManagedValueGeneric<TKey>(keyptr);
}
generic<class TKey, class TResult>
TResult CqEvent<TKey, TResult>::getNewValue( )
{
- native::CacheablePtr& valptr( m_nativeptr->getNewValue( ) );
+ std::shared_ptr<native::Cacheable>& valptr( m_nativeptr->getNewValue( ) );
return Serializable::GetManagedValueGeneric<TResult>(valptr);
}
diff --git a/clicache/src/CqQuery.hpp b/clicache/src/CqQuery.hpp
index 957cb05..850310a 100644
--- a/clicache/src/CqQuery.hpp
+++ b/clicache/src/CqQuery.hpp
@@ -163,7 +163,7 @@ namespace Apache
/// <returns>
/// The managed wrapper object; null if the native pointer is null.
/// </returns>
- inline static CqQuery<TKey, TResult>^ Create( native::CqQueryPtr nativeptr )
+ inline static CqQuery<TKey, TResult>^ Create( std::shared_ptr<native::CqQuery> nativeptr )
{
return __nullptr == nativeptr ? nullptr :
gcnew CqQuery<TKey, TResult>( nativeptr );
@@ -176,7 +176,7 @@ namespace Apache
/// Private constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline CqQuery( native::CqQueryPtr nativeptr )
+ inline CqQuery( std::shared_ptr<native::CqQuery> nativeptr )
{
m_nativeptr = gcnew native_shared_ptr<native::CqQuery>(nativeptr);
}
diff --git a/clicache/src/CqServiceStatistics.hpp b/clicache/src/CqServiceStatistics.hpp
index d711d8a..2fa9c41 100644
--- a/clicache/src/CqServiceStatistics.hpp
+++ b/clicache/src/CqServiceStatistics.hpp
@@ -76,7 +76,7 @@ namespace Apache
/// <returns>
/// The managed wrapper object; null if the native pointer is null.
/// </returns>
- inline static CqServiceStatistics^ Create( apache::geode::client::CqServiceStatisticsPtr nativeptr )
+ inline static CqServiceStatistics^ Create( std::shared_ptr<apache::geode::client::CqServiceStatistics> nativeptr )
{
return __nullptr == nativeptr ? nullptr :
gcnew CqServiceStatistics( nativeptr );
@@ -89,7 +89,7 @@ namespace Apache
/// Private constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline CqServiceStatistics( apache::geode::client::CqServiceStatisticsPtr nativeptr )
+ inline CqServiceStatistics( std::shared_ptr<apache::geode::client::CqServiceStatistics> nativeptr )
{
m_nativeptr = gcnew native_shared_ptr<native::CqServiceStatistics>(nativeptr);
}
diff --git a/clicache/src/CqStatistics.hpp b/clicache/src/CqStatistics.hpp
index 05aa23c..93876fb 100644
--- a/clicache/src/CqStatistics.hpp
+++ b/clicache/src/CqStatistics.hpp
@@ -69,7 +69,7 @@ namespace Apache
/// <returns>
/// The managed wrapper object; null if the native pointer is null.
/// </returns>
- inline static CqStatistics^ Create( apache::geode::client::CqStatisticsPtr nativeptr )
+ inline static CqStatistics^ Create( std::shared_ptr<apache::geode::client::CqStatistics> nativeptr )
{
return __nullptr == nativeptr ? nullptr :
gcnew CqStatistics( nativeptr );
@@ -82,7 +82,7 @@ namespace Apache
/// Private constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline CqStatistics( apache::geode::client::CqStatisticsPtr nativeptr )
+ inline CqStatistics( std::shared_ptr<apache::geode::client::CqStatistics> nativeptr )
{
m_nativeptr = gcnew native_shared_ptr<native::CqStatistics>(nativeptr);
}
diff --git a/clicache/src/EntryEvent.cpp b/clicache/src/EntryEvent.cpp
index 47218c6..bda549c 100644
--- a/clicache/src/EntryEvent.cpp
+++ b/clicache/src/EntryEvent.cpp
@@ -31,35 +31,35 @@ namespace Apache
generic<class TKey, class TValue>
IRegion<TKey, TValue>^ EntryEvent<TKey, TValue>::Region::get( )
{
- apache::geode::client::RegionPtr regionptr = m_nativeptr->getRegion();
+ std::shared_ptr<apache::geode::client::Region> regionptr = m_nativeptr->getRegion();
return Client::Region<TKey, TValue>::Create( regionptr );
}
generic<class TKey, class TValue>
TKey EntryEvent<TKey, TValue>::Key::get( )
{
- apache::geode::client::CacheableKeyPtr& keyptr( m_nativeptr->getKey( ) );
+ std::shared_ptr<apache::geode::client::CacheableKey>& keyptr( m_nativeptr->getKey( ) );
return Serializable::GetManagedValueGeneric<TKey>( keyptr );
}
generic<class TKey, class TValue>
TValue EntryEvent<TKey, TValue>::OldValue::get( )
{
- apache::geode::client::CacheablePtr& valptr( m_nativeptr->getOldValue( ) );
+ std::shared_ptr<apache::geode::client::Cacheable>& valptr( m_nativeptr->getOldValue( ) );
return Serializable::GetManagedValueGeneric<TValue>( valptr );
}
generic<class TKey, class TValue>
TValue EntryEvent<TKey, TValue>::NewValue::get( )
{
- apache::geode::client::CacheablePtr& valptr( m_nativeptr->getNewValue( ) );
+ std::shared_ptr<apache::geode::client::Cacheable>& valptr( m_nativeptr->getNewValue( ) );
return Serializable::GetManagedValueGeneric<TValue>( valptr );
}
generic<class TKey, class TValue>
Object^ EntryEvent<TKey, TValue>::CallbackArgument::get()
{
- apache::geode::client::SerializablePtr& valptr(m_nativeptr->getCallbackArgument());
+ std::shared_ptr<apache::geode::client::Serializable>& valptr(m_nativeptr->getCallbackArgument());
return Serializable::GetManagedValueGeneric<Object^>( valptr );
}
diff --git a/clicache/src/ExceptionTypes.hpp b/clicache/src/ExceptionTypes.hpp
index 491dfcb..6ac31b4 100644
--- a/clicache/src/ExceptionTypes.hpp
+++ b/clicache/src/ExceptionTypes.hpp
@@ -152,7 +152,7 @@ namespace Apache
/// contained in the message. Note that in this process the
/// original stacktrace is appended to the message of the exception.
/// </remarks>
- inline static apache::geode::client::ExceptionPtr GetNative(Exception^ ex)
+ inline static std::shared_ptr<apache::geode::client::Exception> GetNative(Exception^ ex)
{
if (ex != nullptr) {
GeodeException^ gfEx = dynamic_cast<GeodeException^>(ex);
@@ -160,7 +160,7 @@ namespace Apache
return gfEx->GetNative();
}
else {
- apache::geode::client::ExceptionPtr cause;
+ std::shared_ptr<apache::geode::client::Exception> cause;
if (ex->InnerException != nullptr) {
cause = GeodeException::GetNative(ex->InnerException);
}
@@ -176,11 +176,11 @@ namespace Apache
/// Gets the C++ native exception object for this managed
/// <c>GeodeException</c>.
/// </summary>
- virtual apache::geode::client::ExceptionPtr GetNative()
+ virtual std::shared_ptr<apache::geode::client::Exception> GetNative()
{
String^ msg = this->Message + ": " + this->StackTrace;
ManagedString mg_msg(msg);
- apache::geode::client::ExceptionPtr cause;
+ std::shared_ptr<apache::geode::client::Exception> cause;
if (this->InnerException != nullptr) {
cause = GeodeException::GetNative(this->InnerException);
}
@@ -205,7 +205,7 @@ namespace Apache
inline static void ThrowNative(Exception^ ex)
{
if (ex != nullptr) {
- apache::geode::client::ExceptionPtr cause;
+ std::shared_ptr<apache::geode::client::Exception> cause;
if (ex->InnerException != nullptr) {
cause = GeodeException::GetNative(ex->InnerException);
}
@@ -350,11 +350,11 @@ namespace Apache
} \
return nullptr; \
} \
- virtual apache::geode::client::ExceptionPtr GetNative() override \
+ virtual std::shared_ptr<apache::geode::client::Exception> GetNative() override \
{ \
String^ msg = this->Message + ": " + this->StackTrace; \
ManagedString mg_msg(msg); \
- apache::geode::client::ExceptionPtr cause; \
+ std::shared_ptr<apache::geode::client::Exception> cause; \
if (this->InnerException != nullptr) { \
cause = GeodeException::GetNative(this->InnerException); \
} \
diff --git a/clicache/src/Execution.cpp b/clicache/src/Execution.cpp
index 3b41d09..8b564b6 100644
--- a/clicache/src/Execution.cpp
+++ b/clicache/src/Execution.cpp
@@ -88,7 +88,7 @@ namespace Apache
Execution<TResult>^ Execution<TResult>::WithCollector(Client::IResultCollector<TResult>^ rc)
{
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
- native::ResultCollectorPtr rcptr;
+ std::shared_ptr<native::ResultCollector> rcptr;
if ( rc != nullptr ) {
auto rcg = gcnew ResultCollectorGeneric<TResult>();
rcg->SetResultCollector(rc);
diff --git a/clicache/src/Execution.hpp b/clicache/src/Execution.hpp
index a1f27b8..067afbe 100644
--- a/clicache/src/Execution.hpp
+++ b/clicache/src/Execution.hpp
@@ -90,7 +90,7 @@ namespace Apache
/// <returns>
/// The managed wrapper object; null if the native pointer is null.
/// </returns>
- inline static Execution<TResult>^ Create( native::ExecutionPtr nativeptr, IResultCollector<TResult>^ rc )
+ inline static Execution<TResult>^ Create( std::shared_ptr<native::Execution> nativeptr, IResultCollector<TResult>^ rc )
{
return __nullptr == nativeptr ? nullptr :
gcnew Execution<TResult>( nativeptr, rc );
@@ -100,7 +100,7 @@ namespace Apache
/// Private constructor to wrap a native object pointer.
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline Execution( native::ExecutionPtr nativeptr, IResultCollector<TResult>^ rc )
+ inline Execution( std::shared_ptr<native::Execution> nativeptr, IResultCollector<TResult>^ rc )
{
m_rc = rc;
m_nativeptr = gcnew native_shared_ptr<native::Execution>(nativeptr);
diff --git a/clicache/src/LocalRegion.cpp b/clicache/src/LocalRegion.cpp
index 67b92b5..821c28b 100644
--- a/clicache/src/LocalRegion.cpp
+++ b/clicache/src/LocalRegion.cpp
@@ -41,7 +41,7 @@ namespace Apache
generic<class TKey, class TValue>
TValue LocalRegion<TKey, TValue>::Get(TKey key, Object^ callbackArg)
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>( key );
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>( key );
auto nativeptr= this->getRegionEntryValue(keyptr);
if (nativeptr == nullptr)
{
@@ -52,7 +52,7 @@ namespace Apache
}
generic<class TKey, class TValue>
- apache::geode::client::SerializablePtr LocalRegion<TKey, TValue>::getRegionEntryValue(apache::geode::client::CacheableKeyPtr& keyptr)
+ std::shared_ptr<apache::geode::client::Serializable> LocalRegion<TKey, TValue>::getRegionEntryValue(std::shared_ptr<apache::geode::client::CacheableKey>& keyptr)
{
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
try
@@ -78,9 +78,9 @@ namespace Apache
try
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>( key );
- native::CacheablePtr valueptr = Serializable::GetUnmanagedValueGeneric<TValue>( value );
- native::SerializablePtr callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>( callbackArg );
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>( key );
+ std::shared_ptr<native::Cacheable> valueptr = Serializable::GetUnmanagedValueGeneric<TValue>( value );
+ std::shared_ptr<native::Serializable> callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>( callbackArg );
m_nativeptr->get()->localPut( keyptr, valueptr, callbackptr );
}
finally
@@ -94,7 +94,7 @@ namespace Apache
generic<class TKey, class TValue>
TValue LocalRegion<TKey, TValue>::default::get(TKey key)
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>( key );
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>( key );
auto nativeptr = this->getRegionEntryValue(keyptr);
if (nativeptr == nullptr)
{
@@ -111,8 +111,8 @@ namespace Apache
try
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>( key );
- native::CacheablePtr valueptr = Serializable::GetUnmanagedValueGeneric<TValue>( value );
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>( key );
+ std::shared_ptr<native::Cacheable> valueptr = Serializable::GetUnmanagedValueGeneric<TValue>( value );
m_nativeptr->get()->localPut( keyptr, valueptr );
}
finally
@@ -127,7 +127,7 @@ namespace Apache
System::Collections::Generic::IEnumerator<KeyValuePair<TKey,TValue>>^
LocalRegion<TKey, TValue>::GetEnumerator()
{
- apache::geode::client::VectorOfRegionEntry vc;
+ std::vector<std::shared_ptr<apache::geode::client::RegionEntry>> vc;
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
@@ -157,7 +157,7 @@ namespace Apache
System::Collections::IEnumerator^
LocalRegion<TKey, TValue>::GetEnumeratorOld()
{
- apache::geode::client::VectorOfRegionEntry vc;
+ std::vector<std::shared_ptr<apache::geode::client::RegionEntry>> vc;
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
@@ -185,7 +185,7 @@ namespace Apache
generic<class TKey, class TValue>
- bool LocalRegion<TKey, TValue>::AreValuesEqual(apache::geode::client::CacheablePtr& val1, apache::geode::client::CacheablePtr& val2)
+ bool LocalRegion<TKey, TValue>::AreValuesEqual(std::shared_ptr<apache::geode::client::Cacheable>& val1, std::shared_ptr<apache::geode::client::Cacheable>& val2)
{
if ( val1 == nullptr && val2 == nullptr )
{
@@ -269,7 +269,7 @@ namespace Apache
{
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
- apache::geode::client::VectorOfCacheableKey vc;
+ std::vector<std::shared_ptr<apache::geode::client::CacheableKey>> vc;
try
{
vc = m_nativeptr->get()->keys();
@@ -296,7 +296,7 @@ namespace Apache
{
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
- apache::geode::client::VectorOfCacheable vc;
+ std::vector<std::shared_ptr<apache::geode::client::Cacheable>> vc;
try
{
vc = m_nativeptr->get()->values( );
@@ -326,8 +326,8 @@ namespace Apache
try
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>( key );
- native::CacheablePtr valueptr = Serializable::GetUnmanagedValueGeneric<TValue>( value );
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>( key );
+ std::shared_ptr<native::Cacheable> valueptr = Serializable::GetUnmanagedValueGeneric<TValue>( value );
m_nativeptr->get()->localCreate( keyptr, valueptr );
}
finally
@@ -345,8 +345,8 @@ namespace Apache
try
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>( keyValuePair.Key );
- native::CacheablePtr valueptr = Serializable::GetUnmanagedValueGeneric<TValue>( keyValuePair.Value );
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>( keyValuePair.Key );
+ std::shared_ptr<native::Cacheable> valueptr = Serializable::GetUnmanagedValueGeneric<TValue>( keyValuePair.Value );
m_nativeptr->get()->localCreate( keyptr, valueptr );
}
finally
@@ -364,9 +364,9 @@ namespace Apache
try
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>( key );
- native::CacheablePtr valueptr = Serializable::GetUnmanagedValueGeneric<TValue>( value );
- native::SerializablePtr callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>( callbackArg );
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>( key );
+ std::shared_ptr<native::Cacheable> valueptr = Serializable::GetUnmanagedValueGeneric<TValue>( value );
+ std::shared_ptr<native::Serializable> callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>( callbackArg );
m_nativeptr->get()->localCreate( keyptr, valueptr, callbackptr );
}
finally
@@ -384,7 +384,7 @@ namespace Apache
try
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
m_nativeptr->get()->localDestroy(keyptr);
return true;
}
@@ -407,8 +407,8 @@ namespace Apache
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
try
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
- native::SerializablePtr callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
+ std::shared_ptr<native::Serializable> callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
m_nativeptr->get()->localDestroy(keyptr, callbackptr);
return true;
}
@@ -430,8 +430,8 @@ namespace Apache
try
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>( keyValuePair.Key );
- native::CacheablePtr valueptr = Serializable::GetUnmanagedValueGeneric<TValue>( keyValuePair.Value );
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>( keyValuePair.Key );
+ std::shared_ptr<native::Cacheable> valueptr = Serializable::GetUnmanagedValueGeneric<TValue>( keyValuePair.Value );
return m_nativeptr->get()->localRemove(keyptr, valueptr);
}
finally
@@ -449,9 +449,9 @@ namespace Apache
try
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
- native::CacheablePtr valueptr = Serializable::GetUnmanagedValueGeneric<TValue>(value);
- native::SerializablePtr callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
+ std::shared_ptr<native::Cacheable> valueptr = Serializable::GetUnmanagedValueGeneric<TValue>(value);
+ std::shared_ptr<native::Serializable> callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
return m_nativeptr->get()->localRemove(keyptr, valueptr, callbackptr);
}
finally
@@ -479,7 +479,7 @@ namespace Apache
try
{
- native::SerializablePtr callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>( callbackArg );
+ std::shared_ptr<native::Serializable> callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>( callbackArg );
m_nativeptr->get()->localInvalidateRegion( callbackptr );
}
finally
@@ -506,7 +506,7 @@ namespace Apache
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
try
{
- native::SerializablePtr callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>( callbackArg );
+ std::shared_ptr<native::Serializable> callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>( callbackArg );
m_nativeptr->get()->localDestroyRegion( callbackptr );
}
finally
@@ -534,8 +534,8 @@ namespace Apache
try
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>( key );
- native::SerializablePtr callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>( callbackArg );
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>( key );
+ std::shared_ptr<native::Serializable> callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>( callbackArg );
m_nativeptr->get()->localInvalidate( keyptr, callbackptr );
}
finally
@@ -750,7 +750,7 @@ namespace Apache
{
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
- apache::geode::client::VectorOfRegion vsr;
+ std::vector<std::shared_ptr<apache::geode::client::Region>> vsr;
try
{
vsr = m_nativeptr->get()->subregions( recursive );
@@ -780,7 +780,7 @@ namespace Apache
try
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
auto nativeptr = m_nativeptr->get()->getEntry(keyptr);
return RegionEntry<TKey, TValue>::Create(nativeptr);
}
@@ -797,7 +797,7 @@ namespace Apache
{
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
- apache::geode::client::VectorOfRegionEntry vc;
+ std::vector<std::shared_ptr<apache::geode::client::RegionEntry>> vc;
try
{
vc = m_nativeptr->get()->entries( recursive );
@@ -893,7 +893,7 @@ namespace Apache
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
- apache::geode::client::VectorOfRegionEntry vc;
+ std::vector<std::shared_ptr<apache::geode::client::RegionEntry>> vc;
try
{
vc = m_nativeptr->get()->entries( false );
@@ -910,7 +910,7 @@ namespace Apache
for( System::Int32 index = 0; index < vc.size( ); index++ )
{
- apache::geode::client::RegionEntryPtr nativeptr = vc[ index ];
+ std::shared_ptr<apache::geode::client::RegionEntry> nativeptr = vc[ index ];
TKey key = Serializable::GetManagedValueGeneric<TKey> (nativeptr->getKey());
TValue val = Serializable::GetManagedValueGeneric<TValue> (nativeptr->getValue());
toArray[ startIdx ] = KeyValuePair<TKey,TValue>(key, val);
diff --git a/clicache/src/LocalRegion.hpp b/clicache/src/LocalRegion.hpp
index 4955e49..a8f8a43 100644
--- a/clicache/src/LocalRegion.hpp
+++ b/clicache/src/LocalRegion.hpp
@@ -231,7 +231,7 @@ namespace Apache
/// The managed wrapper object; null if the native pointer is null.
/// </returns>
//generic<class TKey, class TValue>
- inline static IRegion<TKey, TValue>^ Create( native::RegionPtr nativeptr )
+ inline static IRegion<TKey, TValue>^ Create( std::shared_ptr<native::Region> nativeptr )
{
return __nullptr == nativeptr ? nullptr :
gcnew LocalRegion<TKey, TValue>( nativeptr );
@@ -246,14 +246,14 @@ namespace Apache
/// Private constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline LocalRegion( native::RegionPtr nativeptr )
+ inline LocalRegion( std::shared_ptr<native::Region> nativeptr )
{
m_nativeptr = gcnew native_shared_ptr<native::Region>(nativeptr);
}
private:
- inline apache::geode::client::SerializablePtr getRegionEntryValue(apache::geode::client::CacheableKeyPtr& key);
- bool AreValuesEqual(apache::geode::client::CacheablePtr& val1, apache::geode::client::CacheablePtr& val2);
+ inline std::shared_ptr<apache::geode::client::Serializable> getRegionEntryValue(std::shared_ptr<apache::geode::client::CacheableKey>& key);
+ bool AreValuesEqual(std::shared_ptr<apache::geode::client::Cacheable>& val1, std::shared_ptr<apache::geode::client::Cacheable>& val2);
native_shared_ptr<native::Region>^ m_nativeptr;
};
diff --git a/clicache/src/Pool.hpp b/clicache/src/Pool.hpp
index 9dc7e8e..f6b08d2 100644
--- a/clicache/src/Pool.hpp
+++ b/clicache/src/Pool.hpp
@@ -322,7 +322,7 @@ namespace Apache
/// <returns>
/// The managed wrapper object; null if the native pointer is null.
/// </returns>
- inline static Pool^ Create(native::PoolPtr nativeptr)
+ inline static Pool^ Create(std::shared_ptr<native::Pool> nativeptr)
{
return __nullptr == nativeptr ? nullptr :
gcnew Pool( nativeptr );
@@ -339,7 +339,7 @@ namespace Apache
/// Private constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline Pool(native::PoolPtr nativeptr)
+ inline Pool(std::shared_ptr<native::Pool> nativeptr)
{
m_nativeptr = gcnew native_shared_ptr<native::Pool>(nativeptr);
}
diff --git a/clicache/src/PoolFactory.hpp b/clicache/src/PoolFactory.hpp
index 8f29965..1c3b619 100644
--- a/clicache/src/PoolFactory.hpp
+++ b/clicache/src/PoolFactory.hpp
@@ -402,7 +402,7 @@ namespace Apache
/// <returns>
/// The managed wrapper object; null if the native pointer is null.
/// </returns>
- inline static PoolFactory^ Create(native::PoolFactoryPtr nativeptr)
+ inline static PoolFactory^ Create(std::shared_ptr<native::PoolFactory> nativeptr)
{
return __nullptr == nativeptr ? nullptr :
gcnew PoolFactory( nativeptr );
@@ -414,7 +414,7 @@ namespace Apache
/// Private constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline PoolFactory(native::PoolFactoryPtr nativeptr)
+ inline PoolFactory(std::shared_ptr<native::PoolFactory> nativeptr)
{
m_nativeptr = gcnew native_shared_ptr<native::PoolFactory>(nativeptr);
}
diff --git a/clicache/src/Properties.cpp b/clicache/src/Properties.cpp
index a8312b3..1b619fe 100644
--- a/clicache/src/Properties.cpp
+++ b/clicache/src/Properties.cpp
@@ -69,7 +69,7 @@ namespace Apache
{
try
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TPropKey>(key);
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TPropKey>(key);
auto nativeptr = m_nativeptr->get()->find(keyptr);
return Serializable::GetManagedValueGeneric<TPropValue>(nativeptr);
}
@@ -82,8 +82,8 @@ namespace Apache
generic<class TPropKey, class TPropValue>
void Properties<TPropKey, TPropValue>::Insert( TPropKey key, TPropValue value )
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TPropKey>(key, true);
- native::CacheablePtr valueptr = Serializable::GetUnmanagedValueGeneric<TPropValue>(value, true);
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TPropKey>(key, true);
+ std::shared_ptr<native::Cacheable> valueptr = Serializable::GetUnmanagedValueGeneric<TPropValue>(value, true);
_GF_MG_EXCEPTION_TRY2
@@ -102,7 +102,7 @@ namespace Apache
generic<class TPropKey, class TPropValue>
void Properties<TPropKey, TPropValue>::Remove( TPropKey key)
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TPropKey>(key);
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TPropKey>(key);
_GF_MG_EXCEPTION_TRY2
@@ -323,7 +323,7 @@ namespace Apache
//
//generic<class TPropKey, class TPropValue>
//Properties<TPropKey, TPropValue>::Properties( SerializationInfo^ info,
- // StreamingContext context, native::SerializationRegistryPtr serializationRegistry)
+ // StreamingContext context, std::shared_ptr<native::SerializationRegistry> serializationRegistry)
// : Properties(serializationRegistry)
//{
// array<Byte>^ bytes = nullptr;
diff --git a/clicache/src/Properties.hpp b/clicache/src/Properties.hpp
index 689cb32..8aa467c 100644
--- a/clicache/src/Properties.hpp
+++ b/clicache/src/Properties.hpp
@@ -214,7 +214,7 @@ namespace Apache
protected:
// For deserialization using the .NET serialization (ISerializable)
- //Properties(SerializationInfo^ info, StreamingContext context, native::SerializationRegistryPtr serializationRegistry);
+ //Properties(SerializationInfo^ info, StreamingContext context, std::shared_ptr<native::SerializationRegistry> serializationRegistry);
internal:
@@ -228,7 +228,7 @@ namespace Apache
/// The managed wrapper object; null if the native pointer is null.
/// </returns>
//generic<class TPropKey, class TPropValue>
- static Properties<TPropKey, TPropValue>^ Create( native::PropertiesPtr nativeptr )
+ static Properties<TPropKey, TPropValue>^ Create( std::shared_ptr<native::Properties> nativeptr )
{
return __nullptr == nativeptr ? nullptr :
gcnew Properties<TPropKey, TPropValue>( nativeptr );
@@ -250,7 +250,7 @@ namespace Apache
/// Private constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline Properties( native::PropertiesPtr nativeptr )
+ inline Properties( std::shared_ptr<native::Properties> nativeptr )
{
m_nativeptr = gcnew native_shared_ptr<native::Properties>(nativeptr);
}
@@ -268,9 +268,9 @@ namespace Apache
Apache::Geode::Client::IGeodeSerializable^ value)
{
TPropKey tpkey = Apache::Geode::Client::Serializable::
- GetManagedValueGeneric<TPropKey>(SerializablePtr(SafeMSerializableConvertGeneric(key)));
+ GetManagedValueGeneric<TPropKey>(std::shared_ptr<apache::geode::client::Serializable>(SafeMSerializableConvertGeneric(key)));
TPropValue tpvalue = Apache::Geode::Client::Serializable::
- GetManagedValueGeneric<TPropValue>(SerializablePtr(SafeMSerializableConvertGeneric(value)));
+ GetManagedValueGeneric<TPropValue>(std::shared_ptr<apache::geode::client::Serializable>(SafeMSerializableConvertGeneric(value)));
m_visitor->Invoke(tpkey, tpvalue);
}
diff --git a/clicache/src/Query.cpp b/clicache/src/Query.cpp
index f559373..6b9b7d0 100644
--- a/clicache/src/Query.cpp
+++ b/clicache/src/Query.cpp
@@ -87,7 +87,7 @@ namespace Apache
}
generic<class TResult>
- ISelectResults<TResult>^ Query<TResult>::WrapResults(const apache::geode::client::SelectResultsPtr& selectResults)
+ ISelectResults<TResult>^ Query<TResult>::WrapResults(const std::shared_ptr<apache::geode::client::SelectResults>& selectResults)
{
if ( __nullptr == selectResults ) return nullptr;
diff --git a/clicache/src/Query.hpp b/clicache/src/Query.hpp
index 2294b91..c86251f 100644
--- a/clicache/src/Query.hpp
+++ b/clicache/src/Query.hpp
@@ -190,7 +190,7 @@ namespace Apache
/// <returns>
/// The managed wrapper object; null if the native pointer is null.
/// </returns>
- inline static Query<TResult>^ Create( apache::geode::client::QueryPtr nativeptr )
+ inline static Query<TResult>^ Create( std::shared_ptr<apache::geode::client::Query> nativeptr )
{
return __nullptr == nativeptr ? nullptr :
gcnew Query<TResult>( nativeptr );
@@ -203,12 +203,12 @@ namespace Apache
/// Private constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline Query( apache::geode::client::QueryPtr nativeptr )
+ inline Query( std::shared_ptr<apache::geode::client::Query> nativeptr )
{
m_nativeptr = gcnew native_shared_ptr<native::Query>(nativeptr);
}
- ISelectResults<TResult>^ WrapResults(const apache::geode::client::SelectResultsPtr& selectResults);
+ ISelectResults<TResult>^ WrapResults(const std::shared_ptr<apache::geode::client::SelectResults>& selectResults);
native_shared_ptr<native::Query>^ m_nativeptr;
};
diff --git a/clicache/src/QueryService.hpp b/clicache/src/QueryService.hpp
index 78d29ef..3bb89f7 100644
--- a/clicache/src/QueryService.hpp
+++ b/clicache/src/QueryService.hpp
@@ -136,7 +136,7 @@ namespace Apache
/// <returns>
/// The managed wrapper object; null if the native pointer is null.
/// </returns>
- inline static QueryService<TKey, TResult>^ Create(native::QueryServicePtr nativeptr )
+ inline static QueryService<TKey, TResult>^ Create(std::shared_ptr<native::QueryService> nativeptr )
{
return __nullptr == nativeptr ? nullptr :
gcnew QueryService<TKey, TResult>( nativeptr );
@@ -149,7 +149,7 @@ namespace Apache
/// Private constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline QueryService(native::QueryServicePtr nativeptr)
+ inline QueryService(std::shared_ptr<native::QueryService> nativeptr)
{
m_nativeptr = gcnew native_shared_ptr<native::QueryService>(nativeptr);
}
diff --git a/clicache/src/Region.cpp b/clicache/src/Region.cpp
index 289517b..357becc 100644
--- a/clicache/src/Region.cpp
+++ b/clicache/src/Region.cpp
@@ -53,8 +53,8 @@ namespace Apache
generic<class TKey, class TValue>
TValue Region<TKey, TValue>::Get(TKey key, Object^ callbackArg)
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
- native::SerializablePtr callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
+ std::shared_ptr<native::Serializable> callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
GC::KeepAlive(m_nativeptr);
auto nativeptr = this->get(keyptr, callbackptr);
if (nativeptr == nullptr)
@@ -66,7 +66,7 @@ namespace Apache
}
generic<class TKey, class TValue>
- native::SerializablePtr Region<TKey, TValue>::get(native::CacheableKeyPtr& keyptr, native::SerializablePtr& callbackptr)
+ std::shared_ptr<native::Serializable> Region<TKey, TValue>::get(std::shared_ptr<native::CacheableKey>& keyptr, std::shared_ptr<native::Serializable>& callbackptr)
{
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
try
@@ -81,7 +81,7 @@ namespace Apache
}
generic<class TKey, class TValue>
- native::SerializablePtr Region<TKey, TValue>::get(native::CacheableKeyPtr& keyptr)
+ std::shared_ptr<native::Serializable> Region<TKey, TValue>::get(std::shared_ptr<native::CacheableKey>& keyptr)
{
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
try
@@ -119,9 +119,9 @@ namespace Apache
try
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
- native::CacheablePtr valueptr = Serializable::GetUnmanagedValueGeneric<TValue>(value);
- native::SerializablePtr callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
+ std::shared_ptr<native::Cacheable> valueptr = Serializable::GetUnmanagedValueGeneric<TValue>(value);
+ std::shared_ptr<native::Serializable> callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
m_nativeptr->get()->put(keyptr, valueptr, callbackptr);
}
finally
@@ -135,7 +135,7 @@ namespace Apache
generic<class TKey, class TValue>
TValue Region<TKey, TValue>::default::get(TKey key)
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
GC::KeepAlive(m_nativeptr);
auto nativeptr = this->get(keyptr);
if (nativeptr == nullptr)
@@ -153,8 +153,8 @@ namespace Apache
try
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
- native::CacheablePtr valueptr = Serializable::GetUnmanagedValueGeneric<TValue>(value);
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
+ std::shared_ptr<native::Cacheable> valueptr = Serializable::GetUnmanagedValueGeneric<TValue>(value);
m_nativeptr->get()->put(keyptr, valueptr);
}
finally
@@ -169,7 +169,7 @@ namespace Apache
System::Collections::Generic::IEnumerator<KeyValuePair<TKey, TValue>>^
Region<TKey, TValue>::GetEnumerator()
{
- native::VectorOfRegionEntry vc;
+ std::vector<std::shared_ptr<native::RegionEntry>> vc;
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
@@ -200,7 +200,7 @@ namespace Apache
System::Collections::IEnumerator^
Region<TKey, TValue>::GetEnumeratorOld()
{
- native::VectorOfRegionEntry vc;
+ std::vector<std::shared_ptr<native::RegionEntry>> vc;
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
@@ -228,7 +228,7 @@ namespace Apache
}
generic<class TKey, class TValue>
- bool Region<TKey, TValue>::AreValuesEqual(native::CacheablePtr& val1, native::CacheablePtr& val2)
+ bool Region<TKey, TValue>::AreValuesEqual(std::shared_ptr<native::Cacheable>& val1, std::shared_ptr<native::Cacheable>& val2)
{
if (val1 == nullptr && val2 == nullptr)
{
@@ -266,7 +266,7 @@ namespace Apache
generic<class TKey, class TValue>
bool Region<TKey, TValue>::Contains(KeyValuePair<TKey, TValue> keyValuePair)
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(keyValuePair.Key);
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(keyValuePair.Key);
GC::KeepAlive(m_nativeptr);
auto nativeptr = this->get(keyptr);
//This means that key is not present.
@@ -284,7 +284,7 @@ namespace Apache
try
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
return m_nativeptr->get()->containsKeyOnServer(keyptr);
}
finally
@@ -299,7 +299,7 @@ namespace Apache
bool Region<TKey, TValue>::TryGetValue(TKey key, TValue %val)
{
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
GC::KeepAlive(m_nativeptr);
auto nativeptr = this->get(keyptr);
if (nativeptr == nullptr) {
@@ -319,7 +319,7 @@ namespace Apache
{
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
- native::VectorOfCacheableKey vc;
+ std::vector<std::shared_ptr<native::CacheableKey>> vc;
try
{
vc = m_nativeptr->get()->serverKeys();
@@ -345,7 +345,7 @@ namespace Apache
{
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
- native::VectorOfCacheable vc;
+ std::vector<std::shared_ptr<native::Cacheable>> vc;
try
{
vc = m_nativeptr->get()->values();
@@ -373,8 +373,8 @@ namespace Apache
try
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
- native::CacheablePtr valueptr = Serializable::GetUnmanagedValueGeneric<TValue>(value);
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
+ std::shared_ptr<native::Cacheable> valueptr = Serializable::GetUnmanagedValueGeneric<TValue>(value);
m_nativeptr->get()->create(keyptr, valueptr);
}
finally
@@ -392,8 +392,8 @@ namespace Apache
try
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(keyValuePair.Key);
- native::CacheablePtr valueptr = Serializable::GetUnmanagedValueGeneric<TValue>(keyValuePair.Value);
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(keyValuePair.Key);
+ std::shared_ptr<native::Cacheable> valueptr = Serializable::GetUnmanagedValueGeneric<TValue>(keyValuePair.Value);
m_nativeptr->get()->create(keyptr, valueptr);
}
finally
@@ -411,9 +411,9 @@ namespace Apache
try
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
- native::CacheablePtr valueptr = Serializable::GetUnmanagedValueGeneric<TValue>(value);
- native::SerializablePtr callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
+ std::shared_ptr<native::Cacheable> valueptr = Serializable::GetUnmanagedValueGeneric<TValue>(value);
+ std::shared_ptr<native::Serializable> callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
m_nativeptr->get()->create(keyptr, valueptr, callbackptr);
}
finally
@@ -431,7 +431,7 @@ namespace Apache
try
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
return m_nativeptr->get()->removeEx(keyptr);
}
finally
@@ -450,8 +450,8 @@ namespace Apache
try
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
- native::SerializablePtr callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
+ std::shared_ptr<native::Serializable> callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
return m_nativeptr->get()->removeEx(keyptr, callbackptr);
}
finally
@@ -469,8 +469,8 @@ namespace Apache
try
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(keyValuePair.Key);
- native::CacheablePtr valueptr = Serializable::GetUnmanagedValueGeneric<TValue>(keyValuePair.Value);
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(keyValuePair.Key);
+ std::shared_ptr<native::Cacheable> valueptr = Serializable::GetUnmanagedValueGeneric<TValue>(keyValuePair.Value);
return m_nativeptr->get()->remove(keyptr, valueptr);
}
finally
@@ -488,9 +488,9 @@ namespace Apache
try
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
- native::CacheablePtr valueptr = Serializable::GetUnmanagedValueGeneric<TValue>(value);
- native::SerializablePtr callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
+ std::shared_ptr<native::Cacheable> valueptr = Serializable::GetUnmanagedValueGeneric<TValue>(value);
+ std::shared_ptr<native::Serializable> callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
GC::KeepAlive(m_nativeptr);
return m_nativeptr->get()->remove(keyptr, valueptr, callbackptr);
}
@@ -519,7 +519,7 @@ namespace Apache
try
{
- native::SerializablePtr callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
+ std::shared_ptr<native::Serializable> callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
m_nativeptr->get()->invalidateRegion(callbackptr);
}
finally
@@ -547,7 +547,7 @@ namespace Apache
try
{
- native::SerializablePtr callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
+ std::shared_ptr<native::Serializable> callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
m_nativeptr->get()->destroyRegion(callbackptr);
}
finally
@@ -576,8 +576,8 @@ namespace Apache
try
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
- native::SerializablePtr callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
+ std::shared_ptr<native::Serializable> callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
m_nativeptr->get()->invalidate(keyptr, callbackptr);
}
finally
@@ -607,8 +607,8 @@ namespace Apache
native::HashMapOfCacheable nativeMap;
for each (KeyValuePair<TKey, TValue> keyValPair in map)
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(keyValPair.Key);
- native::CacheablePtr valueptr = Serializable::GetUnmanagedValueGeneric<TValue>(keyValPair.Value);
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(keyValPair.Key);
+ std::shared_ptr<native::Cacheable> valueptr = Serializable::GetUnmanagedValueGeneric<TValue>(keyValPair.Value);
nativeMap.emplace(keyptr, valueptr);
}
try
@@ -632,11 +632,11 @@ namespace Apache
native::HashMapOfCacheable nativeMap;
for each (KeyValuePair<TKey, TValue> keyValPair in map)
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(keyValPair.Key);
- native::CacheablePtr valueptr = Serializable::GetUnmanagedValueGeneric<TValue>(keyValPair.Value);
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(keyValPair.Key);
+ std::shared_ptr<native::Cacheable> valueptr = Serializable::GetUnmanagedValueGeneric<TValue>(keyValPair.Value);
nativeMap.emplace(keyptr, valueptr);
}
- native::SerializablePtr callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
+ std::shared_ptr<native::Serializable> callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
try
{
m_nativeptr->get()->putAll(nativeMap, TimeSpanUtils::TimeSpanToDurationCeil<std::chrono::seconds>(timeout), callbackptr);
@@ -672,7 +672,7 @@ namespace Apache
if (keys != nullptr) {
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
- native::VectorOfCacheableKey vecKeys;
+ std::vector<std::shared_ptr<native::CacheableKey>> vecKeys;
for each(TKey item in keys)
{
@@ -680,7 +680,7 @@ namespace Apache
Serializable::GetUnmanagedValueGeneric<TKey>(item));
}
- native::HashMapOfCacheable native_value;
+ native::HashMapOfCacheable native_value;
try
{
@@ -714,7 +714,7 @@ namespace Apache
if (keys != nullptr) {
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
- native::VectorOfCacheableKey vecKeys;
+ std::vector<std::shared_ptr<native::CacheableKey>> vecKeys;
for each(TKey item in keys)
{
@@ -722,11 +722,11 @@ namespace Apache
Serializable::GetUnmanagedValueGeneric<TKey>(item));
}
- native::HashMapOfCacheablePtr valuesPtr;
+ std::shared_ptr<native::HashMapOfCacheable> valuesPtr;
if (values != nullptr) {
valuesPtr = std::make_shared<native::HashMapOfCacheable>();
}
- native::SerializablePtr callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg, m_nativeptr->get()->getCache().get());
+ std::shared_ptr<native::Serializable> callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg, m_nativeptr->get()->getCache().get());
native::HashMapOfCacheable native_value;
try
{
@@ -768,11 +768,11 @@ namespace Apache
{
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
- native::VectorOfCacheableKey vecKeys;
+ std::vector<std::shared_ptr<native::CacheableKey>> vecKeys;
for each(TKey item in keys)
vecKeys.push_back(Serializable::GetUnmanagedValueGeneric<TKey>(item));
- native::SerializablePtr callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
+ std::shared_ptr<native::Serializable> callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
try
{
@@ -929,7 +929,7 @@ namespace Apache
{
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
- native::VectorOfRegion vsr;
+ std::vector<std::shared_ptr<native::Region>> vsr;
try
{
vsr = m_nativeptr->get()->subregions(recursive);
@@ -959,7 +959,7 @@ namespace Apache
try
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
auto nativeptr = m_nativeptr->get()->getEntry(keyptr);
return RegionEntry<TKey, TValue>::Create(nativeptr);
}
@@ -976,7 +976,7 @@ namespace Apache
{
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
- native::VectorOfRegionEntry vc;
+ std::vector<std::shared_ptr<native::RegionEntry>> vc;
try
{
vc = m_nativeptr->get()->entries(recursive);
@@ -1013,7 +1013,7 @@ namespace Apache
try
{
- native::CacheableKeyPtr keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
+ std::shared_ptr<native::CacheableKey> keyptr = Serializable::GetUnmanagedValueGeneric<TKey>(key);
return m_nativeptr->get()->containsValueForKey(keyptr);
}
finally
@@ -1051,7 +1051,7 @@ namespace Apache
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
try
{
- native::SerializablePtr callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
+ std::shared_ptr<native::Serializable> callbackptr = Serializable::GetUnmanagedValueGeneric<Object^>(callbackArg);
m_nativeptr->get()->clear(callbackptr);
}
finally
@@ -1076,7 +1076,7 @@ namespace Apache
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
- native::VectorOfRegionEntry vc;
+ std::vector<std::shared_ptr<native::RegionEntry>> vc;
try
{
vc = m_nativeptr->get()->entries(false);
@@ -1138,7 +1138,7 @@ namespace Apache
{
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
- native::VectorOfCacheableKey vecKeys;
+ std::vector<std::shared_ptr<native::CacheableKey>> vecKeys;
for each(TKey item in keys)
{
@@ -1164,7 +1164,7 @@ namespace Apache
{
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
- native::VectorOfCacheableKey vecKeys;
+ std::vector<std::shared_ptr<native::CacheableKey>> vecKeys;
for each(TKey item in keys)
{
@@ -1228,7 +1228,7 @@ namespace Apache
{
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
- native::VectorOfCacheableKey vc;
+ std::vector<std::shared_ptr<native::CacheableKey>> vc;
try
{
vc = m_nativeptr->get()->getInterestList();
@@ -1255,7 +1255,7 @@ namespace Apache
{
_GF_MG_EXCEPTION_TRY2/* due to auto replace */
- native::VectorOfCacheableString vc;
+ std::vector<std::shared_ptr<native::CacheableString>> vc;
try
{
vc = m_nativeptr->get()->getInterestListRegex();
diff --git a/clicache/src/Region.hpp b/clicache/src/Region.hpp
index 03a9ad6..04de85a 100644
--- a/clicache/src/Region.hpp
+++ b/clicache/src/Region.hpp
@@ -264,7 +264,7 @@ namespace Apache
/// </returns>
//generic<class TKey, class TValue>
inline static IRegion<TKey, TValue>^
- Create( native::RegionPtr nativeptr )
+ Create( std::shared_ptr<native::Region> nativeptr )
{
return __nullptr == nativeptr ? nullptr :
gcnew Region<TKey, TValue>( nativeptr );
@@ -281,14 +281,14 @@ namespace Apache
/// Private constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline Region( native::RegionPtr nativeptr )
+ inline Region( std::shared_ptr<native::Region> nativeptr )
{
m_nativeptr = gcnew native_shared_ptr<native::Region>(nativeptr);
}
- inline apache::geode::client::SerializablePtr get(apache::geode::client::CacheableKeyPtr& key, apache::geode::client::SerializablePtr& callbackArg);
- inline apache::geode::client::SerializablePtr get(apache::geode::client::CacheableKeyPtr& key);
- bool AreValuesEqual(apache::geode::client::CacheablePtr& val1, apache::geode::client::CacheablePtr& val2);
+ inline std::shared_ptr<apache::geode::client::Serializable> get(std::shared_ptr<apache::geode::client::CacheableKey>& key, std::shared_ptr<apache::geode::client::Serializable>& callbackArg);
+ inline std::shared_ptr<apache::geode::client::Serializable> get(std::shared_ptr<apache::geode::client::CacheableKey>& key);
+ bool AreValuesEqual(std::shared_ptr<apache::geode::client::Cacheable>& val1, std::shared_ptr<apache::geode::client::Cacheable>& val2);
bool isPoolInMultiuserMode();
native_shared_ptr<native::Region>^ m_nativeptr;
diff --git a/clicache/src/RegionAttributes.hpp b/clicache/src/RegionAttributes.hpp
index db7e6b3..d2a0ef3 100644
--- a/clicache/src/RegionAttributes.hpp
+++ b/clicache/src/RegionAttributes.hpp
@@ -480,7 +480,7 @@ namespace Apache
/// <returns>
/// The managed wrapper object; null if the native pointer is null.
/// </returns>
- inline static RegionAttributes<TKey, TValue>^ Create(native::RegionAttributesPtr nativeptr)
+ inline static RegionAttributes<TKey, TValue>^ Create(std::shared_ptr<native::RegionAttributes> nativeptr)
{
return __nullptr == nativeptr ? nullptr :
gcnew RegionAttributes<TKey, TValue>( nativeptr );
@@ -497,7 +497,7 @@ namespace Apache
/// Private constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline RegionAttributes<TKey, TValue>(native::RegionAttributesPtr nativeptr)
+ inline RegionAttributes<TKey, TValue>(std::shared_ptr<native::RegionAttributes> nativeptr)
{
m_nativeptr = gcnew native_shared_ptr<native::RegionAttributes>(nativeptr);
}
diff --git a/clicache/src/RegionEntry.cpp b/clicache/src/RegionEntry.cpp
index 6cafac0..f80ac5e 100644
--- a/clicache/src/RegionEntry.cpp
+++ b/clicache/src/RegionEntry.cpp
@@ -72,7 +72,7 @@ namespace Apache
generic<class TKey, class TValue>
Apache::Geode::Client::CacheStatistics^ RegionEntry<TKey, TValue>::Statistics::get( )
{
- apache::geode::client::CacheStatisticsPtr nativeptr;
+ std::shared_ptr<apache::geode::client::CacheStatistics> nativeptr;
try
{
nativeptr = m_nativeptr->get()->getStatistics();
diff --git a/clicache/src/RegionEntry.hpp b/clicache/src/RegionEntry.hpp
index 85c933f..06df712 100644
--- a/clicache/src/RegionEntry.hpp
+++ b/clicache/src/RegionEntry.hpp
@@ -162,7 +162,7 @@ namespace Apache
/// <returns>
/// The managed wrapper object; null if the native pointer is null.
/// </returns>
- inline static Client::RegionEntry<TKey, TValue>^ Create( native::RegionEntryPtr nativeptr )
+ inline static Client::RegionEntry<TKey, TValue>^ Create( std::shared_ptr<native::RegionEntry> nativeptr )
{
return __nullptr == nativeptr ? nullptr :
gcnew RegionEntry<TKey, TValue>( nativeptr );
@@ -175,7 +175,7 @@ namespace Apache
/// Private constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline RegionEntry( native::RegionEntryPtr nativeptr )
+ inline RegionEntry( std::shared_ptr<native::RegionEntry> nativeptr )
{
m_nativeptr = gcnew native_shared_ptr<native::RegionEntry>(nativeptr);
}
diff --git a/clicache/src/RegionEvent.cpp b/clicache/src/RegionEvent.cpp
index 059e130..3766326 100644
--- a/clicache/src/RegionEvent.cpp
+++ b/clicache/src/RegionEvent.cpp
@@ -38,7 +38,7 @@ namespace Apache
generic<class TKey, class TValue>
Object^ RegionEvent<TKey, TValue>::CallbackArgument::get()
{
- apache::geode::client::SerializablePtr& valptr(m_nativeptr->getCallbackArgument());
+ std::shared_ptr<apache::geode::client::Serializable>& valptr(m_nativeptr->getCallbackArgument());
return Serializable::GetManagedValueGeneric<Object^>( valptr );
}
diff --git a/clicache/src/RegionFactory.cpp b/clicache/src/RegionFactory.cpp
index 6183902..d7656ca 100644
--- a/clicache/src/RegionFactory.cpp
+++ b/clicache/src/RegionFactory.cpp
@@ -175,7 +175,7 @@ namespace Apache
RegionFactory^ RegionFactory::SetPersistenceManager( Client::IPersistenceManager<TKey, TValue>^ persistenceManager,
Properties<String^, String^>^ config)
{
- native::PersistenceManagerPtr persistenceManagerptr;
+ std::shared_ptr<native::PersistenceManager> persistenceManagerptr;
if ( persistenceManager != nullptr ) {
PersistenceManagerGeneric<TKey, TValue>^ clg = gcnew PersistenceManagerGeneric<TKey, TValue>();
clg->SetPersistenceManager(persistenceManager);
@@ -379,7 +379,7 @@ namespace Apache
generic <class TKey, class TValue>
RegionFactory^ RegionFactory::SetCacheLoader( Client::ICacheLoader<TKey, TValue>^ cacheLoader )
{
- native::CacheLoaderPtr loaderptr;
+ std::shared_ptr<native::CacheLoader> loaderptr;
if ( cacheLoader != nullptr ) {
CacheLoaderGeneric<TKey, TValue>^ clg = gcnew CacheLoaderGeneric<TKey, TValue>();
clg->SetCacheLoader(cacheLoader);
@@ -400,7 +400,7 @@ namespace Apache
generic <class TKey, class TValue>
RegionFactory^ RegionFactory::SetCacheWriter( Client::ICacheWriter<TKey, TValue>^ cacheWriter )
{
- native::CacheWriterPtr writerptr;
+ std::shared_ptr<native::CacheWriter> writerptr;
if ( cacheWriter != nullptr ) {
CacheWriterGeneric<TKey, TValue>^ cwg = gcnew CacheWriterGeneric<TKey, TValue>();
cwg->SetCacheWriter(cacheWriter);
@@ -421,7 +421,7 @@ namespace Apache
generic <class TKey, class TValue>
RegionFactory^ RegionFactory::SetCacheListener( Client::ICacheListener<TKey, TValue>^ cacheListener )
{
- native::CacheListenerPtr listenerptr;
+ std::shared_ptr<native::CacheListener> listenerptr;
if ( cacheListener != nullptr ) {
CacheListenerGeneric<TKey, TValue>^ clg = gcnew CacheListenerGeneric<TKey, TValue>();
clg->SetCacheListener(cacheListener);
@@ -446,7 +446,7 @@ namespace Apache
generic <class TKey, class TValue>
RegionFactory^ RegionFactory::SetPartitionResolver(Client::IPartitionResolver<TKey, TValue>^ partitionresolver)
{
- native::PartitionResolverPtr resolverptr;
+ std::shared_ptr<native::PartitionResolver> resolverptr;
if (partitionresolver != nullptr) {
Client::IFixedPartitionResolver<TKey, TValue>^ resolver =
dynamic_cast<Client::IFixedPartitionResolver<TKey, TValue>^>(partitionresolver);
diff --git a/clicache/src/ResultCollector.hpp b/clicache/src/ResultCollector.hpp
index 27d628e..50eec6c 100644
--- a/clicache/src/ResultCollector.hpp
+++ b/clicache/src/ResultCollector.hpp
@@ -81,7 +81,7 @@ namespace Apache
/// Internal constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline ResultCollector( native::ResultCollectorPtr nativeptr )
+ inline ResultCollector( std::shared_ptr<native::ResultCollector> nativeptr )
{
m_nativeptr = gcnew native_shared_ptr<native::ResultCollector>(nativeptr);
}
diff --git a/clicache/src/ResultSet.hpp b/clicache/src/ResultSet.hpp
index bc64ede..408517a 100644
--- a/clicache/src/ResultSet.hpp
+++ b/clicache/src/ResultSet.hpp
@@ -101,7 +101,7 @@ namespace Apache
/// <returns>
/// The managed wrapper object; null if the native pointer is null.
/// </returns>
- inline static ResultSet<TResult>^ Create(native::ResultSetPtr nativeptr)
+ inline static ResultSet<TResult>^ Create(std::shared_ptr<native::ResultSet> nativeptr)
{
return __nullptr == nativeptr ? nullptr :
gcnew ResultSet<TResult>( nativeptr );
@@ -117,7 +117,7 @@ namespace Apache
/// Private constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline ResultSet(native::ResultSetPtr nativeptr)
+ inline ResultSet(std::shared_ptr<native::ResultSet> nativeptr)
{
m_nativeptr = gcnew native_shared_ptr<native::ResultSet>(nativeptr);
}
diff --git a/clicache/src/Serializable.cpp b/clicache/src/Serializable.cpp
index 6a66948..8336598 100644
--- a/clicache/src/Serializable.cpp
+++ b/clicache/src/Serializable.cpp
@@ -254,25 +254,25 @@ namespace Apache
System::Int32 Serializable::GetPDXIdForType(const char* poolName, IGeodeSerializable^ pdxType, Cache^ cache)
{
- native::CacheablePtr kPtr(SafeMSerializableConvertGeneric(pdxType));
+ std::shared_ptr<native::Cacheable> kPtr(SafeMSerializableConvertGeneric(pdxType));
return CacheRegionHelper::getCacheImpl(cache->GetNative().get())->getSerializationRegistry()->GetPDXIdForType(cache->GetNative()->getPoolManager().find(poolName), kPtr);
}
IGeodeSerializable^ Serializable::GetPDXTypeById(const char* poolName, System::Int32 typeId, Cache^ cache)
{
- SerializablePtr sPtr = CacheRegionHelper::getCacheImpl(cache->GetNative().get())->getSerializationRegistry()->GetPDXTypeById(cache->GetNative()->getPoolManager().find(poolName), typeId);
+ std::shared_ptr<apache::geode::client::Serializable> sPtr = CacheRegionHelper::getCacheImpl(cache->GetNative().get())->getSerializationRegistry()->GetPDXTypeById(cache->GetNative()->getPoolManager().find(poolName), typeId);
return SafeUMSerializableConvertGeneric(sPtr);
}
int Serializable::GetEnumValue(Internal::EnumInfo^ ei, Cache^ cache)
{
- native::CacheablePtr kPtr(SafeMSerializableConvertGeneric(ei));
+ std::shared_ptr<native::Cacheable> kPtr(SafeMSerializableConvertGeneric(ei));
return CacheRegionHelper::getCacheImpl(cache->GetNative().get())->getSerializationRegistry()->GetEnumValue(cache->GetNative()->getPoolManager().getAll().begin()->second, kPtr);
}
Internal::EnumInfo^ Serializable::GetEnum(int val, Cache^ cache)
{
- SerializablePtr sPtr = CacheRegionHelper::getCacheImpl(cache->GetNative().get())->getSerializationRegistry()->GetEnum(cache->GetNative()->getPoolManager().getAll().begin()->second, val);
+ std::shared_ptr<apache::geode::client::Serializable> sPtr = CacheRegionHelper::getCacheImpl(cache->GetNative().get())->getSerializationRegistry()->GetEnum(cache->GetNative()->getPoolManager().getAll().begin()->second, val);
return (Internal::EnumInfo^)SafeUMSerializableConvertGeneric(sPtr);
}
@@ -638,7 +638,7 @@ namespace Apache
}
generic<class TValue>
- TValue Serializable::GetManagedValueGeneric(native::SerializablePtr val)
+ TValue Serializable::GetManagedValueGeneric(std::shared_ptr<native::Serializable> val)
{
if (val == nullptr)
{
@@ -927,7 +927,7 @@ namespace Apache
}
generic<class TKey>
- native::CacheableKeyPtr Serializable::GetUnmanagedValueGeneric(TKey key)
+ std::shared_ptr<native::CacheableKey> Serializable::GetUnmanagedValueGeneric(TKey key)
{
if (key != nullptr) {
return GetUnmanagedValueGeneric(key->GetType(), key);
@@ -936,7 +936,7 @@ namespace Apache
}
generic<class TKey>
- native::CacheableKeyPtr Serializable::GetUnmanagedValueGeneric(TKey key, bool isAciiChar)
+ std::shared_ptr<native::CacheableKey> Serializable::GetUnmanagedValueGeneric(TKey key, bool isAciiChar)
{
if (key != nullptr) {
return GetUnmanagedValueGeneric(key->GetType(), key, isAciiChar);
@@ -1053,14 +1053,14 @@ namespace Apache
}
generic<class TKey>
- native::CacheableKeyPtr Serializable::GetUnmanagedValueGeneric(
+ std::shared_ptr<native::CacheableKey> Serializable::GetUnmanagedValueGeneric(
Type^ managedType, TKey key)
{
return GetUnmanagedValueGeneric(managedType, key, false);
}
generic<class TKey>
- native::CacheableKeyPtr Serializable::GetUnmanagedValueGeneric(
+ std::shared_ptr<native::CacheableKey> Serializable::GetUnmanagedValueGeneric(
Type^ managedType, TKey key, bool isAsciiChar)
{
Byte typeId = Apache::Geode::Client::Serializable::GetManagedTypeMappingGeneric(managedType);
@@ -1095,128 +1095,128 @@ namespace Apache
}
case native::GeodeTypeIds::CacheableBytes:
{
- native::CacheablePtr kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::CacheableBytes::Create((array<Byte>^)key)));
+ std::shared_ptr<native::Cacheable> kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::CacheableBytes::Create((array<Byte>^)key)));
return std::dynamic_pointer_cast<native::CacheableKey>(kPtr);
}
case native::GeodeTypeIds::CacheableDoubleArray:
{
- native::CacheablePtr kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::CacheableDoubleArray::Create((array<Double>^)key)));
+ std::shared_ptr<native::Cacheable> kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::CacheableDoubleArray::Create((array<Double>^)key)));
return std::dynamic_pointer_cast<native::CacheableKey>(kPtr);
}
case native::GeodeTypeIds::CacheableFloatArray:
{
- native::CacheablePtr kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::CacheableFloatArray::Create((array<float>^)key)));
+ std::shared_ptr<native::Cacheable> kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::CacheableFloatArray::Create((array<float>^)key)));
return std::dynamic_pointer_cast<native::CacheableKey>(kPtr);
}
case native::GeodeTypeIds::CacheableInt16Array:
{
- native::CacheablePtr kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::CacheableInt16Array::Create((array<Int16>^)key)));
+ std::shared_ptr<native::Cacheable> kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::CacheableInt16Array::Create((array<Int16>^)key)));
return std::dynamic_pointer_cast<native::CacheableKey>(kPtr);
}
case native::GeodeTypeIds::CacheableInt32Array:
{
- native::CacheablePtr kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::CacheableInt32Array::Create((array<Int32>^)key)));
+ std::shared_ptr<native::Cacheable> kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::CacheableInt32Array::Create((array<Int32>^)key)));
return std::dynamic_pointer_cast<native::CacheableKey>(kPtr);
}
case native::GeodeTypeIds::CacheableInt64Array:
{
- native::CacheablePtr kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::CacheableInt64Array::Create((array<Int64>^)key)));
+ std::shared_ptr<native::Cacheable> kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::CacheableInt64Array::Create((array<Int64>^)key)));
return std::dynamic_pointer_cast<native::CacheableKey>(kPtr);
}
case native::GeodeTypeIds::CacheableStringArray:
{
- native::CacheablePtr kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::CacheableStringArray::Create((array<String^>^)key)));
+ std::shared_ptr<native::Cacheable> kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::CacheableStringArray::Create((array<String^>^)key)));
return std::dynamic_pointer_cast<native::CacheableKey>(kPtr);
}
case native::GeodeTypeIds::CacheableFileName:
{
- native::CacheablePtr kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)(Apache::Geode::Client::CacheableFileName^)key));
+ std::shared_ptr<native::Cacheable> kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)(Apache::Geode::Client::CacheableFileName^)key));
return std::dynamic_pointer_cast<native::CacheableKey>(kPtr);
}
case native::GeodeTypeIds::CacheableHashTable://collection::hashtable
{
- native::CacheablePtr kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::CacheableHashTable::Create((System::Collections::Hashtable^)key)));
+ std::shared_ptr<native::Cacheable> kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::CacheableHashTable::Create((System::Collections::Hashtable^)key)));
return std::dynamic_pointer_cast<native::CacheableKey>(kPtr);
}
case native::GeodeTypeIds::CacheableHashMap://generic dictionary
{
- native::CacheablePtr kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::CacheableHashMap::Create((System::Collections::IDictionary^)key)));
+ std::shared_ptr<native::Cacheable> kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::CacheableHashMap::Create((System::Collections::IDictionary^)key)));
return std::dynamic_pointer_cast<native::CacheableKey>(kPtr);
}
case native::GeodeTypeIds::CacheableVector://collection::arraylist
{
- native::CacheablePtr kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)CacheableVector::Create((System::Collections::IList^)key)));
+ std::shared_ptr<native::Cacheable> kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)CacheableVector::Create((System::Collections::IList^)key)));
return std::dynamic_pointer_cast<native::CacheableKey>(kPtr);
}
case native::GeodeTypeIds::CacheableArrayList://generic ilist
{
- native::CacheablePtr kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::CacheableArrayList::Create((System::Collections::IList^)key)));
+ std::shared_ptr<native::Cacheable> kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::CacheableArrayList::Create((System::Collections::IList^)key)));
return std::dynamic_pointer_cast<native::CacheableKey>(kPtr);
}
case native::GeodeTypeIds::CacheableLinkedList://generic linked list
{
- native::CacheablePtr kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::CacheableLinkedList::Create((System::Collections::Generic::LinkedList<Object^>^)key)));
+ std::shared_ptr<native::Cacheable> kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::CacheableLinkedList::Create((System::Collections::Generic::LinkedList<Object^>^)key)));
return std::dynamic_pointer_cast<native::CacheableKey>(kPtr);
}
case native::GeodeTypeIds::CacheableStack:
{
- native::CacheablePtr kPtr(SafeGenericMSerializableConvert(Apache::Geode::Client::CacheableStack::Create((System::Collections::ICollection^)key)));
+ std::shared_ptr<native::Cacheable> kPtr(SafeGenericMSerializableConvert(Apache::Geode::Client::CacheableStack::Create((System::Collections::ICollection^)key)));
return std::dynamic_pointer_cast<native::CacheableKey>(kPtr);
}
case 7: //GeodeClassIds::CacheableManagedObject
{
- native::CacheablePtr kPtr(SafeGenericMSerializableConvert((Apache::Geode::Client::CacheableObject^)key));
+ std::shared_ptr<native::Cacheable> kPtr(SafeGenericMSerializableConvert((Apache::Geode::Client::CacheableObject^)key));
return std::dynamic_pointer_cast<native::CacheableKey>(kPtr);
}
case 8://GeodeClassIds::CacheableManagedObjectXml
{
- native::CacheablePtr kPtr(SafeGenericMSerializableConvert((Apache::Geode::Client::CacheableObjectXml^)key));
+ std::shared_ptr<native::Cacheable> kPtr(SafeGenericMSerializableConvert((Apache::Geode::Client::CacheableObjectXml^)key));
return std::dynamic_pointer_cast<native::CacheableKey>(kPtr);
}
case native::GeodeTypeIds::CacheableObjectArray:
{
- native::CacheablePtr kPtr(SafeGenericMSerializableConvert((Apache::Geode::Client::CacheableObjectArray^)key));
+ std::shared_ptr<native::Cacheable> kPtr(SafeGenericMSerializableConvert((Apache::Geode::Client::CacheableObjectArray^)key));
return std::dynamic_pointer_cast<native::CacheableKey>(kPtr);
}
case native::GeodeTypeIds::CacheableIdentityHashMap:
{
- native::CacheablePtr kPtr(SafeGenericMSerializableConvert(Apache::Geode::Client::CacheableIdentityHashMap::Create((System::Collections::IDictionary^)key)));
+ std::shared_ptr<native::Cacheable> kPtr(SafeGenericMSerializableConvert(Apache::Geode::Client::CacheableIdentityHashMap::Create((System::Collections::IDictionary^)key)));
return std::dynamic_pointer_cast<native::CacheableKey>(kPtr);
}
case native::GeodeTypeIds::CacheableHashSet://no need of it, default case should work
{
- native::CacheablePtr kPtr(SafeGenericMSerializableConvert((Apache::Geode::Client::CacheableHashSet^)key));
+ std::shared_ptr<native::Cacheable> kPtr(SafeGenericMSerializableConvert((Apache::Geode::Client::CacheableHashSet^)key));
return std::dynamic_pointer_cast<native::CacheableKey>(kPtr);
}
case native::GeodeTypeIds::CacheableLinkedHashSet://no need of it, default case should work
{
- native::CacheablePtr kPtr(SafeGenericMSerializableConvert((Apache::Geode::Client::CacheableLinkedHashSet^)key));
+ std::shared_ptr<native::Cacheable> kPtr(SafeGenericMSerializableConvert((Apache::Geode::Client::CacheableLinkedHashSet^)key));
return std::dynamic_pointer_cast<native::CacheableKey>(kPtr);
}
case native::GeodeTypeIds::CacheableDate:
{
- native::CacheablePtr kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::CacheableDate::Create((System::DateTime)key)));
+ std::shared_ptr<native::Cacheable> kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::CacheableDate::Create((System::DateTime)key)));
return std::dynamic_pointer_cast<native::CacheableKey>(kPtr);
}
case native::GeodeTypeIds::BooleanArray:
{
- native::CacheablePtr kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::BooleanArray::Create((array<bool>^)key)));
+ std::shared_ptr<native::Cacheable> kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::BooleanArray::Create((array<bool>^)key)));
return std::dynamic_pointer_cast<native::CacheableKey>(kPtr);
}
case native::GeodeTypeIds::CharArray:
{
- native::CacheablePtr kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::CharArray::Create((array<Char>^)key)));
+ std::shared_ptr<native::Cacheable> kPtr(SafeGenericMSerializableConvert((IGeodeSerializable^)Apache::Geode::Client::CharArray::Create((array<Char>^)key)));
return std::dynamic_pointer_cast<native::CacheableKey>(kPtr);
}
default:
{
- native::CacheablePtr kPtr(SafeGenericMSerializableConvert(key));
+ std::shared_ptr<native::Cacheable> kPtr(SafeGenericMSerializableConvert(key));
return std::dynamic_pointer_cast<native::CacheableKey>(kPtr);
}
}
} //
- String^ Serializable::GetString(native::CacheableStringPtr cStr)//native::CacheableString*
+ String^ Serializable::GetString(std::shared_ptr<native::CacheableString> cStr)//native::CacheableString*
{
if (cStr == nullptr) {
return nullptr;
@@ -1232,153 +1232,153 @@ namespace Apache
// These are the new static methods to get/put data from c++
//byte
- Byte Serializable::getByte(native::SerializablePtr nativeptr)
+ Byte Serializable::getByte(std::shared_ptr<native::Serializable> nativeptr)
{
native::CacheableByte* ci = static_cast<native::CacheableByte*>(nativeptr.get());
return ci->value();
}
- native::CacheableKeyPtr Serializable::getCacheableByte(SByte val)
+ std::shared_ptr<native::CacheableKey> Serializable::getCacheableByte(SByte val)
{
return native::CacheableByte::create(val);
}
//boolean
- bool Serializable::getBoolean(native::SerializablePtr nativeptr)
+ bool Serializable::getBoolean(std::shared_ptr<native::Serializable> nativeptr)
{
native::CacheableBoolean* ci = static_cast<native::CacheableBoolean*>(nativeptr.get());
return ci->value();
}
- native::CacheableKeyPtr Serializable::getCacheableBoolean(bool val)
+ std::shared_ptr<native::CacheableKey> Serializable::getCacheableBoolean(bool val)
{
return native::CacheableBoolean::create(val);
}
//widechar
- Char Serializable::getChar(native::SerializablePtr nativeptr)
+ Char Serializable::getChar(std::shared_ptr<native::Serializable> nativeptr)
{
native::CacheableCharacter* ci = static_cast<native::CacheableCharacter*>(nativeptr.get());
return ci->value();
}
- native::CacheableKeyPtr Serializable::getCacheableWideChar(Char val)
+ std::shared_ptr<native::CacheableKey> Serializable::getCacheableWideChar(Char val)
{
return native::CacheableCharacter::create(val);
}
//double
- double Serializable::getDouble(native::SerializablePtr nativeptr)
+ double Serializable::getDouble(std::shared_ptr<native::Serializable> nativeptr)
{
native::CacheableDouble* ci = static_cast<native::CacheableDouble*>(nativeptr.get());
return ci->value();
}
- native::CacheableKeyPtr Serializable::getCacheableDouble(double val)
+ std::shared_ptr<native::CacheableKey> Serializable::getCacheableDouble(double val)
{
return native::CacheableDouble::create(val);
}
//float
- float Serializable::getFloat(native::SerializablePtr nativeptr)
+ float Serializable::getFloat(std::shared_ptr<native::Serializable> nativeptr)
{
native::CacheableFloat* ci = static_cast<native::CacheableFloat*>(nativeptr.get());
return ci->value();
}
- native::CacheableKeyPtr Serializable::getCacheableFloat(float val)
+ std::shared_ptr<native::CacheableKey> Serializable::getCacheableFloat(float val)
{
return native::CacheableFloat::create(val);
}
//int16
- System::Int16 Serializable::getInt16(native::SerializablePtr nativeptr)
+ System::Int16 Serializable::getInt16(std::shared_ptr<native::Serializable> nativeptr)
{
native::CacheableInt16* ci = static_cast<native::CacheableInt16*>(nativeptr.get());
return ci->value();
}
- native::CacheableKeyPtr Serializable::getCacheableInt16(int val)
+ std::shared_ptr<native::CacheableKey> Serializable::getCacheableInt16(int val)
{
return native::CacheableInt16::create(val);
}
//int32
- System::Int32 Serializable::getInt32(native::SerializablePtr nativeptr)
+ System::Int32 Serializable::getInt32(std::shared_ptr<native::Serializable> nativeptr)
{
native::CacheableInt32* ci = static_cast<native::CacheableInt32*>(nativeptr.get());
return ci->value();
}
- native::CacheableKeyPtr Serializable::getCacheableInt32(System::Int32 val)
+ std::shared_ptr<native::CacheableKey> Serializable::getCacheableInt32(System::Int32 val)
{
return native::CacheableInt32::create(val);
}
//int64
- System::Int64 Serializable::getInt64(native::SerializablePtr nativeptr)
+ System::Int64 Serializable::getInt64(std::shared_ptr<native::Serializable> nativeptr)
{
native::CacheableInt64* ci = static_cast<native::CacheableInt64*>(nativeptr.get());
return ci->value();
}
- native::CacheableKeyPtr Serializable::getCacheableInt64(System::Int64 val)
+ std::shared_ptr<native::CacheableKey> Serializable::getCacheableInt64(System::Int64 val)
{
return native::CacheableInt64::create(val);
}
//cacheable ascii string
- String^ Serializable::getASCIIString(native::SerializablePtr nativeptr)
+ String^ Serializable::getASCIIString(std::shared_ptr<native::Serializable> nativeptr)
{
return GetString(nativeptr->toString());
}
- native::CacheableKeyPtr Serializable::getCacheableASCIIString(String^ val)
+ std::shared_ptr<native::CacheableKey> Serializable::getCacheableASCIIString(String^ val)
{
return GetCacheableString(val);
}
- native::CacheableKeyPtr Serializable::getCacheableASCIIString2(String^ val)
+ std::shared_ptr<native::CacheableKey> Serializable::getCacheableASCIIString2(String^ val)
{
return GetCacheableString2(val);
}
//cacheable ascii string huge
- String^ Serializable::getASCIIStringHuge(native::SerializablePtr nativeptr)
+ String^ Serializable::getASCIIStringHuge(std::shared_ptr<native::Serializable> nativeptr)
{
return GetString(nativeptr->toString());
}
- native::CacheableKeyPtr Serializable::getCacheableASCIIStringHuge(String^ val)
+ std::shared_ptr<native::CacheableKey> Serializable::getCacheableASCIIStringHuge(String^ val)
{
return GetCacheableString(val);
}
//cacheable string
- String^ Serializable::getUTFString(native::SerializablePtr nativeptr)
+ String^ Serializable::getUTFString(std::shared_ptr<native::Serializable> nativeptr)
{
return GetString(nativeptr->toString());
}
- native::CacheableKeyPtr Serializable::getCacheableUTFString(String^ val)
+ std::shared_ptr<native::CacheableKey> Serializable::getCacheableUTFString(String^ val)
{
return GetCacheableString(val);
}
//cacheable string huge
- String^ Serializable::getUTFStringHuge(native::SerializablePtr nativeptr)
+ String^ Serializable::getUTFStringHuge(std::shared_ptr<native::Serializable> nativeptr)
{
return GetString(nativeptr->toString());
}
- native::CacheableKeyPtr Serializable::getCacheableUTFStringHuge(String^ val)
+ std::shared_ptr<native::CacheableKey> Serializable::getCacheableUTFStringHuge(String^ val)
{
return GetCacheableString(val);
}
- native::CacheableStringPtr Serializable::GetCacheableString(String^ value)
+ std::shared_ptr<native::CacheableString> Serializable::GetCacheableString(String^ value)
{
- native::CacheableStringPtr cStr;
+ std::shared_ptr<native::CacheableString> cStr;
size_t len = 0;
if (value != nullptr) {
len = value->Length;
@@ -1393,9 +1393,9 @@ namespace Apache
return cStr;
}
- native::CacheableStringPtr Serializable::GetCacheableString2(String^ value)
+ std::shared_ptr<native::CacheableString> Serializable::GetCacheableString2(String^ value)
{
- native::CacheableStringPtr cStr;
+ std::shared_ptr<native::CacheableString> cStr;
size_t len = 0;
if (value != nullptr) {
len = value->Length;
diff --git a/clicache/src/Serializable.hpp b/clicache/src/Serializable.hpp
index b124c78..460bfae 100644
--- a/clicache/src/Serializable.hpp
+++ b/clicache/src/Serializable.hpp
@@ -75,7 +75,7 @@ namespace Apache
/// This delegate should return an object of type <c>IGeodeSerializable</c>
/// given a native object.
/// </remarks>
- delegate Apache::Geode::Client::IGeodeSerializable^ WrapperDelegateGeneric(native::SerializablePtr obj);
+ delegate Apache::Geode::Client::IGeodeSerializable^ WrapperDelegateGeneric(std::shared_ptr<native::Serializable> obj);
/// <summary>
/// Signature of function delegates passed to
@@ -318,81 +318,81 @@ namespace Apache
static Dictionary<String^, PdxTypeFactoryMethod^>^ PdxDelegateMap =
gcnew Dictionary<String^, PdxTypeFactoryMethod^>();
- static String^ GetString(native::CacheableStringPtr cStr);//native::CacheableString*
+ static String^ GetString(std::shared_ptr<native::CacheableString> cStr);//native::CacheableString*
// These are the new static methods to get/put data from c++
//byte
- static Byte getByte(native::SerializablePtr nativeptr);
+ static Byte getByte(std::shared_ptr<native::Serializable> nativeptr);
- static native::CacheableKeyPtr getCacheableByte(SByte val);
+ static std::shared_ptr<native::CacheableKey> getCacheableByte(SByte val);
//boolean
- static bool getBoolean(native::SerializablePtr nativeptr);
+ static bool getBoolean(std::shared_ptr<native::Serializable> nativeptr);
- static native::CacheableKeyPtr getCacheableBoolean(bool val);
+ static std::shared_ptr<native::CacheableKey> getCacheableBoolean(bool val);
//widechar
- static Char getChar(native::SerializablePtr nativeptr);
+ static Char getChar(std::shared_ptr<native::Serializable> nativeptr);
- static native::CacheableKeyPtr getCacheableWideChar(Char val);
+ static std::shared_ptr<native::CacheableKey> getCacheableWideChar(Char val);
//double
- static double getDouble(native::SerializablePtr nativeptr);
+ static double getDouble(std::shared_ptr<native::Serializable> nativeptr);
- static native::CacheableKeyPtr getCacheableDouble(double val);
+ static std::shared_ptr<native::CacheableKey> getCacheableDouble(double val);
//float
- static float getFloat(native::SerializablePtr nativeptr);
+ static float getFloat(std::shared_ptr<native::Serializable> nativeptr);
- static native::CacheableKeyPtr getCacheableFloat(float val);
+ static std::shared_ptr<native::CacheableKey> getCacheableFloat(float val);
//int16
- static System::Int16 getInt16(native::SerializablePtr nativeptr);
+ static System::Int16 getInt16(std::shared_ptr<native::Serializable> nativeptr);
- static native::CacheableKeyPtr getCacheableInt16(int val);
+ static std::shared_ptr<native::CacheableKey> getCacheableInt16(int val);
//int32
- static System::Int32 getInt32(native::SerializablePtr nativeptr);
+ static System::Int32 getInt32(std::shared_ptr<native::Serializable> nativeptr);
- static native::CacheableKeyPtr getCacheableInt32(System::Int32 val);
+ static std::shared_ptr<native::CacheableKey> getCacheableInt32(System::Int32 val);
//int64
- static System::Int64 getInt64(native::SerializablePtr nativeptr);
+ static System::Int64 getInt64(std::shared_ptr<native::Serializable> nativeptr);
- static native::CacheableKeyPtr getCacheableInt64(System::Int64 val);
+ static std::shared_ptr<native::CacheableKey> getCacheableInt64(System::Int64 val);
//cacheable ascii string
- static String^ getASCIIString(native::SerializablePtr nativeptr);
+ static String^ getASCIIString(std::shared_ptr<native::Serializable> nativeptr);
- static native::CacheableKeyPtr getCacheableASCIIString(String^ val);
+ static std::shared_ptr<native::CacheableKey> getCacheableASCIIString(String^ val);
- static native::CacheableKeyPtr getCacheableASCIIString2(String^ val);
+ static std::shared_ptr<native::CacheableKey> getCacheableASCIIString2(String^ val);
//cacheable ascii string huge
- static String^ getASCIIStringHuge(native::SerializablePtr nativeptr);
+ static String^ getASCIIStringHuge(std::shared_ptr<native::Serializable> nativeptr);
- static native::CacheableKeyPtr getCacheableASCIIStringHuge(String^ val);
+ static std::shared_ptr<native::CacheableKey> getCacheableASCIIStringHuge(String^ val);
//cacheable string
- static String^ getUTFString(native::SerializablePtr nativeptr);
+ static String^ getUTFString(std::shared_ptr<native::Serializable> nativeptr);
- static native::CacheableKeyPtr getCacheableUTFString(String^ val);
+ static std::shared_ptr<native::CacheableKey> getCacheableUTFString(String^ val);
//cacheable string huge
- static String^ getUTFStringHuge(native::SerializablePtr nativeptr);
+ static String^ getUTFStringHuge(std::shared_ptr<native::Serializable> nativeptr);
- static native::CacheableKeyPtr getCacheableUTFStringHuge(String^ val);
+ static std::shared_ptr<native::CacheableKey> getCacheableUTFStringHuge(String^ val);
- static native::CacheableStringPtr GetCacheableString(String^ value);
+ static std::shared_ptr<native::CacheableString> GetCacheableString(String^ value);
- static native::CacheableStringPtr GetCacheableString2(String^ value);
+ static std::shared_ptr<native::CacheableString> GetCacheableString2(String^ value);
/*
- static String^ GetString(native::CacheableStringPtr cStr)//native::CacheableString*
+ static String^ GetString(std::shared_ptr<native::CacheableString> cStr)//native::CacheableString*
{
if (cStr == nullptr) {
return nullptr;
@@ -425,7 +425,7 @@ namespace Apache
/// Internal constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline Apache::Geode::Client::Serializable(native::SerializablePtr nativeptr)
+ inline Apache::Geode::Client::Serializable(std::shared_ptr<native::Serializable> nativeptr)
{
m_nativeptr = gcnew native_shared_ptr<native::Serializable>(nativeptr);
}
@@ -452,19 +452,19 @@ namespace Apache
static void UnregisterTypeGeneric(Byte typeId, Cache^ cache);
generic<class TValue>
- static TValue GetManagedValueGeneric(native::SerializablePtr val);
+ static TValue GetManagedValueGeneric(std::shared_ptr<native::Serializable> val);
generic<class TKey>
- static native::CacheableKeyPtr GetUnmanagedValueGeneric(TKey key);
+ static std::shared_ptr<native::CacheableKey> GetUnmanagedValueGeneric(TKey key);
generic<class TKey>
- static native::CacheableKeyPtr GetUnmanagedValueGeneric(TKey key, bool isAciiChar);
+ static std::shared_ptr<native::CacheableKey> GetUnmanagedValueGeneric(TKey key, bool isAciiChar);
generic<class TKey>
- static native::CacheableKeyPtr GetUnmanagedValueGeneric(Type^ managedType, TKey key);
+ static std::shared_ptr<native::CacheableKey> GetUnmanagedValueGeneric(Type^ managedType, TKey key);
generic<class TKey>
- static native::CacheableKeyPtr GetUnmanagedValueGeneric(Type^ managedType, TKey key, bool isAsciiChar);
+ static std::shared_ptr<native::CacheableKey> GetUnmanagedValueGeneric(Type^ managedType, TKey key, bool isAsciiChar);
/// <summary>
/// Static map of <c>TypeFactoryMethod</c> delegates created
diff --git a/clicache/src/Struct.hpp b/clicache/src/Struct.hpp
index 9b43820..557927a 100644
--- a/clicache/src/Struct.hpp
+++ b/clicache/src/Struct.hpp
@@ -117,7 +117,7 @@ namespace Apache
/// Private constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline Apache::Geode::Client::Struct/*<TResult>*/( apache::geode::client::SerializablePtr nativeptr )
+ inline Apache::Geode::Client::Struct/*<TResult>*/( std::shared_ptr<apache::geode::client::Serializable> nativeptr )
: Apache::Geode::Client::Serializable( nativeptr ) { }
inline Apache::Geode::Client::Struct/*<TResult>*/( )
@@ -128,7 +128,7 @@ namespace Apache
/// <summary>
/// Factory function to register wrapper
/// </summary>
- inline static Apache::Geode::Client::IGeodeSerializable^ /*Struct^*/ /*<TResult>*/ Create( ::apache::geode::client::SerializablePtr obj )
+ inline static Apache::Geode::Client::IGeodeSerializable^ /*Struct^*/ /*<TResult>*/ Create( ::std::shared_ptr<apache::geode::client::Serializable> obj )
{
return ( obj != nullptr ?
gcnew Apache::Geode::Client::Struct/*<TResult>*/( obj ) : nullptr );
diff --git a/clicache/src/StructSet.hpp b/clicache/src/StructSet.hpp
index ae81b76..7c649e9 100644
--- a/clicache/src/StructSet.hpp
+++ b/clicache/src/StructSet.hpp
@@ -142,7 +142,7 @@ namespace Apache
/// <returns>
/// The managed wrapper object; null if the native pointer is null.
/// </returns>
- inline static StructSet<TResult>^ Create(native::StructSetPtr nativeptr)
+ inline static StructSet<TResult>^ Create(std::shared_ptr<native::StructSet> nativeptr)
{
return __nullptr == nativeptr ? nullptr :
gcnew StructSet<TResult>( nativeptr );
@@ -158,7 +158,7 @@ namespace Apache
/// Private constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline StructSet(native::StructSetPtr nativeptr)
+ inline StructSet(std::shared_ptr<native::StructSet> nativeptr)
{
m_nativeptr = gcnew native_shared_ptr<native::StructSet>(nativeptr);
}
diff --git a/clicache/src/TransactionEvent.cpp b/clicache/src/TransactionEvent.cpp
index 35d2750..6eefbb1 100644
--- a/clicache/src/TransactionEvent.cpp
+++ b/clicache/src/TransactionEvent.cpp
@@ -46,7 +46,7 @@ namespace Apache
generic<class TKey, class TValue>
Apache::Geode::Client::TransactionId^ TransactionEvent<TKey, TValue>::TransactionId::get( )
{
- apache::geode::client::TransactionIdPtr & nativeptr(
+ std::shared_ptr<apache::geode::client::TransactionId> & nativeptr(
NativePtr->getTransactionId( ) );
return Apache::Geode::Client::TransactionId::Create(
@@ -56,14 +56,14 @@ namespace Apache
generic<class TKey, class TValue>
array<EntryEvent<TKey, TValue>^>^ TransactionEvent<TKey, TValue>::Events::get( )
{
- apache::geode::client::VectorOfEntryEvent vee;
+ std::vector<std::shared_ptr<apache::geode::client::EntryEvent>> vee;
vee = NativePtr->getEvents();
array<EntryEvent<TKey, TValue>^>^ events =
gcnew array<EntryEvent<TKey, TValue>^>( vee.size( ) );
// Loop through the unmanaged event objects to convert them to the managed generic objects.
for( System::Int32 index = 0; index < vee.size( ); index++ )
{
- apache::geode::client::EntryEventPtr& nativeptr( vee[ index ] );
+ std::shared_ptr<apache::geode::client::EntryEvent>& nativeptr( vee[ index ] );
EntryEvent<TKey, TValue> entryEvent( nativeptr.get() );
events[ index ] = (%entryEvent);
}
diff --git a/clicache/src/TransactionId.hpp b/clicache/src/TransactionId.hpp
index 29ceeb8..21cba46 100644
--- a/clicache/src/TransactionId.hpp
+++ b/clicache/src/TransactionId.hpp
@@ -41,7 +41,7 @@ namespace Apache
{
internal:
- inline static TransactionId^ Create(native::TransactionIdPtr nativeptr )
+ inline static TransactionId^ Create(std::shared_ptr<native::TransactionId> nativeptr )
{
return __nullptr == nativeptr ? nullptr :
gcnew TransactionId( nativeptr );
@@ -58,7 +58,7 @@ namespace Apache
/// Private constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline TransactionId( native::TransactionIdPtr nativeptr )
+ inline TransactionId( std::shared_ptr<native::TransactionId> nativeptr )
{
m_nativeptr = gcnew native_shared_ptr<native::TransactionId>(nativeptr);
}
diff --git a/clicache/src/UserFunctionExecutionException.hpp b/clicache/src/UserFunctionExecutionException.hpp
index 3adbfa6..90f58e2 100644
--- a/clicache/src/UserFunctionExecutionException.hpp
+++ b/clicache/src/UserFunctionExecutionException.hpp
@@ -129,7 +129,7 @@ namespace Apache
/// Private constructor to wrap a native object pointer.
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline UserFunctionExecutionException(apache::geode::client::UserFunctionExecutionExceptionPtr nativeptr)
+ inline UserFunctionExecutionException(std::shared_ptr<apache::geode::client::UserFunctionExecutionException> nativeptr)
{
m_nativeptr = gcnew native_shared_ptr<native::UserFunctionExecutionException>(nativeptr);
}
diff --git a/clicache/src/impl/AuthenticatedCache.cpp b/clicache/src/impl/AuthenticatedCache.cpp
index e9871de..14fa38c 100644
--- a/clicache/src/impl/AuthenticatedCache.cpp
+++ b/clicache/src/impl/AuthenticatedCache.cpp
@@ -108,7 +108,7 @@ namespace Apache
generic<class TKey, class TValue>
array<IRegion<TKey, TValue>^>^ AuthenticatedCache::RootRegions( )
{
- apache::geode::client::VectorOfRegion vrr;
+ std::vector<std::shared_ptr<apache::geode::client::Region>> vrr;
try
{
vrr = m_nativeptr->get()->rootRegions( );
diff --git a/clicache/src/impl/AuthenticatedCache.hpp b/clicache/src/impl/AuthenticatedCache.hpp
index 7f0028f..375c17f 100644
--- a/clicache/src/impl/AuthenticatedCache.hpp
+++ b/clicache/src/impl/AuthenticatedCache.hpp
@@ -142,7 +142,7 @@ namespace Apache
/// <returns>
/// The managed wrapper object; null if the native pointer is null.
/// </returns>
- inline static AuthenticatedCache^ Create( native::RegionServicePtr nativeptr )
+ inline static AuthenticatedCache^ Create( std::shared_ptr<native::RegionService> nativeptr )
{
return __nullptr == nativeptr ? nullptr :
gcnew AuthenticatedCache( nativeptr );
@@ -159,7 +159,7 @@ namespace Apache
/// Private constructor to wrap a native object pointer
/// </summary>
/// <param name="nativeptr">The native object pointer</param>
- inline AuthenticatedCache( native::RegionServicePtr nativeptr )
+ inline AuthenticatedCache( std::shared_ptr<native::RegionService> nativeptr )
{
m_nativeptr = gcnew native_shared_ptr<native::RegionService>(nativeptr);
}
diff --git a/clicache/src/impl/CacheLoader.hpp b/clicache/src/impl/CacheLoader.hpp
index b8b3ca0..8aacadf 100644
--- a/clicache/src/impl/CacheLoader.hpp
+++ b/clicache/src/impl/CacheLoader.hpp
@@ -40,10 +40,10 @@ namespace Apache
public interface class ICacheLoaderProxy
{
public:
- apache::geode::client::CacheablePtr load( const apache::geode::client::RegionPtr& region,
- const apache::geode::client::CacheableKeyPtr& key, const apache::geode::client::SerializablePtr& helper );
+ std::shared_ptr<apache::geode::client::Cacheable> load( const std::shared_ptr<apache::geode::client::Region>& region,
+ const std::shared_ptr<apache::geode::client::CacheableKey>& key, const std::shared_ptr<apache::geode::client::Serializable>& helper );
- void close( const apache::geode::client::RegionPtr& region );
+ void close( const std::shared_ptr<apache::geode::client::Region>& region );
};
generic<class TKey, class TValue>
@@ -60,8 +60,8 @@ namespace Apache
m_loader = loader;
}
- virtual apache::geode::client::CacheablePtr load( const apache::geode::client::RegionPtr& region,
- const apache::geode::client::CacheableKeyPtr& key, const apache::geode::client::SerializablePtr& helper )
+ virtual std::shared_ptr<apache::geode::client::Cacheable> load( const std::shared_ptr<apache::geode::client::Region>& region,
+ const std::shared_ptr<apache::geode::client::CacheableKey>& key, const std::shared_ptr<apache::geode::client::Serializable>& helper )
{
IRegion<TKey, TValue>^ gregion = Region<TKey, TValue>::Create(region);
@@ -72,7 +72,7 @@ namespace Apache
return Serializable::GetUnmanagedValueGeneric<TValue>(m_loader->Load(gregion, gkey, ghelper));
}
- virtual void close( const apache::geode::client::RegionPtr& region )
+ virtual void close( const std::shared_ptr<apache::geode::client::Region>& region )
{
IRegion<TKey, TValue>^ gregion = Region<TKey, TValue>::Create(region);
m_loader->Close(gregion);
diff --git a/clicache/src/impl/FixedPartitionResolver.hpp b/clicache/src/impl/FixedPartitionResolver.hpp
index 03f57c9..da6d870 100644
--- a/clicache/src/impl/FixedPartitionResolver.hpp
+++ b/clicache/src/impl/FixedPartitionResolver.hpp
@@ -34,7 +34,7 @@ namespace Apache
public interface class IFixedPartitionResolverProxy
{
public:
- apache::geode::client::CacheableKeyPtr getRoutingObject(const apache::geode::client::EntryEvent& ev);
+ std::shared_ptr<apache::geode::client::CacheableKey> getRoutingObject(const apache::geode::client::EntryEvent& ev);
const char * getName();
const char* getPartitionName(const apache::geode::client::EntryEvent& opDetails);
};
@@ -56,7 +56,7 @@ namespace Apache
m_strList = gcnew Dictionary<String^, ManagedString^>();
}
- virtual apache::geode::client::CacheableKeyPtr getRoutingObject(const apache::geode::client::EntryEvent& ev)
+ virtual std::shared_ptr<apache::geode::client::CacheableKey> getRoutingObject(const apache::geode::client::EntryEvent& ev)
{
EntryEvent<TKey, TValue> gevent(&ev);
Object^ groutingobject = m_resolver->GetRoutingObject(%gevent);
diff --git a/clicache/src/impl/ManagedAuthInitialize.cpp b/clicache/src/impl/ManagedAuthInitialize.cpp
index ca071a7..b7042eb 100644
--- a/clicache/src/impl/ManagedAuthInitialize.cpp
+++ b/clicache/src/impl/ManagedAuthInitialize.cpp
@@ -34,7 +34,7 @@ namespace apache
namespace client
{
- PropertiesPtr ManagedAuthInitializeGeneric::getCredentials(const PropertiesPtr&
+ std::shared_ptr<Properties> ManagedAuthInitializeGeneric::getCredentials(const std::shared_ptr<Properties>&
securityprops, const char* server)
{
try {
diff --git a/clicache/src/impl/ManagedAuthInitialize.hpp b/clicache/src/impl/ManagedAuthInitialize.hpp
index 83f7961..5457bec 100644
--- a/clicache/src/impl/ManagedAuthInitialize.hpp
+++ b/clicache/src/impl/ManagedAuthInitialize.hpp
@@ -101,7 +101,7 @@ namespace apache
/// </param>
/// <param name="server">It is the ID of the endpoint
/// </param>
- virtual PropertiesPtr getCredentials(const PropertiesPtr& securityprops, const char* server);
+ virtual std::shared_ptr<Properties> getCredentials(const std::shared_ptr<Properties>& securityprops, const char* server);
virtual ~ManagedAuthInitializeGeneric() { }
diff --git a/clicache/src/impl/ManagedCacheListener.cpp b/clicache/src/impl/ManagedCacheListener.cpp
index 844231f..bc2b2e8 100644
--- a/clicache/src/impl/ManagedCacheListener.cpp
+++ b/clicache/src/impl/ManagedCacheListener.cpp
@@ -327,7 +327,7 @@ namespace apache
}
}
- void ManagedCacheListenerGeneric::close(const apache::geode::client::RegionPtr& region)
+ void ManagedCacheListenerGeneric::close(const std::shared_ptr<apache::geode::client::Region>& region)
{
try {
auto mregion = Apache::Geode::Client::Region<Object^, Object^>::Create(region);
@@ -341,7 +341,7 @@ namespace apache
Apache::Geode::Client::GeodeException::ThrowNative(ex);
}
}
- void ManagedCacheListenerGeneric::afterRegionDisconnected(const apache::geode::client::RegionPtr& region)
+ void ManagedCacheListenerGeneric::afterRegionDisconnected(const std::shared_ptr<apache::geode::client::Region>& region)
{
try {
auto mregion = Apache::Geode::Client::Region<Object^, Object^>::Create(region);
diff --git a/clicache/src/impl/ManagedCacheListener.hpp b/clicache/src/impl/ManagedCacheListener.hpp
index ccc80d7..f48ab07 100644
--- a/clicache/src/impl/ManagedCacheListener.hpp
+++ b/clicache/src/impl/ManagedCacheListener.hpp
@@ -181,7 +181,7 @@ namespace apache {
/// </remarks>
/// <seealso cref="Apache.Geode.Client.Cache.Close" />
/// <seealso cref="Apache.Geode.Client.Region.DestroyRegion" />
- virtual void close(const apache::geode::client::RegionPtr& region);
+ virtual void close(const std::shared_ptr<apache::geode::client::Region>& region);
///<summary>
///Called when all the endpoints associated with region are down.
@@ -194,7 +194,7 @@ namespace apache {
///<param>
///region Region^ denotes the assosiated region.
///</param>
- virtual void afterRegionDisconnected(const apache::geode::client::RegionPtr& region);
+ virtual void afterRegionDisconnected(const std::shared_ptr<apache::geode::client::Region>& region);
/// <summary>
/// Returns the wrapped managed object reference.
diff --git a/clicache/src/impl/ManagedCacheLoader.cpp b/clicache/src/impl/ManagedCacheLoader.cpp
index c40de7d..e693a59 100644
--- a/clicache/src/impl/ManagedCacheLoader.cpp
+++ b/clicache/src/impl/ManagedCacheLoader.cpp
@@ -214,8 +214,8 @@ namespace apache
return NULL;
}
- CacheablePtr ManagedCacheLoaderGeneric::load(const RegionPtr& region,
- const CacheableKeyPtr& key, const SerializablePtr& aCallbackArgument)
+ std::shared_ptr<Cacheable> ManagedCacheLoaderGeneric::load(const std::shared_ptr<Region>& region,
+ const std::shared_ptr<CacheableKey>& key, const std::shared_ptr<Serializable>& aCallbackArgument)
{
try {
return m_managedptr->load(region, key, aCallbackArgument);
@@ -229,7 +229,7 @@ namespace apache
return nullptr;
}
- void ManagedCacheLoaderGeneric::close(const RegionPtr& region)
+ void ManagedCacheLoaderGeneric::close(const std::shared_ptr<Region>& region)
{
try {
/*
diff --git a/clicache/src/impl/ManagedCacheLoader.hpp b/clicache/src/impl/ManagedCacheLoader.hpp
index 8b717ef..74d1c18 100644
--- a/clicache/src/impl/ManagedCacheLoader.hpp
+++ b/clicache/src/impl/ManagedCacheLoader.hpp
@@ -96,8 +96,8 @@ namespace apache
/// will return null.
/// </returns>
/// <seealso cref="Apache.Geode.Client.Region.Get" />
- virtual CacheablePtr load(const RegionPtr& region,
- const CacheableKeyPtr& key, const SerializablePtr& aCallbackArgument);
+ virtual std::shared_ptr<Cacheable> load(const std::shared_ptr<Region>& region,
+ const std::shared_ptr<CacheableKey>& key, const std::shared_ptr<Serializable>& aCallbackArgument);
/// <summary>
/// Called when the region containing this callback is destroyed, when
@@ -115,7 +115,7 @@ namespace apache
/// <param name="region">the region pointer</param>
/// <seealso cref="Apache.Geode.Client.Cache.Close" />
/// <seealso cref="Apache.Geode.Client.Region.DestroyRegion" />
- virtual void close(const RegionPtr& region);
+ virtual void close(const std::shared_ptr<Region>& region);
/*
/// <summary>
diff --git a/clicache/src/impl/ManagedCacheWriter.cpp b/clicache/src/impl/ManagedCacheWriter.cpp
index 821e27a..8489c0f 100644
--- a/clicache/src/impl/ManagedCacheWriter.cpp
+++ b/clicache/src/impl/ManagedCacheWriter.cpp
@@ -294,7 +294,7 @@ namespace apache
return false;
}
- void ManagedCacheWriterGeneric::close(const RegionPtr& rp)
+ void ManagedCacheWriterGeneric::close(const std::shared_ptr<Region>& rp)
{
try {
auto mregion = Apache::Geode::Client::Region<Object^, Object^>::Create(rp);
diff --git a/clicache/src/impl/ManagedCacheWriter.hpp b/clicache/src/impl/ManagedCacheWriter.hpp
index 0b6eba1..6570f0d 100644
--- a/clicache/src/impl/ManagedCacheWriter.hpp
+++ b/clicache/src/impl/ManagedCacheWriter.hpp
@@ -152,7 +152,7 @@ namespace apache
/// </remarks>
/// <seealso cref="Apache.Geode.Client.Cache.Close" />
/// <seealso cref="Apache.Geode.Client.Region.DestroyRegion" />
- void close(const RegionPtr& rp);
+ void close(const std::shared_ptr<Region>& rp);
/// <summary>
/// Returns the wrapped managed object reference.
diff --git a/clicache/src/impl/ManagedCacheableDelta.cpp b/clicache/src/impl/ManagedCacheableDelta.cpp
index c0538e0..5c99651 100644
--- a/clicache/src/impl/ManagedCacheableDelta.cpp
+++ b/clicache/src/impl/ManagedCacheableDelta.cpp
@@ -197,14 +197,14 @@ namespace apache
}
}
- DeltaPtr ManagedCacheableDeltaGeneric::clone()
+ std::shared_ptr<Delta> ManagedCacheableDeltaGeneric::clone()
{
try {
if (auto cloneable = dynamic_cast<ICloneable^>((
Apache::Geode::Client::IGeodeDelta^) m_managedptr)) {
auto Mclone =
dynamic_cast<Apache::Geode::Client::IGeodeSerializable^>(cloneable->Clone());
- return DeltaPtr(static_cast<ManagedCacheableDeltaGeneric*>(
+ return std::shared_ptr<Delta>(static_cast<ManagedCacheableDeltaGeneric*>(
SafeMSerializableConvertGeneric(Mclone)));
}
else {
diff --git a/clicache/src/impl/ManagedCacheableDelta.hpp b/clicache/src/impl/ManagedCacheableDelta.hpp
index ab16802..9fdc657 100644
--- a/clicache/src/impl/ManagedCacheableDelta.hpp
+++ b/clicache/src/impl/ManagedCacheableDelta.hpp
@@ -134,7 +134,7 @@ namespace apache
virtual bool hasDelta();
- virtual apache::geode::client::DeltaPtr clone();
+ virtual std::shared_ptr<apache::geode::client::Delta> clone();
/// <summary>
/// return the hashcode for this key.
diff --git a/clicache/src/impl/ManagedCacheableKey.cpp b/clicache/src/impl/ManagedCacheableKey.cpp
index 2ba6596..154522a 100644
--- a/clicache/src/impl/ManagedCacheableKey.cpp
+++ b/clicache/src/impl/ManagedCacheableKey.cpp
@@ -126,10 +126,10 @@ namespace apache
return 0;
}
- apache::geode::client::CacheableStringPtr ManagedCacheableKeyGeneric::toString() const
+ std::shared_ptr<apache::geode::client::CacheableString> ManagedCacheableKeyGeneric::toString() const
{
try {
- apache::geode::client::CacheableStringPtr cStr;
+ std::shared_ptr<apache::geode::client::CacheableString> cStr;
Apache::Geode::Client::CacheableString::GetCacheableString(
m_managedptr->ToString(), cStr);
return cStr;
diff --git a/clicache/src/impl/ManagedCacheableKey.hpp b/clicache/src/impl/ManagedCacheableKey.hpp
index 7793743..a8d29e7 100644
--- a/clicache/src/impl/ManagedCacheableKey.hpp
+++ b/clicache/src/impl/ManagedCacheableKey.hpp
@@ -125,7 +125,7 @@ namespace apache
/// Display this object as 'string', which depends on the implementation in
/// the managed class
/// </summary>
- virtual apache::geode::client::CacheableStringPtr toString() const;
+ virtual std::shared_ptr<apache::geode::client::CacheableString> toString() const;
/// <summary>
/// return true if this key matches other CacheableKey
diff --git a/clicache/src/impl/ManagedFixedPartitionResolver.cpp b/clicache/src/impl/ManagedFixedPartitionResolver.cpp
index 26f3f3b..54ece65 100644
--- a/clicache/src/impl/ManagedFixedPartitionResolver.cpp
+++ b/clicache/src/impl/ManagedFixedPartitionResolver.cpp
@@ -214,7 +214,7 @@ namespace apache
return NULL;
}
- CacheableKeyPtr ManagedFixedPartitionResolverGeneric::getRoutingObject(const EntryEvent& key)
+ std::shared_ptr<CacheableKey> ManagedFixedPartitionResolverGeneric::getRoutingObject(const EntryEvent& key)
{
try {
return m_managedptr->getRoutingObject(key);
diff --git a/clicache/src/impl/ManagedFixedPartitionResolver.hpp b/clicache/src/impl/ManagedFixedPartitionResolver.hpp
index aba0bf0..a7ed614 100644
--- a/clicache/src/impl/ManagedFixedPartitionResolver.hpp
+++ b/clicache/src/impl/ManagedFixedPartitionResolver.hpp
@@ -83,7 +83,7 @@ namespace apache {
/// key the detail of the entry event.
/// </param>
- virtual CacheableKeyPtr getRoutingObject(const EntryEvent& key);
+ virtual std::shared_ptr<CacheableKey> getRoutingObject(const EntryEvent& key);
/// <summary>
/// Returns the name of the FixedPartitionResolver.
diff --git a/clicache/src/impl/ManagedPartitionResolver.cpp b/clicache/src/impl/ManagedPartitionResolver.cpp
index 51279c5..f36a9d8 100644
--- a/clicache/src/impl/ManagedPartitionResolver.cpp
+++ b/clicache/src/impl/ManagedPartitionResolver.cpp
@@ -218,7 +218,7 @@ namespace apache
return NULL;
}
- CacheableKeyPtr ManagedPartitionResolverGeneric::getRoutingObject(const EntryEvent& key)
+ std::shared_ptr<CacheableKey> ManagedPartitionResolverGeneric::getRoutingObject(const EntryEvent& key)
{
try {
return m_managedptr->getRoutingObject(key);
diff --git a/clicache/src/impl/ManagedPartitionResolver.hpp b/clicache/src/impl/ManagedPartitionResolver.hpp
index 9640cf9..3074e34 100644
--- a/clicache/src/impl/ManagedPartitionResolver.hpp
+++ b/clicache/src/impl/ManagedPartitionResolver.hpp
@@ -85,7 +85,7 @@ namespace apache {
/// key the detail of the entry event.
/// </param>
- virtual CacheableKeyPtr getRoutingObject(const EntryEvent& key);
+ virtual std::shared_ptr<CacheableKey> getRoutingObject(const EntryEvent& key);
/// <summary>
/// Returns the name of the PartitionResolver.
diff --git a/clicache/src/impl/ManagedPersistenceManager.cpp b/clicache/src/impl/ManagedPersistenceManager.cpp
index cdaf9bc..0b5932a 100644
--- a/clicache/src/impl/ManagedPersistenceManager.cpp
+++ b/clicache/src/impl/ManagedPersistenceManager.cpp
@@ -209,7 +209,7 @@ namespace apache
}
- void ManagedPersistenceManagerGeneric::write(const CacheableKeyPtr& key, const CacheablePtr& value, void *& PersistenceInfo)
+ void ManagedPersistenceManagerGeneric::write(const std::shared_ptr<CacheableKey>& key, const std::shared_ptr<Cacheable>& value, void *& PersistenceInfo)
{
m_managedptr->write(key, value);
}
@@ -219,12 +219,12 @@ namespace apache
throw gcnew System::NotSupportedException;
}
- void ManagedPersistenceManagerGeneric::init(const RegionPtr& region, const PropertiesPtr& diskProperties)
+ void ManagedPersistenceManagerGeneric::init(const std::shared_ptr<Region>& region, const std::shared_ptr<Properties>& diskProperties)
{
m_managedptr->init(region, diskProperties);
}
- CacheablePtr ManagedPersistenceManagerGeneric::read(const CacheableKeyPtr& key, void *& PersistenceInfo)
+ std::shared_ptr<Cacheable> ManagedPersistenceManagerGeneric::read(const std::shared_ptr<CacheableKey>& key, void *& PersistenceInfo)
{
return m_managedptr->read(key);
}
@@ -234,7 +234,7 @@ namespace apache
throw gcnew System::NotSupportedException;
}
- void ManagedPersistenceManagerGeneric::destroy(const CacheableKeyPtr& key, void *& PersistenceInfo)
+ void ManagedPersistenceManagerGeneric::destroy(const std::shared_ptr<CacheableKey>& key, void *& PersistenceInfo)
{
m_managedptr->destroy(key);
}
diff --git a/clicache/src/impl/ManagedPersistenceManager.hpp b/clicache/src/impl/ManagedPersistenceManager.hpp
index 81dfa62..13d1726 100644
--- a/clicache/src/impl/ManagedPersistenceManager.hpp
+++ b/clicache/src/impl/ManagedPersistenceManager.hpp
@@ -45,12 +45,12 @@ namespace apache {
virtual ~ManagedPersistenceManagerGeneric() { }
- virtual void write(const CacheableKeyPtr& key, const CacheablePtr& value, void *& PersistenceInfo);
+ virtual void write(const std::shared_ptr<CacheableKey>& key, const std::shared_ptr<Cacheable>& value, void *& PersistenceInfo);
virtual bool writeAll();
- virtual void init(const RegionPtr& region, const PropertiesPtr& diskProperties);
- virtual CacheablePtr read(const CacheableKeyPtr& key, void *& PersistenceInfo);
+ virtual void init(const std::shared_ptr<Region>& region, const std::shared_ptr<Properties>& diskProperties);
+ virtual std::shared_ptr<Cacheable> read(const std::shared_ptr<CacheableKey>& key, void *& PersistenceInfo);
virtual bool readAll();
- virtual void destroy(const CacheableKeyPtr& key, void *& PersistenceInfo);
+ virtual void destroy(const std::shared_ptr<CacheableKey>& key, void *& PersistenceInfo);
virtual void close();
inline void setptr(Apache::Geode::Client::IPersistenceManagerProxy^ managedptr)
diff --git a/clicache/src/impl/ManagedResultCollector.cpp b/clicache/src/impl/ManagedResultCollector.cpp
index 49a9cb8..8319b2a 100644
--- a/clicache/src/impl/ManagedResultCollector.cpp
+++ b/clicache/src/impl/ManagedResultCollector.cpp
@@ -146,7 +146,7 @@ namespace apache
return NULL;
}
- void ManagedResultCollectorGeneric::addResult(const CacheablePtr& result)
+ void ManagedResultCollectorGeneric::addResult(const std::shared_ptr<Cacheable>& result)
{
try {
Object^ rs = Apache::Geode::Client::Serializable::GetManagedValueGeneric<Object^>(result);
@@ -164,15 +164,15 @@ namespace apache
}
}
- CacheableVectorPtr ManagedResultCollectorGeneric::getResult(std::chrono::milliseconds timeout)
+ std::shared_ptr<CacheableVector> ManagedResultCollectorGeneric::getResult(std::chrono::milliseconds timeout)
{
try {
//array<IGeodeSerializable^>^ rs = m_managedptr->GetResult(timeout);
- //apache::geode::client::CacheableVectorPtr rsptr = apache::geode::client::CacheableVector::create();
+ //std::shared_ptr<apache::geode::client::CacheableVector> rsptr = apache::geode::client::CacheableVector::create();
//for( int index = 0; index < rs->Length; index++ )
//{
- // //apache::geode::client::CacheablePtr valueptr(Apache::Geode::Client::Serializable::GetUnmanagedValueGeneric<IGeodeSerializable^>(rs[ index]));
- // apache::geode::client::CacheablePtr valueptr (SafeMSerializableConvert(rs[ index]));
+ // //std::shared_ptr<apache::geode::client::Cacheable> valueptr(Apache::Geode::Client::Serializable::GetUnmanagedValueGeneric<IGeodeSerializable^>(rs[ index]));
+ // std::shared_ptr<apache::geode::client::Cacheable> valueptr (SafeMSerializableConvert(rs[ index]));
// rsptr->push_back(valueptr);
//}
//return rsptr;
diff --git a/clicache/src/impl/ManagedResultCollector.hpp b/clicache/src/impl/ManagedResultCollector.hpp
index 3706b72..c206397 100644
--- a/clicache/src/impl/ManagedResultCollector.hpp
+++ b/clicache/src/impl/ManagedResultCollector.hpp
@@ -74,8 +74,8 @@ namespace apache {
/// </summary>
virtual ~ManagedResultCollectorGeneric() { }
- CacheableVectorPtr getResult(std::chrono::milliseconds timeout = native::DEFAULT_QUERY_RESPONSE_TIMEOUT) override;
- void addResult(const CacheablePtr& result) override;
+ std::shared_ptr<CacheableVector> getResult(std::chrono::milliseconds timeout = native::DEFAULT_QUERY_RESPONSE_TIMEOUT) override;
+ void addResult(const std::shared_ptr<Cacheable>& result) override;
void endResults() override;
void clearResults() override;
diff --git a/clicache/src/impl/ManagedTransactionListener.cpp b/clicache/src/impl/ManagedTransactionListener.cpp
index 99a683b..7caa973 100644
--- a/clicache/src/impl/ManagedTransactionListener.cpp
+++ b/clicache/src/impl/ManagedTransactionListener.cpp
@@ -200,7 +200,7 @@ namespace apache
}
return NULL;
}
- void ManagedTransactionListenerGeneric::afterCommit(apache::geode::client::TransactionEventPtr& te)
+ void ManagedTransactionListenerGeneric::afterCommit(std::shared_ptr<apache::geode::client::TransactionEvent>& te)
{
try {
Apache::Geode::Client::Log::Error("ManagedTransactionListenerGeneric::afterCommit in");
@@ -216,7 +216,7 @@ namespace apache
Apache::Geode::Client::GeodeException::ThrowNative(ex);
}
}
- void ManagedTransactionListenerGeneric::afterFailedCommit(apache::geode::client::TransactionEventPtr& te)
+ void ManagedTransactionListenerGeneric::afterFailedCommit(std::shared_ptr<apache::geode::client::TransactionEvent>& te)
{
try {
Apache::Geode::Client::TransactionEvent mevent(te.get());
@@ -229,7 +229,7 @@ namespace apache
Apache::Geode::Client::GeodeException::ThrowNative(ex);
}
}
- void ManagedTransactionListenerGeneric::afterRollback(apache::geode::client::TransactionEventPtr& te)
+ void ManagedTransactionListenerGeneric::afterRollback(std::shared_ptr<apache::geode::client::TransactionEvent>& te)
{
try {
Apache::Geode::Client::TransactionEvent mevent(te.get());
diff --git a/clicache/src/impl/ManagedTransactionListener.hpp b/clicache/src/impl/ManagedTransactionListener.hpp
index cd48375..5767c92 100644
--- a/clicache/src/impl/ManagedTransactionListener.hpp
+++ b/clicache/src/impl/ManagedTransactionListener.hpp
@@ -51,11 +51,11 @@ namespace apache {
virtual ~ManagedTransactionListenerGeneric( ) { }
- virtual void afterCommit(apache::geode::client::TransactionEventPtr& te);
+ virtual void afterCommit(std::shared_ptr<apache::geode::client::TransactionEvent>& te);
- virtual void afterFailedCommit(apache::geode::client::TransactionEventPtr& te);
+ virtual void afterFailedCommit(std::shared_ptr<apache::geode::client::TransactionEvent>& te);
- virtual void afterRollback(apache::geode::client::TransactionEventPtr& te);
+ virtual void afterRollback(std::shared_ptr<apache::geode::client::TransactionEvent>& te);
virtual void close();
diff --git a/clicache/src/impl/ManagedTransactionWriter.cpp b/clicache/src/impl/ManagedTransactionWriter.cpp
index bde9cbe..2ca7e25 100644
--- a/clicache/src/impl/ManagedTransactionWriter.cpp
+++ b/clicache/src/impl/ManagedTransactionWriter.cpp
@@ -201,7 +201,7 @@ namespace apache
}
return NULL;
}
- void ManagedTransactionWriterGeneric::beforeCommit(apache::geode::client::TransactionEventPtr& te)
+ void ManagedTransactionWriterGeneric::beforeCommit(std::shared_ptr<apache::geode::client::TransactionEvent>& te)
{
try {
Apache::Geode::Client::TransactionEvent mevent(te.get());
diff --git a/clicache/src/impl/ManagedTransactionWriter.hpp b/clicache/src/impl/ManagedTransactionWriter.hpp
index b4871cb..f8db022 100644
--- a/clicache/src/impl/ManagedTransactionWriter.hpp
+++ b/clicache/src/impl/ManagedTransactionWriter.hpp
@@ -60,7 +60,7 @@ namespace apache {
virtual ~ManagedTransactionWriterGeneric( ) { }
- virtual void beforeCommit(apache::geode::client::TransactionEventPtr& te);
+ virtual void beforeCommit(std::shared_ptr<apache::geode::client::TransactionEvent>& te);
inline Apache::Geode::Client::ITransactionWriter^ ptr( ) const
{
diff --git a/clicache/src/impl/ManagedVisitor.cpp b/clicache/src/impl/ManagedVisitor.cpp
index 568de28..e619c6f 100644
--- a/clicache/src/impl/ManagedVisitor.cpp
+++ b/clicache/src/impl/ManagedVisitor.cpp
@@ -30,7 +30,7 @@ namespace apache
namespace client
{
- void ManagedVisitorGeneric::visit(const CacheableKeyPtr& key, const CacheablePtr& value)
+ void ManagedVisitorGeneric::visit(const std::shared_ptr<CacheableKey>& key, const std::shared_ptr<Cacheable>& value)
{
using namespace Apache::Geode::Client;
try {
diff --git a/clicache/src/impl/ManagedVisitor.hpp b/clicache/src/impl/ManagedVisitor.hpp
index 865e87c..98dd7cc 100644
--- a/clicache/src/impl/ManagedVisitor.hpp
+++ b/clicache/src/impl/ManagedVisitor.hpp
@@ -52,7 +52,7 @@ namespace apache
/// Invokes the managed <c>PropertyVisitor</c> delegate for the given
/// <c>Property</c> key and value.
/// </summary>
- virtual void visit(const CacheableKeyPtr& key, const CacheablePtr& value);
+ virtual void visit(const std::shared_ptr<CacheableKey>& key, const std::shared_ptr<Cacheable>& value);
/// <summary>
/// Destructor -- does nothing.
diff --git a/clicache/src/impl/PartitionResolver.hpp b/clicache/src/impl/PartitionResolver.hpp
index 543ea07..aaec4d3 100644
--- a/clicache/src/impl/PartitionResolver.hpp
+++ b/clicache/src/impl/PartitionResolver.hpp
@@ -37,7 +37,7 @@ namespace Apache
public interface class IPartitionResolverProxy
{
public:
- apache::geode::client::CacheableKeyPtr getRoutingObject(const apache::geode::client::EntryEvent& ev);
+ std::shared_ptr<apache::geode::client::CacheableKey> getRoutingObject(const apache::geode::client::EntryEvent& ev);
const char * getName();
};
@@ -55,7 +55,7 @@ namespace Apache
m_resolver = resolver;
}
- virtual apache::geode::client::CacheableKeyPtr getRoutingObject(const apache::geode::client::EntryEvent& ev)
+ virtual std::shared_ptr<apache::geode::client::CacheableKey> getRoutingObject(const apache::geode::client::EntryEvent& ev)
{
EntryEvent<TKey, TValue> gevent(&ev);
Object^ groutingobject = m_resolver->GetRoutingObject(%gevent);
diff --git a/clicache/src/impl/PdxManagedCacheableKey.cpp b/clicache/src/impl/PdxManagedCacheableKey.cpp
index 950cc69..a1f0b51 100644
--- a/clicache/src/impl/PdxManagedCacheableKey.cpp
+++ b/clicache/src/impl/PdxManagedCacheableKey.cpp
@@ -147,10 +147,10 @@ namespace apache
return 0;
}
- apache::geode::client::CacheableStringPtr PdxManagedCacheableKey::toString() const
+ std::shared_ptr<apache::geode::client::CacheableString> PdxManagedCacheableKey::toString() const
{
try {
- apache::geode::client::CacheableStringPtr cStr;
+ std::shared_ptr<apache::geode::client::CacheableString> cStr;
Apache::Geode::Client::CacheableString::GetCacheableString(
m_managedptr->ToString(), cStr);
return cStr;
@@ -284,12 +284,12 @@ namespace apache
}
}
- DeltaPtr PdxManagedCacheableKey::clone()
+ std::shared_ptr<Delta> PdxManagedCacheableKey::clone()
{
try {
if (auto cloneable = dynamic_cast<ICloneable^>((Apache::Geode::Client::IGeodeDelta^) m_managedDeltaptr)) {
auto Mclone = dynamic_cast<Apache::Geode::Client::IPdxSerializable^>(cloneable->Clone());
- return DeltaPtr(static_cast<PdxManagedCacheableKey*>(SafeGenericM2UMConvert(Mclone)));
+ return std::shared_ptr<Delta>(static_cast<PdxManagedCacheableKey*>(SafeGenericM2UMConvert(Mclone)));
} else {
return Delta::clone();
}
diff --git a/clicache/src/impl/PdxManagedCacheableKey.hpp b/clicache/src/impl/PdxManagedCacheableKey.hpp
index 8a8885c..1ec7366 100644
--- a/clicache/src/impl/PdxManagedCacheableKey.hpp
+++ b/clicache/src/impl/PdxManagedCacheableKey.hpp
@@ -105,7 +105,7 @@ namespace apache
virtual bool hasDelta();
- virtual apache::geode::client::DeltaPtr clone();
+ virtual std::shared_ptr<apache::geode::client::Delta> clone();
/// <summary>
/// return the size of this object in bytes
@@ -140,7 +140,7 @@ namespace apache
/// Display this object as 'string', which depends on the implementation in
/// the managed class
/// </summary>
- virtual apache::geode::client::CacheableStringPtr toString() const;
+ virtual std::shared_ptr<apache::geode::client::CacheableString> toString() const;
/// <summary>
/// return true if this key matches other CacheableKey
diff --git a/clicache/src/impl/PersistenceManagerProxy.hpp b/clicache/src/impl/PersistenceManagerProxy.hpp
index e450c68..d98f78d 100644
--- a/clicache/src/impl/PersistenceManagerProxy.hpp
+++ b/clicache/src/impl/PersistenceManagerProxy.hpp
@@ -20,6 +20,9 @@
#include "SafeConvert.hpp"
#include "../Region.hpp"
#include "../Properties.hpp"
+#include "begin_native.hpp"
+#include <memory>
+#include "end_native.hpp"
using namespace System;
namespace Apache
{
@@ -27,16 +30,16 @@ namespace Apache
{
namespace Client
{
-
+ namespace native = apache::geode::client;
public interface class IPersistenceManagerProxy
{
public:
- void write(const CacheableKeyPtr& key, const CacheablePtr& value/*, void *& PersistenceInfo*/);
+ void write(const std::shared_ptr<native::CacheableKey>& key, const std::shared_ptr<native::Cacheable>& value/*, void *& PersistenceInfo*/);
bool writeAll();
- void init(const RegionPtr& region, const PropertiesPtr& diskProperties);
- CacheablePtr read(const CacheableKeyPtr& key/*, void *& PersistenceInfo*/);
+ void init(const std::shared_ptr<native::Region>& region, const std::shared_ptr<native::Properties>& diskProperties);
+ std::shared_ptr<native::Cacheable> read(const std::shared_ptr<native::CacheableKey>& key/*, void *& PersistenceInfo*/);
bool readAll();
- void destroy(const CacheableKeyPtr& key/*, void *& PersistenceInfo*/);
+ void destroy(const std::shared_ptr<native::CacheableKey>& key/*, void *& PersistenceInfo*/);
void close();
};
@@ -50,7 +53,7 @@ namespace Apache
{
m_persistenceManager = persistenceManager;
}
- virtual void write(const CacheableKeyPtr& key, const CacheablePtr& value/*, void *& PersistenceInfo*/)
+ virtual void write(const std::shared_ptr<native::CacheableKey>& key, const std::shared_ptr<native::Cacheable>& value/*, void *& PersistenceInfo*/)
{
TKey gKey = Serializable::GetManagedValueGeneric<TKey>(key);
TValue gValue = Serializable::GetManagedValueGeneric<TValue>(value);
@@ -62,14 +65,14 @@ namespace Apache
throw gcnew System::NotSupportedException;
}
- virtual void init(const RegionPtr& region, const PropertiesPtr& diskProperties)
+ virtual void init(const std::shared_ptr<native::Region>& region, const std::shared_ptr<native::Properties>& diskProperties)
{
auto gRegion = Region<TKey, TValue>::Create(region);
auto gProps = Properties<String^, String^>::Create(diskProperties);
m_persistenceManager->Init(gRegion, gProps);
}
- virtual CacheablePtr read(const CacheableKeyPtr& key/*, void *& PersistenceInfo*/)
+ virtual std::shared_ptr<native::Cacheable> read(const std::shared_ptr<native::CacheableKey>& key/*, void *& PersistenceInfo*/)
{
TKey gKey = Serializable::GetManagedValueGeneric<TKey>(key);
return Serializable::GetUnmanagedValueGeneric<TValue>(m_persistenceManager->Read(gKey));
@@ -80,7 +83,7 @@ namespace Apache
throw gcnew System::NotSupportedException;
}
- virtual void destroy(const CacheableKeyPtr& key/*, void *& PersistenceInfo*/)
+ virtual void destroy(const std::shared_ptr<native::CacheableKey>& key/*, void *& PersistenceInfo*/)
{
TKey gKey = Serializable::GetManagedValueGeneric<TKey>(key);
m_persistenceManager->Destroy(gKey);
diff --git a/clicache/src/impl/ResultCollectorProxy.hpp b/clicache/src/impl/ResultCollectorProxy.hpp
index 01b1b6a..da8a98a 100644
--- a/clicache/src/impl/ResultCollectorProxy.hpp
+++ b/clicache/src/impl/ResultCollectorProxy.hpp
@@ -54,7 +54,7 @@ namespace Apache
virtual void AddResult( const Object^ rs )
{
- //apache::geode::client::CacheablePtr nativeptr(rs);
+ //std::shared_ptr<apache::geode::client::Cacheable> nativeptr(rs);
//TResult grs = Serializable::GetManagedValueGeneric<TResult>( nativeptr);
m_rscoll->AddResult(safe_cast<const TResult>(rs));
}
diff --git a/clicache/src/impl/SafeConvert.hpp b/clicache/src/impl/SafeConvert.hpp
index ae1ee46..0b72dac 100644
--- a/clicache/src/impl/SafeConvert.hpp
+++ b/clicache/src/impl/SafeConvert.hpp
@@ -60,7 +60,7 @@ namespace Apache
/// to managed <see cref="IGeodeSerializable" /> object.
/// </summary>
inline static Apache::Geode::Client::IGeodeSerializable^
- SafeUMSerializableConvertGeneric(native::SerializablePtr obj)
+ SafeUMSerializableConvertGeneric(std::shared_ptr<native::Serializable> obj)
{
if (obj == nullptr) return nullptr;
@@ -138,7 +138,7 @@ namespace Apache
}
generic<class TValue>
- inline static TValue SafeGenericUMSerializableConvert( native::SerializablePtr obj )
+ inline static TValue SafeGenericUMSerializableConvert( std::shared_ptr<native::Serializable> obj )
{
if (obj == nullptr) return TValue();
@@ -220,7 +220,7 @@ namespace Apache
return SafeGenericM2UMConvert<TValue>( mg_obj );
}
- inline static IPdxSerializable^ SafeUMSerializablePDXConvert( native::SerializablePtr obj )
+ inline static IPdxSerializable^ SafeUMSerializablePDXConvert( std::shared_ptr<native::Serializable> obj )
{
if(auto mg_obj = std::dynamic_pointer_cast<native::PdxManagedCacheableKey>( obj ))
return mg_obj->ptr();
@@ -233,7 +233,7 @@ namespace Apache
/// to managed <see cref="ICacheableKey" /> object.
/// </summary>
generic<class TKey>
- inline static Client::ICacheableKey^ SafeGenericUMKeyConvert( native::CacheableKeyPtr obj )
+ inline static Client::ICacheableKey^ SafeGenericUMKeyConvert( std::shared_ptr<native::CacheableKey> obj )
{
//All cacheables will be ManagedCacheableKey only
if (obj == nullptr) return nullptr;
diff --git a/contrib/pdxautoserializer/src/impl/CPPCodeGenerator.cpp b/contrib/pdxautoserializer/src/impl/CPPCodeGenerator.cpp
index 2206003..8705495 100644
--- a/contrib/pdxautoserializer/src/impl/CPPCodeGenerator.cpp
+++ b/contrib/pdxautoserializer/src/impl/CPPCodeGenerator.cpp
@@ -220,14 +220,16 @@ void CPPCodeGenerator::startMethod(const Method::Type type,
switch (type) {
case Method::TODATA: {
- varVec.push_back("apache::geode::client::PdxWriterPtr __var");
+ varVec.push_back(
+ "std::shared_ptr<apache::geode::client::PdxWriter> __var");
genFunctionHeader("toData", className, "void", varVec, true, false,
m_cppFormatter, methodPrefix);
break;
}
case Method::FROMDATA: {
- varVec.push_back("apache::geode::client::PdxReaderPtr __var ");
+ varVec.push_back(
+ "std::shared_ptr<apache::geode::client::PdxReader> __var ");
genFunctionHeader("fromData", className, "void", varVec, true, false,
m_cppFormatter, methodPrefix);
diff --git a/cppcache/include/geode/AttributesFactory.hpp b/cppcache/include/geode/AttributesFactory.hpp
index ef05e20..22941b6 100644
--- a/cppcache/include/geode/AttributesFactory.hpp
+++ b/cppcache/include/geode/AttributesFactory.hpp
@@ -172,7 +172,7 @@ class CPPCACHE_EXPORT AttributesFactory {
* @param regionAttributes the <code>RegionAttributes</code> used to
* initialize this AttributesFactory
*/
- AttributesFactory(const RegionAttributesPtr& regionAttributes);
+ AttributesFactory(const std::shared_ptr<RegionAttributes>& regionAttributes);
/**
*@brief destructor
@@ -184,23 +184,24 @@ class CPPCACHE_EXPORT AttributesFactory {
/** Sets the cache loader for the next <code>RegionAttributes</code> created.
* @param cacheLoader the cache loader or nullptr if no loader
*/
- void setCacheLoader(const CacheLoaderPtr& cacheLoader);
+ void setCacheLoader(const std::shared_ptr<CacheLoader>& cacheLoader);
/** Sets the cache writer for the next <code>RegionAttributes</code> created.
* @param cacheWriter the cache writer or nullptr if no cache writer
*/
- void setCacheWriter(const CacheWriterPtr& cacheWriter);
+ void setCacheWriter(const std::shared_ptr<CacheWriter>& cacheWriter);
/** Sets the CacheListener for the next <code>RegionAttributes</code> created.
* @param aListener a user defined CacheListener, nullptr if no listener
*/
- void setCacheListener(const CacheListenerPtr& aListener);
+ void setCacheListener(const std::shared_ptr<CacheListener>& aListener);
/** Sets the PartitionResolver for the next <code>RegionAttributes</code>
* created.
* @param aResolver a user defined PartitionResolver, nullptr if no resolver
*/
- void setPartitionResolver(const PartitionResolverPtr& aResolver);
+ void setPartitionResolver(
+ const std::shared_ptr<PartitionResolver>& aResolver);
/**
* Sets the library path for the library that will be invoked for the loader
@@ -281,16 +282,18 @@ class CPPCACHE_EXPORT AttributesFactory {
* directly, then
* this must be used to set the PersistenceManager.
*/
- void setPersistenceManager(const char* libpath, const char* factoryFuncName,
- const PropertiesPtr& config = nullptr);
+ void setPersistenceManager(
+ const char* libpath, const char* factoryFuncName,
+ const std::shared_ptr<Properties>& config = nullptr);
/** Sets the PersistenceManager for the next <code>RegionAttributes</code>
* created.
* @param persistenceManager a user defined PersistenceManager, nullptr if no
* resolver
*/
- void setPersistenceManager(const PersistenceManagerPtr& persistenceManager,
- const PropertiesPtr& config = nullptr);
+ void setPersistenceManager(
+ const std::shared_ptr<PersistenceManager>& persistenceManager,
+ const std::shared_ptr<Properties>& config = nullptr);
public:
// DISTRIBUTION ATTRIBUTES
diff --git a/cppcache/include/geode/AttributesMutator.hpp b/cppcache/include/geode/AttributesMutator.hpp
index 485f2a8..363d271 100644
--- a/cppcache/include/geode/AttributesMutator.hpp
+++ b/cppcache/include/geode/AttributesMutator.hpp
@@ -38,7 +38,7 @@ namespace client {
class CacheListener;
class CacheLoader;
class CacheWriter;
-
+class Region;
/**
* @class AttributesMutator AttributesMutator.hpp
*
@@ -58,12 +58,12 @@ class CacheWriter;
*/
class CPPCACHE_EXPORT AttributesMutator {
private:
- RegionPtr m_region;
+ std::shared_ptr<Region> m_region;
public:
/** Internal constructor. Use Region::getAttributesMutator() to acquire the
* mutator for a region. */
- AttributesMutator(const RegionPtr& region);
+ AttributesMutator(const std::shared_ptr<Region>& region);
virtual ~AttributesMutator();
@@ -146,7 +146,7 @@ class CPPCACHE_EXPORT AttributesMutator {
* <code>aListener</code>.
* @param aListener cache listener
*/
- void setCacheListener(const CacheListenerPtr& aListener);
+ void setCacheListener(const std::shared_ptr<CacheListener>& aListener);
/** Sets cache listener for region. The previous cache listener will be
* replaced with
@@ -163,7 +163,7 @@ class CPPCACHE_EXPORT AttributesMutator {
* <code>aLoader</code>.
* @param aLoader cache loader
*/
- void setCacheLoader(const CacheLoaderPtr& aLoader);
+ void setCacheLoader(const std::shared_ptr<CacheLoader>& aLoader);
/** Sets cache loader for region. The previous cache loader will be replaced
* with
@@ -179,7 +179,7 @@ class CPPCACHE_EXPORT AttributesMutator {
* <code>aWriter</code>.
* @param aWriter cache writer
*/
- void setCacheWriter(const CacheWriterPtr& aWriter);
+ void setCacheWriter(const std::shared_ptr<CacheWriter>& aWriter);
/** Sets cache writer for region. The previous cache writer will be replaced
* with
diff --git a/cppcache/include/geode/AuthInitialize.hpp b/cppcache/include/geode/AuthInitialize.hpp
index 0978b22..0fab2da 100644
--- a/cppcache/include/geode/AuthInitialize.hpp
+++ b/cppcache/include/geode/AuthInitialize.hpp
@@ -30,7 +30,7 @@
namespace apache {
namespace geode {
namespace client {
-
+class Properties;
/**
* @class AuthInitialize AuthInitialize.hpp
* Specifies the mechanism to obtain credentials for a client.
@@ -54,8 +54,8 @@ class CPPCACHE_EXPORT AuthInitialize {
* @remarks This method can modify the given set of properties. For
* example it may invoke external agents or even interact with the user.
*/
- virtual PropertiesPtr getCredentials(const PropertiesPtr& securityprops,
- const char* server) = 0;
+ virtual std::shared_ptr<Properties> getCredentials(
+ const std::shared_ptr<Properties>& securityprops, const char* server) = 0;
/**@brief Invoked before the cache goes down. */
virtual void close() = 0;
diff --git a/cppcache/include/geode/Cache.hpp b/cppcache/include/geode/Cache.hpp
index c03d827..f7bb214 100644
--- a/cppcache/include/geode/Cache.hpp
+++ b/cppcache/include/geode/Cache.hpp
@@ -48,7 +48,7 @@ class CacheFactory;
class CacheRegionHelper;
class Pool;
class CacheImpl;
-
+class AuthInitialize;
/**
* @class Cache Cache.hpp
*
@@ -135,12 +135,12 @@ class CPPCACHE_EXPORT Cache : public GeodeCache,
* If Pool attached with Region is in multiusersecure mode then don't use
* return instance of region as no credential are attached with this instance.
* Get region from RegionService instance of Cache.@see
- * Cache#createAuthenticatedView(PropertiesPtr).
+ * Cache#createAuthenticatedView(std::shared_ptr<Properties>).
*
* @param path the region's name, such as <code>AuthRegion</code>.
* @returns region, or nullptr if no such region exists.
*/
- virtual RegionPtr getRegion(const char* path) override;
+ virtual std::shared_ptr<Region> getRegion(const char* path) override;
/**
* Returns a set of root regions in the cache. This set is a snapshot and
@@ -150,13 +150,13 @@ class CPPCACHE_EXPORT Cache : public GeodeCache,
* @param regions the returned set of
* regions
*/
- virtual VectorOfRegion rootRegions() override;
+ virtual std::vector<std::shared_ptr<Region>> rootRegions() override;
/**
* Gets the QueryService from which a new Query can be obtained.
* @returns A smart pointer to the QueryService.
*/
- virtual QueryServicePtr getQueryService() override;
+ virtual std::shared_ptr<QueryService> getQueryService() override;
/**
* Gets the QueryService from which a new Query can be obtained.
@@ -165,7 +165,7 @@ class CPPCACHE_EXPORT Cache : public GeodeCache,
* PoolManager}
* @returns A smart pointer to the QueryService.
*/
- virtual QueryServicePtr getQueryService(const char* poolName);
+ virtual std::shared_ptr<QueryService> getQueryService(const char* poolName);
/**
* Send the "client ready" message to the server from a durable client.
@@ -195,15 +195,16 @@ class CPPCACHE_EXPORT Cache : public GeodeCache,
* there are more than one Pool in Cache.
*/
- virtual RegionServicePtr createAuthenticatedView(
- PropertiesPtr userSecurityProperties, const char* poolName = nullptr);
+ virtual std::shared_ptr<RegionService> createAuthenticatedView(
+ std::shared_ptr<Properties> userSecurityProperties,
+ const char* poolName = nullptr);
/**
* Get the CacheTransactionManager instance for this Cache.
* @return The CacheTransactionManager instance.
* @throws CacheClosedException if the cache is closed.
*/
- virtual CacheTransactionManagerPtr getCacheTransactionManager();
+ virtual std::shared_ptr<CacheTransactionManager> getCacheTransactionManager();
/**
* Returns whether Cache saves unread fields for Pdx types.
@@ -226,7 +227,7 @@ class CPPCACHE_EXPORT Cache : public GeodeCache,
* @throws IllegalStateException if the className is nullptr or invalid.
* @return the factory
*/
- virtual PdxInstanceFactoryPtr createPdxInstanceFactory(
+ virtual std::shared_ptr<PdxInstanceFactory> createPdxInstanceFactory(
const char* className) override;
virtual statistics::StatisticsFactory* getStatisticsFactory() const;
@@ -246,9 +247,9 @@ class CPPCACHE_EXPORT Cache : public GeodeCache,
/**
* @brief constructors
*/
- Cache(const std::string& name, PropertiesPtr dsProp,
+ Cache(const std::string& name, std::shared_ptr<Properties> dsProp,
bool ignorePdxUnreadFields, bool readPdxSerialized,
- const AuthInitializePtr& authInitialize);
+ const std::shared_ptr<AuthInitialize>& authInitialize);
std::unique_ptr<CacheImpl> m_cacheImpl;
std::unique_ptr<TypeRegistry> m_typeRegistry;
@@ -256,7 +257,7 @@ class CPPCACHE_EXPORT Cache : public GeodeCache,
protected:
Cache() = delete;
- static bool isPoolInMultiuserMode(RegionPtr regionPtr);
+ static bool isPoolInMultiuserMode(std::shared_ptr<Region> regionPtr);
friend class CacheFactory;
friend class CacheRegionHelper;
diff --git a/cppcache/include/geode/CacheAttributes.hpp b/cppcache/include/geode/CacheAttributes.hpp
index 23ce2f6..da1cae8 100644
--- a/cppcache/include/geode/CacheAttributes.hpp
+++ b/cppcache/include/geode/CacheAttributes.hpp
@@ -51,9 +51,7 @@ namespace client {
*/
class CacheAttributesFactory;
-_GF_PTR_DEF_(CacheAttributes, CacheAttributesPtr);
-
-class CPPCACHE_EXPORT CacheAttributes {
+class CPPCACHE_EXPORT CacheAttributes {
/**
* @brief public static methods
*/
diff --git a/cppcache/include/geode/CacheFactory.hpp b/cppcache/include/geode/CacheFactory.hpp
index cc8381e..f3397af 100644
--- a/cppcache/include/geode/CacheFactory.hpp
+++ b/cppcache/include/geode/CacheFactory.hpp
@@ -39,6 +39,7 @@ namespace geode {
namespace client {
class CppCacheLibrary;
+class AuthInitialize;
/**
* @class CacheFactory CacheFactory.hpp
* Top level class for configuring and using Geode on a client.This should be
@@ -55,13 +56,13 @@ class CPPCACHE_EXPORT CacheFactory
* @param dsProps
* Properties which are applicable at client level.
*/
- static CacheFactoryPtr createCacheFactory(
- const PropertiesPtr& dsProps = nullptr);
+ static std::shared_ptr<CacheFactory> createCacheFactory(
+ const std::shared_ptr<Properties>& dsProps = nullptr);
/**
* To create the instance of {@link Cache}.
*/
- CachePtr create();
+ std::shared_ptr<Cache> create();
/** Returns the version of the cache implementation.
* For the 1.0 release of Geode, the string returned is <code>1.0</code>.
@@ -94,7 +95,7 @@ class CPPCACHE_EXPORT CacheFactory
* @return this CacheFactory
* @since 3.6
*/
- CacheFactoryPtr setPdxIgnoreUnreadFields(bool ignore);
+ std::shared_ptr<CacheFactory> setPdxIgnoreUnreadFields(bool ignore);
/**
* Sets the AuthInitializer defined by the user.
@@ -102,7 +103,7 @@ class CPPCACHE_EXPORT CacheFactory
* @param authInitialize
* @return this ClientCacheFactory
*/
- CacheFactoryPtr setAuthInitialize(const AuthInitializePtr& authInitialize);
+ std::shared_ptr<CacheFactory> setAuthInitialize(const std::shared_ptr<AuthInitialize>& authInitialize);
/** Sets the object preference to PdxInstance type.
* When a cached object that was serialized as a PDX is read
@@ -122,7 +123,7 @@ class CPPCACHE_EXPORT CacheFactory
* @param pdxReadSerialized true to prefer PdxInstance
* @return this ClientCacheFactory
*/
- CacheFactoryPtr setPdxReadSerialized(bool pdxReadSerialized);
+ std::shared_ptr<CacheFactory> setPdxReadSerialized(bool pdxReadSerialized);
/**
* Sets a geode property that will be used when creating the {link @Cache}.
@@ -131,24 +132,24 @@ class CPPCACHE_EXPORT CacheFactory
* @return a reference to <code>this</code>
* @since 3.5
*/
- CacheFactoryPtr set(const char* name, const char* value);
+ std::shared_ptr<CacheFactory> set(const char* name, const char* value);
private:
- PropertiesPtr dsProp;
+ std::shared_ptr<Properties> dsProp;
bool ignorePdxUnreadFields;
bool pdxReadSerialized;
- AuthInitializePtr authInitialize;
+ std::shared_ptr<AuthInitialize> authInitialize;
- CachePtr create(const char* name,
- const CacheAttributesPtr& attrs = nullptr);
+ std::shared_ptr<Cache> create(
+ const char* name,
+ const std::shared_ptr<CacheAttributes>& attrs = nullptr);
void create_(const char* name, const char* id_data,
- CachePtr& cptr,
- bool readPdxSerialized);
+ std::shared_ptr<Cache>& cptr, bool readPdxSerialized);
// no instances allowed
CacheFactory();
- CacheFactory(const PropertiesPtr dsProps);
+ CacheFactory(const std::shared_ptr<Properties> dsProps);
private:
~CacheFactory();
diff --git a/cppcache/include/geode/CacheListener.hpp b/cppcache/include/geode/CacheListener.hpp
index 9619d56..dd51ab9 100644
--- a/cppcache/include/geode/CacheListener.hpp
+++ b/cppcache/include/geode/CacheListener.hpp
@@ -34,7 +34,7 @@ namespace client {
class EntryEvent;
class RegionEvent;
-
+class Region;
/**
* @class CacheListener CacheListener.hpp
* An application plug-in that can be installed on a region.
@@ -184,16 +184,16 @@ class CPPCACHE_EXPORT CacheListener {
* @see Region::destroyRegion
*/
- virtual void close(const RegionPtr& region);
+ virtual void close(const std::shared_ptr<Region>& region);
/**
* Called when all the endpoints assosiated with region are down.
* This will be called when all the endpoints are down for the first time.
* If endpoints come up and again go down it will be called again.
* This will also be called when all endpoints are down and region is attached
* to the pool.
- * @param region RegionPtr denotes the assosiated region.
+ * @param region std::shared_ptr<Region> denotes the assosiated region.
*/
- virtual void afterRegionDisconnected(const RegionPtr& region);
+ virtual void afterRegionDisconnected(const std::shared_ptr<Region>& region);
protected:
/**
diff --git a/cppcache/include/geode/CacheLoader.hpp b/cppcache/include/geode/CacheLoader.hpp
index 425ed4a..044bf13 100644
--- a/cppcache/include/geode/CacheLoader.hpp
+++ b/cppcache/include/geode/CacheLoader.hpp
@@ -32,6 +32,7 @@
namespace apache {
namespace geode {
namespace client {
+class Region;
/**
* @class CacheLoader CacheLoader.hpp
@@ -67,8 +68,10 @@ class CPPCACHE_EXPORT CacheLoader {
*
*@see Region::get .
*/
- virtual CacheablePtr load(const RegionPtr& rp, const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument) = 0;
+ virtual std::shared_ptr<Cacheable> load(
+ const std::shared_ptr<Region>& rp,
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument) = 0;
/** Called when the region containing this callback is destroyed, when
* the cache is closed.
@@ -85,7 +88,7 @@ class CPPCACHE_EXPORT CacheLoader {
* @see Cache::close
* @see Region::destroyRegion
*/
- virtual void close(const RegionPtr& rp);
+ virtual void close(const std::shared_ptr<Region>& rp);
virtual ~CacheLoader();
diff --git a/cppcache/include/geode/CacheTransactionManager.hpp b/cppcache/include/geode/CacheTransactionManager.hpp
index d7ce9d8..b43175a 100644
--- a/cppcache/include/geode/CacheTransactionManager.hpp
+++ b/cppcache/include/geode/CacheTransactionManager.hpp
@@ -29,6 +29,7 @@
namespace apache {
namespace geode {
namespace client {
+class TransactionId;
class CPPCACHE_EXPORT CacheTransactionManager {
public:
@@ -90,33 +91,33 @@ class CPPCACHE_EXPORT CacheTransactionManager {
* the thread was not associated with a transaction
* @since 3.6.2
*/
- virtual TransactionIdPtr suspend() = 0;
+ virtual std::shared_ptr<TransactionId> suspend() = 0;
/**
- * On the current thread, resumes a transaction that was previously suspended
- * using {@link #suspend()}
- *
- * @param transactionId
- * the transaction to resume
- * @throws IllegalStateException
- * if the thread is associated with a transaction or if
- * {@link #isSuspended(TransactionId)} would return false for the
- * given transactionId
- * @since 3.6.2
- */
- virtual void resume(TransactionIdPtr transactionId) = 0;
+ * On the current thread, resumes a transaction that was previously suspended
+ * using {@link #suspend()}
+ *
+ * @param transactionId
+ * the transaction to resume
+ * @throws IllegalStateException
+ * if the thread is associated with a transaction or if
+ * {@link #isSuspended(TransactionId)} would return false for the
+ * given transactionId
+ * @since 3.6.2
+ */
+ virtual void resume(std::shared_ptr<TransactionId> transactionId) = 0;
/**
- * This method can be used to determine if a transaction with the given
- * transaction identifier is currently suspended locally. This method does not
- * check other members for transaction status.
- *
- * @param transactionId
- * @return true if the transaction is in suspended state, false otherwise
- * @since 3.6.2
- * @see #exists(TransactionId)
- */
- virtual bool isSuspended(TransactionIdPtr transactionId) = 0;
+ * This method can be used to determine if a transaction with the given
+ * transaction identifier is currently suspended locally. This method does not
+ * check other members for transaction status.
+ *
+ * @param transactionId
+ * @return true if the transaction is in suspended state, false otherwise
+ * @since 3.6.2
+ * @see #exists(TransactionId)
+ */
+ virtual bool isSuspended(std::shared_ptr<TransactionId> transactionId) = 0;
/**
* On the current thread, resumes a transaction that was previously suspended
@@ -135,7 +136,7 @@ class CPPCACHE_EXPORT CacheTransactionManager {
* @return true if the transaction was resumed, false otherwise
* @since 3.6.2
*/
- virtual bool tryResume(TransactionIdPtr transactionId) = 0;
+ virtual bool tryResume(std::shared_ptr<TransactionId> transactionId) = 0;
/**
* On the current thread, resumes a transaction that was previously suspended
@@ -158,7 +159,7 @@ class CPPCACHE_EXPORT CacheTransactionManager {
* @since 3.6.2
* @see #tryResume(TransactionId)
*/
- virtual bool tryResume(TransactionIdPtr transactionId,
+ virtual bool tryResume(std::shared_ptr<TransactionId> transactionId,
std::chrono::milliseconds waitTime) = 0;
/**
@@ -172,15 +173,15 @@ class CPPCACHE_EXPORT CacheTransactionManager {
* @since 3.6.2
* @see #isSuspended(TransactionId)
*/
- virtual bool exists(TransactionIdPtr transactionId) = 0;
+ virtual bool exists(std::shared_ptr<TransactionId> transactionId) = 0;
/** Returns the transaction identifier for the current thread
- *
- * @return the transaction identifier or null if no transaction exists
- *
- * @since 3.6.2
- */
- virtual TransactionIdPtr getTransactionId() = 0;
+ *
+ * @return the transaction identifier or null if no transaction exists
+ *
+ * @since 3.6.2
+ */
+ virtual std::shared_ptr<TransactionId> getTransactionId() = 0;
/** Reports the existence of a Transaction for this thread
*
diff --git a/cppcache/include/geode/CacheWriter.hpp b/cppcache/include/geode/CacheWriter.hpp
index 6451b7f..d8692ad 100644
--- a/cppcache/include/geode/CacheWriter.hpp
+++ b/cppcache/include/geode/CacheWriter.hpp
@@ -34,6 +34,7 @@ namespace client {
class EntryEvent;
class RegionEvent;
+class Region;
/**
* @class CacheWriter CacheWriter.hpp
* An application plug-in that can be installed on the region.
@@ -156,20 +157,20 @@ class CPPCACHE_EXPORT CacheWriter {
virtual bool beforeRegionDestroy(const RegionEvent& event);
/** Called when the region containing this callback is destroyed, when
- * the cache is closed.
- *
- * <p>Implementations should clean up any external
- * resources, such as database connections. Any runtime exceptions this
+ * the cache is closed.
+ *
+ * <p>Implementations should clean up any external
+ * resources, such as database connections. Any runtime exceptions this
* method
- * throws will be logged.
- *
- * <p>It is possible for this method to be called multiple times on a single
- * callback instance, so implementations must be tolerant of this.
- *
- * @see Cache::close
- * @see Region::destroyRegion
+ * throws will be logged.
+ *
+ * <p>It is possible for this method to be called multiple times on a single
+ * callback instance, so implementations must be tolerant of this.
+ *
+ * @see Cache::close
+ * @see Region::destroyRegion
*/
- virtual void close(const RegionPtr& rp);
+ virtual void close(const std::shared_ptr<Region>& rp);
virtual ~CacheWriter();
diff --git a/cppcache/include/geode/Cacheable.hpp b/cppcache/include/geode/Cacheable.hpp
index 02c7798..f914c26 100644
--- a/cppcache/include/geode/Cacheable.hpp
+++ b/cppcache/include/geode/Cacheable.hpp
@@ -23,6 +23,7 @@
/**
* @file
*/
+#include <memory>
#include "geode_globals.hpp"
#include "Serializable.hpp"
@@ -31,11 +32,11 @@ namespace apache {
namespace geode {
namespace client {
-typedef SerializablePtr CacheablePtr;
typedef Serializable Cacheable;
template <typename TVALUE>
-inline CacheablePtr createValue(const std::shared_ptr<TVALUE>& value) {
+inline std::shared_ptr<Cacheable> createValue(
+ const std::shared_ptr<TVALUE>& value) {
return std::dynamic_pointer_cast<Cacheable>(value);
}
diff --git a/cppcache/include/geode/CacheableBuiltins.hpp b/cppcache/include/geode/CacheableBuiltins.hpp
index f7a6a05..71076ae 100644
--- a/cppcache/include/geode/CacheableBuiltins.hpp
+++ b/cppcache/include/geode/CacheableBuiltins.hpp
@@ -91,7 +91,7 @@ class CacheableKeyType : public CacheableKey {
virtual int8_t typeId() const { return TYPEID; }
/** Return a string representation of the object. */
- virtual CacheableStringPtr toString() const {
+ virtual std::shared_ptr<CacheableString> toString() const {
char buffer[STRSIZE + 1];
gf_sprintf(buffer, SPRINTFSYM, m_value);
return CacheableString::create(buffer);
@@ -340,45 +340,47 @@ class CacheableContainerType : public Cacheable, public TBase {
#pragma warning(disable : 4231)
#endif
-#define _GF_CACHEABLE_KEY_TYPE_DEF_(p, k, sz) \
- extern const char tName_##k[]; \
- extern const char tStr_##k[]; \
- TEMPLATE_EXPORT \
- CacheableKeyType<p, GeodeTypeIds::k, tName_##k, tStr_##k, sz>; \
- typedef CacheableKeyType<p, GeodeTypeIds::k, tName_##k, tStr_##k, sz> _##k; \
- class CPPCACHE_EXPORT k; \
- typedef std::shared_ptr<k> k##Ptr;
+#define _GF_CACHEABLE_KEY_TYPE_DEF_(p, k, sz) \
+ extern const char tName_##k[]; \
+ extern const char tStr_##k[]; \
+ TEMPLATE_EXPORT \
+ CacheableKeyType<p, GeodeTypeIds::k, tName_##k, tStr_##k, sz>; \
+ typedef CacheableKeyType<p, GeodeTypeIds::k, tName_##k, tStr_##k, sz> _##k;
// use a class instead of typedef for bug #283
-#define _GF_CACHEABLE_KEY_TYPE_(p, k, sz) \
- class CPPCACHE_EXPORT k : public _##k { \
- protected: \
- inline k() : _##k() {} \
- inline k(const p value) : _##k(value) {} \
- FRIEND_STD_SHARED_PTR(k) \
- \
- public: \
- /** Factory function registered with serialization registry. */ \
- static Serializable* createDeserializable() { return new k(); } \
- /** Factory function to create a new default instance. */ \
- inline static k##Ptr create() { return std::make_shared<k>(); } \
- /** Factory function to create an instance with the given value. */ \
- inline static k##Ptr create(const p value) { \
- return std::make_shared<k>(value); \
- } \
- }; \
- inline CacheableKeyPtr createKey(const p value) { return k::create(value); } \
- inline CacheablePtr createValue(const p value) { return k::create(value); }
+#define _GF_CACHEABLE_KEY_TYPE_(p, k, sz) \
+ class CPPCACHE_EXPORT k : public _##k { \
+ protected: \
+ inline k() : _##k() {} \
+ inline k(const p value) : _##k(value) {} \
+ FRIEND_STD_SHARED_PTR(k) \
+ \
+ public: \
+ /** Factory function registered with serialization registry. */ \
+ static Serializable* createDeserializable() { return new k(); } \
+ /** Factory function to create a new default instance. */ \
+ inline static std::shared_ptr<k> create() { \
+ return std::make_shared<k>(); \
+ } \
+ /** Factory function to create an instance with the given value. */ \
+ inline static std::shared_ptr<k> create(const p value) { \
+ return std::make_shared<k>(value); \
+ } \
+ }; \
+ inline std::shared_ptr<CacheableKey> createKey(const p value) { \
+ return k::create(value); \
+ } \
+ inline std::shared_ptr<Cacheable> createValue(const p value) { \
+ return k::create(value); \
+ }
#define _GF_CACHEABLE_ARRAY_TYPE_DEF_(p, c) \
TEMPLATE_EXPORT CacheableArrayType<p, GeodeTypeIds::c>; \
- typedef CacheableArrayType<p, GeodeTypeIds::c> _##c; \
- class CPPCACHE_EXPORT c; \
- typedef std::shared_ptr<CacheableArrayType<p, GeodeTypeIds::c>> c##Ptr;
+ typedef CacheableArrayType<p, GeodeTypeIds::c> _##c;
// use a class instead of typedef for bug #283
#define _GF_CACHEABLE_ARRAY_TYPE_(p, c) \
- class CPPCACHE_EXPORT c : public _##c { \
+ class CPPCACHE_EXPORT c : public CacheableArrayType<p, GeodeTypeIds::c> { \
protected: \
inline c() : _##c() {} \
inline c(int32_t length) : _##c(length) {} \
@@ -397,13 +399,15 @@ class CacheableContainerType : public Cacheable, public TBase {
/** Factory function registered with serialization registry. */ \
static Serializable* createDeserializable() { return new c(); } \
/** Factory function to create a new default instance. */ \
- inline static c##Ptr create() { return std::make_shared<c>(); } \
+ inline static std::shared_ptr<c> create() { \
+ return std::make_shared<c>(); \
+ } \
/** Factory function to create a cacheable array of given size. */ \
- inline static c##Ptr create(int32_t length) { \
+ inline static std::shared_ptr<c> create(int32_t length) { \
return std::make_shared<c>(length); \
} \
/** Create a cacheable array copying from the given array. */ \
- inline static c##Ptr create(const p* value, int32_t length) { \
+ inline static std::shared_ptr<c> create(const p* value, int32_t length) { \
return nullptr == value ? nullptr \
: std::make_shared<c>(value, length, true); \
} \
@@ -415,16 +419,14 @@ class CacheableContainerType : public Cacheable, public TBase {
* 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) { \
+ inline static std::shared_ptr<c> createNoCopy(p* value, int32_t length) { \
return nullptr == value ? nullptr : std::make_shared<c>(value, length); \
} \
};
#define _GF_CACHEABLE_CONTAINER_TYPE_DEF_(p, c) \
TEMPLATE_EXPORT CacheableContainerType<p, GeodeTypeIds::c>; \
- typedef CacheableContainerType<p, GeodeTypeIds::c> _##c; \
- class CPPCACHE_EXPORT c; \
- typedef std::shared_ptr<c> c##Ptr;
+ typedef CacheableContainerType<p, GeodeTypeIds::c> _##c;
// use a class instead of typedef for bug #283
#define _GF_CACHEABLE_CONTAINER_TYPE_(p, c) \
@@ -439,9 +441,11 @@ class CacheableContainerType : public Cacheable, public TBase {
/** Factory function registered with serialization registry. */ \
static Serializable* createDeserializable() { return new c(); } \
/** Factory function to create a default instance. */ \
- inline static c##Ptr create() { return std::make_shared<c>(); } \
+ inline static std::shared_ptr<c> create() { \
+ return std::make_shared<c>(); \
+ } \
/** Factory function to create an instance with the given size. */ \
- inline static c##Ptr create(const int32_t n) { \
+ inline static std::shared_ptr<c> create(const int32_t n) { \
return std::make_shared<c>(n); \
} \
};
@@ -562,21 +566,23 @@ _GF_CACHEABLE_ARRAY_TYPE_DEF_(int64_t, CacheableInt64Array);
*/
_GF_CACHEABLE_ARRAY_TYPE_(int64_t, CacheableInt64Array);
-_GF_CACHEABLE_ARRAY_TYPE_DEF_(CacheableStringPtr, CacheableStringArray);
+_GF_CACHEABLE_ARRAY_TYPE_DEF_(std::shared_ptr<CacheableString>, CacheableStringArray);
/**
* An immutable wrapper for array of strings that can serve as
* a distributable object for caching.
*/
-_GF_CACHEABLE_ARRAY_TYPE_(CacheableStringPtr, CacheableStringArray);
+_GF_CACHEABLE_ARRAY_TYPE_(std::shared_ptr<CacheableString>,
+ CacheableStringArray);
// Instantiations for container types (Vector/HashMap/HashSet) Cacheables
-_GF_CACHEABLE_CONTAINER_TYPE_DEF_(VectorOfCacheable, CacheableVector);
+_GF_CACHEABLE_CONTAINER_TYPE_DEF_(std::vector<std::shared_ptr<Cacheable>>,
+ 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_(std::vector<std::shared_ptr<Cacheable>>, CacheableVector);
_GF_CACHEABLE_CONTAINER_TYPE_DEF_(HashMapOfCacheable, CacheableHashMap);
/**
@@ -592,27 +598,30 @@ _GF_CACHEABLE_CONTAINER_TYPE_DEF_(HashSetOfCacheableKey, CacheableHashSet);
*/
_GF_CACHEABLE_CONTAINER_TYPE_(HashSetOfCacheableKey, CacheableHashSet);
-_GF_CACHEABLE_CONTAINER_TYPE_DEF_(VectorOfCacheable, CacheableArrayList);
+_GF_CACHEABLE_CONTAINER_TYPE_DEF_(std::vector<std::shared_ptr<Cacheable>>,
+ 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_(std::vector<std::shared_ptr<Cacheable>>, CacheableArrayList);
// linketlist for JSON formattor issue
-_GF_CACHEABLE_CONTAINER_TYPE_DEF_(VectorOfCacheable, CacheableLinkedList);
+_GF_CACHEABLE_CONTAINER_TYPE_DEF_(std::vector<std::shared_ptr<Cacheable>>,
+ 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_(std::vector<std::shared_ptr<Cacheable>>, CacheableLinkedList);
-_GF_CACHEABLE_CONTAINER_TYPE_DEF_(VectorOfCacheable, CacheableStack);
+_GF_CACHEABLE_CONTAINER_TYPE_DEF_(std::vector<std::shared_ptr<Cacheable>>,
+ 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_(std::vector<std::shared_ptr<Cacheable>>, CacheableStack);
_GF_CACHEABLE_CONTAINER_TYPE_DEF_(HashMapOfCacheable, CacheableHashTable);
/**
@@ -643,12 +652,12 @@ _GF_CACHEABLE_CONTAINER_TYPE_DEF_(HashSetOfCacheableKey,
_GF_CACHEABLE_CONTAINER_TYPE_(HashSetOfCacheableKey, CacheableLinkedHashSet);
template <>
-inline CacheableKeyPtr CacheableKey::create(int32_t value) {
+inline std::shared_ptr<CacheableKey> CacheableKey::create(int32_t value) {
return CacheableInt32::create(value);
}
template <>
-inline SerializablePtr Serializable::create(int32_t value) {
+inline std::shared_ptr<Serializable> Serializable::create(int32_t value) {
return CacheableInt32::create(value);
}
diff --git a/cppcache/include/geode/CacheableDate.hpp b/cppcache/include/geode/CacheableDate.hpp
index a4a44db..1ee36ec 100644
--- a/cppcache/include/geode/CacheableDate.hpp
+++ b/cppcache/include/geode/CacheableDate.hpp
@@ -110,21 +110,23 @@ class CPPCACHE_EXPORT CacheableDate : public CacheableKey {
/**
* Factory method for creating an instance of CacheableDate
*/
- static CacheableDatePtr create() { return std::make_shared<CacheableDate>(); }
+ static std::shared_ptr<CacheableDate> create() {
+ return std::make_shared<CacheableDate>();
+ }
- static CacheableDatePtr create(const time_t& value) {
+ static std::shared_ptr<CacheableDate> create(const time_t& value) {
return std::make_shared<CacheableDate>(value);
}
- static CacheableDatePtr create(const time_point& value) {
+ static std::shared_ptr<CacheableDate> create(const time_point& value) {
return std::make_shared<CacheableDate>(value);
}
- static CacheableDatePtr create(const duration& value) {
+ static std::shared_ptr<CacheableDate> create(const duration& value) {
return std::make_shared<CacheableDate>(value);
}
- virtual CacheableStringPtr toString() const;
+ virtual std::shared_ptr<CacheableString> toString() const;
/** Destructor */
virtual ~CacheableDate();
@@ -154,11 +156,13 @@ class CPPCACHE_EXPORT CacheableDate : public CacheableKey {
FRIEND_STD_SHARED_PTR(CacheableDate)
};
-inline CacheableKeyPtr createKey(const CacheableDate::time_point& value) {
+inline std::shared_ptr<CacheableKey> createKey(
+ const CacheableDate::time_point& value) {
return CacheableDate::create(value);
}
-inline CacheablePtr createValue(const CacheableDate::time_point& value) {
+inline std::shared_ptr<Cacheable> createValue(
+ const CacheableDate::time_point& value) {
return CacheableDate::create(value);
}
diff --git a/cppcache/include/geode/CacheableEnum.hpp b/cppcache/include/geode/CacheableEnum.hpp
index e9ee088..c13bde2 100644
--- a/cppcache/include/geode/CacheableEnum.hpp
+++ b/cppcache/include/geode/CacheableEnum.hpp
@@ -43,8 +43,8 @@ namespace client {
class CPPCACHE_EXPORT CacheableEnum : public CacheableKey {
private:
- CacheableStringPtr m_enumClassName;
- CacheableStringPtr m_enumName;
+ std::shared_ptr<CacheableString> m_enumClassName;
+ std::shared_ptr<CacheableString> m_enumName;
int32_t m_ordinal;
mutable int32_t m_hashcode;
@@ -95,7 +95,7 @@ class CPPCACHE_EXPORT CacheableEnum : public CacheableKey {
/**
* Display this object as c string.
*/
- virtual CacheableStringPtr toString() const {
+ virtual std::shared_ptr<CacheableString> toString() const {
return CacheableString::create("CacheableEnum");
}
@@ -109,8 +109,9 @@ class CPPCACHE_EXPORT CacheableEnum : public CacheableKey {
* enum type.
* @return a {@link CacheableEnum} representing C++ enum.
*/
- static CacheableEnumPtr create(const char* enumClassName,
- const char* enumName, int32_t ordinal) {
+ static std::shared_ptr<CacheableEnum> create(const char* enumClassName,
+ const char* enumName,
+ int32_t ordinal) {
return std::make_shared<CacheableEnum>(enumClassName, enumName, ordinal);
}
diff --git a/cppcache/include/geode/CacheableFileName.hpp b/cppcache/include/geode/CacheableFileName.hpp
index bab3e52..5b1a0ef 100644
--- a/cppcache/include/geode/CacheableFileName.hpp
+++ b/cppcache/include/geode/CacheableFileName.hpp
@@ -75,8 +75,9 @@ class CPPCACHE_EXPORT CacheableFileName : public CacheableString {
* Factory method for creating an instance of CacheableFileName from a
* C string optionally given the length.
*/
- static CacheableFileNamePtr create(const char* value, int32_t len = 0) {
- CacheableFileNamePtr str = nullptr;
+ static std::shared_ptr<CacheableFileName> create(const char* value,
+ int32_t len = 0) {
+ std::shared_ptr<CacheableFileName> str = nullptr;
if (value != nullptr) {
str = std::make_shared<CacheableFileName>();
str->initString(value, len);
@@ -88,8 +89,9 @@ class CPPCACHE_EXPORT CacheableFileName : public CacheableString {
* Factory method for creating an instance of CacheableFileName from a
* wide-character C string optionally given the length.
*/
- static CacheableFileNamePtr create(const wchar_t* value, int32_t len = 0) {
- CacheableFileNamePtr str = nullptr;
+ static std::shared_ptr<CacheableFileName> create(const wchar_t* value,
+ int32_t len = 0) {
+ std::shared_ptr<CacheableFileName> str = nullptr;
if (value != nullptr) {
str = std::make_shared<CacheableFileName>();
str->initString(value, len);
diff --git a/cppcache/include/geode/CacheableKey.hpp b/cppcache/include/geode/CacheableKey.hpp
index a081c45..1a00fba 100644
--- a/cppcache/include/geode/CacheableKey.hpp
+++ b/cppcache/include/geode/CacheableKey.hpp
@@ -71,7 +71,7 @@ class CPPCACHE_EXPORT CacheableKey : public Cacheable {
* the method apache::geode::client::createKeyArr may be overloaded.
*/
template <class PRIM>
- inline static CacheableKeyPtr create(const PRIM value);
+ inline static std::shared_ptr<CacheableKey> create(const PRIM value);
struct hash {
inline std::size_t operator()(const CacheableKey& s) const {
diff --git a/cppcache/include/geode/CacheableObjectArray.hpp b/cppcache/include/geode/CacheableObjectArray.hpp
index 2c86604..63e171d 100644
--- a/cppcache/include/geode/CacheableObjectArray.hpp
+++ b/cppcache/include/geode/CacheableObjectArray.hpp
@@ -19,11 +19,12 @@
#ifndef GEODE_CACHEABLEOBJECTARRAY_H_
#define GEODE_CACHEABLEOBJECTARRAY_H_
+#include <vector>
+#include <memory>
#include "geode_globals.hpp"
#include "geode_types.hpp"
-#include "VectorT.hpp"
-
+#include "Cacheable.hpp"
/** @file
*/
@@ -35,8 +36,9 @@ namespace client {
* Implement an immutable Vector of <code>Cacheable</code> objects
* that can serve as a distributable object for caching.
*/
-class CPPCACHE_EXPORT CacheableObjectArray : public Cacheable,
- public VectorOfCacheable {
+class CPPCACHE_EXPORT CacheableObjectArray
+ : public Cacheable,
+ public std::vector<std::shared_ptr<Cacheable>> {
public:
/**
*@brief serialize this object
@@ -72,7 +74,7 @@ class CPPCACHE_EXPORT CacheableObjectArray : public Cacheable,
/**
* Factory method for creating the default instance of CacheableObjectArray.
*/
- inline static CacheableObjectArrayPtr create() {
+ inline static std::shared_ptr<CacheableObjectArray> create() {
return std::make_shared<CacheableObjectArray>();
}
@@ -80,7 +82,7 @@ class CPPCACHE_EXPORT CacheableObjectArray : public Cacheable,
* Factory method for creating an instance of CacheableObjectArray with
* given size.
*/
- inline static CacheableObjectArrayPtr create(int32_t n) {
+ inline static std::shared_ptr<CacheableObjectArray> create(int32_t n) {
return std::make_shared<CacheableObjectArray>(n);
}
@@ -88,9 +90,9 @@ class CPPCACHE_EXPORT CacheableObjectArray : public Cacheable,
protected:
/** Constructor, used for deserialization. */
- inline CacheableObjectArray() : VectorOfCacheable() {}
+ inline CacheableObjectArray() : std::vector<std::shared_ptr<Cacheable>>() {}
/** Create a vector with n elements allocated. */
- inline CacheableObjectArray(int32_t n) : VectorOfCacheable(n) {}
+ inline CacheableObjectArray(int32_t n) : std::vector<std::shared_ptr<Cacheable>>(n) {}
private:
// never implemented.
diff --git a/cppcache/include/geode/CacheableString.hpp b/cppcache/include/geode/CacheableString.hpp
index 8ebf023..d1d9fc3 100644
--- a/cppcache/include/geode/CacheableString.hpp
+++ b/cppcache/include/geode/CacheableString.hpp
@@ -112,12 +112,13 @@ class CPPCACHE_EXPORT CacheableString : public CacheableKey {
*
* This should be used only for ASCII strings.
*/
- static CacheableStringPtr create(const char* value, int32_t len = 0) {
+ static std::shared_ptr<CacheableString> create(const char* value,
+ int32_t len = 0) {
if (nullptr == value) {
return nullptr;
}
- CacheableStringPtr str = std::make_shared<CacheableString>();
+ auto str = std::make_shared<CacheableString>();
str->initString(value, len);
return str;
}
@@ -132,12 +133,13 @@ class CPPCACHE_EXPORT CacheableString : public CacheableKey {
*
* CAUTION: use this only when you really know what you are doing.
*/
- static CacheableStringPtr createNoCopy(char* value, int32_t len = 0) {
+ static std::shared_ptr<CacheableString> createNoCopy(char* value,
+ int32_t len = 0) {
if (nullptr == value) {
return nullptr;
}
- CacheableStringPtr str = std::make_shared<CacheableString>();
+ auto str = std::make_shared<CacheableString>();
str->initStringNoCopy(value, len);
return str;
}
@@ -148,12 +150,13 @@ class CPPCACHE_EXPORT CacheableString : public CacheableKey {
*
* This should be used for non-ASCII strings.
*/
- static CacheableStringPtr create(const wchar_t* value, int32_t len = 0) {
+ static std::shared_ptr<CacheableString> create(const wchar_t* value,
+ int32_t len = 0) {
if (nullptr == value) {
return nullptr;
}
- CacheableStringPtr str = std::make_shared<CacheableString>();
+ auto str = std::make_shared<CacheableString>();
str->initString(value, len);
return str;
}
@@ -168,12 +171,13 @@ class CPPCACHE_EXPORT CacheableString : public CacheableKey {
*
* CAUTION: use this only when you really know what you are doing.
*/
- static CacheableStringPtr createNoCopy(wchar_t* value, int32_t len = 0) {
+ static std::shared_ptr<CacheableString> createNoCopy(wchar_t* value,
+ int32_t len = 0) {
if (nullptr == value) {
return nullptr;
}
- CacheableStringPtr str = std::make_shared<CacheableString>();
+ auto str = std::make_shared<CacheableString>();
str->initStringNoCopy(value, len);
return str;
}
@@ -240,7 +244,7 @@ class CPPCACHE_EXPORT CacheableString : public CacheableKey {
*/
const char* toString() { return reinterpret_cast<const char*>(m_str); }
- virtual CacheableStringPtr toString() const {
+ virtual std::shared_ptr<CacheableString> toString() const {
// TODO this cast seems odd
return std::const_pointer_cast<CacheableString>(
std::static_pointer_cast<const CacheableString>(shared_from_this()));
@@ -289,47 +293,48 @@ class CPPCACHE_EXPORT CacheableString : public CacheableKey {
};
/** overload of apache::geode::client::createKeyArr to pass char* */
-inline CacheableKeyPtr createKeyArr(const char* value) {
+inline std::shared_ptr<CacheableKey> createKeyArr(const char* value) {
return CacheableString::create(value);
}
/** overload of apache::geode::client::createKeyArr to pass wchar_t* */
-inline CacheableKeyPtr createKeyArr(const wchar_t* value) {
+inline std::shared_ptr<CacheableKey> createKeyArr(const wchar_t* value) {
return CacheableString::create(value);
}
/** overload of apache::geode::client::createValueArr to pass char* */
-inline CacheablePtr createValueArr(const char* value) {
+inline std::shared_ptr<Cacheable> createValueArr(const char* value) {
return CacheableString::create(value);
}
/** overload of apache::geode::client::createValueArr to pass wchar_t* */
-inline CacheablePtr createValueArr(const wchar_t* value) {
+inline std::shared_ptr<Cacheable> createValueArr(const wchar_t* value) {
return CacheableString::create(value);
}
template <typename TVALUE>
-inline CacheablePtr createValue(const TVALUE* value) {
+inline std::shared_ptr<Cacheable> createValue(const TVALUE* value) {
return CacheableString::create(value);
}
template <class TKEY>
-inline CacheableKeyPtr createKey(const std::shared_ptr<TKEY>& value) {
- return CacheableKeyPtr(value);
+inline std::shared_ptr<CacheableKey> createKey(
+ const std::shared_ptr<TKEY>& value) {
+ return std::shared_ptr<CacheableKey>(value);
}
template <typename TKEY>
-inline CacheableKeyPtr createKey(const TKEY* value) {
+inline std::shared_ptr<CacheableKey> createKey(const TKEY* value) {
return createKeyArr(value);
}
template <class PRIM>
-inline CacheableKeyPtr CacheableKey::create(const PRIM value) {
+inline std::shared_ptr<CacheableKey> CacheableKey::create(const PRIM value) {
return createKey(value);
}
template <class PRIM>
-inline SerializablePtr Serializable::create(const PRIM value) {
+inline std::shared_ptr<Serializable> Serializable::create(const PRIM value) {
return createKey(value);
}
diff --git a/cppcache/include/geode/CacheableUndefined.hpp b/cppcache/include/geode/CacheableUndefined.hpp
index b287298..1dd7e78 100644
--- a/cppcache/include/geode/CacheableUndefined.hpp
+++ b/cppcache/include/geode/CacheableUndefined.hpp
@@ -76,7 +76,7 @@ class CPPCACHE_EXPORT CacheableUndefined : public Cacheable {
/**
* Factory method for creating the default instance of CacheableUndefined.
*/
- inline static CacheableUndefinedPtr create() {
+ inline static std::shared_ptr<CacheableUndefined> create() {
return std::make_shared<CacheableUndefined>();
}
diff --git a/cppcache/include/geode/CqAttributes.hpp b/cppcache/include/geode/CqAttributes.hpp
index b4bbf07..bbf15b9 100644
--- a/cppcache/include/geode/CqAttributes.hpp
+++ b/cppcache/include/geode/CqAttributes.hpp
@@ -55,7 +55,8 @@ class CPPCACHE_EXPORT CqAttributes {
* Get the CqListeners set with the CQ.
* Returns all the Listeners associated with this CQ.
* @see CqListener
- * @param[out] std::vector<CqListenerPtr> of CqListnerPtr
+ * @param[out] std::vector<std::shared_ptr<CqListener>> of
+ * std::shared_ptr<CqListner>
*/
virtual listener_container_type getCqListeners() = 0;
};
diff --git a/cppcache/include/geode/CqAttributesFactory.hpp b/cppcache/include/geode/CqAttributesFactory.hpp
index ce97d43..48f1dcb 100644
--- a/cppcache/include/geode/CqAttributesFactory.hpp
+++ b/cppcache/include/geode/CqAttributesFactory.hpp
@@ -70,14 +70,14 @@ class CPPCACHE_EXPORT CqAttributesFactory {
* the <code>CqAttributes</code> used to initialize this
* AttributesFactory
*/
- CqAttributesFactory(const CqAttributesPtr& cqAttributes);
+ CqAttributesFactory(const std::shared_ptr<CqAttributes>& cqAttributes);
/**
* Adds a CQ listener to the end of the list of cq listeners on this factory.
* @param cqListener the CqListener to add to the factory.
* @throws IllegalArgumentException if <code>cqListener</code> is nullptr
*/
- void addCqListener(const CqListenerPtr& cqListener);
+ void addCqListener(const std::shared_ptr<CqListener>& cqListener);
/**
* Removes all Cq listeners and then adds each listener in the specified
@@ -88,16 +88,17 @@ class CPPCACHE_EXPORT CqAttributesFactory {
* a
* nullptr element
*/
- void initCqListeners(const std::vector<CqListenerPtr>& cqListeners);
+ void initCqListeners(
+ const std::vector<std::shared_ptr<CqListener>>& cqListeners);
/**
* Creates a <code>CqAttributes</code> with the current settings.
* @return the newly created <code>CqAttributes</code>
*/
- CqAttributesPtr create();
+ std::shared_ptr<CqAttributes> create();
private:
- CqAttributesPtr m_cqAttributes;
+ std::shared_ptr<CqAttributes> m_cqAttributes;
};
} // namespace client
} // namespace geode
diff --git a/cppcache/include/geode/CqAttributesMutator.hpp b/cppcache/include/geode/CqAttributesMutator.hpp
index 9f910f4..badfdd2 100644
--- a/cppcache/include/geode/CqAttributesMutator.hpp
+++ b/cppcache/include/geode/CqAttributesMutator.hpp
@@ -22,8 +22,7 @@
#include "geode_globals.hpp"
#include "geode_types.hpp"
-#include "VectorT.hpp"
-
+#include <vector>
/**
* @file
*/
@@ -31,7 +30,7 @@
namespace apache {
namespace geode {
namespace client {
-
+class CqListener;
/**
* @class CqAttributesMutator CqAttributesMutator.hpp
*
@@ -47,7 +46,7 @@ class CPPCACHE_EXPORT CqAttributesMutator {
* @param aListener the user defined CQ listener to add to the CqQuery.
* @throws IllegalArgumentException if <code>aListener</code> is nullptr
*/
- virtual void addCqListener(const CqListenerPtr& aListener) = 0;
+ virtual void addCqListener(const std::shared_ptr<CqListener>& aListener) = 0;
/**
* Removes given CQ listener from the list of CQ listeners on this CqQuery.
@@ -57,7 +56,7 @@ class CPPCACHE_EXPORT CqAttributesMutator {
* @param aListener the CQ listener to remove from the CqQuery.
* @throws IllegalArgumentException if <code>aListener</code> is nullptr
*/
- virtual void removeCqListener(const CqListenerPtr& aListener) = 0;
+ virtual void removeCqListener(const std::shared_ptr<CqListener>& aListener) = 0;
/**
* Adds the given set CqListner on this CQ. If the CQ already has CqListeners,
@@ -69,7 +68,7 @@ class CPPCACHE_EXPORT CqAttributesMutator {
* has a nullptr element
*/
virtual void setCqListeners(
- const std::vector<CqListenerPtr>& newListeners) = 0;
+ const std::vector<std::shared_ptr<CqListener>>& newListeners) = 0;
};
} // namespace client
} // namespace geode
diff --git a/cppcache/include/geode/CqEvent.hpp b/cppcache/include/geode/CqEvent.hpp
index 283e0f3..cd71e77 100644
--- a/cppcache/include/geode/CqEvent.hpp
+++ b/cppcache/include/geode/CqEvent.hpp
@@ -35,7 +35,7 @@
namespace apache {
namespace geode {
namespace client {
-
+class CqQuery;
/**
* @class CqEvent CqEvent.hpp
*
@@ -61,7 +61,7 @@ class CPPCACHE_EXPORT CqEvent {
* @see CqQuery
* @return CqQuery object.
*/
- virtual CqQueryPtr getCq() const = 0;
+ virtual std::shared_ptr<CqQuery> getCq() const = 0;
/**
* Get the operation on the base region that triggered this event.
@@ -82,7 +82,7 @@ class CPPCACHE_EXPORT CqEvent {
* nullptr.
* @return Object key.
*/
- virtual CacheableKeyPtr getKey() const = 0;
+ virtual std::shared_ptr<CacheableKey> getKey() const = 0;
/**
* Get the new value of the modification.
@@ -90,7 +90,7 @@ class CPPCACHE_EXPORT CqEvent {
* operation.
* @return Object new/modified value.
*/
- virtual CacheablePtr getNewValue() const = 0;
+ virtual std::shared_ptr<Cacheable> getNewValue() const = 0;
/**
* Get the delta modification.
@@ -98,7 +98,7 @@ class CPPCACHE_EXPORT CqEvent {
*
* @return CacheableBytes delta value.
*/
- virtual CacheableBytesPtr getDeltaValue() const = 0;
+ virtual std::shared_ptr<CacheableBytes> getDeltaValue() const = 0;
private:
CqEvent(const CqEvent&);
diff --git a/cppcache/include/geode/CqListener.hpp b/cppcache/include/geode/CqListener.hpp
index 409c06e..0f46639 100644
--- a/cppcache/include/geode/CqListener.hpp
+++ b/cppcache/include/geode/CqListener.hpp
@@ -31,7 +31,7 @@
namespace apache {
namespace geode {
namespace client {
-
+class CacheListener;
/**
* @cacheserver
* Querying is only supported for native clients.
diff --git a/cppcache/include/geode/CqQuery.hpp b/cppcache/include/geode/CqQuery.hpp
index ccdf97d..3b335d7 100644
--- a/cppcache/include/geode/CqQuery.hpp
+++ b/cppcache/include/geode/CqQuery.hpp
@@ -38,6 +38,7 @@
namespace apache {
namespace geode {
namespace client {
+class Query;
/**
* @class CqQuery CqQuery.hpp
@@ -64,7 +65,7 @@ class CPPCACHE_EXPORT CqQuery {
* Get teh query object generated for this CQs query.
* @return Query object fort he query string
*/
- virtual QueryPtr getQuery() const = 0;
+ virtual std::shared_ptr<Query> getQuery() const = 0;
/**
* Get the name of the CQ.
* @return the name of the CQ.
@@ -74,17 +75,17 @@ class CPPCACHE_EXPORT CqQuery {
* Get the statistics information of this CQ.
* @return CqStatistics, the CqStatistics object.
*/
- virtual const CqStatisticsPtr getStatistics() const = 0;
+ virtual const std::shared_ptr<CqStatistics> getStatistics() const = 0;
/**
* Get the Attributes of this CQ.
* @return CqAttributes, the CqAttributes object.
*/
- virtual const CqAttributesPtr getCqAttributes() const = 0;
+ virtual const std::shared_ptr<CqAttributes> getCqAttributes() const = 0;
/**
* Get the AttributesMutator of this CQ.
* @return CqAttributesMutator, the CqAttributesMutator object.
*/
- virtual const CqAttributesMutatorPtr getCqAttributesMutator() const = 0;
+ virtual const std::shared_ptr<CqAttributesMutator> getCqAttributesMutator() const = 0;
/**
* Start executing the CQ or if this CQ is stopped earlier, resumes execution
@@ -105,7 +106,7 @@ class CPPCACHE_EXPORT CqQuery {
* @throws CqException if failed to execute and get initial results.
* @return CqResults resultset obtained by executing the query.
*/
- virtual CqResultsPtr executeWithInitialResults(
+ virtual std::shared_ptr<CqResults> executeWithInitialResults(
std::chrono::milliseconds timeout = DEFAULT_QUERY_RESPONSE_TIMEOUT) = 0;
/**
diff --git a/cppcache/include/geode/DataInput.hpp b/cppcache/include/geode/DataInput.hpp
index 4638487..61c7846 100644
--- a/cppcache/include/geode/DataInput.hpp
+++ b/cppcache/include/geode/DataInput.hpp
@@ -537,7 +537,7 @@ class CPPCACHE_EXPORT DataInput {
template <class PTR>
inline std::shared_ptr<PTR> readObject(
bool throwOnError = DINP_THROWONERROR_DEFAULT) {
- SerializablePtr sPtr = readObjectInternal();
+ auto sPtr = readObjectInternal();
if (throwOnError) {
return std::dynamic_pointer_cast<PTR>(sPtr);
} else {
@@ -556,31 +556,31 @@ class CPPCACHE_EXPORT DataInput {
return readInt32();
}
- inline CacheableStringPtr readNativeString() {
- CacheableStringPtr csPtr;
+ inline std::shared_ptr<CacheableString> readNativeString() {
+ std::shared_ptr<CacheableString> csPtr;
const int64_t compId = read();
if (compId == GeodeTypeIds::NullObj) {
csPtr = nullptr;
} else if (compId == GeodeTypeIds::CacheableNullString) {
- csPtr = CacheableStringPtr(dynamic_cast<CacheableString*>(
+ csPtr = std::shared_ptr<CacheableString>(dynamic_cast<CacheableString*>(
CacheableString::createDeserializable()));
} else if (compId ==
apache::geode::client::GeodeTypeIds::CacheableASCIIString) {
- csPtr = CacheableStringPtr(dynamic_cast<CacheableString*>(
+ csPtr = std::shared_ptr<CacheableString>(dynamic_cast<CacheableString*>(
CacheableString::createDeserializable()));
csPtr->fromData(*this);
} else if (compId ==
apache::geode::client::GeodeTypeIds::CacheableASCIIStringHuge) {
- csPtr = CacheableStringPtr(dynamic_cast<CacheableString*>(
+ csPtr = std::shared_ptr<CacheableString>(dynamic_cast<CacheableString*>(
CacheableString::createDeserializableHuge()));
csPtr->fromData(*this);
} else if (compId == apache::geode::client::GeodeTypeIds::CacheableString) {
- csPtr = CacheableStringPtr(dynamic_cast<CacheableString*>(
+ csPtr = std::shared_ptr<CacheableString>(dynamic_cast<CacheableString*>(
CacheableString::createUTFDeserializable()));
csPtr->fromData(*this);
} else if (compId ==
apache::geode::client::GeodeTypeIds::CacheableStringHuge) {
- csPtr = CacheableStringPtr(dynamic_cast<CacheableString*>(
+ csPtr = std::shared_ptr<CacheableString>(dynamic_cast<CacheableString*>(
CacheableString::createUTFDeserializableHuge()));
csPtr->fromData(*this);
} else {
@@ -591,7 +591,7 @@ class CPPCACHE_EXPORT DataInput {
return csPtr;
}
- inline SerializablePtr readDirectObject(int8_t typeId = -1) {
+ inline std::shared_ptr<Serializable> readDirectObject(int8_t typeId = -1) {
return readObjectInternal(typeId);
}
@@ -599,7 +599,9 @@ class CPPCACHE_EXPORT DataInput {
* Read a <code>Serializable</code> object from the <code>DataInput</code>.
* Null objects are handled.
*/
- inline void readObject(SerializablePtr& ptr) { ptr = readObjectInternal(); }
+ inline void readObject(std::shared_ptr<Serializable>& ptr) {
+ ptr = readObjectInternal();
+ }
inline void readObject(wchar_t* value) {
uint16_t temp = readInt16();
@@ -899,7 +901,7 @@ class CPPCACHE_EXPORT DataInput {
const char* m_poolName;
const Cache* m_cache;
- SerializablePtr readObjectInternal(int8_t typeId = -1);
+ std::shared_ptr<Serializable> readObjectInternal(int8_t typeId = -1);
template <typename mType>
void readObject(mType** value, int32_t& length) {
diff --git a/cppcache/include/geode/DataOutput.hpp b/cppcache/include/geode/DataOutput.hpp
index fa04bf5..20dba2d 100644
--- a/cppcache/include/geode/DataOutput.hpp
+++ b/cppcache/include/geode/DataOutput.hpp
@@ -307,7 +307,7 @@ class CPPCACHE_EXPORT DataOutput {
// create cacheable string
// write typeid id.
// call todata
- CacheableStringPtr csPtr = CacheableString::create(value);
+ auto csPtr = CacheableString::create(value);
write(csPtr->typeId());
csPtr->toData(*this);
}
diff --git a/cppcache/include/geode/DefaultResultCollector.hpp b/cppcache/include/geode/DefaultResultCollector.hpp
index a9d93f6..8a4a4a0 100644
--- a/cppcache/include/geode/DefaultResultCollector.hpp
+++ b/cppcache/include/geode/DefaultResultCollector.hpp
@@ -28,7 +28,6 @@
#include "geode_globals.hpp"
#include "geode_types.hpp"
-#include "VectorT.hpp"
#include "CacheableBuiltins.hpp"
#include "ResultCollector.hpp"
@@ -45,18 +44,18 @@ class CPPCACHE_EXPORT DefaultResultCollector : public ResultCollector {
DefaultResultCollector();
virtual ~DefaultResultCollector() noexcept;
- virtual CacheableVectorPtr getResult(
+ virtual std::shared_ptr<CacheableVector> getResult(
std::chrono::milliseconds timeout =
DEFAULT_QUERY_RESPONSE_TIMEOUT) override;
- virtual void addResult(const CacheablePtr& resultOfSingleExecution) override;
+ virtual void addResult(const std::shared_ptr<Cacheable>& resultOfSingleExecution) override;
virtual void endResults() override;
virtual void clearResults() override;
private:
- CacheableVectorPtr resultList;
+ std::shared_ptr<CacheableVector> resultList;
bool ready;
std::condition_variable readyCondition;
std::mutex readyMutex;
diff --git a/cppcache/include/geode/Delta.hpp b/cppcache/include/geode/Delta.hpp
index 8b9f8dc..da6da6b 100644
--- a/cppcache/include/geode/Delta.hpp
+++ b/cppcache/include/geode/Delta.hpp
@@ -43,16 +43,16 @@ namespace client {
* of the class.
*/
-class Delta {
+class CPPCACHE_EXPORT Delta {
public:
/**
* <code>hasDelta( )</code> is invoked by Geode during <code>Region::put(
- * CacheableKeyPtr, CacheablePtr )</code> to determine if the object contains
- * a delta.
- * If <code>hasDelta( )</code> returns true, the delta in the object is
- * serialized by invoking <code>Delta::toDelta( DataOutput& )</code>.
- * If <code>hasDelta( )</code> returns false, the object is serialized by
- * invoking <code>Cacheable::toData( DataOutput& )</code>.
+ * std::shared_ptr<CacheableKey>, std::shared_ptr<Cacheable> )</code> to
+ * determine if the object contains a delta. If <code>hasDelta( )</code>
+ * returns true, the delta in the object is serialized by invoking
+ * <code>Delta::toDelta( DataOutput& )</code>. If <code>hasDelta( )</code>
+ * returns false, the object is serialized by invoking
+ * <code>Cacheable::toData( DataOutput& )</code>.
*/
virtual bool hasDelta() = 0;
@@ -88,7 +88,7 @@ class Delta {
* a buffer, then deserializing from the buffer thus creating a clone of the
* original.
*/
- virtual DeltaPtr clone();
+ virtual std::shared_ptr<Delta> clone();
virtual ~Delta() {}
diff --git a/cppcache/include/geode/DistributedSystem.hpp b/cppcache/include/geode/DistributedSystem.hpp
index b547e6e..0366629 100644
--- a/cppcache/include/geode/DistributedSystem.hpp
+++ b/cppcache/include/geode/DistributedSystem.hpp
@@ -29,7 +29,6 @@
#include "geode_types.hpp"
#include "ExceptionTypes.hpp"
#include "Properties.hpp"
-#include "VectorT.hpp"
namespace apache {
namespace geode {
@@ -67,7 +66,7 @@ class CPPCACHE_EXPORT DistributedSystem {
**/
static std::unique_ptr<DistributedSystem> create(
const std::string& name, Cache* cache,
- const PropertiesPtr& configPtr = nullptr);
+ const std::shared_ptr<Properties>& configPtr = nullptr);
/**
* @brief connects from the distributed system
diff --git a/cppcache/include/geode/EntryEvent.hpp b/cppcache/include/geode/EntryEvent.hpp
index b38edc3..6abeffd 100644
--- a/cppcache/include/geode/EntryEvent.hpp
+++ b/cppcache/include/geode/EntryEvent.hpp
@@ -35,19 +35,22 @@ namespace client {
* the circumstances of the event. */
class CPPCACHE_EXPORT EntryEvent {
protected:
- RegionPtr m_region; /**< Region */
- CacheableKeyPtr m_key; /**< Cacheable key */
- CacheablePtr m_oldValue; /**< Old value */
- CacheablePtr m_newValue; /**< New value */
- SerializablePtr
+ std::shared_ptr<Region> m_region; /**< Region */
+ std::shared_ptr<CacheableKey> m_key; /**< Cacheable key */
+ std::shared_ptr<Cacheable> m_oldValue; /**< Old value */
+ std::shared_ptr<Cacheable> m_newValue; /**< New value */
+ std::shared_ptr<Serializable>
m_callbackArgument; /**< Callback argument for this event, if any. */
bool m_remoteOrigin; /**< True if from a remote (non-local) process */
public:
/** Constructor, given all values. */
- EntryEvent(const RegionPtr& region, const CacheableKeyPtr& key,
- const CacheablePtr& oldValue, const CacheablePtr& newValue,
- const SerializablePtr& aCallbackArgument, const bool remoteOrigin);
+ EntryEvent(const std::shared_ptr<Region>& region,
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& oldValue,
+ const std::shared_ptr<Cacheable>& newValue,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ const bool remoteOrigin);
/** Destructor. */
virtual ~EntryEvent();
@@ -56,29 +59,31 @@ class CPPCACHE_EXPORT EntryEvent {
EntryEvent();
/** @return the region this event occurred in. */
- inline RegionPtr getRegion() const { return m_region; }
+ inline std::shared_ptr<Region> getRegion() const { return m_region; }
/** @return the key this event describes. */
- inline CacheableKeyPtr getKey() const { return m_key; }
+ inline std::shared_ptr<CacheableKey> getKey() const { return m_key; }
/** If the prior state of the entry was invalid, or non-existent/destroyed,
* then the old value will be nullptr.
* @return the old value in the cache.
*/
- inline CacheablePtr getOldValue() const { return m_oldValue; }
+ inline std::shared_ptr<Cacheable> getOldValue() const { return m_oldValue; }
/** If the event is a destroy or invalidate operation, then the new value
* will be nullptr.
* @return the updated value from this event
*/
- inline CacheablePtr getNewValue() const { return m_newValue; }
+ inline std::shared_ptr<Cacheable> getNewValue() const { return m_newValue; }
/**
* Returns the callbackArgument passed to the method that generated
* this event. See the {@link Region} interface methods that take
* a callbackArgument parameter.
*/
- inline SerializablePtr getCallbackArgument() const { return m_callbackArgument; }
+ inline std::shared_ptr<Serializable> getCallbackArgument() const {
+ return m_callbackArgument;
+ }
/** If the event originated in a remote process, returns true. */
inline bool remoteOrigin() const { return m_remoteOrigin; }
diff --git a/cppcache/include/geode/Exception.hpp b/cppcache/include/geode/Exception.hpp
index c94e030..a2618e8 100644
--- a/cppcache/include/geode/Exception.hpp
+++ b/cppcache/include/geode/Exception.hpp
@@ -35,11 +35,9 @@ namespace client {
#define GF_EX_MSG_LIMIT 2048
-class Exception;
-typedef std::shared_ptr<Exception> ExceptionPtr;
-
class DistributedSystem;
-
+class CacheableString;
+class StackTrace;
/**
* @class Exception Exception.hpp
* A description of an exception that occurred during a cache operation.
@@ -58,7 +56,7 @@ class CPPCACHE_EXPORT Exception {
* retrieved using <code>getCause</code>
**/
Exception(const char* msg1, const char* msg2 = nullptr,
- bool forceTrace = false, const ExceptionPtr& cause = nullptr);
+ bool forceTrace = false, const std::shared_ptr<Exception>& cause = nullptr);
explicit Exception(const std::string& msg1);
@@ -108,18 +106,19 @@ class CPPCACHE_EXPORT Exception {
*/
virtual void raise() { throw *this; }
- inline ExceptionPtr getCause() const { return m_cause; }
+ inline std::shared_ptr<Exception> getCause() const { return m_cause; }
protected:
/** internal constructor used to clone this exception */
- Exception(const CacheableStringPtr& message, const StackTracePtr& stack,
- const ExceptionPtr& cause);
+ Exception(const std::shared_ptr<CacheableString>& message,
+ const std::shared_ptr<StackTrace>& stack,
+ const std::shared_ptr<Exception>& cause);
static bool s_exceptionStackTraceEnabled;
- CacheableStringPtr m_message; // error message
- StackTracePtr m_stack;
- ExceptionPtr m_cause;
+ std::shared_ptr<CacheableString> m_message; // error message
+ std::shared_ptr<StackTrace> m_stack;
+ std::shared_ptr<Exception> m_cause;
private:
static void setStackTraces(bool stackTraceEnabled);
diff --git a/cppcache/include/geode/ExceptionTypes.hpp b/cppcache/include/geode/ExceptionTypes.hpp
index d7a0989..2dd5ddd 100644
--- a/cppcache/include/geode/ExceptionTypes.hpp
+++ b/cppcache/include/geode/ExceptionTypes.hpp
@@ -25,16 +25,17 @@
*/
#include "geode_globals.hpp"
-#include "Exception.hpp"
-
+#include "geode/Exception.hpp"
+#include <memory>
namespace apache {
namespace geode {
namespace client {
+class StackTrace;
+class CacheableString;
#define _GF_EXCEPTION_DEF(x) \
const char _exception_name_##x[] = "apache::geode::client::" #x; \
class x; \
- typedef std::shared_ptr<x> x##Ptr; \
class CPPCACHE_EXPORT x : public apache::geode::client::Exception { \
public: \
using Exception::Exception; \
@@ -43,11 +44,12 @@ namespace client {
} \
virtual ~x() {} \
virtual const char* getName() const { return _exception_name_##x; } \
- virtual void raise() { throw *this; } \
+ virtual void raise() { throw * this; } \
\
protected: \
- x(const CacheableStringPtr& message, const StackTracePtr& stack, \
- const ExceptionPtr& cause) \
+ x(const std::shared_ptr<CacheableString>& message, \
+ const std::shared_ptr<StackTrace>& stack, \
+ const std::shared_ptr<Exception>& cause) \
: Exception(message, stack, cause) {} \
\
private: \
diff --git a/cppcache/include/geode/Execution.hpp b/cppcache/include/geode/Execution.hpp
index 935c679..f82a60a 100644
--- a/cppcache/include/geode/Execution.hpp
+++ b/cppcache/include/geode/Execution.hpp
@@ -25,7 +25,6 @@
#include "geode_globals.hpp"
#include "geode_types.hpp"
-#include "VectorT.hpp"
#include "CacheableBuiltins.hpp"
#include "ResultCollector.hpp"
@@ -59,7 +58,7 @@ class CPPCACHE_EXPORT Execution {
* @throws UnsupportedOperationException if not called after
* FunctionService::onRegion(Region).
*/
- virtual ExecutionPtr withFilter(CacheableVectorPtr routingObj) = 0;
+ virtual std::shared_ptr<Execution> withFilter(std::shared_ptr<CacheableVector> routingObj) = 0;
/**
* Specifies the user data passed to the function when it is executed.
* @param args user data passed to the function execution
@@ -67,7 +66,7 @@ class CPPCACHE_EXPORT Execution {
* @throws IllegalArgumentException if the input parameter is nullptr
*
*/
- virtual ExecutionPtr withArgs(CacheablePtr args) = 0;
+ virtual std::shared_ptr<Execution> withArgs(std::shared_ptr<Cacheable> args) = 0;
/**
* Specifies the {@link ResultCollector} that will receive the results after
* the function has been executed.
@@ -75,7 +74,7 @@ class CPPCACHE_EXPORT Execution {
* @throws IllegalArgumentException if {@link ResultCollector} is nullptr
* @see ResultCollector
*/
- virtual ExecutionPtr withCollector(ResultCollectorPtr rs) = 0;
+ virtual std::shared_ptr<Execution> withCollector(std::shared_ptr<ResultCollector> rs) = 0;
/**
* Executes the function using its name
* <p>
@@ -85,7 +84,7 @@ class CPPCACHE_EXPORT Execution {
* @return either a default result collector or one specified by {@link
* #withCollector(ResultCollector)}
*/
- virtual ResultCollectorPtr execute(
+ virtual std::shared_ptr<ResultCollector> execute(
const char* func,
std::chrono::milliseconds timeout = DEFAULT_QUERY_RESPONSE_TIMEOUT) = 0;
@@ -104,10 +103,11 @@ class CPPCACHE_EXPORT Execution {
* @return either a default result collector or one specified by {@link
* #withCollector(ResultCollector)}
*/
- virtual ResultCollectorPtr execute(const CacheableVectorPtr& routingObj,
- const CacheablePtr& args,
- const ResultCollectorPtr& rs,
- const char* func, std::chrono::milliseconds timeout) = 0;
+ virtual std::shared_ptr<ResultCollector> execute(
+ const std::shared_ptr<CacheableVector>& routingObj,
+ const std::shared_ptr<Cacheable>& args,
+ const std::shared_ptr<ResultCollector>& rs, const char* func,
+ std::chrono::milliseconds timeout) = 0;
};
} // namespace client
diff --git a/cppcache/include/geode/FixedPartitionResolver.hpp b/cppcache/include/geode/FixedPartitionResolver.hpp
index 23f9d4a..e6519b5 100644
--- a/cppcache/include/geode/FixedPartitionResolver.hpp
+++ b/cppcache/include/geode/FixedPartitionResolver.hpp
@@ -35,7 +35,7 @@ class EntryEvent;
* <p>
* Geode uses the partition name returned by
* {@link FixedPartitionResolver#getPartitionName(EntryEvent,
- * CacheableHashSetPtr)}
+ * std::shared_ptr<CacheableHashSet>)}
* to determine on which member the data is being managed. Say, for example, you
* want to
* partition all Trades according to quarters. You can implement
@@ -45,7 +45,7 @@ class EntryEvent;
*
* public class QuarterPartitionResolver implements FixedPartitionResolver{<br>
*     public const char* getPartitionName(EntryEvent event,
- * CacheableHashSetPtr
+ * std::shared_ptr<CacheableHashSet>
* allAvailablePartitions) {<br>
*     Date date = sdf.parse((String)opDetails.getKey());<br>
*     Calendar cal = Calendar.getInstance();<br>
diff --git a/cppcache/include/geode/FunctionService.hpp b/cppcache/include/geode/FunctionService.hpp
index 8041eff..c33286d 100644
--- a/cppcache/include/geode/FunctionService.hpp
+++ b/cppcache/include/geode/FunctionService.hpp
@@ -31,7 +31,9 @@
namespace apache {
namespace geode {
namespace client {
-
+class Region;
+class Pool;
+class RegionService;
/**
* @class FunctionService FunctionService.hpp
* entry point for function execution
@@ -57,7 +59,7 @@ class CPPCACHE_EXPORT FunctionService {
* @throws NullPointerException
* if the region passed in is nullptr
*/
- static ExecutionPtr onRegion(const RegionPtr& region);
+ static std::shared_ptr<Execution> onRegion(const std::shared_ptr<Region>& region);
/**
* Returns a {@link Execution} object that can be used to execute a data
@@ -72,7 +74,7 @@ class CPPCACHE_EXPORT FunctionService {
* @throws UnsupportedOperationException
* if Pool is in multiusersecure Mode
*/
- inline static ExecutionPtr onServer(const PoolPtr& pool) {
+ inline static std::shared_ptr<Execution> onServer(const std::shared_ptr<Pool>& pool) {
return onServerWithPool(pool);
}
@@ -90,7 +92,7 @@ class CPPCACHE_EXPORT FunctionService {
* @throws UnsupportedOperationException
* if Pool is in multiusersecure Mode
*/
- inline static ExecutionPtr onServer(const RegionServicePtr& cache) {
+ inline static std::shared_ptr<Execution> onServer(const std::shared_ptr<RegionService>& cache) {
return onServerWithCache(cache);
}
@@ -107,7 +109,7 @@ class CPPCACHE_EXPORT FunctionService {
* @throws UnsupportedOperationException
* if Pool is in multiusersecure Mode
*/
- inline static ExecutionPtr onServers(const PoolPtr& pool) {
+ inline static std::shared_ptr<Execution> onServers(const std::shared_ptr<Pool>& pool) {
return onServersWithPool(pool);
}
@@ -125,20 +127,23 @@ class CPPCACHE_EXPORT FunctionService {
* @throws UnsupportedOperationException
* if Pool is in multiusersecure Mode
*/
- inline static ExecutionPtr onServers(const RegionServicePtr& cache) {
+ inline static std::shared_ptr<Execution> onServers(const std::shared_ptr<RegionService>& cache) {
return onServersWithCache(cache);
}
virtual ~FunctionService() {}
private:
- static ExecutionPtr onServerWithPool(const PoolPtr& pool);
+ static std::shared_ptr<Execution> onServerWithPool(
+ const std::shared_ptr<Pool>& pool);
- static ExecutionPtr onServerWithCache(const RegionServicePtr& cache);
+ static std::shared_ptr<Execution> onServerWithCache(
+ const std::shared_ptr<RegionService>& cache);
- static ExecutionPtr onServersWithPool(const PoolPtr& pool);
+ static std::shared_ptr<Execution> onServersWithPool(
+ const std::shared_ptr<Pool>& pool);
- static ExecutionPtr onServersWithCache(const RegionServicePtr& cache);
+ static std::shared_ptr<Execution> onServersWithCache(const std::shared_ptr<RegionService>& cache);
};
} // namespace client
} // namespace geode
diff --git a/cppcache/include/geode/GeodeCppCache.hpp b/cppcache/include/geode/GeodeCppCache.hpp
deleted file mode 100644
index 59fe70d..0000000
--- a/cppcache/include/geode/GeodeCppCache.hpp
+++ /dev/null
@@ -1,84 +0,0 @@
-#pragma once
-
-#ifndef GEODE_GEODECPPCACHE_H_
-#define GEODE_GEODECPPCACHE_H_
-
-/*
- * 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.
- */
-
-/**
- * @file
- */
-
-#include "geode_globals.hpp"
-#include "Cacheable.hpp"
-#include "CacheableKey.hpp"
-#include "CacheableBuiltins.hpp"
-#include "CacheableDate.hpp"
-#include "CacheableFileName.hpp"
-#include "CacheableObjectArray.hpp"
-#include "CacheableString.hpp"
-#include "CacheableUndefined.hpp"
-#include "CacheFactory.hpp"
-#include "Cache.hpp"
-#include "GeodeCache.hpp"
-#include "CacheAttributes.hpp"
-#include "CacheStatistics.hpp"
-#include "CqAttributesFactory.hpp"
-#include "CqAttributes.hpp"
-#include "CqListener.hpp"
-#include "CqQuery.hpp"
-#include "CqServiceStatistics.hpp"
-#include "DataInput.hpp"
-#include "DataOutput.hpp"
-#include "Delta.hpp"
-#include "DistributedSystem.hpp"
-#include "EntryEvent.hpp"
-#include "Exception.hpp"
-#include "ExceptionTypes.hpp"
-#include "Execution.hpp"
-#include "ExpirationAction.hpp"
-#include "ExpirationAttributes.hpp"
-#include "FunctionService.hpp"
-#include "HashMapT.hpp"
-#include "HashSetT.hpp"
-#include "Query.hpp"
-#include "QueryService.hpp"
-#include "RegionEvent.hpp"
-#include "Region.hpp"
-#include "Pool.hpp"
-#include "PoolManager.hpp"
-#include "PoolFactory.hpp"
-#include "RegionService.hpp"
-#include "ResultCollector.hpp"
-#include "ResultSet.hpp"
-#include "Serializable.hpp"
-#include <memory>
-#include "StructSet.hpp"
-#include "VectorT.hpp"
-#include "TransactionId.hpp"
-#include "UserFunctionExecutionException.hpp"
-#include "PdxInstanceFactory.hpp"
-#include "PdxInstance.hpp"
-#include "WritablePdxInstance.hpp"
-#include "PdxWrapper.hpp"
-#include "PdxSerializer.hpp"
-#include "CacheableEnum.hpp"
-#include "CqStatusListener.hpp"
-#include "PdxFieldTypes.hpp"
-
-#endif // GEODE_GEODECPPCACHE_H_
diff --git a/cppcache/include/geode/HashFunction.hpp b/cppcache/include/geode/HashFunction.hpp
index 7abd2f8..8f41a69 100644
--- a/cppcache/include/geode/HashFunction.hpp
+++ b/cppcache/include/geode/HashFunction.hpp
@@ -32,10 +32,11 @@ namespace geode {
namespace client {
/** typedef for the hash function used by the hashing schemes. */
-typedef int32_t (*Hasher)(const SharedBasePtr&);
+typedef int32_t (*Hasher)(const std::shared_ptr<SharedBase>&);
/** typedef for the hashing key equality function. */
-typedef bool (*EqualTo)(const SharedBasePtr&, const SharedBasePtr&);
+typedef bool (*EqualTo)(const std::shared_ptr<SharedBase>&,
+ const std::shared_ptr<SharedBase>&);
class HashSB {
private:
@@ -47,7 +48,9 @@ class HashSB {
public:
HashSB(const Hasher hashFn) : m_hashFn(hashFn) {}
- int32_t operator()(const SharedBasePtr& p) const { return m_hashFn(p); }
+ int32_t operator()(const std::shared_ptr<SharedBase>& p) const {
+ return m_hashFn(p);
+ }
};
class EqualToSB {
@@ -60,7 +63,8 @@ class EqualToSB {
public:
EqualToSB(const EqualTo equalFn) : m_equalFn(equalFn) {}
- bool operator()(const SharedBasePtr& x, const SharedBasePtr& y) const {
+ bool operator()(const std::shared_ptr<SharedBase>& x,
+ const std::shared_ptr<SharedBase>& y) const {
return m_equalFn(x, y);
}
};
diff --git a/cppcache/include/geode/HashMapT.hpp b/cppcache/include/geode/HashMapT.hpp
index 8e32261..685268a 100644
--- a/cppcache/include/geode/HashMapT.hpp
+++ b/cppcache/include/geode/HashMapT.hpp
@@ -33,17 +33,17 @@ namespace apache {
namespace geode {
namespace client {
-typedef std::unordered_map<CacheableKeyPtr, CacheablePtr,
- dereference_hash<CacheableKeyPtr>,
- dereference_equal_to<CacheableKeyPtr>>
+typedef std::unordered_map<std::shared_ptr<CacheableKey>,
+ std::shared_ptr<Cacheable>,
+ dereference_hash<std::shared_ptr<CacheableKey>>,
+ dereference_equal_to<std::shared_ptr<CacheableKey>>>
HashMapOfCacheable;
-typedef std::shared_ptr<HashMapOfCacheable> HashMapOfCacheablePtr;
-typedef std::unordered_map<CacheableKeyPtr, ExceptionPtr,
- dereference_hash<CacheableKeyPtr>,
- dereference_equal_to<CacheableKeyPtr>>
+typedef std::unordered_map<std::shared_ptr<CacheableKey>,
+ std::shared_ptr<Exception>,
+ dereference_hash<std::shared_ptr<CacheableKey>>,
+ dereference_equal_to<std::shared_ptr<CacheableKey>>>
HashMapOfException;
-typedef std::shared_ptr<HashMapOfException> HashMapOfExceptionPtr;
} // namespace client
} // namespace geode
diff --git a/cppcache/include/geode/HashSetT.hpp b/cppcache/include/geode/HashSetT.hpp
index 488cebb..3e7f24c 100644
--- a/cppcache/include/geode/HashSetT.hpp
+++ b/cppcache/include/geode/HashSetT.hpp
@@ -31,10 +31,10 @@ namespace apache {
namespace geode {
namespace client {
-typedef std::unordered_set<CacheableKeyPtr, dereference_hash<CacheableKeyPtr>,
- dereference_equal_to<CacheableKeyPtr>>
+typedef std::unordered_set<std::shared_ptr<CacheableKey>,
+ dereference_hash<std::shared_ptr<CacheableKey>>,
+ dereference_equal_to<std::shared_ptr<CacheableKey>>>
HashSetOfCacheableKey;
-typedef std::shared_ptr<HashSetOfCacheableKey> HashSetOfCacheableKeyPtr;
} // namespace client
} // namespace geode
diff --git a/cppcache/include/geode/PartitionResolver.hpp b/cppcache/include/geode/PartitionResolver.hpp
index 3a4f1b6..8b07704 100644
--- a/cppcache/include/geode/PartitionResolver.hpp
+++ b/cppcache/include/geode/PartitionResolver.hpp
@@ -29,7 +29,7 @@ namespace geode {
namespace client {
class EntryEvent;
-
+class CacheableKey;
/**
* Implementers of interface <code>PartitionResolver</code> enable custom
* partitioning on the <code>PartitionedRegion</code>.
@@ -90,7 +90,8 @@ class CPPCACHE_EXPORT PartitionResolver {
* @return object associated with entry event which allows the Partitioned
* Region to store associated data together
*/
- virtual CacheableKeyPtr getRoutingObject(const EntryEvent& opDetails) = 0;
+ virtual std::shared_ptr<CacheableKey> getRoutingObject(
+ const EntryEvent& opDetails) = 0;
protected:
/**
diff --git a/cppcache/include/geode/PdxInstance.hpp b/cppcache/include/geode/PdxInstance.hpp
index e8dc9fa..26935a6 100644
--- a/cppcache/include/geode/PdxInstance.hpp
+++ b/cppcache/include/geode/PdxInstance.hpp
@@ -27,7 +27,9 @@
namespace apache {
namespace geode {
namespace client {
-
+class WritablePdxInstance;
+class CacheableDate;
+class CacheableObjectArray;
/**
* PdxInstance provides run time access to the fields of a PDX without
* deserializing the PDX. Preventing deserialization saves time
@@ -61,7 +63,7 @@ class CPPCACHE_EXPORT PdxInstance : public PdxSerializable {
*
* @see serializationRegistry->addPdxType
*/
- virtual PdxSerializablePtr getObject() = 0;
+ virtual std::shared_ptr<PdxSerializable> getObject() = 0;
/**
* Checks if the named field exists and returns the result.
@@ -74,10 +76,12 @@ class CPPCACHE_EXPORT PdxInstance : public PdxSerializable {
virtual bool hasField(const char* fieldname) = 0;
/**
- * Reads the named field and set its value in CacheablePtr type out param.
- * CacheablePtr type is corresponding to java object type.
+ * Reads the named field and set its value in std::shared_ptr<Cacheable> type
+ * out param. std::shared_ptr<Cacheable> type is corresponding to java object
+ * type.
* @param fieldname name of the field to read
- * @param value value of the field to be set with CacheablePtr type.
+ * @param value value of the field to be set with std::shared_ptr<Cacheable>
+ * type.
* @throws IllegalStateException if PdxInstance doesn't has the named field.
* For deserialization C++ Native Client requires the domain class to be
* registered.
@@ -85,7 +89,7 @@ class CPPCACHE_EXPORT PdxInstance : public PdxSerializable {
* @see serializationRegistry->addPdxType
* @see PdxInstance#hasField
*/
- virtual CacheablePtr getCacheableField(const char* fieldname) const = 0;
+ virtual std::shared_ptr<Cacheable> getCacheableField(const char* fieldname) const = 0;
/**
* Reads the named field and set its value in bool type out param.
@@ -360,15 +364,17 @@ class CPPCACHE_EXPORT PdxInstance : public PdxSerializable {
int32_t& length) const = 0;
/**
- * Reads the named field and set its value in CacheableDatePtr type out param.
- * CacheableDatePtr type is corresponding to java Java.util.date type.
+ * Reads the named field and set its value in std::shared_ptr<CacheableDate>
+ * type out param. std::shared_ptr<CacheableDate> type is corresponding to
+ * java Java.util.date type.
* @param fieldname name of the field to read
- * @param value value of the field to be set with CacheableDatePtr type.
+ * @param value value of the field to be set with
+ * std::shared_ptr<CacheableDate> type.
* @throws IllegalStateException if PdxInstance doesn't has the named field.
*
* @see PdxInstance#hasField
*/
- virtual CacheableDatePtr getCacheableDateField(
+ virtual std::shared_ptr<CacheableDate> getCacheableDateField(
const char* fieldname) const = 0;
/**
@@ -388,20 +394,20 @@ class CPPCACHE_EXPORT PdxInstance : public PdxSerializable {
int32_t*& elementLength) const = 0;
/**
- * Reads the named field and set its value in CacheableObjectArrayPtr type out
- * param.
- * For deserialization C++ Native Client requires the domain class to be
- * registered.
- * CacheableObjectArrayPtr type is corresponding to java Object[] type.
+ * Reads the named field and set its value in
+ * std::shared_ptr<CacheableObjectArray> type out param. For deserialization
+ * C++ Native Client requires the domain class to be registered.
+ * std::shared_ptr<CacheableObjectArray> type is corresponding to java
+ * Object[] type.
* @param fieldname name of the field to read.
- * @param value value of the field to be set with CacheableObjectArrayPtr
- * type.
+ * @param value value of the field to be set with
+ * std::shared_ptr<CacheableObjectArray> type.
* @throws IllegalStateException if PdxInstance doesn't has the named field.
*
* @see serializationRegistry->addPdxType
* @see PdxInstance#hasField
*/
- virtual CacheableObjectArrayPtr getCacheableObjectArrayField(
+ virtual std::shared_ptr<CacheableObjectArray> getCacheableObjectArrayField(
const char* fieldname) const = 0;
/**
@@ -424,7 +430,7 @@ class CPPCACHE_EXPORT PdxInstance : public PdxSerializable {
* made to the returned value will not modify this PdxInstance.
* @return a {@link WritablePdxInstance}
*/
- virtual WritablePdxInstancePtr createWriter() = 0;
+ virtual std::shared_ptr<WritablePdxInstance> createWriter() = 0;
/**
* Generates a hashcode based on the identity fields of
@@ -457,7 +463,7 @@ class CPPCACHE_EXPORT PdxInstance : public PdxSerializable {
*
* @see serializationRegistry->addPdxType
*/
- virtual CacheableStringPtr toString() const = 0;
+ virtual std::shared_ptr<CacheableString> toString() const = 0;
/**
* @brief serialize this object. This is an internal method.
@@ -528,7 +534,7 @@ class CPPCACHE_EXPORT PdxInstance : public PdxSerializable {
* Return an unmodifiable list of the field names on this PdxInstance.
* @return an unmodifiable list of the field names on this PdxInstance
*/
- virtual CacheableStringArrayPtr getFieldNames() = 0;
+ virtual std::shared_ptr<CacheableStringArray> getFieldNames() = 0;
// From PdxSerializable
/**
@@ -536,13 +542,13 @@ class CPPCACHE_EXPORT PdxInstance : public PdxSerializable {
* method.
* @param PdxWriter to serialize the PDX object
*/
- virtual void toData(PdxWriterPtr output) = 0;
+ virtual void toData(std::shared_ptr<PdxWriter> output) = 0;
/**
* @brief Deserialize this object. This is an internal method.
* @param PdxReader to Deserialize the PDX object
*/
- virtual void fromData(PdxReaderPtr input) = 0;
+ virtual void fromData(std::shared_ptr<PdxReader> input) = 0;
/**
* Return the full name of the class that this pdx instance represents.
diff --git a/cppcache/include/geode/PdxInstanceFactory.hpp b/cppcache/include/geode/PdxInstanceFactory.hpp
index b7928aa..2f1e0bf 100644
--- a/cppcache/include/geode/PdxInstanceFactory.hpp
+++ b/cppcache/include/geode/PdxInstanceFactory.hpp
@@ -80,8 +80,8 @@ class CPPCACHE_EXPORT PdxInstanceFactory {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeChar(const char* fieldName,
- char16_t value) = 0;
+ virtual std::shared_ptr<PdxInstanceFactory> writeChar(const char* fieldName,
+ char16_t value) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -93,8 +93,8 @@ class CPPCACHE_EXPORT PdxInstanceFactory {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeChar(const char* fieldName,
- char value) = 0;
+ virtual std::shared_ptr<PdxInstanceFactory> writeChar(const char* fieldName,
+ char value) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -106,8 +106,8 @@ class CPPCACHE_EXPORT PdxInstanceFactory {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeBoolean(const char* fieldName,
- bool value) = 0;
+ virtual std::shared_ptr<PdxInstanceFactory> writeBoolean(
+ const char* fieldName, bool value) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -119,8 +119,8 @@ class CPPCACHE_EXPORT PdxInstanceFactory {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeByte(const char* fieldName,
- int8_t value) = 0;
+ virtual std::shared_ptr<PdxInstanceFactory> writeByte(const char* fieldName,
+ int8_t value) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -132,8 +132,8 @@ class CPPCACHE_EXPORT PdxInstanceFactory {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeShort(const char* fieldName,
- int16_t value) = 0;
+ virtual std::shared_ptr<PdxInstanceFactory> writeShort(const char* fieldName,
+ int16_t value) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -145,8 +145,8 @@ class CPPCACHE_EXPORT PdxInstanceFactory {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeInt(const char* fieldName,
- int32_t value) = 0;
+ virtual std::shared_ptr<PdxInstanceFactory> writeInt(const char* fieldName,
+ int32_t value) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -158,8 +158,8 @@ class CPPCACHE_EXPORT PdxInstanceFactory {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeLong(const char* fieldName,
- int64_t value) = 0;
+ virtual std::shared_ptr<PdxInstanceFactory> writeLong(const char* fieldName,
+ int64_t value) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -171,8 +171,8 @@ class CPPCACHE_EXPORT PdxInstanceFactory {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeFloat(const char* fieldName,
- float value) = 0;
+ virtual std::shared_ptr<PdxInstanceFactory> writeFloat(const char* fieldName,
+ float value) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -184,21 +184,21 @@ class CPPCACHE_EXPORT PdxInstanceFactory {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeDouble(const char* fieldName,
- double value) = 0;
+ virtual std::shared_ptr<PdxInstanceFactory> writeDouble(const char* fieldName,
+ double value) = 0;
/**
* Writes the named field with the given value to the serialized form.
* The fields type is <code>CacheableDatePtr</code>.
- * <p>Java Date is mapped to C++ CacheableDatePtr.</p>
+ * <p>Java Date is mapped to C++ std::shared_ptr<CacheableDate>.</p>
* @param fieldName the name of the field to write
* @param value the value of the field to write
* @return this PdxInstanceFactory
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeDate(const char* fieldName,
- CacheableDatePtr value) = 0;
+ virtual std::shared_ptr<PdxInstanceFactory> writeDate(
+ const char* fieldName, std::shared_ptr<CacheableDate> value) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -210,8 +210,8 @@ class CPPCACHE_EXPORT PdxInstanceFactory {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeWideString(const char* fieldName,
- const wchar_t* value) = 0;
+ virtual std::shared_ptr<PdxInstanceFactory> writeWideString(
+ const char* fieldName, const wchar_t* value) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -223,13 +223,13 @@ class CPPCACHE_EXPORT PdxInstanceFactory {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeString(const char* fieldName,
- const char* value) = 0;
+ virtual std::shared_ptr<PdxInstanceFactory> writeString(
+ const char* fieldName, const char* value) = 0;
/**
* Writes the named field with the given value to the serialized form.
* The fields type is <code>CacheablePtr</code>.
- * <p>Java object is mapped to C++ CacheablePtr.</p>
+ * <p>Java object is mapped to C++ std::shared_ptr<Cacheable>.</p>
* It is best to use one of the other writeXXX methods if your field type
* will always be XXX. This method allows the field value to be anything
* that is an instance of Object. This gives you more flexibility but more
@@ -243,8 +243,8 @@ class CPPCACHE_EXPORT PdxInstanceFactory {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeObject(const char* fieldName,
- CacheablePtr value) = 0;
+ virtual std::shared_ptr<PdxInstanceFactory> writeObject(
+ const char* fieldName, std::shared_ptr<Cacheable> value) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -257,9 +257,8 @@ class CPPCACHE_EXPORT PdxInstanceFactory {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeBooleanArray(const char* fieldName,
- bool* value,
- int32_t length) = 0;
+ virtual std::shared_ptr<PdxInstanceFactory> writeBooleanArray(
+ const char* fieldName, bool* value, int32_t length) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -272,9 +271,8 @@ class CPPCACHE_EXPORT PdxInstanceFactory {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeWideCharArray(const char* fieldName,
- wchar_t* value,
- int32_t length) = 0;
+ virtual std::shared_ptr<PdxInstanceFactory> writeWideCharArray(
+ const char* fieldName, wchar_t* value, int32_t length) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -287,8 +285,8 @@ class CPPCACHE_EXPORT PdxInstanceFactory {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeCharArray(const char* fieldName,
- char* value, int32_t length) = 0;
+ virtual std::shared_ptr<PdxInstanceFactory> writeCharArray(
+ const char* fieldName, char* value, int32_t length) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -301,9 +299,8 @@ class CPPCACHE_EXPORT PdxInstanceFactory {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeByteArray(const char* fieldName,
- int8_t* value,
- int32_t length) = 0;
+ virtual std::shared_ptr<PdxInstanceFactory> writeByteArray(
+ const char* fieldName, int8_t* value, int32_t length) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -316,9 +313,8 @@ class CPPCACHE_EXPORT PdxInstanceFactory {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeShortArray(const char* fieldName,
- int16_t* value,
- int32_t length) = 0;
+ virtual std::shared_ptr<PdxInstanceFactory> writeShortArray(
+ const char* fieldName, int16_t* value, int32_t length) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -331,9 +327,8 @@ class CPPCACHE_EXPORT PdxInstanceFactory {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeIntArray(const char* fieldName,
- int32_t* value,
- int32_t length) = 0;
+ virtual std::shared_ptr<PdxInstanceFactory> writeIntArray(
+ const char* fieldName, int32_t* value, int32_t length) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -346,9 +341,8 @@ class CPPCACHE_EXPORT PdxInstanceFactory {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeLongArray(const char* fieldName,
- int64_t* value,
- int32_t length) = 0;
+ virtual std::shared_ptr<PdxInstanceFactory> writeLongArray(
+ const char* fieldName, int64_t* value, int32_t length) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -361,9 +355,8 @@ class CPPCACHE_EXPORT PdxInstanceFactory {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeFloatArray(const char* fieldName,
- float* value,
- int32_t length) = 0;
+ virtual std::shared_ptr<PdxInstanceFactory> writeFloatArray(
+ const char* fieldName, float* value, int32_t length) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -376,9 +369,8 @@ class CPPCACHE_EXPORT PdxInstanceFactory {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeDoubleArray(const char* fieldName,
- double* value,
- int32_t length) = 0;
+ virtual std::shared_ptr<PdxInstanceFactory> writeDoubleArray(
+ const char* fieldName, double* value, int32_t length) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -391,9 +383,8 @@ class CPPCACHE_EXPORT PdxInstanceFactory {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeStringArray(const char* fieldName,
- char** value,
- int32_t length) = 0;
+ virtual std::shared_ptr<PdxInstanceFactory> writeStringArray(
+ const char* fieldName, char** value, int32_t length) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -406,14 +397,13 @@ class CPPCACHE_EXPORT PdxInstanceFactory {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeWideStringArray(const char* fieldName,
- wchar_t** value,
- int32_t length) = 0;
+ virtual std::shared_ptr<PdxInstanceFactory> writeWideStringArray(
+ const char* fieldName, wchar_t** value, int32_t length) = 0;
/**
* Writes the named field with the given value to the serialized form.
* The fields type is <code>CacheableObjectArrayPtr</code>.
- * Java Object[] is mapped to C++ CacheableObjectArrayPtr.
+ * Java Object[] is mapped to C++ std::shared_ptr<CacheableObjectArray>.
* For how each element of the array is a mapped to C++ see {@link
* #writeObject}.
* Note that this call may serialize elements that are not compatible with
@@ -424,8 +414,8 @@ class CPPCACHE_EXPORT PdxInstanceFactory {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeObjectArray(
- const char* fieldName, CacheableObjectArrayPtr value) = 0;
+ virtual std::shared_ptr<PdxInstanceFactory> writeObjectArray(
+ const char* fieldName, std::shared_ptr<CacheableObjectArray> value) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -440,7 +430,7 @@ class CPPCACHE_EXPORT PdxInstanceFactory {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeArrayOfByteArrays(
+ virtual std::shared_ptr<PdxInstanceFactory> writeArrayOfByteArrays(
const char* fieldName, int8_t** value, int32_t arrayLength,
int32_t* elementLength) = 0;
@@ -467,7 +457,8 @@ class CPPCACHE_EXPORT PdxInstanceFactory {
* @return this PdxInstanceFactory
* @throws IllegalStateException if the named field does not exist.
*/
- virtual PdxInstanceFactoryPtr markIdentityField(const char* fieldName) = 0;
+ virtual std::shared_ptr<PdxInstanceFactory> markIdentityField(
+ const char* fieldName) = 0;
};
} // namespace client
} // namespace geode
diff --git a/cppcache/include/geode/PdxReader.hpp b/cppcache/include/geode/PdxReader.hpp
index 8fc763c..d86a86e 100644
--- a/cppcache/include/geode/PdxReader.hpp
+++ b/cppcache/include/geode/PdxReader.hpp
@@ -28,8 +28,8 @@ namespace geode {
namespace client {
class PdxReader;
-typedef std::shared_ptr<PdxReader> PdxReaderPtr;
-
+class CacheableObjectArray;
+class CacheableDate;
/**
* A PdxReader will be passed to PdxSerializable.fromData or
* during deserialization of a PDX. The domain class needs to deserialize field
@@ -42,7 +42,7 @@ typedef std::shared_ptr<PdxReader> PdxReaderPtr;
*
* @note Implementations of PdxReader that are internal to the Native
* Client library may be returned to clients via instances of
- * PdxReaderPtr. For those implementations, any
+ * std::shared_ptr<PdxReader>. For those implementations, any
* non-<tt>nullptr</tt>, non-empty strings returned from
* PdxReader::readString() or PdxReader::readWideString() must
* be freed with DataInput::freeUTFMemory(). Arrays returned
@@ -189,15 +189,15 @@ class CPPCACHE_EXPORT PdxReader {
virtual wchar_t* readWideString(const char* fieldName) = 0;
/**
- * Read a CacheablePtr value from the <code>PdxReader</code>.
- * <p>C++ CacheablePtr is mapped to Java object</p>
+ * Read a std::shared_ptr<Cacheable> value from the <code>PdxReader</code>.
+ * <p>C++ std::shared_ptr<Cacheable> is mapped to Java object</p>
* @param fieldName name of the field to read
- * @return value of type CacheablePtr.
+ * @return value of type std::shared_ptr<Cacheable>.
* @throws IllegalStateException if PdxReader doesn't has the named field.
*
* @see PdxReader#hasField
*/
- virtual CacheablePtr readObject(const char* fieldName) = 0;
+ virtual std::shared_ptr<Cacheable> readObject(const char* fieldName) = 0;
/**
* Read a char* value from the <code>PdxReader</code> and sets array length.
@@ -340,15 +340,17 @@ class CPPCACHE_EXPORT PdxReader {
int32_t& length) = 0;
/**
- * Read a CacheableObjectArrayPtr value from the <code>PdxReader</code>.
- * C++ CacheableObjectArrayPtr is mapped to Java Object[].
+ * Read a std::shared_ptr<CacheableObjectArray> value from the
+ * <code>PdxReader</code>. C++ std::shared_ptr<CacheableObjectArray> is mapped
+ * to Java Object[].
* @param fieldName name of the field to read
- * @return value of type CacheableObjectArrayPtr.
+ * @return value of type std::shared_ptr<CacheableObjectArray>.
* @throws IllegalStateException if PdxReader doesn't has the named field.
*
* @see PdxReader#hasField
*/
- virtual CacheableObjectArrayPtr readObjectArray(const char* fieldName) = 0;
+ virtual std::shared_ptr<CacheableObjectArray> readObjectArray(
+ const char* fieldName) = 0;
/**
* Read a int8_t** value from the <code>PdxReader</code> and sets
@@ -368,15 +370,16 @@ class CPPCACHE_EXPORT PdxReader {
int32_t** elementLength) = 0;
/**
- * Read a CacheableDatePtr value from the <code>PdxReader</code>.
- * <p>C++ CacheableDatePtr is mapped to Java Date</p>
+ * Read a std::shared_ptr<CacheableDate> value from the
+ * <code>PdxReader</code>. <p>C++ std::shared_ptr<CacheableDate> is mapped to
+ * Java Date</p>
* @param fieldName name of the field to read
- * @return value of type CacheableDatePtr.
+ * @return value of type std::shared_ptr<CacheableDate>.
* @throws IllegalStateException if PdxReader doesn't has the named field.
*
* @see PdxReader#hasField
*/
- virtual CacheableDatePtr readDate(const char* fieldName) = 0;
+ virtual std::shared_ptr<CacheableDate> readDate(const char* fieldName) = 0;
/**
* Checks if the named field exists and returns the result.
@@ -411,7 +414,7 @@ class CPPCACHE_EXPORT PdxReader {
*
* @return an object that represents the unread fields.
*/
- virtual PdxUnreadFieldsPtr readUnreadFields() = 0;
+ virtual std::shared_ptr<PdxUnreadFields> readUnreadFields() = 0;
};
} // namespace client
} // namespace geode
diff --git a/cppcache/include/geode/PdxSerializable.hpp b/cppcache/include/geode/PdxSerializable.hpp
index fa411dd..4ce1711 100644
--- a/cppcache/include/geode/PdxSerializable.hpp
+++ b/cppcache/include/geode/PdxSerializable.hpp
@@ -25,6 +25,8 @@
namespace apache {
namespace geode {
namespace client {
+class PdxWriter;
+class PdxReader;
class CPPCACHE_EXPORT PdxSerializable : public CacheableKey {
public:
@@ -36,8 +38,8 @@ class CPPCACHE_EXPORT PdxSerializable : public CacheableKey {
// Solaris compiler gives "hides the virtual function" warnings when
// compiling child classes while other compilers silently
// accept but will cause problems with overloaded calls (in this case
- // no implicit conversion from PdxWriterPtr to DataOutput etc exists
- // so no imminent danger)
+ // no implicit conversion from std::shared_ptr<PdxWriter> to DataOutput etc
+ // exists so no imminent danger)
// see
// http://www.oracle.com/technetwork/server-storage/solarisstudio/documentation/cplusplus-faq-355066.html#Coding1
// using Serializable::toData;
@@ -47,13 +49,13 @@ class CPPCACHE_EXPORT PdxSerializable : public CacheableKey {
*@brief serialize this object in geode PDX format
*@param PdxWriter to serialize the PDX object
**/
- virtual void toData(PdxWriterPtr output) /*const*/ = 0;
+ virtual void toData(std::shared_ptr<PdxWriter> output) /*const*/ = 0;
/**
*@brief Deserialize this object
*@param PdxReader to Deserialize the PDX object
**/
- virtual void fromData(PdxReaderPtr input) = 0;
+ virtual void fromData(std::shared_ptr<PdxReader> input) = 0;
/**
*@brief return the typeId byte of the instance being serialized.
@@ -94,7 +96,7 @@ class CPPCACHE_EXPORT PdxSerializable : public CacheableKey {
* the subclasses.
* The default implementation renders the classname.
*/
- virtual CacheableStringPtr toString() const;
+ virtual std::shared_ptr<CacheableString> toString() const;
/**
* Get the Type for the Object. Equivalent to the C# Type->GetType() API.
diff --git a/cppcache/include/geode/PdxSerializer.hpp b/cppcache/include/geode/PdxSerializer.hpp
index f2a0e94..ca93e5c 100644
--- a/cppcache/include/geode/PdxSerializer.hpp
+++ b/cppcache/include/geode/PdxSerializer.hpp
@@ -60,7 +60,8 @@ class CPPCACHE_EXPORT PdxSerializer {
* @param className the class name whose object need to de-serialize
* @param pr the PdxReader stream to use for reading the object data
*/
- virtual void* fromData(const char* className, PdxReaderPtr pr) = 0;
+ virtual void* fromData(const char* className,
+ std::shared_ptr<PdxReader> pr) = 0;
/**
* Serializes this object in geode PDX format.
@@ -68,7 +69,7 @@ class CPPCACHE_EXPORT PdxSerializer {
* @param pw the PdxWriter object to use for serializing the object
*/
virtual bool toData(void* userObject, const char* className,
- PdxWriterPtr pw) = 0;
+ std::shared_ptr<PdxWriter> pw) = 0;
/**
* Get the function pointer to the user deallocator
diff --git a/cppcache/include/geode/PdxWrapper.hpp b/cppcache/include/geode/PdxWrapper.hpp
index 139384b..a52fade 100644
--- a/cppcache/include/geode/PdxWrapper.hpp
+++ b/cppcache/include/geode/PdxWrapper.hpp
@@ -44,7 +44,7 @@ class CPPCACHE_EXPORT PdxWrapper : public PdxSerializable {
* the Java side.
*/
PdxWrapper(void* userObject, const char* className,
- PdxSerializerPtr pdxSerializerPtr);
+ std::shared_ptr<PdxSerializer> pdxSerializerPtr);
/**
* Returns the pointer to the user object which is deserialized with a
@@ -71,12 +71,12 @@ class CPPCACHE_EXPORT PdxWrapper : public PdxSerializable {
*@brief serialize this object in geode PDX format
*@param PdxWriter to serialize the PDX object
**/
- void toData(PdxWriterPtr output);
+ void toData(std::shared_ptr<PdxWriter> output);
/**
*@brief Deserialize this object
*@param PdxReader to Deserialize the PDX object
**/
- void fromData(PdxReaderPtr input);
+ void fromData(std::shared_ptr<PdxReader> input);
/**
*@brief serialize this object
**/
@@ -106,19 +106,20 @@ class CPPCACHE_EXPORT PdxWrapper : public PdxSerializable {
* the subclasses.
* The default implementation renders the classname.
*/
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
virtual ~PdxWrapper();
private:
/** hide default constructor */
PdxWrapper();
- PdxWrapper(const char* className, PdxSerializerPtr pdxSerializerPtr);
+ PdxWrapper(const char* className,
+ std::shared_ptr<PdxSerializer> pdxSerializerPtr);
FRIEND_STD_SHARED_PTR(PdxWrapper)
void* m_userObject;
- PdxSerializerPtr m_serializer;
+ std::shared_ptr<PdxSerializer> m_serializer;
UserDeallocator m_deallocator;
UserObjectSizer m_sizer;
char* m_className;
diff --git a/cppcache/include/geode/PdxWriter.hpp b/cppcache/include/geode/PdxWriter.hpp
index b59f5ef..3325c34 100644
--- a/cppcache/include/geode/PdxWriter.hpp
+++ b/cppcache/include/geode/PdxWriter.hpp
@@ -29,9 +29,8 @@ namespace apache {
namespace geode {
namespace client {
-class PdxWriter;
-typedef std::shared_ptr<PdxWriter> PdxWriterPtr;
-
+class CacheableObjectArray;
+class PdxUnreadFields;
/**
* A PdxWriter will be passed to PdxSerializable.toData
* when it is serializing the domain class. The domain class needs to serialize
@@ -60,7 +59,8 @@ class CPPCACHE_EXPORT PdxWriter {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty
*/
- virtual PdxWriterPtr writeChar(const char* fieldName, char value) = 0;
+ virtual std::shared_ptr<PdxWriter> writeChar(const char* fieldName,
+ char value) = 0;
/**
* Writes the named field with the given value to the serialized form
@@ -72,7 +72,8 @@ class CPPCACHE_EXPORT PdxWriter {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty
*/
- virtual PdxWriterPtr writeChar(const char* fieldName, char16_t value) = 0;
+ virtual std::shared_ptr<PdxWriter> writeChar(const char* fieldName,
+ char16_t value) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -84,7 +85,8 @@ class CPPCACHE_EXPORT PdxWriter {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty
*/
- virtual PdxWriterPtr writeBoolean(const char* fieldName, bool value) = 0;
+ virtual std::shared_ptr<PdxWriter> writeBoolean(const char* fieldName,
+ bool value) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -96,7 +98,8 @@ class CPPCACHE_EXPORT PdxWriter {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty
*/
- virtual PdxWriterPtr writeByte(const char* fieldName, int8_t value) = 0;
+ virtual std::shared_ptr<PdxWriter> writeByte(const char* fieldName,
+ int8_t value) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -108,7 +111,8 @@ class CPPCACHE_EXPORT PdxWriter {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty
*/
- virtual PdxWriterPtr writeShort(const char* fieldName, int16_t value) = 0;
+ virtual std::shared_ptr<PdxWriter> writeShort(const char* fieldName,
+ int16_t value) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -120,7 +124,8 @@ class CPPCACHE_EXPORT PdxWriter {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty
*/
- virtual PdxWriterPtr writeInt(const char* fieldName, int32_t value) = 0;
+ virtual std::shared_ptr<PdxWriter> writeInt(const char* fieldName,
+ int32_t value) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -132,7 +137,8 @@ class CPPCACHE_EXPORT PdxWriter {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty
*/
- virtual PdxWriterPtr writeLong(const char* fieldName, int64_t value) = 0;
+ virtual std::shared_ptr<PdxWriter> writeLong(const char* fieldName,
+ int64_t value) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -144,7 +150,8 @@ class CPPCACHE_EXPORT PdxWriter {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty
*/
- virtual PdxWriterPtr writeFloat(const char* fieldName, float value) = 0;
+ virtual std::shared_ptr<PdxWriter> writeFloat(const char* fieldName,
+ float value) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -156,20 +163,21 @@ class CPPCACHE_EXPORT PdxWriter {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty
*/
- virtual PdxWriterPtr writeDouble(const char* fieldName, double value) = 0;
+ virtual std::shared_ptr<PdxWriter> writeDouble(const char* fieldName,
+ double value) = 0;
/**
* Writes the named field with the given value to the serialized form.
* The fields type is <code>CacheableDatePtr</code>.
- * <p>C++ CacheableDatePtr is mapped to Java Date</p>
+ * <p>C++ std::shared_ptr<CacheableDate> is mapped to Java Date</p>
* @param fieldName the name of the field to write
* @param value the value of the field to write
* @return this PdxWriter
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty
*/
- virtual PdxWriterPtr writeDate(const char* fieldName,
- CacheableDatePtr date) = 0;
+ virtual std::shared_ptr<PdxWriter> writeDate(
+ const char* fieldName, std::shared_ptr<CacheableDate> date) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -181,8 +189,8 @@ class CPPCACHE_EXPORT PdxWriter {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty
*/
- virtual PdxWriterPtr writeString(const char* fieldName,
- const char* value) = 0;
+ virtual std::shared_ptr<PdxWriter> writeString(const char* fieldName,
+ const char* value) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -194,13 +202,13 @@ class CPPCACHE_EXPORT PdxWriter {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty
*/
- virtual PdxWriterPtr writeWideString(const char* fieldName,
- const wchar_t* value) = 0;
+ virtual std::shared_ptr<PdxWriter> writeWideString(const char* fieldName,
+ const wchar_t* value) = 0;
/**
* Writes the named field with the given value to the serialized form.
* The fields type is <code>CacheablePtr</code>.
- * <p>C++ CacheablePtr is mapped to Java object.</p>
+ * <p>C++ std::shared_ptr<Cacheable> is mapped to Java object.</p>
* It is best to use one of the other writeXXX methods if your field type
* will always be XXX. This method allows the field value to be anything
* that is an instance of Object. This gives you more flexibility but more
@@ -214,8 +222,8 @@ class CPPCACHE_EXPORT PdxWriter {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxWriterPtr writeObject(const char* fieldName,
- CacheablePtr value) = 0;
+ virtual std::shared_ptr<PdxWriter> writeObject(
+ const char* fieldName, std::shared_ptr<Cacheable> value) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -228,8 +236,9 @@ class CPPCACHE_EXPORT PdxWriter {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxWriterPtr writeBooleanArray(const char* fieldName, bool* array,
- int length) = 0;
+ virtual std::shared_ptr<PdxWriter> writeBooleanArray(const char* fieldName,
+ bool* array,
+ int length) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -242,8 +251,9 @@ class CPPCACHE_EXPORT PdxWriter {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxWriterPtr writeWideCharArray(const char* fieldName, wchar_t* array,
- int length) = 0;
+ virtual std::shared_ptr<PdxWriter> writeWideCharArray(const char* fieldName,
+ wchar_t* array,
+ int length) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -256,8 +266,9 @@ class CPPCACHE_EXPORT PdxWriter {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxWriterPtr writeCharArray(const char* fieldName, char* array,
- int length) = 0;
+ virtual std::shared_ptr<PdxWriter> writeCharArray(const char* fieldName,
+ char* array,
+ int length) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -270,8 +281,9 @@ class CPPCACHE_EXPORT PdxWriter {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxWriterPtr writeByteArray(const char* fieldName, int8_t* array,
- int length) = 0;
+ virtual std::shared_ptr<PdxWriter> writeByteArray(const char* fieldName,
+ int8_t* array,
+ int length) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -284,8 +296,9 @@ class CPPCACHE_EXPORT PdxWriter {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxWriterPtr writeShortArray(const char* fieldName, int16_t* array,
- int length) = 0;
+ virtual std::shared_ptr<PdxWriter> writeShortArray(const char* fieldName,
+ int16_t* array,
+ int length) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -298,8 +311,9 @@ class CPPCACHE_EXPORT PdxWriter {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxWriterPtr writeIntArray(const char* fieldName, int32_t* array,
- int length) = 0;
+ virtual std::shared_ptr<PdxWriter> writeIntArray(const char* fieldName,
+ int32_t* array,
+ int length) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -312,8 +326,9 @@ class CPPCACHE_EXPORT PdxWriter {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxWriterPtr writeLongArray(const char* fieldName, int64_t* array,
- int length) = 0;
+ virtual std::shared_ptr<PdxWriter> writeLongArray(const char* fieldName,
+ int64_t* array,
+ int length) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -326,8 +341,9 @@ class CPPCACHE_EXPORT PdxWriter {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxWriterPtr writeFloatArray(const char* fieldName, float* array,
- int length) = 0;
+ virtual std::shared_ptr<PdxWriter> writeFloatArray(const char* fieldName,
+ float* array,
+ int length) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -340,8 +356,9 @@ class CPPCACHE_EXPORT PdxWriter {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxWriterPtr writeDoubleArray(const char* fieldName, double* array,
- int length) = 0;
+ virtual std::shared_ptr<PdxWriter> writeDoubleArray(const char* fieldName,
+ double* array,
+ int length) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -354,8 +371,9 @@ class CPPCACHE_EXPORT PdxWriter {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxWriterPtr writeStringArray(const char* fieldName, char** array,
- int length) = 0;
+ virtual std::shared_ptr<PdxWriter> writeStringArray(const char* fieldName,
+ char** array,
+ int length) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -368,13 +386,14 @@ class CPPCACHE_EXPORT PdxWriter {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxWriterPtr writeWideStringArray(const char* fieldName,
- wchar_t** array, int length) = 0;
+ virtual std::shared_ptr<PdxWriter> writeWideStringArray(const char* fieldName,
+ wchar_t** array,
+ int length) = 0;
/**
* Writes the named field with the given value to the serialized form.
* The fields type is <code>CacheableObjectArrayPtr</code>.
- * C++ CacheableObjectArrayPtr is mapped to Java Object[].
+ * C++ std::shared_ptr<CacheableObjectArray> is mapped to Java Object[].
* For how each element of the array is a mapped to C++ see {@link
* #writeObject}.
* Note that this call may serialize elements that are not compatible with
@@ -385,8 +404,8 @@ class CPPCACHE_EXPORT PdxWriter {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxWriterPtr writeObjectArray(const char* fieldName,
- CacheableObjectArrayPtr array) = 0;
+ virtual std::shared_ptr<PdxWriter> writeObjectArray(
+ const char* fieldName, std::shared_ptr<CacheableObjectArray> array) = 0;
/**
* Writes the named field with the given value to the serialized form.
@@ -401,9 +420,9 @@ class CPPCACHE_EXPORT PdxWriter {
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxWriterPtr writeArrayOfByteArrays(const char* fieldName,
- int8_t** array, int arrayLength,
- int* elementLength) = 0;
+ virtual std::shared_ptr<PdxWriter> writeArrayOfByteArrays(
+ const char* fieldName, int8_t** array, int arrayLength,
+ int* elementLength) = 0;
/**
* Indicate that the given field name should be included in hashCode and
@@ -425,10 +444,11 @@ class CPPCACHE_EXPORT PdxWriter {
* write* method.
*
* @param fieldName the name of the field to mark as an identity field.
- * @returns this PdxWriterPtr
+ * @returns this std::shared_ptr<PdxWriter>
* @throws IllegalStateException if the named field does not exist.
*/
- virtual PdxWriterPtr markIdentityField(const char* fieldName) = 0;
+ virtual std::shared_ptr<PdxWriter> markIdentityField(
+ const char* fieldName) = 0;
/**
* Writes the given unread fields to the serialized form.
@@ -442,7 +462,8 @@ class CPPCACHE_EXPORT PdxWriter {
* @throws IllegalStateException if one of the writeXXX methods has already
* been called.
*/
- virtual PdxWriterPtr writeUnreadFields(PdxUnreadFieldsPtr unread) = 0;
+ virtual std::shared_ptr<PdxWriter> writeUnreadFields(
+ std::shared_ptr<PdxUnreadFields> unread) = 0;
};
} // namespace client
} // namespace geode
diff --git a/cppcache/include/geode/PersistenceManager.hpp b/cppcache/include/geode/PersistenceManager.hpp
index 4b9c065..8baebb2 100644
--- a/cppcache/include/geode/PersistenceManager.hpp
+++ b/cppcache/include/geode/PersistenceManager.hpp
@@ -37,9 +37,10 @@
namespace apache {
namespace geode {
namespace client {
-
-typedef PersistenceManagerPtr (*getPersistenceManagerInstance)(
- const RegionPtr&);
+class PersistenceManager;
+class Region;
+typedef std::shared_ptr<PersistenceManager> (*getPersistenceManagerInstance)(
+ const std::shared_ptr<Region>&);
/**
* @class PersistenceManager PersistenceManager.hpp
@@ -55,23 +56,23 @@ class CPPCACHE_EXPORT PersistenceManager {
*/
public:
/**
- * Returns the current persistence manager.
- * @return persistence manager
- */
- static PersistenceManagerPtr getPersistenceManager();
+ * Returns the current persistence manager.
+ * @return persistence manager
+ */
+ static std::shared_ptr<PersistenceManager> getPersistenceManager();
/**
- * Writes a key, value pair of region to the disk. The actual file or database
- * related write operations should be implemented
- * in this method by the class implementing this method.
- * @param key the key to write.
- * @param value the value to write
- * @param PersistenceInfo related persistence information.
- * @throws RegionDestroyedException is the region is already destroyed.
- * @throws OutofMemoryException if the disk is full
- * @throws DiskFailureException if the write fails due to disk fail.
- */
- virtual void write(const CacheableKeyPtr& key, const CacheablePtr& value,
+ * Writes a key, value pair of region to the disk. The actual file or database
+ * related write operations should be implemented
+ * in this method by the class implementing this method.
+ * @param key the key to write.
+ * @param value the value to write
+ * @param PersistenceInfo related persistence information.
+ * @throws RegionDestroyedException is the region is already destroyed.
+ * @throws OutofMemoryException if the disk is full
+ * @throws DiskFailureException if the write fails due to disk fail.
+ */
+ virtual void write(const std::shared_ptr<CacheableKey>& key, const std::shared_ptr<Cacheable>& value,
void*& PersistenceInfo) = 0;
/**
@@ -88,17 +89,17 @@ class CPPCACHE_EXPORT PersistenceManager {
* @throws InitfailedException if the persistence manager cannot be
* initialized.
*/
- virtual void init(const RegionPtr& region,
- const PropertiesPtr& diskProperties) = 0;
+ virtual void init(const std::shared_ptr<Region>& region,
+ const std::shared_ptr<Properties>& diskProperties) = 0;
/**
- * Reads the value for the key from the disk.
- * @param key is the key for which the value has to be read.
- * @param PersistenceInfo related persistence information.
- * @returns value of type CacheablePtr.
- * @throws DiskCorruptException if the data to be read is corrupt.
- */
- virtual CacheablePtr read(const CacheableKeyPtr& key,
+ * Reads the value for the key from the disk.
+ * @param key is the key for which the value has to be read.
+ * @param PersistenceInfo related persistence information.
+ * @returns value of type std::shared_ptr<Cacheable>.
+ * @throws DiskCorruptException if the data to be read is corrupt.
+ */
+ virtual std::shared_ptr<Cacheable> read(const std::shared_ptr<CacheableKey>& key,
void*& PersistenceInfo) = 0;
/**
@@ -108,13 +109,13 @@ class CPPCACHE_EXPORT PersistenceManager {
virtual bool readAll() = 0;
/**
- * destroys the entry specified by the key in the argument.
- * @param key is the key of the entry which is being destroyed.
- * @param PersistenceInfo related persistence information.
- * @throws RegionDestroyedException is the region is already destroyed.
- * @throws EntryNotFoundException if the entry is not found on the disk.
- */
- virtual void destroy(const CacheableKeyPtr& key, void*& PersistenceInfo) = 0;
+ * destroys the entry specified by the key in the argument.
+ * @param key is the key of the entry which is being destroyed.
+ * @param PersistenceInfo related persistence information.
+ * @throws RegionDestroyedException is the region is already destroyed.
+ * @throws EntryNotFoundException if the entry is not found on the disk.
+ */
+ virtual void destroy(const std::shared_ptr<CacheableKey>& key, void*& PersistenceInfo) = 0;
/**
* Closes the persistence manager instance.
@@ -122,7 +123,7 @@ class CPPCACHE_EXPORT PersistenceManager {
*/
virtual void close() = 0;
- PersistenceManager(const RegionPtr& regionPtr);
+ PersistenceManager(const std::shared_ptr<Region>& regionPtr);
PersistenceManager();
/**
* @brief destructor
@@ -132,7 +133,7 @@ class CPPCACHE_EXPORT PersistenceManager {
protected:
/** Region for this persistence manager.
*/
- const RegionPtr m_regionPtr;
+ const std::shared_ptr<Region> m_regionPtr;
};
} // namespace client
} // namespace geode
diff --git a/cppcache/include/geode/Pool.hpp b/cppcache/include/geode/Pool.hpp
index 95fae98..2a0352b 100644
--- a/cppcache/include/geode/Pool.hpp
+++ b/cppcache/include/geode/Pool.hpp
@@ -198,7 +198,7 @@ class CPPCACHE_EXPORT Pool : public std::enable_shared_from_this<Pool> {
* <p> If a pool has no locators, then it cannot discover servers or locators
* at runtime.
*/
- virtual const CacheableStringArrayPtr getLocators() const = 0;
+ virtual const std::shared_ptr<CacheableStringArray> getLocators() const = 0;
/**
* Returns an unmodifiable list of
@@ -207,7 +207,7 @@ class CPPCACHE_EXPORT Pool : public std::enable_shared_from_this<Pool> {
* when the pool was created or were discovered using this pools {@link
* #getLocators locators}.
*/
- virtual const CacheableStringArrayPtr getServers() = 0;
+ virtual const std::shared_ptr<CacheableStringArray> getServers() = 0;
/**
* Destroys this pool closing any connections it produced.
@@ -238,7 +238,7 @@ class CPPCACHE_EXPORT Pool : public std::enable_shared_from_this<Pool> {
* @see Cache#getQueryService
* @return the QueryService
*/
- virtual QueryServicePtr getQueryService() = 0;
+ virtual std::shared_ptr<QueryService> getQueryService() = 0;
virtual ~Pool();
@@ -277,8 +277,8 @@ class CPPCACHE_EXPORT Pool : public std::enable_shared_from_this<Pool> {
int getPendingEventCount() const;
protected:
- Pool(PoolAttributesPtr attr);
- PoolAttributesPtr m_attrs;
+ Pool(std::shared_ptr<PoolAttributes> attr);
+ std::shared_ptr<PoolAttributes> m_attrs;
private:
/**
@@ -291,8 +291,8 @@ class CPPCACHE_EXPORT Pool : public std::enable_shared_from_this<Pool> {
* @returns Logical instance of cache to do operations on behalf of one
* particular user.
*/
- virtual RegionServicePtr createSecureUserCache(PropertiesPtr credentials,
- CacheImpl* cacheImpl);
+ virtual std::shared_ptr<RegionService> createSecureUserCache(
+ std::shared_ptr<Properties> credentials, CacheImpl* cacheImpl);
Pool(const Pool&);
diff --git a/cppcache/include/geode/PoolFactory.hpp b/cppcache/include/geode/PoolFactory.hpp
index 9814611..85356df 100644
--- a/cppcache/include/geode/PoolFactory.hpp
+++ b/cppcache/include/geode/PoolFactory.hpp
@@ -37,7 +37,7 @@ namespace client {
class CacheImpl;
class PoolAttributes;
-
+class Pool;
/**
* This interface provides for the configuration and creation of instances of
* {@link Pool}.
@@ -490,7 +490,7 @@ class CPPCACHE_EXPORT PoolFactory {
* @throws IllegalStateException if a locator or server has not been added.
* @return the newly created pool.
*/
- PoolPtr create(const char* name);
+ std::shared_ptr<Pool> create(const char* name);
/**
* By default setPRSingleHopEnabled is true<br>
@@ -520,7 +520,7 @@ class CPPCACHE_EXPORT PoolFactory {
PoolFactory(const Cache& cache);
PoolFactory(const PoolFactory&);
void addCheck(const char* host, int port);
- PoolAttributesPtr m_attrs;
+ std::shared_ptr<PoolAttributes> m_attrs;
bool m_isSubscriptionRedundancy;
bool m_addedServerOrLocator;
const Cache& m_cache;
diff --git a/cppcache/include/geode/PoolManager.hpp b/cppcache/include/geode/PoolManager.hpp
index 26dd85a..a0bb05b 100644
--- a/cppcache/include/geode/PoolManager.hpp
+++ b/cppcache/include/geode/PoolManager.hpp
@@ -36,7 +36,9 @@ namespace geode {
namespace client {
class ThinClientPoolDM;
-typedef std::unordered_map<std::string, PoolPtr> HashMapOfPools;
+class FunctionService;
+
+typedef std::unordered_map<std::string, std::shared_ptr<Pool>> HashMapOfPools;
/**
* Manages creation and access to {@link Pool connection pools} for clients.
@@ -58,7 +60,7 @@ class CPPCACHE_EXPORT PoolManager {
* which is used to configure and create new {@link Pool}s.
* @return the new pool factory
*/
- PoolFactoryPtr createFactory();
+ std::shared_ptr<PoolFactory> createFactory();
/**
* Returns a map containing all the pools in this manager.
@@ -79,7 +81,7 @@ class CPPCACHE_EXPORT PoolManager {
* @return the existing connection pool or <code>nullptr</code> if it does not
* exist.
*/
- PoolPtr find(const char* name);
+ std::shared_ptr<Pool> find(const char* name);
/**
* Find the pool used by the given region.
@@ -88,7 +90,7 @@ class CPPCACHE_EXPORT PoolManager {
* region does
* not have a pool.
*/
- PoolPtr find(RegionPtr region);
+ std::shared_ptr<Pool> find(std::shared_ptr<Region> region);
/**
* Unconditionally destroys all created pools that are in this manager.
@@ -102,9 +104,9 @@ class CPPCACHE_EXPORT PoolManager {
private:
void removePool(const char* name);
- void addPool(const char* name, const PoolPtr& pool);
+ void addPool(const char* name, const std::shared_ptr<Pool>& pool);
- PoolPtr getDefaultPool();
+ std::shared_ptr<Pool> getDefaultPool();
class Impl;
std::unique_ptr<Impl, void (*)(Impl*)> m_pimpl;
diff --git a/cppcache/include/geode/Properties.hpp b/cppcache/include/geode/Properties.hpp
index 82afa74..562143f 100644
--- a/cppcache/include/geode/Properties.hpp
+++ b/cppcache/include/geode/Properties.hpp
@@ -49,8 +49,8 @@ class CPPCACHE_EXPORT Properties : public Serializable {
public:
class Visitor {
public:
- virtual void visit(const CacheableKeyPtr& key,
- const CacheablePtr& value) = 0;
+ virtual void visit(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value) = 0;
virtual ~Visitor() {}
};
@@ -59,14 +59,14 @@ class CPPCACHE_EXPORT Properties : public Serializable {
*
* @throws NullPointerException if the key is null
*/
- CacheableStringPtr find(const char* key);
+ std::shared_ptr<CacheableString> find(const char* key);
/**
* Return the value for the given <code>CacheableKey</code>,
* or nullptr if not found.
*
* @throws NullPointerException if the key is nullptr
*/
- CacheablePtr find(const CacheableKeyPtr& key);
+ std::shared_ptr<Cacheable> find(const std::shared_ptr<CacheableKey>& key);
/**
* Add or update the string value for key.
@@ -87,7 +87,8 @@ class CPPCACHE_EXPORT Properties : public Serializable {
*
* @throws NullPointerException if the key is nullptr
*/
- void insert(const CacheableKeyPtr& key, const CacheablePtr& value);
+ void insert(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value);
template <class _Rep, class _Period>
void insert(const char* key,
@@ -107,7 +108,7 @@ class CPPCACHE_EXPORT Properties : public Serializable {
*
* @throws NullPointerException if the key is nullptr
*/
- void remove(const CacheableKeyPtr& key);
+ void remove(const std::shared_ptr<CacheableKey>& key);
/** Execute the Visitor's <code>visit( const char* key, const char* value
* )</code>
@@ -121,10 +122,10 @@ class CPPCACHE_EXPORT Properties : public Serializable {
/** Add the contents of other to this instance, replacing any existing
* values with those from other.
*/
- void addAll(const PropertiesPtr& other);
+ void addAll(const std::shared_ptr<Properties>& other);
/** Factory method, returns an empty collection. */
- static PropertiesPtr create();
+ static std::shared_ptr<Properties> create();
/** Read property values from a file, overriding what is currently
* in the properties object.
diff --git a/cppcache/include/geode/Query.hpp b/cppcache/include/geode/Query.hpp
index 436d547..5b3c605 100644
--- a/cppcache/include/geode/Query.hpp
+++ b/cppcache/include/geode/Query.hpp
@@ -65,7 +65,7 @@ class CPPCACHE_EXPORT Query {
* @returns A smart pointer to the SelectResults which can either be a
* ResultSet or a StructSet.
*/
- virtual SelectResultsPtr execute(
+ virtual std::shared_ptr<SelectResults> execute(
std::chrono::milliseconds timeout = DEFAULT_QUERY_RESPONSE_TIMEOUT) = 0;
/**
@@ -87,8 +87,8 @@ class CPPCACHE_EXPORT Query {
* ResultSet or a StructSet.
*/
- virtual SelectResultsPtr execute(
- CacheableVectorPtr paramList,
+ virtual std::shared_ptr<SelectResults> execute(
+ std::shared_ptr<CacheableVector> paramList,
std::chrono::milliseconds timeout = DEFAULT_QUERY_RESPONSE_TIMEOUT) = 0;
/**
* Get the query string provided when a new Query was created from a
diff --git a/cppcache/include/geode/QueryService.hpp b/cppcache/include/geode/QueryService.hpp
index 97af16c..3054584 100644
--- a/cppcache/include/geode/QueryService.hpp
+++ b/cppcache/include/geode/QueryService.hpp
@@ -45,7 +45,7 @@ namespace client {
*/
class CPPCACHE_EXPORT QueryService {
public:
- typedef std::vector<CqQueryPtr> query_container_type;
+ typedef std::vector<std::shared_ptr<CqQuery>> query_container_type;
/**
* Get a new Query with the specified query string.
@@ -53,7 +53,7 @@ class CPPCACHE_EXPORT QueryService {
* @param querystr The query string with which to create a new Query.
* @returns A smart pointer to the Query.
*/
- virtual QueryPtr newQuery(const char* querystr) = 0;
+ virtual std::shared_ptr<Query> newQuery(const char* querystr) = 0;
/**
* @nativeclient
@@ -88,9 +88,9 @@ class CPPCACHE_EXPORT QueryService {
*
* @endnativeclient
*/
- virtual CqQueryPtr newCq(const char* name, const char* querystr,
- const CqAttributesPtr& cqAttr,
- bool isDurable = false) = 0;
+ virtual std::shared_ptr<CqQuery> newCq(
+ const char* name, const char* querystr,
+ const std::shared_ptr<CqAttributes>& cqAttr, bool isDurable = false) = 0;
/**
* @nativeclient
* Constructs a new named continuous query, represented by an instance of
@@ -123,8 +123,9 @@ class CPPCACHE_EXPORT QueryService {
*
* @endnativeclient
*/
- virtual CqQueryPtr newCq(const char* querystr, const CqAttributesPtr& cqAttr,
- bool isDurable = false) = 0;
+ virtual std::shared_ptr<CqQuery> newCq(
+ const char* querystr, const std::shared_ptr<CqAttributes>& cqAttr,
+ bool isDurable = false) = 0;
/**
* @nativeclient
* Close all CQs, and release resources
@@ -144,7 +145,7 @@ class CPPCACHE_EXPORT QueryService {
* @return the CqQuery or nullptr if not found
* @endnativeclient
*/
- virtual CqQueryPtr getCq(const char* name) = 0;
+ virtual std::shared_ptr<CqQuery> getCq(const char* name) = 0;
/**
* @nativeclient
* Executes all the cqs on this client.
@@ -163,7 +164,7 @@ class CPPCACHE_EXPORT QueryService {
* @return the CqServiceStatistics
* @endnativeclient
*/
- virtual CqServiceStatisticsPtr getCqServiceStatistics() = 0;
+ virtual std::shared_ptr<CqServiceStatistics> getCqServiceStatistics() = 0;
/**
* Gets all the durable CQs registered by this client.
@@ -171,7 +172,7 @@ class CPPCACHE_EXPORT QueryService {
* @return List of names of registered durable CQs, empty list if no durable
* cqs.
*/
- virtual CacheableArrayListPtr getAllDurableCqsFromServer() = 0;
+ virtual std::shared_ptr<CacheableArrayList> getAllDurableCqsFromServer() = 0;
};
} // namespace client
} // namespace geode
diff --git a/cppcache/include/geode/Region.hpp b/cppcache/include/geode/Region.hpp
index 22c1585..4ddf362 100644
--- a/cppcache/include/geode/Region.hpp
+++ b/cppcache/include/geode/Region.hpp
@@ -49,6 +49,7 @@
namespace apache {
namespace geode {
namespace client {
+class Pool;
static constexpr std::chrono::milliseconds DEFAULT_RESPONSE_TIMEOUT =
std::chrono::seconds(15);
@@ -102,21 +103,21 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
/** Returns the parent region, or nullptr if a root region.
* @throws RegionDestroyedException
*/
- virtual RegionPtr getParentRegion() const = 0;
+ virtual std::shared_ptr<Region> getParentRegion() const = 0;
/** Return the RegionAttributes for this region.
*/
- virtual RegionAttributesPtr getAttributes() const = 0;
+ virtual std::shared_ptr<RegionAttributes> getAttributes() const = 0;
/** Return the a mutator object for changing a subset of the region
* attributes.
* @throws RegionDestroyedException.
*/
- virtual AttributesMutatorPtr getAttributesMutator() const = 0;
+ virtual std::shared_ptr<AttributesMutator> getAttributesMutator() const = 0;
// virtual void updateAccessOrModifiedTime() = 0;
- virtual CacheStatisticsPtr getStatistics() const = 0;
+ virtual std::shared_ptr<CacheStatistics> getStatistics() const = 0;
/** Invalidates this region. The invalidation will cascade to
* all the subregions and cached entries. After
@@ -135,7 +136,7 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
* This operation is not distributed.
*/
virtual void invalidateRegion(
- const SerializablePtr& aCallbackArgument = nullptr) = 0;
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
/** Invalidates this region. The invalidation will cascade to
* all the subregions and cached entries. After
@@ -157,7 +158,7 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
*/
virtual void localInvalidateRegion(
- const SerializablePtr& aCallbackArgument = nullptr) = 0;
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
/** Destroys the whole region and provides a user-defined parameter
* object to any <code>CacheWriter</code> invoked in the process.
@@ -196,7 +197,7 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
* @see invalidateRegion
*/
virtual void destroyRegion(
- const SerializablePtr& aCallbackArgument = nullptr) = 0;
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
/**
* Removes all entries from this region and provides a user-defined parameter
* object to any <code>CacheWriter</code> or <code>CacheListener</code>
@@ -204,7 +205,7 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
* @see CacheListener#afterRegionClear
* @see CacheWriter#beforeRegionClear
*/
- virtual void clear(const SerializablePtr& aCallbackArgument = nullptr) = 0;
+ virtual void clear(const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
/**
* Removes all entries from this region and provides a user-defined parameter
* object to any <code>CacheWriter</code> or <code>CacheListener</code>
@@ -212,7 +213,7 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
* @see CacheListener#afterRegionClear
* @see CacheWriter#beforeRegionClear
*/
- virtual void localClear(const SerializablePtr& aCallbackArgument = nullptr) = 0;
+ virtual void localClear(const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
/** Destroys the whole region and provides a user-defined parameter
* object to any <code>CacheWriter</code> invoked in the process.
@@ -234,34 +235,34 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
* @see localInvalidateRegion
*/
virtual void localDestroyRegion(
- const SerializablePtr& aCallbackArgument = nullptr) = 0;
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
/** Returns the subregion identified by the path, nullptr if no such subregion
*/
- virtual RegionPtr getSubregion(const char* path) = 0;
+ virtual std::shared_ptr<Region> getSubregion(const char* path) = 0;
/** Creates a subregion with the specified attributes */
- virtual RegionPtr createSubregion(
+ virtual std::shared_ptr<Region> createSubregion(
const char* subregionName,
- const RegionAttributesPtr& aRegionAttributes) = 0;
+ const std::shared_ptr<RegionAttributes>& aRegionAttributes) = 0;
- /** Populates the passed in VectorOfRegion with subregions of the current
- * region
+ /** Populates the passed in std::vector<std::shared_ptr<Region>> with
+ * subregions of the current region
* @param recursive determines whether the method recursively fills in
* subregions
* @param[out] sr subregions
* @throws RegionDestroyedException
*/
- virtual VectorOfRegion subregions(const bool recursive) = 0;
+ virtual std::vector<std::shared_ptr<Region>> subregions(const bool recursive) = 0;
/** Return the meta-object RegionEntry for key.
* @throws IllegalArgumentException, RegionDestroyedException.
*/
- virtual RegionEntryPtr getEntry(const CacheableKeyPtr& key) = 0;
+ virtual std::shared_ptr<RegionEntry> getEntry(const std::shared_ptr<CacheableKey>& key) = 0;
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
- inline RegionEntryPtr getEntry(const KEYTYPE& key) {
+ inline std::shared_ptr<RegionEntry> getEntry(const KEYTYPE& key) {
return getEntry(createKey(key));
}
@@ -306,13 +307,15 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
* @throws RegionDestroyedException if the method is called on a destroyed
*region
**/
- virtual CacheablePtr get(const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument = nullptr) = 0;
+ virtual std::shared_ptr<Cacheable> get(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
- inline CacheablePtr get(const KEYTYPE& key,
- const SerializablePtr& callbackArg = nullptr) {
+ inline std::shared_ptr<Cacheable> get(
+ const KEYTYPE& key,
+ const std::shared_ptr<Serializable>& callbackArg = nullptr) {
return get(createKey(key), callbackArg);
}
@@ -361,27 +364,30 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
* @throws TimeoutException if operation timed out
* @throws OutOfMemoryException if not enoough memory for the value
*/
- virtual void put(const CacheableKeyPtr& key, const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument = nullptr) = 0;
+ virtual void put(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
/** Convenience method allowing both key and value to be a const char* */
template <class KEYTYPE, class VALUETYPE>
inline void put(const KEYTYPE& key, const VALUETYPE& value,
- const SerializablePtr& arg = nullptr) {
+ const std::shared_ptr<Serializable>& arg = nullptr) {
put(createKey(key), createValue(value), arg);
}
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
- inline void put(const KEYTYPE& key, const CacheablePtr& value,
- const SerializablePtr& arg = nullptr) {
+ inline void put(const KEYTYPE& key, const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
put(createKey(key), value, arg);
}
/** Convenience method allowing value to be a const char* */
template <class VALUETYPE>
- inline void put(const CacheableKeyPtr& key, const VALUETYPE& value,
- const SerializablePtr& arg = nullptr) {
+ inline void put(const std::shared_ptr<CacheableKey>& key,
+ const VALUETYPE& value,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
put(key, createValue(value), arg);
}
@@ -406,7 +412,7 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
virtual void putAll(
const HashMapOfCacheable& map,
std::chrono::milliseconds timeout = DEFAULT_RESPONSE_TIMEOUT,
- const SerializablePtr& aCallbackArgument = nullptr) = 0;
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
/**
* Places a new value into an entry in this region with the specified key
@@ -432,27 +438,31 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
* @throws RegionDestroyedException if region no longer valid
* @throws OutOfMemoryException if not enoough memory for the value
*/
- virtual void localPut(const CacheableKeyPtr& key, const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument = nullptr) = 0;
+ virtual void localPut(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
/** Convenience method allowing both key and value to be a const char* */
template <class KEYTYPE, class VALUETYPE>
inline void localPut(const KEYTYPE& key, const VALUETYPE& value,
- const SerializablePtr& arg = nullptr) {
+ const std::shared_ptr<Serializable>& arg = nullptr) {
localPut(createKey(key), createValue(value), arg);
}
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
- inline void localPut(const KEYTYPE& key, const CacheablePtr& value,
- const SerializablePtr& arg = nullptr) {
+ inline void localPut(const KEYTYPE& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
localPut(createKey(key), value, arg);
}
/** Convenience method allowing value to be a const char* */
template <class VALUETYPE>
- inline void localPut(const CacheableKeyPtr& key, const VALUETYPE& value,
- const SerializablePtr& arg = nullptr) {
+ inline void localPut(const std::shared_ptr<CacheableKey>& key,
+ const VALUETYPE& value,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
localPut(key, createValue(value), arg);
}
@@ -502,27 +512,31 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
* @throws OutOfMemoryException if no memory for new entry
* @throws EntryExistsException if an entry with this key already exists
*/
- virtual void create(const CacheableKeyPtr& key, const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument = nullptr) = 0;
+ virtual void create(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
/** Convenience method allowing both key and value to be a const char* */
template <class KEYTYPE, class VALUETYPE>
inline void create(const KEYTYPE& key, const VALUETYPE& value,
- const SerializablePtr& arg = nullptr) {
+ const std::shared_ptr<Serializable>& arg = nullptr) {
create(createKey(key), createValue(value), arg);
}
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
- inline void create(const KEYTYPE& key, const CacheablePtr& value,
- const SerializablePtr& arg = nullptr) {
+ inline void create(const KEYTYPE& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
create(createKey(key), value, arg);
}
/** Convenience method allowing value to be a const char* */
template <class VALUETYPE>
- inline void create(const CacheableKeyPtr& key, const VALUETYPE& value,
- const SerializablePtr& arg = nullptr) {
+ inline void create(const std::shared_ptr<CacheableKey>& key,
+ const VALUETYPE& value,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
create(key, createValue(value), arg);
}
@@ -551,28 +565,31 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
* @throws OutOfMemoryException if no memory for new entry
* @throws EntryExistsException if an entry with this key already exists
*/
- virtual void localCreate(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument = nullptr) = 0;
+ virtual void localCreate(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
/** Convenience method allowing both key and value to be a const char* */
template <class KEYTYPE, class VALUETYPE>
inline void localCreate(const KEYTYPE& key, const VALUETYPE& value,
- const SerializablePtr& arg = nullptr) {
+ const std::shared_ptr<Serializable>& arg = nullptr) {
localCreate(createKey(key), createValue(value), arg);
}
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
- inline void localCreate(const KEYTYPE& key, const CacheablePtr& value,
- const SerializablePtr& arg = nullptr) {
+ inline void localCreate(const KEYTYPE& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
localCreate(createKey(key), value, arg);
}
/** Convenience method allowing value to be a const char* */
template <class VALUETYPE>
- inline void localCreate(const CacheableKeyPtr& key, const VALUETYPE& value,
- const SerializablePtr& arg = nullptr) {
+ inline void localCreate(const std::shared_ptr<CacheableKey>& key,
+ const VALUETYPE& value,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
localCreate(key, createValue(value), arg);
}
@@ -598,12 +615,14 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
* @see destroy
* @see CacheListener::afterInvalidate
*/
- virtual void invalidate(const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument = nullptr) = 0;
+ virtual void invalidate(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
- inline void invalidate(const KEYTYPE& key, const SerializablePtr& arg = nullptr) {
+ inline void invalidate(const KEYTYPE& key,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
invalidate(createKey(key), arg);
}
@@ -628,13 +647,13 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
* @see CacheListener::afterInvalidate
*/
virtual void localInvalidate(
- const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument = nullptr) = 0;
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
- inline void localInvalidate(const KEYTYPE& key,
- const SerializablePtr& arg = nullptr) {
+ inline void localInvalidate(
+ const KEYTYPE& key, const std::shared_ptr<Serializable>& arg = nullptr) {
localInvalidate(createKey(key), arg);
}
@@ -682,12 +701,14 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
* @see CacheListener::afterDestroy
* @see CacheWriter::beforeDestroy
*/
- virtual void destroy(const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument = nullptr) = 0;
+ virtual void destroy(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
- inline void destroy(const KEYTYPE& key, const SerializablePtr& arg = nullptr) {
+ inline void destroy(const KEYTYPE& key,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
destroy(createKey(key), arg);
}
@@ -715,13 +736,14 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
* @see CacheListener::afterDestroy
* @see CacheWriter::beforeDestroy
*/
- virtual void localDestroy(const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument = nullptr) = 0;
+ virtual void localDestroy(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
inline void localDestroy(const KEYTYPE& key,
- const SerializablePtr& arg = nullptr) {
+ const std::shared_ptr<Serializable>& arg = nullptr) {
localDestroy(createKey(key), arg);
}
@@ -773,31 +795,35 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
* @see CacheListener::afterDestroy
* @see CacheWriter::beforeDestroy
*/
- virtual bool remove(const CacheableKeyPtr& key, const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument = nullptr) = 0;
+ virtual bool remove(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
/** Convenience method allowing both key and value to be a const char* */
template <class KEYTYPE, class VALUETYPE>
inline bool remove(const KEYTYPE& key, const VALUETYPE& value,
- const SerializablePtr& arg = nullptr) {
+ const std::shared_ptr<Serializable>& arg = nullptr) {
return remove(createKey(key), createValue(value), arg);
}
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
- inline bool remove(const KEYTYPE& key, const CacheablePtr& value,
- const SerializablePtr& arg = nullptr) {
+ inline bool remove(const KEYTYPE& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
return remove(createKey(key), value, arg);
}
/** Convenience method allowing value to be a const char* */
template <class VALUETYPE>
- inline bool remove(const CacheableKeyPtr& key, const VALUETYPE& value,
- const SerializablePtr& arg = nullptr) {
+ inline bool remove(const std::shared_ptr<CacheableKey>& key,
+ const VALUETYPE& value,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
return remove(key, createValue(value), arg);
}
- bool remove(const CacheableKeyPtr& key) { return removeEx(key); }
+ bool remove(const std::shared_ptr<CacheableKey>& key) { return removeEx(key); }
/** Convenience method allowing both key and value to be a const char* */
template <class KEYTYPE>
@@ -851,12 +877,14 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
* @see CacheListener::afterDestroy
* @see CacheWriter::beforeDestroy
*/
- virtual bool removeEx(const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument = nullptr) = 0;
+ virtual bool removeEx(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
- inline bool removeEx(const KEYTYPE& key, const SerializablePtr& arg = nullptr) {
+ inline bool removeEx(const KEYTYPE& key,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
return removeEx(createKey(key), arg);
}
@@ -887,28 +915,31 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
* @see CacheListener::afterDestroy
* @see CacheWriter::beforeDestroy
*/
- virtual bool localRemove(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument = nullptr) = 0;
+ virtual bool localRemove(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
/** Convenience method allowing both key and value to be a const char* */
template <class KEYTYPE, class VALUETYPE>
inline bool localRemove(const KEYTYPE& key, const VALUETYPE& value,
- const SerializablePtr& arg = nullptr) {
+ const std::shared_ptr<Serializable>& arg = nullptr) {
return localRemove(createKey(key), createValue(value), arg);
}
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
- inline bool localRemove(const KEYTYPE& key, const CacheablePtr& value,
- const SerializablePtr& arg = nullptr) {
+ inline bool localRemove(const KEYTYPE& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
return localRemove(createKey(key), value, arg);
}
/** Convenience method allowing value to be a const char* */
template <class VALUETYPE>
- inline bool localRemove(const CacheableKeyPtr& key, const VALUETYPE& value,
- const SerializablePtr& arg = nullptr) {
+ inline bool localRemove(const std::shared_ptr<CacheableKey>& key,
+ const VALUETYPE& value,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
return localRemove(key, createValue(value), arg);
}
@@ -939,13 +970,13 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
*/
virtual bool localRemoveEx(
- const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument = nullptr) = 0;
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
- inline bool localRemoveEx(const KEYTYPE& key,
- const SerializablePtr& arg = nullptr) {
+ inline bool localRemoveEx(
+ const KEYTYPE& key, const std::shared_ptr<Serializable>& arg = nullptr) {
return localRemoveEx(createKey(key), arg);
}
@@ -953,7 +984,7 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
* Return all the keys in the local process for this region. This includes
* keys for which the entry is invalid.
*/
- virtual VectorOfCacheableKey keys() = 0;
+ virtual std::vector<std::shared_ptr<CacheableKey>> keys() = 0;
/**
* Return the set of keys defined in the server process associated to this
@@ -980,21 +1011,21 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
* @throws UnsupportedOperationException if the member type is not CLIENT
* or region is not a native client one.
*/
- virtual VectorOfCacheableKey serverKeys() = 0;
+ virtual std::vector<std::shared_ptr<CacheableKey>> serverKeys() = 0;
/**
* Return all values in the local process for this region. No value is
* included for entries that are invalidated.
*/
- virtual VectorOfCacheable values() = 0;
+ virtual std::vector<std::shared_ptr<Cacheable>> values() = 0;
- virtual VectorOfRegionEntry entries(bool recursive) = 0;
+ virtual std::vector<std::shared_ptr<RegionEntry>> entries(bool recursive) = 0;
/**
* Returns the <code>cache</code> associated with this region.
* @return the cache
*/
- virtual RegionServicePtr getRegionService() const = 0;
+ virtual std::shared_ptr<RegionService> getRegionService() const = 0;
virtual bool isDestroyed() const = 0;
@@ -1003,7 +1034,7 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
* It is not propagated to the Geode cache server
* to which it is connected.
*/
- virtual bool containsValueForKey(const CacheableKeyPtr& keyPtr) const = 0;
+ virtual bool containsValueForKey(const std::shared_ptr<CacheableKey>& keyPtr) const = 0;
/**
* Convenience method allowing key to be a const char*
@@ -1021,28 +1052,28 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
* server
* to which it is connected with.
*/
- virtual bool containsKey(const CacheableKeyPtr& keyPtr) const = 0;
+ virtual bool containsKey(const std::shared_ptr<CacheableKey>& keyPtr) const = 0;
/**
* The cache of the server, to which it is connected with, is searched
* for the key to see if the key is present.
* @throws UnsupportedOperationException if the region's scope is
* ScopeType::LOCAL.
*/
- virtual bool containsKeyOnServer(const CacheableKeyPtr& keyPtr) const = 0;
+ virtual bool containsKeyOnServer(const std::shared_ptr<CacheableKey>& keyPtr) const = 0;
/**
* Returns the list of keys on which this client is interested and will be
* notified of changes.
* @throws UnsupportedOperationException if the region's scope is
* ScopeType::LOCAL.
*/
- virtual VectorOfCacheableKey getInterestList() const = 0;
+ virtual std::vector<std::shared_ptr<CacheableKey>> getInterestList() const = 0;
/**
* Returns the list of regular expresssions on which this client is
* interested and will be notified of changes.
* @throws UnsupportedOperationException if the region's scope is
* ScopeType::LOCAL.
*/
- virtual VectorOfCacheableString getInterestListRegex() const = 0;
+ virtual std::vector<std::shared_ptr<CacheableString>> getInterestListRegex() const = 0;
/**
* Convenience method allowing key to be a const char*
* This operations checks for the key in the local cache .
@@ -1089,7 +1120,7 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
* @throws UnknownException For other exceptions.
* @throws TimeoutException if operation timed out
*/
- virtual void registerKeys(const VectorOfCacheableKey& keys,
+ virtual void registerKeys(const std::vector<std::shared_ptr<CacheableKey>> & keys,
bool isDurable = false,
bool getInitialValues = false,
bool receiveValues = true) = 0;
@@ -1119,7 +1150,7 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
* @throws UnknownException For other exceptions.
* @throws TimeoutException if operation timed out
*/
- virtual void unregisterKeys(const VectorOfCacheableKey& keys) = 0;
+ virtual void unregisterKeys(const std::vector<std::shared_ptr<CacheableKey>> & keys) = 0;
/**
* Registers to get updates for all keys from the server.
@@ -1300,8 +1331,8 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
* @see get
*/
virtual HashMapOfCacheable getAll(
- const VectorOfCacheableKey& keys,
- const SerializablePtr& aCallbackArgument = nullptr) = 0;
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
/**
* Executes the query on the server based on the predicate.
@@ -1329,7 +1360,7 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
* @returns A smart pointer to the SelectResults which can either be a
* ResultSet or a StructSet.
*/
- virtual SelectResultsPtr query(
+ virtual std::shared_ptr<SelectResults> query(
const char* predicate,
std::chrono::milliseconds timeout = DEFAULT_QUERY_RESPONSE_TIMEOUT) = 0;
@@ -1379,7 +1410,7 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
* @returns A smart pointer to the single ResultSet or StructSet item, or
* nullptr of no results are available.
*/
- virtual SerializablePtr selectValue(
+ virtual std::shared_ptr<Serializable> selectValue(
const char* predicate,
std::chrono::milliseconds timeout = DEFAULT_QUERY_RESPONSE_TIMEOUT) = 0;
@@ -1410,8 +1441,9 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
* @throws UnknownException For other exceptions.
* @see destroy
*/
- virtual void removeAll(const VectorOfCacheableKey& keys,
- const SerializablePtr& aCallbackArgument = nullptr) = 0;
+ virtual void removeAll(
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
/**
* Get the size of region. For native client regions, this will give the
@@ -1419,18 +1451,18 @@ class CPPCACHE_EXPORT Region : public std::enable_shared_from_this<Region> {
*/
virtual uint32_t size() = 0;
- virtual const PoolPtr& getPool() = 0;
+ virtual const std::shared_ptr<Pool>& getPool() = 0;
- inline CachePtr& getCache() { return m_cache; }
+ inline std::shared_ptr<Cache>& getCache() { return m_cache; }
Region(const Region&) = delete;
Region& operator=(const Region&) = delete;
protected:
- Region(const CachePtr& cache);
+ Region(const std::shared_ptr<Cache>& cache);
virtual ~Region();
- mutable CachePtr m_cache;
+ mutable std::shared_ptr<Cache> m_cache;
FRIEND_STD_SHARED_PTR(Region)
};
diff --git a/cppcache/include/geode/RegionAttributes.hpp b/cppcache/include/geode/RegionAttributes.hpp
index 18478dc..b0b7500 100644
--- a/cppcache/include/geode/RegionAttributes.hpp
+++ b/cppcache/include/geode/RegionAttributes.hpp
@@ -83,21 +83,21 @@ class CPPCACHE_EXPORT RegionAttributes : public Serializable {
* <code>CacheLoader</code> , nullptr if there is no CacheLoader for this
* region.
*/
- CacheLoaderPtr getCacheLoader();
+ std::shared_ptr<CacheLoader> getCacheLoader();
/** Gets the cache writer for the region.
* @return a pointer that points to the region's ,
* <code>CacheWriter</code> , nullptr if there is no CacheWriter for this
* region
*/
- CacheWriterPtr getCacheWriter();
+ std::shared_ptr<CacheWriter> getCacheWriter();
/** Gets the cache listener for the region.
* @return a pointer that points to the region's ,
* <code>CacheListener</code> , nullptr if there is no CacheListener defined
* for this region.
*/
- CacheListenerPtr getCacheListener();
+ std::shared_ptr<CacheListener> getCacheListener();
/** Gets the partition resolver for the partition region.
* @return a pointer that points to the region's ,
@@ -105,7 +105,7 @@ class CPPCACHE_EXPORT RegionAttributes : public Serializable {
* defined
* for this region.
*/
- PartitionResolverPtr getPartitionResolver();
+ std::shared_ptr<PartitionResolver> getPartitionResolver();
/** Gets the <code>timeToLive</code> expiration attributes for the region as a
* whole.
@@ -297,7 +297,7 @@ class CPPCACHE_EXPORT RegionAttributes : public Serializable {
/**
* This method returns the properties pointer which is set for persistence.
*/
- PropertiesPtr getPersistenceProperties();
+ std::shared_ptr<Properties> getPersistenceProperties();
/** Gets the persistence for the region.
* @return a pointer that points to the region's ,
@@ -305,7 +305,7 @@ class CPPCACHE_EXPORT RegionAttributes : public Serializable {
* for this
* region.
*/
- PersistenceManagerPtr getPersistenceManager();
+ std::shared_ptr<PersistenceManager> getPersistenceManager();
/** TODO
* Returns the name of the {@link Pool} that this region
@@ -338,7 +338,7 @@ class CPPCACHE_EXPORT RegionAttributes : public Serializable {
void setCacheWriter(const char* libpath, const char* factoryFuncName);
void setPartitionResolver(const char* libpath, const char* factoryFuncName);
void setPersistenceManager(const char* lib, const char* func,
- const PropertiesPtr& config);
+ const std::shared_ptr<Properties>& config);
void setEndpoints(const char* endpoints);
void setPoolName(const char* poolName);
void setCloningEnabled(bool isClonable);
@@ -365,10 +365,10 @@ class CPPCACHE_EXPORT RegionAttributes : public Serializable {
ExpirationAction::Action m_entryTimeToLiveExpirationAction;
ExpirationAction::Action m_entryIdleTimeoutExpirationAction;
ExpirationAction::Action m_lruEvictionAction;
- CacheWriterPtr m_cacheWriter;
- CacheLoaderPtr m_cacheLoader;
- CacheListenerPtr m_cacheListener;
- PartitionResolverPtr m_partitionResolver;
+ std::shared_ptr<CacheWriter> m_cacheWriter;
+ std::shared_ptr<CacheLoader> m_cacheLoader;
+ std::shared_ptr<CacheListener> m_cacheListener;
+ std::shared_ptr<PartitionResolver> m_partitionResolver;
uint32_t m_lruEntriesLimit;
bool m_caching;
uint32_t m_maxValueDistLimit;
@@ -392,8 +392,8 @@ class CPPCACHE_EXPORT RegionAttributes : public Serializable {
bool m_clientNotificationEnabled;
char* m_persistenceLibrary;
char* m_persistenceFactory;
- PropertiesPtr m_persistenceProperties;
- PersistenceManagerPtr m_persistenceManager;
+ std::shared_ptr<Properties> m_persistenceProperties;
+ std::shared_ptr<PersistenceManager> m_persistenceManager;
char* m_poolName;
bool m_isClonable;
bool m_isConcurrencyChecksEnabled;
diff --git a/cppcache/include/geode/RegionEntry.hpp b/cppcache/include/geode/RegionEntry.hpp
index 024ad26..85fdf6e 100644
--- a/cppcache/include/geode/RegionEntry.hpp
+++ b/cppcache/include/geode/RegionEntry.hpp
@@ -34,7 +34,7 @@ namespace geode {
namespace client {
class RegionInternal;
-
+class Region;
/**
* @class RegionEntry RegionEntry.hpp
* An object in a Region that represents an entry, i.e., a key-value pair.
@@ -54,20 +54,20 @@ class CPPCACHE_EXPORT RegionEntry {
*
* @return the key for this entry
*/
- CacheableKeyPtr getKey();
+ std::shared_ptr<CacheableKey> getKey();
/** Returns the value of this entry in the local cache. Does not invoke
* a <code>CacheLoader</code>,
*
* @return the value or <code>nullptr</code> if this entry is invalid
*/
- CacheablePtr getValue();
+ std::shared_ptr<Cacheable> getValue();
/** Returns the region that contains this entry.
*
* @return the Region that contains this entry
*/
- RegionPtr getRegion();
+ std::shared_ptr<Region> getRegion();
/** Returns the statistics for this entry.
*
@@ -75,7 +75,7 @@ class CPPCACHE_EXPORT RegionEntry {
* @throws StatisticsDisabledException if statistics have been disabled for
* this region
*/
- CacheStatisticsPtr getStatistics();
+ std::shared_ptr<CacheStatistics> getStatistics();
/**
* Returns whether this entry has been destroyed.
@@ -95,12 +95,13 @@ class CPPCACHE_EXPORT RegionEntry {
* @brief constructors
* created by region
*/
- RegionEntry(const RegionPtr& region, const CacheableKeyPtr& key,
- const CacheablePtr& value);
- RegionPtr m_region;
- CacheableKeyPtr m_key;
- CacheablePtr m_value;
- CacheStatisticsPtr m_statistics;
+ RegionEntry(const std::shared_ptr<Region>& region,
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value);
+ std::shared_ptr<Region> m_region;
+ std::shared_ptr<CacheableKey> m_key;
+ std::shared_ptr<Cacheable> m_value;
+ std::shared_ptr<CacheStatistics> m_statistics;
bool m_destroyed;
friend class RegionInternal;
diff --git a/cppcache/include/geode/RegionEvent.hpp b/cppcache/include/geode/RegionEvent.hpp
index 70013ee..6152477 100644
--- a/cppcache/include/geode/RegionEvent.hpp
+++ b/cppcache/include/geode/RegionEvent.hpp
@@ -36,8 +36,8 @@ namespace client {
class CPPCACHE_EXPORT RegionEvent {
protected:
- const RegionPtr m_region; /**< Region for this event. */
- const SerializablePtr
+ const std::shared_ptr<Region> m_region; /**< Region for this event. */
+ const std::shared_ptr<Serializable>
m_callbackArgument; /**< Callback argument for this event, if any. */
const bool m_remoteOrigin; /**< True if from a remote process. */
@@ -45,21 +45,24 @@ class CPPCACHE_EXPORT RegionEvent {
/** Constructor. */
RegionEvent();
/** Constructor, given the values. */
- RegionEvent(const RegionPtr& region, const SerializablePtr& aCallbackArgument,
+ RegionEvent(const std::shared_ptr<Region>& region,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
const bool remoteOrigin);
/** Destructor. */
~RegionEvent();
/** Return the region this event occurred in. */
- inline RegionPtr getRegion() const { return m_region; }
+ inline std::shared_ptr<Region> getRegion() const { return m_region; }
/**
* Returns the callbackArgument passed to the method that generated
* this event. See the {@link Region} interface methods that take
* a callbackArgument parameter.
*/
- inline SerializablePtr getCallbackArgument() const { return m_callbackArgument; }
+ inline std::shared_ptr<Serializable> getCallbackArgument() const {
+ return m_callbackArgument;
+ }
/** If the event originated in a remote process, returns true. */
inline bool remoteOrigin() const { return m_remoteOrigin; }
diff --git a/cppcache/include/geode/RegionFactory.hpp b/cppcache/include/geode/RegionFactory.hpp
index 405a825..9fbd696 100644
--- a/cppcache/include/geode/RegionFactory.hpp
+++ b/cppcache/include/geode/RegionFactory.hpp
@@ -50,32 +50,36 @@ class CPPCACHE_EXPORT RegionFactory {
* this cache
* @throws CacheClosedException if the cache is closed
*/
- RegionPtr create(const char* name);
+ std::shared_ptr<Region> create(const char* name);
/** Sets the cache loader for the next <code>RegionAttributes</code> created.
* @param cacheLoader the cache loader or nullptr if no loader
* @return a reference to <code>this</code>
*/
- RegionFactory& setCacheLoader(const CacheLoaderPtr& cacheLoader);
+ RegionFactory& setCacheLoader(
+ const std::shared_ptr<CacheLoader>& cacheLoader);
/** Sets the cache writer for the next <code>RegionAttributes</code> created.
* @param cacheWriter the cache writer or nullptr if no cache writer
* @return a reference to <code>this</code>
*/
- RegionFactory& setCacheWriter(const CacheWriterPtr& cacheWriter);
+ RegionFactory& setCacheWriter(
+ const std::shared_ptr<CacheWriter>& cacheWriter);
/** Sets the CacheListener for the next <code>RegionAttributes</code> created.
* @param aListener a user defined CacheListener, nullptr if no listener
* @return a reference to <code>this</code>
*/
- RegionFactory& setCacheListener(const CacheListenerPtr& aListener);
+ RegionFactory& setCacheListener(
+ const std::shared_ptr<CacheListener>& aListener);
/** Sets the PartitionResolver for the next <code>RegionAttributes</code>
* created.
* @param aResolver a user defined PartitionResolver, nullptr if no resolver
* @return a reference to <code>this</code>
*/
- RegionFactory& setPartitionResolver(const PartitionResolverPtr& aResolver);
+ RegionFactory& setPartitionResolver(
+ const std::shared_ptr<PartitionResolver>& aResolver);
/**
* Sets the library path for the library that will be invoked for the loader
@@ -156,9 +160,9 @@ class CPPCACHE_EXPORT RegionFactory {
* this must be used to set the PersistenceManager.
* @return a reference to <code>this</code>
*/
- RegionFactory& setPersistenceManager(const char* libpath,
- const char* factoryFuncName,
- const PropertiesPtr& config = nullptr);
+ RegionFactory& setPersistenceManager(
+ const char* libpath, const char* factoryFuncName,
+ const std::shared_ptr<Properties>& config = nullptr);
/** Sets the PersistenceManager for the next <code>RegionAttributes</code>
* created.
@@ -167,8 +171,8 @@ class CPPCACHE_EXPORT RegionFactory {
* @return a reference to <code>this</code>
*/
RegionFactory& setPersistenceManager(
- const PersistenceManagerPtr& persistenceManager,
- const PropertiesPtr& config = nullptr);
+ const std::shared_ptr<PersistenceManager>& persistenceManager,
+ const std::shared_ptr<Properties>& config = nullptr);
// MAP ATTRIBUTES
/** Sets the entry initial capacity for the next <code>RegionAttributes</code>
@@ -261,7 +265,7 @@ class CPPCACHE_EXPORT RegionFactory {
RegionShortcut m_preDefinedRegion;
- AttributesFactoryPtr m_attributeFactory;
+ std::shared_ptr<AttributesFactory> m_attributeFactory;
CacheImpl* m_cacheImpl;
diff --git a/cppcache/include/geode/RegionService.hpp b/cppcache/include/geode/RegionService.hpp
index 108b476..17bfbd1 100644
--- a/cppcache/include/geode/RegionService.hpp
+++ b/cppcache/include/geode/RegionService.hpp
@@ -22,7 +22,7 @@
#include "geode_globals.hpp"
#include "geode_types.hpp"
-#include "VectorT.hpp"
+#include <vector>
/**
* @file
@@ -34,7 +34,7 @@ namespace client {
class Region;
class QueryService;
-
+class PdxInstanceFactory;
/**
* A RegionService provides access to existing {@link Region regions} that exist
* in a {@link GeodeCache Geode cache}.
@@ -89,13 +89,13 @@ class CPPCACHE_EXPORT RegionService {
* @param name the region's name, such as <code>root</code>.
* @returns region, or nullptr if no such region exists.
*/
- virtual RegionPtr getRegion(const char* name) = 0;
+ virtual std::shared_ptr<Region> getRegion(const char* name) = 0;
/**
* Gets the QueryService from which a new Query can be obtained.
* @returns A smart pointer to the QueryService.
*/
- virtual QueryServicePtr getQueryService() = 0;
+ virtual std::shared_ptr<QueryService> getQueryService() = 0;
/**
* Returns a set of root regions in the cache. This set is a snapshot and
@@ -105,7 +105,7 @@ class CPPCACHE_EXPORT RegionService {
* @param regions the returned set of
* regions
*/
- virtual VectorOfRegion rootRegions() = 0;
+ virtual std::vector<std::shared_ptr<Region>> rootRegions() = 0;
/**
* Returns a factory that can create a {@link PdxInstance}.
@@ -114,7 +114,7 @@ class CPPCACHE_EXPORT RegionService {
* when it is fully deserialized.
* @return the factory
*/
- virtual PdxInstanceFactoryPtr createPdxInstanceFactory(
+ virtual std::shared_ptr<PdxInstanceFactory> createPdxInstanceFactory(
const char* className) = 0;
};
} // namespace client
diff --git a/cppcache/include/geode/ResultCollector.hpp b/cppcache/include/geode/ResultCollector.hpp
index 7465b88..cb3c35b 100644
--- a/cppcache/include/geode/ResultCollector.hpp
+++ b/cppcache/include/geode/ResultCollector.hpp
@@ -50,14 +50,14 @@ namespace client {
* Example:
* <br>
* <pre>
- * ResultCollectorPtr rc = FunctionService::onRegion(region)
+ * auto rc = FunctionService::onRegion(region)
* ->withArgs(args)
* ->withFilter(keySet)
* ->withCollector(new
* MyCustomResultCollector())
* .execute(Function);
* //Application can do something else here before retrieving the result
- * CacheableVectorPtr functionResult = rc.getResult();
+ * auto functionResult = rc.getResult();
* </pre>
*
* @see FunctionService
@@ -84,7 +84,7 @@ class CPPCACHE_EXPORT ResultCollector {
* @throws FunctionException if result retrieval fails
* @see UserFunctionExecutionException
*/
- virtual CacheableVectorPtr getResult(
+ virtual std::shared_ptr<CacheableVector> getResult(
std::chrono::milliseconds timeout = DEFAULT_QUERY_RESPONSE_TIMEOUT) = 0;
/**
@@ -93,7 +93,8 @@ class CPPCACHE_EXPORT ResultCollector {
* @param resultOfSingleExecution
* @since 5.8LA
*/
- virtual void addResult(const CacheablePtr& resultOfSingleExecution) = 0;
+ virtual void addResult(
+ const std::shared_ptr<Cacheable>& resultOfSingleExecution) = 0;
/**
* Geode will invoke this method when function execution has completed
diff --git a/cppcache/include/geode/ResultSet.hpp b/cppcache/include/geode/ResultSet.hpp
index 30f0dea..8048b23 100644
--- a/cppcache/include/geode/ResultSet.hpp
+++ b/cppcache/include/geode/ResultSet.hpp
@@ -25,7 +25,6 @@
#include "ExceptionTypes.hpp"
#include "SelectResults.hpp"
-#include "VectorT.hpp"
#include "SelectResultsIterator.hpp"
@@ -65,7 +64,7 @@ class CPPCACHE_EXPORT ResultSet : public SelectResults {
* @throws IllegalArgumentException if the index is out of bounds.
* @returns A smart pointer to the item indexed.
*/
- virtual const SerializablePtr operator[](int32_t index) const = 0;
+ virtual const std::shared_ptr<Serializable> operator[](int32_t index) const = 0;
/**
* Get a SelectResultsIterator with which to iterate over the items in the
diff --git a/cppcache/include/geode/SelectResults.hpp b/cppcache/include/geode/SelectResults.hpp
index 82405f2..ee75404 100644
--- a/cppcache/include/geode/SelectResults.hpp
+++ b/cppcache/include/geode/SelectResults.hpp
@@ -64,7 +64,8 @@ class CPPCACHE_EXPORT SelectResults {
* @throws IllegalArgumentException if the index is out of bounds.
* @returns A smart pointer to the item indexed.
*/
- virtual const SerializablePtr operator[](int32_t index) const = 0;
+ virtual const std::shared_ptr<Serializable> operator[](
+ int32_t index) const = 0;
/**
* Get a SelectResultsIterator with which to iterate over the items in the
diff --git a/cppcache/include/geode/SelectResultsIterator.hpp b/cppcache/include/geode/SelectResultsIterator.hpp
index 4a1b270..a24a531 100644
--- a/cppcache/include/geode/SelectResultsIterator.hpp
+++ b/cppcache/include/geode/SelectResultsIterator.hpp
@@ -59,7 +59,7 @@ class CPPCACHE_EXPORT SelectResultsIterator {
* @returns a smart pointer to the next item from the iterator or nullptr if
* no further items are available.
*/
- const SerializablePtr next();
+ const std::shared_ptr<Serializable> next();
/**
* Move the iterator to point to the next item to get.
@@ -74,7 +74,7 @@ class CPPCACHE_EXPORT SelectResultsIterator {
* @returns A smart pointer to the current item pointed to by the
* SelectResultsIterator.
*/
- const SerializablePtr current() const;
+ const std::shared_ptr<Serializable> current() const;
/**
* Reset the SelectResultsIterator to point to the start of the items.
@@ -85,14 +85,14 @@ class CPPCACHE_EXPORT SelectResultsIterator {
/**
* Constructor - meant only for internal use.
*/
- SelectResultsIterator(const CacheableVectorPtr& vectorSR,
- SelectResultsPtr srp);
+ SelectResultsIterator(const std::shared_ptr<CacheableVector>& vectorSR,
+ std::shared_ptr<SelectResults> srp);
- CacheableVectorPtr m_vectorSR;
+ std::shared_ptr<CacheableVector> m_vectorSR;
int32_t m_nextIndex;
// this is to ensure that a reference of SelectResults is kept alive
// if an iterator object is present
- SelectResultsPtr m_srp;
+ std::shared_ptr<SelectResults> m_srp;
friend class ResultSetImpl;
friend class StructSetImpl;
diff --git a/cppcache/include/geode/Serializable.hpp b/cppcache/include/geode/Serializable.hpp
index 751b4d7..c156349 100644
--- a/cppcache/include/geode/Serializable.hpp
+++ b/cppcache/include/geode/Serializable.hpp
@@ -34,7 +34,10 @@ namespace client {
class DataOutput;
class DataInput;
-
+class Cache;
+class PdxSerializable;
+class Serializable;
+class CacheableString;
typedef void (*CliCallbackMethod)(Cache &cache);
/** @brief signature of functions passed to registerType. Such functions
@@ -109,7 +112,7 @@ class CPPCACHE_EXPORT Serializable
* the subclasses.
* The default implementation renders the classname.
*/
- virtual CacheableStringPtr toString() const;
+ virtual std::shared_ptr<CacheableString> toString() const;
/** Factory method that creates the Serializable object that matches the type
* of value.
@@ -119,7 +122,7 @@ class CPPCACHE_EXPORT Serializable
* apache::geode::client::createValueArr may be overloaded.
*/
template <class PRIM>
- inline static SerializablePtr create(const PRIM value);
+ inline static std::shared_ptr<Serializable> create(const PRIM value);
/**
* @brief destructor
diff --git a/cppcache/include/geode/Serializer.hpp b/cppcache/include/geode/Serializer.hpp
index 29e955f..c4a9176 100644
--- a/cppcache/include/geode/Serializer.hpp
+++ b/cppcache/include/geode/Serializer.hpp
@@ -29,7 +29,6 @@
#include "geode_globals.hpp"
#include "DataOutput.hpp"
#include "DataInput.hpp"
-#include "VectorT.hpp"
#include "HashMapT.hpp"
#include "HashSetT.hpp"
#include "GeodeTypeIds.hpp"
@@ -303,14 +302,14 @@ inline void writeObject(apache::geode::client::DataOutput& output,
}
}
-inline uint32_t objectSize(const VectorOfCacheable& value) {
+inline uint32_t objectSize(const std::vector<std::shared_ptr<Cacheable>>& value) {
size_t objectSize = 0;
for (const auto& iter : value) {
if (iter) {
objectSize += iter->objectSize();
}
}
- objectSize += sizeof(CacheablePtr) * value.size();
+ objectSize += sizeof(std::shared_ptr<Cacheable>) * value.size();
return static_cast<uint32_t>(objectSize);
}
@@ -347,7 +346,7 @@ inline uint32_t objectSize(const HashMapOfCacheable& value) {
}
}
objectSize += static_cast<uint32_t>(
- (sizeof(CacheableKeyPtr) + sizeof(CacheablePtr)) * value.size());
+ (sizeof(std::shared_ptr<CacheableKey>) + sizeof(std::shared_ptr<Cacheable>)) * value.size());
return objectSize;
}
@@ -381,7 +380,7 @@ inline uint32_t objectSize(const HashSetOfCacheableKey& value) {
objectSize += iter->objectSize();
}
}
- objectSize += static_cast<uint32_t>(sizeof(CacheableKeyPtr) * value.size());
+ objectSize += static_cast<uint32_t>(sizeof(std::shared_ptr<CacheableKey>) * value.size());
return objectSize;
}
diff --git a/cppcache/include/geode/Struct.hpp b/cppcache/include/geode/Struct.hpp
index cea08c3..a98c3a1 100644
--- a/cppcache/include/geode/Struct.hpp
+++ b/cppcache/include/geode/Struct.hpp
@@ -51,7 +51,8 @@ class CPPCACHE_EXPORT Struct : public Serializable {
/**
* Constructor - meant only for internal use.
*/
- Struct(StructSet* ssPtr, std::vector<SerializablePtr>& fieldValues);
+ Struct(StructSet* ssPtr,
+ std::vector<std::shared_ptr<Serializable>>& fieldValues);
/**
* Factory function for registration of <code>Struct</code>.
@@ -65,7 +66,7 @@ class CPPCACHE_EXPORT Struct : public Serializable {
* @returns A smart pointer to the field value or nullptr if index out of
* bounds.
*/
- const SerializablePtr operator[](int32_t index) const;
+ const std::shared_ptr<Serializable> operator[](int32_t index) const;
/**
* Get the field value for the given field name.
@@ -74,14 +75,15 @@ class CPPCACHE_EXPORT Struct : public Serializable {
* @returns A smart pointer to the field value.
* @throws IllegalArgumentException if the field name is not found.
*/
- const SerializablePtr operator[](const std::string& fieldName) const;
+ const std::shared_ptr<Serializable> operator[](
+ const std::string& fieldName) const;
/**
* Get the parent StructSet of this Struct.
*
* @returns A smart pointer to the parent StructSet of this Struct.
*/
- const StructSetPtr getStructSet() const;
+ const std::shared_ptr<StructSet> getStructSet() const;
/**
* Check whether another field value is available to iterate over in this
@@ -104,7 +106,7 @@ class CPPCACHE_EXPORT Struct : public Serializable {
* @returns A smart pointer to the next item in the Struct or nullptr if no
* more available.
*/
- const SerializablePtr next();
+ const std::shared_ptr<Serializable> next();
/**
* Deserializes the Struct object from the DataInput. @TODO KN: better comment
@@ -153,7 +155,7 @@ class CPPCACHE_EXPORT Struct : public Serializable {
typedef std::unordered_map<std::string, int32_t> FieldNames;
FieldNames m_fieldNames;
- std::vector<SerializablePtr> m_fieldValues;
+ std::vector<std::shared_ptr<Serializable>> m_fieldValues;
StructSet* m_parent;
diff --git a/cppcache/include/geode/StructSet.hpp b/cppcache/include/geode/StructSet.hpp
index 116add7..143a852 100644
--- a/cppcache/include/geode/StructSet.hpp
+++ b/cppcache/include/geode/StructSet.hpp
@@ -65,7 +65,8 @@ class CPPCACHE_EXPORT StructSet : public CqResults {
* @throws IllegalArgumentException if the index is out of bounds.
* @returns A smart pointer to the item indexed.
*/
- virtual const SerializablePtr operator[](int32_t index) const = 0;
+ virtual const std::shared_ptr<Serializable> operator[](
+ int32_t index) const = 0;
/**
* Get the index number of the specified field name in the StructSet.
diff --git a/cppcache/include/geode/SystemProperties.hpp b/cppcache/include/geode/SystemProperties.hpp
index 9372033..8262cd7 100644
--- a/cppcache/include/geode/SystemProperties.hpp
+++ b/cppcache/include/geode/SystemProperties.hpp
@@ -52,7 +52,7 @@ class CPPCACHE_EXPORT SystemProperties {
* If useMemType is true, use the given member type; if false, always set
* member type to SERVER.
*/
- SystemProperties(const PropertiesPtr& propertiesPtr,
+ SystemProperties(const std::shared_ptr<Properties>& propertiesPtr,
const char* configFile = nullptr);
/**
@@ -312,9 +312,9 @@ class CPPCACHE_EXPORT SystemProperties {
}
/** Returns securityPropertiesPtr.
- * @return PropertiesPtr value.
+ * @return std::shared_ptr<Properties> value.
*/
- PropertiesPtr getSecurityProperties() const {
+ std::shared_ptr<Properties> getSecurityProperties() const {
return m_securityPropertiesPtr;
}
@@ -426,10 +426,10 @@ class CPPCACHE_EXPORT SystemProperties {
std::chrono::milliseconds m_notifyAckInterval;
std::chrono::milliseconds m_notifyDupCheckLife;
- PropertiesPtr m_securityPropertiesPtr;
+ std::shared_ptr<Properties> m_securityPropertiesPtr;
- CacheableStringPtr m_securityClientDhAlgo;
- CacheableStringPtr m_securityClientKsPath;
+ std::shared_ptr<CacheableString> m_securityClientDhAlgo;
+ std::shared_ptr<CacheableString> m_securityClientKsPath;
char* m_durableClientId;
std::chrono::seconds m_durableTimeout;
diff --git a/cppcache/include/geode/TypeRegistry.hpp b/cppcache/include/geode/TypeRegistry.hpp
index 1229daf..7b65fe6 100644
--- a/cppcache/include/geode/TypeRegistry.hpp
+++ b/cppcache/include/geode/TypeRegistry.hpp
@@ -27,6 +27,7 @@
namespace apache {
namespace geode {
namespace client {
+class PdxSerializer;
class TypeRegistry {
public:
@@ -55,7 +56,7 @@ class TypeRegistry {
* user domain classes.
* @see PdxSerializer
*/
- void registerPdxSerializer(PdxSerializerPtr pdxSerializer);
+ void registerPdxSerializer(std::shared_ptr<PdxSerializer> pdxSerializer);
protected:
private:
diff --git a/cppcache/include/geode/UserFunctionExecutionException.hpp b/cppcache/include/geode/UserFunctionExecutionException.hpp
index 0d0efb6..ad74858 100644
--- a/cppcache/include/geode/UserFunctionExecutionException.hpp
+++ b/cppcache/include/geode/UserFunctionExecutionException.hpp
@@ -28,8 +28,6 @@ namespace geode {
namespace client {
class UserFunctionExecutionException;
-typedef std::shared_ptr<UserFunctionExecutionException>
- UserFunctionExecutionExceptionPtr;
/**
* @brief UserFunctionExecutionException class is used to encapsulate geode
@@ -49,7 +47,7 @@ class UserFunctionExecutionException : public Serializable {
/**
* @brief constructors
*/
- UserFunctionExecutionException(CacheableStringPtr msg);
+ UserFunctionExecutionException(std::shared_ptr<CacheableString> msg);
/**
*@brief serialize this object
@@ -97,18 +95,18 @@ class UserFunctionExecutionException : public Serializable {
virtual int8_t typeId() const;
/**
- *@brief return as CacheableStringPtr the Exception message returned from
- *geode sendException api.
+ *@brief return as std::shared_ptr<CacheableString> the Exception message
+ *returned from geode sendException api.
**/
- CacheableStringPtr getMessage() { return m_message; }
+ std::shared_ptr<CacheableString> getMessage() { return m_message; }
/**
- *@brief return as CacheableStringPtr the Exception name returned from geode
- *sendException api.
+ *@brief return as std::shared_ptr<CacheableString> the Exception name
+ *returned from geode sendException api.
**/
- CacheableStringPtr getName() {
+ std::shared_ptr<CacheableString> getName() {
const char* msg = "UserFunctionExecutionException";
- CacheableStringPtr str = CacheableString::create(msg);
+ auto str = CacheableString::create(msg);
return str;
}
@@ -117,7 +115,7 @@ class UserFunctionExecutionException : public Serializable {
UserFunctionExecutionException(const UserFunctionExecutionException& other);
void operator=(const UserFunctionExecutionException& other);
- CacheableStringPtr m_message; // error message
+ std::shared_ptr<CacheableString> m_message; // error message
};
} // namespace client
diff --git a/cppcache/include/geode/VectorT.hpp b/cppcache/include/geode/VectorT.hpp
deleted file mode 100644
index d3225a5..0000000
--- a/cppcache/include/geode/VectorT.hpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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.
- */
-
-#pragma once
-
-#ifndef GEODE_VECTORT_H_
-#define GEODE_VECTORT_H_
-
-#include <vector>
-#include <memory>
-
-#include "geode_globals.hpp"
-#include "Cacheable.hpp"
-#include "CacheableKey.hpp"
-
-namespace apache {
-namespace geode {
-namespace client {
-
-// TODO move to more appropriate location
-typedef std::vector<RegionEntryPtr> VectorOfRegionEntry;
-typedef std::vector<RegionPtr> VectorOfRegion;
-typedef std::vector<CacheablePtr> VectorOfCacheable;
-typedef std::shared_ptr<VectorOfCacheable> VectorOfCacheablePtr;
-typedef std::vector<CacheableKeyPtr> VectorOfCacheableKey;
-typedef std::shared_ptr<VectorOfCacheableKey> VectorOfCacheableKeyPtr;
-typedef std::vector<CacheableStringPtr> VectorOfCacheableString;
-
-} // namespace client
-} // namespace geode
-} // namespace apache
-
-#endif // GEODE_VECTORT_H_
diff --git a/cppcache/include/geode/WritablePdxInstance.hpp b/cppcache/include/geode/WritablePdxInstance.hpp
index d4ea0db..ec075de 100644
--- a/cppcache/include/geode/WritablePdxInstance.hpp
+++ b/cppcache/include/geode/WritablePdxInstance.hpp
@@ -28,7 +28,7 @@
namespace apache {
namespace geode {
namespace client {
-
+class CacheableObjectArray;
/**
* WritablePdxInstance is a {@link PdxInstance} that also supports field
* modification
@@ -51,15 +51,17 @@ class CPPCACHE_EXPORT WritablePdxInstance : public PdxInstance {
* The setField method has copy-on-write semantics.
* So for the modifications to be stored in the cache the WritablePdxInstance
* must be put into a region after setField has been called one or more times.
- * CacheablePtr type is corresponding to java object type.
+ * std::shared_ptr<Cacheable> type is corresponding to java object type.
* @param fieldName
* name of the field whose value will be set
* @param value
- * value that will be set to the field of type CacheablePtr
+ * value that will be set to the field of type
+ * std::shared_ptr<Cacheable>
* @throws IllegalStateException if the named field does not exist
* or if the type of the value is not compatible with the field.
*/
- virtual void setField(const char* fieldName, CacheablePtr value) = 0;
+ virtual void setField(const char* fieldName,
+ std::shared_ptr<Cacheable> value) = 0;
/**
* Set the existing named field to the given value.
@@ -209,15 +211,18 @@ class CPPCACHE_EXPORT WritablePdxInstance : public PdxInstance {
* The setField method has copy-on-write semantics.
* So for the modifications to be stored in the cache the WritablePdxInstance
* must be put into a region after setField has been called one or more times.
- * CacheableDatePtr type is corresponding to java Java.util.date type.
+ * std::shared_ptr<CacheableDate> type is corresponding to java Java.util.date
+ * type.
* @param fieldName
* name of the field whose value will be set
* @param value
- * value that will be set to the field of type CacheableDatePtr
+ * value that will be set to the field of type
+ * std::shared_ptr<CacheableDate>
* @throws IllegalStateException if the named field does not exist
* or if the type of the value is not compatible with the field.
*/
- virtual void setField(const char* fieldName, CacheableDatePtr value) = 0;
+ virtual void setField(const char* fieldName,
+ std::shared_ptr<CacheableDate> value) = 0;
/**
* Set the existing named field to the given value.
@@ -496,17 +501,18 @@ class CPPCACHE_EXPORT WritablePdxInstance : public PdxInstance {
* The setField method has copy-on-write semantics.
* So for the modifications to be stored in the cache the WritablePdxInstance
* must be put into a region after setField has been called one or more times.
- * CacheableObjectArrayPtr type is corresponding to java Object[] type.
+ * std::shared_ptr<CacheableObjectArray> type is corresponding to java
+ * Object[] type.
* @param fieldName
* name of the field whose value will be set
* @param value
* value that will be set to the field of type
- * CacheableObjectArrayPtr
+ * std::shared_ptr<CacheableObjectArray>
* @throws IllegalStateException if the named field does not exist
* or if the type of the value is not compatible with the field.
*/
virtual void setField(const char* fieldName,
- CacheableObjectArrayPtr value) = 0;
+ std::shared_ptr<CacheableObjectArray> value) = 0;
protected:
/**
diff --git a/cppcache/include/geode/geode_types.hpp b/cppcache/include/geode/geode_types.hpp
index 882893a..224686d 100644
--- a/cppcache/include/geode/geode_types.hpp
+++ b/cppcache/include/geode/geode_types.hpp
@@ -32,79 +32,7 @@ namespace apache {
namespace geode {
namespace client {
-class CacheFactory;
-#define _GF_PTR_DEF_(a, b) \
- class CPPCACHE_EXPORT a; \
- typedef std::shared_ptr<a> b;
-
-_GF_PTR_DEF_(CacheFactory, CacheFactoryPtr);
-_GF_PTR_DEF_(RegionService, RegionServicePtr);
-_GF_PTR_DEF_(GeodeCache, GeodeCachePtr);
-_GF_PTR_DEF_(Cache, CachePtr);
-_GF_PTR_DEF_(RegionFactory, RegionFactoryPtr);
-_GF_PTR_DEF_(AttributesFactory, AttributesFactoryPtr);
-_GF_PTR_DEF_(Region, RegionPtr);
-_GF_PTR_DEF_(AttributesMutator, AttributesMutatorPtr);
-_GF_PTR_DEF_(MapEntry, MapEntryPtr);
-_GF_PTR_DEF_(RegionEntry, RegionEntryPtr);
-_GF_PTR_DEF_(EventId, EventIdPtr);
-_GF_PTR_DEF_(CacheStatistics, CacheStatisticsPtr);
-_GF_PTR_DEF_(PersistenceManager, PersistenceManagerPtr);
-_GF_PTR_DEF_(Properties, PropertiesPtr);
-_GF_PTR_DEF_(FunctionService, FunctionServicePtr);
-_GF_PTR_DEF_(CacheLoader, CacheLoaderPtr);
-_GF_PTR_DEF_(CacheListener, CacheListenerPtr);
-_GF_PTR_DEF_(CacheWriter, CacheWriterPtr);
-_GF_PTR_DEF_(MembershipListener, MembershipListenerPtr);
-_GF_PTR_DEF_(RegionAttributes, RegionAttributesPtr);
-_GF_PTR_DEF_(CacheableDate, CacheableDatePtr);
-_GF_PTR_DEF_(CacheableFileName, CacheableFileNamePtr);
-_GF_PTR_DEF_(CacheableKey, CacheableKeyPtr);
-_GF_PTR_DEF_(CacheableObjectArray, CacheableObjectArrayPtr);
-_GF_PTR_DEF_(CacheableString, CacheableStringPtr);
-_GF_PTR_DEF_(CacheableUndefined, CacheableUndefinedPtr);
-_GF_PTR_DEF_(Serializable, SerializablePtr);
-_GF_PTR_DEF_(PdxSerializable, PdxSerializablePtr);
-_GF_PTR_DEF_(StackTrace, StackTracePtr);
-_GF_PTR_DEF_(SelectResults, SelectResultsPtr);
-_GF_PTR_DEF_(CqResults, CqResultsPtr);
-_GF_PTR_DEF_(ResultSet, ResultSetPtr);
-_GF_PTR_DEF_(StructSet, StructSetPtr);
-_GF_PTR_DEF_(Struct, StructPtr);
-_GF_PTR_DEF_(Query, QueryPtr);
-_GF_PTR_DEF_(QueryService, QueryServicePtr);
-_GF_PTR_DEF_(AuthInitialize, AuthInitializePtr);
-_GF_PTR_DEF_(CqQuery, CqQueryPtr);
-_GF_PTR_DEF_(CqListener, CqListenerPtr);
-_GF_PTR_DEF_(CqAttributes, CqAttributesPtr);
-_GF_PTR_DEF_(CqServiceStatistics, CqServiceStatisticsPtr);
-_GF_PTR_DEF_(CqStatistics, CqStatisticsPtr);
-_GF_PTR_DEF_(CqAttributesMutator, CqAttributesMutatorPtr);
-_GF_PTR_DEF_(ClientHealthStats, ClientHealthStatsPtr);
-_GF_PTR_DEF_(Pool, PoolPtr);
-_GF_PTR_DEF_(PoolFactory, PoolFactoryPtr);
-_GF_PTR_DEF_(PoolAttributes, PoolAttributesPtr);
-_GF_PTR_DEF_(ResultCollector, ResultCollectorPtr);
-_GF_PTR_DEF_(Execution, ExecutionPtr);
-_GF_PTR_DEF_(Delta, DeltaPtr);
-_GF_PTR_DEF_(PartitionResolver, PartitionResolverPtr);
-_GF_PTR_DEF_(FixedPartitionResolver, FixedPartitionResolverPtr);
-_GF_PTR_DEF_(CacheTransactionManager, CacheTransactionManagerPtr);
-_GF_PTR_DEF_(TransactionId, TransactionIdPtr);
-_GF_PTR_DEF_(EntryEvent, EntryEventPtr);
-_GF_PTR_DEF_(PdxReader, PdxReaderPtr);
-_GF_PTR_DEF_(PdxWriter, PdxWriterPtr);
-_GF_PTR_DEF_(PdxWrapper, PdxWrapperPtr);
-_GF_PTR_DEF_(PdxSerializer, PdxSerializerPtr);
-_GF_PTR_DEF_(PdxInstanceFactory, PdxInstanceFactoryPtr);
-_GF_PTR_DEF_(PdxInstance, PdxInstancePtr);
-_GF_PTR_DEF_(WritablePdxInstance, WritablePdxInstancePtr);
-_GF_PTR_DEF_(PdxUnreadFields, PdxUnreadFieldsPtr);
-_GF_PTR_DEF_(CacheableEnum, CacheableEnumPtr);
-_GF_PTR_DEF_(CqStatusListener, CqStatusListenerPtr);
-_GF_PTR_DEF_(InternalCacheTransactionManager2PC,
- InternalCacheTransactionManager2PCPtr);
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/integration-test/BuiltinCacheableWrappers.hpp b/cppcache/integration-test/BuiltinCacheableWrappers.hpp
index ed2f58b..c1332ee 100644
--- a/cppcache/integration-test/BuiltinCacheableWrappers.hpp
+++ b/cppcache/integration-test/BuiltinCacheableWrappers.hpp
@@ -25,10 +25,16 @@
#include <wchar.h>
#include <ace/Date_Time.h>
+
#include "CacheHelper.hpp"
#include "CacheRegionHelper.hpp"
#include "CacheableWrapper.hpp"
#include "CacheImpl.hpp"
+
+#include <geode/CacheableFileName.hpp>
+#include <geode/CacheableUndefined.hpp>
+#include <geode/CacheableObjectArray.hpp>
+
using namespace apache::geode::client;
namespace CacheableHelper {
@@ -201,7 +207,7 @@ class CacheableBooleanWrapper : public CacheableWrapper {
CacheableHelper::random<uint8_t>(UCHAR_MAX) % 2);
}
- virtual uint32_t getCheckSum(const CacheablePtr object) const {
+ virtual uint32_t getCheckSum(const std::shared_ptr<Cacheable> object) const {
const CacheableBoolean* obj =
dynamic_cast<const CacheableBoolean*>(object.get());
ASSERT(obj != nullptr, "getCheckSum: null object.");
@@ -230,7 +236,7 @@ class CacheableByteWrapper : public CacheableWrapper {
CacheableByte::create(CacheableHelper::random<uint8_t>(UCHAR_MAX));
}
- virtual uint32_t getCheckSum(const CacheablePtr object) const {
+ virtual uint32_t getCheckSum(const std::shared_ptr<Cacheable> object) const {
const CacheableByte* obj = dynamic_cast<const CacheableByte*>(object.get());
ASSERT(obj != nullptr, "getCheckSum: null object.");
return CacheableHelper::crc32<uint8_t>(obj->value());
@@ -258,7 +264,7 @@ class CacheableDoubleWrapper : public CacheableWrapper {
CacheableHelper::random(static_cast<double>(maxSize)));
}
- virtual uint32_t getCheckSum(const CacheablePtr object) const {
+ virtual uint32_t getCheckSum(const std::shared_ptr<Cacheable> object) const {
const CacheableDouble* obj =
dynamic_cast<const CacheableDouble*>(object.get());
ASSERT(obj != nullptr, "getCheckSum: null object.");
@@ -295,7 +301,7 @@ class CacheableDateWrapper : public CacheableWrapper {
m_cacheableObject = CacheableDate::create(epoctime);
}
- virtual uint32_t getCheckSum(const CacheablePtr object) const {
+ virtual uint32_t getCheckSum(const std::shared_ptr<Cacheable> object) const {
const CacheableDate* obj = dynamic_cast<const CacheableDate*>(object.get());
ASSERT(obj != nullptr, "getCheckSum: null object.");
return CacheableHelper::crc32<int64_t>(obj->milliseconds());
@@ -347,7 +353,7 @@ class CacheableFileNameWrapper : public CacheableWrapper {
randStr.data(), static_cast<int32_t>(randStr.size()));
}
- virtual uint32_t getCheckSum(const CacheablePtr object) const {
+ virtual uint32_t getCheckSum(const std::shared_ptr<Cacheable> object) const {
const CacheableFileName* obj =
dynamic_cast<const CacheableFileName*>(object.get());
return (obj != nullptr
@@ -377,7 +383,7 @@ class CacheableFloatWrapper : public CacheableWrapper {
CacheableHelper::random(static_cast<float>(maxSize)));
}
- virtual uint32_t getCheckSum(const CacheablePtr object) const {
+ virtual uint32_t getCheckSum(const std::shared_ptr<Cacheable> object) const {
const CacheableFloat* obj =
dynamic_cast<const CacheableFloat*>(object.get());
ASSERT(obj != nullptr, "getCheckSum: null object.");
@@ -406,7 +412,7 @@ class CacheableInt16Wrapper : public CacheableWrapper {
CacheableInt16::create(CacheableHelper::random<int16_t>(SHRT_MAX));
}
- virtual uint32_t getCheckSum(const CacheablePtr object) const {
+ virtual uint32_t getCheckSum(const std::shared_ptr<Cacheable> object) const {
const CacheableInt16* obj =
dynamic_cast<const CacheableInt16*>(object.get());
ASSERT(obj != nullptr, "getCheckSum: null object.");
@@ -435,7 +441,7 @@ class CacheableInt32Wrapper : public CacheableWrapper {
CacheableInt32::create(CacheableHelper::random<int32_t>(INT_MAX));
}
- virtual uint32_t getCheckSum(const CacheablePtr object) const {
+ virtual uint32_t getCheckSum(const std::shared_ptr<Cacheable> object) const {
const CacheableInt32* obj =
dynamic_cast<const CacheableInt32*>(object.get());
ASSERT(obj != nullptr, "getCheckSum: null object.");
@@ -465,7 +471,7 @@ class CacheableInt64Wrapper : public CacheableWrapper {
m_cacheableObject = CacheableInt64::create(rnd);
}
- virtual uint32_t getCheckSum(const CacheablePtr object) const {
+ virtual uint32_t getCheckSum(const std::shared_ptr<Cacheable> object) const {
const CacheableInt64* obj =
dynamic_cast<const CacheableInt64*>(object.get());
ASSERT(obj != nullptr, "getCheckSum: null object.");
@@ -506,7 +512,7 @@ class CacheableStringWrapper : public CacheableWrapper {
randStr.data(), static_cast<int32_t>(randStr.length()));
}
- virtual uint32_t getCheckSum(const CacheablePtr object) const {
+ virtual uint32_t getCheckSum(const std::shared_ptr<Cacheable> object) const {
const CacheableString* obj =
dynamic_cast<const CacheableString*>(object.get());
return (obj != nullptr
@@ -551,7 +557,7 @@ class CacheableHugeStringWrapper : public CacheableWrapper {
randStr.data(), static_cast<int32_t>(randStr.length()));
}
- virtual uint32_t getCheckSum(const CacheablePtr object) const {
+ virtual uint32_t getCheckSum(const std::shared_ptr<Cacheable> object) const {
const CacheableString* obj =
dynamic_cast<const CacheableString*>(object.get());
ASSERT(obj != nullptr, "getCheckSum: null object.");
@@ -597,7 +603,7 @@ class CacheableHugeUnicodeStringWrapper : public CacheableWrapper {
randStr.data(), static_cast<int32_t>(randStr.length()));
}
- virtual uint32_t getCheckSum(const CacheablePtr object) const {
+ virtual uint32_t getCheckSum(const std::shared_ptr<Cacheable> object) const {
const CacheableString* obj =
dynamic_cast<const CacheableString*>(object.get());
ASSERT(obj != nullptr, "getCheckSum: null object.");
@@ -641,7 +647,7 @@ class CacheableUnicodeStringWrapper : public CacheableWrapper {
randStr.data(), static_cast<int32_t>(randStr.length()));
}
- virtual uint32_t getCheckSum(const CacheablePtr object) const {
+ virtual uint32_t getCheckSum(const std::shared_ptr<Cacheable> object) const {
const CacheableString* obj =
dynamic_cast<const CacheableString*>(object.get());
ASSERT(obj != nullptr, "getCheckSum: null object.");
@@ -671,7 +677,7 @@ class CacheableWideCharWrapper : public CacheableWrapper {
CacheableCharacter::create(CacheableHelper::random<char16_t>(SHRT_MAX));
}
- virtual uint32_t getCheckSum(const CacheablePtr object) const {
+ virtual uint32_t getCheckSum(const std::shared_ptr<Cacheable> object) const {
auto obj = std::dynamic_pointer_cast<const CacheableCharacter>(object);
ASSERT(obj != nullptr, "getCheckSum: null object.");
return CacheableHelper::crc32<char16_t>(obj->value());
@@ -697,10 +703,8 @@ class CacheableHashMapTypeWrapper : public CacheableWrapper {
m_cacheableObject = HMAPTYPE::create(maxSize);
HMAPTYPE* chmp = dynamic_cast<HMAPTYPE*>(m_cacheableObject.get());
ASSERT(chmp != nullptr, "initRandomValue: null object.");
- std::vector<int8_t> keyTypeIds =
- CacheableWrapperFactory::getRegisteredKeyTypes();
- std::vector<int8_t> valTypeIds =
- CacheableWrapperFactory::getRegisteredValueTypes();
+ auto keyTypeIds = CacheableWrapperFactory::getRegisteredKeyTypes();
+ auto valTypeIds = CacheableWrapperFactory::getRegisteredValueTypes();
for (std::vector<int8_t>::iterator keyIter = keyTypeIds.begin();
keyIter != keyTypeIds.end(); keyIter++) {
@@ -746,7 +750,7 @@ class CacheableHashMapTypeWrapper : public CacheableWrapper {
}
}
- virtual uint32_t getCheckSum(const CacheablePtr object) const {
+ virtual uint32_t getCheckSum(const std::shared_ptr<Cacheable> object) const {
const HMAPTYPE* obj = dynamic_cast<const HMAPTYPE*>(object.get());
ASSERT(obj != nullptr, "getCheckSum: null object.");
uint32_t chksum = 0;
@@ -792,8 +796,7 @@ class CacheableHashSetTypeWrapper : public CacheableWrapper {
virtual void initRandomValue(int32_t maxSize) {
Serializable* ser = HSETTYPE::createDeserializable();
HSETTYPE* set = (HSETTYPE*)ser;
- std::vector<int8_t> keyTypeIds =
- CacheableWrapperFactory::getRegisteredKeyTypes();
+ auto keyTypeIds = CacheableWrapperFactory::getRegisteredKeyTypes();
size_t sizeOfTheVector = keyTypeIds.size();
maxSize = maxSize / static_cast<int32_t>(sizeOfTheVector) + 1;
for (size_t i = 0; i < sizeOfTheVector; i++) {
@@ -801,7 +804,7 @@ class CacheableHashSetTypeWrapper : public CacheableWrapper {
CacheableWrapper* wrapper =
CacheableWrapperFactory::createInstance(keyTypeId);
wrapper->initRandomValue(maxSize);
- CacheablePtr cptr = wrapper->getCacheable();
+ auto cptr = wrapper->getCacheable();
set->insert(
std::dynamic_pointer_cast<CacheableKey>(wrapper->getCacheable()));
delete wrapper;
@@ -809,7 +812,7 @@ class CacheableHashSetTypeWrapper : public CacheableWrapper {
m_cacheableObject = std::shared_ptr<Serializable>(set);
}
- virtual uint32_t getCheckSum(const CacheablePtr object) const {
+ virtual uint32_t getCheckSum(const std::shared_ptr<Cacheable> object) const {
const HSETTYPE* obj = dynamic_cast<const HSETTYPE*>(object.get());
ASSERT(obj != nullptr, "getCheckSum: null object.");
uint32_t checkSum = 0;
@@ -846,7 +849,7 @@ class CacheableBytesWrapper : public CacheableWrapper {
delete[] randArr;
}
- virtual uint32_t getCheckSum(const CacheablePtr object) const {
+ virtual uint32_t getCheckSum(const std::shared_ptr<Cacheable> object) const {
const CacheableBytes* obj =
dynamic_cast<const CacheableBytes*>(object.get());
ASSERT(obj != nullptr, "getCheckSum: null object.");
@@ -874,7 +877,7 @@ class CacheableDoubleArrayWrapper : public CacheableWrapper {
delete[] randArr;
}
- virtual uint32_t getCheckSum(const CacheablePtr object) const {
+ virtual uint32_t getCheckSum(const std::shared_ptr<Cacheable> object) const {
const CacheableDoubleArray* obj =
dynamic_cast<const CacheableDoubleArray*>(object.get());
ASSERT(obj != nullptr, "getCheckSum: null object.");
@@ -900,7 +903,7 @@ class CacheableFloatArrayWrapper : public CacheableWrapper {
delete[] randArr;
}
- virtual uint32_t getCheckSum(const CacheablePtr object) const {
+ virtual uint32_t getCheckSum(const std::shared_ptr<Cacheable> object) const {
const CacheableFloatArray* obj =
dynamic_cast<const CacheableFloatArray*>(object.get());
ASSERT(obj != nullptr, "getCheckSum: null object.");
@@ -925,7 +928,7 @@ class CacheableInt16ArrayWrapper : public CacheableWrapper {
delete[] randArr;
}
- virtual uint32_t getCheckSum(const CacheablePtr object) const {
+ virtual uint32_t getCheckSum(const std::shared_ptr<Cacheable> object) const {
const CacheableInt16Array* obj =
dynamic_cast<const CacheableInt16Array*>(object.get());
ASSERT(obj != nullptr, "getCheckSum: null object.");
@@ -950,7 +953,7 @@ class CacheableInt32ArrayWrapper : public CacheableWrapper {
delete[] randArr;
}
- virtual uint32_t getCheckSum(const CacheablePtr object) const {
+ virtual uint32_t getCheckSum(const std::shared_ptr<Cacheable> object) const {
const CacheableInt32Array* obj =
dynamic_cast<const CacheableInt32Array*>(object.get());
ASSERT(obj != nullptr, "getCheckSum: null object.");
@@ -975,7 +978,7 @@ class CacheableInt64ArrayWrapper : public CacheableWrapper {
delete[] randArr;
}
- virtual uint32_t getCheckSum(const CacheablePtr object) const {
+ virtual uint32_t getCheckSum(const std::shared_ptr<Cacheable> object) const {
const CacheableInt64Array* obj =
dynamic_cast<const CacheableInt64Array*>(object.get());
ASSERT(obj != nullptr, "getCheckSum: null object.");
@@ -997,7 +1000,7 @@ class CacheableNullStringWrapper : public CacheableWrapper {
m_cacheableObject = CacheableString::create((char*)nullptr);
}
- virtual uint32_t getCheckSum(const CacheablePtr object) const {
+ virtual uint32_t getCheckSum(const std::shared_ptr<Cacheable> object) const {
ASSERT(object == nullptr, "getCheckSum: expected null object");
return 0;
}
@@ -1022,7 +1025,8 @@ class CacheableStringArrayWrapper : public CacheableWrapper {
maxSize = 2;
}
- CacheableStringPtr* randArr = new CacheableStringPtr[arraySize];
+ std::shared_ptr<CacheableString>* randArr =
+ new std::shared_ptr<CacheableString>[arraySize];
for (int32_t arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) {
if (arrayIndex % 2 == 0) {
std::string randStr;
@@ -1039,12 +1043,12 @@ class CacheableStringArrayWrapper : public CacheableWrapper {
m_cacheableObject = CacheableStringArray::create(randArr, arraySize);
}
- virtual uint32_t getCheckSum(const CacheablePtr object) const {
+ virtual uint32_t getCheckSum(const std::shared_ptr<Cacheable> object) const {
const CacheableStringArray* obj =
dynamic_cast<const CacheableStringArray*>(object.get());
ASSERT(obj != nullptr, "getCheckSum: null object.");
uint32_t checkSum = 0;
- CacheableStringPtr str;
+ std::shared_ptr<CacheableString> str;
for (int32_t index = 0; index < obj->length(); index++) {
str = obj->operator[](index);
if (str->isWideString()) {
@@ -1074,7 +1078,9 @@ class CacheableUndefinedWrapper : public CacheableWrapper {
CacheableUndefined::createDeserializable());
}
- virtual uint32_t getCheckSum(const CacheablePtr object) const { return 0; }
+ virtual uint32_t getCheckSum(const std::shared_ptr<Cacheable> object) const {
+ return 0;
+ }
};
template <typename VECTTYPE>
@@ -1093,8 +1099,7 @@ class CacheableVectorTypeWrapper : public CacheableWrapper {
virtual void initRandomValue(int32_t maxSize) {
Serializable* ser = VECTTYPE::createDeserializable();
VECTTYPE* vec = (VECTTYPE*)ser;
- std::vector<int8_t> valueTypeIds =
- CacheableWrapperFactory::getRegisteredValueTypes();
+ auto valueTypeIds = CacheableWrapperFactory::getRegisteredValueTypes();
size_t sizeOfTheVector = valueTypeIds.size();
maxSize = maxSize / static_cast<int32_t>(sizeOfTheVector) + 1;
for (size_t i = 0; i < sizeOfTheVector; i++) {
@@ -1110,12 +1115,12 @@ class CacheableVectorTypeWrapper : public CacheableWrapper {
m_cacheableObject = std::shared_ptr<Serializable>(vec);
}
- virtual uint32_t getCheckSum(const CacheablePtr object) const {
+ virtual uint32_t getCheckSum(const std::shared_ptr<Cacheable> object) const {
const VECTTYPE* vec = dynamic_cast<const VECTTYPE*>(object.get());
ASSERT(vec != nullptr, "getCheckSum: null object.");
uint32_t checkSum = 0;
for (uint32_t index = 0; index < (uint32_t)vec->size(); ++index) {
- CacheablePtr obj = vec->at(index);
+ auto obj = vec->at(index);
if (obj == nullptr) {
continue;
}
@@ -1154,8 +1159,7 @@ class CacheableObjectArrayWrapper : public CacheableWrapper {
virtual void initRandomValue(int32_t maxSize) {
Serializable* ser = CacheableObjectArray::createDeserializable();
CacheableObjectArray* arr = (CacheableObjectArray*)ser;
- std::vector<int8_t> valueTypeIds =
- CacheableWrapperFactory::getRegisteredValueTypes();
+ auto valueTypeIds = CacheableWrapperFactory::getRegisteredValueTypes();
size_t sizeOfTheVector = valueTypeIds.size();
maxSize = maxSize / static_cast<int32_t>(sizeOfTheVector) + 1;
for (size_t i = 0; i < sizeOfTheVector; i++) {
@@ -1171,14 +1175,14 @@ class CacheableObjectArrayWrapper : public CacheableWrapper {
m_cacheableObject = std::shared_ptr<Serializable>(arr);
}
- virtual uint32_t getCheckSum(const CacheablePtr object) const {
+ virtual uint32_t getCheckSum(const std::shared_ptr<Cacheable> object) const {
const CacheableObjectArray* arr =
dynamic_cast<const CacheableObjectArray*>(object.get());
ASSERT(arr != nullptr, "getCheckSum: null object.");
uint32_t checkSum = 0;
for (uint32_t index = 0; index < static_cast<uint32_t>(arr->size());
++index) {
- const CacheablePtr obj = arr->at(index);
+ const auto obj = arr->at(index);
if (obj == nullptr) {
continue;
}
diff --git a/cppcache/integration-test/CacheHelper.cpp b/cppcache/integration-test/CacheHelper.cpp
index a046815..b18f122 100644
--- a/cppcache/integration-test/CacheHelper.cpp
+++ b/cppcache/integration-test/CacheHelper.cpp
@@ -24,7 +24,6 @@
#include <ace/INET_Addr.h>
#include <ace/SOCK_Acceptor.h>
-#include <geode/GeodeCppCache.hpp>
#include <geode/SystemProperties.hpp>
#include <geode/PoolManager.hpp>
#include <geode/util/chrono/duration.hpp>
@@ -70,8 +69,7 @@ extern ClientCleanup gClientCleanup;
#define SEED 0
#define RANDOM_NUMBER_OFFSET 14000
#define RANDOM_NUMBER_DIVIDER 15000
-
-CachePtr CacheHelper::getCache() { return cachePtr; }
+std::shared_ptr<Cache> CacheHelper::getCache() { return cachePtr; }
CacheHelper& CacheHelper::getHelper() {
if (singleton == nullptr) {
@@ -80,9 +78,10 @@ CacheHelper& CacheHelper::getHelper() {
return *singleton;
}
-CacheHelper::CacheHelper(const char* member_id, const PropertiesPtr& configPtr,
+CacheHelper::CacheHelper(const char* member_id,
+ const std::shared_ptr<Properties>& configPtr,
const bool noRootRegion) {
- PropertiesPtr pp = configPtr;
+ auto pp = configPtr;
if (pp == nullptr) {
pp = Properties::create();
}
@@ -105,8 +104,8 @@ CacheHelper::CacheHelper(const char* member_id, const PropertiesPtr& configPtr,
/** rootRegionPtr will still be null... */
CacheHelper::CacheHelper(const char* member_id, const char* cachexml,
- const PropertiesPtr& configPtr) {
- PropertiesPtr pp = configPtr;
+ const std::shared_ptr<Properties>& configPtr) {
+ auto pp = configPtr;
if (pp == nullptr) {
pp = Properties::create();
}
@@ -121,9 +120,9 @@ CacheHelper::CacheHelper(const char* member_id, const char* cachexml,
m_doDisconnect = false;
}
-CacheHelper::CacheHelper(const PropertiesPtr& configPtr,
+CacheHelper::CacheHelper(const std::shared_ptr<Properties>& configPtr,
const bool noRootRegion) {
- PropertiesPtr pp = configPtr;
+ auto pp = configPtr;
if (pp == nullptr) {
pp = Properties::create();
}
@@ -149,9 +148,9 @@ CacheHelper::CacheHelper(const PropertiesPtr& configPtr,
}
CacheHelper::CacheHelper(const bool isThinclient,
- const AuthInitializePtr& authInitialize,
- const PropertiesPtr& configPtr) {
- PropertiesPtr pp = configPtr;
+ const std::shared_ptr<AuthInitialize>& authInitialize,
+ const std::shared_ptr<Properties>& configPtr) {
+ auto pp = configPtr;
if (pp == nullptr) {
pp = Properties::create();
}
@@ -170,9 +169,9 @@ CacheHelper::CacheHelper(const bool isThinclient,
}
CacheHelper::CacheHelper(const bool isThinclient,
- const PropertiesPtr& configPtr,
+ const std::shared_ptr<Properties>& configPtr,
const bool noRootRegion) {
- PropertiesPtr pp = configPtr;
+ auto pp = configPtr;
if (pp == nullptr) {
pp = Properties::create();
}
@@ -189,14 +188,15 @@ CacheHelper::CacheHelper(const bool isThinclient,
}
CacheHelper::CacheHelper(const bool isThinclient, bool pdxIgnoreUnreadFields,
- bool pdxReadSerialized, const PropertiesPtr& configPtr,
+ bool pdxReadSerialized,
+ const std::shared_ptr<Properties>& configPtr,
const bool noRootRegion) {
- PropertiesPtr pp = configPtr;
+ auto pp = configPtr;
if (pp == nullptr) {
pp = Properties::create();
}
try {
- CacheFactoryPtr cfPtr = CacheFactory::createCacheFactory(pp);
+ auto cfPtr = CacheFactory::createCacheFactory(pp);
LOGINFO("pdxReadSerialized = %d ", pdxReadSerialized);
LOGINFO("pdxIgnoreUnreadFields = %d ", pdxIgnoreUnreadFields);
cfPtr->setPdxReadSerialized(pdxReadSerialized);
@@ -213,18 +213,18 @@ CacheHelper::CacheHelper(const bool isThinclient, bool pdxIgnoreUnreadFields,
CacheHelper::CacheHelper(const bool isthinClient, const char* poolName,
const char* locators, const char* serverGroup,
- const PropertiesPtr& configPtr, int redundancy,
- bool clientNotification, int subscriptionAckInterval,
- int connections, int loadConditioningInterval,
- bool isMultiuserMode, bool prSingleHop,
- bool threadLocal) {
- PropertiesPtr pp = configPtr;
+ const std::shared_ptr<Properties>& configPtr,
+ int redundancy, bool clientNotification,
+ int subscriptionAckInterval, int connections,
+ int loadConditioningInterval, bool isMultiuserMode,
+ bool prSingleHop, bool threadLocal) {
+ auto pp = configPtr;
if (pp == nullptr) {
pp = Properties::create();
}
try {
- CacheFactoryPtr cacheFac = CacheFactory::createCacheFactory(pp);
+ auto cacheFac = CacheFactory::createCacheFactory(pp);
cachePtr = cacheFac->create();
auto poolFactory = cachePtr->getPoolManager().createFactory();
@@ -265,13 +265,13 @@ CacheHelper::CacheHelper(const bool isthinClient, const char* poolName,
}
CacheHelper::CacheHelper(const int redundancyLevel,
- const PropertiesPtr& configPtr) {
- PropertiesPtr pp = configPtr;
+ const std::shared_ptr<Properties>& configPtr) {
+ auto pp = configPtr;
if (pp == nullptr) {
pp = Properties::create();
}
- CacheFactoryPtr cacheFac = CacheFactory::createCacheFactory(pp);
+ auto cacheFac = CacheFactory::createCacheFactory(pp);
cachePtr = cacheFac->create();
m_doDisconnect = false;
}
@@ -282,7 +282,7 @@ CacheHelper::~CacheHelper() {
}
void CacheHelper::closePool(const char* poolName, bool keepAlive) {
- PoolPtr pool = getCache()->getPoolManager().find(poolName);
+ auto pool = getCache()->getPoolManager().find(poolName);
pool->destroy(keepAlive);
}
@@ -325,13 +325,14 @@ void CacheHelper::disconnect(bool keepalive) {
}
void CacheHelper::createPlainRegion(const char* regionName,
- RegionPtr& regionPtr) {
+ std::shared_ptr<Region>& regionPtr) {
createPlainRegion(regionName, regionPtr, 10);
}
void CacheHelper::createPlainRegion(const char* regionName,
- RegionPtr& regionPtr, uint32_t size) {
- RegionAttributesPtr regAttrs;
+ std::shared_ptr<Region>& regionPtr,
+ uint32_t size) {
+ std::shared_ptr<RegionAttributes> regAttrs;
AttributesFactory attrFactory;
// set lru attributes...
attrFactory.setLruEntriesLimit(0); // no limit.
@@ -345,12 +346,13 @@ void CacheHelper::createPlainRegion(const char* regionName,
}
void CacheHelper::createLRURegion(const char* regionName,
- RegionPtr& regionPtr) {
+ std::shared_ptr<Region>& regionPtr) {
createLRURegion(regionName, regionPtr, 10);
}
-void CacheHelper::createLRURegion(const char* regionName, RegionPtr& regionPtr,
+void CacheHelper::createLRURegion(const char* regionName,
+ std::shared_ptr<Region>& regionPtr,
uint32_t size) {
- RegionAttributesPtr regAttrs;
+ std::shared_ptr<RegionAttributes> regAttrs;
AttributesFactory attrFactory;
// set lru attributes...
attrFactory.setLruEntriesLimit(size);
@@ -364,13 +366,14 @@ void CacheHelper::createLRURegion(const char* regionName, RegionPtr& regionPtr,
}
void CacheHelper::createDistRegion(const char* regionName,
- RegionPtr& regionPtr) {
+ std::shared_ptr<Region>& regionPtr) {
createDistRegion(regionName, regionPtr, 10);
}
-void CacheHelper::createDistRegion(const char* regionName, RegionPtr& regionPtr,
+void CacheHelper::createDistRegion(const char* regionName,
+ std::shared_ptr<Region>& regionPtr,
uint32_t size) {
- RegionAttributesPtr regAttrs;
+ std::shared_ptr<RegionAttributes> regAttrs;
AttributesFactory attrFactory;
// set lru attributes...
attrFactory.setLruEntriesLimit(0); // no limit.
@@ -382,17 +385,14 @@ void CacheHelper::createDistRegion(const char* regionName, RegionPtr& regionPtr,
regionPtr = rootRegionPtr->createSubregion(regionName, regAttrs);
ASSERT(regionPtr != nullptr, "failed to create region.");
}
-
-RegionPtr CacheHelper::getRegion(const char* name) {
+std::shared_ptr<Region> CacheHelper::getRegion(const char* name) {
return cachePtr->getRegion(name);
}
-
-RegionPtr CacheHelper::createRegion(const char* name, bool ack, bool caching,
- const CacheListenerPtr& listener,
- bool clientNotificationEnabled,
- bool scopeLocal,
- bool concurrencyCheckEnabled,
- int32_t tombstonetimeout) {
+std::shared_ptr<Region> CacheHelper::createRegion(
+ const char* name, bool ack, bool caching,
+ const std::shared_ptr<CacheListener>& listener,
+ bool clientNotificationEnabled, bool scopeLocal,
+ bool concurrencyCheckEnabled, int32_t tombstonetimeout) {
AttributesFactory af;
af.setCachingEnabled(caching);
if (listener != nullptr) {
@@ -402,15 +402,14 @@ RegionPtr CacheHelper::createRegion(const char* name, bool ack, bool caching,
af.setConcurrencyChecksEnabled(concurrencyCheckEnabled);
}
- RegionAttributesPtr rattrsPtr = af.createRegionAttributes();
+ std::shared_ptr<RegionAttributes> rattrsPtr = af.createRegionAttributes();
CacheImpl* cacheImpl = CacheRegionHelper::getCacheImpl(cachePtr.get());
- RegionPtr regionPtr;
+ std::shared_ptr<Region> regionPtr;
cacheImpl->createRegion(name, rattrsPtr, regionPtr);
return regionPtr;
}
-
-RegionPtr CacheHelper::createRegion(
+std::shared_ptr<Region> CacheHelper::createRegion(
const char* name, bool ack, bool caching, const std::chrono::seconds& ettl,
const std::chrono::seconds& eit, const std::chrono::seconds& rttl,
const std::chrono::seconds& rit, int lel, ExpirationAction::Action action,
@@ -423,21 +422,20 @@ RegionPtr CacheHelper::createRegion(
af.setRegionIdleTimeout(action, rit);
af.setRegionTimeToLive(action, rttl);
- RegionAttributesPtr rattrsPtr = af.createRegionAttributes();
+ std::shared_ptr<RegionAttributes> rattrsPtr = af.createRegionAttributes();
CacheImpl* cacheImpl = CacheRegionHelper::getCacheImpl(cachePtr.get());
- RegionPtr regionPtr;
+ std::shared_ptr<Region> regionPtr;
cacheImpl->createRegion(name, rattrsPtr, regionPtr);
return regionPtr;
}
-
-PoolPtr CacheHelper::createPool(
+std::shared_ptr<Pool> CacheHelper::createPool(
const char* poolName, const char* locators, const char* serverGroup,
int redundancy, bool clientNotification,
std::chrono::milliseconds subscriptionAckInterval, int connections,
int loadConditioningInterval, bool isMultiuserMode) {
// printf(" in createPool isMultiuserMode = %d \n", isMultiuserMode);
- PoolFactoryPtr poolFacPtr = getCache()->getPoolManager().createFactory();
+ auto poolFacPtr = getCache()->getPoolManager().createFactory();
addServerLocatorEPs(locators, poolFacPtr);
if (serverGroup) {
@@ -464,11 +462,11 @@ PoolPtr CacheHelper::createPool(
}
// this will create pool even endpoints and locatorhost has been not defined
-PoolPtr CacheHelper::createPool2(const char* poolName, const char* locators,
- const char* serverGroup, const char* servers,
- int redundancy, bool clientNotification,
- int subscriptionAckInterval, int connections) {
- PoolFactoryPtr poolFacPtr = getCache()->getPoolManager().createFactory();
+std::shared_ptr<Pool> CacheHelper::createPool2(
+ const char* poolName, const char* locators, const char* serverGroup,
+ const char* servers, int redundancy, bool clientNotification,
+ int subscriptionAckInterval, int connections) {
+ auto poolFacPtr = getCache()->getPoolManager().createFactory();
if (servers != 0) // with explicit server list
{
@@ -495,7 +493,7 @@ PoolPtr CacheHelper::createPool2(const char* poolName, const char* locators,
return poolFacPtr->create(poolName);
}
-void CacheHelper::logPoolAttributes(PoolPtr& pool) {
+void CacheHelper::logPoolAttributes(std::shared_ptr<Pool>& pool) {
LOG("logPoolAttributes() entered");
LOGINFO("CPPTEST: Pool attribtes for pool %s are as follows:",
pool->getName());
@@ -530,16 +528,14 @@ void CacheHelper::createPoolWithLocators(
bool isMultiuserMode, const char* serverGroup) {
LOG("createPool() entered.");
printf(" in createPoolWithLocators isMultiuserMode = %d\n", isMultiuserMode);
- PoolPtr poolPtr =
- createPool(name, locators, serverGroup, subscriptionRedundancy,
- clientNotificationEnabled, subscriptionAckInterval,
- connections, -1, isMultiuserMode);
+ auto poolPtr = createPool(name, locators, serverGroup, subscriptionRedundancy,
+ clientNotificationEnabled, subscriptionAckInterval,
+ connections, -1, isMultiuserMode);
ASSERT(poolPtr != nullptr, "Failed to create pool.");
logPoolAttributes(poolPtr);
LOG("Pool created.");
}
-
-RegionPtr CacheHelper::createRegionAndAttachPool(
+std::shared_ptr<Region> CacheHelper::createRegionAndAttachPool(
const char* name, bool ack, const char* poolName, bool caching,
const std::chrono::seconds& ettl, const std::chrono::seconds& eit,
const std::chrono::seconds& rttl, const std::chrono::seconds& rit, int lel,
@@ -562,10 +558,9 @@ RegionPtr CacheHelper::createRegionAndAttachPool(
}
return regionFactory.create(name);
}
-
-RegionPtr CacheHelper::createRegionAndAttachPool2(
+std::shared_ptr<Region> CacheHelper::createRegionAndAttachPool2(
const char* name, bool ack, const char* poolName,
- const PartitionResolverPtr& aResolver, bool caching,
+ const std::shared_ptr<PartitionResolver>& aResolver, bool caching,
const std::chrono::seconds& ettl, const std::chrono::seconds& eit,
const std::chrono::seconds& rttl, const std::chrono::seconds& rit, int lel,
ExpirationAction::Action action) {
@@ -587,7 +582,7 @@ RegionPtr CacheHelper::createRegionAndAttachPool2(
return regionFactory.create(name);
}
-void CacheHelper::addServerLocatorEPs(const char* epList, PoolFactoryPtr pfPtr,
+void CacheHelper::addServerLocatorEPs(const char* epList, std::shared_ptr<PoolFactory> pfPtr,
bool poolLocators) {
std::unordered_set<std::string> endpointNames;
Utils::parseEndpointNamesString(epList, endpointNames);
@@ -609,7 +604,7 @@ void CacheHelper::addServerLocatorEPs(const char* epList, PoolFactoryPtr pfPtr,
}
// void CacheHelper::addServerLocatorEPs(const char* epList,
-// CacheFactoryPtr cacheFac,
+// std::shared_ptr<CacheFactory> cacheFac,
// bool poolLocators) {
// std::unordered_set<std::string> endpointNames;
// Utils::parseEndpointNamesString(epList, endpointNames);
@@ -629,14 +624,14 @@ void CacheHelper::addServerLocatorEPs(const char* epList, PoolFactoryPtr pfPtr,
// }
// }
//}
-
-RegionPtr CacheHelper::createPooledRegion(
+std::shared_ptr<Region> CacheHelper::createPooledRegion(
const char* name, bool ack, const char* locators, const char* poolName,
bool caching, bool clientNotificationEnabled,
const std::chrono::seconds& ettl, const std::chrono::seconds& eit,
const std::chrono::seconds& rttl, const std::chrono::seconds& rit, int lel,
- const CacheListenerPtr& cacheListener, ExpirationAction::Action action) {
- PoolFactoryPtr poolFacPtr = getCache()->getPoolManager().createFactory();
+ const std::shared_ptr<CacheListener>& cacheListener,
+ ExpirationAction::Action action) {
+ auto poolFacPtr = getCache()->getPoolManager().createFactory();
poolFacPtr->setSubscriptionEnabled(clientNotificationEnabled);
if (locators) {
@@ -646,7 +641,7 @@ RegionPtr CacheHelper::createPooledRegion(
if ((getCache()->getPoolManager().find(poolName)) ==
nullptr) { // Pool does not exist with the same name.
- PoolPtr pptr = poolFacPtr->create(poolName);
+ auto pptr = poolFacPtr->create(poolName);
}
RegionShortcut preDefRA = PROXY;
@@ -668,14 +663,14 @@ RegionPtr CacheHelper::createPooledRegion(
}
return regionFactory.create(name);
}
-
-RegionPtr CacheHelper::createPooledRegionConcurrencyCheckDisabled(
+std::shared_ptr<Region> CacheHelper::createPooledRegionConcurrencyCheckDisabled(
const char* name, bool ack, const char* locators, const char* poolName,
bool caching, bool clientNotificationEnabled, bool concurrencyCheckEnabled,
const std::chrono::seconds& ettl, const std::chrono::seconds& eit,
const std::chrono::seconds& rttl, const std::chrono::seconds& rit, int lel,
- const CacheListenerPtr& cacheListener, ExpirationAction::Action action) {
- PoolFactoryPtr poolFacPtr = getCache()->getPoolManager().createFactory();
+ const std::shared_ptr<CacheListener>& cacheListener,
+ ExpirationAction::Action action) {
+ auto poolFacPtr = getCache()->getPoolManager().createFactory();
poolFacPtr->setSubscriptionEnabled(clientNotificationEnabled);
LOG("adding pool locators");
@@ -683,7 +678,7 @@ RegionPtr CacheHelper::createPooledRegionConcurrencyCheckDisabled(
if ((getCache()->getPoolManager().find(poolName)) ==
nullptr) { // Pool does not exist with the same name.
- PoolPtr pptr = poolFacPtr->create(poolName);
+ auto pptr = poolFacPtr->create(poolName);
}
RegionShortcut preDefRA = PROXY;
@@ -706,8 +701,7 @@ RegionPtr CacheHelper::createPooledRegionConcurrencyCheckDisabled(
}
return regionFactory.create(name);
}
-
-RegionPtr CacheHelper::createRegionDiscOverFlow(
+ std::shared_ptr<Region> CacheHelper::createRegionDiscOverFlow(
const char* name, bool caching, bool clientNotificationEnabled,
const std::chrono::seconds& ettl, const std::chrono::seconds& eit,
const std::chrono::seconds& rttl, const std::chrono::seconds& rit, int lel,
@@ -722,7 +716,7 @@ RegionPtr CacheHelper::createRegionDiscOverFlow(
af.setCloningEnabled(true);
if (lel > 0) {
af.setDiskPolicy(DiskPolicyType::OVERFLOWS);
- PropertiesPtr sqLiteProps = Properties::create();
+ auto sqLiteProps = Properties::create();
sqLiteProps->insert("PageSize", "65536");
sqLiteProps->insert("MaxPageCount", "1073741823");
std::string sqlite_dir =
@@ -732,20 +726,20 @@ RegionPtr CacheHelper::createRegionDiscOverFlow(
af.setPersistenceManager("SqLiteImpl", "createSqLiteInstance", sqLiteProps);
}
- RegionAttributesPtr rattrsPtr = af.createRegionAttributes();
+ std::shared_ptr<RegionAttributes> rattrsPtr = af.createRegionAttributes();
CacheImpl* cacheImpl = CacheRegionHelper::getCacheImpl(cachePtr.get());
- RegionPtr regionPtr;
+ std::shared_ptr<Region> regionPtr;
cacheImpl->createRegion(name, rattrsPtr, regionPtr);
return regionPtr;
}
-
-RegionPtr CacheHelper::createPooledRegionDiscOverFlow(
+std::shared_ptr<Region> CacheHelper::createPooledRegionDiscOverFlow(
const char* name, bool ack, const char* locators, const char* poolName,
bool caching, bool clientNotificationEnabled,
const std::chrono::seconds& ettl, const std::chrono::seconds& eit,
const std::chrono::seconds& rttl, const std::chrono::seconds& rit, int lel,
- const CacheListenerPtr& cacheListener, ExpirationAction::Action action) {
- PoolFactoryPtr poolFacPtr = getCache()->getPoolManager().createFactory();
+ const std::shared_ptr<CacheListener>& cacheListener,
+ ExpirationAction::Action action) {
+ auto poolFacPtr = getCache()->getPoolManager().createFactory();
poolFacPtr->setSubscriptionEnabled(clientNotificationEnabled);
if (locators) // with locator
@@ -755,7 +749,7 @@ RegionPtr CacheHelper::createPooledRegionDiscOverFlow(
}
if ((getCache()->getPoolManager().find(poolName)) ==
nullptr) { // Pool does not exist with the same name.
- PoolPtr pptr = poolFacPtr->create(poolName);
+ auto pptr = poolFacPtr->create(poolName);
}
if (!caching) {
@@ -794,26 +788,25 @@ RegionPtr CacheHelper::createPooledRegionDiscOverFlow(
}
return regionFactory.create(name);
}
-
-RegionPtr CacheHelper::createPooledRegionSticky(
+ std::shared_ptr<Region> CacheHelper::createPooledRegionSticky(
const char* name, bool ack, const char* locators, const char* poolName,
bool caching, bool clientNotificationEnabled,
const std::chrono::seconds& ettl, const std::chrono::seconds& eit,
const std::chrono::seconds& rttl, const std::chrono::seconds& rit, int lel,
- const CacheListenerPtr& cacheListener, ExpirationAction::Action action) {
- PoolFactoryPtr poolFacPtr = getCache()->getPoolManager().createFactory();
- poolFacPtr->setSubscriptionEnabled(clientNotificationEnabled);
- poolFacPtr->setThreadLocalConnections(true);
- poolFacPtr->setPRSingleHopEnabled(false);
+ const std::shared_ptr<CacheListener>& cacheListener, ExpirationAction::Action action) {
+ auto poolFacPtr = getCache()->getPoolManager().createFactory();
+ poolFacPtr->setSubscriptionEnabled(clientNotificationEnabled);
+ poolFacPtr->setThreadLocalConnections(true);
+ poolFacPtr->setPRSingleHopEnabled(false);
- LOG("adding pool locators");
- addServerLocatorEPs(locators, poolFacPtr);
+ LOG("adding pool locators");
+ addServerLocatorEPs(locators, poolFacPtr);
- if ((getCache()->getPoolManager().find(poolName)) ==
- nullptr) { // Pool does not exist with the same name.
- PoolPtr pptr = poolFacPtr->create(poolName);
- LOG("createPooledRegionSticky logPoolAttributes");
- logPoolAttributes(pptr);
+ if ((getCache()->getPoolManager().find(poolName)) ==
+ nullptr) { // Pool does not exist with the same name.
+ auto pptr = poolFacPtr->create(poolName);
+ LOG("createPooledRegionSticky logPoolAttributes");
+ logPoolAttributes(pptr);
}
RegionShortcut preDefRA = PROXY;
@@ -835,26 +828,25 @@ RegionPtr CacheHelper::createPooledRegionSticky(
}
return regionFactory.create(name);
}
-
-RegionPtr CacheHelper::createPooledRegionStickySingleHop(
+ std::shared_ptr<Region> CacheHelper::createPooledRegionStickySingleHop(
const char* name, bool ack, const char* locators, const char* poolName,
bool caching, bool clientNotificationEnabled,
const std::chrono::seconds& ettl, const std::chrono::seconds& eit,
const std::chrono::seconds& rttl, const std::chrono::seconds& rit, int lel,
- const CacheListenerPtr& cacheListener, ExpirationAction::Action action) {
+ const std::shared_ptr<CacheListener>& cacheListener, ExpirationAction::Action action) {
LOG("createPooledRegionStickySingleHop");
- PoolFactoryPtr poolFacPtr = getCache()->getPoolManager().createFactory();
- poolFacPtr->setSubscriptionEnabled(clientNotificationEnabled);
- poolFacPtr->setThreadLocalConnections(true);
- poolFacPtr->setPRSingleHopEnabled(true);
- LOG("adding pool locators");
- addServerLocatorEPs(locators, poolFacPtr);
+ auto poolFacPtr = getCache()->getPoolManager().createFactory();
+ poolFacPtr->setSubscriptionEnabled(clientNotificationEnabled);
+ poolFacPtr->setThreadLocalConnections(true);
+ poolFacPtr->setPRSingleHopEnabled(true);
+ LOG("adding pool locators");
+ addServerLocatorEPs(locators, poolFacPtr);
- if ((getCache()->getPoolManager().find(poolName)) ==
- nullptr) { // Pool does not exist with the same name.
- PoolPtr pptr = poolFacPtr->create(poolName);
- LOG("createPooledRegionStickySingleHop logPoolAttributes");
- logPoolAttributes(pptr);
+ if ((getCache()->getPoolManager().find(poolName)) ==
+ nullptr) { // Pool does not exist with the same name.
+ auto pptr = poolFacPtr->create(poolName);
+ LOG("createPooledRegionStickySingleHop logPoolAttributes");
+ logPoolAttributes(pptr);
}
RegionShortcut preDefRA = PROXY;
@@ -876,53 +868,52 @@ RegionPtr CacheHelper::createPooledRegionStickySingleHop(
}
return regionFactory.create(name);
}
-
-RegionPtr CacheHelper::createSubregion(RegionPtr& parent, const char* name,
+ std::shared_ptr<Region> CacheHelper::createSubregion(std::shared_ptr<Region>& parent, const char* name,
bool ack, bool caching,
- const CacheListenerPtr& listener) {
+ const std::shared_ptr<CacheListener>& listener) {
AttributesFactory af;
af.setCachingEnabled(caching);
if (listener != nullptr) {
af.setCacheListener(listener);
}
- RegionAttributesPtr rattrsPtr = af.createRegionAttributes();
+ std::shared_ptr<RegionAttributes> rattrsPtr = af.createRegionAttributes();
- return parent->createSubregion(name, rattrsPtr);
+ return parent->createSubregion(name, rattrsPtr);
}
-
-CacheableStringPtr CacheHelper::createCacheable(const char* value) {
+std::shared_ptr<CacheableString> CacheHelper::createCacheable(
+ const char* value) {
return CacheableString::create(value);
-}
-
-void CacheHelper::showKeys(VectorOfCacheableKey& vecKeys) {
- fprintf(stdout, "vecKeys.size() = %zd\n", vecKeys.size());
- for (uint32_t i = 0; i < static_cast<uint32_t>(vecKeys.size()); i++) {
- char msg[1024];
- size_t wrote = vecKeys.at(i)->logString(msg, 1023);
- msg[wrote] = '\0'; // just in case...
- fprintf(stdout, "key[%d] - %s\n", i, msg);
- }
- fflush(stdout);
-}
-
-void CacheHelper::showRegionAttributes(RegionAttributes& attributes) {
- printf("caching=%s\n", attributes.getCachingEnabled() ? "true" : "false");
- printf("Entry Time To Live = %s\n",
- to_string(attributes.getEntryTimeToLive()).c_str());
- printf("Entry Idle Timeout = %s\n",
- to_string(attributes.getEntryIdleTimeout()).c_str());
- printf("Region Time To Live = %s\n",
- to_string(attributes.getRegionTimeToLive()).c_str());
- printf("Region Idle Timeout = %s\n",
- to_string(attributes.getRegionIdleTimeout()).c_str());
- printf("Initial Capacity = %d\n", attributes.getInitialCapacity());
- printf("Load Factor = %f\n", attributes.getLoadFactor());
- printf("End Points = %s\n",
- (attributes.getEndpoints() != nullptr ? attributes.getEndpoints()
- : "(null)"));
-}
-
-QueryServicePtr CacheHelper::getQueryService() {
+ }
+
+ void CacheHelper::showKeys(
+ std::vector<std::shared_ptr<CacheableKey>>& vecKeys) {
+ fprintf(stdout, "vecKeys.size() = %zd\n", vecKeys.size());
+ for (uint32_t i = 0; i < static_cast<uint32_t>(vecKeys.size()); i++) {
+ char msg[1024];
+ size_t wrote = vecKeys.at(i)->logString(msg, 1023);
+ msg[wrote] = '\0'; // just in case...
+ fprintf(stdout, "key[%d] - %s\n", i, msg);
+ }
+ fflush(stdout);
+ }
+
+ void CacheHelper::showRegionAttributes(RegionAttributes& attributes) {
+ printf("caching=%s\n", attributes.getCachingEnabled() ? "true" : "false");
+ printf("Entry Time To Live = %s\n",
+ to_string(attributes.getEntryTimeToLive()).c_str());
+ printf("Entry Idle Timeout = %s\n",
+ to_string(attributes.getEntryIdleTimeout()).c_str());
+ printf("Region Time To Live = %s\n",
+ to_string(attributes.getRegionTimeToLive()).c_str());
+ printf("Region Idle Timeout = %s\n",
+ to_string(attributes.getRegionIdleTimeout()).c_str());
+ printf("Initial Capacity = %d\n", attributes.getInitialCapacity());
+ printf("Load Factor = %f\n", attributes.getLoadFactor());
+ printf("End Points = %s\n",
+ (attributes.getEndpoints() != nullptr ? attributes.getEndpoints()
+ : "(null)"));
+}
+ std::shared_ptr<QueryService> CacheHelper::getQueryService() {
return cachePtr->getQueryService();
}
@@ -1769,7 +1760,7 @@ void CacheHelper::initLocator(int instance, bool ssl, bool multiDS, int dsId,
}
void CacheHelper::clearSecProp() {
- PropertiesPtr tmpSecProp = CacheHelper::getHelper()
+ auto tmpSecProp = CacheHelper::getHelper()
.getCache()
->getDistributedSystem()
.getSystemProperties()
diff --git a/cppcache/integration-test/CacheHelper.hpp b/cppcache/integration-test/CacheHelper.hpp
index 556a44e..b657092 100644
--- a/cppcache/integration-test/CacheHelper.hpp
+++ b/cppcache/integration-test/CacheHelper.hpp
@@ -28,7 +28,6 @@
#include <ace/INET_Addr.h>
#include <ace/SOCK_Acceptor.h>
-#include <geode/GeodeCppCache.hpp>
#include <geode/SystemProperties.hpp>
#include <geode/PoolManager.hpp>
@@ -50,47 +49,51 @@ class CacheHelper {
public:
static CacheHelper* singleton;
static std::list<std::string> staticConfigFileList;
- CachePtr cachePtr;
- RegionPtr rootRegionPtr;
+ std::shared_ptr<Cache> cachePtr;
+ std::shared_ptr<Region> rootRegionPtr;
bool m_doDisconnect;
- CachePtr getCache();
+ std::shared_ptr<Cache> getCache();
static CacheHelper& getHelper();
static std::string unitTestOutputFile();
static int getNumLocatorListUpdates(const char* s);
- CacheHelper(const char* member_id, const PropertiesPtr& configPtr = nullptr,
+ CacheHelper(const char* member_id,
+ const std::shared_ptr<Properties>& configPtr = nullptr,
const bool noRootRegion = false);
/** rootRegionPtr will still be null... */
CacheHelper(const char* member_id, const char* cachexml,
- const PropertiesPtr& configPtr = nullptr);
+ const std::shared_ptr<Properties>& configPtr = nullptr);
- CacheHelper(const PropertiesPtr& configPtr = nullptr,
+ CacheHelper(const std::shared_ptr<Properties>& configPtr = nullptr,
const bool noRootRegion = false);
- CacheHelper(const bool isThinclient, const PropertiesPtr& configPtr = nullptr,
+ CacheHelper(const bool isThinclient,
+ const std::shared_ptr<Properties>& configPtr = nullptr,
const bool noRootRegion = false);
- CacheHelper(const bool isThinclient, const AuthInitializePtr& authInitialize,
- const PropertiesPtr& configPtr = nullptr);
+ CacheHelper(const bool isThinclient,
+ const std::shared_ptr<AuthInitialize>& authInitialize,
+ const std::shared_ptr<Properties>& configPtr = nullptr);
CacheHelper(const bool isThinclient, bool pdxIgnoreUnreadFields,
- bool pdxReadSerialized, const PropertiesPtr& configPtr = nullptr,
+ bool pdxReadSerialized,
+ const std::shared_ptr<Properties>& configPtr = nullptr,
const bool noRootRegion = false);
CacheHelper(const bool isthinClient, const char* poolName,
const char* locators, const char* serverGroup,
- const PropertiesPtr& configPtr = nullptr, int redundancy = 0,
- bool clientNotification = false, int subscriptionAckInterval = -1,
- int connections = -1, int loadConditioningInterval = -1,
- bool isMultiuserMode = false, bool prSingleHop = false,
- bool threadLocal = false);
+ const std::shared_ptr<Properties>& configPtr = nullptr,
+ int redundancy = 0, bool clientNotification = false,
+ int subscriptionAckInterval = -1, int connections = -1,
+ int loadConditioningInterval = -1, bool isMultiuserMode = false,
+ bool prSingleHop = false, bool threadLocal = false);
CacheHelper(const int redundancyLevel,
- const PropertiesPtr& configPtr = nullptr);
+ const std::shared_ptr<Properties>& configPtr = nullptr);
virtual ~CacheHelper();
@@ -98,31 +101,33 @@ class CacheHelper {
void disconnect(bool keepalive = false);
- void createPlainRegion(const char* regionName, RegionPtr& regionPtr);
+ void createPlainRegion(const char* regionName,
+ std::shared_ptr<Region>& regionPtr);
- void createPlainRegion(const char* regionName, RegionPtr& regionPtr,
- uint32_t size);
+ void createPlainRegion(const char* regionName,
+ std::shared_ptr<Region>& regionPtr, uint32_t size);
- void createLRURegion(const char* regionName, RegionPtr& regionPtr);
+ void createLRURegion(const char* regionName,
+ std::shared_ptr<Region>& regionPtr);
- void createLRURegion(const char* regionName, RegionPtr& regionPtr,
- uint32_t size);
+ void createLRURegion(const char* regionName,
+ std::shared_ptr<Region>& regionPtr, uint32_t size);
- void createDistRegion(const char* regionName, RegionPtr& regionPtr);
+ void createDistRegion(const char* regionName,
+ std::shared_ptr<Region>& regionPtr);
- void createDistRegion(const char* regionName, RegionPtr& regionPtr,
- uint32_t size);
+ void createDistRegion(const char* regionName,
+ std::shared_ptr<Region>& regionPtr, uint32_t size);
- RegionPtr getRegion(const char* name);
+ std::shared_ptr<Region> getRegion(const char* name);
- RegionPtr createRegion(const char* name, bool ack, bool caching,
- const CacheListenerPtr& listener,
- bool clientNotificationEnabled = false,
- bool scopeLocal = false,
- bool concurrencyCheckEnabled = false,
- int32_t tombstonetimeout = -1);
+ std::shared_ptr<Region> createRegion(
+ const char* name, bool ack, bool caching,
+ const std::shared_ptr<CacheListener>& listener,
+ bool clientNotificationEnabled = false, bool scopeLocal = false,
+ bool concurrencyCheckEnabled = false, int32_t tombstonetimeout = -1);
- RegionPtr createRegion(
+ std::shared_ptr<Region> createRegion(
const char* name, bool ack, bool caching = true,
const std::chrono::seconds& ettl = std::chrono::seconds::zero(),
const std::chrono::seconds& eit = std::chrono::seconds::zero(),
@@ -131,21 +136,24 @@ class CacheHelper {
int lel = 0, ExpirationAction::Action action = ExpirationAction::DESTROY,
const char* endpoints = 0, bool clientNotificationEnabled = false);
- PoolPtr createPool(const char* poolName, const char* locators,
- const char* serverGroup, int redundancy = 0,
- bool clientNotification = false,
- std::chrono::milliseconds subscriptionAckInterval =
- std::chrono::milliseconds::zero(),
- int connections = -1, int loadConditioningInterval = -1,
- bool isMultiuserMode = false);
+ std::shared_ptr<Pool> createPool(
+ const char* poolName, const char* locators, const char* serverGroup,
+ int redundancy = 0, bool clientNotification = false,
+ std::chrono::milliseconds subscriptionAckInterval =
+ std::chrono::milliseconds::zero(),
+ int connections = -1, int loadConditioningInterval = -1,
+ bool isMultiuserMode = false);
// this will create pool even endpoints and locatorhost has been not defined
- PoolPtr createPool2(const char* poolName, const char* locators,
- const char* serverGroup, const char* servers = nullptr,
- int redundancy = 0, bool clientNotification = false,
- int subscriptionAckInterval = -1, int connections = -1);
+ std::shared_ptr<Pool> createPool2(const char* poolName, const char* locators,
+ const char* serverGroup,
+ const char* servers = nullptr,
+ int redundancy = 0,
+ bool clientNotification = false,
+ int subscriptionAckInterval = -1,
+ int connections = -1);
- void logPoolAttributes(PoolPtr& pool);
+ void logPoolAttributes(std::shared_ptr<Pool>& pool);
void createPoolWithLocators(
const char* name, const char* locators = nullptr,
@@ -155,7 +163,7 @@ class CacheHelper {
int connections = -1, bool isMultiuserMode = false,
const char* serverGroup = nullptr);
- RegionPtr createRegionAndAttachPool(
+ std::shared_ptr<Region> createRegionAndAttachPool(
const char* name, bool ack, const char* poolName = nullptr,
bool caching = true,
const std::chrono::seconds& ettl = std::chrono::seconds::zero(),
@@ -164,22 +172,25 @@ class CacheHelper {
const std::chrono::seconds& rit = std::chrono::seconds::zero(),
int lel = 0, ExpirationAction::Action action = ExpirationAction::DESTROY);
- RegionPtr createRegionAndAttachPool2(
+ std::shared_ptr<Region> createRegionAndAttachPool2(
const char* name, bool ack, const char* poolName,
- const PartitionResolverPtr& aResolver = nullptr, bool caching = true,
+ const std::shared_ptr<PartitionResolver>& aResolver = nullptr,
+ bool caching = true,
const std::chrono::seconds& ettl = std::chrono::seconds::zero(),
const std::chrono::seconds& eit = std::chrono::seconds::zero(),
const std::chrono::seconds& rttl = std::chrono::seconds::zero(),
const std::chrono::seconds& rit = std::chrono::seconds::zero(),
int lel = 0, ExpirationAction::Action action = ExpirationAction::DESTROY);
- void addServerLocatorEPs(const char* epList, PoolFactoryPtr pfPtr,
+ void addServerLocatorEPs(const char* epList,
+ std::shared_ptr<PoolFactory> pfPtr,
bool poolLocators = true);
- void addServerLocatorEPs(const char* epList, CacheFactoryPtr cacheFac,
+ void addServerLocatorEPs(const char* epList,
+ std::shared_ptr<CacheFactory> cacheFac,
bool poolLocators = true);
- RegionPtr createPooledRegion(
+ std::shared_ptr<Region> createPooledRegion(
const char* name, bool ack, const char* locators = 0,
const char* poolName = "__TEST_POOL1__", bool caching = true,
bool clientNotificationEnabled = false,
@@ -187,10 +198,11 @@ class CacheHelper {
const std::chrono::seconds& eit = std::chrono::seconds::zero(),
const std::chrono::seconds& rttl = std::chrono::seconds::zero(),
const std::chrono::seconds& rit = std::chrono::seconds::zero(),
- int lel = 0, const CacheListenerPtr& cacheListener = nullptr,
+ int lel = 0,
+ const std::shared_ptr<CacheListener>& cacheListener = nullptr,
ExpirationAction::Action action = ExpirationAction::DESTROY);
- RegionPtr createPooledRegionConcurrencyCheckDisabled(
+ std::shared_ptr<Region> createPooledRegionConcurrencyCheckDisabled(
const char* name, bool ack, const char* locators = 0,
const char* poolName = "__TEST_POOL1__", bool caching = true,
bool clientNotificationEnabled = false,
@@ -199,10 +211,11 @@ class CacheHelper {
const std::chrono::seconds& eit = std::chrono::seconds::zero(),
const std::chrono::seconds& rttl = std::chrono::seconds::zero(),
const std::chrono::seconds& rit = std::chrono::seconds::zero(),
- int lel = 0, const CacheListenerPtr& cacheListener = nullptr,
+ int lel = 0,
+ const std::shared_ptr<CacheListener>& cacheListener = nullptr,
ExpirationAction::Action action = ExpirationAction::DESTROY);
- RegionPtr createRegionDiscOverFlow(
+ std::shared_ptr<Region> createRegionDiscOverFlow(
const char* name, bool caching = true,
bool clientNotificationEnabled = false,
const std::chrono::seconds& ettl = std::chrono::seconds::zero(),
@@ -211,7 +224,7 @@ class CacheHelper {
const std::chrono::seconds& rit = std::chrono::seconds::zero(),
int lel = 0, ExpirationAction::Action action = ExpirationAction::DESTROY);
- RegionPtr createPooledRegionDiscOverFlow(
+ std::shared_ptr<Region> createPooledRegionDiscOverFlow(
const char* name, bool ack, const char* locators = 0,
const char* poolName = "__TEST_POOL1__", bool caching = true,
bool clientNotificationEnabled = false,
@@ -219,10 +232,11 @@ class CacheHelper {
const std::chrono::seconds& eit = std::chrono::seconds::zero(),
const std::chrono::seconds& rttl = std::chrono::seconds::zero(),
const std::chrono::seconds& rit = std::chrono::seconds::zero(),
- int lel = 0, const CacheListenerPtr& cacheListener = nullptr,
+ int lel = 0,
+ const std::shared_ptr<CacheListener>& cacheListener = nullptr,
ExpirationAction::Action action = ExpirationAction::DESTROY);
- RegionPtr createPooledRegionSticky(
+ std::shared_ptr<Region> createPooledRegionSticky(
const char* name, bool ack, const char* locators = 0,
const char* poolName = "__TEST_POOL1__", bool caching = true,
bool clientNotificationEnabled = false,
@@ -230,10 +244,11 @@ class CacheHelper {
const std::chrono::seconds& eit = std::chrono::seconds::zero(),
const std::chrono::seconds& rttl = std::chrono::seconds::zero(),
const std::chrono::seconds& rit = std::chrono::seconds::zero(),
- int lel = 0, const CacheListenerPtr& cacheListener = nullptr,
+ int lel = 0,
+ const std::shared_ptr<CacheListener>& cacheListener = nullptr,
ExpirationAction::Action action = ExpirationAction::DESTROY);
- RegionPtr createPooledRegionStickySingleHop(
+ std::shared_ptr<Region> createPooledRegionStickySingleHop(
const char* name, bool ack, const char* locators = 0,
const char* poolName = "__TEST_POOL1__", bool caching = true,
bool clientNotificationEnabled = false,
@@ -241,19 +256,21 @@ class CacheHelper {
const std::chrono::seconds& eit = std::chrono::seconds::zero(),
const std::chrono::seconds& rttl = std::chrono::seconds::zero(),
const std::chrono::seconds& rit = std::chrono::seconds::zero(),
- int lel = 0, const CacheListenerPtr& cacheListener = nullptr,
+ int lel = 0,
+ const std::shared_ptr<CacheListener>& cacheListener = nullptr,
ExpirationAction::Action action = ExpirationAction::DESTROY);
- RegionPtr createSubregion(RegionPtr& parent, const char* name, bool ack,
- bool caching, const CacheListenerPtr& listener);
+ std::shared_ptr<Region> createSubregion(
+ std::shared_ptr<Region>& parent, const char* name, bool ack, bool caching,
+ const std::shared_ptr<CacheListener>& listener);
- CacheableStringPtr createCacheable(const char* value);
+ std::shared_ptr<CacheableString> createCacheable(const char* value);
- void showKeys(VectorOfCacheableKey& vecKeys);
+ void showKeys(std::vector<std::shared_ptr<CacheableKey>>& vecKeys);
void showRegionAttributes(RegionAttributes& attributes);
- QueryServicePtr getQueryService();
+ std::shared_ptr<QueryService> getQueryService();
/*
* GFJAVA is the environment variable. user has to set GFJAVA variable as a
diff --git a/cppcache/integration-test/CacheImplHelper.hpp b/cppcache/integration-test/CacheImplHelper.hpp
index 474205b..51e7a2d 100644
--- a/cppcache/integration-test/CacheImplHelper.hpp
+++ b/cppcache/integration-test/CacheImplHelper.hpp
@@ -20,7 +20,6 @@
* limitations under the License.
*/
-#include <geode/GeodeCppCache.hpp>
#include <cstdlib>
#include <geode/SystemProperties.hpp>
#include <ace/OS.h>
@@ -40,17 +39,17 @@ using namespace unitTests;
class CacheImplHelper : public CacheHelper {
public:
CacheImplHelper(const char* member_id,
- const PropertiesPtr& configPtr = nullptr)
+ const std::shared_ptr<Properties>& configPtr = nullptr)
: CacheHelper(member_id, configPtr) {}
- CacheImplHelper(const PropertiesPtr& configPtr = nullptr)
+ CacheImplHelper(const std::shared_ptr<Properties>& configPtr = nullptr)
: CacheHelper(configPtr) {}
- virtual void createRegion(const char* regionName, RegionPtr& regionPtr,
- uint32_t size, bool ack = false,
- bool cacheServerClient = false,
+ virtual void createRegion(const char* regionName,
+ std::shared_ptr<Region>& regionPtr, uint32_t size,
+ bool ack = false, bool cacheServerClient = false,
bool cacheEnabled = true) {
- RegionAttributesPtr regAttrs;
+ std::shared_ptr<RegionAttributes> regAttrs;
AttributesFactory attrFactory;
// set lru attributes...
attrFactory.setLruEntriesLimit(0); // no limit.
diff --git a/cppcache/integration-test/CacheableWrapper.hpp b/cppcache/integration-test/CacheableWrapper.hpp
index cc0f951..79df121 100644
--- a/cppcache/integration-test/CacheableWrapper.hpp
+++ b/cppcache/integration-test/CacheableWrapper.hpp
@@ -20,7 +20,6 @@
* limitations under the License.
*/
-#include <geode/GeodeCppCache.hpp>
#include <string>
#include <map>
#include <vector>
@@ -29,13 +28,15 @@ using namespace apache::geode::client;
class CacheableWrapper {
protected:
- CacheablePtr m_cacheableObject;
+ std::shared_ptr<Cacheable> m_cacheableObject;
public:
- CacheableWrapper(const CacheablePtr cacheableObject)
+ CacheableWrapper(const std::shared_ptr<Cacheable> cacheableObject)
: m_cacheableObject(cacheableObject) {}
- virtual CacheablePtr getCacheable() const { return m_cacheableObject; }
+ virtual std::shared_ptr<Cacheable> getCacheable() const {
+ return m_cacheableObject;
+ }
virtual int maxKeys() const {
throw IllegalArgumentException("Cannot call maxKeys.");
@@ -47,7 +48,8 @@ class CacheableWrapper {
virtual void initRandomValue(int maxSize) = 0;
- virtual uint32_t getCheckSum(const CacheablePtr object) const = 0;
+ virtual uint32_t getCheckSum(
+ const std::shared_ptr<Cacheable> object) const = 0;
uint32_t getCheckSum() const { return getCheckSum(m_cacheableObject); }
diff --git a/cppcache/integration-test/DeltaEx.hpp b/cppcache/integration-test/DeltaEx.hpp
index e0dc9e4..c34f2ee 100644
--- a/cppcache/integration-test/DeltaEx.hpp
+++ b/cppcache/integration-test/DeltaEx.hpp
@@ -21,9 +21,15 @@
#define GEODE_INTEGRATION_TEST_DELTAEX_H_
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
+#include <memory>
+#include <geode/PdxSerializable.hpp>
+#include <geode/PdxWriter.hpp>
+#include <geode/PdxReader.hpp>
+#include <geode/Delta.hpp>
+
#include "CacheHelper.hpp"
+
class DeltaEx : public Cacheable, public Delta {
private:
std::shared_ptr<DeltaEx> shared_from_this() {
@@ -69,7 +75,7 @@ class DeltaEx : public Cacheable, public Delta {
}
virtual int32_t classId() const { return 1; }
virtual uint32_t objectSize() const { return 0; }
- DeltaPtr clone() {
+ std::shared_ptr<Delta> clone() {
cloneCount++;
return shared_from_this();
}
@@ -117,19 +123,19 @@ class PdxDeltaEx : public PdxSerializable, public Delta {
const char* getClassName() const { return "PdxTests.PdxDeltaEx"; }
- void toData(PdxWriterPtr pw) {
+ void toData(std::shared_ptr<PdxWriter> pw) {
pw->writeInt("counter", m_counter);
m_toDataCount++;
}
- void fromData(PdxReaderPtr pr) {
+ void fromData(std::shared_ptr<PdxReader> pr) {
m_counter = pr->readInt("counter");
m_fromDataCount++;
}
static PdxSerializable* createDeserializable() { return new PdxDeltaEx(); }
- DeltaPtr clone() {
+ std::shared_ptr<Delta> clone() {
m_cloneCount++;
return shared_from_this();
}
@@ -138,13 +144,12 @@ class PdxDeltaEx : public PdxSerializable, public Delta {
void setDelta(bool delta) { this->m_isDelta = delta; }
- CacheableStringPtr toString() const {
+ std::shared_ptr<CacheableString> toString() const {
char idbuf[1024];
sprintf(idbuf, "PdxDeltaEx :: [counter=%d] [isDelta=%d]", m_counter,
m_isDelta);
return CacheableString::create(idbuf);
}
};
-typedef std::shared_ptr<PdxDeltaEx> PdxDeltaExPtr;
#endif // GEODE_INTEGRATION_TEST_DELTAEX_H_
diff --git a/cppcache/integration-test/QueryHelper.hpp b/cppcache/integration-test/QueryHelper.hpp
index df220c6..8eb0b79 100644
--- a/cppcache/integration-test/QueryHelper.hpp
+++ b/cppcache/integration-test/QueryHelper.hpp
@@ -20,7 +20,6 @@
* limitations under the License.
*/
-#include <geode/GeodeCppCache.hpp>
#include <cstdlib>
#include <geode/SystemProperties.hpp>
#include <ace/OS.h>
@@ -70,21 +69,23 @@ class QueryHelper {
virtual ~QueryHelper() { ; }
- virtual void populatePortfolioData(RegionPtr& pregion, int setSize,
- int numSets, int32_t objSize = 1,
- CacheableStringArrayPtr nm = nullptr);
- virtual void populatePositionData(RegionPtr& pregion, int setSize,
- int numSets);
- virtual void populatePortfolioPdxData(RegionPtr& pregion, int setSize,
- int numSets, int32_t objSize = 1,
+ virtual void populatePortfolioData(
+ std::shared_ptr<Region>& pregion, int setSize, int numSets,
+ int32_t objSize = 1, std::shared_ptr<CacheableStringArray> nm = nullptr);
+ virtual void populatePositionData(std::shared_ptr<Region>& pregion,
+ int setSize, int numSets);
+ virtual void populatePortfolioPdxData(std::shared_ptr<Region>& pregion,
+ int setSize, int numSets,
+ int32_t objSize = 1,
char** nm = nullptr);
- virtual void populatePositionPdxData(RegionPtr& pregion, int setSize,
- int numSets);
- virtual void populatePDXObject(RegionPtr& pregion);
- virtual void getPDXObject(RegionPtr& pregion);
-
- virtual bool verifyRS(SelectResultsPtr& resultset, int rowCount);
- virtual bool verifySS(SelectResultsPtr& structset, int rowCount,
+ virtual void populatePositionPdxData(std::shared_ptr<Region>& pregion,
+ int setSize, int numSets);
+ virtual void populatePDXObject(std::shared_ptr<Region>& pregion);
+ virtual void getPDXObject(std::shared_ptr<Region>& pregion);
+
+ virtual bool verifyRS(std::shared_ptr<SelectResults>& resultset,
+ int rowCount);
+ virtual bool verifySS(std::shared_ptr<SelectResults>& structset, int rowCount,
int fieldCount);
// utility methods
@@ -155,9 +156,9 @@ QueryHelper* QueryHelper::singleton = nullptr;
//===========================================================================================
-void QueryHelper::populatePortfolioData(RegionPtr& rptr, int setSize,
- int numSets, int32_t objSize,
- CacheableStringArrayPtr nm) {
+void QueryHelper::populatePortfolioData(
+ std::shared_ptr<Region>& rptr, int setSize, int numSets, int32_t objSize,
+ std::shared_ptr<CacheableStringArray> nm) {
// lets reset the counter for uniform population of position objects
Position::resetCounter();
@@ -168,7 +169,7 @@ void QueryHelper::populatePortfolioData(RegionPtr& rptr, int setSize,
char portname[100] = {0};
ACE_OS::sprintf(portname, "port%d-%d", set, current);
- CacheableKeyPtr keyport = CacheableKey::create(portname);
+ auto keyport = CacheableKey::create(portname);
// printf(" QueryHelper::populatePortfolioData creating key = %s and
// puting data \n",portname);
rptr->put(keyport, port);
@@ -183,8 +184,8 @@ void QueryHelper::populatePortfolioData(RegionPtr& rptr, int setSize,
const char* secIds[] = {"SUN", "IBM", "YHOO", "GOOG", "MSFT",
"AOL", "APPL", "ORCL", "SAP", "DELL"};
-void QueryHelper::populatePositionData(RegionPtr& rptr, int setSize,
- int numSets) {
+void QueryHelper::populatePositionData(std::shared_ptr<Region>& rptr,
+ int setSize, int numSets) {
int numSecIds = sizeof(secIds) / sizeof(char*);
for (int set = 1; set <= numSets; set++) {
@@ -195,16 +196,16 @@ void QueryHelper::populatePositionData(RegionPtr& rptr, int setSize,
char posname[100] = {0};
ACE_OS::sprintf(posname, "pos%d-%d", set, current);
- CacheableKeyPtr keypos = CacheableKey::create(posname);
+ auto keypos = CacheableKey::create(posname);
rptr->put(keypos, pos);
}
}
// positionSetSize = setSize; positionNumSets = numSets;
}
-void QueryHelper::populatePortfolioPdxData(RegionPtr& rptr, int setSize,
- int numSets, int32_t objSize,
- char** nm) {
+void QueryHelper::populatePortfolioPdxData(std::shared_ptr<Region>& rptr,
+ int setSize, int numSets,
+ int32_t objSize, char** nm) {
// lets reset the counter for uniform population of position objects
PositionPdx::resetCounter();
@@ -215,7 +216,7 @@ void QueryHelper::populatePortfolioPdxData(RegionPtr& rptr, int setSize,
char portname[100] = {0};
ACE_OS::sprintf(portname, "port%d-%d", set, current);
- CacheableKeyPtr keyport = CacheableKey::create(portname);
+ auto keyport = CacheableKey::create(portname);
rptr->put(keyport, port);
LOGINFO("populatePortfolioPdxData:: Put for iteration current = %d done",
@@ -228,8 +229,8 @@ void QueryHelper::populatePortfolioPdxData(RegionPtr& rptr, int setSize,
printf("all puts done \n");
}
-void QueryHelper::populatePositionPdxData(RegionPtr& rptr, int setSize,
- int numSets) {
+void QueryHelper::populatePositionPdxData(std::shared_ptr<Region>& rptr,
+ int setSize, int numSets) {
int numSecIds = sizeof(secIds) / sizeof(char*);
for (int set = 1; set <= numSets; set++) {
@@ -240,14 +241,14 @@ void QueryHelper::populatePositionPdxData(RegionPtr& rptr, int setSize,
char posname[100] = {0};
ACE_OS::sprintf(posname, "pos%d-%d", set, current);
- CacheableKeyPtr keypos = CacheableKey::create(posname);
+ auto keypos = CacheableKey::create(posname);
rptr->put(keypos, pos);
}
}
// positionSetSize = setSize; positionNumSets = numSets;
}
-void QueryHelper::populatePDXObject(RegionPtr& rptr) {
+void QueryHelper::populatePDXObject(std::shared_ptr<Region>& rptr) {
// Register PdxType Object
CacheImpl* cacheImpl = CacheRegionHelper::getCacheImpl(rptr->getCache().get());
@@ -256,7 +257,7 @@ void QueryHelper::populatePDXObject(RegionPtr& rptr) {
// Creating object of type PdxObject
auto pdxobj = std::make_shared<PdxTests::PdxType>();
- CacheableKeyPtr keyport = CacheableKey::create("ABC");
+ auto keyport = CacheableKey::create("ABC");
// PUT Operation
rptr->put(keyport, pdxobj);
@@ -284,11 +285,11 @@ void QueryHelper::populatePDXObject(RegionPtr& rptr) {
LOG("NIL:200:PUT Operation successfully Done....End");
}
-void QueryHelper::getPDXObject(RegionPtr& rptr) {
+void QueryHelper::getPDXObject(std::shared_ptr<Region>& rptr) {
// Remote GET for PdxObject
// PdxObject *obj2 = dynamic_cast<PdxObject *> ((rptr->get(keyport)).get());
- CacheableKeyPtr keyport = CacheableKey::create("ABC");
+ auto keyport = CacheableKey::create("ABC");
LOG("Client-2 PdxObject GET OP Start....");
auto obj2 = std::dynamic_pointer_cast<PdxTests::PdxType>(rptr->get(keyport));
LOG("Client-2 PdxObject GET OP Done....");
@@ -307,20 +308,20 @@ void QueryHelper::getPDXObject(RegionPtr& rptr) {
*/
}
-bool QueryHelper::verifyRS(SelectResultsPtr& resultSet, int expectedRows) {
+bool QueryHelper::verifyRS(std::shared_ptr<SelectResults>& resultSet,
+ int expectedRows) {
if (!std::dynamic_pointer_cast<ResultSet>(resultSet)) {
return false;
}
- ResultSetPtr rsptr =
- std::static_pointer_cast<ResultSet>(resultSet);
+ auto rsptr = std::static_pointer_cast<ResultSet>(resultSet);
int foundRows = 0;
SelectResultsIterator iter = rsptr->getIterator();
for (int32_t rows = 0; rows < rsptr->size(); rows++) {
- SerializablePtr ser = (*rsptr)[rows];
+ auto ser = (*rsptr)[rows];
foundRows++;
}
@@ -330,8 +331,8 @@ bool QueryHelper::verifyRS(SelectResultsPtr& resultSet, int expectedRows) {
return false;
}
-bool QueryHelper::verifySS(SelectResultsPtr& structSet, int expectedRows,
- int expectedFields) {
+bool QueryHelper::verifySS(std::shared_ptr<SelectResults>& structSet,
+ int expectedRows, int expectedFields) {
if (!std::dynamic_pointer_cast<StructSet>(structSet)) {
if (expectedRows == 0 && expectedFields == 0) {
return true; // quite possible we got a null set back.
@@ -340,14 +341,13 @@ bool QueryHelper::verifySS(SelectResultsPtr& structSet, int expectedRows,
return false;
}
- StructSetPtr ssptr =
- std::static_pointer_cast<StructSet>(structSet);
+ auto ssptr = std::static_pointer_cast<StructSet>(structSet);
int foundRows = 0;
for (SelectResults::Iterator iter = ssptr->begin(); iter != ssptr->end();
iter++) {
- SerializablePtr ser = (*iter);
+ auto ser = (*iter);
foundRows++;
Struct* siptr = dynamic_cast<Struct*>(ser.get());
@@ -360,7 +360,7 @@ bool QueryHelper::verifySS(SelectResultsPtr& structSet, int expectedRows,
int foundFields = 0;
for (int32_t cols = 0; cols < siptr->length(); cols++) {
- SerializablePtr field = (*siptr)[cols];
+ auto field = (*siptr)[cols];
foundFields++;
}
diff --git a/cppcache/integration-test/TallyListener.hpp b/cppcache/integration-test/TallyListener.hpp
index 1d94a0f..65e9dcc 100644
--- a/cppcache/integration-test/TallyListener.hpp
+++ b/cppcache/integration-test/TallyListener.hpp
@@ -20,13 +20,10 @@
* limitations under the License.
*/
-#include <geode/GeodeCppCache.hpp>
+#include <geode/EntryEvent.hpp>
#include <string>
using namespace apache::geode::client;
-class TallyListener;
-
-typedef std::shared_ptr<TallyListener> TallyListenerPtr;
class TallyListener : public CacheListener {
private:
@@ -37,9 +34,9 @@ class TallyListener : public CacheListener {
int m_clears;
bool isListnerInvoked;
bool isCallbackCalled;
- CacheableKeyPtr m_lastKey;
- CacheablePtr m_lastValue;
- CacheableKeyPtr m_callbackArg;
+ std::shared_ptr<CacheableKey> m_lastKey;
+ std::shared_ptr<Cacheable> m_lastValue;
+ std::shared_ptr<CacheableKey> m_callbackArg;
bool m_ignoreTimeout;
bool m_quiet;
@@ -113,12 +110,12 @@ class TallyListener : public CacheListener {
int getInvalidates() { return m_invalidates; }
int getDestroys() { return m_destroys; }
bool isListenerInvoked() { return isListnerInvoked; }
- void setCallBackArg(const CacheableKeyPtr& callbackArg) {
+ void setCallBackArg(const std::shared_ptr<CacheableKey>& callbackArg) {
m_callbackArg = callbackArg;
}
- CacheableKeyPtr getLastKey() { return m_lastKey; }
+ std::shared_ptr<CacheableKey> getLastKey() { return m_lastKey; }
- CacheablePtr getLastValue() { return m_lastValue; }
+ std::shared_ptr<Cacheable> getLastValue() { return m_lastValue; }
bool isCallBackArgCalled() { return isCallbackCalled; }
void checkcallbackArg(const EntryEvent& event) {
if (!isListnerInvoked) isListnerInvoked = true;
diff --git a/cppcache/integration-test/TallyLoader.hpp b/cppcache/integration-test/TallyLoader.hpp
index e7184aa..d7b0c0c 100644
--- a/cppcache/integration-test/TallyLoader.hpp
+++ b/cppcache/integration-test/TallyLoader.hpp
@@ -20,15 +20,11 @@
* limitations under the License.
*/
-#include <geode/GeodeCppCache.hpp>
-
using namespace apache::geode::client;
using namespace test;
class TallyLoader;
-typedef std::shared_ptr<TallyLoader> TallyLoaderPtr;
-
class TallyLoader : virtual public CacheLoader {
private:
int32_t m_loads;
@@ -41,8 +37,10 @@ class TallyLoader : virtual public CacheLoader {
{}
virtual ~TallyLoader() {}
- CacheablePtr load(const RegionPtr& rp, const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument) {
+ std::shared_ptr<Cacheable> load(
+ const std::shared_ptr<Region>& rp,
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
LOGDEBUG("TallyLoader::load invoked for %d.", m_loads);
char buf[1024];
sprintf(buf, "TallyLoader state: (loads = %d)", m_loads);
@@ -50,7 +48,7 @@ class TallyLoader : virtual public CacheLoader {
return CacheableInt32::create(m_loads++);
}
- virtual void close(const RegionPtr& region) { LOG("TallyLoader::close"); }
+ virtual void close(const std::shared_ptr<Region>& region) { LOG("TallyLoader::close"); }
int expectLoads(int expected) {
int tries = 0;
diff --git a/cppcache/integration-test/TallyWriter.hpp b/cppcache/integration-test/TallyWriter.hpp
index 9a99b7a..e8425b7 100644
--- a/cppcache/integration-test/TallyWriter.hpp
+++ b/cppcache/integration-test/TallyWriter.hpp
@@ -20,15 +20,11 @@
* limitations under the License.
*/
-#include <geode/GeodeCppCache.hpp>
-
using namespace apache::geode::client;
using namespace test;
class TallyWriter;
-typedef std::shared_ptr<TallyWriter> TallyWriterPtr;
-
class TallyWriter : virtual public CacheWriter {
private:
int m_creates;
@@ -38,9 +34,9 @@ class TallyWriter : virtual public CacheWriter {
bool isWriterInvoke;
bool isCallbackCalled;
bool isWriterfailed;
- CacheableKeyPtr m_lastKey;
- CacheablePtr m_lastValue;
- CacheableKeyPtr m_callbackArg;
+ std::shared_ptr<CacheableKey> m_lastKey;
+ std::shared_ptr<Cacheable> m_lastValue;
+ std::shared_ptr<CacheableKey> m_callbackArg;
public:
TallyWriter()
@@ -93,7 +89,7 @@ class TallyWriter : virtual public CacheWriter {
return !isWriterfailed;
}
- virtual void close(const RegionPtr& region) { LOG("TallyWriter::close"); }
+ virtual void close(const std::shared_ptr<Region>& region) { LOG("TallyWriter::close"); }
int expectCreates(int expected) {
int tries = 0;
@@ -119,7 +115,7 @@ class TallyWriter : virtual public CacheWriter {
int getInvalidates() { return m_invalidates; }
int getDestroys() { return m_destroys; }
void setWriterFailed() { isWriterfailed = true; }
- void setCallBackArg(const CacheableKeyPtr& callbackArg) {
+ void setCallBackArg(const std::shared_ptr<CacheableKey>& callbackArg) {
m_callbackArg = callbackArg;
}
void resetWriterInvokation() {
@@ -128,9 +124,9 @@ class TallyWriter : virtual public CacheWriter {
}
bool isWriterInvoked() { return isWriterInvoke; }
bool isCallBackArgCalled() { return isCallbackCalled; }
- CacheableKeyPtr getLastKey() { return m_lastKey; }
+ std::shared_ptr<CacheableKey> getLastKey() { return m_lastKey; }
- CacheablePtr getLastValue() { return m_lastValue; }
+ std::shared_ptr<Cacheable> getLastValue() { return m_lastValue; }
void showTallies() {
char buf[1024];
diff --git a/cppcache/integration-test/ThinClientCQ.hpp b/cppcache/integration-test/ThinClientCQ.hpp
index 027eb1a..11bf9c9 100644
--- a/cppcache/integration-test/ThinClientCQ.hpp
+++ b/cppcache/integration-test/ThinClientCQ.hpp
@@ -40,7 +40,7 @@ const char* locatorsG =
void createRegionForCQ(const char* name, bool ackMode,
bool clientNotificationEnabled = false,
int redundancyLevel = 0,
- const CacheListenerPtr& listener = nullptr,
+ const std::shared_ptr<CacheListener>& listener = nullptr,
bool caching = true) {
// Use region name as pool name to avoid recreating pools with the same name.
getHelper()->createPoolWithLocators(name, locatorsG,
@@ -49,12 +49,11 @@ void createRegionForCQ(const char* name, bool ackMode,
createRegionAndAttachPool(name, ackMode, name, caching);
}
-void createRegionForCQMU(const char* name, bool ackMode,
- bool clientNotificationEnabled = false,
- int redundancyLevel = 0,
- const CacheListenerPtr& listener = nullptr,
- bool caching = true,
- bool poolIsInMultiuserMode = false) {
+void createRegionForCQMU(
+ const char* name, bool ackMode, bool clientNotificationEnabled = false,
+ int redundancyLevel = 0,
+ const std::shared_ptr<CacheListener>& listener = nullptr,
+ bool caching = true, bool poolIsInMultiuserMode = false) {
// Use region name as pool name to avoid recreating pools with the same name.
// TODO:
// getHelper()->createPoolWithLocators( name, locatorsG,
diff --git a/cppcache/integration-test/ThinClientCallbackArg.hpp b/cppcache/integration-test/ThinClientCallbackArg.hpp
index f1f3823..1c130f8 100644
--- a/cppcache/integration-test/ThinClientCallbackArg.hpp
+++ b/cppcache/integration-test/ThinClientCallbackArg.hpp
@@ -43,26 +43,28 @@ static int numberOfLocators = 0;
const char* locatorsG =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, numberOfLocators);
const char* poolName = "__TESTPOOL1_";
-TallyListenerPtr regListener;
-TallyWriterPtr regWriter;
+std::shared_ptr<TallyListener> regListener;
+std::shared_ptr<TallyWriter> regWriter;
#include "LocatorHelper.hpp"
-void setCacheListener(const char* regName, TallyListenerPtr regListener) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
+void setCacheListener(const char* regName,
+ std::shared_ptr<TallyListener> regListener) {
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheListener(regListener);
}
-void setCacheWriter(const char* regName, TallyWriterPtr regWriter) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
+void setCacheWriter(const char* regName,
+ std::shared_ptr<TallyWriter> regWriter) {
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheWriter(regWriter);
}
void createClientPooledLocatorRegion() {
initClient(true);
- CacheableKeyPtr key0 = CacheableKey::create(keys[0]);
+ auto key0 = CacheableKey::create(keys[0]);
LOG("Creating region in CLIENT , no-ack, cacheing enable, with-listener and "
"writer");
createPooledRegion(regionNames[0], false, locatorsG, poolName, true,
@@ -73,7 +75,7 @@ void createClientPooledLocatorRegion() {
setCacheListener(regionNames[0], regListener);
regWriter->setCallBackArg(key0);
regListener->setCallBackArg(key0);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
regPtr0->registerAllKeys();
}
void validateLocalListenerWriterData() {
@@ -111,7 +113,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, doOperations)
{
- CacheableKeyPtr key0 = CacheableKey::create(keys[0]);
+ auto key0 = CacheableKey::create(keys[0]);
LOG("do entry operation from client 1");
RegionOperations region(regionNames[0]);
region.putOp(5, key0);
diff --git a/cppcache/integration-test/ThinClientDistOps.hpp b/cppcache/integration-test/ThinClientDistOps.hpp
index 2cdc986..90895b1 100644
--- a/cppcache/integration-test/ThinClientDistOps.hpp
+++ b/cppcache/integration-test/ThinClientDistOps.hpp
@@ -27,7 +27,6 @@
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include "testobject/PdxType.hpp"
@@ -68,7 +67,7 @@ END_TASK_DEFINITION
void initClient(const bool isthinClient) {
if (cacheHelper == nullptr) {
- PropertiesPtr config = Properties::create();
+ auto config = Properties::create();
if (g_isGridClient) {
config->insert("grid-client", "true");
}
@@ -109,10 +108,10 @@ void _verifyEntry(const char* name, const char* key, const char* val,
LOG(buf);
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
// if the region is no ack, then we may need to wait...
if (noKey == false) { // need to find the key!
@@ -204,9 +203,8 @@ void createRegion(const char* name, bool ackMode, const char* endpoints,
LOG("createRegion() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
- getHelper()->createRegion(name, ackMode, cachingEnable, nullptr,
- endpoints, clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, cachingEnable, nullptr,
+ endpoints, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -217,7 +215,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -231,7 +229,7 @@ void createPooledRegionSticky(const char* name, bool ackMode,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr = getHelper()->createPooledRegionSticky(
+ auto regPtr = getHelper()->createPooledRegionSticky(
name, ackMode, locators, poolname, cachingEnable,
clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -244,10 +242,10 @@ void createEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -264,7 +262,7 @@ void createEntry(const char* name, const char* key, const char* value) {
}
void createAndVerifyEntry(const char* name) {
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
/*1. create new entry with long key and long value */
@@ -296,7 +294,7 @@ void createAndVerifyEntry(const char* name) {
/*3.create new with entry nullptr key and nullptr value.
* IllegalArgumentException thrown*/
- CacheableInt32Ptr x;
+ std::shared_ptr<CacheableInt32> x;
try {
regPtr->create(x, 1);
LOG("Entry with null key and value created successfully");
@@ -319,7 +317,7 @@ void createAndVerifyEntry(const char* name) {
// serializationRegistry->addPdxType(PdxTests::PdxType::createDeserializable);
auto keyObject1 = std::make_shared<PdxTests::PdxType>();
regPtr->create(keyObject1, x);
- CacheablePtr retVal = regPtr->get(keyObject1);
+ auto retVal = regPtr->get(keyObject1);
ASSERT(retVal == x, "retVal and x should match.");
/*6.create new with entry userobject cantain all cacheable type ( like
@@ -348,7 +346,7 @@ void createAndVerifyEntry(const char* name) {
* string value*/
auto keyObject3 = std::make_shared<PdxTests::PdxType>();
regPtr->create(keyObject3, "testString");
- CacheablePtr strVal = regPtr->get(keyObject3);
+ auto strVal = regPtr->get(keyObject3);
ASSERT(strcmp(strVal->toString()->asChar(), "testString") == 0,
"strVal should be testString.");
@@ -360,7 +358,7 @@ void createAndVerifyEntry(const char* name) {
auto keyObject4 = std::make_shared<PdxTests::PdxType>();
auto valObject = std::make_shared<PdxTests::PdxType>();
regPtr->create(keyObject4, valObject);
- PdxTests::PdxTypePtr objVal =
+ auto objVal =
std::dynamic_pointer_cast<PdxTests::PdxType>(regPtr->get(keyObject4));
ASSERT(valObject == objVal, "valObject and objVal should match.");
@@ -399,9 +397,9 @@ void createEntryTwice(const char* name, const char* key, const char* value) {
sprintf(message, "Creating entry -- key: %s value: %s in region %s\n", key,
value, name);
LOG(message);
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
+ auto regPtr = getHelper()->getRegion(name);
regPtr->create(keyPtr, valPtr);
try {
regPtr->create(keyPtr, valPtr);
@@ -422,10 +420,10 @@ void updateEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -446,9 +444,9 @@ void doGetAgain(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "get region name%s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -478,9 +476,9 @@ void doNetsearch(const char* name, const char* key, const char* value) {
fflush(stdout);
static int count = 0;
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "netsearch region %s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -558,11 +556,10 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, CreatePoolForUpdateLocatorList)
{
/*
- PoolPtr createPool(const char* poolName, const char* locators, const char*
- serverGroup,
- const char* servers = nullptr, int redundancy = 0, bool
- clientNotification = false, int subscriptionAckInterval = -1,
- int connections = -1, int loadConditioningInterval = - 1, bool
+ std::shared_ptr<Pool> createPool(const char* poolName, const char*
+ locators, const char* serverGroup, const char* servers = nullptr, int
+ redundancy = 0, bool clientNotification = false, int subscriptionAckInterval
+ = -1, int connections = -1, int loadConditioningInterval = - 1, bool
isMultiuserMode = false, int updateLocatorListInterval = 5000 )
*/
initClient(true);
@@ -575,11 +572,10 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, CreatePoolForDontUpdateLocatorList)
{
/*
- PoolPtr createPool(const char* poolName, const char* locators, const char*
- serverGroup,
- const char* servers = nullptr, int redundancy = 0, bool
- clientNotification = false, int subscriptionAckInterval = -1,
- int connections = -1, int loadConditioningInterval = - 1, bool
+ std::shared_ptr<Pool> createPool(const char* poolName, const char*
+ locators, const char* serverGroup, const char* servers = nullptr, int
+ redundancy = 0, bool clientNotification = false, int subscriptionAckInterval
+ = -1, int connections = -1, int loadConditioningInterval = - 1, bool
isMultiuserMode = false, int updateLocatorListInterval = 5000 )
*/
initClient(true);
@@ -594,8 +590,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, VerifyUpdateLocatorListThread)
int sleepSeconds = 60;
dunit::sleep(sleepSeconds * 1000);
- PoolPtr pptr =
- getHelper()->getCache()->getPoolManager().find("__TESTPOOL1_");
+ auto pptr = getHelper()->getCache()->getPoolManager().find("__TESTPOOL1_");
int updateIntervalSeconds = pptr->getUpdateLocatorListInterval().count() / 1000;
int numLocatorListUpdates =
@@ -698,8 +693,8 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepFive)
{
- RegionPtr reg0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr reg1 = getHelper()->getRegion(regionNames[1]);
+ auto reg0 = getHelper()->getRegion(regionNames[0]);
+ auto reg1 = getHelper()->getRegion(regionNames[1]);
auto vec0 = reg0->serverKeys();
auto vec1 = reg1->serverKeys();
ASSERT(vec0.size() == 2, "Should have 2 keys in first region.");
@@ -747,10 +742,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepEight_Pool)
{
createPooledRegion(regionNames[2], NO_ACK, locatorsG, "__TESTPOOL1_", false,
false);
- RegionPtr reg = getHelper()->getRegion(regionNames[2]);
+ auto reg = getHelper()->getRegion(regionNames[2]);
LOG("REGION Created with Caching Enabled false");
- CacheableKeyPtr keyPtr = createKey(CREATE_TWICE_KEY);
- CacheableStringPtr valPtr = CacheableString::create(CREATE_TWICE_VALUE);
+ auto keyPtr = createKey(CREATE_TWICE_KEY);
+ auto valPtr = CacheableString::create(CREATE_TWICE_VALUE);
try {
reg->create(keyPtr, valPtr);
char message[200];
@@ -775,17 +770,16 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepEight_Pool_Sticky)
{
createPooledRegionSticky(regionNames[2], NO_ACK, locatorsG, "__TESTPOOL1_",
false, false);
- RegionPtr reg = getHelper()->getRegion(regionNames[2]);
+ auto reg = getHelper()->getRegion(regionNames[2]);
LOG("REGION Created with Caching Enabled false");
- CacheableKeyPtr keyPtr = createKey(CREATE_TWICE_KEY);
- CacheableStringPtr valPtr = CacheableString::create(CREATE_TWICE_VALUE);
+ auto keyPtr = createKey(CREATE_TWICE_KEY);
+ auto valPtr = CacheableString::create(CREATE_TWICE_VALUE);
- RegionPtr reg0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr reg1 = getHelper()->getRegion(regionNames[1]);
+ auto reg0 = getHelper()->getRegion(regionNames[0]);
+ auto reg1 = getHelper()->getRegion(regionNames[1]);
reg0->localInvalidate(createKey(keys[1]));
reg1->localInvalidate(createKey(keys[3]));
- PoolPtr pool =
- getHelper()->getCache()->getPoolManager().find("__TESTPOOL1_");
+ auto pool = getHelper()->getCache()->getPoolManager().find("__TESTPOOL1_");
ASSERT(pool != nullptr, "Pool Should have been found");
doNetsearch(regionNames[0], keys[1], nvals[1]);
doNetsearch(regionNames[1], keys[3], nvals[3]);
diff --git a/cppcache/integration-test/ThinClientDistOps2.hpp b/cppcache/integration-test/ThinClientDistOps2.hpp
index fafa461..193b3be 100644
--- a/cppcache/integration-test/ThinClientDistOps2.hpp
+++ b/cppcache/integration-test/ThinClientDistOps2.hpp
@@ -21,7 +21,6 @@
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <string>
@@ -152,11 +151,11 @@ END_TASK_DEFINITION
// Test for getAll
DUNIT_TASK_DEFINITION(CLIENT1, Client1GetAll)
{
- RegionPtr reg0 = getHelper()->getRegion(_regionNames[0]);
+ auto reg0 = getHelper()->getRegion(_regionNames[0]);
- VectorOfCacheableKey keys0;
- CacheableKeyPtr key0 = CacheableString::create(_keys[0]);
- CacheableKeyPtr key1 = CacheableString::create(_keys[1]);
+ std::vector<std::shared_ptr<CacheableKey>> keys0;
+ auto key0 = CacheableString::create(_keys[0]);
+ auto key1 = CacheableString::create(_keys[1]);
// re-create region with caching enabled
reg0->localDestroyRegion();
@@ -186,11 +185,11 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1GetAll)
// for second region invalidate only one key to have a partial get
// from java server
- RegionPtr reg1 = getHelper()->getRegion(_regionNames[1]);
- CacheableKeyPtr key2 = CacheableString::create(_keys[2]);
- CacheableKeyPtr key3 = CacheableString::create(_keys[3]);
+ auto reg1 = getHelper()->getRegion(_regionNames[1]);
+ auto key2 = CacheableString::create(_keys[2]);
+ auto key3 = CacheableString::create(_keys[3]);
reg1->localInvalidate(key2);
- VectorOfCacheableKey keys1;
+ std::vector<std::shared_ptr<CacheableKey>> keys1;
keys1.push_back(key2);
keys1.push_back(key3);
@@ -228,11 +227,11 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, Client1GetAll_Pool)
{
{
- RegionPtr reg0 = getHelper()->getRegion(_regionNames[0]);
+ auto reg0 = getHelper()->getRegion(_regionNames[0]);
- VectorOfCacheableKey keys0;
- CacheableKeyPtr key0 = CacheableString::create(_keys[0]);
- CacheableKeyPtr key1 = CacheableString::create(_keys[1]);
+ std::vector<std::shared_ptr<CacheableKey>> keys0;
+ auto key0 = CacheableString::create(_keys[0]);
+ auto key1 = CacheableString::create(_keys[1]);
getHelper()->createRegionAndAttachPool(_regionNames[0], USE_ACK,
poolName);
@@ -261,11 +260,11 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1GetAll_Pool)
{
// for second region invalidate only one key to have a partial get
// from java server
- RegionPtr reg1 = getHelper()->getRegion(_regionNames[1]);
- CacheableKeyPtr key2 = CacheableString::create(_keys[2]);
- CacheableKeyPtr key3 = CacheableString::create(_keys[3]);
+ auto reg1 = getHelper()->getRegion(_regionNames[1]);
+ auto key2 = CacheableString::create(_keys[2]);
+ auto key3 = CacheableString::create(_keys[3]);
reg1->localInvalidate(key2);
- VectorOfCacheableKey keys1;
+ std::vector<std::shared_ptr<CacheableKey>> keys1;
keys1.push_back(key2);
keys1.push_back(key3);
diff --git a/cppcache/integration-test/ThinClientDurable.hpp b/cppcache/integration-test/ThinClientDurable.hpp
index cbb9f16..59e86bb 100644
--- a/cppcache/integration-test/ThinClientDurable.hpp
+++ b/cppcache/integration-test/ThinClientDurable.hpp
@@ -60,8 +60,8 @@ class OperMonitor : public CacheListener {
void check(const EntryEvent& event) {
m_ops++;
- CacheableKeyPtr key = event.getKey();
- CacheableInt32Ptr value = nullptr;
+ auto key = event.getKey();
+ std::shared_ptr<CacheableInt32> value = nullptr;
try {
value = std::dynamic_pointer_cast<CacheableInt32>(event.getNewValue());
} catch (Exception&) {
@@ -137,19 +137,12 @@ class OperMonitor : public CacheListener {
virtual void afterRegionInvalidate(const RegionEvent& event){};
virtual void afterRegionDestroy(const RegionEvent& event){};
};
-typedef std::shared_ptr<OperMonitor> OperMonitorPtr;
-void setCacheListener(const char* regName, OperMonitorPtr monitor) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
+void setCacheListener(const char* regName, std::shared_ptr<OperMonitor> monitor) {
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheListener(monitor);
-}
-
-OperMonitorPtr mon1C1 = nullptr;
-OperMonitorPtr mon2C1 = nullptr;
-
-OperMonitorPtr mon1C2 = nullptr;
-OperMonitorPtr mon2C2 = nullptr;
+}std::shared_ptr<OperMonitor> mon1C1 = nullptr;std::shared_ptr<OperMonitor> mon2C1=nullptr;std::shared_ptr<OperMonitor> mon1C2 = nullptr;std::shared_ptr<OperMonitor> mon2C2=nullptr;
/* Total 10 Keys , alternate durable and non-durable */
const char* mixKeys[] = {"Key-1", "D-Key-1", "L-Key", "LD-Key"};
@@ -159,8 +152,8 @@ const char* testRegex[] = {"D-Key-.*", "Key-.*"};
#include "ThinClientTasks_C2S2.hpp"
void initClientCache(int durableIdx, int redundancy,
- std::chrono::seconds durableTimeout, OperMonitorPtr& mon1,
- OperMonitorPtr& mon2, int sleepDuration = 0) {
+ std::chrono::seconds durableTimeout, std::shared_ptr<OperMonitor>& mon1,
+ std::shared_ptr<OperMonitor>& mon2, int sleepDuration = 0) {
// Sleep before starting , Used for Timeout testing.
if (sleepDuration) SLEEP(sleepDuration);
@@ -171,8 +164,8 @@ void initClientCache(int durableIdx, int redundancy,
getHelper()->cachePtr->readyForEvents();
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
// Register Regex in both region.
regPtr0->registerRegex(testRegex[0], true);
@@ -181,18 +174,18 @@ void initClientCache(int durableIdx, int redundancy,
regPtr1->registerRegex(testRegex[1], false);
// Register List in both regions
- VectorOfCacheableKey v;
- CacheableKeyPtr ldkey = CacheableKey::create(mixKeys[3]);
+ std::vector<std::shared_ptr<CacheableKey>> v;
+ auto ldkey = CacheableKey::create(mixKeys[3]);
v.push_back(ldkey);
regPtr0->registerKeys(v, true);
regPtr1->registerKeys(v, true);
v.clear();
- CacheableKeyPtr lkey = CacheableKey::create(mixKeys[2]);
- v.push_back(lkey);
- regPtr0->registerKeys(v);
- regPtr1->registerKeys(v);
+ auto lkey = CacheableKey::create(mixKeys[2]);
+ v.push_back(lkey);
+ regPtr0->registerKeys(v);
+ regPtr1->registerKeys(v);
- LOG("Clnt1Init complete.");
+ LOG("Clnt1Init complete.");
}
void feederUpdate(int value, int ignoreR2 = false) {
diff --git a/cppcache/integration-test/ThinClientDurableConnect.hpp b/cppcache/integration-test/ThinClientDurableConnect.hpp
index 878bca3..44dc7d1 100644
--- a/cppcache/integration-test/ThinClientDurableConnect.hpp
+++ b/cppcache/integration-test/ThinClientDurableConnect.hpp
@@ -165,7 +165,7 @@ DUNIT_TASK_DEFINITION(CLIENT, ClntUp)
initClientAndRegion(1, 0);
getHelper()->cachePtr->readyForEvents();
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
regPtr0->registerAllKeys(true);
LOG("Clnt1Init complete.");
@@ -177,7 +177,7 @@ DUNIT_TASK_DEFINITION(CLIENT, ClntUpNonHA)
initClientAndRegion(0, 0);
getHelper()->cachePtr->readyForEvents();
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
regPtr0->registerAllKeys(true);
LOG("Clnt1Init complete.");
diff --git a/cppcache/integration-test/ThinClientDurableFailover.hpp b/cppcache/integration-test/ThinClientDurableFailover.hpp
index e91748a..9188d4f 100644
--- a/cppcache/integration-test/ThinClientDurableFailover.hpp
+++ b/cppcache/integration-test/ThinClientDurableFailover.hpp
@@ -58,8 +58,8 @@ class OperMonitor : public CacheListener {
void check(const EntryEvent& event) {
m_ops++;
- CacheableKeyPtr key = event.getKey();
- CacheableInt32Ptr value = nullptr;
+ auto key = event.getKey();
+ std::shared_ptr<CacheableInt32> value = nullptr;
try {
value = std::dynamic_pointer_cast<CacheableInt32>(event.getNewValue());
} catch (Exception&) {
@@ -132,16 +132,12 @@ class OperMonitor : public CacheListener {
virtual void afterRegionInvalidate(const RegionEvent& event){};
virtual void afterRegionDestroy(const RegionEvent& event){};
};
-typedef std::shared_ptr<OperMonitor> OperMonitorPtr;
-void setCacheListener(const char* regName, OperMonitorPtr monitor) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
+void setCacheListener(const char* regName, std::shared_ptr<OperMonitor> monitor) {
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheListener(monitor);
-}
-
-OperMonitorPtr mon1 = nullptr;
-OperMonitorPtr mon2 = nullptr;
+}std::shared_ptr<OperMonitor> mon1 = nullptr;std::shared_ptr<OperMonitor> mon2=nullptr;
#include "ThinClientDurableInit.hpp"
#include "ThinClientTasks_C2S2.hpp"
@@ -150,7 +146,7 @@ OperMonitorPtr mon2 = nullptr;
const char* mixKeys[] = {"Key-1", "D-Key-1", "L-Key", "LD-Key"};
const char* testRegex[] = {"D-Key-.*", "Key-.*"};
-void initClientCache(int redundancy, int durableTimeout, OperMonitorPtr& mon,
+void initClientCache(int redundancy, int durableTimeout, std::shared_ptr<OperMonitor>& mon,
int sleepDuration = 0, int durableIdx = 0) {
if (sleepDuration) SLEEP(sleepDuration);
@@ -169,7 +165,7 @@ void initClientCache(int redundancy, int durableTimeout, OperMonitorPtr& mon,
getHelper()->cachePtr->readyForEvents();
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
// for R =1 it will get a redundancy error
try {
diff --git a/cppcache/integration-test/ThinClientDurableInit.hpp b/cppcache/integration-test/ThinClientDurableInit.hpp
index 9f3c22a..f57c856 100644
--- a/cppcache/integration-test/ThinClientDurableInit.hpp
+++ b/cppcache/integration-test/ThinClientDurableInit.hpp
@@ -41,7 +41,7 @@ void initClientAndRegion(
std::chrono::seconds redundancyMonitorInterval =
std::chrono::seconds::zero(),
std::chrono::seconds durableClientTimeout = std::chrono::seconds(60)) {
- PropertiesPtr pp = Properties::create();
+ auto pp = Properties::create();
if (ClientIdx < 2) {
pp->insert("durable-client-id", durableIds[ClientIdx]);
pp->insert("durable-timeout", durableClientTimeout);
@@ -59,7 +59,7 @@ void initClientAndTwoRegions(int ClientIdx, int redundancy,
std::chrono::seconds durableClientTimeout,
const char* conflation = nullptr,
const char* rNames[] = regionNames) {
- PropertiesPtr pp = Properties::create();
+ auto pp = Properties::create();
pp->insert("durable-client-id", durableIds[ClientIdx]);
pp->insert("durable-timeout", durableClientTimeout);
if (conflation) {
@@ -75,7 +75,7 @@ void initClientAndTwoRegions(int ClientIdx, int redundancy,
void initClientAndTwoRegionsAndTwoPools(
int ClientIdx, int redundancy, std::chrono::seconds durableClientTimeout,
const char* conflation = nullptr, const char* rNames[] = regionNames) {
- PropertiesPtr pp = Properties::create();
+ auto pp = Properties::create();
pp->insert("durable-client-id", durableIds[ClientIdx]);
pp->insert("durable-timeout", durableClientTimeout);
if (conflation) {
@@ -95,12 +95,12 @@ void initClientAndTwoRegionsAndTwoPools(
LOG("Exception occured while sending readyForEvents");
}*/
- RegionPtr regPtr1 = getHelper()->getRegion(rNames[1]);
+ auto regPtr1 = getHelper()->getRegion(rNames[1]);
regPtr1->registerAllKeys(true);
getHelper()->createPoolWithLocators("__TESTPOOL1_", locatorsG, true,
redundancy, std::chrono::seconds(1));
createRegionAndAttachPool(rNames[0], USE_ACK, "__TESTPOOL1_", true);
- RegionPtr regPtr0 = getHelper()->getRegion(rNames[0]);
+ auto regPtr0 = getHelper()->getRegion(rNames[0]);
regPtr0->registerAllKeys(true);
LOG("Calling readyForEvents:");
diff --git a/cppcache/integration-test/ThinClientDurableInterest.hpp b/cppcache/integration-test/ThinClientDurableInterest.hpp
index 5b684cf..e5fab23 100644
--- a/cppcache/integration-test/ThinClientDurableInterest.hpp
+++ b/cppcache/integration-test/ThinClientDurableInterest.hpp
@@ -52,7 +52,7 @@ class OperMonitor : public CacheListener {
void check(const EntryEvent& event) {
m_ops++;
- CacheableKeyPtr key = event.getKey();
+ auto key = event.getKey();
auto value = std::dynamic_pointer_cast<CacheableInt32>(event.getNewValue());
char buf[256];
@@ -114,23 +114,21 @@ class OperMonitor : public CacheListener {
LOG("afterRegionLive called.");
}
};
-typedef std::shared_ptr<OperMonitor> OperMonitorPtr;
const char* mixKeys[] = {"Key-1", "D-Key-1", "Key-2", "D-Key-2"};
-const char* testRegex[] = {"D-Key-.*", "Key-.*"};
-OperMonitorPtr mon1, mon2;
+const char* testRegex[] = {"D-Key-.*", "Key-.*"}; std::shared_ptr<OperMonitor> mon1, mon2;
#include "ThinClientDurableInit.hpp"
#include "ThinClientTasks_C2S2.hpp"
-void setCacheListener(const char* regName, OperMonitorPtr monitor) {
+void setCacheListener(const char* regName, std::shared_ptr<OperMonitor> monitor) {
LOGINFO("setCacheListener to %s ", regName);
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheListener(monitor);
}
-void initClientWithIntrest(int ClientIdx, OperMonitorPtr& mon) {
+void initClientWithIntrest(int ClientIdx, std::shared_ptr<OperMonitor>& mon) {
if (mon == nullptr) {
mon = std::make_shared<OperMonitor>();
}
@@ -145,13 +143,13 @@ void initClientWithIntrest(int ClientIdx, OperMonitorPtr& mon) {
LOG("Exception occured while sending readyForEvents");
}
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
regPtr0->registerRegex(testRegex[0], true);
regPtr0->registerRegex(testRegex[1], false);
}
-void initClientWithIntrest2(int ClientIdx, OperMonitorPtr& monitor1,
- OperMonitorPtr& monitor2) {
+void initClientWithIntrest2(int ClientIdx, std::shared_ptr<OperMonitor>& monitor1,
+ std::shared_ptr<OperMonitor>& monitor2) {
initClientAndTwoRegionsAndTwoPools(0, ClientIdx, std::chrono::seconds(60));
if (monitor1 == nullptr) {
monitor1 = std::make_shared<OperMonitor>(1);
@@ -163,7 +161,7 @@ void initClientWithIntrest2(int ClientIdx, OperMonitorPtr& monitor1,
setCacheListener(regionNames[1], monitor2);
}
-void initClientNoIntrest(int ClientIdx, OperMonitorPtr mon) {
+void initClientNoIntrest(int ClientIdx, std::shared_ptr<OperMonitor> mon) {
initClientAndRegion(0, ClientIdx);
setCacheListener(regionNames[0], mon);
@@ -171,13 +169,13 @@ void initClientNoIntrest(int ClientIdx, OperMonitorPtr mon) {
getHelper()->cachePtr->readyForEvents();
}
-void initClientRemoveIntrest(int ClientIdx, OperMonitorPtr mon) {
+void initClientRemoveIntrest(int ClientIdx, std::shared_ptr<OperMonitor> mon) {
initClientAndRegion(0, ClientIdx);
setCacheListener(regionNames[0], mon);
getHelper()->cachePtr->readyForEvents();
// Only unregister durable Intrest.
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
regPtr0->registerRegex(testRegex[0], true);
regPtr0->unregisterRegex(testRegex[0]);
}
diff --git a/cppcache/integration-test/ThinClientDurableReconnect.hpp b/cppcache/integration-test/ThinClientDurableReconnect.hpp
index d1cbb95..8ee384c 100644
--- a/cppcache/integration-test/ThinClientDurableReconnect.hpp
+++ b/cppcache/integration-test/ThinClientDurableReconnect.hpp
@@ -59,27 +59,24 @@ class OperMonitor : public CacheListener {
LOG("Duplicate Recieved");
}
}
- virtual void close(const RegionPtr& region) {
+ virtual void close(const std::shared_ptr<Region>& region) {
m_close = true;
LOG("Listener Close Called");
}
};
-typedef std::shared_ptr<OperMonitor> OperMonitorPtr;
-void setCacheListener(const char* regName, OperMonitorPtr monitor) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
+void setCacheListener(const char* regName, std::shared_ptr<OperMonitor> monitor) {
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheListener(monitor);
-}
-
-OperMonitorPtr mon1 = nullptr;
+}std::shared_ptr<OperMonitor> mon1 = nullptr;
const char* mixKeys[] = {"D-Key-1"};
#include "ThinClientDurableInit.hpp"
#include "ThinClientTasks_C2S2.hpp"
-void initClientCache(int redundancy, OperMonitorPtr& mon) {
+void initClientCache(int redundancy, std::shared_ptr<OperMonitor>& mon) {
initClientAndRegion(redundancy, 0, std::chrono::seconds(60000),
std::chrono::seconds(1), std::chrono::seconds(300));
@@ -90,7 +87,7 @@ void initClientCache(int redundancy, OperMonitorPtr& mon) {
setCacheListener(regionNames[0], mon);
getHelper()->cachePtr->readyForEvents();
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
regPtr0->registerAllKeys(true);
}
diff --git a/cppcache/integration-test/ThinClientFailover.hpp b/cppcache/integration-test/ThinClientFailover.hpp
index 8b91ebc..49f1e7d 100644
--- a/cppcache/integration-test/ThinClientFailover.hpp
+++ b/cppcache/integration-test/ThinClientFailover.hpp
@@ -21,7 +21,6 @@
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/High_Res_Timer.h>
#include <ace/OS.h>
@@ -84,11 +83,11 @@ void _verifyEntry(const char* name, const char* key, const char* val,
LOG(buf);
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
LOG("_verifyEntry =================");
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
if (noKey == false) { // need to find the key!
ASSERT(regPtr->containsKey(keyPtr), "Key not found in region.");
@@ -156,8 +155,8 @@ void createRegion(const char* name, bool ackMode, const char* endpoints,
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
// ack, caching
- RegionPtr regPtr = getHelper()->createRegion(
- name, ackMode, true, nullptr, endpoints, clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
+ endpoints, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -168,7 +167,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -182,7 +181,7 @@ void createPooledRegionSticky(const char* name, bool ackMode,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr = getHelper()->createPooledRegionSticky(
+ auto regPtr = getHelper()->createPooledRegionSticky(
name, ackMode, locators, poolname, cachingEnable,
clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -195,10 +194,10 @@ void createEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -220,10 +219,10 @@ void updateEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -245,9 +244,9 @@ void doNetsearch(const char* name, const char* key, const char* value) {
key, value, name);
fflush(stdout);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "netsearch region %s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
diff --git a/cppcache/integration-test/ThinClientFailover2.hpp b/cppcache/integration-test/ThinClientFailover2.hpp
index ba5c95d..a57b4c9 100644
--- a/cppcache/integration-test/ThinClientFailover2.hpp
+++ b/cppcache/integration-test/ThinClientFailover2.hpp
@@ -21,7 +21,6 @@
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/High_Res_Timer.h>
#include <ace/OS.h>
@@ -87,10 +86,10 @@ void _verifyEntry(const char* name, const char* key, const char* val,
LOG(buf);
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
if (noKey == false) { // need to find the key!
ASSERT(regPtr->containsKey(keyPtr), "Key not found in region.");
@@ -178,8 +177,8 @@ void createRegion(const char* name, bool ackMode, const char* endpoints,
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
// ack, caching
- RegionPtr regPtr = getHelper()->createRegion(
- name, ackMode, true, nullptr, endpoints, clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
+ endpoints, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -190,7 +189,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -202,10 +201,10 @@ void createEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -227,10 +226,10 @@ void updateEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -252,9 +251,9 @@ void doNetsearch(const char* name, const char* key, const char* value) {
key, value, name);
fflush(stdout);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "netsearch region %s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -288,9 +287,9 @@ void invalidateEntry(const char* name, const char* key) {
fprintf(stdout, "Invalidating entry -- key: %s in region %s\n", key, name);
fflush(stdout);
// Invalidate entry, verify entry is invalidated
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -309,9 +308,9 @@ void destroyEntry(const char* name, const char* key) {
fprintf(stdout, "Destroying entry -- key: %s in region %s\n", key, name);
fflush(stdout);
// Destroy entry, verify entry is destroyed
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -325,7 +324,7 @@ void destroyEntry(const char* name, const char* key) {
void destroyRegion(const char* name) {
LOG("destroyRegion() entered.");
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
regPtr->destroyRegion();
LOG("Region destroyed.");
}
@@ -357,7 +356,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepOne_Pool_Locator)
true);
createPooledRegion(regionNames[1], NO_ACK, locatorsG, "__TEST_POOL1__",
true);
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
regPtr->registerAllKeys(false, false, false);
regPtr = getHelper()->getRegion(regionNames[1]);
regPtr->registerAllKeys(false, false, false);
@@ -375,7 +374,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepTwo_Pool_Locator)
true);
createPooledRegion(regionNames[1], NO_ACK, locatorsG, "__TEST_POOL1__",
true);
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
regPtr->registerAllKeys(false, false, false);
regPtr = getHelper()->getRegion(regionNames[1]);
regPtr->registerAllKeys(false, false, false);
@@ -420,8 +419,8 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepFive)
{
- RegionPtr reg0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr reg1 = getHelper()->getRegion(regionNames[1]);
+ auto reg0 = getHelper()->getRegion(regionNames[0]);
+ auto reg1 = getHelper()->getRegion(regionNames[1]);
auto vec0 = reg0->serverKeys();
auto vec1 = reg1->serverKeys();
ASSERT(vec0.size() == 3, "Should have 3 keys in first region.");
diff --git a/cppcache/integration-test/ThinClientFailover3.hpp b/cppcache/integration-test/ThinClientFailover3.hpp
index 7506812..11ba8a2 100644
--- a/cppcache/integration-test/ThinClientFailover3.hpp
+++ b/cppcache/integration-test/ThinClientFailover3.hpp
@@ -21,7 +21,6 @@
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <string>
@@ -85,10 +84,10 @@ void _verifyEntry(const char *name, const char *key, const char *val,
LOG(buf);
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
if (noKey == false) { // need to find the key!
ASSERT(regPtr->containsKey(keyPtr), "Key not found in region.");
@@ -157,7 +156,7 @@ void createPooledRegion(const char *name, bool ackMode, const char *locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -169,10 +168,10 @@ void createEntry(const char *name, const char *key, const char *value) {
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -194,10 +193,10 @@ void updateEntry(const char *name, const char *key, const char *value) {
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -217,9 +216,9 @@ void doNetsearch(const char *name, const char *key, const char *value) {
key, value, name);
fflush(stdout);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "netsearch region %s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
diff --git a/cppcache/integration-test/ThinClientFailoverInterest.hpp b/cppcache/integration-test/ThinClientFailoverInterest.hpp
index ab7ecfa..323a175 100644
--- a/cppcache/integration-test/ThinClientFailoverInterest.hpp
+++ b/cppcache/integration-test/ThinClientFailoverInterest.hpp
@@ -21,7 +21,6 @@
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <string>
@@ -86,10 +85,10 @@ void _verifyEntry(const char* name, const char* key, const char* val,
}
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
// if the region is no ack, then we may need to wait...
if (!isCreated) {
@@ -184,8 +183,8 @@ void createRegion(const char* name, bool ackMode, const char* endpoints,
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
// ack, not a mirror, caching
- RegionPtr regPtr = getHelper()->createRegion(
- name, ackMode, true, nullptr, endpoints, clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
+ endpoints, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -196,7 +195,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -208,10 +207,10 @@ void createEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -233,10 +232,10 @@ void updateEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -258,9 +257,9 @@ void doNetsearch(const char* name, const char* key, const char* value) {
key, value, name);
fflush(stdout);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "netsearch region %s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -324,13 +323,13 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepTwo_Pool_Locator)
createPooledRegion(regionNames[1], NO_ACK, locatorsG, "__TEST_POOL1__",
true);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
- CacheableKeyPtr keyPtr0 = CacheableKey::create(keys[0]);
- CacheableKeyPtr keyPtr2 = CacheableKey::create(keys[2]);
+ auto keyPtr0 = CacheableKey::create(keys[0]);
+ auto keyPtr2 = CacheableKey::create(keys[2]);
- VectorOfCacheableKey keys0, keys1;
+ std::vector<std::shared_ptr<CacheableKey>> keys0, keys1;
keys0.push_back(keyPtr0);
keys1.push_back(keyPtr2);
regPtr0->registerKeys(keys0);
diff --git a/cppcache/integration-test/ThinClientFailoverInterest2.hpp b/cppcache/integration-test/ThinClientFailoverInterest2.hpp
index e915c30..1c28de1 100644
--- a/cppcache/integration-test/ThinClientFailoverInterest2.hpp
+++ b/cppcache/integration-test/ThinClientFailoverInterest2.hpp
@@ -21,7 +21,6 @@
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <string>
@@ -85,10 +84,10 @@ void _verifyEntry(const char* name, const char* key, const char* val,
}
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
// if the region is no ack, then we may need to wait...
if (!isCreated) {
@@ -183,8 +182,8 @@ void createRegion(const char* name, bool ackMode, const char* endpoints,
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
// ack, caching
- RegionPtr regPtr = getHelper()->createRegion(
- name, ackMode, true, nullptr, endpoints, clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
+ endpoints, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -195,7 +194,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -207,10 +206,10 @@ void createEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -232,10 +231,10 @@ void updateEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -257,9 +256,9 @@ void doNetsearch(const char* name, const char* key, const char* value) {
key, value, name);
fflush(stdout);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "netsearch region %s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -324,8 +323,8 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepTwo_Pool_Locator)
createPooledRegion(regionNames[1], NO_ACK, locatorsG, "__TEST_POOL1__",
true);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
regPtr0->registerAllKeys();
regPtr1->registerAllKeys();
@@ -390,8 +389,8 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, StepSeven)
{
// Client two unregister all keys
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
regPtr0->unregisterAllKeys();
regPtr1->unregisterAllKeys();
diff --git a/cppcache/integration-test/ThinClientFailoverInterestAllWithCache.hpp b/cppcache/integration-test/ThinClientFailoverInterestAllWithCache.hpp
index c09edcf..f22b9d4 100644
--- a/cppcache/integration-test/ThinClientFailoverInterestAllWithCache.hpp
+++ b/cppcache/integration-test/ThinClientFailoverInterestAllWithCache.hpp
@@ -20,7 +20,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <string>
@@ -90,10 +89,10 @@ void _verifyEntry(const char* name, const char* key, const char* val,
}
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
// if the region is no ack, then we may need to wait...
if (!isCreated) {
@@ -187,8 +186,8 @@ void createRegion(const char* name, bool ackMode, const char* endpoints,
LOG("createRegion() entered.");
LOGINFO("Creating region -- %s ackMode is %d", name, ackMode);
// ack, caching
- RegionPtr regPtr = getHelper()->createRegion(
- name, ackMode, true, nullptr, endpoints, clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
+ endpoints, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -198,10 +197,10 @@ void createEntry(const char* name, const char* key, const char* value) {
LOGINFO("Creating entry -- key: %s value: %s in region %s", key, value,
name);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -222,10 +221,10 @@ void updateEntry(const char* name, const char* key, const char* value) {
LOGINFO("Updating entry -- key: %s value: %s in region %s", key, value,
name);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -244,9 +243,9 @@ void doNetsearch(const char* name, const char* key, const char* value) {
LOGINFO("Netsearching for entry -- key: %s expecting value: %s in region %s",
key, value, name);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
LOGINFO("netsearch region %s", regPtr->getName());
ASSERT(regPtr != nullptr, "Region not found.");
@@ -315,8 +314,8 @@ DUNIT_TASK_DEFINITION(CLIENT2, InitializeClient2)
getHelper()->createPooledRegion(regionNames[1], NO_ACK, locatorsG,
"__TEST_POOL1__", true, true);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
// create a local entry to check for no change after register interest
createEntry(regionNames[0], keys[1], nvals[1]);
regPtr0->registerAllKeys(false, true);
@@ -337,8 +336,8 @@ DUNIT_TASK_DEFINITION(CLIENT2, InitializeClient2Regex)
createRegion(regionNames[0], USE_ACK, locatorsG, true);
createRegion(regionNames[1], NO_ACK, locatorsG, true);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
// create a local entry to check for no change after register interest
createEntry(regionNames[0], keys[1], nvals[1]);
regPtr0->registerRegex(".*", false, true);
@@ -359,7 +358,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, VerifyClient1)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
regPtr0->registerAllKeys(false, false);
ASSERT(regPtr0->size() == 1, "Expected one entry in region");
@@ -368,7 +367,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, VerifyClient1)
"Expected region to not contain the value");
// check the same for registerRegex(".*")
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
regPtr1->registerRegex(".*", false, false);
ASSERT(regPtr1->size() == 1, "Expected one entry in region");
@@ -387,8 +386,8 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, VerifyClient2)
{
// Client two should recieve all entries
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
ASSERT(regPtr0->size() == 2, "Expected two entries in region");
ASSERT(regPtr1->size() == 2, "Expected two entries in region");
@@ -446,8 +445,8 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, Client2UnregisterAllKeys)
{
// Client two unregister all keys
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
regPtr0->unregisterAllKeys();
regPtr1->unregisterAllKeys();
diff --git a/cppcache/integration-test/ThinClientFailoverRegex.hpp b/cppcache/integration-test/ThinClientFailoverRegex.hpp
index 7b713cc..7c67070 100644
--- a/cppcache/integration-test/ThinClientFailoverRegex.hpp
+++ b/cppcache/integration-test/ThinClientFailoverRegex.hpp
@@ -21,7 +21,6 @@
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <string>
@@ -86,10 +85,10 @@ void _verifyEntry(const char* name, const char* key, const char* val,
}
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
// if the region is no ack, then we may need to wait...
if (!isCreated) {
@@ -184,8 +183,8 @@ void createRegion(const char* name, bool ackMode, const char* endpoints,
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
// ack, caching
- RegionPtr regPtr = getHelper()->createRegion(
- name, ackMode, true, nullptr, endpoints, clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
+ endpoints, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -196,7 +195,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -208,10 +207,10 @@ void createEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -233,10 +232,10 @@ void updateEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -258,9 +257,9 @@ void doNetsearch(const char* name, const char* key, const char* value) {
key, value, name);
fflush(stdout);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "netsearch region %s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -330,14 +329,14 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepTwo_Pool_Locator)
createEntry(regionNames[1], keys[1], nvals[1]);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
/*
- CacheableKeyPtr keyPtr0 = CacheableKey::create(keys[0]);
- CacheableKeyPtr keyPtr2 = CacheableKey::create(keys[2]);
+ auto keyPtr0 = CacheableKey::create(keys[0]);
+ auto keyPtr2 = CacheableKey::create(keys[2]);
- VectorOfCacheableKey keys0,keys1;
+ std::vector<std::shared_ptr<CacheableKey>> keys0,keys1;
keys0.push_back(keyPtr0);
keys1.push_back(keyPtr2);
regPtr0->registerKeys(keys0, nullptr);
@@ -356,7 +355,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
createEntry(regionNames[0], keys[0], vals[0]);
createEntry(regionNames[1], keys[2], vals[2]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
regPtr1->registerRegex(regkeys[1], false);
doNetsearch(
@@ -378,13 +377,13 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepFour)
updateEntry(regionNames[1], keys[1], vals[1]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
regPtr1->unregisterRegex(regkeys[2]);
/*
- RegionPtr regPtr1 = getHelper()->getRegion( regionNames[1] );
- CacheableKeyPtr keyPtr2 = CacheableKey::create(keys[2]);
- VectorOfCacheableKey keys2;
+ auto regPtr1 = getHelper()->getRegion( regionNames[1] );
+ auto keyPtr2 = CacheableKey::create(keys[2]);
+ std::vector<std::shared_ptr<CacheableKey>> keys2;
keys2.push_back(keyPtr2);
regPtr1->unregisterKeys(keys2, nullptr);
*/
diff --git a/cppcache/integration-test/ThinClientGatewayTest.hpp b/cppcache/integration-test/ThinClientGatewayTest.hpp
index 5d60765..9d1d486 100644
--- a/cppcache/integration-test/ThinClientGatewayTest.hpp
+++ b/cppcache/integration-test/ThinClientGatewayTest.hpp
@@ -34,7 +34,6 @@
using namespace apache::geode::client;
using namespace test;
-#include <geode/GeodeCppCache.hpp>
#include <string>
class MyListener : public CacheListener {
@@ -62,11 +61,9 @@ class MyListener : public CacheListener {
int getNumEvents() { return m_events; }
};
-typedef std::shared_ptr<MyListener> MyListenerPtr;
-
-void setCacheListener(const char* regName, TallyListenerPtr regListener) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
+void setCacheListener(const char* regName, std::shared_ptr<TallyListener> regListener) {
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheListener(regListener);
}
@@ -101,31 +98,30 @@ DUNIT_TASK_DEFINITION(SERVER2, StartServer2)
LOG("SERVER started");
}
END_TASK_DEFINITION
-
-MyListenerPtr reg1Listener1 = nullptr;
+std::shared_ptr<MyListener> reg1Listener1 = nullptr;
DUNIT_TASK_DEFINITION(SERVER2, SetupClient2)
{
// CacheHelper ch = getHelper();
reg1Listener1 = std::make_shared<MyListener>();
- RegionPtr regPtr = createPooledRegion("exampleRegion", false, locHostPort2,
+ auto regPtr = createPooledRegion("exampleRegion", false, locHostPort2,
"poolName", true, reg1Listener1);
- regPtr->registerAllKeys();
+ regPtr->registerAllKeys();
}
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(SERVER1, SetupClient)
{
initClientWithPool(true, "poolName", locHostPort1, nullptr);
- RegionPtr regPtr =
+ auto regPtr =
createRegionAndAttachPool("exampleRegion", true, nullptr);
- LOG(" region is created ");
- for (int i = 0; i < 100; i++) {
- LOG(" region is created put");
- regPtr->put(i, i);
- }
+ LOG(" region is created ");
+ for (int i = 0; i < 100; i++) {
+ LOG(" region is created put");
+ regPtr->put(i, i);
+ }
- dunit::sleep(10000);
+ dunit::sleep(10000);
}
END_TASK_DEFINITION
diff --git a/cppcache/integration-test/ThinClientHeapLRU.hpp b/cppcache/integration-test/ThinClientHeapLRU.hpp
index 2020cdc..be72e61 100644
--- a/cppcache/integration-test/ThinClientHeapLRU.hpp
+++ b/cppcache/integration-test/ThinClientHeapLRU.hpp
@@ -21,7 +21,6 @@
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include "BuiltinCacheableWrappers.hpp"
@@ -62,7 +61,7 @@ const bool NO_ACK = false;
void initThinClientWithClientTypeAsCLIENT(const bool isthinClient) {
if (cacheHelper == nullptr) {
- PropertiesPtr pp = Properties::create();
+ auto pp = Properties::create();
pp->insert("heap-lru-limit", 1);
pp->insert("heap-lru-delta", 10);
@@ -95,8 +94,8 @@ void createRegion(const char* name, bool ackMode, const char* endpoints,
LOG("createRegion() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr = getHelper()->createRegion(
- name, ackMode, true, nullptr, endpoints, clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
+ endpoints, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -108,7 +107,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -117,7 +116,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
void createOnekEntries() {
CacheableHelper::registerBuiltins();
- RegionPtr dataReg = getHelper()->getRegion(regionNames[0]);
+ auto dataReg = getHelper()->getRegion(regionNames[0]);
for (int i = 0; i < 2048; i++) {
CacheableWrapper* tmpkey =
CacheableWrapperFactory::createInstance(GeodeTypeIds::CacheableInt32);
@@ -136,7 +135,7 @@ void createOnekEntries() {
// delete tmpval;
}
dunit::sleep(10000);
- VectorOfRegionEntry me;
+ std::vector<std::shared_ptr<RegionEntry>> me;
dataReg->entries(me, false);
LOG("Verifying size outside loop");
char buf[1024];
diff --git a/cppcache/integration-test/ThinClientHelper.hpp b/cppcache/integration-test/ThinClientHelper.hpp
index 04be743..1f2f2a3 100644
--- a/cppcache/integration-test/ThinClientHelper.hpp
+++ b/cppcache/integration-test/ThinClientHelper.hpp
@@ -22,7 +22,6 @@
#include <chrono>
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include "testUtils.hpp"
@@ -49,12 +48,12 @@ using namespace unitTests;
CacheHelper* cacheHelper = nullptr;
void initGridClient(const bool isthinClient,
- const PropertiesPtr& configPtr = nullptr) {
+ const std::shared_ptr<Properties>& configPtr = nullptr) {
static bool s_isGridClient = true;
s_isGridClient = !s_isGridClient;
if (cacheHelper == nullptr) {
- PropertiesPtr config = configPtr;
+ auto config = configPtr;
if (config == nullptr) {
config = Properties::create();
}
@@ -65,7 +64,7 @@ void initGridClient(const bool isthinClient,
}
void initClient(const bool isthinClient,
- const PropertiesPtr& configPtr = nullptr) {
+ const std::shared_ptr<Properties>& configPtr = nullptr) {
if (cacheHelper == nullptr) {
cacheHelper = new CacheHelper(isthinClient, configPtr);
}
@@ -74,7 +73,7 @@ void initClient(const bool isthinClient,
void initClientWithPool(const bool isthinClient, const char* poolName,
const char* locators, const char* serverGroup,
- const PropertiesPtr& configPtr = nullptr,
+ const std::shared_ptr<Properties>& configPtr = nullptr,
int redundancy = 0, bool clientNotification = false,
int subscriptionAckInterval = -1, int connections = -1,
int loadConditioningInterval = -1,
@@ -89,9 +88,10 @@ void initClientWithPool(const bool isthinClient, const char* poolName,
}
/* For HA Clients */
-void initClient(int redundancyLevel, const PropertiesPtr& configPtr = nullptr) {
+void initClient(int redundancyLevel,
+ const std::shared_ptr<Properties>& configPtr = nullptr) {
if (cacheHelper == nullptr) {
- PropertiesPtr config = configPtr;
+ auto config = configPtr;
if (config == nullptr) {
config = Properties::create();
}
@@ -101,12 +101,12 @@ void initClient(int redundancyLevel, const PropertiesPtr& configPtr = nullptr) {
}
void initGridClient(int redundancyLevel,
- const PropertiesPtr& configPtr = nullptr) {
+ const std::shared_ptr<Properties>& configPtr = nullptr) {
static bool s_isGridClient = true;
s_isGridClient = !s_isGridClient;
if (cacheHelper == nullptr) {
- PropertiesPtr config = configPtr;
+ auto config = configPtr;
if (config == nullptr) {
config = Properties::create();
}
@@ -178,10 +178,10 @@ void _verifyEntry(const char* name, const char* key, const char* val,
LOG(buf);
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
if (noKey == false) { // need to find the key!
ASSERT(regPtr->containsKey(keyPtr), "Key not found in region.");
@@ -285,10 +285,10 @@ void _verifyIntEntry(const char* name, const char* key, const int val,
free(buf);
}
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
// if the region is no ack, then we may need to wait...
if (!isCreated) {
@@ -369,20 +369,20 @@ void _verifyIntEntry(const char* name, const char* key, const int val,
void createRegion(const char* name, bool ackMode,
bool clientNotificationEnabled = false,
- const CacheListenerPtr& listener = nullptr,
+ const std::shared_ptr<CacheListener>& listener = nullptr,
bool caching = true) {
LOG("createRegion() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
// ack, caching
- RegionPtr regPtr = getHelper()->createRegion(name, ackMode, caching, listener,
- clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, caching, listener,
+ clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
-RegionPtr createOverflowRegion(const char* name, bool ackMode, int lel = 0,
- bool clientNotificationEnabled = true,
- bool caching = true) {
+std::shared_ptr<Region> createOverflowRegion(
+ const char* name, bool ackMode, int lel = 0,
+ bool clientNotificationEnabled = true, bool caching = true) {
std::string bdb_dir = "BDB";
std::string bdb_dirEnv = "BDBEnv";
AttributesFactory af;
@@ -390,7 +390,7 @@ RegionPtr createOverflowRegion(const char* name, bool ackMode, int lel = 0,
af.setLruEntriesLimit(lel);
af.setDiskPolicy(DiskPolicyType::OVERFLOWS);
- PropertiesPtr sqLiteProps = Properties::create();
+ auto sqLiteProps = Properties::create();
sqLiteProps->insert("PageSize", "65536");
sqLiteProps->insert("MaxPageCount", "1073741823");
std::string sqlite_dir =
@@ -399,19 +399,18 @@ RegionPtr createOverflowRegion(const char* name, bool ackMode, int lel = 0,
sqLiteProps->insert("PersistenceDirectory", sqlite_dir.c_str());
af.setPersistenceManager("SqLiteImpl", "createSqLiteInstance", sqLiteProps);
- RegionAttributesPtr rattrsPtr = af.createRegionAttributes();
- CachePtr cache = getHelper()->cachePtr;
+ std::shared_ptr<RegionAttributes> rattrsPtr = af.createRegionAttributes();
+ auto cache = getHelper()->cachePtr;
CacheImpl* cacheImpl = CacheRegionHelper::getCacheImpl(cache.get());
- RegionPtr regionPtr;
+ std::shared_ptr<Region> regionPtr;
cacheImpl->createRegion(name, rattrsPtr, regionPtr);
return regionPtr;
}
-
-RegionPtr createPooledRegion(const char* name, bool ackMode,
- const char* locators, const char* poolname,
- bool clientNotificationEnabled = false,
- const CacheListenerPtr& listener = nullptr,
- bool caching = true) {
+std::shared_ptr<Region> createPooledRegion(
+ const char* name, bool ackMode, const char* locators, const char* poolname,
+ bool clientNotificationEnabled = false,
+ const std::shared_ptr<CacheListener>& listener = nullptr,
+ bool caching = true) {
LOG("createPooledRegion() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
@@ -421,7 +420,7 @@ RegionPtr createPooledRegion(const char* name, bool ackMode,
}
// ack, caching
- RegionPtr regPtr = getHelper()->createPooledRegion(
+ auto regPtr = getHelper()->createPooledRegion(
name, ackMode, locators, poolname, caching, clientNotificationEnabled,
std::chrono::seconds(0), std::chrono::seconds(0), std::chrono::seconds(0),
std::chrono::seconds(0), 0, listener);
@@ -430,59 +429,56 @@ RegionPtr createPooledRegion(const char* name, bool ackMode,
LOG("Region created.");
return regPtr;
}
-
-PoolPtr findPool(const char* poolName) {
- LOG("findPool() entered.");
- PoolPtr poolPtr = getHelper()->getCache()->getPoolManager().find(poolName);
- ASSERT(poolPtr != nullptr, "Failed to find pool.");
- return poolPtr;
-}
-PoolPtr createPool(const char* poolName, const char* locators,
- const char* serverGroup, int redundancy = 0,
- bool clientNotification = false,
- std::chrono::milliseconds subscriptionAckInterval =
- std::chrono::milliseconds::zero(),
- int connections = -1, int loadConditioningInterval = -1) {
- LOG("createPool() entered.");
-
- PoolPtr poolPtr = getHelper()->createPool(
- poolName, locators, serverGroup, redundancy, clientNotification,
- subscriptionAckInterval, connections, loadConditioningInterval);
- ASSERT(poolPtr != nullptr, "Failed to create pool.");
- LOG("Pool created.");
- return poolPtr;
-}
-
-PoolPtr createPoolAndDestroy(const char* poolName, const char* locators,
- const char* serverGroup, int redundancy = 0,
- bool clientNotification = false,
- std::chrono::milliseconds subscriptionAckInterval =
- std::chrono::milliseconds::zero(),
- int connections = -1) {
- LOG("createPoolAndDestroy() entered.");
-
- PoolPtr poolPtr = getHelper()->createPool(
- poolName, locators, serverGroup, redundancy, clientNotification,
- subscriptionAckInterval, connections);
- ASSERT(poolPtr != nullptr, "Failed to create pool.");
- poolPtr->destroy();
- LOG("Pool created and destroyed.");
- return poolPtr;
+ std::shared_ptr<Pool> findPool(const char* poolName) {
+ LOG("findPool() entered.");
+ auto poolPtr = getHelper()->getCache()->getPoolManager().find(poolName);
+ ASSERT(poolPtr != nullptr, "Failed to find pool.");
+ return poolPtr;
+ }
+ std::shared_ptr<Pool> createPool(
+ const char* poolName, const char* locators, const char* serverGroup,
+ int redundancy = 0, bool clientNotification = false,
+ std::chrono::milliseconds subscriptionAckInterval =
+ std::chrono::milliseconds::zero(),
+ int connections = -1, int loadConditioningInterval = -1) {
+ LOG("createPool() entered.");
+
+ auto poolPtr = getHelper()->createPool(
+ poolName, locators, serverGroup, redundancy, clientNotification,
+ subscriptionAckInterval, connections, loadConditioningInterval);
+ ASSERT(poolPtr != nullptr, "Failed to create pool.");
+ LOG("Pool created.");
+ return poolPtr;
+ }
+ std::shared_ptr<Pool> createPoolAndDestroy(
+ const char* poolName, const char* locators, const char* serverGroup,
+ int redundancy = 0, bool clientNotification = false,
+ std::chrono::milliseconds subscriptionAckInterval =
+ std::chrono::milliseconds::zero(),
+ int connections = -1) {
+ LOG("createPoolAndDestroy() entered.");
+
+ auto poolPtr = getHelper()->createPool(poolName, locators, serverGroup,
+ redundancy, clientNotification,
+ subscriptionAckInterval, connections);
+ ASSERT(poolPtr != nullptr, "Failed to create pool.");
+ poolPtr->destroy();
+ LOG("Pool created and destroyed.");
+ return poolPtr;
}
// this will create pool even endpoints and locatorhost has been not defined
-PoolPtr createPool2(const char* poolName, const char* locators,
+std::shared_ptr<Pool> createPool2(const char* poolName, const char* locators,
const char* serverGroup, const char* servers = nullptr,
int redundancy = 0, bool clientNotification = false) {
LOG("createPool2() entered.");
- PoolPtr poolPtr = getHelper()->createPool2(
+ auto poolPtr = getHelper()->createPool2(
poolName, locators, serverGroup, servers, redundancy, clientNotification);
ASSERT(poolPtr != nullptr, "Failed to create pool.");
LOG("Pool created.");
return poolPtr;
}
-
-RegionPtr createRegionAndAttachPool(
+std::shared_ptr<Region> createRegionAndAttachPool(
const char* name, bool ack, const char* poolName, bool caching = true,
const std::chrono::seconds& ettl = std::chrono::seconds::zero(),
const std::chrono::seconds& eit = std::chrono::seconds::zero(),
@@ -490,7 +486,7 @@ RegionPtr createRegionAndAttachPool(
const std::chrono::seconds& rit = std::chrono::seconds::zero(), int lel = 0,
ExpirationAction::Action action = ExpirationAction::DESTROY) {
LOG("createRegionAndAttachPool() entered.");
- RegionPtr regPtr = getHelper()->createRegionAndAttachPool(
+ auto regPtr = getHelper()->createRegionAndAttachPool(
name, ack, poolName, caching, ettl, eit, rttl, rit, lel, action);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
@@ -503,23 +499,23 @@ void createEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
- ASSERT(regPtr != nullptr, "Region not found.");
+ auto regPtr = getHelper()->getRegion(name);
+ ASSERT(regPtr != nullptr, "Region not found.");
- ASSERT(!regPtr->containsKey(keyPtr),
- "Key should not have been found in region.");
- ASSERT(!regPtr->containsValueForKey(keyPtr),
- "Value should not have been found in region.");
+ ASSERT(!regPtr->containsKey(keyPtr),
+ "Key should not have been found in region.");
+ ASSERT(!regPtr->containsValueForKey(keyPtr),
+ "Value should not have been found in region.");
- // regPtr->create( keyPtr, valPtr );
- regPtr->put(keyPtr, valPtr);
- LOG("Created entry.");
+ // regPtr->create( keyPtr, valPtr );
+ regPtr->put(keyPtr, valPtr);
+ LOG("Created entry.");
- verifyEntry(name, key, value);
- LOG("Entry created.");
+ verifyEntry(name, key, value);
+ LOG("Entry created.");
}
void updateEntry(const char* name, const char* key, const char* value,
@@ -529,15 +525,14 @@ void updateEntry(const char* name, const char* key, const char* value,
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
- ASSERT(regPtr != nullptr, "Region not found.");
+ auto regPtr = getHelper()->getRegion(name);
+ ASSERT(regPtr != nullptr, "Region not found.");
- if (checkKey) {
- ASSERT(regPtr->containsKey(keyPtr),
- "Key should have been found in region.");
+ if (checkKey) {
+ ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
}
if (checkVal) {
ASSERT(regPtr->containsValueForKey(keyPtr),
@@ -560,9 +555,9 @@ void doNetsearch(const char* name, const char* key, const char* value,
key, value, name);
fflush(stdout);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "netsearch region %s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -598,17 +593,17 @@ void createIntEntry(const char* name, const char* key, const int value,
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableInt32Ptr valPtr = CacheableInt32::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableInt32::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
- ASSERT(regPtr != nullptr, "Region not found.");
+ auto regPtr = getHelper()->getRegion(name);
+ ASSERT(regPtr != nullptr, "Region not found.");
- if (onlyCreate) {
- ASSERT(!regPtr->containsKey(keyPtr),
- "Key should not have been found in region.");
- ASSERT(!regPtr->containsValueForKey(keyPtr),
- "Value should not have been found in region.");
+ if (onlyCreate) {
+ ASSERT(!regPtr->containsKey(keyPtr),
+ "Key should not have been found in region.");
+ ASSERT(!regPtr->containsValueForKey(keyPtr),
+ "Value should not have been found in region.");
}
regPtr->put(keyPtr, valPtr);
@@ -623,9 +618,9 @@ void invalidateEntry(const char* name, const char* key) {
fprintf(stdout, "Invalidating entry -- key: %s in region %s\n", key, name);
fflush(stdout);
// Invalidate entry, verify entry is invalidated
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -644,9 +639,9 @@ void destroyEntry(const char* name, const char* key) {
fprintf(stdout, "Destroying entry -- key: %s in region %s\n", key, name);
fflush(stdout);
// Destroy entry, verify entry is destroyed
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -660,7 +655,7 @@ void destroyEntry(const char* name, const char* key) {
void destroyRegion(const char* name) {
LOG("destroyRegion() entered.");
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
regPtr->localDestroyRegion();
LOG("Region destroyed.");
}
@@ -670,46 +665,51 @@ class RegionOperations {
RegionOperations(const char* name)
: m_regionPtr(getHelper()->getRegion(name)) {}
- void putOp(int keys = 1, const SerializablePtr& aCallbackArgument = nullptr) {
+ void putOp(int keys = 1, const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) {
char keybuf[100];
char valbuf[100];
for (int i = 1; i <= keys; i++) {
sprintf(keybuf, "key%d", i);
sprintf(valbuf, "value%d", i);
- CacheableStringPtr valPtr = CacheableString::create(valbuf);
+ auto valPtr = CacheableString::create(valbuf);
m_regionPtr->put(keybuf, valPtr, aCallbackArgument);
}
}
- void invalidateOp(int keys = 1,
- const SerializablePtr& aCallbackArgument = nullptr) {
+ void invalidateOp(
+ int keys = 1,
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) {
char keybuf[100];
char valbuf[100];
for (int i = 1; i <= keys; i++) {
sprintf(keybuf, "key%d", i);
- CacheableStringPtr valPtr = CacheableString::create(valbuf);
+ auto valPtr = CacheableString::create(valbuf);
m_regionPtr->localInvalidate(keybuf, aCallbackArgument);
}
}
- void destroyOp(int keys = 1, const SerializablePtr& aCallbackArgument = nullptr) {
+ void destroyOp(
+ int keys = 1,
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) {
char keybuf[100];
char valbuf[100];
for (int i = 1; i <= keys; i++) {
sprintf(keybuf, "key%d", i);
- CacheableStringPtr valPtr = CacheableString::create(valbuf);
+ auto valPtr = CacheableString::create(valbuf);
m_regionPtr->destroy(keybuf, aCallbackArgument);
}
}
- void removeOp(int keys = 1, const SerializablePtr& aCallbackArgument = nullptr) {
+ void removeOp(
+ int keys = 1,
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) {
char keybuf[100];
char valbuf[100];
for (int i = 1; i <= keys; i++) {
sprintf(keybuf, "key%d", i);
sprintf(valbuf, "value%d", i);
- CacheableStringPtr valPtr = CacheableString::create(valbuf);
+ auto valPtr = CacheableString::create(valbuf);
m_regionPtr->remove(keybuf, valPtr, aCallbackArgument);
}
}
- RegionPtr m_regionPtr;
+ std::shared_ptr<Region> m_regionPtr;
};
#endif // GEODE_INTEGRATION_TEST_THINCLIENTHELPER_H_
diff --git a/cppcache/integration-test/ThinClientInterest1.hpp b/cppcache/integration-test/ThinClientInterest1.hpp
index 8cf0b6b..c1fd4d5 100644
--- a/cppcache/integration-test/ThinClientInterest1.hpp
+++ b/cppcache/integration-test/ThinClientInterest1.hpp
@@ -54,9 +54,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, populateServer)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
for (int i = 0; i < 5; i++) {
- CacheableKeyPtr keyPtr = CacheableKey::create(keys[i]);
+ auto keyPtr = CacheableKey::create(keys[i]);
regPtr->create(keyPtr, vals[i]);
}
SLEEP(200);
@@ -68,7 +68,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, setupClient2_Pool_Locator)
initClient(true);
createPooledRegion(regionNames[0], false /*ack mode*/, locatorsG,
"__TEST_POOL1__", true /*client notification*/);
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
regPtr->registerAllKeys(false, true);
SLEEP(200);
}
@@ -76,9 +76,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, verify)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
for (int i = 0; i < 5; i++) {
- CacheableKeyPtr keyPtr1 = CacheableKey::create(keys[i]);
+ auto keyPtr1 = CacheableKey::create(keys[i]);
char buf[1024];
sprintf(buf, "key[%s] should have been found", keys[i]);
ASSERT(regPtr->containsKey(keyPtr1), buf);
diff --git a/cppcache/integration-test/ThinClientInterest2.hpp b/cppcache/integration-test/ThinClientInterest2.hpp
index 92ef6ab..caacbdd 100644
--- a/cppcache/integration-test/ThinClientInterest2.hpp
+++ b/cppcache/integration-test/ThinClientInterest2.hpp
@@ -49,15 +49,15 @@ DUNIT_TASK_DEFINITION(CLIENT2, setupClient2_Pool_Locator)
initClient(true);
createPooledRegion(regionNames[0], false /*ack mode*/, locatorsG,
"__TEST_POOL1__", true /*client notification*/);
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
}
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, populateServer)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
for (int i = 0; i < 5; i++) {
- CacheableKeyPtr keyPtr = CacheableKey::create(keys[i]);
+ auto keyPtr = CacheableKey::create(keys[i]);
regPtr->create(keyPtr, vals[i]);
}
}
@@ -65,13 +65,13 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, verify)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
for (int i = 0; i < 5; i++) {
- CacheableKeyPtr keyPtr1 = CacheableKey::create(keys[i]);
+ auto keyPtr1 = CacheableKey::create(keys[i]);
char buf[1024];
sprintf(buf, "key[%s] should not have been found", keys[i]);
ASSERT(!regPtr->containsKey(keyPtr1), buf);
- CacheablePtr checkPtr = regPtr->get(keyPtr1);
+ auto checkPtr = regPtr->get(keyPtr1);
verifyEntry(regionNames[0], keys[i], vals[i]);
}
}
diff --git a/cppcache/integration-test/ThinClientInterest3.hpp b/cppcache/integration-test/ThinClientInterest3.hpp
index 3eb0c0f..132113a 100644
--- a/cppcache/integration-test/ThinClientInterest3.hpp
+++ b/cppcache/integration-test/ThinClientInterest3.hpp
@@ -38,22 +38,24 @@ static bool isLocator = false;
const char *locatorsG =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, 1);
#include "LocatorHelper.hpp"
-TallyListenerPtr reg1Listener1;
-TallyWriterPtr reg1Writer1;
+std::shared_ptr<TallyListener> reg1Listener1;
+std::shared_ptr<TallyWriter> reg1Writer1;
int numCreates = 0;
int numUpdates = 0;
int numInvalidates = 0;
int numDestroys = 0;
-void setCacheListener(const char *regName, TallyListenerPtr regListener) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
+void setCacheListener(const char *regName,
+ std::shared_ptr<TallyListener> regListener) {
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheListener(regListener);
}
-void setCacheWriter(const char *regName, TallyWriterPtr regWriter) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
+void setCacheWriter(const char *regName,
+ std::shared_ptr<TallyWriter> regWriter) {
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheWriter(regWriter);
}
@@ -105,10 +107,10 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, testCreatesAndUpdates)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
- CacheableKeyPtr keyPtr1 = CacheableKey::create(keys[1]);
- CacheableKeyPtr keyPtr2 = CacheableKey::create(keys[2]);
- VectorOfCacheableKey keys;
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+ auto keyPtr1 = CacheableKey::create(keys[1]);
+ auto keyPtr2 = CacheableKey::create(keys[2]);
+ std::vector<std::shared_ptr<CacheableKey>> keys;
keys.push_back(keyPtr1);
keys.push_back(keyPtr2);
regPtr->registerKeys(keys);
@@ -145,9 +147,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, testInvalidateAndDestroy)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
- CacheableKeyPtr keyPtr1 = CacheableKey::create(keys[1]);
- CacheableKeyPtr keyPtr2 = CacheableKey::create(keys[2]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+ auto keyPtr1 = CacheableKey::create(keys[1]);
+ auto keyPtr2 = CacheableKey::create(keys[2]);
regPtr->invalidate(keyPtr1);
numInvalidates++;
validateEventCount(__LINE__);
diff --git a/cppcache/integration-test/ThinClientInterest3Cacheless.hpp b/cppcache/integration-test/ThinClientInterest3Cacheless.hpp
index 3943e3a..6bc8882 100644
--- a/cppcache/integration-test/ThinClientInterest3Cacheless.hpp
+++ b/cppcache/integration-test/ThinClientInterest3Cacheless.hpp
@@ -38,22 +38,24 @@ static bool isLocator = false;
const char *locatorsG =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, 1);
#include "LocatorHelper.hpp"
-TallyListenerPtr reg1Listener1;
-TallyWriterPtr reg1Writer1;
+std::shared_ptr<TallyListener> reg1Listener1;
+std::shared_ptr<TallyWriter> reg1Writer1;
int numCreates = 0;
int numUpdates = 0;
int numInvalidates = 0;
int numDestroys = 0;
-void setCacheListener(const char *regName, TallyListenerPtr regListener) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
+void setCacheListener(const char *regName,
+ std::shared_ptr<TallyListener> regListener) {
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheListener(regListener);
}
-void setCacheWriter(const char *regName, TallyWriterPtr regWriter) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
+void setCacheWriter(const char *regName,
+ std::shared_ptr<TallyWriter> regWriter) {
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheWriter(regWriter);
}
@@ -106,10 +108,10 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, testCreatesAndUpdates)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
- CacheableKeyPtr keyPtr1 = CacheableKey::create(keys[1]);
- CacheableKeyPtr keyPtr2 = CacheableKey::create(keys[2]);
- VectorOfCacheableKey keys;
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+ auto keyPtr1 = CacheableKey::create(keys[1]);
+ auto keyPtr2 = CacheableKey::create(keys[2]);
+ std::vector<std::shared_ptr<CacheableKey>> keys;
keys.push_back(keyPtr1);
keys.push_back(keyPtr2);
regPtr->registerKeys(keys);
diff --git a/cppcache/integration-test/ThinClientInterestList.hpp b/cppcache/integration-test/ThinClientInterestList.hpp
index 77aed90..357d4b5 100644
--- a/cppcache/integration-test/ThinClientInterestList.hpp
+++ b/cppcache/integration-test/ThinClientInterestList.hpp
@@ -20,7 +20,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <string>
@@ -84,10 +83,10 @@ void _verifyEntry(const char* name, const char* key, const char* val,
}
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
// if the region is no ack, then we may need to wait...
if (!isCreated) {
@@ -202,7 +201,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locatorsG,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locatorsG, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -215,13 +214,13 @@ void createEntry(const char* name, const char* key,
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
if (value == nullptr) {
value = "";
}
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -243,10 +242,10 @@ void updateEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -268,9 +267,9 @@ void doNetsearch(const char* name, const char* key, const char* value) {
key, value, name);
fflush(stdout);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "netsearch region %s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -331,13 +330,13 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
{
createEntry(regionNames[0], keys[0], vals[0]);
createEntry(regionNames[1], keys[2], vals[2]);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
- CacheableKeyPtr keyPtr1 = CacheableKey::create(keys[1]);
- CacheableKeyPtr keyPtr3 = CacheableKey::create(keys[3]);
+ auto keyPtr1 = CacheableKey::create(keys[1]);
+ auto keyPtr3 = CacheableKey::create(keys[3]);
- VectorOfCacheableKey keys0, keys1;
+ std::vector<std::shared_ptr<CacheableKey>> keys0, keys1;
keys0.push_back(keyPtr1);
keys1.push_back(keyPtr3);
regPtr0->registerKeys(keys0);
@@ -356,9 +355,9 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepFour)
doNetsearch(regionNames[1], keys[2], vals[2]);
createEntry(regionNames[0], keys[1], vals[1]);
createEntry(regionNames[1], keys[3], vals[3]);
- CacheableKeyPtr keyPtr0 = CacheableKey::create(keys[0]);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- VectorOfCacheableKey keys0;
+ auto keyPtr0 = CacheableKey::create(keys[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ std::vector<std::shared_ptr<CacheableKey>> keys0;
keys0.push_back(keyPtr0);
regPtr0->registerKeys(keys0);
LOG("StepFour complete.");
@@ -374,9 +373,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFive)
updateEntry(regionNames[0], keys[0], nvals[0]);
updateEntry(regionNames[1], keys[2], nvals[2]);
- CacheableKeyPtr keyPtr3 = CacheableKey::create(keys[3]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
- VectorOfCacheableKey keys1;
+ auto keyPtr3 = CacheableKey::create(keys[3]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
+ std::vector<std::shared_ptr<CacheableKey>> keys1;
keys1.push_back(keyPtr3);
regPtr1->unregisterKeys(keys1);
LOG("StepFive complete.");
@@ -387,10 +386,10 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepSix)
// verifyCreated( regionNames[0], keys[0]);
verifyEntry(regionNames[0], keys[0], nvals[0]);
verifyEntry(regionNames[1], keys[2], vals[2]);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
- CacheableKeyPtr keyPtr1 = CacheableKey::create(keys[1]);
- CacheableKeyPtr keyPtr3 = CacheableKey::create(keys[3]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto keyPtr1 = CacheableKey::create(keys[1]);
+ auto keyPtr3 = CacheableKey::create(keys[3]);
regPtr0->destroy(keyPtr1);
regPtr1->destroy(keyPtr3);
LOG("StepSix complete.");
diff --git a/cppcache/integration-test/ThinClientInterestList2.hpp b/cppcache/integration-test/ThinClientInterestList2.hpp
index a84a9ee..687401d 100644
--- a/cppcache/integration-test/ThinClientInterestList2.hpp
+++ b/cppcache/integration-test/ThinClientInterestList2.hpp
@@ -20,7 +20,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <string>
@@ -84,10 +83,10 @@ void _verifyEntry(const char* name, const char* key, const char* val,
}
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
// if the region is no ack, then we may need to wait...
if (!isCreated) {
@@ -202,7 +201,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locatorsG, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -215,13 +214,13 @@ void createEntry(const char* name, const char* key,
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
if (value == nullptr) {
value = "";
}
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -243,10 +242,10 @@ void updateEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -268,9 +267,9 @@ void doNetsearch(const char* name, const char* key, const char* value) {
key, value, name);
fflush(stdout);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "netsearch region %s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -332,8 +331,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateClient1Entries)
createEntry(regionNames[0], keys[0], vals[0]);
createEntry(regionNames[1], keys[2], vals[2]);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
regPtr0->registerAllKeys();
regPtr1->registerAllKeys();
@@ -348,7 +347,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, CreateClient2Entries)
doNetsearch(regionNames[1], keys[2], vals[2]);
createEntry(regionNames[0], keys[1], vals[1]);
createEntry(regionNames[1], keys[3], vals[3]);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
regPtr0->registerAllKeys();
LOG("CreateClient2Entries complete.");
}
@@ -363,7 +362,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, UpdateClient1Entries)
updateEntry(regionNames[0], keys[0], nvals[0]);
updateEntry(regionNames[1], keys[2], nvals[2]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
regPtr1->unregisterAllKeys();
LOG("UpdateClient1Entries complete.");
}
@@ -373,10 +372,10 @@ DUNIT_TASK_DEFINITION(CLIENT2, VerifyAndDestroyClient2Entries)
// verifyCreated( regionNames[0], keys[0]);
verifyEntry(regionNames[0], keys[0], nvals[0]);
verifyEntry(regionNames[1], keys[2], vals[2]);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
- CacheableKeyPtr keyPtr1 = CacheableKey::create(keys[1]);
- CacheableKeyPtr keyPtr3 = CacheableKey::create(keys[3]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto keyPtr1 = CacheableKey::create(keys[1]);
+ auto keyPtr3 = CacheableKey::create(keys[3]);
regPtr0->destroy(keyPtr1);
regPtr1->destroy(keyPtr3);
LOG("VerifyAndDestroyClient2Entries complete.");
diff --git a/cppcache/integration-test/ThinClientListenerInit.hpp b/cppcache/integration-test/ThinClientListenerInit.hpp
index 8082ab9..99f63b8 100644
--- a/cppcache/integration-test/ThinClientListenerInit.hpp
+++ b/cppcache/integration-test/ThinClientListenerInit.hpp
@@ -39,9 +39,9 @@ static int numberOfLocators = 1;
const char* locatorsG =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, numberOfLocators);
const char* poolName = "__TESTPOOL1_";
-TallyListenerPtr reg1Listener1, reg1Listener2;
-TallyWriterPtr reg1Writer1, reg1Writer2;
-TallyLoaderPtr reg1Loader1, reg1Loader2;
+std::shared_ptr<TallyListener> reg1Listener1, reg1Listener2;
+std::shared_ptr<TallyWriter> reg1Writer1, reg1Writer2;
+std::shared_ptr<TallyLoader> reg1Loader1, reg1Loader2;
int numCreates = 0;
int numUpdates = 0;
int numLoads = 0;
@@ -54,14 +54,16 @@ class ThinClientTallyLoader : public TallyLoader {
virtual ~ThinClientTallyLoader() {}
- CacheablePtr load(const RegionPtr& rp, const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument) {
+ std::shared_ptr<Cacheable> load(
+ const std::shared_ptr<Region>& rp,
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
int32_t loadValue = std::dynamic_pointer_cast<CacheableInt32>(
TallyLoader::load(rp, key, aCallbackArgument))
->value();
char lstrvalue[32];
sprintf(lstrvalue, "%i", loadValue);
- CacheableStringPtr lreturnValue = CacheableString::create(lstrvalue);
+ auto lreturnValue = CacheableString::create(lstrvalue);
if (key != nullptr && (nullptr != rp->getAttributes()->getEndpoints() ||
rp->getAttributes()->getPoolName() != nullptr)) {
LOGDEBUG("Putting the value (%s) for local region clients only ",
@@ -72,21 +74,24 @@ class ThinClientTallyLoader : public TallyLoader {
}
};
-void setCacheListener(const char* regName, TallyListenerPtr regListener) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
+void setCacheListener(const char* regName,
+ std::shared_ptr<TallyListener> regListener) {
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheListener(regListener);
}
-void setCacheLoader(const char* regName, TallyLoaderPtr regLoader) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
+void setCacheLoader(const char* regName,
+ std::shared_ptr<TallyLoader> regLoader) {
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheLoader(regLoader);
}
-void setCacheWriter(const char* regName, TallyWriterPtr regWriter) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
+void setCacheWriter(const char* regName,
+ std::shared_ptr<TallyWriter> regWriter) {
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheWriter(regWriter);
}
@@ -134,9 +139,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, testLoaderAndWriter)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
- CacheableKeyPtr keyPtr = CacheableKey::create(keys[0]);
- VectorOfCacheableKey keys;
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+ auto keyPtr = CacheableKey::create(keys[0]);
+ std::vector<std::shared_ptr<CacheableKey>> keys;
keys.push_back(keyPtr);
regPtr->registerKeys(keys);
@@ -148,8 +153,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, testLoaderAndWriter)
// now having all the Callbacks set, lets call the loader and writer
ASSERT(regPtr->get(keyPtr) != nullptr, "Expected non null value");
- RegionEntryPtr regEntryPtr = regPtr->getEntry(keyPtr);
- CacheablePtr valuePtr = regEntryPtr->getValue();
+ auto regEntryPtr = regPtr->getEntry(keyPtr);
+ auto valuePtr = regEntryPtr->getValue();
int val = atoi(valuePtr->toString()->asChar());
LOGFINE("val for keyPtr is %d", val);
ASSERT(val == 0, "Expected value CacheLoad value should be 0");
@@ -162,10 +167,10 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, testCreatesAndUpdates)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
- CacheableKeyPtr keyPtr1 = CacheableKey::create(keys[1]);
- CacheableKeyPtr keyPtr2 = CacheableKey::create(keys[2]);
- VectorOfCacheableKey keys;
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+ auto keyPtr1 = CacheableKey::create(keys[1]);
+ auto keyPtr2 = CacheableKey::create(keys[2]);
+ std::vector<std::shared_ptr<CacheableKey>> keys;
keys.push_back(keyPtr1);
keys.push_back(keyPtr2);
regPtr->registerKeys(keys);
@@ -212,17 +217,17 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, testDestroy)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
- CacheableKeyPtr keyPtr1 = CacheableKey::create(keys[1]);
- CacheableKeyPtr keyPtr2 = CacheableKey::create(keys[2]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+ auto keyPtr1 = CacheableKey::create(keys[1]);
+ auto keyPtr2 = CacheableKey::create(keys[2]);
regPtr->localInvalidate(keyPtr1);
// Verify no listener activity after the invalidate
validateEventCount(__LINE__);
// Verify after update listener activity after a get on an invalidated value
regPtr->get(keyPtr1);
- RegionEntryPtr regEntryPtr = regPtr->getEntry(keyPtr1);
- CacheablePtr valuePtr = regEntryPtr->getValue();
+ auto regEntryPtr = regPtr->getEntry(keyPtr1);
+ auto valuePtr = regEntryPtr->getValue();
int val = atoi(valuePtr->toString()->asChar());
LOGFINE("val for keyPtr1 is %d", val);
ASSERT(val == 0, "Expected value CacheLoad value should be 0");
@@ -231,8 +236,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, testDestroy)
regPtr->destroy(keyPtr2);
regPtr->get(keyPtr2);
- RegionEntryPtr regEntryPtr1 = regPtr->getEntry(keyPtr2);
- CacheablePtr valuePtr1 = regEntryPtr1->getValue();
+ auto regEntryPtr1 = regPtr->getEntry(keyPtr2);
+ auto valuePtr1 = regEntryPtr1->getValue();
int val1 = atoi(valuePtr1->toString()->asChar());
LOGFINE("val1 for keyPtr2 is %d", val1);
ASSERT(val1 == 1, "Expected value CacheLoad value should be 1");
diff --git a/cppcache/integration-test/ThinClientListenerWriter.hpp b/cppcache/integration-test/ThinClientListenerWriter.hpp
index ce6ec8b..f5d9d28 100644
--- a/cppcache/integration-test/ThinClientListenerWriter.hpp
+++ b/cppcache/integration-test/ThinClientListenerWriter.hpp
@@ -31,7 +31,6 @@
#define CLIENT3 s2p2
class SimpleCacheListener;
-typedef std::shared_ptr<SimpleCacheListener> SimpleCacheListenerPtr;
// The SimpleCacheListener class.
class SimpleCacheListener : public CacheListener {
@@ -47,7 +46,7 @@ class SimpleCacheListener : public CacheListener {
virtual void afterDestroy(const EntryEvent& event);
virtual void afterRegionInvalidate(const RegionEvent& event);
virtual void afterRegionDestroy(const RegionEvent& event);
- virtual void close(const RegionPtr& region);
+ virtual void close(const std::shared_ptr<Region>& region);
virtual void afterRegionClear(const RegionEvent& event);
SimpleCacheListener() : CacheListener(), m_creates(0), m_clears(0) {
@@ -93,7 +92,7 @@ void SimpleCacheListener::afterRegionDestroy(const RegionEvent& event) {
event.getRegion()->getName());
}
-void SimpleCacheListener::close(const RegionPtr& region) {
+void SimpleCacheListener::close(const std::shared_ptr<Region>& region) {
LOGINFO("SimpleCacheListener: Got an close event for %s region .",
region.get()->getName());
}
@@ -118,26 +117,24 @@ static bool isLocator = false;
static int numberOfLocators = 0;
const char* locatorsG =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, numberOfLocators);
-const char* poolName = "__TESTPOOL1_";
-TallyListenerPtr regListener;
-SimpleCacheListenerPtr parentRegCacheListener;
-SimpleCacheListenerPtr subRegCacheListener;
-
-SimpleCacheListenerPtr distRegCacheListener;
-TallyWriterPtr regWriter;
+const char* poolName = "__TESTPOOL1_"; std::shared_ptr<TallyListener> regListener; std::shared_ptr<SimpleCacheListener> parentRegCacheListener; std::shared_ptr<SimpleCacheListener> subRegCacheListener;
+std::shared_ptr<SimpleCacheListener> distRegCacheListener;
+std::shared_ptr<TallyWriter> regWriter;
#include "LocatorHelper.hpp"
const char* myRegNames[] = {"DistRegionAck", "DistRegionNoAck", "ExampleRegion",
"SubRegion1", "SubRegion2"};
-void setCacheListener(const char* regName, TallyListenerPtr regListener) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
+void setCacheListener(const char* regName,
+ std::shared_ptr<TallyListener> regListener) {
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheListener(regListener);
}
-void setCacheWriter(const char* regName, TallyWriterPtr regWriter) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
+void setCacheWriter(const char* regName,
+ std::shared_ptr<TallyWriter> regWriter) {
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheWriter(regWriter);
}
@@ -208,22 +205,20 @@ DUNIT_TASK_DEFINITION(CLIENT1, SetupClient1withCachingEnabled_Pooled_Locator)
true);
// create subregion
- RegionPtr exmpRegptr = getHelper()->getRegion(myRegNames[2]);
- RegionAttributesPtr lattribPtr = exmpRegptr->getAttributes();
- RegionPtr subregPtr1 =
- exmpRegptr->createSubregion(myRegNames[3], lattribPtr);
- RegionPtr subregPtr2 =
- exmpRegptr->createSubregion(myRegNames[4], lattribPtr);
-
- LOGINFO(
- " CLIENT1 SetupClient1withCachingEnabled_Pooled_Locator subRegions "
- "created successfully");
+ auto exmpRegptr = getHelper()->getRegion(myRegNames[2]);
+ auto lattribPtr = exmpRegptr->getAttributes();
+ auto subregPtr1 = exmpRegptr->createSubregion(myRegNames[3], lattribPtr);
+ auto subregPtr2 = exmpRegptr->createSubregion(myRegNames[4], lattribPtr);
+
+ LOGINFO(
+ " CLIENT1 SetupClient1withCachingEnabled_Pooled_Locator subRegions "
+ "created successfully");
}
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, Register2WithTrue)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
regPtr0->registerAllKeys();
}
END_TASK_DEFINITION
@@ -231,30 +226,30 @@ END_TASK_DEFINITION
// RegisterKeys
DUNIT_TASK_DEFINITION(CLIENT2, RegisterKeys)
{
- RegionPtr regPtr0 = getHelper()->getRegion(myRegNames[0]);
+ auto regPtr0 = getHelper()->getRegion(myRegNames[0]);
- RegionPtr exmpRegPtr = getHelper()->getRegion(myRegNames[2]);
- RegionPtr subregPtr0 = exmpRegPtr->getSubregion(myRegNames[3]);
- RegionPtr subregPtr1 = exmpRegPtr->getSubregion(myRegNames[4]);
+ auto exmpRegPtr = getHelper()->getRegion(myRegNames[2]);
+ auto subregPtr0 = exmpRegPtr->getSubregion(myRegNames[3]);
+ auto subregPtr1 = exmpRegPtr->getSubregion(myRegNames[4]);
- // 1. registerAllKeys on parent and both subregions
- regPtr0->registerAllKeys();
- exmpRegPtr->registerAllKeys();
- subregPtr0->registerAllKeys();
- subregPtr1->registerAllKeys();
+ // 1. registerAllKeys on parent and both subregions
+ regPtr0->registerAllKeys();
+ exmpRegPtr->registerAllKeys();
+ subregPtr0->registerAllKeys();
+ subregPtr1->registerAllKeys();
}
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, Register2WithFalse)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
regPtr0->registerAllKeys(false, false, false);
}
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT3, Register3WithFalse)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
regPtr0->registerAllKeys(false, false, false);
}
END_TASK_DEFINITION
@@ -269,7 +264,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, SetupClient2_Pooled_Locator)
regListener, false);
regWriter = std::make_shared<TallyWriter>();
setCacheWriter(regionNames[0], regWriter);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
// regPtr0->registerAllKeys();
}
END_TASK_DEFINITION
@@ -294,26 +289,23 @@ DUNIT_TASK_DEFINITION(CLIENT2, SetupClient2withCachingEnabled_Pooled_Locator)
setCacheWriter(myRegNames[2], regWriter);
// create subregion
- RegionPtr exmpRegptr = getHelper()->getRegion(myRegNames[2]);
- RegionAttributesPtr lattribPtr = exmpRegptr->getAttributes();
- RegionPtr subregPtr1 =
- exmpRegptr->createSubregion(myRegNames[3], lattribPtr);
- RegionPtr subregPtr2 =
- exmpRegptr->createSubregion(myRegNames[4], lattribPtr);
-
- LOGINFO(
- "CLIENT2 SetupClient2withCachingEnabled_Pooled_Locator:: subRegions "
- "created successfully");
-
- // Attach Listener to subRegion
- // Attache Listener
-
- AttributesMutatorPtr subregAttrMutatorPtr =
- subregPtr1->getAttributesMutator();
- subRegCacheListener = std::make_shared<SimpleCacheListener>();
- subregAttrMutatorPtr->setCacheListener(subRegCacheListener);
-
- LOG("StepTwo_Pool complete.");
+ auto exmpRegptr = getHelper()->getRegion(myRegNames[2]);
+ auto lattribPtr = exmpRegptr->getAttributes();
+ auto subregPtr1 = exmpRegptr->createSubregion(myRegNames[3], lattribPtr);
+ auto subregPtr2 = exmpRegptr->createSubregion(myRegNames[4], lattribPtr);
+
+ LOGINFO(
+ "CLIENT2 SetupClient2withCachingEnabled_Pooled_Locator:: subRegions "
+ "created successfully");
+
+ // Attach Listener to subRegion
+ // Attache Listener
+
+ auto subregAttrMutatorPtr = subregPtr1->getAttributesMutator();
+ subRegCacheListener = std::make_shared<SimpleCacheListener>();
+ subregAttrMutatorPtr->setCacheListener(subRegCacheListener);
+
+ LOG("StepTwo_Pool complete.");
}
END_TASK_DEFINITION
@@ -368,54 +360,54 @@ DUNIT_TASK_DEFINITION(CLIENT1, doEventOperations)
{
LOG("do entry operation from client 1");
- RegionPtr regPtr0 = getHelper()->getRegion(myRegNames[0]);
- RegionPtr exmpRegPtr = getHelper()->getRegion(myRegNames[2]);
-
- RegionPtr subregPtr1 = exmpRegPtr->getSubregion(myRegNames[3]);
- RegionPtr subregPtr2 = exmpRegPtr->getSubregion(myRegNames[4]);
-
- for (int index = 0; index < 5; index++) {
- char key[100] = {0};
- char value[100] = {0};
- ACE_OS::sprintf(key, "Key-%d", index);
- ACE_OS::sprintf(value, "Value-%d", index);
- CacheableKeyPtr keyptr = CacheableKey::create(key);
- CacheablePtr valuePtr = CacheableString::create(value);
- regPtr0->put(keyptr, valuePtr);
- exmpRegPtr->put(keyptr, valuePtr);
- subregPtr1->put(keyptr, valuePtr);
- subregPtr2->put(keyptr, valuePtr);
- }
-
- LOGINFO(
- "CLIENT-1 localCaching Enabled After Put ....ExampleRegion.size() = %d",
- exmpRegPtr->size());
- ASSERT(exmpRegPtr->size() == 5,
- "Total number of entries in the region should be 5");
- // SLEEP( 1000 ); // let the events reach at other end.
-
- LOGINFO(
- "CLIENT-1 localCaching Enabled After Put ....DistRegionAck.size() = %d",
- regPtr0->size());
-
- // TEST COVERAGE FOR cacheListener.afterRegionClear() API
- exmpRegPtr->clear();
- LOGINFO("CLIENT-1 AFTER Clear() call ....reg.size() = %d",
- exmpRegPtr->size());
- ASSERT(exmpRegPtr->size() == 0,
- "Total number of entries in the region should be 0");
-
- LOGINFO("CLIENT-1 AFTER Clear() call ....SubRegion-1.size() = %d",
- subregPtr1->size());
- ASSERT(subregPtr1->size() == 5,
- "Total number of entries in the region should be 0");
-
- LOGINFO("CLIENT-1 AFTER Clear() call ....SubRegion-2.size() = %d",
- subregPtr2->size());
- ASSERT(subregPtr2->size() == 5,
- "Total number of entries in the region should be 0");
-
- SLEEP(1000);
+ auto regPtr0 = getHelper()->getRegion(myRegNames[0]);
+ auto exmpRegPtr = getHelper()->getRegion(myRegNames[2]);
+
+ auto subregPtr1 = exmpRegPtr->getSubregion(myRegNames[3]);
+ auto subregPtr2 = exmpRegPtr->getSubregion(myRegNames[4]);
+
+ for (int index = 0; index < 5; index++) {
+ char key[100] = {0};
+ char value[100] = {0};
+ ACE_OS::sprintf(key, "Key-%d", index);
+ ACE_OS::sprintf(value, "Value-%d", index);
+ auto keyptr = CacheableKey::create(key);
+ auto valuePtr = CacheableString::create(value);
+ regPtr0->put(keyptr, valuePtr);
+ exmpRegPtr->put(keyptr, valuePtr);
+ subregPtr1->put(keyptr, valuePtr);
+ subregPtr2->put(keyptr, valuePtr);
+ }
+
+ LOGINFO(
+ "CLIENT-1 localCaching Enabled After Put ....ExampleRegion.size() = %d",
+ exmpRegPtr->size());
+ ASSERT(exmpRegPtr->size() == 5,
+ "Total number of entries in the region should be 5");
+ // SLEEP( 1000 ); // let the events reach at other end.
+
+ LOGINFO(
+ "CLIENT-1 localCaching Enabled After Put ....DistRegionAck.size() = %d",
+ regPtr0->size());
+
+ // TEST COVERAGE FOR cacheListener.afterRegionClear() API
+ exmpRegPtr->clear();
+ LOGINFO("CLIENT-1 AFTER Clear() call ....reg.size() = %d",
+ exmpRegPtr->size());
+ ASSERT(exmpRegPtr->size() == 0,
+ "Total number of entries in the region should be 0");
+
+ LOGINFO("CLIENT-1 AFTER Clear() call ....SubRegion-1.size() = %d",
+ subregPtr1->size());
+ ASSERT(subregPtr1->size() == 5,
+ "Total number of entries in the region should be 0");
+
+ LOGINFO("CLIENT-1 AFTER Clear() call ....SubRegion-2.size() = %d",
+ subregPtr2->size());
+ ASSERT(subregPtr2->size() == 5,
+ "Total number of entries in the region should be 0");
+
+ SLEEP(1000);
}
END_TASK_DEFINITION
@@ -441,35 +433,35 @@ DUNIT_TASK_DEFINITION(CLIENT2, validateListenerWriterEventsWithNBSTrue)
ASSERT(parentRegCacheListener->getClears() == 1,
"region.clear() should be called once");
- RegionPtr exmpRegPtr = getHelper()->getRegion(myRegNames[2]);
+ auto exmpRegPtr = getHelper()->getRegion(myRegNames[2]);
// LOGINFO(" Total Entries in ExampleRegion = %d ", exmpRegPtr->size());
- ASSERT(exmpRegPtr->size() == 0,
- "Client-2 ExampleRegion.clear() should have called and so "
- "Exampleregion size is expected to 0 ");
-
- // Verify entries in Sub-Region.
- RegionPtr subregPtr1 = exmpRegPtr->getSubregion(myRegNames[3]);
- RegionPtr subregPtr2 = exmpRegPtr->getSubregion(myRegNames[4]);
-
- // LOGINFO(" Total Entries in SubRegion-1 = %d ", subregPtr1->size());
- // LOGINFO(" Total Entries in SubRegion-2 = %d ", subregPtr2->size());
- ASSERT(subRegCacheListener->getCreates() == 5,
- "should be 5 creates for SubRegion-1 ");
- ASSERT(subRegCacheListener->getClears() == 0,
- "should be 0 clears for SubRegion-1 ");
- ASSERT(subregPtr1->size() == 5,
- "Client-2 SubRegion-1 should contains 5 entries ");
- ASSERT(subregPtr2->size() == 5,
- "Client-2 SubRegion-2 should contains 5 entries ");
-
- // LOGINFO(" SubRegion-1 CREATES:: subRegCacheListener::m_creates = %d ",
- // subRegCacheListener->getCreates());
- // LOGINFO(" SubRegion-1 CLEARS:: subRegCacheListener::m_clears = %d ",
- // subRegCacheListener->getClears());
-
- LOGINFO(
- "validateListenerWriterEventsWithNBSTrue :: Event Validation "
- "Passed....!!");
+ ASSERT(exmpRegPtr->size() == 0,
+ "Client-2 ExampleRegion.clear() should have called and so "
+ "Exampleregion size is expected to 0 ");
+
+ // Verify entries in Sub-Region.
+ auto subregPtr1 = exmpRegPtr->getSubregion(myRegNames[3]);
+ auto subregPtr2 = exmpRegPtr->getSubregion(myRegNames[4]);
+
+ // LOGINFO(" Total Entries in SubRegion-1 = %d ", subregPtr1->size());
+ // LOGINFO(" Total Entries in SubRegion-2 = %d ", subregPtr2->size());
+ ASSERT(subRegCacheListener->getCreates() == 5,
+ "should be 5 creates for SubRegion-1 ");
+ ASSERT(subRegCacheListener->getClears() == 0,
+ "should be 0 clears for SubRegion-1 ");
+ ASSERT(subregPtr1->size() == 5,
+ "Client-2 SubRegion-1 should contains 5 entries ");
+ ASSERT(subregPtr2->size() == 5,
+ "Client-2 SubRegion-2 should contains 5 entries ");
+
+ // LOGINFO(" SubRegion-1 CREATES:: subRegCacheListener::m_creates = %d ",
+ // subRegCacheListener->getCreates());
+ // LOGINFO(" SubRegion-1 CLEARS:: subRegCacheListener::m_clears = %d ",
+ // subRegCacheListener->getClears());
+
+ LOGINFO(
+ "validateListenerWriterEventsWithNBSTrue :: Event Validation "
+ "Passed....!!");
}
END_TASK_DEFINITION
diff --git a/cppcache/integration-test/ThinClientLocalCacheLoader.hpp b/cppcache/integration-test/ThinClientLocalCacheLoader.hpp
index faea6ee..0d4484b 100644
--- a/cppcache/integration-test/ThinClientLocalCacheLoader.hpp
+++ b/cppcache/integration-test/ThinClientLocalCacheLoader.hpp
@@ -30,11 +30,10 @@
using namespace apache::geode::client;
using namespace test;
-
-TallyLoaderPtr reg1Loader1;
+std::shared_ptr<TallyLoader> reg1Loader1;
int numLoads = 0;
-CachePtr cachePtr;
-RegionPtr regionPtr;
+std::shared_ptr<Cache> cachePtr;
+std::shared_ptr<Region> regionPtr;
class ThinClientTallyLoader : public TallyLoader {
public:
@@ -42,24 +41,26 @@ class ThinClientTallyLoader : public TallyLoader {
virtual ~ThinClientTallyLoader() {}
- CacheablePtr load(const RegionPtr& rp, const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument) {
+ std::shared_ptr<Cacheable> load(
+ const std::shared_ptr<Region>& rp,
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
int32_t loadValue = std::dynamic_pointer_cast<CacheableInt32>(
TallyLoader::load(rp, key, aCallbackArgument))
->value();
char lstrvalue[32];
sprintf(lstrvalue, "%i", loadValue);
- CacheableStringPtr lreturnValue = CacheableString::create(lstrvalue);
- if (key != nullptr && (nullptr != rp->getAttributes()->getEndpoints() ||
- rp->getAttributes()->getPoolName() != nullptr)) {
- LOGDEBUG("Putting the value (%s) for local region clients only ",
- lstrvalue);
- rp->put(key, lreturnValue);
+ auto lreturnValue = CacheableString::create(lstrvalue);
+ if (key != nullptr && (nullptr != rp->getAttributes()->getEndpoints() ||
+ rp->getAttributes()->getPoolName() != nullptr)) {
+ LOGDEBUG("Putting the value (%s) for local region clients only ",
+ lstrvalue);
+ rp->put(key, lreturnValue);
}
return lreturnValue;
}
- void close(const RegionPtr& region) {
+ void close(const std::shared_ptr<Region>& region) {
LOG(" ThinClientTallyLoader::close() called");
if (region != nullptr) {
LOGINFO(" Region %s is Destroyed = %d ", region->getName(),
@@ -101,7 +102,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, SetupClient)
std::string clientXml = path;
clientXml += "/resources/";
clientXml += clientXmlFile;
- CacheFactoryPtr cacheFactoryPtr = CacheFactory::createCacheFactory()->set(
+ auto cacheFactoryPtr = CacheFactory::createCacheFactory()->set(
"cache-xml-file", clientXml.c_str());
cachePtr = cacheFactoryPtr->create();
LOGINFO("Created the Geode Cache");
@@ -112,9 +113,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, SetupClient)
LOGINFO("Obtained the Region from the Cache");
// Plugin the ThinClientTallyLoader to the Region.
- AttributesMutatorPtr attrMutatorPtr = regionPtr->getAttributesMutator();
- reg1Loader1 = std::make_shared<ThinClientTallyLoader>();
- attrMutatorPtr->setCacheLoader(reg1Loader1);
+ auto attrMutatorPtr = regionPtr->getAttributesMutator();
+ reg1Loader1 = std::make_shared<ThinClientTallyLoader>();
+ attrMutatorPtr->setCacheLoader(reg1Loader1);
}
END_TASK_DEFINITION
@@ -128,115 +129,115 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, testLoader)
{
- CacheableKeyPtr keyPtr = CacheableKey::create("Key0");
+ auto keyPtr = CacheableKey::create("Key0");
- ASSERT(!regionPtr->containsKey(keyPtr),
- "Key should not have been found in region.");
- // now having the Callbacks set, lets call the loader
- ASSERT(regionPtr->get(keyPtr) != nullptr, "Expected non null value");
+ ASSERT(!regionPtr->containsKey(keyPtr),
+ "Key should not have been found in region.");
+ // now having the Callbacks set, lets call the loader
+ ASSERT(regionPtr->get(keyPtr) != nullptr, "Expected non null value");
- RegionEntryPtr regEntryPtr = regionPtr->getEntry(keyPtr);
- CacheablePtr valuePtr = regEntryPtr->getValue();
- int val = atoi(valuePtr->toString()->asChar());
- LOGFINE("val for keyPtr is %d", val);
- numLoads++;
- validateEventCount(__LINE__);
+ auto regEntryPtr = regionPtr->getEntry(keyPtr);
+ auto valuePtr = regEntryPtr->getValue();
+ int val = atoi(valuePtr->toString()->asChar());
+ LOGFINE("val for keyPtr is %d", val);
+ numLoads++;
+ validateEventCount(__LINE__);
}
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, testDestroy)
{
- CacheableKeyPtr keyPtr2 = CacheableKey::create("Key1");
- regionPtr->destroy(keyPtr2);
- // Verify the sequence destroy()->get() :- CacheLoader to be invoked.
- regionPtr->get(keyPtr2);
- RegionEntryPtr regEntryPtr2 = regionPtr->getEntry(keyPtr2);
- CacheablePtr valuePtr2 = regEntryPtr2->getValue();
- int val2 = atoi(valuePtr2->toString()->asChar());
- LOGFINE("val2 for keyPtr2 is %d", val2);
- numLoads++;
- validateEventCount(__LINE__);
+ auto keyPtr2 = CacheableKey::create("Key1");
+ regionPtr->destroy(keyPtr2);
+ // Verify the sequence destroy()->get() :- CacheLoader to be invoked.
+ regionPtr->get(keyPtr2);
+ auto regEntryPtr2 = regionPtr->getEntry(keyPtr2);
+ auto valuePtr2 = regEntryPtr2->getValue();
+ int val2 = atoi(valuePtr2->toString()->asChar());
+ LOGFINE("val2 for keyPtr2 is %d", val2);
+ numLoads++;
+ validateEventCount(__LINE__);
}
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, testInvalidateKey)
{
- CacheableKeyPtr keyPtr2 = CacheableKey::create("Key2");
- regionPtr->put(keyPtr2, "Value2");
- regionPtr->invalidate(keyPtr2);
- // Verify the sequence invalidate()->get() :- CacheLoader to be invoked.
- regionPtr->get(keyPtr2);
- RegionEntryPtr regEntryPtr = regionPtr->getEntry(keyPtr2);
- CacheablePtr valuePtr = regEntryPtr->getValue();
- int val = atoi(valuePtr->toString()->asChar());
- LOGFINE("val for keyPtr1 is %d", val);
- numLoads++;
- validateEventCount(__LINE__);
+ auto keyPtr2 = CacheableKey::create("Key2");
+ regionPtr->put(keyPtr2, "Value2");
+ regionPtr->invalidate(keyPtr2);
+ // Verify the sequence invalidate()->get() :- CacheLoader to be invoked.
+ regionPtr->get(keyPtr2);
+ auto regEntryPtr = regionPtr->getEntry(keyPtr2);
+ auto valuePtr = regEntryPtr->getValue();
+ int val = atoi(valuePtr->toString()->asChar());
+ LOGFINE("val for keyPtr1 is %d", val);
+ numLoads++;
+ validateEventCount(__LINE__);
- // Verify the sequence put()->invalidate()->get()->invalidate()->get() :-
- // CacheLoader to be invoked twice
- // once after each get.
- CacheableKeyPtr keyPtr4 = CacheableKey::create("Key4");
- regionPtr->put(keyPtr4, "Value4");
- regionPtr->invalidate(keyPtr4);
- regionPtr->get(keyPtr4);
- RegionEntryPtr regEntryPtr1 = regionPtr->getEntry(keyPtr4);
- CacheablePtr valuePtr1 = regEntryPtr1->getValue();
- int val1 = atoi(valuePtr1->toString()->asChar());
- LOGFINE("val1 for keyPtr4 is %d", val1);
- numLoads++;
- validateEventCount(__LINE__);
+ // Verify the sequence put()->invalidate()->get()->invalidate()->get() :-
+ // CacheLoader to be invoked twice
+ // once after each get.
+ auto keyPtr4 = CacheableKey::create("Key4");
+ regionPtr->put(keyPtr4, "Value4");
+ regionPtr->invalidate(keyPtr4);
+ regionPtr->get(keyPtr4);
+ auto regEntryPtr1 = regionPtr->getEntry(keyPtr4);
+ auto valuePtr1 = regEntryPtr1->getValue();
+ int val1 = atoi(valuePtr1->toString()->asChar());
+ LOGFINE("val1 for keyPtr4 is %d", val1);
+ numLoads++;
+ validateEventCount(__LINE__);
- regionPtr->invalidate(keyPtr4);
- regionPtr->get(keyPtr4);
- RegionEntryPtr regEntryPtr2 = regionPtr->getEntry(keyPtr4);
- CacheablePtr valuePtr2 = regEntryPtr2->getValue();
- int val2 = atoi(valuePtr2->toString()->asChar());
- LOGFINE("val2 for keyPtr4 is %d", val2);
- numLoads++;
- validateEventCount(__LINE__);
+ regionPtr->invalidate(keyPtr4);
+ regionPtr->get(keyPtr4);
+ auto regEntryPtr2 = regionPtr->getEntry(keyPtr4);
+ auto valuePtr2 = regEntryPtr2->getValue();
+ int val2 = atoi(valuePtr2->toString()->asChar());
+ LOGFINE("val2 for keyPtr4 is %d", val2);
+ numLoads++;
+ validateEventCount(__LINE__);
}
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, testInvalidateRegion)
{
- CacheableKeyPtr keyPtr3 = CacheableKey::create("Key3");
- regionPtr->put(keyPtr3, "Value3");
- // Verify the sequence invalidateRegion()->get() :- CacheLoader to be
- // invoked.
- regionPtr->invalidateRegion();
- regionPtr->get(keyPtr3);
- RegionEntryPtr regEntryPtr = regionPtr->getEntry(keyPtr3);
- CacheablePtr valuePtr = regEntryPtr->getValue();
- int val = atoi(valuePtr->toString()->asChar());
- LOGFINE("val for keyPtr3 is %d", val);
- numLoads++;
- validateEventCount(__LINE__);
+ auto keyPtr3 = CacheableKey::create("Key3");
+ regionPtr->put(keyPtr3, "Value3");
+ // Verify the sequence invalidateRegion()->get() :- CacheLoader to be
+ // invoked.
+ regionPtr->invalidateRegion();
+ regionPtr->get(keyPtr3);
+ auto regEntryPtr = regionPtr->getEntry(keyPtr3);
+ auto valuePtr = regEntryPtr->getValue();
+ int val = atoi(valuePtr->toString()->asChar());
+ LOGFINE("val for keyPtr3 is %d", val);
+ numLoads++;
+ validateEventCount(__LINE__);
- // Verify the sequence
- // put()->invalidateRegion()->get()->invalidateRegion()->get() :-
- // CacheLoader
- // to be invoked twice.
- // once after each get.
- CacheableKeyPtr keyPtr4 = CacheableKey::create("Key4");
- regionPtr->put(keyPtr4, "Value4");
- regionPtr->invalidateRegion();
- regionPtr->get(keyPtr4);
- RegionEntryPtr regEntryPtr1 = regionPtr->getEntry(keyPtr4);
- CacheablePtr valuePtr1 = regEntryPtr1->getValue();
- int val1 = atoi(valuePtr1->toString()->asChar());
- LOGFINE("val1 for keyPtr4 is %d", val1);
- numLoads++;
- validateEventCount(__LINE__);
+ // Verify the sequence
+ // put()->invalidateRegion()->get()->invalidateRegion()->get() :-
+ // CacheLoader
+ // to be invoked twice.
+ // once after each get.
+ auto keyPtr4 = CacheableKey::create("Key4");
+ regionPtr->put(keyPtr4, "Value4");
+ regionPtr->invalidateRegion();
+ regionPtr->get(keyPtr4);
+ auto regEntryPtr1 = regionPtr->getEntry(keyPtr4);
+ auto valuePtr1 = regEntryPtr1->getValue();
+ int val1 = atoi(valuePtr1->toString()->asChar());
+ LOGFINE("val1 for keyPtr4 is %d", val1);
+ numLoads++;
+ validateEventCount(__LINE__);
- regionPtr->invalidateRegion();
- regionPtr->get(keyPtr4);
- RegionEntryPtr regEntryPtr2 = regionPtr->getEntry(keyPtr4);
- CacheablePtr valuePtr2 = regEntryPtr2->getValue();
- int val2 = atoi(valuePtr2->toString()->asChar());
- LOGFINE("val2 for keyPtr4 is %d", val2);
- numLoads++;
- validateEventCount(__LINE__);
+ regionPtr->invalidateRegion();
+ regionPtr->get(keyPtr4);
+ auto regEntryPtr2 = regionPtr->getEntry(keyPtr4);
+ auto valuePtr2 = regEntryPtr2->getValue();
+ int val2 = atoi(valuePtr2->toString()->asChar());
+ LOGFINE("val2 for keyPtr4 is %d", val2);
+ numLoads++;
+ validateEventCount(__LINE__);
}
END_TASK_DEFINITION
diff --git a/cppcache/integration-test/ThinClientMultipleCaches.hpp b/cppcache/integration-test/ThinClientMultipleCaches.hpp
index 637b368..0cec164 100644
--- a/cppcache/integration-test/ThinClientMultipleCaches.hpp
+++ b/cppcache/integration-test/ThinClientMultipleCaches.hpp
@@ -23,7 +23,6 @@
#include <string>
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <geode/CacheFactory.hpp>
#include "CacheHelper.hpp"
@@ -48,8 +47,7 @@ DUNIT_TASK_DEFINITION(SERVER1, CreateServer1)
LOG("SERVER1 started");
}
END_TASK_DEFINITION
-
-RegionPtr createRegionFromCache(std::shared_ptr<Cache> cache) {
+std::shared_ptr<Region> createRegionFromCache(std::shared_ptr<Cache> cache) {
auto poolFactory = cache->getPoolManager().createFactory();
CacheHelper::getHelper().addServerLocatorEPs(locatorsG, poolFactory, true);
poolFactory->create("DistRegionAck");
diff --git a/cppcache/integration-test/ThinClientNotification.hpp b/cppcache/integration-test/ThinClientNotification.hpp
index 089bcce..a04040e 100644
--- a/cppcache/integration-test/ThinClientNotification.hpp
+++ b/cppcache/integration-test/ThinClientNotification.hpp
@@ -21,7 +21,6 @@
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <string>
@@ -80,10 +79,10 @@ void _verifyEntry(const char* name, const char* key, const char* val,
LOG(buf);
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
LOG("Before contains key");
// if the region is no ack, then we may need to wait...
@@ -176,7 +175,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -189,10 +188,10 @@ void createEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -214,10 +213,10 @@ void updateEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -239,9 +238,9 @@ void doNetsearch(const char* name, const char* key, const char* value) {
key, value, name);
fflush(stdout);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "netsearch region %s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -253,7 +252,7 @@ void doNetsearch(const char* name, const char* key, const char* value) {
ASSERT(!regPtr->containsValueForKey(keyPtr),
"Value should not have been found in region.");
- CacheablePtr theValue = regPtr->get(keyPtr);
+ auto theValue = regPtr->get(keyPtr);
auto checkPtr = std::dynamic_pointer_cast<CacheableString>(
theValue); // force a netsearch
@@ -275,9 +274,9 @@ void invalidateEntry(const char* name, const char* key) {
fprintf(stdout, "Invalidating entry -- key: %s in region %s\n", key, name);
fflush(stdout);
// Invalidate entry, verify entry is invalidated
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -296,9 +295,9 @@ void destroyEntry(const char* name, const char* key) {
fprintf(stdout, "Destroying entry -- key: %s in region %s\n", key, name);
fflush(stdout);
// Destroy entry, verify entry is destroyed
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -312,7 +311,7 @@ void destroyEntry(const char* name, const char* key) {
void destroyRegion(const char* name) {
LOG("destroyRegion() entered.");
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
regPtr->localDestroyRegion();
LOG("Region destroyed.");
}
@@ -340,7 +339,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateRegions1_PoolLocators)
createPooledRegion(regionNames[0], USE_ACK, locatorsG, "__TESTPOOL1_",
true);
createPooledRegion(regionNames[1], NO_ACK, locatorsG, "__TESTPOOL1_", true);
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
regPtr->registerAllKeys(false, false, false);
regPtr = getHelper()->getRegion(regionNames[1]);
regPtr->registerAllKeys(false, false, false);
@@ -353,7 +352,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, CreateRegions2_PoolLocators)
createPooledRegion(regionNames[0], USE_ACK, locatorsG, "__TESTPOOL1_",
true);
createPooledRegion(regionNames[1], NO_ACK, locatorsG, "__TESTPOOL1_", true);
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
regPtr->registerAllKeys(false, false, false);
regPtr = getHelper()->getRegion(regionNames[1]);
regPtr->registerAllKeys(false, false, false);
diff --git a/cppcache/integration-test/ThinClientPdxSerializer.hpp b/cppcache/integration-test/ThinClientPdxSerializer.hpp
index 7e80b6b..c8965bc 100644
--- a/cppcache/integration-test/ThinClientPdxSerializer.hpp
+++ b/cppcache/integration-test/ThinClientPdxSerializer.hpp
@@ -27,7 +27,6 @@
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <string>
@@ -154,7 +153,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepTwoPoolLoc_PDX)
}
END_TASK_DEFINITION
-void checkPdxInstanceToStringAtServer(RegionPtr regionPtr) {
+void checkPdxInstanceToStringAtServer(std::shared_ptr<Region> regionPtr) {
auto keyport = CacheableKey::create("success");
auto boolPtr =
std::dynamic_pointer_cast<CacheableBoolean>(regionPtr->get(keyport));
@@ -164,7 +163,9 @@ void checkPdxInstanceToStringAtServer(RegionPtr regionPtr) {
DUNIT_TASK_DEFINITION(CLIENT1, JavaPutGet)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
serializationRegistry->setPdxSerializer(std::make_shared<TestPdxSerializer>());
auto regPtr0 = getHelper()->getRegion("DistRegionAck");
@@ -196,7 +197,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, JavaGet)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
serializationRegistry->setPdxSerializer(std::make_shared<TestPdxSerializer>());
LOGDEBUG("JavaGet-1 Line_309");
@@ -222,7 +225,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, putFromVersion1_PS)
auto regPtr0 = getHelper()->getRegion("DistRegionAck");
auto key = CacheableKey::create(1);
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
serializationRegistry->setPdxSerializer(std::make_shared<TestPdxSerializerForV1>());
// Create New object and wrap it in PdxWrapper (owner)
@@ -255,9 +260,11 @@ DUNIT_TASK_DEFINITION(CLIENT2, putFromVersion2_PS)
auto regPtr0 = getHelper()->getRegion("DistRegionAck");
auto key = CacheableKey::create(1);
-
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
- serializationRegistry->setPdxSerializer(PdxSerializerPtr(new TestPdxSerializerForV2));
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
+ serializationRegistry->setPdxSerializer(
+ std::shared_ptr<PdxSerializer>(new TestPdxSerializerForV2));
// Create New object and wrap it in PdxWrapper (owner)
auto npt1 = new PdxTests::TestDiffTypePdxSV2(true);
diff --git a/cppcache/integration-test/ThinClientPdxSerializers.hpp b/cppcache/integration-test/ThinClientPdxSerializers.hpp
index e166213..8eabc70 100644
--- a/cppcache/integration-test/ThinClientPdxSerializers.hpp
+++ b/cppcache/integration-test/ThinClientPdxSerializers.hpp
@@ -63,7 +63,7 @@ class TestPdxSerializer : public PdxSerializer {
return objectSize;
}
- void *fromDataForAddress(PdxReaderPtr pr) {
+ void *fromDataForAddress(std::shared_ptr<PdxReader> pr) {
try {
PdxTests::NonPdxAddress *npa = new PdxTests::NonPdxAddress;
npa->_aptNumber = pr->readInt("_aptNumber");
@@ -75,7 +75,7 @@ class TestPdxSerializer : public PdxSerializer {
}
}
- void *fromData(const char *className, PdxReaderPtr pr) {
+ void *fromData(const char *className, std::shared_ptr<PdxReader> pr) {
ASSERT(strcmp(className, CLASSNAME1) == 0 ||
strcmp(className, CLASSNAME2) == 0,
"Unexpected classname in fromData");
@@ -180,7 +180,7 @@ class TestPdxSerializer : public PdxSerializer {
return (void *)npt;
}
- bool toDataForAddress(void *testObject, PdxWriterPtr pw) {
+ bool toDataForAddress(void *testObject, std::shared_ptr<PdxWriter> pw) {
try {
PdxTests::NonPdxAddress *npa =
reinterpret_cast<PdxTests::NonPdxAddress *>(testObject);
@@ -193,7 +193,8 @@ class TestPdxSerializer : public PdxSerializer {
}
}
- bool toData(void *testObject, const char *className, PdxWriterPtr pw) {
+ bool toData(void *testObject, const char *className,
+ std::shared_ptr<PdxWriter> pw) {
ASSERT(strcmp(className, CLASSNAME1) == 0 ||
strcmp(className, CLASSNAME2) == 0,
"Unexpected classname in toData");
diff --git a/cppcache/integration-test/ThinClientPutAll.hpp b/cppcache/integration-test/ThinClientPutAll.hpp
index fd986c0..545b326 100644
--- a/cppcache/integration-test/ThinClientPutAll.hpp
+++ b/cppcache/integration-test/ThinClientPutAll.hpp
@@ -21,7 +21,6 @@
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include "testobject/PdxType.hpp"
@@ -92,10 +91,10 @@ void _verifyEntry(const char* name, const char* key, const char* val,
}
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
// if the region is no ack, then we may need to wait...
if (!isCreated) {
@@ -207,8 +206,8 @@ void createRegion(const char* name, bool ackMode, bool isCacheEnabled,
LOG("createRegion() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr = getHelper()->createRegion(
- name, ackMode, isCacheEnabled, nullptr, clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, isCacheEnabled,
+ nullptr, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -219,7 +218,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -233,7 +232,7 @@ void createPooledRegionConcurrencyCheckDisabled(
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr = getHelper()->createPooledRegionConcurrencyCheckDisabled(
+ auto regPtr = getHelper()->createPooledRegionConcurrencyCheckDisabled(
name, ackMode, locators, poolname, cachingEnable,
clientNotificationEnabled, concurrencyCheckEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -247,13 +246,13 @@ void createEntry(const char* name, const char* key,
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
if (value == nullptr) {
value = "";
}
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -275,10 +274,10 @@ void updateEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -300,9 +299,9 @@ void doNetsearch(const char* name, const char* key, const char* value) {
key, value, name);
fflush(stdout);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "netsearch region %s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -398,7 +397,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
{
try {
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
serializationRegistry->addPdxType(PdxTests::PdxType::createDeserializable);
serializationRegistry->addPdxType(PdxTests::PdxTypes1::createDeserializable);
serializationRegistry->addPdxType(PdxTests::PdxTypes2::createDeserializable);
@@ -410,21 +411,21 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
// the client1 will register k0 and k1
// createEntry( regionNames[0], keys[0], vals[0] );
// createEntry( regionNames[0], keys[1], vals[1] );
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
- CacheableKeyPtr keyPtr0 = CacheableKey::create(keys[0]);
- CacheableKeyPtr keyPtr1 = CacheableKey::create(keys[1]);
+ auto keyPtr0 = CacheableKey::create(keys[0]);
+ auto keyPtr1 = CacheableKey::create(keys[1]);
- VectorOfCacheableKey keys1;
+ std::vector<std::shared_ptr<CacheableKey>> keys1;
keys1.push_back(keyPtr0);
keys1.push_back(keyPtr1);
regPtr0->registerKeys(keys1);
- CacheableKeyPtr keyPtr2 = CacheableKey::create(keys[2]);
- CacheableKeyPtr keyPtr3 = CacheableKey::create(keys[3]);
+ auto keyPtr2 = CacheableKey::create(keys[2]);
+ auto keyPtr3 = CacheableKey::create(keys[3]);
- VectorOfCacheableKey keys2;
+ std::vector<std::shared_ptr<CacheableKey>> keys2;
keys2.push_back(keyPtr2);
keys2.push_back(keyPtr3);
regPtr1->registerKeys(keys2);
@@ -436,7 +437,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, StepFour)
{
try {
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
serializationRegistry->addPdxType(PdxTests::PdxType::createDeserializable);
serializationRegistry->addPdxType(PdxTests::PdxTypes1::createDeserializable);
serializationRegistry->addPdxType(PdxTests::PdxTypes2::createDeserializable);
@@ -457,8 +460,8 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepFour)
map1.emplace(CacheableKey::create(keys[i]),
CacheableString::create(vals[i]));
}
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
regPtr0->putAll(map0);
regPtr1->putAll(map1);
LOG("StepFour complete.");
@@ -478,11 +481,11 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutAllOps)
CacheableString::create(value));
}
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
regPtr0->putAll(entryMap);
LOG("putAll1 complete");
- VectorOfCacheableKey getAllkeys;
+ std::vector<std::shared_ptr<CacheableKey>> getAllkeys;
for (int32_t item = 0; item < 500; item++) {
sprintf(key, "key-%d", item);
getAllkeys.push_back(CacheableKey::create(key));
@@ -531,8 +534,8 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepSix)
map1.emplace(CacheableKey::create(keys[i]),
CacheableString::create(nvals[i]));
}
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
regPtr0->putAll(map0);
regPtr1->putAll(map1);
@@ -589,13 +592,13 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepTen)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionServicePtr rsp = regPtr0->getRegionService();
- RegionPtr regPtr = rsp->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto rsp = regPtr0->getRegionService();
+ auto regPtr = rsp->getRegion(regionNames[0]);
ASSERT(regPtr != nullptr, "Failed to get region.");
- RegionServicePtr rsp1 = regPtr0->getRegionService();
- RegionPtr regPtr1 = rsp1->getRegion("NOT_CREATED_REGION");
+ auto rsp1 = regPtr0->getRegionService();
+ auto regPtr1 = rsp1->getRegion("NOT_CREATED_REGION");
ASSERT(regPtr1 == nullptr, "Unknown Region Returned");
LOG("StepTen complete.");
@@ -604,10 +607,10 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepEleven)
{
- CacheableKeyPtr keyPtr0 = CacheableInt64::create(100L);
- CacheableKeyPtr valPtr0 = CacheableInt64::create(200L);
+ auto keyPtr0 = CacheableInt64::create(100L);
+ auto valPtr0 = CacheableInt64::create(200L);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
regPtr0->put(keyPtr0, valPtr0);
auto checkPtr =
@@ -619,7 +622,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepEleven)
ASSERT(checkPtr == nullptr, "checkPtr should be null.");
try {
- CacheableKeyPtr key;
+ std::shared_ptr<CacheableKey> key;
regPtr0->invalidate(key);
FAIL("Invalidate on nullptr should throw exception");
} catch (IllegalArgumentException e) {
@@ -633,7 +636,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepThirteen)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
HashMapOfCacheable map0;
for (int i = 0; i < 2; i++) {
map0.emplace(CacheableInt64::create(i), CacheableInt64::create(i));
@@ -680,7 +683,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThirteen)
auto keyObject6 = std::make_shared<PdxTests::PdxTypes3>();
map0.emplace(keyObject6, CacheableString::create("testString"));
regPtr0->putAll(map0);
- CacheablePtr checkPtr1 = regPtr0->get(keyObject6);
+ auto checkPtr1 = regPtr0->get(keyObject6);
ASSERT(strcmp(checkPtr1->toString()->asChar(), "testString") == 0,
"strVal should be testString.");
map0.clear();
@@ -735,7 +738,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThirteen)
regPtr0->localInvalidateRegion();
- VectorOfCacheableKey keys1;
+ std::vector<std::shared_ptr<CacheableKey>> keys1;
keys1.push_back(keyObject7);
keys1.push_back(keyObject8);
const auto values = regPtr0->getAll(keys1);
diff --git a/cppcache/integration-test/ThinClientPutAllTimeout.hpp b/cppcache/integration-test/ThinClientPutAllTimeout.hpp
index 191a814..a60642b 100644
--- a/cppcache/integration-test/ThinClientPutAllTimeout.hpp
+++ b/cppcache/integration-test/ThinClientPutAllTimeout.hpp
@@ -37,22 +37,24 @@ static bool isLocator = false;
const char* locatorsG =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, 1);
#include "LocatorHelper.hpp"
-TallyListenerPtr reg1Listener1;
-TallyWriterPtr reg1Writer1;
+std::shared_ptr<TallyListener> reg1Listener1;
+std::shared_ptr<TallyWriter> reg1Writer1;
int numCreates = 0;
int numUpdates = 0;
int numInvalidates = 0;
int numDestroys = 0;
-void setCacheListener(const char* regName, TallyListenerPtr regListener) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
+void setCacheListener(const char* regName,
+ std::shared_ptr<TallyListener> regListener) {
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheListener(regListener);
}
-void setCacheWriter(const char* regName, TallyWriterPtr regWriter) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
+void setCacheWriter(const char* regName,
+ std::shared_ptr<TallyWriter> regWriter) {
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheWriter(regWriter);
}
@@ -150,7 +152,7 @@ void putAllWithOneEntryTimeoutWithCallBackArg(
DUNIT_TASK_DEFINITION(CLIENT1, testTimeoutException)
{
printf("start task testTimeoutException\n");
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
regPtr->registerAllKeys();
@@ -189,7 +191,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, testWithoutTimeoutException)
{
printf("start task testWithoutTimeoutException\n");
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
// regPtr->registerAllKeys();
diff --git a/cppcache/integration-test/ThinClientPutAllWithCallBack.hpp b/cppcache/integration-test/ThinClientPutAllWithCallBack.hpp
index 5688b87..3ae9323 100644
--- a/cppcache/integration-test/ThinClientPutAllWithCallBack.hpp
+++ b/cppcache/integration-test/ThinClientPutAllWithCallBack.hpp
@@ -21,7 +21,6 @@
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include "testobject/PdxType.hpp"
@@ -91,10 +90,10 @@ void _verifyEntry(const char* name, const char* key, const char* val,
LOG(buf);
}
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
// if the region is no ack, then we may need to wait...
if (!isCreated) {
@@ -206,8 +205,8 @@ void createRegion(const char* name, bool ackMode, bool isCacheEnabled,
LOG("createRegion() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr = getHelper()->createRegion(
- name, ackMode, isCacheEnabled, nullptr, clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, isCacheEnabled,
+ nullptr, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -218,7 +217,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -232,7 +231,7 @@ void createPooledRegionConcurrencyCheckDisabled(
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr = getHelper()->createPooledRegionConcurrencyCheckDisabled(
+ auto regPtr = getHelper()->createPooledRegionConcurrencyCheckDisabled(
name, ackMode, locators, poolname, cachingEnable,
clientNotificationEnabled, concurrencyCheckEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -246,13 +245,13 @@ void createEntry(const char* name, const char* key,
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
if (value == nullptr) {
value = "";
}
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -274,10 +273,10 @@ void updateEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -299,9 +298,9 @@ void doNetsearch(const char* name, const char* key, const char* value) {
key, value, name);
fflush(stdout);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "netsearch region %s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -400,7 +399,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, RegisterClient1Keys)
{
try {
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
serializationRegistry->addPdxType(PdxTests::PdxType::createDeserializable);
serializationRegistry->addPdxType(PdxTests::PdxTypes1::createDeserializable);
@@ -413,21 +414,21 @@ DUNIT_TASK_DEFINITION(CLIENT1, RegisterClient1Keys)
// the client1 will register k0 and k1
// createEntry( regionNames[0], keys[0], vals[0] );
// createEntry( regionNames[0], keys[1], vals[1] );
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
- CacheableKeyPtr keyPtr0 = CacheableKey::create(keys[0]);
- CacheableKeyPtr keyPtr1 = CacheableKey::create(keys[1]);
+ auto keyPtr0 = CacheableKey::create(keys[0]);
+ auto keyPtr1 = CacheableKey::create(keys[1]);
- VectorOfCacheableKey keys1;
+ std::vector<std::shared_ptr<CacheableKey>> keys1;
keys1.push_back(keyPtr0);
keys1.push_back(keyPtr1);
regPtr0->registerKeys(keys1);
- CacheableKeyPtr keyPtr2 = CacheableKey::create(keys[2]);
- CacheableKeyPtr keyPtr3 = CacheableKey::create(keys[3]);
+ auto keyPtr2 = CacheableKey::create(keys[2]);
+ auto keyPtr3 = CacheableKey::create(keys[3]);
- VectorOfCacheableKey keys2;
+ std::vector<std::shared_ptr<CacheableKey>> keys2;
keys2.push_back(keyPtr2);
keys2.push_back(keyPtr3);
regPtr1->registerKeys(keys2);
@@ -439,7 +440,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, RegisterClient2Keys)
{
try {
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
serializationRegistry->addPdxType(PdxTests::PdxType::createDeserializable);
serializationRegistry->addPdxType(PdxTests::PdxTypes1::createDeserializable);
serializationRegistry->addPdxType(PdxTests::PdxTypes2::createDeserializable);
@@ -460,8 +463,8 @@ DUNIT_TASK_DEFINITION(CLIENT2, RegisterClient2Keys)
map1.emplace(CacheableKey::create(keys[i]),
CacheableString::create(vals[i]));
}
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
regPtr0->putAll(map0, std::chrono::seconds(15),
CacheableInt32::create(1000));
regPtr1->putAll(map1, std::chrono::seconds(15),
@@ -483,13 +486,13 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutAllOps)
CacheableString::create(value));
}
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
regPtr0->putAll(entryMap, std::chrono::seconds(15),
CacheableInt32::create(1000));
LOG("putAll1 complete");
- VectorOfCacheableKey getAllkeys;
+ std::vector<std::shared_ptr<CacheableKey>> getAllkeys;
for (int32_t item = 0; item < 500; item++) {
sprintf(key, "key-%d", item);
getAllkeys.push_back(CacheableKey::create(key));
@@ -599,13 +602,13 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, VerifyRegionService)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionServicePtr rsp = regPtr0->getRegionService();
- RegionPtr regPtr = rsp->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto rsp = regPtr0->getRegionService();
+ auto regPtr = rsp->getRegion(regionNames[0]);
ASSERT(regPtr != nullptr, "Failed to get region.");
- RegionServicePtr rsp1 = regPtr0->getRegionService();
- RegionPtr regPtr1 = rsp1->getRegion("NOT_CREATED_REGION");
+ auto rsp1 = regPtr0->getRegionService();
+ auto regPtr1 = rsp1->getRegion("NOT_CREATED_REGION");
ASSERT(regPtr1 == nullptr, "Unknown Region Returned");
LOG("VerifyRegionService complete.");
@@ -614,10 +617,10 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, InvalidateKeys)
{
- CacheableKeyPtr keyPtr0 = CacheableInt64::create(100L);
- CacheableKeyPtr valPtr0 = CacheableInt64::create(200L);
+ auto keyPtr0 = CacheableInt64::create(100L);
+ auto valPtr0 = CacheableInt64::create(200L);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
regPtr0->put(keyPtr0, valPtr0);
auto checkPtr =
@@ -629,7 +632,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, InvalidateKeys)
ASSERT(checkPtr == nullptr, "checkPtr should be null.");
try {
- CacheableKeyPtr key;
+ std::shared_ptr<CacheableKey> key;
regPtr0->invalidate(key);
FAIL("Invalidate on nullptr should throw exception");
} catch (IllegalArgumentException e) {
@@ -678,7 +681,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, VerifyPutAllWithLongKeyAndLongValue)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
HashMapOfCacheable map0;
try {
map0.emplace(CacheableInt64::create(345),
@@ -766,7 +769,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, VerifyPutAllWithObjectKey)
regPtr0->localInvalidateRegion();
- VectorOfCacheableKey keys1;
+ std::vector<std::shared_ptr<CacheableKey>> keys1;
keys1.push_back(keyObject7);
keys1.push_back(keyObject8);
const auto values = regPtr0->getAll(keys1);
diff --git a/cppcache/integration-test/ThinClientPutGetAll.hpp b/cppcache/integration-test/ThinClientPutGetAll.hpp
index c1666b2..264a25d 100644
--- a/cppcache/integration-test/ThinClientPutGetAll.hpp
+++ b/cppcache/integration-test/ThinClientPutGetAll.hpp
@@ -21,7 +21,6 @@
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <string>
@@ -59,13 +58,14 @@ const char* _regionNames[] = {"DistRegionAck"};
#include "LocatorHelper.hpp"
-void verifyGetAll(RegionPtr region, bool addToLocalCache, const char** _vals,
- int startIndex, CacheablePtr callBack = nullptr) {
- CacheableKeyPtr keyPtr0 = CacheableKey::create(_keys[0]);
- CacheableKeyPtr keyPtr1 = CacheableKey::create(_keys[1]);
- CacheableKeyPtr keyPtr2 = CacheableKey::create("keyNotThere");
+void verifyGetAll(std::shared_ptr<Region> region, bool addToLocalCache,
+ const char** _vals, int startIndex,
+ std::shared_ptr<Cacheable> callBack = nullptr) {
+ auto keyPtr0 = CacheableKey::create(_keys[0]);
+ auto keyPtr1 = CacheableKey::create(_keys[1]);
+ auto keyPtr2 = CacheableKey::create("keyNotThere");
- VectorOfCacheableKey keys1;
+ std::vector<std::shared_ptr<CacheableKey>> keys1;
keys1.push_back(keyPtr0);
keys1.push_back(keyPtr1);
keys1.push_back(keyPtr2);
@@ -96,9 +96,10 @@ void verifyGetAll(RegionPtr region, bool addToLocalCache, const char** _vals,
}
}
-void verifyGetAllWithCallBackArg(RegionPtr region, bool addToLocalCache,
- const char** vals, int startIndex,
- CacheablePtr callBack) {
+void verifyGetAllWithCallBackArg(std::shared_ptr<Region> region,
+ bool addToLocalCache, const char** vals,
+ int startIndex,
+ std::shared_ptr<Cacheable> callBack) {
verifyGetAll(region, addToLocalCache, vals, startIndex, callBack);
}
@@ -109,7 +110,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -148,7 +149,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutAllInitialValuesFromClientOne)
map0.emplace(CacheableKey::create(_keys[i]),
CacheableString::create(_vals[i]));
}
- RegionPtr regPtr0 = getHelper()->getRegion(_regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(_regionNames[0]);
regPtr0->putAll(map0);
LOG("PutAllInitialValuesFromClientOne complete.");
}
@@ -157,7 +158,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, GetAllInitialValuesFromClientTwo)
{
// getAll and validate key and value.
- RegionPtr region = getHelper()->getRegion(_regionNames[0]);
+ auto region = getHelper()->getRegion(_regionNames[0]);
verifyGetAll(region, true, _vals, 0);
verifyGetAllWithCallBackArg(region, true, _vals, 0,
CacheableInt32::create(1000));
@@ -173,7 +174,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutAllUpdatedValuesFromClientOne)
map0.emplace(CacheableKey::create(_keys[i]),
CacheableString::create(_nvals[i]));
}
- RegionPtr regPtr0 = getHelper()->getRegion(_regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(_regionNames[0]);
regPtr0->putAll(map0);
LOG("PutAllUpdatedValuesFromClientOne complete.");
}
@@ -181,7 +182,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, GetAllUpdatedValuesFromClientTwo)
{
// verify getAll get the data from local cache.
- RegionPtr region = getHelper()->getRegion(_regionNames[0]);
+ auto region = getHelper()->getRegion(_regionNames[0]);
verifyGetAll(region, true, _vals, 0);
verifyGetAllWithCallBackArg(region, true, _vals, 0,
CacheableInt32::create(1000));
@@ -193,7 +194,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, GetAllAfterLocalDestroyRegionOnClientTwo)
{
// getAll and validate key and value after localDestroyRegion and recreation
// of region.
- RegionPtr reg0 = getHelper()->getRegion(_regionNames[0]);
+ auto reg0 = getHelper()->getRegion(_regionNames[0]);
reg0->localDestroyRegion();
reg0 = nullptr;
getHelper()->createPooledRegion(regionNames[0], USE_ACK, 0,
@@ -209,7 +210,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, GetAllAfterLocalDestroyRegionOnClientTwo_Pool)
{
// getAll and validate key and value after localDestroyRegion and recreation
// of region.
- RegionPtr reg0 = getHelper()->getRegion(_regionNames[0]);
+ auto reg0 = getHelper()->getRegion(_regionNames[0]);
reg0->localDestroyRegion();
reg0 = nullptr;
createPooledRegion(_regionNames[0], USE_ACK, locatorsG, poolName, true,
@@ -224,7 +225,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, putallAndGetallPdxWithCallBackArg)
{
LOG("putallAndGetallPdxWithCallBackArg started.");
- SerializationRegistryPtr serializationRegistry =
+ auto serializationRegistry =
CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
->getSerializationRegistry();
try {
@@ -310,7 +311,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, putallAndGetallPdxWithCallBackArg)
map0.emplace(CacheableInt32::create(29), p9);
map0.emplace(CacheableInt32::create(30), p10);
- RegionPtr regPtr0 = getHelper()->getRegion(_regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(_regionNames[0]);
// TODO: Investigate whether callback is used
regPtr0->putAll(map0, std::chrono::seconds(15),
CacheableInt32::create(1001));
@@ -328,7 +329,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, putallAndGetallPdxWithCallBackArg)
regPtr0->localDestroy(CacheableInt32::create(30));
LOG("localDestroy on all Pdx objects completed.");
- VectorOfCacheableKey keys1;
+ std::vector<std::shared_ptr<CacheableKey>> keys1;
keys1.push_back(CacheableInt32::create(21));
keys1.push_back(CacheableInt32::create(22));
keys1.push_back(CacheableInt32::create(23));
@@ -401,7 +402,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, putallAndGetallPdx)
{
LOG("putallAndGetallPdx started.");
- SerializationRegistryPtr serializationRegistry =
+ auto serializationRegistry =
CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
->getSerializationRegistry();
try {
@@ -486,7 +487,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, putallAndGetallPdx)
map0.emplace(CacheableInt32::create(28), p8);
map0.emplace(CacheableInt32::create(29), p9);
map0.emplace(CacheableInt32::create(30), p10);
- RegionPtr regPtr0 = getHelper()->getRegion(_regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(_regionNames[0]);
regPtr0->put(CacheableInt32::create(30), p10);
regPtr0->putAll(map0);
LOG("putAll on Pdx objects completed.");
@@ -503,7 +504,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, putallAndGetallPdx)
regPtr0->localDestroy(CacheableInt32::create(30));
LOG("localDestroy on all Pdx objects completed.");
- VectorOfCacheableKey keys1;
+ std::vector<std::shared_ptr<CacheableKey>> keys1;
keys1.push_back(CacheableInt32::create(21));
keys1.push_back(CacheableInt32::create(22));
keys1.push_back(CacheableInt32::create(23));
diff --git a/cppcache/integration-test/ThinClientRIwithlocalRegionDestroy.hpp b/cppcache/integration-test/ThinClientRIwithlocalRegionDestroy.hpp
index db18d3e..3ba9953 100644
--- a/cppcache/integration-test/ThinClientRIwithlocalRegionDestroy.hpp
+++ b/cppcache/integration-test/ThinClientRIwithlocalRegionDestroy.hpp
@@ -20,7 +20,7 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
+#include <geode/RegionEvent.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <string>
@@ -87,14 +87,12 @@ class SimpleCacheListener : public CacheListener {
}
}
- virtual void close(const RegionPtr& region) {
+ virtual void close(const std::shared_ptr<Region>& region) {
LOGINFO("SimpleCacheListener: Got a close event.");
}
};
-typedef std::shared_ptr<SimpleCacheListener> SimpleCacheListenerPtr;
-
-SimpleCacheListenerPtr eventListener1 = nullptr;
-SimpleCacheListenerPtr eventListener2 = nullptr;
+std::shared_ptr<SimpleCacheListener> eventListener1 = nullptr;
+std::shared_ptr<SimpleCacheListener> eventListener2 = nullptr;
void initClient(const bool isthinClient) {
if (cacheHelper == nullptr) {
@@ -121,7 +119,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -148,26 +146,24 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepOne_Pool_Locator)
createPooledRegion(regionNames[2], NO_ACK, locatorsG, "__TESTPOOL1_", true);
// create subregion
- RegionPtr regptr = getHelper()->getRegion(regionNames[2]);
- RegionAttributesPtr lattribPtr = regptr->getAttributes();
- RegionPtr subregPtr1 = regptr->createSubregion(regionNames[3], lattribPtr);
- RegionPtr subregPtr2 = regptr->createSubregion(regionNames[4], lattribPtr);
-
- LOGINFO(
- "NIL: CLIENT1 StepOne_Pool_Locator subregions created successfully");
-
- // Attache Listener
- RegionPtr regionPtr0 = getHelper()->getRegion(regionNames[0]);
- AttributesMutatorPtr attrMutatorPtr = regionPtr0->getAttributesMutator();
- eventListener1 = std::make_shared<SimpleCacheListener>();
- attrMutatorPtr->setCacheListener(eventListener1);
-
- AttributesMutatorPtr subregAttrMutatorPtr =
- subregPtr1->getAttributesMutator();
- eventListener2 = std::make_shared<SimpleCacheListener>();
- subregAttrMutatorPtr->setCacheListener(eventListener2);
-
- LOG("StepOne_Pool complete.");
+ auto regptr = getHelper()->getRegion(regionNames[2]);
+ std::shared_ptr<RegionAttributes> lattribPtr = regptr->getAttributes();
+ auto subregPtr1 = regptr->createSubregion(regionNames[3], lattribPtr);
+ auto subregPtr2 = regptr->createSubregion(regionNames[4], lattribPtr);
+
+ LOGINFO("NIL: CLIENT1 StepOne_Pool_Locator subregions created successfully");
+
+ // Attache Listener
+ auto regionPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto attrMutatorPtr = regionPtr0->getAttributesMutator();
+ eventListener1 = std::make_shared<SimpleCacheListener>();
+ attrMutatorPtr->setCacheListener(eventListener1);
+
+ auto subregAttrMutatorPtr = subregPtr1->getAttributesMutator();
+ eventListener2 = std::make_shared<SimpleCacheListener>();
+ subregAttrMutatorPtr->setCacheListener(eventListener2);
+
+ LOG("StepOne_Pool complete.");
}
END_TASK_DEFINITION
@@ -180,48 +176,48 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepTwo_Pool_Locator)
createPooledRegion(regionNames[2], NO_ACK, locatorsG, "__TESTPOOL1_", true);
// create subregion
- RegionPtr regptr = getHelper()->getRegion(regionNames[2]);
- RegionAttributesPtr lattribPtr = regptr->getAttributes();
- RegionPtr subregPtr1 = regptr->createSubregion(regionNames[3], lattribPtr);
- RegionPtr subregPtr2 = regptr->createSubregion(regionNames[4], lattribPtr);
-
- LOGINFO(
- "NIL: CLIENT2 StepTwo_Pool_Locator:: subregions created successfully");
- LOG("StepTwo_Pool complete.");
+ auto regptr = getHelper()->getRegion(regionNames[2]);
+ std::shared_ptr<RegionAttributes> lattribPtr = regptr->getAttributes();
+ auto subregPtr1 = regptr->createSubregion(regionNames[3], lattribPtr);
+ auto subregPtr2 = regptr->createSubregion(regionNames[4], lattribPtr);
+
+ LOGINFO(
+ "NIL: CLIENT2 StepTwo_Pool_Locator:: subregions created successfully");
+ LOG("StepTwo_Pool complete.");
}
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, registerKeysOnRegion)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- // RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ //auto regPtr1 = getHelper()->getRegion(regionNames[1]);
/*regPtr0->registerRegex(testregex[0]);
regPtr1->registerRegex(testregex[1]);*/
- // NIL
- VectorOfCacheableKey keys;
- keys.push_back(CacheableString::create("Key-1"));
- keys.push_back(CacheableString::create("Key-2"));
- regPtr0->registerKeys(keys, false);
- LOGINFO("NIL CLIENT-1 registerAllKeys() done ");
+ // NIL
+ std::vector<std::shared_ptr<CacheableKey>> keys;
+ keys.push_back(CacheableString::create("Key-1"));
+ keys.push_back(CacheableString::create("Key-2"));
+ regPtr0->registerKeys(keys, false);
+ LOGINFO("NIL CLIENT-1 registerAllKeys() done ");
- regPtr0->localDestroyRegion();
- LOGINFO("NIL CLIENT-1 localDestroyRegion() done");
- LOG("StepThree complete.");
+ regPtr0->localDestroyRegion();
+ LOGINFO("NIL CLIENT-1 localDestroyRegion() done");
+ LOG("StepThree complete.");
}
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, putOps)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
for (int index = 0; index < 5; index++) {
char key[100] = {0};
char value[100] = {0};
ACE_OS::sprintf(key, "Key-%d", index);
ACE_OS::sprintf(value, "Value-%d", index);
- CacheableKeyPtr keyptr = CacheableKey::create(key);
- CacheablePtr valuePtr = CacheableString::create(value);
+ auto keyptr = CacheableKey::create(key);
+ auto valuePtr = CacheableString::create(value);
regPtr0->put(keyptr, valuePtr);
}
LOG("StepFour complete.");
@@ -230,7 +226,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
regPtr0->registerAllKeys();
LOGINFO("NIL CLIENT-1 registerAllKeys() done ");
@@ -243,15 +239,15 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, StepFour)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
for (int index = 0; index < 5; index++) {
char key[100] = {0};
char value[100] = {0};
ACE_OS::sprintf(key, "Key-%d", index);
ACE_OS::sprintf(value, "Value-%d", index);
- CacheableKeyPtr keyptr = CacheableKey::create(key);
- CacheablePtr valuePtr = CacheableString::create(value);
+ auto keyptr = CacheableKey::create(key);
+ auto valuePtr = CacheableString::create(value);
regPtr0->put(keyptr, valuePtr);
}
LOG("StepFour complete.");
@@ -278,8 +274,8 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepFive)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
regPtr0->registerRegex(testregex[0]);
regPtr1->registerRegex(testregex[1]);
LOGINFO("NIL CLIENT-1 registerRegex() done ");
@@ -292,16 +288,16 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, StepSix)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
for (int index = 0; index < 5; index++) {
char key[100] = {0};
char value[100] = {0};
ACE_OS::sprintf(key, "Key-%d", index);
ACE_OS::sprintf(value, "Value-%d", index);
- CacheableKeyPtr keyptr = CacheableKey::create(key);
- CacheablePtr valuePtr = CacheableString::create(value);
+ auto keyptr = CacheableKey::create(key);
+ auto valuePtr = CacheableString::create(value);
regPtr0->put(keyptr, valuePtr);
regPtr1->put(keyptr, valuePtr);
}
@@ -312,88 +308,88 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, VerifyOps)
{
// regPtr0 is destroyed
- // RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ //auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
- CacheableKeyPtr keyptr = CacheableKey::create("Key-2");
+ auto keyptr = CacheableKey::create("Key-2");
- // regPtr0 is destroyed
- // ASSERT( !regPtr0->containsKey( keyptr ), "Key must not found in region0."
- // );
+ // regPtr0 is destroyed
+ // ASSERT( !regPtr0->containsKey( keyptr ), "Key must not found in region0."
+ // );
- ASSERT(regPtr1->containsKey(keyptr), "Key must found in region1.");
+ ASSERT(regPtr1->containsKey(keyptr), "Key must found in region1.");
}
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepSeven)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
- RegionPtr regPtr2 = getHelper()->getRegion(regionNames[2]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr2 = getHelper()->getRegion(regionNames[2]);
- RegionPtr subregPtr0 = regPtr2->getSubregion(regionNames[3]);
- RegionPtr subregPtr1 = regPtr2->getSubregion(regionNames[4]);
+ auto subregPtr0 = regPtr2->getSubregion(regionNames[3]);
+ auto subregPtr1 = regPtr2->getSubregion(regionNames[4]);
- // 1. registerAllKeys on parent and both subregions
- regPtr2->registerAllKeys();
- subregPtr0->registerAllKeys();
- subregPtr1->registerAllKeys();
+ // 1. registerAllKeys on parent and both subregions
+ regPtr2->registerAllKeys();
+ subregPtr0->registerAllKeys();
+ subregPtr1->registerAllKeys();
- LOGINFO("NIL CLIENT-1 StepSeven :: registerAllKeys() done ");
+ LOGINFO("NIL CLIENT-1 StepSeven :: registerAllKeys() done ");
- // 2. Now locally destroy SubRegion1
- subregPtr0->localDestroyRegion();
- LOGINFO("NIL CLIENT-1 SubRegion1 locally destroyed successfully");
+ // 2. Now locally destroy SubRegion1
+ subregPtr0->localDestroyRegion();
+ LOGINFO("NIL CLIENT-1 SubRegion1 locally destroyed successfully");
- LOG("NIL: Client-1 StepSeven complete.");
+ LOG("NIL: Client-1 StepSeven complete.");
- /*
- regPtr0->registerRegex(testregex[0]);
- regPtr1->registerRegex(testregex[1]);
- LOGINFO("NIL CLIENT-1 registerRegex() done ");
- */
+ /*
+ regPtr0->registerRegex(testregex[0]);
+ regPtr1->registerRegex(testregex[1]);
+ LOGINFO("NIL CLIENT-1 registerRegex() done ");
+ */
}
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, StepEight)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
- RegionPtr regPtr2 = getHelper()->getRegion(regionNames[2]);
-
- RegionPtr subregPtr0 = regPtr2->getSubregion(regionNames[3]);
- RegionPtr subregPtr1 = regPtr2->getSubregion(regionNames[4]);
-
- for (int index = 0; index < 5; index++) {
- char key[100] = {0};
- char value[100] = {0};
- ACE_OS::sprintf(key, "Key-%d", index);
- ACE_OS::sprintf(value, "Value-%d", index);
- CacheableKeyPtr keyptr = CacheableKey::create(key);
- CacheablePtr valuePtr = CacheableString::create(value);
- regPtr2->put(keyptr, valuePtr);
- subregPtr0->put(keyptr, valuePtr);
- subregPtr1->put(keyptr, valuePtr);
- }
-
- LOG("NIL : Client-2 StepSix complete.");
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr2 = getHelper()->getRegion(regionNames[2]);
+
+ auto subregPtr0 = regPtr2->getSubregion(regionNames[3]);
+ auto subregPtr1 = regPtr2->getSubregion(regionNames[4]);
+
+ for (int index = 0; index < 5; index++) {
+ char key[100] = {0};
+ char value[100] = {0};
+ ACE_OS::sprintf(key, "Key-%d", index);
+ ACE_OS::sprintf(value, "Value-%d", index);
+ auto keyptr = CacheableKey::create(key);
+ auto valuePtr = CacheableString::create(value);
+ regPtr2->put(keyptr, valuePtr);
+ subregPtr0->put(keyptr, valuePtr);
+ subregPtr1->put(keyptr, valuePtr);
+ }
+
+ LOG("NIL : Client-2 StepSix complete.");
}
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, VerifySubRegionOps)
{
- RegionPtr regPtr2 = getHelper()->getRegion(regionNames[2]);
+ auto regPtr2 = getHelper()->getRegion(regionNames[2]);
// locally destroyed
- // RegionPtr subregPtr0 = regPtr2->getSubregion( regionNames[3] );
- RegionPtr subregPtr1 = regPtr2->getSubregion(regionNames[4]);
+ //auto subregPtr0 = regPtr2->getSubregion( regionNames[3] );
+ auto subregPtr1 = regPtr2->getSubregion(regionNames[4]);
for (int index = 0; index < 5; index++) {
char key[100] = {0};
char value[100] = {0};
ACE_OS::sprintf(key, "Key-%d", index);
ACE_OS::sprintf(value, "Value-%d", index);
- CacheableKeyPtr keyptr = CacheableKey::create(key);
- CacheablePtr valuePtr = CacheableString::create(value);
+ auto keyptr = CacheableKey::create(key);
+ auto valuePtr = CacheableString::create(value);
ASSERT(regPtr2->containsKey(keyptr), "Key must found in region1.");
ASSERT(subregPtr1->containsKey(keyptr), "Key must found in region1.");
diff --git a/cppcache/integration-test/ThinClientRegex.hpp b/cppcache/integration-test/ThinClientRegex.hpp
index 248dd04..0114909 100644
--- a/cppcache/integration-test/ThinClientRegex.hpp
+++ b/cppcache/integration-test/ThinClientRegex.hpp
@@ -20,7 +20,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <string>
@@ -83,10 +82,10 @@ void _verifyEntry(const char* name, const char* key, const char* val,
}
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
// if the region is no ack, then we may need to wait...
if (!isCreated) {
@@ -201,7 +200,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -214,13 +213,13 @@ void createEntry(const char* name, const char* key,
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
if (value == nullptr) {
value = "";
}
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -242,10 +241,10 @@ void updateEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -267,9 +266,9 @@ void doNetsearch(const char* name, const char* key, const char* value) {
key, value, name);
fflush(stdout);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "netsearch region %s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -327,8 +326,8 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, RegisterClient1Regex)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
regPtr0->registerRegex(testregex[0]);
regPtr1->registerRegex(testregex[1]);
LOG("RegisterClient1Regex complete.");
@@ -337,8 +336,8 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, RegisterClient2Regex)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
regPtr0->registerRegex(testregex[2]);
regPtr1->registerRegex(testregex[3]);
LOG("RegisterClient2Regex complete.");
@@ -360,7 +359,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, CreateAndVerifyClient2Entries)
verifyEntry(regionNames[0], keys[2], vals[2]);
verifyEntry(regionNames[1], keys[3], vals[3]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
regPtr1->unregisterRegex(testregex[3]);
LOG("CreateAndVerifyClient2Entries complete.");
@@ -374,7 +373,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, VerifyAndUpdateClient1Entries)
updateEntry(regionNames[0], keys[2], nvals[2]);
updateEntry(regionNames[1], keys[3], nvals[3]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
regPtr1->unregisterRegex(testregex[1]);
LOG("VerifyAndUpdateClient1Entries complete.");
diff --git a/cppcache/integration-test/ThinClientRegex2.hpp b/cppcache/integration-test/ThinClientRegex2.hpp
index 817c729..b78616c 100644
--- a/cppcache/integration-test/ThinClientRegex2.hpp
+++ b/cppcache/integration-test/ThinClientRegex2.hpp
@@ -20,7 +20,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <string>
@@ -84,10 +83,10 @@ void _verifyEntry(const char* name, const char* key, const char* val,
}
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
// if the region is no ack, then we may need to wait...
if (!isCreated) {
@@ -200,8 +199,8 @@ void createRegion(const char* name, bool ackMode,
LOG("createRegion() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
- clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
+ clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -212,7 +211,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -225,13 +224,13 @@ void createEntry(const char* name, const char* key,
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
if (value == nullptr) {
value = "";
}
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -253,10 +252,10 @@ void updateEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -278,9 +277,9 @@ void doNetsearch(const char* name, const char* key, const char* value) {
key, value, name);
fflush(stdout);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "netsearch region %s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -349,7 +348,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
regPtr0->registerRegex(regex23);
LOG("StepThree complete.");
}
@@ -357,7 +356,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, StepFour)
{
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
regPtr1->registerRegex(regexWildcard);
LOG("StepFour complete.");
}
diff --git a/cppcache/integration-test/ThinClientRegex3.hpp b/cppcache/integration-test/ThinClientRegex3.hpp
index 3028cd8..40ae6e2 100644
--- a/cppcache/integration-test/ThinClientRegex3.hpp
+++ b/cppcache/integration-test/ThinClientRegex3.hpp
@@ -20,7 +20,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <string>
@@ -84,10 +83,10 @@ void _verifyEntry(const char* name, const char* key, const char* val,
}
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
// if the region is no ack, then we may need to wait...
if (!isCreated) {
@@ -200,8 +199,8 @@ void createRegion(const char* name, bool ackMode, const char* endpoints,
LOG("createRegion() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr = getHelper()->createRegion(
- name, ackMode, true, nullptr, endpoints, clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
+ endpoints, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -212,7 +211,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -225,13 +224,13 @@ void createEntry(const char* name, const char* key,
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
if (value == nullptr) {
value = "";
}
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -253,10 +252,10 @@ void updateEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -278,9 +277,9 @@ void doNetsearch(const char* name, const char* key, const char* value) {
key, value, name);
fflush(stdout);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "netsearch region %s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -338,8 +337,8 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, RegisterMalformedRegex)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
try {
LOG("Registering regex: a*");
@@ -359,8 +358,8 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, RegisterEmptyNullAndNonExistentRegex)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
try {
LOG("Registering empty regex");
diff --git a/cppcache/integration-test/ThinClientRemoveAll.hpp b/cppcache/integration-test/ThinClientRemoveAll.hpp
index 0205cf9..a1376e9 100644
--- a/cppcache/integration-test/ThinClientRemoveAll.hpp
+++ b/cppcache/integration-test/ThinClientRemoveAll.hpp
@@ -20,8 +20,10 @@
* limitations under the License.
*/
+#define ROOT_NAME "ThinClientRemoveAll"
+#define ROOT_SCOPE DISTRIBUTED_ACK
+
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include "testobject/PdxType.hpp"
@@ -32,8 +34,6 @@
#include <Utils.hpp>
#include <geode/statistics/StatisticsFactory.hpp>
-#define ROOT_NAME "ThinClientRemoveAll"
-#define ROOT_SCOPE DISTRIBUTED_ACK
#include "CacheHelper.hpp"
using namespace apache::geode::client;
@@ -88,8 +88,8 @@ void createRegion(const char* name, bool ackMode, const char* endpoints,
LOG("createRegion() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr = getHelper()->createRegion(
- name, ackMode, isCacheEnabled, nullptr, clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, isCacheEnabled,
+ nullptr, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -100,7 +100,7 @@ void createRegionLocal(const char* name, bool ackMode, const char* endpoints,
LOG("createRegion() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr = getHelper()->createRegion(
+ auto regPtr = getHelper()->createRegion(
name, ackMode, isCacheEnabled, nullptr, clientNotificationEnabled, true);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
@@ -113,7 +113,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -127,7 +127,7 @@ void createPooledRegionConcurrencyCheckDisabled(
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr = getHelper()->createPooledRegionConcurrencyCheckDisabled(
+ auto regPtr = getHelper()->createPooledRegionConcurrencyCheckDisabled(
name, ackMode, locators, poolname, cachingEnable,
clientNotificationEnabled, concurrencyCheckEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -192,8 +192,8 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, removeAllValidation)
{
char key[2048];
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- VectorOfCacheableKey removeallkeys;
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ std::vector<std::shared_ptr<CacheableKey>> removeallkeys;
try {
regPtr0->removeAll(removeallkeys);
FAIL("Did not get expected IllegalArgumentException exception");
@@ -244,8 +244,8 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, removeAllValidationLocal)
{
char key[2048];
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- VectorOfCacheableKey removeallkeys;
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ std::vector<std::shared_ptr<CacheableKey>> removeallkeys;
try {
regPtr0->removeAll(removeallkeys);
FAIL("Did not get expected IllegalArgumentException exception");
@@ -307,11 +307,11 @@ DUNIT_TASK_DEFINITION(CLIENT1, removeAllOps)
CacheableString::create(value));
}
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
regPtr0->putAll(entryMap);
LOG("putAll1 complete");
- VectorOfCacheableKey removeallkeys;
+ std::vector<std::shared_ptr<CacheableKey>> removeallkeys;
for (int32_t item = 0; item < 1; item++) {
sprintf(key, "key-%d", item);
removeallkeys.push_back(CacheableKey::create(key));
@@ -336,11 +336,11 @@ DUNIT_TASK_DEFINITION(CLIENT1, removeAllSequence)
entryMap.emplace(CacheableKey::create(3), CacheableInt32::create(3));
entryMap.emplace(CacheableKey::create(4), CacheableInt32::create(4));
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
regPtr0->putAll(entryMap);
LOG("putAll1 complete");
- VectorOfCacheableKey removeallkeys;
+ std::vector<std::shared_ptr<CacheableKey>> removeallkeys;
removeallkeys.push_back(CacheableKey::create(1));
removeallkeys.push_back(CacheableKey::create(2));
removeallkeys.push_back(CacheableKey::create(3));
@@ -381,11 +381,11 @@ DUNIT_TASK_DEFINITION(CLIENT1, removeAllOpsLocal)
CacheableString::create(value));
}
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
regPtr0->putAll(entryMap);
LOG("putAll1 complete");
- VectorOfCacheableKey removeallkeys;
+ std::vector<std::shared_ptr<CacheableKey>> removeallkeys;
for (int32_t item = 0; item < 1; item++) {
sprintf(key, "key-%d", item);
removeallkeys.push_back(CacheableKey::create(key));
diff --git a/cppcache/integration-test/ThinClientSSL.hpp b/cppcache/integration-test/ThinClientSSL.hpp
index c52b4ec..01dbc19 100644
--- a/cppcache/integration-test/ThinClientSSL.hpp
+++ b/cppcache/integration-test/ThinClientSSL.hpp
@@ -21,7 +21,6 @@
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <string>
@@ -47,7 +46,7 @@ const char* locatorsG =
#include "LocatorHelper.hpp"
void initClient(const bool isthinClient) {
if (cacheHelper == nullptr) {
- PropertiesPtr props = Properties::create();
+ auto props = Properties::create();
props->insert("ssl-enabled", "true");
std::string keystore = std::string(ACE_OS::getenv("TESTSRC")) + "/keystore";
std::string pubkey = keystore + "/client_truststore.pem";
@@ -89,10 +88,10 @@ void _verifyEntry(const char* name, const char* key, const char* val,
LOG(buf);
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
LOG("Before contains key");
// if the region is no ack, then we may need to wait...
@@ -185,7 +184,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -198,10 +197,10 @@ void createEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -223,10 +222,10 @@ void updateEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -248,9 +247,9 @@ void doNetsearch(const char* name, const char* key, const char* value) {
key, value, name);
fflush(stdout);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "netsearch region %s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -259,7 +258,7 @@ void doNetsearch(const char* name, const char* key, const char* value) {
ASSERT(!regPtr->containsValueForKey(keyPtr),
"Value should not have been found in region.");
- CacheablePtr theValue = regPtr->get(keyPtr);
+ auto theValue = regPtr->get(keyPtr);
auto checkPtr = std::dynamic_pointer_cast<CacheableString>(
theValue); // force a netsearch
@@ -281,9 +280,9 @@ void invalidateEntry(const char* name, const char* key) {
fprintf(stdout, "Invalidating entry -- key: %s in region %s\n", key, name);
fflush(stdout);
// Invalidate entry, verify entry is invalidated
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -302,9 +301,9 @@ void destroyEntry(const char* name, const char* key) {
fprintf(stdout, "Destroying entry -- key: %s in region %s\n", key, name);
fflush(stdout);
// Destroy entry, verify entry is destroyed
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -318,7 +317,7 @@ void destroyEntry(const char* name, const char* key) {
void destroyRegion(const char* name) {
LOG("destroyRegion() entered.");
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
regPtr->localDestroyRegion();
LOG("Region destroyed.");
}
@@ -353,7 +352,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateRegions1_PoolLocators)
createPooledRegion(regionNames[0], USE_ACK, locatorsG, "__TESTPOOL1_",
true);
createPooledRegion(regionNames[1], NO_ACK, locatorsG, "__TESTPOOL1_", true);
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
regPtr->registerAllKeys(false, false, false);
regPtr = getHelper()->getRegion(regionNames[1]);
regPtr->registerAllKeys(false, false, false);
@@ -366,7 +365,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, CreateRegions2_PoolLocators)
createPooledRegion(regionNames[0], USE_ACK, locatorsG, "__TESTPOOL1_",
true);
createPooledRegion(regionNames[1], NO_ACK, locatorsG, "__TESTPOOL1_", true);
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
regPtr->registerAllKeys(false, false, false);
regPtr = getHelper()->getRegion(regionNames[1]);
regPtr->registerAllKeys(false, false, false);
diff --git a/cppcache/integration-test/ThinClientSSLWithPassword.hpp b/cppcache/integration-test/ThinClientSSLWithPassword.hpp
index ac74c6c..22297cc 100644
--- a/cppcache/integration-test/ThinClientSSLWithPassword.hpp
+++ b/cppcache/integration-test/ThinClientSSLWithPassword.hpp
@@ -21,7 +21,6 @@
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <string>
@@ -47,7 +46,7 @@ const char* locatorsG =
#include "LocatorHelper.hpp"
void initClient(const bool isthinClient) {
if (cacheHelper == nullptr) {
- PropertiesPtr props = Properties::create();
+ auto props = Properties::create();
props->insert("ssl-enabled", "true");
std::string keystore = std::string(ACE_OS::getenv("TESTSRC")) + "/keystore";
std::string pubkey = keystore + "/client_truststore.pem";
@@ -91,10 +90,10 @@ void _verifyEntry(const char* name, const char* key, const char* val,
LOG(buf);
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
LOG("Before contains key");
// if the region is no ack, then we may need to wait...
@@ -186,8 +185,8 @@ void createRegion(const char* name, bool ackMode, const char* endpoints,
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
// ack, caching
- RegionPtr regPtr = getHelper()->createRegion(
- name, ackMode, true, nullptr, endpoints, clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
+ endpoints, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -199,7 +198,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -212,10 +211,10 @@ void createEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -237,10 +236,10 @@ void updateEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -262,9 +261,9 @@ void doNetsearch(const char* name, const char* key, const char* value) {
key, value, name);
fflush(stdout);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "netsearch region %s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -273,7 +272,7 @@ void doNetsearch(const char* name, const char* key, const char* value) {
ASSERT(!regPtr->containsValueForKey(keyPtr),
"Value should not have been found in region.");
- CacheablePtr theValue = regPtr->get(keyPtr);
+ auto theValue = regPtr->get(keyPtr);
auto checkPtr = std::dynamic_pointer_cast<CacheableString>(
theValue); // force a netsearch
@@ -295,9 +294,9 @@ void invalidateEntry(const char* name, const char* key) {
fprintf(stdout, "Invalidating entry -- key: %s in region %s\n", key, name);
fflush(stdout);
// Invalidate entry, verify entry is invalidated
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -316,9 +315,9 @@ void destroyEntry(const char* name, const char* key) {
fprintf(stdout, "Destroying entry -- key: %s in region %s\n", key, name);
fflush(stdout);
// Destroy entry, verify entry is destroyed
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -332,7 +331,7 @@ void destroyEntry(const char* name, const char* key) {
void destroyRegion(const char* name) {
LOG("destroyRegion() entered.");
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
regPtr->localDestroyRegion();
LOG("Region destroyed.");
}
@@ -367,7 +366,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateRegions1_PoolLocators)
createPooledRegion(regionNames[0], USE_ACK, locatorsG, "__TESTPOOL1_",
true);
createPooledRegion(regionNames[1], NO_ACK, locatorsG, "__TESTPOOL1_", true);
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
regPtr->registerAllKeys(false, false, false);
regPtr = getHelper()->getRegion(regionNames[1]);
regPtr->registerAllKeys(false, false, false);
@@ -380,7 +379,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, CreateRegions2_PoolLocators)
createPooledRegion(regionNames[0], USE_ACK, locatorsG, "__TESTPOOL1_",
true);
createPooledRegion(regionNames[1], NO_ACK, locatorsG, "__TESTPOOL1_", true);
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
regPtr->registerAllKeys(false, false, false);
regPtr = getHelper()->getRegion(regionNames[1]);
regPtr->registerAllKeys(false, false, false);
diff --git a/cppcache/integration-test/ThinClientSecurity.hpp b/cppcache/integration-test/ThinClientSecurity.hpp
index 64cfc5b..ac93f7c 100644
--- a/cppcache/integration-test/ThinClientSecurity.hpp
+++ b/cppcache/integration-test/ThinClientSecurity.hpp
@@ -37,20 +37,20 @@ static int numberOfLocators = 1;
const char* locatorsG =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, numberOfLocators);
-void setCacheListener(const char* regName, const CacheListenerPtr& listener) {
+void setCacheListener(const char* regName,
+ const std::shared_ptr<CacheListener>& listener) {
if (listener != nullptr) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheListener(listener);
}
}
-void createRegionForSecurity(const char* name, bool ackMode,
- bool clientNotificationEnabled = false,
- const CacheListenerPtr& listener = nullptr,
- bool caching = true, int connections = -1,
- bool isMultiuserMode = false,
- int subscriptionRedundancy = -1) {
+void createRegionForSecurity(
+ const char* name, bool ackMode, bool clientNotificationEnabled = false,
+ const std::shared_ptr<CacheListener>& listener = nullptr,
+ bool caching = true, int connections = -1, bool isMultiuserMode = false,
+ int subscriptionRedundancy = -1) {
char msg[128] = {'\0'};
LOG(msg);
LOG(" pool is creating");
@@ -69,14 +69,12 @@ void createRegionForSecurity(const char* name, bool ackMode,
createRegionAndAttachPool(name, ackMode, poolName, caching);
setCacheListener(name, listener);
}
-
-PoolPtr getPool(const char* name) {
+std::shared_ptr<Pool> getPool(const char* name) {
return getHelper()->getCache()->getPoolManager().find(name);
}
-
-RegionServicePtr getVirtualCache(PropertiesPtr creds, PoolPtr pool) {
- CachePtr cachePtr = getHelper()->getCache();
- return cachePtr->createAuthenticatedView(creds, pool->getName());
-}
+ std::shared_ptr<RegionService> getVirtualCache(std::shared_ptr<Properties> creds, std::shared_ptr<Pool> pool) {
+ auto cachePtr = getHelper()->getCache();
+ return cachePtr->createAuthenticatedView(creds, pool->getName());
+ }
#endif // GEODE_INTEGRATION_TEST_THINCLIENTSECURITY_H_
diff --git a/cppcache/integration-test/ThinClientSecurityHelper.hpp b/cppcache/integration-test/ThinClientSecurityHelper.hpp
index f4570f0..72cdfe3 100644
--- a/cppcache/integration-test/ThinClientSecurityHelper.hpp
+++ b/cppcache/integration-test/ThinClientSecurityHelper.hpp
@@ -20,7 +20,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include "ThinClientHelper.hpp"
#include "ace/Process.h"
@@ -33,8 +32,7 @@ const char* locHostPort =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, 1);
const char* regionNamesAuth[] = {"DistRegionAck"};
-
-CredentialGeneratorPtr credentialGeneratorHandler;
+std::shared_ptr<CredentialGenerator> credentialGeneratorHandler;
std::string getXmlPath() {
char xmlPath[1000] = {'\0'};
@@ -111,44 +109,44 @@ opCodeList::value_type tmpAArr[] = {OP_CREATE, OP_UPDATE,
#define TYPE_USER_CLIENT 'U'
void initClientAuth(char UserType) {
- PropertiesPtr config = Properties::create();
- opCodeList wr(tmpWArr, tmpWArr + sizeof tmpWArr / sizeof *tmpWArr);
- opCodeList rt(tmpRArr, tmpRArr + sizeof tmpRArr / sizeof *tmpRArr);
- opCodeList ad(tmpAArr, tmpAArr + sizeof tmpAArr / sizeof *tmpAArr);
- credentialGeneratorHandler->getAuthInit(config);
- switch (UserType) {
- case 'W':
- credentialGeneratorHandler->getAllowedCredentialsForOps(wr, config,
- nullptr);
- printf("User is %s Pass is %s ",
- config->find("security-username")->asChar(),
- (config->find("security-password") != nullptr
- ? config->find("security-password")->asChar()
- : " not set"));
- break;
- case 'R':
- credentialGeneratorHandler->getAllowedCredentialsForOps(rt, config,
- nullptr);
- printf("User is %s Pass is %s ",
- config->find("security-username")->asChar(),
- (config->find("security-password") != nullptr
- ? config->find("security-password")->asChar()
- : " not set"));
- break;
- case 'A':
- credentialGeneratorHandler->getAllowedCredentialsForOps(ad, config,
- nullptr);
- printf("User is %s Pass is %s ",
- config->find("security-username")->asChar(),
- (config->find("security-password") != nullptr
- ? config->find("security-password")->asChar()
- : " not set"));
- default:
- break;
- }
+ auto config = Properties::create();
+ opCodeList wr(tmpWArr, tmpWArr + sizeof tmpWArr / sizeof *tmpWArr);
+ opCodeList rt(tmpRArr, tmpRArr + sizeof tmpRArr / sizeof *tmpRArr);
+ opCodeList ad(tmpAArr, tmpAArr + sizeof tmpAArr / sizeof *tmpAArr);
+ credentialGeneratorHandler->getAuthInit(config);
+ switch (UserType) {
+ case 'W':
+ credentialGeneratorHandler->getAllowedCredentialsForOps(wr, config,
+ nullptr);
+ printf("User is %s Pass is %s ",
+ config->find("security-username")->asChar(),
+ (config->find("security-password") != nullptr
+ ? config->find("security-password")->asChar()
+ : " not set"));
+ break;
+ case 'R':
+ credentialGeneratorHandler->getAllowedCredentialsForOps(rt, config,
+ nullptr);
+ printf("User is %s Pass is %s ",
+ config->find("security-username")->asChar(),
+ (config->find("security-password") != nullptr
+ ? config->find("security-password")->asChar()
+ : " not set"));
+ break;
+ case 'A':
+ credentialGeneratorHandler->getAllowedCredentialsForOps(ad, config,
+ nullptr);
+ printf("User is %s Pass is %s ",
+ config->find("security-username")->asChar(),
+ (config->find("security-password") != nullptr
+ ? config->find("security-password")->asChar()
+ : " not set"));
+ default:
+ break;
+ }
- try {
- initClient(true, config);
+ try {
+ initClient(true, config);
} catch (...) {
throw;
}
@@ -159,7 +157,7 @@ void initClientAuth(char UserType) {
class putThread : public ACE_Task_Base {
public:
- putThread(RegionPtr r, bool regInt = false, int waitTime = 0) {
+ putThread(std::shared_ptr<Region> r, bool regInt = false, int waitTime = 0) {
m_reg = r;
m_regInt = regInt;
m_numthreads = 1;
@@ -196,9 +194,9 @@ class putThread : public ACE_Task_Base {
int ops = 0;
int32_t pid = ACE_OS::getpid();
ACE_thread_t thr_id = ACE_OS::thr_self();
- CacheableKeyPtr key;
- CacheableStringPtr value;
- VectorOfCacheableKey keys0;
+ std::shared_ptr<CacheableKey> key;
+ std::shared_ptr<CacheableString> value;
+ std::vector<std::shared_ptr<CacheableKey>> keys0;
char buf[20];
char valbuf[20];
if (m_regInt) {
@@ -216,10 +214,10 @@ class putThread : public ACE_Task_Base {
key = CacheableKey::create(buf);
if (m_opcode == 0) {
if (m_isCallBack) {
- CacheableBooleanPtr boolptr = CacheableBoolean::create("true");
- sprintf(valbuf, "client1-value%d", ops);
- value = CacheableString::create(valbuf);
- m_reg->put(key, value, boolptr);
+ auto boolptr = CacheableBoolean::create("true");
+ sprintf(valbuf, "client1-value%d", ops);
+ value = CacheableString::create(valbuf);
+ m_reg->put(key, value, boolptr);
} else {
sprintf(valbuf, "client2-value%d", ops);
value = CacheableString::create(valbuf);
@@ -237,8 +235,8 @@ class putThread : public ACE_Task_Base {
} else {
try {
if (m_isCallBack) {
- CacheableBooleanPtr boolptr = CacheableBoolean::create("true");
- m_reg->destroy(key, boolptr);
+ auto boolptr = CacheableBoolean::create("true");
+ m_reg->destroy(key, boolptr);
} else {
m_reg->destroy(key);
}
@@ -251,7 +249,7 @@ class putThread : public ACE_Task_Base {
return 0;
}
- RegionPtr m_reg;
+ std::shared_ptr<Region> m_reg;
bool m_run;
int m_opcode;
int m_numops;
diff --git a/cppcache/integration-test/ThinClientTXFailover.hpp b/cppcache/integration-test/ThinClientTXFailover.hpp
index 35dc0ad..83fd1a7 100644
--- a/cppcache/integration-test/ThinClientTXFailover.hpp
+++ b/cppcache/integration-test/ThinClientTXFailover.hpp
@@ -21,7 +21,6 @@
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/High_Res_Timer.h>
#include <ace/OS.h>
@@ -84,10 +83,10 @@ void _verifyEntry(const char* name, const char* key, const char* val,
LOG(buf);
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
if (noKey == false) { // need to find the key!
ASSERT(regPtr->containsKey(keyPtr), "Key not found in region.");
@@ -155,8 +154,8 @@ void createRegion(const char* name, bool ackMode, const char* endpoints,
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
// ack, caching
- RegionPtr regPtr = getHelper()->createRegion(
- name, ackMode, true, nullptr, endpoints, clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
+ endpoints, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -167,7 +166,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -181,7 +180,7 @@ void createPooledRegionSticky(const char* name, bool ackMode,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr = getHelper()->createPooledRegionSticky(
+ auto regPtr = getHelper()->createPooledRegionSticky(
name, ackMode, locators, poolname, cachingEnable,
clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -194,10 +193,10 @@ void createEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
// ASSERT( !regPtr->containsKey( keyPtr ), "Key should not have been found in
@@ -219,10 +218,10 @@ void updateEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
// ASSERT( regPtr->containsKeyOnServer( keyPtr ), "Key should have been found
@@ -245,9 +244,9 @@ void doNetsearch(const char* name, const char* key, const char* value) {
key, value, name);
fflush(stdout);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "netsearch region %s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
diff --git a/cppcache/integration-test/ThinClientTransactions.hpp b/cppcache/integration-test/ThinClientTransactions.hpp
index 82562df..c8dc6aa 100644
--- a/cppcache/integration-test/ThinClientTransactions.hpp
+++ b/cppcache/integration-test/ThinClientTransactions.hpp
@@ -21,7 +21,6 @@
#define GEODE_INTEGRATION_TEST_THINCLIENTTRANSACTIONS_H_
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/Auto_Event.h>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
@@ -62,7 +61,7 @@ END_TASK_DEFINITION
void initClient(const bool isthinClient) {
if (cacheHelper == nullptr) {
- PropertiesPtr config = Properties::create();
+ auto config = Properties::create();
if (g_isGridClient) {
config->insert("grid-client", "true");
}
@@ -103,10 +102,10 @@ void _verifyEntry(const char* name, const char* key, const char* val,
LOG(buf);
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
// if the region is no ack, then we may need to wait...
if (noKey == false) { // need to find the key!
@@ -198,9 +197,8 @@ void createRegion(const char* name, bool ackMode, const char* endpoints,
LOG("createRegion() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
- getHelper()->createRegion(name, ackMode, cachingEnable, nullptr,
- endpoints, clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, cachingEnable, nullptr,
+ endpoints, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -211,7 +209,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -225,7 +223,7 @@ void createPooledRegionSticky(const char* name, bool ackMode,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr = getHelper()->createPooledRegionSticky(
+ auto regPtr = getHelper()->createPooledRegionSticky(
name, ackMode, locators, poolname, cachingEnable,
clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -238,10 +236,10 @@ void createEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -262,9 +260,9 @@ void createEntryTwice(const char* name, const char* key, const char* value) {
sprintf(message, "Creating entry -- key: %s value: %s in region %s\n", key,
value, name);
LOG(message);
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
+ auto regPtr = getHelper()->getRegion(name);
regPtr->create(keyPtr, valPtr);
try {
regPtr->create(keyPtr, valPtr);
@@ -285,10 +283,10 @@ void updateEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -309,9 +307,9 @@ void doGetAgain(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "get region name%s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -341,9 +339,9 @@ void doNetsearch(const char* name, const char* key, const char* value) {
fflush(stdout);
static int count = 0;
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "netsearch region %s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -393,7 +391,7 @@ const bool NO_ACK = false;
class SuspendTransactionThread : public ACE_Task_Base {
private:
- TransactionIdPtr m_suspendedTransaction;
+ std::shared_ptr<TransactionId> m_suspendedTransaction;
bool m_sleep;
ACE_Auto_Event* m_txEvent;
@@ -406,8 +404,7 @@ class SuspendTransactionThread : public ACE_Task_Base {
sprintf(buf, " In SuspendTransactionThread");
LOG(buf);
- CacheTransactionManagerPtr txManager =
- getHelper()->getCache()->getCacheTransactionManager();
+ auto txManager = getHelper()->getCache()->getCacheTransactionManager();
txManager->begin();
@@ -435,11 +432,13 @@ class SuspendTransactionThread : public ACE_Task_Base {
}
void start() { activate(); }
void stop() { wait(); }
- TransactionIdPtr getSuspendedTx() { return m_suspendedTransaction; }
+ std::shared_ptr<TransactionId> getSuspendedTx() {
+ return m_suspendedTransaction;
+ }
};
class ResumeTransactionThread : public ACE_Task_Base {
private:
- TransactionIdPtr m_suspendedTransaction;
+ std::shared_ptr<TransactionId> m_suspendedTransaction;
bool m_commit;
bool m_tryResumeWithSleep;
bool m_isFailed;
@@ -447,8 +446,9 @@ class ResumeTransactionThread : public ACE_Task_Base {
ACE_Auto_Event* m_txEvent;
public:
- ResumeTransactionThread(TransactionIdPtr suspendedTransaction, bool commit,
- bool tryResumeWithSleep, ACE_Auto_Event* txEvent)
+ ResumeTransactionThread(std::shared_ptr<TransactionId> suspendedTransaction,
+ bool commit, bool tryResumeWithSleep,
+ ACE_Auto_Event* txEvent)
: m_suspendedTransaction(suspendedTransaction),
m_commit(commit),
m_tryResumeWithSleep(tryResumeWithSleep),
@@ -460,15 +460,15 @@ class ResumeTransactionThread : public ACE_Task_Base {
sprintf(buf, "In ResumeTransactionThread");
LOG(buf);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
THREADERRORCHECK(regPtr0 != nullptr,
"In ResumeTransactionThread - Region not found.");
- CacheableKeyPtr keyPtr4 = createKey(keys[4]);
- CacheableKeyPtr keyPtr5 = createKey(keys[5]);
- CacheableKeyPtr keyPtr6 = createKey(keys[6]);
+ auto keyPtr4 = createKey(keys[4]);
+ auto keyPtr5 = createKey(keys[5]);
+ auto keyPtr6 = createKey(keys[6]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
THREADERRORCHECK(regPtr1 != nullptr,
"In ResumeTransactionThread - Region not found.");
@@ -480,8 +480,7 @@ class ResumeTransactionThread : public ACE_Task_Base {
"In ResumeTransactionThread - Key should not have been "
"found in region.");
- CacheTransactionManagerPtr txManager =
- getHelper()->getCache()->getCacheTransactionManager();
+ auto txManager = getHelper()->getCache()->getCacheTransactionManager();
if (m_tryResumeWithSleep) {
THREADERRORCHECK(!txManager->isSuspended(m_suspendedTransaction),
"In ResumeTransactionThread - the transaction should "
@@ -595,20 +594,19 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, SuspendResumeCommit)
{
- CacheTransactionManagerPtr txManager =
- getHelper()->getCache()->getCacheTransactionManager();
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto txManager = getHelper()->getCache()->getCacheTransactionManager();
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
ASSERT(regPtr0 != nullptr, "In SuspendResumeCommit - Region not found.");
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
ASSERT(regPtr1 != nullptr, "In SuspendResumeCommit - Region not found.");
- CacheableKeyPtr keyPtr4 = createKey(keys[4]);
- CacheableKeyPtr keyPtr5 = createKey(keys[5]);
- CacheableKeyPtr keyPtr6 = createKey(keys[6]);
+ auto keyPtr4 = createKey(keys[4]);
+ auto keyPtr5 = createKey(keys[5]);
+ auto keyPtr6 = createKey(keys[6]);
txManager->begin();
createEntry(regionNames[0], keys[4], vals[4]);
createEntry(regionNames[1], keys[5], vals[5]);
- TransactionIdPtr m_suspendedTransaction = txManager->suspend();
+ auto m_suspendedTransaction = txManager->suspend();
ASSERT(
!regPtr0->containsKeyOnServer(keyPtr4),
@@ -672,21 +670,20 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, SuspendTimeOut)
{
- CacheTransactionManagerPtr txManager =
- getHelper()->getCache()->getCacheTransactionManager();
- CacheableKeyPtr keyPtr4 = createKey(keys[4]);
- CacheableKeyPtr keyPtr5 = createKey(keys[5]);
+ auto txManager = getHelper()->getCache()->getCacheTransactionManager();
+ auto keyPtr4 = createKey(keys[4]);
+ auto keyPtr5 = createKey(keys[5]);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
ASSERT(regPtr0 != nullptr, "In SuspendTimeOut - Region not found.");
txManager->begin();
createEntry(regionNames[0], keys[4], vals[4]);
- TransactionIdPtr tid1 = txManager->suspend();
+ auto tid1 = txManager->suspend();
txManager->begin();
createEntry(regionNames[0], keys[5], vals[5]);
- TransactionIdPtr tid2 = txManager->suspend();
+ auto tid2 = txManager->suspend();
txManager->resume(tid1);
createEntry(regionNames[0], keys[6], vals[6]);
@@ -713,21 +710,20 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, SuspendResumeRollback)
{
- CacheTransactionManagerPtr txManager =
- getHelper()->getCache()->getCacheTransactionManager();
- CacheableKeyPtr keyPtr4 = createKey(keys[4]);
- CacheableKeyPtr keyPtr5 = createKey(keys[5]);
- CacheableKeyPtr keyPtr6 = createKey(keys[6]);
+ auto txManager = getHelper()->getCache()->getCacheTransactionManager();
+ auto keyPtr4 = createKey(keys[4]);
+ auto keyPtr5 = createKey(keys[5]);
+ auto keyPtr6 = createKey(keys[6]);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
ASSERT(regPtr0 != nullptr, "In SuspendResumeRollback - Region not found.");
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
ASSERT(regPtr1 != nullptr, "In SuspendResumeRollback - Region not found.");
txManager->begin();
createEntry(regionNames[0], keys[4], vals[4]);
createEntry(regionNames[1], keys[5], vals[5]);
- TransactionIdPtr m_suspendedTransaction = txManager->suspend();
+ auto m_suspendedTransaction = txManager->suspend();
ASSERT(
!regPtr0->containsKeyOnServer(keyPtr4),
@@ -957,8 +953,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, CreateClient1Entries)
{
- CacheTransactionManagerPtr txManager =
- getHelper()->getCache()->getCacheTransactionManager();
+ auto txManager = getHelper()->getCache()->getCacheTransactionManager();
txManager->begin();
createEntry(regionNames[0], keys[0], vals[0]);
createEntry(regionNames[1], keys[2], vals[2]);
@@ -971,8 +966,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, CreateClient2Entries)
{
doNetsearch(regionNames[0], keys[0], vals[0]);
doNetsearch(regionNames[1], keys[2], vals[2]);
- CacheTransactionManagerPtr txManager =
- getHelper()->getCache()->getCacheTransactionManager();
+ auto txManager = getHelper()->getCache()->getCacheTransactionManager();
txManager->begin();
createEntry(regionNames[0], keys[1], vals[1]);
createEntry(regionNames[1], keys[3], vals[3]);
@@ -984,8 +978,8 @@ DUNIT_TASK_DEFINITION(CLIENT2, CreateClient2Entries)
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, UpdateClient1Entries)
{
- RegionPtr reg0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr reg1 = getHelper()->getRegion(regionNames[1]);
+ auto reg0 = getHelper()->getRegion(regionNames[0]);
+ auto reg1 = getHelper()->getRegion(regionNames[1]);
auto vec0 = reg0->serverKeys();
auto vec1 = reg1->serverKeys();
ASSERT(vec0.size() == 2, "Should have 2 keys in first region.");
@@ -1018,8 +1012,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, UpdateClient2Entries)
{
doNetsearch(regionNames[0], keys[0], vals[0]);
doNetsearch(regionNames[1], keys[2], vals[2]);
- CacheTransactionManagerPtr txManager =
- getHelper()->getCache()->getCacheTransactionManager();
+ auto txManager = getHelper()->getCache()->getCacheTransactionManager();
txManager->begin();
updateEntry(regionNames[0], keys[1], nvals[1]);
updateEntry(regionNames[1], keys[3], nvals[3]);
@@ -1035,10 +1028,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateClient1KeyThriceWithoutSticky)
{
createPooledRegion(regionNames[2], NO_ACK, locatorsG, "__TESTPOOL1_", false,
false);
- RegionPtr reg = getHelper()->getRegion(regionNames[2]);
+ auto reg = getHelper()->getRegion(regionNames[2]);
LOG("REGION Created with Caching Enabled false");
- CacheableKeyPtr keyPtr = createKey(CREATE_TWICE_KEY);
- CacheableStringPtr valPtr = CacheableString::create(CREATE_TWICE_VALUE);
+ auto keyPtr = createKey(CREATE_TWICE_KEY);
+ auto valPtr = CacheableString::create(CREATE_TWICE_VALUE);
try {
reg->create(keyPtr, valPtr);
char message[200];
@@ -1063,17 +1056,16 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateClient1KeyThriceWithSticky)
{
createPooledRegionSticky(regionNames[2], NO_ACK, locatorsG, "__TESTPOOL1_",
false, false);
- RegionPtr reg = getHelper()->getRegion(regionNames[2]);
+ auto reg = getHelper()->getRegion(regionNames[2]);
LOG("REGION Created with Caching Enabled false");
- CacheableKeyPtr keyPtr = createKey(CREATE_TWICE_KEY);
- CacheableStringPtr valPtr = CacheableString::create(CREATE_TWICE_VALUE);
+ auto keyPtr = createKey(CREATE_TWICE_KEY);
+ auto valPtr = CacheableString::create(CREATE_TWICE_VALUE);
- RegionPtr reg0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr reg1 = getHelper()->getRegion(regionNames[1]);
+ auto reg0 = getHelper()->getRegion(regionNames[0]);
+ auto reg1 = getHelper()->getRegion(regionNames[1]);
reg0->localInvalidate(createKey(keys[1]));
reg1->localInvalidate(createKey(keys[3]));
- PoolPtr pool =
- getHelper()->getCache()->getPoolManager().find("__TESTPOOL1_");
+ auto pool = getHelper()->getCache()->getPoolManager().find("__TESTPOOL1_");
ASSERT(pool != nullptr, "Pool Should have been found");
doNetsearch(regionNames[0], keys[1], nvals[1]);
doNetsearch(regionNames[1], keys[3], nvals[3]);
diff --git a/cppcache/integration-test/ThinClientTransactionsXA.hpp b/cppcache/integration-test/ThinClientTransactionsXA.hpp
index 05fe990..1b2e4f1 100644
--- a/cppcache/integration-test/ThinClientTransactionsXA.hpp
+++ b/cppcache/integration-test/ThinClientTransactionsXA.hpp
@@ -21,7 +21,6 @@
#define GEODE_INTEGRATION_TEST_THINCLIENTTRANSACTIONSXA_H_
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/Auto_Event.h>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
@@ -61,7 +60,7 @@ END_TASK_DEFINITION
void initClient(const bool isthinClient) {
if (cacheHelper == nullptr) {
- PropertiesPtr config = Properties::create();
+ auto config = Properties::create();
if (g_isGridClient) {
config->insert("grid-client", "true");
}
@@ -102,10 +101,10 @@ void _verifyEntry(const char* name, const char* key, const char* val,
LOG(buf);
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
// if the region is no ack, then we may need to wait...
if (noKey == false) { // need to find the key!
@@ -197,9 +196,8 @@ void createRegion(const char* name, bool ackMode, const char* endpoints,
LOG("createRegion() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
- getHelper()->createRegion(name, ackMode, cachingEnable, nullptr,
- endpoints, clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, cachingEnable, nullptr,
+ endpoints, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -210,7 +208,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -224,7 +222,7 @@ void createPooledRegionSticky(const char* name, bool ackMode,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr = getHelper()->createPooledRegionSticky(
+ auto regPtr = getHelper()->createPooledRegionSticky(
name, ackMode, locators, poolname, cachingEnable,
clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -237,10 +235,10 @@ void createEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -261,9 +259,9 @@ void createEntryTwice(const char* name, const char* key, const char* value) {
sprintf(message, "Creating entry -- key: %s value: %s in region %s\n", key,
value, name);
LOG(message);
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
+ auto regPtr = getHelper()->getRegion(name);
regPtr->create(keyPtr, valPtr);
try {
regPtr->create(keyPtr, valPtr);
@@ -284,10 +282,10 @@ void updateEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -308,9 +306,9 @@ void doGetAgain(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "get region name%s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -340,9 +338,9 @@ void doNetsearch(const char* name, const char* key, const char* value) {
fflush(stdout);
static int count = 0;
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "netsearch region %s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -392,7 +390,7 @@ const bool NO_ACK = false;
class SuspendTransactionThread : public ACE_Task_Base {
private:
- TransactionIdPtr m_suspendedTransaction;
+ std::shared_ptr<TransactionId> m_suspendedTransaction;
bool m_sleep;
ACE_Auto_Event* m_txEvent;
@@ -435,11 +433,13 @@ class SuspendTransactionThread : public ACE_Task_Base {
}
void start() { activate(); }
void stop() { wait(); }
- TransactionIdPtr getSuspendedTx() { return m_suspendedTransaction; }
+ std::shared_ptr<TransactionId> getSuspendedTx() {
+ return m_suspendedTransaction;
+ }
};
class ResumeTransactionThread : public ACE_Task_Base {
private:
- TransactionIdPtr m_suspendedTransaction;
+ std::shared_ptr<TransactionId> m_suspendedTransaction;
bool m_commit;
bool m_tryResumeWithSleep;
bool m_isFailed;
@@ -447,8 +447,9 @@ class ResumeTransactionThread : public ACE_Task_Base {
ACE_Auto_Event* m_txEvent;
public:
- ResumeTransactionThread(TransactionIdPtr suspendedTransaction, bool commit,
- bool tryResumeWithSleep, ACE_Auto_Event* txEvent)
+ ResumeTransactionThread(std::shared_ptr<TransactionId> suspendedTransaction,
+ bool commit, bool tryResumeWithSleep,
+ ACE_Auto_Event* txEvent)
: m_suspendedTransaction(suspendedTransaction),
m_commit(commit),
m_tryResumeWithSleep(tryResumeWithSleep),
@@ -460,15 +461,15 @@ class ResumeTransactionThread : public ACE_Task_Base {
sprintf(buf, "In ResumeTransactionThread");
LOG(buf);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
THREADERRORCHECK(regPtr0 != nullptr,
"In ResumeTransactionThread - Region not found.");
- CacheableKeyPtr keyPtr4 = createKey(keys[4]);
- CacheableKeyPtr keyPtr5 = createKey(keys[5]);
- CacheableKeyPtr keyPtr6 = createKey(keys[6]);
+ auto keyPtr4 = createKey(keys[4]);
+ auto keyPtr5 = createKey(keys[5]);
+ auto keyPtr6 = createKey(keys[6]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
THREADERRORCHECK(regPtr1 != nullptr,
"In ResumeTransactionThread - Region not found.");
@@ -601,18 +602,18 @@ DUNIT_TASK_DEFINITION(CLIENT1, SuspendResumeCommit)
auto txManager =
std::dynamic_pointer_cast<InternalCacheTransactionManager2PC>(
getHelper()->getCache()->getCacheTransactionManager());
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
ASSERT(regPtr0 != nullptr, "In SuspendResumeCommit - Region not found.");
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
ASSERT(regPtr1 != nullptr, "In SuspendResumeCommit - Region not found.");
- CacheableKeyPtr keyPtr4 = createKey(keys[4]);
- CacheableKeyPtr keyPtr5 = createKey(keys[5]);
- CacheableKeyPtr keyPtr6 = createKey(keys[6]);
+ auto keyPtr4 = createKey(keys[4]);
+ auto keyPtr5 = createKey(keys[5]);
+ auto keyPtr6 = createKey(keys[6]);
txManager->begin();
createEntry(regionNames[0], keys[4], vals[4]);
createEntry(regionNames[1], keys[5], vals[5]);
- TransactionIdPtr m_suspendedTransaction = txManager->suspend();
+ auto m_suspendedTransaction = txManager->suspend();
ASSERT(
!regPtr0->containsKeyOnServer(keyPtr4),
@@ -680,19 +681,19 @@ DUNIT_TASK_DEFINITION(CLIENT1, SuspendTimeOut)
auto txManager =
std::dynamic_pointer_cast<InternalCacheTransactionManager2PC>(
getHelper()->getCache()->getCacheTransactionManager());
- CacheableKeyPtr keyPtr4 = createKey(keys[4]);
- CacheableKeyPtr keyPtr5 = createKey(keys[5]);
+ auto keyPtr4 = createKey(keys[4]);
+ auto keyPtr5 = createKey(keys[5]);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
ASSERT(regPtr0 != nullptr, "In SuspendTimeOut - Region not found.");
txManager->begin();
createEntry(regionNames[0], keys[4], vals[4]);
- TransactionIdPtr tid1 = txManager->suspend();
+ auto tid1 = txManager->suspend();
txManager->begin();
createEntry(regionNames[0], keys[5], vals[5]);
- TransactionIdPtr tid2 = txManager->suspend();
+ auto tid2 = txManager->suspend();
txManager->resume(tid1);
createEntry(regionNames[0], keys[6], vals[6]);
@@ -723,19 +724,19 @@ DUNIT_TASK_DEFINITION(CLIENT1, SuspendResumeRollback)
auto txManager =
std::dynamic_pointer_cast<InternalCacheTransactionManager2PC>(
getHelper()->getCache()->getCacheTransactionManager());
- CacheableKeyPtr keyPtr4 = createKey(keys[4]);
- CacheableKeyPtr keyPtr5 = createKey(keys[5]);
- CacheableKeyPtr keyPtr6 = createKey(keys[6]);
+ auto keyPtr4 = createKey(keys[4]);
+ auto keyPtr5 = createKey(keys[5]);
+ auto keyPtr6 = createKey(keys[6]);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
ASSERT(regPtr0 != nullptr, "In SuspendResumeRollback - Region not found.");
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
ASSERT(regPtr1 != nullptr, "In SuspendResumeRollback - Region not found.");
txManager->begin();
createEntry(regionNames[0], keys[4], vals[4]);
createEntry(regionNames[1], keys[5], vals[5]);
- TransactionIdPtr m_suspendedTransaction = txManager->suspend();
+ auto m_suspendedTransaction = txManager->suspend();
ASSERT(
!regPtr0->containsKeyOnServer(keyPtr4),
@@ -997,8 +998,8 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepFour)
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepFive)
{
- RegionPtr reg0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr reg1 = getHelper()->getRegion(regionNames[1]);
+ auto reg0 = getHelper()->getRegion(regionNames[0]);
+ auto reg1 = getHelper()->getRegion(regionNames[1]);
auto vec0 = reg0->serverKeys();
auto vec1 = reg1->serverKeys();
ASSERT(vec0.size() == 2, "Should have 2 keys in first region.");
@@ -1050,10 +1051,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepEight_Pool)
{
createPooledRegion(regionNames[2], NO_ACK, locatorsG, "__TESTPOOL1_", false,
false);
- RegionPtr reg = getHelper()->getRegion(regionNames[2]);
+ auto reg = getHelper()->getRegion(regionNames[2]);
LOG("REGION Created with Caching Enabled false");
- CacheableKeyPtr keyPtr = createKey(CREATE_TWICE_KEY);
- CacheableStringPtr valPtr = CacheableString::create(CREATE_TWICE_VALUE);
+ auto keyPtr = createKey(CREATE_TWICE_KEY);
+ auto valPtr = CacheableString::create(CREATE_TWICE_VALUE);
try {
reg->create(keyPtr, valPtr);
char message[200];
@@ -1078,17 +1079,16 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepEight_Pool_Sticky)
{
createPooledRegionSticky(regionNames[2], NO_ACK, locatorsG, "__TESTPOOL1_",
false, false);
- RegionPtr reg = getHelper()->getRegion(regionNames[2]);
+ auto reg = getHelper()->getRegion(regionNames[2]);
LOG("REGION Created with Caching Enabled false");
- CacheableKeyPtr keyPtr = createKey(CREATE_TWICE_KEY);
- CacheableStringPtr valPtr = CacheableString::create(CREATE_TWICE_VALUE);
+ auto keyPtr = createKey(CREATE_TWICE_KEY);
+ auto valPtr = CacheableString::create(CREATE_TWICE_VALUE);
- RegionPtr reg0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr reg1 = getHelper()->getRegion(regionNames[1]);
+ auto reg0 = getHelper()->getRegion(regionNames[0]);
+ auto reg1 = getHelper()->getRegion(regionNames[1]);
reg0->localInvalidate(createKey(keys[1]));
reg1->localInvalidate(createKey(keys[3]));
- PoolPtr pool =
- getHelper()->getCache()->getPoolManager().find("__TESTPOOL1_");
+ auto pool = getHelper()->getCache()->getPoolManager().find("__TESTPOOL1_");
ASSERT(pool != nullptr, "Pool Should have been found");
doNetsearch(regionNames[0], keys[1], nvals[1]);
doNetsearch(regionNames[1], keys[3], nvals[3]);
diff --git a/cppcache/integration-test/ThinClientVersionedOps.hpp b/cppcache/integration-test/ThinClientVersionedOps.hpp
index 9319c7c..54f26c6 100644
--- a/cppcache/integration-test/ThinClientVersionedOps.hpp
+++ b/cppcache/integration-test/ThinClientVersionedOps.hpp
@@ -48,30 +48,26 @@ bool isLocalServer1 = false;
static bool isLocator1 = false;
const char *locatorsG =
CacheHelper::getLocatorHostPort(isLocator1, isLocalServer1, 1);
-
-CacheableStringPtr c1v11;
-CacheableStringPtr c1v12;
-CacheableStringPtr c1v13;
-CacheableStringPtr c1v14;
-CacheableStringPtr c1v15;
-
-CacheableStringPtr s1v11;
-CacheableStringPtr s1v12;
-CacheableStringPtr s1v13;
-CacheableStringPtr s1v14;
-CacheableStringPtr s1v15;
-
-CacheableStringPtr c2v11;
-CacheableStringPtr c2v12;
-CacheableStringPtr c2v13;
-CacheableStringPtr c2v14;
-CacheableStringPtr c2v15;
-
-CacheableStringPtr s2v11;
-CacheableStringPtr s2v12;
-CacheableStringPtr s2v13;
-CacheableStringPtr s2v14;
-CacheableStringPtr s2v15;
+std::shared_ptr<CacheableString> c1v11;
+std::shared_ptr<CacheableString> c1v12;
+std::shared_ptr<CacheableString> c1v13;
+std::shared_ptr<CacheableString> c1v14;
+std::shared_ptr<CacheableString> c1v15;
+std::shared_ptr<CacheableString> s1v11;
+std::shared_ptr<CacheableString> s1v12;
+std::shared_ptr<CacheableString> s1v13;
+std::shared_ptr<CacheableString> s1v14;
+std::shared_ptr<CacheableString> s1v15;
+std::shared_ptr<CacheableString> c2v11;
+std::shared_ptr<CacheableString> c2v12;
+std::shared_ptr<CacheableString> c2v13;
+std::shared_ptr<CacheableString> c2v14;
+std::shared_ptr<CacheableString> c2v15;
+std::shared_ptr<CacheableString> s2v11;
+std::shared_ptr<CacheableString> s2v12;
+std::shared_ptr<CacheableString> s2v13;
+std::shared_ptr<CacheableString> s2v14;
+std::shared_ptr<CacheableString> s2v15;
void verifyAllValues() {
LOGINFO("verifyAllValues TEST-1");
@@ -138,14 +134,14 @@ DUNIT_TASK_DEFINITION(CLIENT1, StartClient1)
// 0/*redundancy*/, true/*clientNotification*/,
// -1/*subscriptionAckInterval*/,
// 5/*connections*/, 60000/*loadConditioningInterval*/);
- // RegionPtr regPtr0 = createRegionAndAttachPool(regNames[0],USE_ACK,
+ //auto regPtr0 = createRegionAndAttachPool(regNames[0],USE_ACK,
// nullptr);
initClient(true);
getHelper()->createPoolWithLocators("__TEST_POOL1__", locatorsG, true, -1,
std::chrono::milliseconds::zero(), -1,
false, group1);
- RegionPtr regPtr0 = getHelper()->createRegionAndAttachPool(
+ auto regPtr0 = getHelper()->createRegionAndAttachPool(
regNames[0], USE_ACK, "__TEST_POOL1__", true);
LOG("StepOne_Pooled_Locator1 complete.");
@@ -171,7 +167,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, StartClient2)
gfendpoints2.c_str(), nullptr, 0, true, -1, 5, 60000); LOG( "Client-2 Init
-5" );
- RegionPtr regPtr0 = createRegionAndAttachPool(regNames[0],USE_ACK, nullptr);
+ auto regPtr0 = createRegionAndAttachPool(regNames[0],USE_ACK, nullptr);
LOG( "Client-2 Init -6" );
*/
@@ -179,7 +175,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, StartClient2)
getHelper()->createPoolWithLocators("__TEST_POOL1__", locatorsG, true, -1,
std::chrono::milliseconds::zero(), -1,
false, group2);
- RegionPtr regPtr0 = getHelper()->createRegionAndAttachPool(
+ auto regPtr0 = getHelper()->createRegionAndAttachPool(
regNames[0], USE_ACK, "__TEST_POOL1__", true);
LOG("StepOne_Pooled_Locator1 complete.");
@@ -191,7 +187,7 @@ END_TASK_DEFINITION
// threadPutonClient1
DUNIT_TASK_DEFINITION(CLIENT1, threadPutonClient1)
{
- RegionPtr rptr = getHelper()->getRegion(regNames[0]);
+ auto rptr = getHelper()->getRegion(regNames[0]);
thread4 = new putThread(rptr, false);
thread4->setParams(0, 10, 1, true, false, 0);
thread4->start();
@@ -201,20 +197,20 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, transactionPutOnClient2)
{
- RegionPtr rptr = getHelper()->getRegion(regNames[0]);
- CacheTransactionManagerPtr txManager =
+ auto rptr = getHelper()->getRegion(regNames[0]);
+ auto txManager =
getHelper()->getCache()->getCacheTransactionManager();
- txManager->begin();
- CacheableKeyPtr keyPtr1 = CacheableKey::create("key-1");
- CacheableStringPtr valPtr = CacheableString::create("client2-value1");
+ txManager->begin();
+ auto keyPtr1 = CacheableKey::create("key-1");
+ auto valPtr = CacheableString::create("client2-value1");
rptr->put(keyPtr1, valPtr);
- CacheableKeyPtr keyPtr2 = CacheableKey::create("key-2");
+ auto keyPtr2 = CacheableKey::create("key-2");
valPtr = CacheableString::create("client2-value2");
rptr->put(keyPtr2, valPtr);
- CacheableKeyPtr keyPtr3 = CacheableKey::create("key-3");
+ auto keyPtr3 = CacheableKey::create("key-3");
valPtr = CacheableString::create("client2-value3");
rptr->put(keyPtr3, valPtr);
txManager->commit();
@@ -270,56 +266,56 @@ DUNIT_TASK_DEFINITION(CLIENT1, verifyGetonClient1)
thread4->stop();
delete thread4;
- RegionPtr rptr = getHelper()->getRegion(regNames[0]);
-
- CacheableKeyPtr keyPtr1 = CacheableKey::create("key-1");
- CacheableKeyPtr keyPtr2 = CacheableKey::create("key-2");
- CacheableKeyPtr keyPtr3 = CacheableKey::create("key-3");
-
- // localGet
- c1v11 = std::dynamic_pointer_cast<CacheableString>(rptr->get(keyPtr1));
- c1v12 = std::dynamic_pointer_cast<CacheableString>(rptr->get(keyPtr2));
- c1v13 = std::dynamic_pointer_cast<CacheableString>(rptr->get(keyPtr3));
-
- // localDestroy
- rptr->localDestroy(keyPtr1);
- rptr->localDestroy(keyPtr2);
- rptr->localDestroy(keyPtr3);
-
- // remoteGet
- s1v11 = std::dynamic_pointer_cast<CacheableString>(rptr->get(keyPtr1));
- s1v12 = std::dynamic_pointer_cast<CacheableString>(rptr->get(keyPtr2));
- s1v13 = std::dynamic_pointer_cast<CacheableString>(rptr->get(keyPtr3));
-
- // Print remoteGet Values
- LOGINFO(
- "CLIENT-2 :: verifyGetonClient1: localGet Val1 = %s remoteGet Val1 = "
- "%s ",
- c1v11->asChar(), s1v11->asChar());
- LOGINFO(
- "CLIENT-2 :: verifyGetonClient1: localGet Val2 = %s remoteGet Val2 = "
- "%s ",
- c1v12->asChar(), s1v12->asChar());
- LOGINFO(
- "CLIENT-2 :: verifyGetonClient1: localGet Val3 = %s remoteGet Val3 = "
- "%s ",
- c1v13->asChar(), s1v13->asChar());
-
- ASSERT(*c1v11.get() == *s1v11.get(),
- "verifyGetonClient1:Values should be equal-1");
- ASSERT(*c1v12.get() == *s1v12.get(),
- "verifyGetonClient1:Values should be equal-2");
- ASSERT(*c1v13.get() == *s1v13.get(),
- "verifyGetonClient1:Values should be equal-3");
-
- LOG("CLIENT-2 :: TASK: verifyGetonClient1 completed successfully");
+ auto rptr = getHelper()->getRegion(regNames[0]);
+
+ auto keyPtr1 = CacheableKey::create("key-1");
+ auto keyPtr2 = CacheableKey::create("key-2");
+ auto keyPtr3 = CacheableKey::create("key-3");
+
+ // localGet
+ c1v11 = std::dynamic_pointer_cast<CacheableString>(rptr->get(keyPtr1));
+ c1v12 = std::dynamic_pointer_cast<CacheableString>(rptr->get(keyPtr2));
+ c1v13 = std::dynamic_pointer_cast<CacheableString>(rptr->get(keyPtr3));
+
+ // localDestroy
+ rptr->localDestroy(keyPtr1);
+ rptr->localDestroy(keyPtr2);
+ rptr->localDestroy(keyPtr3);
+
+ // remoteGet
+ s1v11 = std::dynamic_pointer_cast<CacheableString>(rptr->get(keyPtr1));
+ s1v12 = std::dynamic_pointer_cast<CacheableString>(rptr->get(keyPtr2));
+ s1v13 = std::dynamic_pointer_cast<CacheableString>(rptr->get(keyPtr3));
+
+ // Print remoteGet Values
+ LOGINFO(
+ "CLIENT-2 :: verifyGetonClient1: localGet Val1 = %s remoteGet Val1 = "
+ "%s ",
+ c1v11->asChar(), s1v11->asChar());
+ LOGINFO(
+ "CLIENT-2 :: verifyGetonClient1: localGet Val2 = %s remoteGet Val2 = "
+ "%s ",
+ c1v12->asChar(), s1v12->asChar());
+ LOGINFO(
+ "CLIENT-2 :: verifyGetonClient1: localGet Val3 = %s remoteGet Val3 = "
+ "%s ",
+ c1v13->asChar(), s1v13->asChar());
+
+ ASSERT(*c1v11.get() == *s1v11.get(),
+ "verifyGetonClient1:Values should be equal-1");
+ ASSERT(*c1v12.get() == *s1v12.get(),
+ "verifyGetonClient1:Values should be equal-2");
+ ASSERT(*c1v13.get() == *s1v13.get(),
+ "verifyGetonClient1:Values should be equal-3");
+
+ LOG("CLIENT-2 :: TASK: verifyGetonClient1 completed successfully");
}
END_TASK_DEFINITION
//
DUNIT_TASK_DEFINITION(CLIENT1, PutOnClient1)
{
- RegionPtr rptr = getHelper()->getRegion(regNames[0]);
+ auto rptr = getHelper()->getRegion(regNames[0]);
thread1 = new putThread(rptr, false);
thread1->setParams(0, 5, 1, true, false, 1);
thread1->start();
@@ -329,7 +325,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, PutOnClient2)
{
- RegionPtr rptr = getHelper()->getRegion(regNames[0]);
+ auto rptr = getHelper()->getRegion(regNames[0]);
thread2 = new putThread(rptr, false);
thread2->setParams(0, 5, 1, false, false, 0); // 0, 5, 1, false, false, 0
thread2->start();
@@ -339,7 +335,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, testServerGC)
{
- RegionPtr rptr = getHelper()->getRegion(regNames[0]);
+ auto rptr = getHelper()->getRegion(regNames[0]);
thread3 = new putThread(rptr, false);
thread3->setParams(0, 5000, 1, true, false, 0); // 0, 5, 1, false, false, 0
thread3->start();
@@ -363,130 +359,128 @@ DUNIT_TASK_DEFINITION(CLIENT1, GetOnClient1)
thread1->stop();
delete thread1;
dunit::sleep(3000);
- RegionPtr regPtr = getHelper()->getRegion(regNames[0]);
+ auto regPtr = getHelper()->getRegion(regNames[0]);
// localGet
- CacheableKeyPtr keyPtr1 = CacheableKey::create("key-1");
- CacheableKeyPtr keyPtr2 = CacheableKey::create("key-2");
- CacheableKeyPtr keyPtr3 = CacheableKey::create("key-3");
- CacheableKeyPtr keyPtr4 = CacheableKey::create("key-4");
- CacheableKeyPtr keyPtr5 = CacheableKey::create("key-5");
-
- c1v11 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr1));
- c1v12 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr2));
- c1v13 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr3));
- c1v14 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr4));
- c1v15 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr5));
-
- // Print local Get Values
- LOGINFO("CLIENT-1 :: local GET operation -6 c1v11 = %s", c1v11->asChar());
- LOGINFO("CLIENT-1 :: local GET operation -7 c1v12 = %s", c1v12->asChar());
- LOGINFO("CLIENT-1 :: local GET operation -8 c1v13 = %s", c1v13->asChar());
- LOGINFO("CLIENT-1 :: local GET operation -9 c1v14=%s", c1v14->asChar());
- LOGINFO("CLIENT-1 :: local GET operation....Done c1v15=%s",
- c1v15->asChar());
-
- // localDestroy
- regPtr->localDestroy(keyPtr1);
- regPtr->localDestroy(keyPtr2);
- regPtr->localDestroy(keyPtr3);
- regPtr->localDestroy(keyPtr4);
- regPtr->localDestroy(keyPtr5);
-
- LOG("CLIENT-1 :: localDestroy() operation....Done");
-
- // remoteGet
- s1v11 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr1));
- s1v12 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr2));
- s1v13 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr3));
- s1v14 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr4));
- s1v15 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr5));
-
- // Print remoteGet Values
- LOGINFO("CLIENT-1 :: remoteGet operation -6 s1v11 = %s", s1v11->asChar());
- LOGINFO("CLIENT-1 :: remoteGet operation -6 s1v12 = %s", s1v12->asChar());
- LOGINFO("CLIENT-1 :: remoteGet operation -6 s1v13 = %s", s1v13->asChar());
- LOGINFO("CLIENT-1 :: remoteGet operation -6 s1v14 = %s", s1v14->asChar());
- LOGINFO("CLIENT-1 :: remoteGet operation -6 s1v15 = %s", s1v15->asChar());
-
- ASSERT(*c1v11.get() == *s1v11.get(),
- "GetOnClient1:Values should be equal-1");
- ASSERT(*c1v12.get() == *s1v12.get(),
- "GetOnClient1:Values should be equal-2");
- ASSERT(*c1v13.get() == *s1v13.get(),
- "GetOnClient1:Values should be equal-3");
- ASSERT(*c1v14.get() == *s1v14.get(),
- "GetOnClient1:Values should be equal-4");
- ASSERT(*c1v15.get() == *s1v15.get(),
- "GetOnClient1:Values should be equal-5");
- LOG("CLIENT-1 ::local GET operation....Done");
+ auto keyPtr1 = CacheableKey::create("key-1");
+ auto keyPtr2 = CacheableKey::create("key-2");
+ auto keyPtr3 = CacheableKey::create("key-3");
+ auto keyPtr4 = CacheableKey::create("key-4");
+ auto keyPtr5 = CacheableKey::create("key-5");
+
+ c1v11 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr1));
+ c1v12 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr2));
+ c1v13 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr3));
+ c1v14 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr4));
+ c1v15 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr5));
+
+ // Print local Get Values
+ LOGINFO("CLIENT-1 :: local GET operation -6 c1v11 = %s", c1v11->asChar());
+ LOGINFO("CLIENT-1 :: local GET operation -7 c1v12 = %s", c1v12->asChar());
+ LOGINFO("CLIENT-1 :: local GET operation -8 c1v13 = %s", c1v13->asChar());
+ LOGINFO("CLIENT-1 :: local GET operation -9 c1v14=%s", c1v14->asChar());
+ LOGINFO("CLIENT-1 :: local GET operation....Done c1v15=%s", c1v15->asChar());
+
+ // localDestroy
+ regPtr->localDestroy(keyPtr1);
+ regPtr->localDestroy(keyPtr2);
+ regPtr->localDestroy(keyPtr3);
+ regPtr->localDestroy(keyPtr4);
+ regPtr->localDestroy(keyPtr5);
+
+ LOG("CLIENT-1 :: localDestroy() operation....Done");
+
+ // remoteGet
+ s1v11 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr1));
+ s1v12 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr2));
+ s1v13 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr3));
+ s1v14 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr4));
+ s1v15 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr5));
+
+ // Print remoteGet Values
+ LOGINFO("CLIENT-1 :: remoteGet operation -6 s1v11 = %s", s1v11->asChar());
+ LOGINFO("CLIENT-1 :: remoteGet operation -6 s1v12 = %s", s1v12->asChar());
+ LOGINFO("CLIENT-1 :: remoteGet operation -6 s1v13 = %s", s1v13->asChar());
+ LOGINFO("CLIENT-1 :: remoteGet operation -6 s1v14 = %s", s1v14->asChar());
+ LOGINFO("CLIENT-1 :: remoteGet operation -6 s1v15 = %s", s1v15->asChar());
+
+ ASSERT(*c1v11.get() == *s1v11.get(),
+ "GetOnClient1:Values should be equal-1");
+ ASSERT(*c1v12.get() == *s1v12.get(),
+ "GetOnClient1:Values should be equal-2");
+ ASSERT(*c1v13.get() == *s1v13.get(),
+ "GetOnClient1:Values should be equal-3");
+ ASSERT(*c1v14.get() == *s1v14.get(),
+ "GetOnClient1:Values should be equal-4");
+ ASSERT(*c1v15.get() == *s1v15.get(),
+ "GetOnClient1:Values should be equal-5");
+ LOG("CLIENT-1 ::local GET operation....Done");
}
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, GetOnClient2)
{
- RegionPtr regPtr = getHelper()->getRegion(regNames[0]);
+ auto regPtr = getHelper()->getRegion(regNames[0]);
thread2->stop();
delete thread2;
dunit::sleep(3000);
// localGet
- CacheableKeyPtr keyPtr1 = CacheableKey::create("key-1");
- CacheableKeyPtr keyPtr2 = CacheableKey::create("key-2");
- CacheableKeyPtr keyPtr3 = CacheableKey::create("key-3");
- CacheableKeyPtr keyPtr4 = CacheableKey::create("key-4");
- CacheableKeyPtr keyPtr5 = CacheableKey::create("key-5");
-
- c2v11 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr1));
- c2v12 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr2));
- c2v13 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr3));
- c2v14 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr4));
- c2v15 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr5));
-
- // Print localGets
- // Print local Get Values
- LOGINFO("CLIENT-2 :: local GET operation c2v11 = %s", c2v11->asChar());
- LOGINFO("CLIENT-2 :: local GET operation c2v12 = %s", c2v12->asChar());
- LOGINFO("CLIENT-2 :: local GET operation c2v13 = %s", c2v13->asChar());
- LOGINFO("CLIENT-2 :: local GET operation c2v14=%s", c2v14->asChar());
- LOGINFO("CLIENT-2 :: local GET operation....Done c2v15=%s",
- c2v15->asChar());
-
- LOG("CLIENT-2 :: local GET operation....Done");
-
- // localDestroy
- regPtr->localDestroy(keyPtr1);
- regPtr->localDestroy(keyPtr2);
- regPtr->localDestroy(keyPtr3);
- regPtr->localDestroy(keyPtr4);
- regPtr->localDestroy(keyPtr5);
- LOG("CLIENT-2 :: localDestroy() operation....Done");
-
- // remoteGet
- s2v11 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr1));
- s2v12 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr2));
- s2v13 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr3));
- s2v14 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr4));
- s2v15 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr5));
-
- // Print remoteGet Values
- LOGINFO("CLIENT-2 :: remoteGet operation s2v11 = %s", s2v11->asChar());
- LOGINFO("CLIENT-2 :: remoteGet operation s2v12 = %s", s2v12->asChar());
- LOGINFO("CLIENT-2 :: remoteGet operation s2v13 = %s", s2v13->asChar());
- LOGINFO("CLIENT-2 :: remoteGet operation s2v14 = %s", s2v14->asChar());
- LOGINFO("CLIENT-2 :: remoteGet operation s2v15 = %s", s2v15->asChar());
-
- ASSERT(*c2v11.get() == *s2v11.get(),
- "GetOnClient2:Values should be equal-1");
- ASSERT(*c2v12.get() == *s2v12.get(),
- "GetOnClient2:Values should be equal-2");
- ASSERT(*c2v13.get() == *s2v13.get(),
- "GetOnClient2:Values should be equal-3");
- ASSERT(*c2v14.get() == *s2v14.get(),
- "GetOnClient2:Values should be equal-4");
- ASSERT(*c2v15.get() == *s2v15.get(),
- "GetOnClient2:Values should be equal-5");
-
- LOG("GetOnClient2 completed");
+ auto keyPtr1 = CacheableKey::create("key-1");
+ auto keyPtr2 = CacheableKey::create("key-2");
+ auto keyPtr3 = CacheableKey::create("key-3");
+ auto keyPtr4 = CacheableKey::create("key-4");
+ auto keyPtr5 = CacheableKey::create("key-5");
+
+ c2v11 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr1));
+ c2v12 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr2));
+ c2v13 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr3));
+ c2v14 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr4));
+ c2v15 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr5));
+
+ // Print localGets
+ // Print local Get Values
+ LOGINFO("CLIENT-2 :: local GET operation c2v11 = %s", c2v11->asChar());
+ LOGINFO("CLIENT-2 :: local GET operation c2v12 = %s", c2v12->asChar());
+ LOGINFO("CLIENT-2 :: local GET operation c2v13 = %s", c2v13->asChar());
+ LOGINFO("CLIENT-2 :: local GET operation c2v14=%s", c2v14->asChar());
+ LOGINFO("CLIENT-2 :: local GET operation....Done c2v15=%s", c2v15->asChar());
+
+ LOG("CLIENT-2 :: local GET operation....Done");
+
+ // localDestroy
+ regPtr->localDestroy(keyPtr1);
+ regPtr->localDestroy(keyPtr2);
+ regPtr->localDestroy(keyPtr3);
+ regPtr->localDestroy(keyPtr4);
+ regPtr->localDestroy(keyPtr5);
+ LOG("CLIENT-2 :: localDestroy() operation....Done");
+
+ // remoteGet
+ s2v11 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr1));
+ s2v12 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr2));
+ s2v13 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr3));
+ s2v14 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr4));
+ s2v15 = std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr5));
+
+ // Print remoteGet Values
+ LOGINFO("CLIENT-2 :: remoteGet operation s2v11 = %s", s2v11->asChar());
+ LOGINFO("CLIENT-2 :: remoteGet operation s2v12 = %s", s2v12->asChar());
+ LOGINFO("CLIENT-2 :: remoteGet operation s2v13 = %s", s2v13->asChar());
+ LOGINFO("CLIENT-2 :: remoteGet operation s2v14 = %s", s2v14->asChar());
+ LOGINFO("CLIENT-2 :: remoteGet operation s2v15 = %s", s2v15->asChar());
+
+ ASSERT(*c2v11.get() == *s2v11.get(),
+ "GetOnClient2:Values should be equal-1");
+ ASSERT(*c2v12.get() == *s2v12.get(),
+ "GetOnClient2:Values should be equal-2");
+ ASSERT(*c2v13.get() == *s2v13.get(),
+ "GetOnClient2:Values should be equal-3");
+ ASSERT(*c2v14.get() == *s2v14.get(),
+ "GetOnClient2:Values should be equal-4");
+ ASSERT(*c2v15.get() == *s2v15.get(),
+ "GetOnClient2:Values should be equal-5");
+
+ LOG("GetOnClient2 completed");
}
END_TASK_DEFINITION
diff --git a/cppcache/integration-test/fw_perf.hpp b/cppcache/integration-test/fw_perf.hpp
index a000e57..a18e1f1 100644
--- a/cppcache/integration-test/fw_perf.hpp
+++ b/cppcache/integration-test/fw_perf.hpp
@@ -230,7 +230,7 @@ class Thread : public ACE_Task_Base {
//
// argsv[0] = strdup( pbuf );
// argsv[1] = 0;
-// ACE_Service_Object_Ptr svcObj = ACE_SVC_INVOKE( ACE_Name_Acceptor );
+// auto svcObj = ACE_SVC_INVOKE( ACE_Name_Acceptor );
//
// if ( svcObj->init( 1, argsv ) == -1 ) {
// fprintf( stdout, "Failed to construct the Naming Service." );
diff --git a/cppcache/integration-test/testAttributesFactory.cpp b/cppcache/integration-test/testAttributesFactory.cpp
index ef84c40..e667b5a 100644
--- a/cppcache/integration-test/testAttributesFactory.cpp
+++ b/cppcache/integration-test/testAttributesFactory.cpp
@@ -18,7 +18,6 @@
#define ROOT_NAME "testAttributesFactory"
#include "fw_helper.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <CacheRegionHelper.hpp>
using namespace apache::geode::client;
diff --git a/cppcache/integration-test/testAttributesMutator.cpp b/cppcache/integration-test/testAttributesMutator.cpp
index e93a791..9ae5419 100644
--- a/cppcache/integration-test/testAttributesMutator.cpp
+++ b/cppcache/integration-test/testAttributesMutator.cpp
@@ -18,7 +18,6 @@
#define ROOT_NAME "testAttributesMutator"
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include "CacheRegionHelper.hpp"
#include "CacheImpl.hpp"
@@ -28,8 +27,8 @@ using namespace apache::geode::client;
class TestData {
public:
- RegionPtr m_region;
- CachePtr m_cache;
+ std::shared_ptr<Region> m_region;
+ std::shared_ptr<Cache> m_cache;
} Test;
@@ -38,13 +37,13 @@ class TestData {
/* setup recipient */
DUNIT_TASK(A, Init)
{
- CacheFactoryPtr cacheFactoryPtr = CacheFactory::createCacheFactory();
+ auto cacheFactoryPtr = CacheFactory::createCacheFactory();
Test.m_cache = cacheFactoryPtr->create();
AttributesFactory af;
af.setEntryTimeToLive(ExpirationAction::LOCAL_INVALIDATE,
std::chrono::seconds(5));
- RegionAttributesPtr attrs = af.createRegionAttributes();
+ std::shared_ptr<RegionAttributes> attrs = af.createRegionAttributes();
CacheImpl* cacheImpl = CacheRegionHelper::getCacheImpl(Test.m_cache.get());
cacheImpl->createRegion("Local_ETTL_LI", attrs, Test.m_region);
@@ -53,7 +52,7 @@ ENDTASK
DUNIT_TASK(A, CreateAndVerifyExpiry)
{
- CacheableInt32Ptr value = CacheableInt32::create(1);
+ auto value = CacheableInt32::create(1);
LOGDEBUG("### About to put of :one:1: ###");
Test.m_region->put("one", value);
LOGDEBUG("### Finished put of :one:1: ###");
diff --git a/cppcache/integration-test/testCache.cpp b/cppcache/integration-test/testCache.cpp
index 8ac7890..716cde5 100644
--- a/cppcache/integration-test/testCache.cpp
+++ b/cppcache/integration-test/testCache.cpp
@@ -20,7 +20,6 @@
#include <string>
#include <iostream>
-#include <geode/GeodeCppCache.hpp>
#include "CacheRegionHelper.hpp"
#include "CacheImpl.hpp"
#include "fw_helper.hpp"
@@ -35,16 +34,16 @@ BEGIN_TEST(CacheFunction)
char* subRegionName1 = (char*)"TESTCACHE_SUB_REGION1";
char* subRegionName2 = (char*)"TESTCACHE_SUB_REGION2";
char* subRegionName21 = (char*)"TESTCACHE_SUB_REGION21";
- CachePtr cptr;
+ std::shared_ptr<Cache> cptr;
if (cptr != nullptr) {
std::cout << "cptr is not null" << std::endl;
}
std::cout << "create Cache with name=" << host_name
<< " and unitialized system" << std::endl;
- CacheFactoryPtr cacheFactoryPtr = CacheFactory::createCacheFactory();
+ auto cacheFactoryPtr = CacheFactory::createCacheFactory();
cptr = cacheFactoryPtr->create();
AttributesFactory attrFac;
- RegionAttributesPtr rAttr;
+ std::shared_ptr<RegionAttributes> rAttr;
std::cout << "create RegionAttributes" << std::endl;
try {
rAttr = attrFac.createRegionAttributes();
@@ -55,7 +54,7 @@ BEGIN_TEST(CacheFunction)
if (rAttr == nullptr) {
std::cout << "Warnning! : AttributesFactory returned nullptr" << std::endl;
}
- RegionPtr rptr;
+ std::shared_ptr<Region> rptr;
if (rptr != nullptr) {
std::cout << "rptr is not null" << std::endl;
}
@@ -68,7 +67,7 @@ BEGIN_TEST(CacheFunction)
ASSERT(false, (char*)"attribute create failed");
}
std::cout << "create Sub Region with name=" << subRegionName1 << std::endl;
- RegionPtr subRptr1;
+ std::shared_ptr<Region> subRptr1;
try {
subRptr1 = rptr->createSubregion(subRegionName1, rAttr);
} catch (Exception& ex) {
@@ -76,7 +75,7 @@ BEGIN_TEST(CacheFunction)
ASSERT(false, (char*)"subregion create failed");
}
std::cout << "create Sub Region with name=" << subRegionName2 << std::endl;
- RegionPtr subRptr2;
+ std::shared_ptr<Region> subRptr2;
try {
subRptr2 = rptr->createSubregion(subRegionName2, rAttr);
} catch (Exception& ex) {
@@ -85,14 +84,14 @@ BEGIN_TEST(CacheFunction)
}
std::cout << "create Sub Region with name=" << subRegionName21
<< "inside region=" << subRegionName2 << std::endl;
- RegionPtr subRptr21;
+ std::shared_ptr<Region> subRptr21;
try {
subRptr21 = subRptr2->createSubregion(subRegionName21, rAttr);
} catch (Exception& ex) {
std::cout << ex.getMessage() << std::endl;
ASSERT(false, (char*)"subregion create failed");
}
- VectorOfRegion vr = rptr->subregions(true);
+ std::vector<std::shared_ptr<Region>> vr = rptr->subregions(true);
std::cout << " vr.size=" << vr.size() << std::endl;
ASSERT(vr.size() == totalSubRegions, "Number of Subregions does not match");
std::cout << "sub regions:" << std::endl;
@@ -120,7 +119,7 @@ BEGIN_TEST(CacheFunction)
std::cout << "subRegion1=" << subRegion1.c_str() << std::endl;
subRegion21 = subRegion2 + sptor + subRegion21;
std::cout << "subRegion21=" << subRegion21.c_str() << std::endl;
- RegionPtr region;
+ std::shared_ptr<Region> region;
std::cout << "find region:" << regionName << std::endl;
try {
region = cptr->getRegion(root.c_str());
diff --git a/cppcache/integration-test/testCacheless.cpp b/cppcache/integration-test/testCacheless.cpp
index 6eec6c7..f597c00 100644
--- a/cppcache/integration-test/testCacheless.cpp
+++ b/cppcache/integration-test/testCacheless.cpp
@@ -16,7 +16,6 @@
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#define ROOT_SCOPE DISTRIBUTED_ACK
@@ -24,14 +23,13 @@
#include "TallyListener.hpp"
using namespace apache::geode::client;
-
-CacheListenerPtr nullListenerPtr;
+std::shared_ptr<CacheListener> nullListenerPtr;
class RegionWrapper {
public:
explicit RegionWrapper(const char* name)
: m_regionPtr(cacheHelper->getRegion(name)) {
- RegionAttributesPtr attrs;
+ std::shared_ptr<RegionAttributes> attrs;
attrs = m_regionPtr->getAttributes();
m_noack = true;
}
@@ -41,11 +39,11 @@ class RegionWrapper {
char valbuf[100];
sprintf(keybuf, "key%d", key);
sprintf(valbuf, "%d", value);
- CacheableStringPtr valPtr = CacheableString::create(valbuf);
- m_regionPtr->put(keybuf, valPtr);
+ auto valPtr = CacheableString::create(valbuf);
+ m_regionPtr->put(keybuf, valPtr);
}
- void waitForKey(CacheableKeyPtr& keyPtr) {
+ void waitForKey(std::shared_ptr<CacheableKey>& keyPtr) {
if (m_noack) {
// might have to wait for a moment.
int tries = 0;
@@ -56,8 +54,8 @@ class RegionWrapper {
}
}
- int waitForValue(CacheableKeyPtr& keyPtr, int expected,
- CacheableStringPtr& valPtr) {
+ int waitForValue(std::shared_ptr<CacheableKey>& keyPtr, int expected,
+ std::shared_ptr<CacheableString>& valPtr) {
int tries = 0;
int val = 0;
do {
@@ -76,12 +74,12 @@ class RegionWrapper {
void test(int key, int value, int line) {
char keybuf[100];
sprintf(keybuf, "key%d", key);
- CacheableKeyPtr keyPtr = createKey(keybuf);
+ auto keyPtr = createKey(keybuf);
- if (value == -1) {
- char ebuf[1024];
- sprintf(ebuf, "unexpected key found at %d", line);
- ASSERT(!m_regionPtr->containsKey(keyPtr), ebuf);
+ if (value == -1) {
+ char ebuf[1024];
+ sprintf(ebuf, "unexpected key found at %d", line);
+ ASSERT(!m_regionPtr->containsKey(keyPtr), ebuf);
} else if (value == 0) {
waitForKey(keyPtr);
ASSERT(m_regionPtr->containsKey(keyPtr), "missing key.");
@@ -90,7 +88,7 @@ class RegionWrapper {
} else {
waitForKey(keyPtr);
ASSERT(m_regionPtr->containsKey(keyPtr), "missing key.");
- CacheableStringPtr valPtr;
+ std::shared_ptr<CacheableString> valPtr;
int val = waitForValue(keyPtr, value, valPtr);
char ebuf[1024];
sprintf(ebuf, "unexpected value: \"%s\", expected \"%d\" from line %d",
@@ -99,7 +97,7 @@ class RegionWrapper {
}
}
- RegionPtr m_regionPtr;
+ std::shared_ptr<Region> m_regionPtr;
bool m_noack;
};
@@ -108,7 +106,7 @@ bool isLocalServer = true;
bool isLocator = true;
const char* locHostPort =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, numberOfLocators);
-TallyListenerPtr listener;
+std::shared_ptr<TallyListener> listener;
#define REGIONNAME "DistRegionAck"
DUNIT_TASK_DEFINITION(s1p1, Setup)
diff --git a/cppcache/integration-test/testConnect.cpp b/cppcache/integration-test/testConnect.cpp
index 7cf284c..236c49b 100644
--- a/cppcache/integration-test/testConnect.cpp
+++ b/cppcache/integration-test/testConnect.cpp
@@ -18,15 +18,15 @@
#define ROOT_NAME "testConnect"
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
+#include <geode/CacheFactory.hpp>
using namespace apache::geode::client;
const char* host_name = "Suds";
DUNIT_TASK(s1p1, CreateRegionOne)
{
- CacheFactoryPtr factory = CacheFactory::createCacheFactory();
- CachePtr cache = factory->create();
+ auto factory = CacheFactory::createCacheFactory();
+ auto cache = factory->create();
try {
cache->getDistributedSystem().connect();
FAIL("Expected an exception.");
diff --git a/cppcache/integration-test/testCreateAndDestroyPool.cpp b/cppcache/integration-test/testCreateAndDestroyPool.cpp
index 269ea3a..bdf83f4 100644
--- a/cppcache/integration-test/testCreateAndDestroyPool.cpp
+++ b/cppcache/integration-test/testCreateAndDestroyPool.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <ace/Task.h>
diff --git a/cppcache/integration-test/testDunit.cpp b/cppcache/integration-test/testDunit.cpp
index 0830854..99bbfed 100644
--- a/cppcache/integration-test/testDunit.cpp
+++ b/cppcache/integration-test/testDunit.cpp
@@ -20,7 +20,6 @@
#include <iostream>
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
int getSlaveTest() {
return dunit::globals()->getIntValue("test_alive_slaves");
diff --git a/cppcache/integration-test/testExpiration.cpp b/cppcache/integration-test/testExpiration.cpp
index b88a053..ff578c1 100644
--- a/cppcache/integration-test/testExpiration.cpp
+++ b/cppcache/integration-test/testExpiration.cpp
@@ -18,7 +18,6 @@
#define ROOT_NAME "testExpiration"
#include "fw_helper.hpp"
-#include <geode/GeodeCppCache.hpp>
#include "CacheRegionHelper.hpp"
#include "CacheImpl.hpp"
@@ -28,21 +27,21 @@ ExpirationAction::Action action = ExpirationAction::DESTROY;
// This test is for serially running the tests.
-size_t getNumOfEntries(RegionPtr& R1) {
- VectorOfCacheableKey v = R1->keys();
+size_t getNumOfEntries(std::shared_ptr<Region>& R1) {
+ std::vector<std::shared_ptr<CacheableKey>> v = R1->keys();
LOGFINE("Number of keys in region %s is %d", R1->getFullPath(), v.size());
return v.size();
}
-void startDSandCreateCache(CachePtr& cache) {
- PropertiesPtr pp = Properties::create();
- CacheFactoryPtr cacheFactoryPtr = CacheFactory::createCacheFactory(pp);
+void startDSandCreateCache(std::shared_ptr<Cache>& cache) {
+ auto pp = Properties::create();
+ auto cacheFactoryPtr = CacheFactory::createCacheFactory(pp);
cache = cacheFactoryPtr->create();
ASSERT(cache != nullptr, "cache not equal to null expected");
}
-void doNPuts(RegionPtr& rptr, int n) {
- CacheableStringPtr value;
+void doNPuts(std::shared_ptr<Region>& rptr, int n) {
+ std::shared_ptr<CacheableString> value;
char buf[16];
memset(buf, 'A', 15);
buf[15] = '\0';
@@ -52,15 +51,14 @@ void doNPuts(RegionPtr& rptr, int n) {
for (int i = 0; i < n; i++) {
sprintf(buf, "KeyA - %d", i + 1);
- CacheableKeyPtr key = CacheableKey::create(buf);
+ auto key = CacheableKey::create(buf);
LOGINFO("Putting key %s value %s in region %s", buf, value->toString(),
rptr->getFullPath());
rptr->put(key, value);
}
}
-
-CacheableKeyPtr do1Put(RegionPtr& rptr) {
- CacheableStringPtr value;
+std::shared_ptr<CacheableKey> do1Put(std::shared_ptr<Region>& rptr) {
+ std::shared_ptr<CacheableString> value;
char buf[16];
memset(buf, 'A', 15);
buf[15] = '\0';
@@ -69,15 +67,15 @@ CacheableKeyPtr do1Put(RegionPtr& rptr) {
ASSERT(value != nullptr, "Failed to create value.");
sprintf(buf, "KeyA - %d", 0 + 1);
- CacheableKeyPtr key = CacheableKey::create(buf);
- LOGINFO("Putting key %s value %s in region %s", buf, value->toString(),
- rptr->getFullPath());
- rptr->put(key, value);
- return key;
+ auto key = CacheableKey::create(buf);
+ LOGINFO("Putting key %s value %s in region %s", buf, value->toString(),
+ rptr->getFullPath());
+ rptr->put(key, value);
+ return key;
}
void setExpTimes(
- RegionAttributesPtr& attrs,
+ std::shared_ptr<RegionAttributes>& attrs,
const std::chrono::seconds& ettl = std::chrono::seconds::zero(),
const std::chrono::seconds& eit = std::chrono::seconds::zero(),
const std::chrono::seconds& rttl = std::chrono::seconds::zero(),
@@ -94,7 +92,7 @@ void setExpTimes(
BEGIN_TEST(TEST_EXPIRATION)
{
- CachePtr cache;
+ std::shared_ptr<Cache> cache;
startDSandCreateCache(cache);
@@ -104,10 +102,10 @@ BEGIN_TEST(TEST_EXPIRATION)
size_t n;
- RegionAttributesPtr attrs_1;
+ std::shared_ptr<RegionAttributes> attrs_1;
// ettl = 0, eit = 0, rttl = 0, reit = 0
setExpTimes(attrs_1);
- RegionPtr R1;
+ std::shared_ptr<Region> R1;
cacheImpl->createRegion("R1", attrs_1, R1);
ASSERT(R1 != nullptr, "Expected R1 to be NON-nullptr");
@@ -120,12 +118,12 @@ BEGIN_TEST(TEST_EXPIRATION)
ASSERT(R1->isDestroyed() == false, "Expected R1 to be alive");
- RegionAttributesPtr attrs_2;
+ std::shared_ptr<RegionAttributes> attrs_2;
setExpTimes(attrs_2, std::chrono::seconds(20), std::chrono::seconds(2),
std::chrono::seconds(0), std::chrono::seconds(0));
- RegionPtr R2;
+ std::shared_ptr<Region> R2;
cacheImpl->createRegion("R2", attrs_2, R2);
ASSERT(R2 != nullptr, "Expected R2 to be NON-nullptr");
LOG("Region R2 created");
@@ -138,12 +136,12 @@ BEGIN_TEST(TEST_EXPIRATION)
ASSERT(R2->isDestroyed() == false, "Expected R2 to be alive");
- RegionAttributesPtr attrs_3;
+ std::shared_ptr<RegionAttributes> attrs_3;
// rttl = 20, reit = 2
setExpTimes(attrs_3, std::chrono::seconds(0), std::chrono::seconds(0),
std::chrono::seconds(20), std::chrono::seconds(2));
- RegionPtr R3;
+ std::shared_ptr<Region> R3;
cacheImpl->createRegion("R3", attrs_3, R3);
ASSERT(R3 != nullptr, "Expected R3 to be NON-nullptr");
@@ -151,12 +149,12 @@ BEGIN_TEST(TEST_EXPIRATION)
ASSERT(R3->isDestroyed() == false, "Expected R3 to be alive");
- RegionAttributesPtr attrs_4;
+ std::shared_ptr<RegionAttributes> attrs_4;
setExpTimes(attrs_4, std::chrono::seconds(5), std::chrono::seconds(0),
std::chrono::seconds(0), std::chrono::seconds(0));
- RegionPtr R4;
+ std::shared_ptr<Region> R4;
cacheImpl->createRegion("R4", attrs_4, R4);
ASSERT(R4 != nullptr, "Expected R4 to be NON-nullptr");
@@ -170,16 +168,16 @@ BEGIN_TEST(TEST_EXPIRATION)
ASSERT(R4->isDestroyed() == false, "Expected R4 to be alive");
- RegionAttributesPtr attrs_5;
+ std::shared_ptr<RegionAttributes> attrs_5;
// ettl = 0, eit = 0, rttl = 0, reit = 0
setExpTimes(attrs_5, std::chrono::seconds(0), std::chrono::seconds(5),
std::chrono::seconds(0), std::chrono::seconds(0));
- RegionPtr R5;
+ std::shared_ptr<Region> R5;
cacheImpl->createRegion("R5", attrs_5, R5);
ASSERT(R5 != nullptr, "Expected R5 to be NON-nullptr");
- CacheableKeyPtr key_0 = do1Put(R5);
+ auto key_0 = do1Put(R5);
ACE_OS::sleep(2);
@@ -198,12 +196,12 @@ BEGIN_TEST(TEST_EXPIRATION)
ASSERT(n == 0, "Expected 0 entry");
ASSERT(R5->isDestroyed() == false, "Expected R5 to be alive");
- RegionAttributesPtr attrs_6;
+ std::shared_ptr<RegionAttributes> attrs_6;
// ettl = 0, eit = 0, rttl = 0, reit = 0
setExpTimes(attrs_6, std::chrono::seconds(0), std::chrono::seconds(0),
std::chrono::seconds(5), std::chrono::seconds(0));
- RegionPtr R6;
+ std::shared_ptr<Region> R6;
cacheImpl->createRegion("R6", attrs_6, R6);
ASSERT(R6 != nullptr, "Expected R6 to be NON-nullptr");
@@ -217,12 +215,12 @@ BEGIN_TEST(TEST_EXPIRATION)
ASSERT(R6->isDestroyed() == true, "Expected R6 to be dead");
- RegionAttributesPtr attrs_7;
+ std::shared_ptr<RegionAttributes> attrs_7;
// ettl = 0, eit = 0, rttl = 0, reit = 0
setExpTimes(attrs_7, std::chrono::seconds(0), std::chrono::seconds(0),
std::chrono::seconds(0), std::chrono::seconds(5));
- RegionPtr R7;
+ std::shared_ptr<Region> R7;
cacheImpl->createRegion("R7", attrs_7, R7);
ASSERT(R7 != nullptr, "Expected R7 to be NON-nullptr");
@@ -236,16 +234,16 @@ BEGIN_TEST(TEST_EXPIRATION)
ASSERT(R7->isDestroyed() == true, "Expected R7 to be dead");
- RegionAttributesPtr attrs_8;
+ std::shared_ptr<RegionAttributes> attrs_8;
// ettl = 0, eit = 0, rttl = 0, reit = 0
setExpTimes(attrs_8, std::chrono::seconds(10), std::chrono::seconds(0),
std::chrono::seconds(0), std::chrono::seconds(0));
- RegionPtr R8;
+ std::shared_ptr<Region> R8;
cacheImpl->createRegion("R8", attrs_8, R8);
ASSERT(R8 != nullptr, "Expected R8 to be NON-nullptr");
- CacheableKeyPtr key = do1Put(R8);
+ auto key = do1Put(R8);
ACE_OS::sleep(5);
@@ -256,16 +254,16 @@ BEGIN_TEST(TEST_EXPIRATION)
n = getNumOfEntries(R8);
ASSERT(n == 0, "Expected 1 entries");
- RegionAttributesPtr attrs_9;
+ std::shared_ptr<RegionAttributes> attrs_9;
// ettl = 0, eit = 0, rttl = 0, reit = 0
setExpTimes(attrs_9, std::chrono::seconds(0), std::chrono::seconds(0),
std::chrono::seconds(0), std::chrono::seconds(8));
- RegionPtr R9;
+ std::shared_ptr<Region> R9;
cacheImpl->createRegion("R9", attrs_9, R9);
ASSERT(R9 != nullptr, "Expected R9 to be NON-nullptr");
- CacheableKeyPtr key_1 = do1Put(R9);
+ auto key_1 = do1Put(R9);
ACE_OS::sleep(5);
@@ -278,12 +276,12 @@ BEGIN_TEST(TEST_EXPIRATION)
ASSERT(R9->isDestroyed() == false, "Expected R9 to be alive");
- RegionAttributesPtr attrs_10;
+ std::shared_ptr<RegionAttributes> attrs_10;
// ettl = 0, eit = 0, rttl = 0, reit = 0
setExpTimes(attrs_10, std::chrono::seconds(6), std::chrono::seconds(0),
std::chrono::seconds(0), std::chrono::seconds(12));
- RegionPtr R10;
+ std::shared_ptr<Region> R10;
cacheImpl->createRegion("R10", attrs_10, R10);
ASSERT(R10 != nullptr, "Expected R10 to be NON-nullptr");
@@ -298,17 +296,17 @@ BEGIN_TEST(TEST_EXPIRATION)
ASSERT(R10->isDestroyed() == true, "Expected R10 to be dead");
- RegionAttributesPtr attrs_11;
+ std::shared_ptr<RegionAttributes> attrs_11;
// ettl = 0, eit = 0, rttl = 0, reit = 0
setExpTimes(attrs_11, std::chrono::seconds(0), std::chrono::seconds(4),
std::chrono::seconds(0), std::chrono::seconds(7));
- RegionPtr R11;
+ std::shared_ptr<Region> R11;
cacheImpl->createRegion("R11", attrs_11, R11);
ASSERT(R11 != nullptr, "Expected R11 to be NON-nullptr");
- CacheableKeyPtr k11 = do1Put(R11);
+ auto k11 = do1Put(R11);
ACE_OS::sleep(3);
@@ -326,16 +324,16 @@ BEGIN_TEST(TEST_EXPIRATION)
ASSERT(R11->isDestroyed() == true, "Expected R11 to be dead");
- RegionAttributesPtr attrs_12;
+ std::shared_ptr<RegionAttributes> attrs_12;
// ettl = 0, eit = 0, rttl = 0, reit = 0
setExpTimes(attrs_12, std::chrono::seconds(5), std::chrono::seconds(0),
std::chrono::seconds(0), std::chrono::seconds(0));
- RegionPtr R12;
+ std::shared_ptr<Region> R12;
cacheImpl->createRegion("R12", attrs_12, R12);
ASSERT(R12 != nullptr, "Expected R12 to be NON-nullptr");
- CacheableKeyPtr key_3 = do1Put(R12);
+ auto key_3 = do1Put(R12);
ACE_OS::sleep(6);
@@ -345,12 +343,12 @@ BEGIN_TEST(TEST_EXPIRATION)
ASSERT(R12->isDestroyed() == false, "Expected R12 to be alive");
/////////
- RegionAttributesPtr attrs_14;
+ std::shared_ptr<RegionAttributes> attrs_14;
// ettl = 0, eit = 0, rttl = 0, reit = 0
setExpTimes(attrs_14, std::chrono::seconds(0), std::chrono::seconds(0),
std::chrono::seconds(10), std::chrono::seconds(0));
- RegionPtr R14;
+ std::shared_ptr<Region> R14;
cacheImpl->createRegion("R14", attrs_14, R14);
ASSERT(R14 != nullptr, "Expected R14 to be NON-nullptr");
@@ -360,16 +358,16 @@ BEGIN_TEST(TEST_EXPIRATION)
ASSERT(R14->isDestroyed() == true, "Expected R14 to be dead");
- RegionAttributesPtr attrs_15;
+ std::shared_ptr<RegionAttributes> attrs_15;
// ettl = 0, eit = 0, rttl = 0, reit = 0
setExpTimes(attrs_15, std::chrono::seconds(0), std::chrono::seconds(5),
std::chrono::seconds(0), std::chrono::seconds(0));
- RegionPtr R15;
+ std::shared_ptr<Region> R15;
cacheImpl->createRegion("R15", attrs_15, R15);
ASSERT(R15 != nullptr, "Expected R15 to be NON-nullptr");
- CacheableKeyPtr key_4 = do1Put(R15);
+ auto key_4 = do1Put(R15);
ACE_OS::sleep(2);
@@ -380,12 +378,12 @@ BEGIN_TEST(TEST_EXPIRATION)
ASSERT(R15->isDestroyed() == false, "Expected R15 to be alive");
//////////////
- RegionAttributesPtr attrs_18;
+ std::shared_ptr<RegionAttributes> attrs_18;
// ettl = 0, eit = 0, rttl = 0, reit = 0
setExpTimes(attrs_18, std::chrono::seconds(6), std::chrono::seconds(3),
std::chrono::seconds(0), std::chrono::seconds(0));
- RegionPtr R18;
+ std::shared_ptr<Region> R18;
cacheImpl->createRegion("R18", attrs_18, R18);
ASSERT(R18 != nullptr, "Expected R18 to be NON-nullptr");
@@ -400,12 +398,12 @@ BEGIN_TEST(TEST_EXPIRATION)
n = getNumOfEntries(R18);
ASSERT(n == 0, "ttl is over so it should be 0");
- RegionAttributesPtr attrs_19;
+ std::shared_ptr<RegionAttributes> attrs_19;
// ettl = 0, eit = 0, rttl = 0, reit = 0
setExpTimes(attrs_19, std::chrono::seconds(0), std::chrono::seconds(0),
std::chrono::seconds(6), std::chrono::seconds(3));
- RegionPtr R19;
+ std::shared_ptr<Region> R19;
cacheImpl->createRegion("R19x", attrs_19, R19);
ASSERT(R19 != nullptr, "Expected R19 to be NON-nullptr");
diff --git a/cppcache/integration-test/testFwPerf.cpp b/cppcache/integration-test/testFwPerf.cpp
index a8e73c1..ffed718 100644
--- a/cppcache/integration-test/testFwPerf.cpp
+++ b/cppcache/integration-test/testFwPerf.cpp
@@ -16,7 +16,6 @@
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#define ROOT_NAME "testFwPerf"
diff --git a/cppcache/integration-test/testLRUList.cpp b/cppcache/integration-test/testLRUList.cpp
index 7a51370..6fe6aca 100644
--- a/cppcache/integration-test/testLRUList.cpp
+++ b/cppcache/integration-test/testLRUList.cpp
@@ -32,13 +32,13 @@ END_TEST(NotOnWindows)
//#define BUILD_CPPCACHE
#include <LRUList.cpp>
-#include <geode/GeodeCppCache.hpp>
+#include <geode/CacheableKey.hpp>
using namespace apache::geode::client;
class MyNode : public LRUEntryProperties {
public:
- static MyNode* create(const CacheableKeyPtr& key = nullptr) {
+ static MyNode* create(const std::shared_ptr<CacheableKey>& key = nullptr) {
return new MyNode();
}
virtual ~MyNode() {}
@@ -52,8 +52,6 @@ class MyNode : public LRUEntryProperties {
int m_value;
};
-typedef std::shared_ptr<MyNode> MyNodePtr;
-
/**
* @brief Test the LRU-ness of the LRUList.
*/
@@ -61,7 +59,7 @@ BEGIN_TEST(LRUListTest)
{
LRUList<MyNode, MyNode> lruList;
// Create 10 Nodes to keep track of.
- MyNodePtr* tenNodes = new MyNodePtr[10];
+ std::shared_ptr<MyNode>* tenNodes = new std::shared_ptr<MyNode>[10];
for (int i = 0; i < 10; i++) {
tenNodes[i] = std::shared_ptr<MyNode>(MyNode::create());
@@ -77,7 +75,7 @@ BEGIN_TEST(LRUListTest)
tenNodes[j]->setRecentlyUsed();
}
- MyNodePtr aNode;
+ std::shared_ptr<MyNode> aNode;
char msgbuf[100];
// check that we get the unmarked entries first. 0,2,4,6,8
for (int k = 0; k < 10; k += 2) {
@@ -101,7 +99,7 @@ BEGIN_TEST(TestEndOfList)
LRUList<MyNode, MyNode> lruList;
// add ten entries.
for (int i = 0; i < 10; i++) {
- MyNodePtr tmp(MyNode::create());
+ std::shared_ptr<MyNode> tmp(MyNode::create());
tmp->setValue(i);
lruList.appendEntry(tmp);
}
@@ -109,7 +107,7 @@ BEGIN_TEST(TestEndOfList)
int k = 0;
char msgbuf[100];
while (k < 10) {
- MyNodePtr nodePtr;
+ std::shared_ptr<MyNode> nodePtr;
lruList.getLRUEntry(nodePtr);
sprintf(msgbuf, "expected node %d", k);
ASSERT(std::dynamic_pointer_cast<MyNode>(nodePtr)->getValue() == k,
@@ -117,7 +115,7 @@ BEGIN_TEST(TestEndOfList)
k++;
}
// now list should be empty...
- MyNodePtr emptyPtr;
+ std::shared_ptr<MyNode> emptyPtr;
lruList.getLRUEntry(emptyPtr);
ASSERT(emptyPtr == nullptr, "expected nullptr");
// do it again...
@@ -127,11 +125,11 @@ BEGIN_TEST(TestEndOfList)
ASSERT(emptyPtr == nullptr, "expected nullptr");
// now add something to the list... and retest...
{
- MyNodePtr tmp(MyNode::create());
+ std::shared_ptr<MyNode> tmp(MyNode::create());
tmp->setValue(100);
lruList.appendEntry(tmp);
}
- MyNodePtr hundredPtr;
+ std::shared_ptr<MyNode> hundredPtr;
lruList.getLRUEntry(hundredPtr);
ASSERT(hundredPtr != nullptr, "expected to not be nullptr");
ASSERT(std::dynamic_pointer_cast<MyNode>(hundredPtr)->getValue() == 100,
@@ -146,7 +144,7 @@ END_TEST(TestEndOfList)
*/
BEGIN_TEST(LRUListEntryTest)
{
- MyNodePtr node(MyNode::create());
+ std::shared_ptr<MyNode> node(MyNode::create());
node->setValue(20);
// test initial state.
ASSERT(node->testRecentlyUsed() == false, "should not be marked used.");
diff --git a/cppcache/integration-test/testLinkage.cpp b/cppcache/integration-test/testLinkage.cpp
index 5a7b7fc..53108e7 100644
--- a/cppcache/integration-test/testLinkage.cpp
+++ b/cppcache/integration-test/testLinkage.cpp
@@ -17,7 +17,7 @@
#define ROOT_NAME "testLinkage"
-#include <geode/GeodeCppCache.hpp>
+#include <geode/AttributesFactory.hpp>
#include "fw_helper.hpp"
using namespace apache::geode::client;
@@ -31,13 +31,13 @@ BEGIN_TEST(LinkageTest)
AttributesFactory af;
{
- CacheablePtr cacheablePtr;
- CacheableKeyPtr cacheableKeyPtr;
- RegionPtr regionPtr;
+ std::shared_ptr<Cacheable> cacheablePtr;
+ std::shared_ptr<CacheableKey> cacheableKeyPtr;
+ std::shared_ptr<Region> regionPtr;
AttributesMutator am(regionPtr);
- RegionEntryPtr regionEntryPtr;
- CacheableStringPtr cacheableStringPtr;
- CachePtr cachePtr;
+ std::shared_ptr<RegionEntry> regionEntryPtr;
+ std::shared_ptr<CacheableString> cacheableStringPtr;
+ std::shared_ptr<Cache> cachePtr;
// add other ptr types here...
}
{
@@ -77,19 +77,19 @@ BEGIN_TEST(LinkageTest)
EntryExistsException aEntryExistsException("EntryExistsException");
}
- CachePtr cachePtr;
- CacheFactoryPtr cacheFactoryPtr = CacheFactory::createCacheFactory();
+ std::shared_ptr<Cache> cachePtr;
+ auto cacheFactoryPtr = CacheFactory::createCacheFactory();
cachePtr = cacheFactoryPtr->create();
// Cache cache;
ASSERT((!cachePtr->isClosed()), "cache shouldn't be closed.");
- RegionPtr rptr;
- SerializablePtr callback;
+ std::shared_ptr<Region> rptr;
+ std::shared_ptr<Serializable> callback;
// CacheListener cl;
- CacheListenerPtr clPtr;
+ std::shared_ptr<CacheListener> clPtr;
// CacheLoader cacheloader;
- CacheLoaderPtr cldPtr;
+ std::shared_ptr<CacheLoader> cldPtr;
// CacheStatistics cstats; NOT yet...
// CacheWriter cwriter;
- CacheWriterPtr cwPtr;
+ std::shared_ptr<CacheWriter> cwPtr;
END_TEST(LinkageTest)
diff --git a/cppcache/integration-test/testLogger.cpp b/cppcache/integration-test/testLogger.cpp
index ab46eeb..f965402 100644
--- a/cppcache/integration-test/testLogger.cpp
+++ b/cppcache/integration-test/testLogger.cpp
@@ -18,7 +18,7 @@
#define ROOT_NAME "testLogger"
#include "fw_helper.hpp"
-#include <geode/GeodeCppCache.hpp>
+#include <geode/ExceptionTypes.hpp>
#ifndef WIN32
#include <unistd.h>
diff --git a/cppcache/integration-test/testOverflowPutGetSqLite.cpp b/cppcache/integration-test/testOverflowPutGetSqLite.cpp
index cc89dd3..29e4bd9 100644
--- a/cppcache/integration-test/testOverflowPutGetSqLite.cpp
+++ b/cppcache/integration-test/testOverflowPutGetSqLite.cpp
@@ -22,8 +22,6 @@
#include <ace/OS.h>
-#include <geode/GeodeCppCache.hpp>
-
#include "fw_helper.hpp"
#include <CacheableToken.hpp>
#include <MapEntry.hpp>
@@ -35,7 +33,7 @@ uint32_t numOfEnt;
std::string sqlite_dir = "SqLiteRegionData";
// Return the number of keys and values in entries map.
-void getNumOfEntries(RegionPtr& regionPtr, uint32_t num) {
+void getNumOfEntries(std::shared_ptr<Region>& regionPtr, uint32_t num) {
auto v = regionPtr->keys();
auto vecValues = regionPtr->values();
printf("Values vector size is %zd\n", vecValues.size());
@@ -43,14 +41,14 @@ void getNumOfEntries(RegionPtr& regionPtr, uint32_t num) {
ASSERT(vecValues.size() == num, (char*)"size of value vec and num not equal");
}
-void setAttributes(RegionAttributesPtr& attrsPtr,
+void setAttributes(std::shared_ptr<RegionAttributes>& attrsPtr,
std::string pDir = sqlite_dir) {
AttributesFactory attrsFact;
attrsFact.setCachingEnabled(true);
attrsFact.setLruEntriesLimit(10);
attrsFact.setInitialCapacity(1000);
attrsFact.setDiskPolicy(DiskPolicyType::OVERFLOWS);
- PropertiesPtr sqliteProperties = Properties::create();
+ auto sqliteProperties = Properties::create();
sqliteProperties->insert("MaxPageCount", "1073741823");
sqliteProperties->insert("PageSize", "65536");
sqliteProperties->insert("PersistenceDirectory", pDir.c_str());
@@ -59,13 +57,13 @@ void setAttributes(RegionAttributesPtr& attrsPtr,
attrsPtr = attrsFact.createRegionAttributes();
}
-void setAttributesWithMirror(RegionAttributesPtr& attrsPtr) {
+void setAttributesWithMirror(std::shared_ptr<RegionAttributes>& attrsPtr) {
AttributesFactory attrsFact;
attrsFact.setCachingEnabled(true);
attrsFact.setLruEntriesLimit(20);
attrsFact.setInitialCapacity(1000);
attrsFact.setDiskPolicy(DiskPolicyType::OVERFLOWS);
- PropertiesPtr sqliteProperties = Properties::create();
+ auto sqliteProperties = Properties::create();
sqliteProperties->insert("MaxPageCount", "1073741823");
sqliteProperties->insert("PageSize", "65536");
sqliteProperties->insert("PersistenceDirectory", sqlite_dir.c_str());
@@ -75,8 +73,8 @@ void setAttributesWithMirror(RegionAttributesPtr& attrsPtr) {
}
// Testing for attibute validation.
-void validateAttribute(RegionPtr& regionPtr) {
- RegionAttributesPtr regAttr = regionPtr->getAttributes();
+void validateAttribute(std::shared_ptr<Region>& regionPtr) {
+ std::shared_ptr<RegionAttributes> regAttr = regionPtr->getAttributes();
int initialCapacity = regAttr->getInitialCapacity();
ASSERT(initialCapacity == 1000, "Expected initial capacity to be 1000");
const DiskPolicyType::PolicyType type = regAttr->getDiskPolicy();
@@ -84,15 +82,16 @@ void validateAttribute(RegionPtr& regionPtr) {
"Expected Action should overflow to disk");
}
-void checkOverflowTokenValues(RegionPtr& regionPtr, uint32_t num) {
- VectorOfCacheableKey v = regionPtr->keys();
- CacheableKeyPtr keyPtr;
- CacheablePtr valuePtr;
+void checkOverflowTokenValues(std::shared_ptr<Region>& regionPtr,
+ uint32_t num) {
+ std::vector<std::shared_ptr<CacheableKey>> v = regionPtr->keys();
+ std::shared_ptr<CacheableKey> keyPtr;
+ std::shared_ptr<Cacheable> valuePtr;
int count = 0;
int nonoverflowCount = 0;
for (uint32_t i = 0; i < num; i++) {
keyPtr = v.at(i);
- RegionEntryPtr rPtr = regionPtr->getEntry(keyPtr);
+ auto rPtr = regionPtr->getEntry(keyPtr);
valuePtr = rPtr->getValue();
if (CacheableToken::isOverflowed(valuePtr) == true) {
count++;
@@ -107,10 +106,10 @@ void checkOverflowTokenValues(RegionPtr& regionPtr, uint32_t num) {
"Non overflowed entries should match key size");
}
-void checkOverflowToken(RegionPtr& regionPtr, uint32_t lruLimit) {
- VectorOfCacheableKey v = regionPtr->keys();
- CacheableKeyPtr keyPtr;
- CacheablePtr valuePtr;
+void checkOverflowToken(std::shared_ptr<Region>& regionPtr, uint32_t lruLimit) {
+ std::vector<std::shared_ptr<CacheableKey>> v = regionPtr->keys();
+ std::shared_ptr<CacheableKey> keyPtr;
+ std::shared_ptr<Cacheable> valuePtr;
int normalCount = 0;
int overflowCount = 0;
int invalidCount = 0;
@@ -118,7 +117,7 @@ void checkOverflowToken(RegionPtr& regionPtr, uint32_t lruLimit) {
int tombstoneCount = 0;
for (uint32_t i = 0; i < static_cast<uint32_t>(v.size()); i++) {
keyPtr = v.at(i);
- RegionEntryPtr rPtr = regionPtr->getEntry(keyPtr);
+ auto rPtr = regionPtr->getEntry(keyPtr);
valuePtr = rPtr->getValue();
if (CacheableToken::isOverflowed(valuePtr) == true) {
overflowCount++;
@@ -145,28 +144,29 @@ void checkOverflowToken(RegionPtr& regionPtr, uint32_t lruLimit) {
}
// Testing for put operation
-void doNput(RegionPtr& regionPtr, uint32_t num, uint32_t start = 0) {
+void doNput(std::shared_ptr<Region>& regionPtr, uint32_t num,
+ uint32_t start = 0) {
char keybuf[100];
// Put 1 KB of data locally for each entry
char* text = new char[1024];
memset(text, 'A', 1023);
text[1023] = '\0';
- CacheableStringPtr valuePtr = CacheableString::create(text);
+ auto valuePtr = CacheableString::create(text);
for (uint32_t i = start; i < num; i++) {
sprintf(keybuf, "key-%d", i);
- CacheableKeyPtr key = CacheableKey::create(keybuf);
+ auto key = CacheableKey::create(keybuf);
printf("Putting key = %s\n", keybuf);
regionPtr->put(key, valuePtr);
}
}
-void doNputLargeData(RegionPtr& regionPtr, int num) {
+void doNputLargeData(std::shared_ptr<Region>& regionPtr, int num) {
// Put 1 MB of data locally for each entry
char* text = new char[1024 * 1024 /* 1 MB */];
memset(text, 'A', 1024 * 1024 - 1);
text[1024 * 1024 - 1] = '\0';
- CacheableStringPtr valuePtr = CacheableString::create(text);
+ auto valuePtr = CacheableString::create(text);
for (int item = 0; item < num; item++) {
regionPtr->put(CacheableKey::create(item), valuePtr);
}
@@ -175,7 +175,7 @@ void doNputLargeData(RegionPtr& regionPtr, int num) {
}
// Testing for get operation
-uint32_t doNgetLargeData(RegionPtr& regionPtr, int num) {
+uint32_t doNgetLargeData(std::shared_ptr<Region>& regionPtr, int num) {
uint32_t countFound = 0;
uint32_t countNotFound = 0;
@@ -194,7 +194,8 @@ uint32_t doNgetLargeData(RegionPtr& regionPtr, int num) {
}
// Testing for get operation
-uint32_t doNget(RegionPtr& regionPtr, uint32_t num, uint32_t start = 0) {
+uint32_t doNget(std::shared_ptr<Region>& regionPtr, uint32_t num,
+ uint32_t start = 0) {
uint32_t countFound = 0;
uint32_t countNotFound = 0;
@@ -221,10 +222,10 @@ uint32_t doNget(RegionPtr& regionPtr, uint32_t num, uint32_t start = 0) {
/**
* Test the entry operation ( local invalidate, localDestroy ).
*/
-void testEntryDestroy(RegionPtr& regionPtr, uint32_t num) {
- VectorOfCacheableKey v = regionPtr->keys();
- VectorOfCacheable vecValues;
- CacheablePtr valuePtr;
+void testEntryDestroy(std::shared_ptr<Region>& regionPtr, uint32_t num) {
+ std::vector<std::shared_ptr<CacheableKey>> v = regionPtr->keys();
+ std::vector<std::shared_ptr<Cacheable>> vecValues;
+ std::shared_ptr<Cacheable> valuePtr;
for (uint32_t i = 45; i < 50; i++) {
try {
std::cout << "try to destroy key" << i << std::endl;
@@ -238,10 +239,10 @@ void testEntryDestroy(RegionPtr& regionPtr, uint32_t num) {
ASSERT(v.size() == num - 5, (char*)"size of key vec not equal");
}
-void testEntryInvalidate(RegionPtr& regionPtr, uint32_t num) {
- VectorOfCacheableKey v = regionPtr->keys();
- VectorOfCacheable vecValues;
- CacheablePtr valuePtr;
+void testEntryInvalidate(std::shared_ptr<Region>& regionPtr, uint32_t num) {
+ std::vector<std::shared_ptr<CacheableKey>> v = regionPtr->keys();
+ std::vector<std::shared_ptr<Cacheable>> vecValues;
+ std::shared_ptr<Cacheable> valuePtr;
for (uint32_t i = 40; i < 45; i++) {
try {
std::cout << "try to invalidate key" << i << std::endl;
@@ -257,12 +258,12 @@ void testEntryInvalidate(RegionPtr& regionPtr, uint32_t num) {
class PutThread : public ACE_Task_Base {
private:
- RegionPtr m_regPtr;
+ std::shared_ptr<Region> m_regPtr;
int m_min;
int m_max;
public:
- PutThread(RegionPtr& regPtr, int min, int max)
+ PutThread(std::shared_ptr<Region>& regPtr, int min, int max)
: m_regPtr(regPtr), m_min(min), m_max(max) {}
int svc(void) {
@@ -279,8 +280,8 @@ class PutThread : public ACE_Task_Base {
void stop() { wait(); }
};
-void verifyGetAll(RegionPtr region, int startIndex) {
- VectorOfCacheableKey keysVector;
+void verifyGetAll(std::shared_ptr<Region> region, int startIndex) {
+ std::vector<std::shared_ptr<CacheableKey>> keysVector;
for (int i = 0; i <= 100; i++) keysVector.push_back(CacheableKey::create(i));
// keysVector.push_back(CacheableKey::create(101)); //key not there
@@ -289,7 +290,7 @@ void verifyGetAll(RegionPtr region, int startIndex) {
int i = startIndex;
for (const auto& iter : valuesMap) {
auto key = std::dynamic_pointer_cast<CacheableKey>(iter.first);
- CacheablePtr mVal = iter.second;
+ auto mVal = iter.second;
if (mVal != nullptr) {
int val = atoi(mVal->toString()->asChar());
ASSERT(val == i, "value not matched");
@@ -298,8 +299,9 @@ void verifyGetAll(RegionPtr region, int startIndex) {
}
}
-void createRegion(RegionPtr& regionPtr, const char* regionName,
- PropertiesPtr& cacheProps, PropertiesPtr& sqLiteProps) {
+void createRegion(std::shared_ptr<Region>& regionPtr, const char* regionName,
+ std::shared_ptr<Properties>& cacheProps,
+ std::shared_ptr<Properties>& sqLiteProps) {
auto cacheFactoryPtr = CacheFactory::createCacheFactory(cacheProps);
auto cachePtr = CacheFactory::createCacheFactory()->create();
ASSERT(cachePtr != nullptr, "Expected cache to be NON-nullptr");
@@ -314,7 +316,7 @@ void createRegion(RegionPtr& regionPtr, const char* regionName,
ASSERT(regionPtr != nullptr, "Expected regionPtr to be NON-nullptr");
}
-void setSqLiteProperties(PropertiesPtr& sqliteProperties,
+void setSqLiteProperties(std::shared_ptr<Properties>& sqliteProperties,
int maxPageCount = 1073741823, int pageSize = 65536,
std::string pDir = sqlite_dir) {
sqliteProperties = Properties::create();
@@ -326,9 +328,10 @@ void setSqLiteProperties(PropertiesPtr& sqliteProperties,
}
// creation of subregion.
-void createSubRegion(RegionPtr& regionPtr, RegionPtr& subRegion,
- const char* regionName, std::string pDir = sqlite_dir) {
- RegionAttributesPtr regionAttributesPtr;
+void createSubRegion(std::shared_ptr<Region>& regionPtr,
+ std::shared_ptr<Region>& subRegion, const char* regionName,
+ std::string pDir = sqlite_dir) {
+ std::shared_ptr<RegionAttributes> regionAttributesPtr;
setAttributes(regionAttributesPtr, pDir);
subRegion = regionPtr->createSubregion(regionName, regionAttributesPtr);
ASSERT(subRegion != nullptr, "Expected region to be NON-nullptr");
@@ -344,10 +347,10 @@ void createSubRegion(RegionPtr& regionPtr, RegionPtr& subRegion,
BEGIN_TEST(OverFlowTest)
{
/** Creating a cache to manage regions. */
- PropertiesPtr sqliteProperties;
- PropertiesPtr cacheProperties = Properties::create();
+ std::shared_ptr<Properties> sqliteProperties;
+ auto cacheProperties = Properties::create();
setSqLiteProperties(sqliteProperties);
- RegionPtr regionPtr;
+ std::shared_ptr<Region> regionPtr;
createRegion(regionPtr, "OverFlowRegion", cacheProperties,
sqliteProperties);
ASSERT(regionPtr != nullptr, "Expected regionPtr to be NON-nullptr");
@@ -375,7 +378,7 @@ BEGIN_TEST(OverFlowTest)
/** test to verify same region repeatedly to ensure that the persistece
files are created and destroyed correctly */
- RegionPtr subRegion;
+ std::shared_ptr<Region> subRegion;
for (int i = 0; i < 10; i++) {
createSubRegion(regionPtr, subRegion, "SubRegion");
ASSERT(subRegion != nullptr, "Expected region to be NON-nullptr");
@@ -402,7 +405,7 @@ END_TEST(OverFlowTest)
BEGIN_TEST(OverFlowTest_absPath)
{
- RegionAttributesPtr attrsPtr;
+ std::shared_ptr<RegionAttributes> attrsPtr;
char currWDPath[512];
char* wdPath = ACE_OS::getcwd(currWDPath, 512);
ASSERT(wdPath != nullptr,
@@ -410,10 +413,10 @@ BEGIN_TEST(OverFlowTest_absPath)
std::string absPersistenceDir = std::string(wdPath) + "/absSqLite";
/** Creating a cache to manage regions. */
- PropertiesPtr sqliteProperties;
- PropertiesPtr cacheProperties = Properties::create();
+ std::shared_ptr<Properties> sqliteProperties;
+ auto cacheProperties = Properties::create();
setSqLiteProperties(sqliteProperties, 1073741823, 65536, absPersistenceDir);
- RegionPtr regionPtr;
+ std::shared_ptr<Region> regionPtr;
createRegion(regionPtr, "OverFlowRegion", cacheProperties,
sqliteProperties);
ASSERT(regionPtr != nullptr, "Expected regionPtr to be NON-nullptr");
@@ -441,7 +444,7 @@ BEGIN_TEST(OverFlowTest_absPath)
/** check whether value get evicted and token gets set as overflow */
checkOverflowTokenValues(regionPtr, 45);
- RegionPtr subRegion;
+ std::shared_ptr<Region> subRegion;
for (int i = 0; i < 10; i++) {
createSubRegion(regionPtr, subRegion, "SubRegion", absPersistenceDir);
ASSERT(subRegion != nullptr, "Expected region to be NON-nullptr");
@@ -539,9 +542,9 @@ BEGIN_TEST(OverFlowTest_HeapLRU)
/** test to verify same region repeatedly to ensure that the persistece
files are created and destroyed correctly */
- RegionPtr subRegion;
+ std::shared_ptr<Region> subRegion;
for (int i = 0; i < 10; i++) {
- RegionAttributesPtr regionAttributesPtr;
+ std::shared_ptr<RegionAttributes> regionAttributesPtr;
setAttributes(regionAttributesPtr);
subRegion = regionPtr->createSubregion("SubRegion", regionAttributesPtr);
ASSERT(subRegion != nullptr, "Expected region to be NON-nullptr");
@@ -567,15 +570,15 @@ END_TEST(OverFlowTest_HeapLRU)
BEGIN_TEST(OverFlowTest_MultiThreaded)
{
/** Creating a cache to manage regions. */
- CachePtr cachePtr = CacheFactory::createCacheFactory()->create();
+ auto cachePtr = CacheFactory::createCacheFactory()->create();
ASSERT(cachePtr != nullptr, "Expected cache to be NON-nullptr");
- RegionAttributesPtr attrsPtr;
+ std::shared_ptr<RegionAttributes> attrsPtr;
setAttributes(attrsPtr);
ASSERT(attrsPtr != nullptr, "Expected region attributes to be NON-nullptr");
/** Create a region with caching and LRU. */
- RegionPtr regionPtr;
+ std::shared_ptr<Region> regionPtr;
CacheImpl* cacheImpl = CacheRegionHelper::getCacheImpl(cachePtr.get());
cacheImpl->createRegion("OverFlowRegion", attrsPtr, regionPtr);
ASSERT(regionPtr != nullptr, "Expected regionPtr to be NON-nullptr");
@@ -608,15 +611,15 @@ END_TEST(OverFlowTest_MultiThreaded)
BEGIN_TEST(OverFlowTest_PutGetAll)
{
/** Creating a cache to manage regions. */
- CachePtr cachePtr = CacheFactory::createCacheFactory()->create();
+ auto cachePtr = CacheFactory::createCacheFactory()->create();
ASSERT(cachePtr != nullptr, "Expected cache to be NON-nullptr");
- RegionAttributesPtr attrsPtr;
+ std::shared_ptr<RegionAttributes> attrsPtr;
setAttributes(attrsPtr);
ASSERT(attrsPtr != nullptr, "Expected region attributes to be NON-nullptr");
/** Create a region with caching and LRU. */
- RegionPtr regionPtr;
+ std::shared_ptr<Region> regionPtr;
CacheImpl* cacheImpl = CacheRegionHelper::getCacheImpl(cachePtr.get());
cacheImpl->createRegion("OverFlowRegion", attrsPtr, regionPtr);
ASSERT(regionPtr != nullptr, "Expected regionPtr to be NON-nullptr");
diff --git a/cppcache/integration-test/testRegionAccessThreadSafe.cpp b/cppcache/integration-test/testRegionAccessThreadSafe.cpp
index 46ff49c..541e325 100644
--- a/cppcache/integration-test/testRegionAccessThreadSafe.cpp
+++ b/cppcache/integration-test/testRegionAccessThreadSafe.cpp
@@ -16,7 +16,6 @@
*/
#include "fw_dunit.hpp"
#include "ThinClientHelper.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/Task.h>
#include <ace/Recursive_Thread_Mutex.h>
@@ -41,7 +40,7 @@ class GetRegionThread : public ACE_Task_Base {
while (m_running == true) {
SLEEP(40);
try {
- RegionPtr rptr = getHelper()->getRegion(m_path.c_str());
+ auto rptr = getHelper()->getRegion(m_path.c_str());
if (rptr != nullptr) {
ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_mutex);
ASSERT(m_regionCreateDone == true, "regionCreate Not Done");
@@ -57,7 +56,7 @@ class GetRegionThread : public ACE_Task_Base {
continue;
}
try {
- RegionPtr rptr = getHelper()->getRegion(m_subPath.c_str());
+ auto rptr = getHelper()->getRegion(m_subPath.c_str());
if (rptr != nullptr) {
ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_mutex);
ASSERT(m_subRegionCreateDone == true, "subRegionCreate Not Done");
@@ -97,7 +96,7 @@ bool isLocator = true;
const char* locHostPort =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, numberOfLocators);
GetRegionThread* getThread = nullptr;
-RegionPtr regionPtr;
+std::shared_ptr<Region> regionPtr;
DUNIT_TASK(s1p1, Setup)
{
CacheHelper::initLocator(1);
@@ -120,9 +119,9 @@ DUNIT_TASK(s2p2, CreateNormalRegion)
"DistRegionAck", USE_ACK, locHostPort, "__TEST_POOL1__", true, true);
getThread->setRegionFlag();
AttributesFactory af;
- RegionAttributesPtr rattrsPtr = af.createRegionAttributes();
- getThread->setSubRegionFlag();
- LOG("create normal region successful");
+ std::shared_ptr<RegionAttributes> rattrsPtr = af.createRegionAttributes();
+ getThread->setSubRegionFlag();
+ LOG("create normal region successful");
}
END_TASK(CreateNormalRegion)
diff --git a/cppcache/integration-test/testRegionMap.cpp b/cppcache/integration-test/testRegionMap.cpp
index 96a0ff7..a62813e 100644
--- a/cppcache/integration-test/testRegionMap.cpp
+++ b/cppcache/integration-test/testRegionMap.cpp
@@ -17,8 +17,6 @@
#include <iostream>
-#include <geode/GeodeCppCache.hpp>
-
#include "fw_helper.hpp"
using namespace apache::geode::client;
@@ -33,7 +31,7 @@ using namespace apache::geode::client;
BEGIN_TEST(TestRegionLRULastTen)
#if 1
CacheHelper& cacheHelper = CacheHelper::getHelper();
- RegionPtr regionPtr;
+ std::shared_ptr<Region> regionPtr;
cacheHelper.createLRURegion(fwtest_Name, regionPtr);
std::cout << regionPtr->getFullPath() << std::endl;
// put more than 10 items... verify limit is held.
@@ -41,25 +39,25 @@ BEGIN_TEST(TestRegionLRULastTen)
for (i = 0; i < 10; i++) {
char buf[100];
sprintf(buf, "%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
+ auto key = CacheableKey::create(buf);
sprintf(buf, "value of %d", i);
- CacheableStringPtr valuePtr = cacheHelper.createCacheable(buf);
+ auto valuePtr = cacheHelper.createCacheable(buf);
regionPtr->put(key, valuePtr);
- VectorOfCacheableKey vecKeys = regionPtr->keys();
+ std::vector<std::shared_ptr<CacheableKey>> vecKeys = regionPtr->keys();
ASSERT(vecKeys.size() == (i + 1), "expected more entries");
}
for (i = 10; i < 20; i++) {
char buf[100];
sprintf(buf, "%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
+ auto key = CacheableKey::create(buf);
sprintf(buf, "value of %d", i);
- CacheableStringPtr valuePtr = cacheHelper.createCacheable(buf);
+ auto valuePtr = cacheHelper.createCacheable(buf);
regionPtr->put(key, valuePtr);
- VectorOfCacheableKey vecKeys = regionPtr->keys();
+ std::vector<std::shared_ptr<CacheableKey>> vecKeys = regionPtr->keys();
cacheHelper.showKeys(vecKeys);
ASSERT(vecKeys.size() == (10), "expected 10 entries");
}
- VectorOfCacheableKey vecKeys = regionPtr->keys();
+ std::vector<std::shared_ptr<CacheableKey>> vecKeys = regionPtr->keys();
ASSERT(vecKeys.size() == 10, "expected 10 entries");
// verify it is the last 10 keys..
int expected = 0;
@@ -78,18 +76,18 @@ END_TEST(TestRegionLRULastTen)
BEGIN_TEST(TestRegionNoLRU)
#if 1
CacheHelper& cacheHelper = CacheHelper::getHelper();
- RegionPtr regionPtr;
+ std::shared_ptr<Region> regionPtr;
cacheHelper.createPlainRegion(fwtest_Name, regionPtr);
// put more than 10 items... verify limit is held.
uint32_t i;
for (i = 0; i < 20; i++) {
char buf[100];
sprintf(buf, "%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
+ auto key = CacheableKey::create(buf);
sprintf(buf, "value of %d", i);
- CacheableStringPtr valuePtr = cacheHelper.createCacheable(buf);
+ auto valuePtr = cacheHelper.createCacheable(buf);
regionPtr->put(key, valuePtr);
- VectorOfCacheableKey vecKeys = regionPtr->keys();
+ std::vector<std::shared_ptr<CacheableKey>> vecKeys = regionPtr->keys();
cacheHelper.showKeys(vecKeys);
ASSERT(vecKeys.size() == (i + 1), "unexpected entries count");
}
@@ -101,7 +99,7 @@ END_TEST(TestRegionNoLRU)
BEGIN_TEST(TestRegionLRULocal)
#if 1
CacheHelper& cacheHelper = CacheHelper::getHelper();
- RegionPtr regionPtr;
+ std::shared_ptr<Region> regionPtr;
cacheHelper.createLRURegion(fwtest_Name, regionPtr);
std::cout << regionPtr->getFullPath() << std::endl;
// put more than 10 items... verify limit is held.
@@ -111,11 +109,11 @@ BEGIN_TEST(TestRegionLRULocal)
for (i = 0; i < 1000; i++) {
char buf[100];
sprintf(buf, "%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
+ auto key = CacheableKey::create(buf);
sprintf(buf, "value of %d", i);
- CacheableStringPtr valuePtr = cacheHelper.createCacheable(buf);
+ auto valuePtr = cacheHelper.createCacheable(buf);
regionPtr->put(key, valuePtr);
- VectorOfCacheableKey vecKeys = regionPtr->keys();
+ std::vector<std::shared_ptr<CacheableKey>> vecKeys = regionPtr->keys();
ASSERT(vecKeys.size() == (i < 10 ? i + 1 : 10), "expected more entries");
}
@@ -129,7 +127,7 @@ BEGIN_TEST(TestRecentlyUsedBit)
// put 9 more... check that 15 was skipped for eviction.
// put 1 more... 15 should then have been evicted.
CacheHelper& cacheHelper = CacheHelper::getHelper();
- RegionPtr regionPtr;
+ std::shared_ptr<Region> regionPtr;
cacheHelper.createLRURegion(fwtest_Name, regionPtr);
std::cout << regionPtr->getFullPath() << std::endl;
// put more than 10 items... verify limit is held.
@@ -137,32 +135,32 @@ BEGIN_TEST(TestRecentlyUsedBit)
char buf[100];
for (i = 0; i < 20; i++) {
sprintf(buf, "%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
+ auto key = CacheableKey::create(buf);
sprintf(buf, "value of %d", i);
- CacheableStringPtr valuePtr = cacheHelper.createCacheable(buf);
+ auto valuePtr = cacheHelper.createCacheable(buf);
regionPtr->put(key, valuePtr);
}
sprintf(buf, "%d", 15);
- CacheableStringPtr value2Ptr;
- CacheableKeyPtr key2 = CacheableKey::create(buf);
+ std::shared_ptr<CacheableString> value2Ptr;
+ auto key2 = CacheableKey::create(buf);
value2Ptr = std::dynamic_pointer_cast<CacheableString>(regionPtr->get(key2));
ASSERT(value2Ptr != nullptr, "expected to find key 15 in cache.");
for (i = 20; i < 35; i++) {
sprintf(buf, "%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
- CacheableStringPtr valuePtr = cacheHelper.createCacheable(buf);
+ auto key = CacheableKey::create(buf);
+ auto valuePtr = cacheHelper.createCacheable(buf);
regionPtr->put(key, valuePtr);
- VectorOfCacheableKey vecKeys = regionPtr->keys();
+ std::vector<std::shared_ptr<CacheableKey>> vecKeys = regionPtr->keys();
cacheHelper.showKeys(vecKeys);
ASSERT(vecKeys.size() == 10, "expected more entries");
}
ASSERT(regionPtr->containsKey(key2), "expected to find key 15 in cache.");
{
sprintf(buf, "%d", 35);
- CacheableKeyPtr key = CacheableKey::create(buf);
- CacheableStringPtr valuePtr = cacheHelper.createCacheable(buf);
+ auto key = CacheableKey::create(buf);
+ auto valuePtr = cacheHelper.createCacheable(buf);
regionPtr->put(key, valuePtr);
- VectorOfCacheableKey vecKeys = regionPtr->keys();
+ std::vector<std::shared_ptr<CacheableKey>> vecKeys = regionPtr->keys();
cacheHelper.showKeys(vecKeys);
ASSERT(vecKeys.size() == 10, "expected more entries");
}
@@ -172,7 +170,7 @@ END_TEST(TestRecentlyUsedBit)
BEGIN_TEST(TestEmptiedMap)
CacheHelper& cacheHelper = CacheHelper::getHelper();
- RegionPtr regionPtr;
+ std::shared_ptr<Region> regionPtr;
cacheHelper.createLRURegion(fwtest_Name, regionPtr);
std::cout << regionPtr->getFullPath() << std::endl;
// put more than 10 items... verify limit is held.
@@ -180,30 +178,30 @@ BEGIN_TEST(TestEmptiedMap)
for (i = 0; i < 10; i++) {
char buf[100];
sprintf(buf, "%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
+ auto key = CacheableKey::create(buf);
sprintf(buf, "value of %d", i);
- CacheableStringPtr valuePtr = cacheHelper.createCacheable(buf);
+ auto valuePtr = cacheHelper.createCacheable(buf);
regionPtr->put(key, valuePtr);
- VectorOfCacheableKey vecKeys = regionPtr->keys();
+ std::vector<std::shared_ptr<CacheableKey>> vecKeys = regionPtr->keys();
ASSERT(vecKeys.size() == (i + 1), "expected more entries");
}
for (i = 0; i < 10; i++) {
char buf[100];
sprintf(buf, "%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
+ auto key = CacheableKey::create(buf);
regionPtr->destroy(key);
std::cout << "removed key "
<< std::dynamic_pointer_cast<CacheableString>(key)->asChar()
<< std::endl;
}
- VectorOfCacheableKey vecKeys = regionPtr->keys();
+ std::vector<std::shared_ptr<CacheableKey>> vecKeys = regionPtr->keys();
ASSERT(vecKeys.size() == 0, "expected more entries");
for (i = 20; i < 40; i++) {
char buf[100];
sprintf(buf, "%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
+ auto key = CacheableKey::create(buf);
sprintf(buf, "value of %d", i);
- CacheableStringPtr valuePtr = cacheHelper.createCacheable(buf);
+ auto valuePtr = cacheHelper.createCacheable(buf);
regionPtr->put(key, valuePtr);
}
vecKeys = regionPtr->keys();
diff --git a/cppcache/integration-test/testRegionTemplateArgs.cpp b/cppcache/integration-test/testRegionTemplateArgs.cpp
index 1418bea..18357e3 100644
--- a/cppcache/integration-test/testRegionTemplateArgs.cpp
+++ b/cppcache/integration-test/testRegionTemplateArgs.cpp
@@ -17,14 +17,14 @@
#define ROOT_NAME "testRegionTemplateArgs"
-#include <geode/GeodeCppCache.hpp>
#include "CacheRegionHelper.hpp"
#include "CacheImpl.hpp"
#include "fw_helper.hpp"
using namespace apache::geode::client;
-bool CheckBytesEqual(CacheableBytesPtr result, CacheablePtr expected) {
+bool CheckBytesEqual(std::shared_ptr<CacheableBytes> result,
+ std::shared_ptr<Cacheable> expected) {
auto expectedPtr = std::dynamic_pointer_cast<CacheableBytes>(expected);
// Assume that the bytes are really a char*
return (strcmp((char*)result->value(), (char*)expectedPtr->value()) == 0);
@@ -35,11 +35,11 @@ bool CheckBytesEqual(CacheableBytesPtr result, CacheablePtr expected) {
BEGIN_TEST(CheckTemplates)
{
- CacheFactoryPtr cacheFactoryPtr = CacheFactory::createCacheFactory();
- CachePtr cache = cacheFactoryPtr->create();
+ auto cacheFactoryPtr = CacheFactory::createCacheFactory();
+ auto cache = cacheFactoryPtr->create();
AttributesFactory afact;
- RegionAttributesPtr attrs = afact.createRegionAttributes();
- RegionPtr regPtr;
+ std::shared_ptr<RegionAttributes> attrs = afact.createRegionAttributes();
+ std::shared_ptr<Region> regPtr;
CacheImpl* cacheImpl = CacheRegionHelper::getCacheImpl(cache.get());
cacheImpl->createRegion("TestRegion", attrs, regPtr);
@@ -52,18 +52,18 @@ BEGIN_TEST(CheckTemplates)
const char baseKey[] = "test base key";
const char baseVal[] = "test base value";
int int32Key = 100;
- CacheableStringPtr stringPtr = CacheableString::create(stringKey);
- CacheableInt32Ptr int32Ptr = CacheableInt32::create(int32Key);
- CacheableBytesPtr bytesPtr = CacheableBytes::create(
+ auto stringPtr = CacheableString::create(stringKey);
+ auto int32Ptr = CacheableInt32::create(int32Key);
+ auto bytesPtr = CacheableBytes::create(
reinterpret_cast<const uint8_t*>(stringVal), sizeof(stringVal));
- CacheableKeyPtr keyPtr = CacheableString::create(baseKey);
- CacheablePtr valPtr = CacheableBytes::create(
+ auto keyPtr = CacheableString::create(baseKey);
+ auto valPtr = CacheableBytes::create(
reinterpret_cast<const uint8_t*>(baseVal), sizeof(baseVal));
- CacheableBytesPtr resValPtr;
- CacheableStringPtr resStringPtr;
- CacheableInt32Ptr resInt32Ptr;
- RegionEntryPtr resEntryPtr;
+ std::shared_ptr<CacheableBytes> resValPtr;
+ std::shared_ptr<CacheableString> resStringPtr;
+ std::shared_ptr<CacheableInt32> resInt32Ptr;
+ std::shared_ptr<RegionEntry> resEntryPtr;
/* ------ Test puts/gets of various shapes and sizes --------- */
diff --git a/cppcache/integration-test/testSerialization.cpp b/cppcache/integration-test/testSerialization.cpp
index 4941962..0f68829 100644
--- a/cppcache/integration-test/testSerialization.cpp
+++ b/cppcache/integration-test/testSerialization.cpp
@@ -22,7 +22,6 @@
#define ROOT_SCOPE DISTRIBUTED_ACK
-#include <geode/GeodeCppCache.hpp>
#include <SerializationRegistry.hpp>
#include <geode/CacheableString.hpp>
#include <geode/GeodeTypeIds.hpp>
@@ -106,8 +105,8 @@ class OtherType : public Serializable {
uint32_t size() const { return sizeof(CData); }
- static CacheablePtr uniqueCT(int32_t i,
- int32_t classIdToReturn = g_classIdToReturn) {
+ static std::shared_ptr<Cacheable> uniqueCT(
+ int32_t i, int32_t classIdToReturn = g_classIdToReturn) {
OtherType* ot = new OtherType(classIdToReturn);
ot->m_struct.a = (int)i;
ot->m_struct.b = (i % 2 == 0) ? true : false;
@@ -119,10 +118,10 @@ class OtherType : public Serializable {
printf("double hex 0x%016" PRIX64 "\n", ot->m_struct.e);
- return CacheablePtr(ot);
+ return std::shared_ptr<Cacheable>(ot);
}
- static void validateCT(int32_t i, const CacheablePtr otPtr) {
+ static void validateCT(int32_t i, const std::shared_ptr<Cacheable> otPtr) {
char logmsg[1000];
sprintf(logmsg, "validateCT for %d", i);
LOG(logmsg);
@@ -145,8 +144,7 @@ class OtherType : public Serializable {
#define NoDist s2p2
#define Sender s1p1
#define Receiver s1p2
-
-RegionPtr regionPtr;
+std::shared_ptr<Region> regionPtr;
DUNIT_TASK(Receiver, SetupR)
{
@@ -161,7 +159,7 @@ DUNIT_TASK(Sender, SetupAndPutInts)
{
initClientWithPool(true, "__TEST_POOL1__", locatorsG, nullptr, nullptr, 0,
true);
- SerializationRegistryPtr serializationRegistry =
+ auto serializationRegistry =
CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
->getSerializationRegistry();
serializationRegistry->addType(OtherType::createDeserializable);
diff --git a/cppcache/integration-test/testSpinLock.cpp b/cppcache/integration-test/testSpinLock.cpp
index 7c13441..15b380a 100644
--- a/cppcache/integration-test/testSpinLock.cpp
+++ b/cppcache/integration-test/testSpinLock.cpp
@@ -18,7 +18,6 @@
#define ROOT_NAME "testSpinLock"
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <mutex>
#include <util/concurrent/spinlock_mutex.hpp>
diff --git a/cppcache/integration-test/testSystemProperties.cpp b/cppcache/integration-test/testSystemProperties.cpp
index 9c72576..87d4072 100644
--- a/cppcache/integration-test/testSystemProperties.cpp
+++ b/cppcache/integration-test/testSystemProperties.cpp
@@ -18,7 +18,6 @@
#define ROOT_NAME "testSystemProperties"
#include "fw_helper.hpp"
-#include "geode/GeodeCppCache.hpp"
#include "geode/SystemProperties.hpp"
#include "geode/Properties.hpp"
@@ -28,13 +27,14 @@
using namespace apache::geode::client;
-const bool checkSecurityProperties(PropertiesPtr securityProperties,
- const char* key, const char* value) {
+const bool checkSecurityProperties(
+ std::shared_ptr<Properties> securityProperties, const char* key,
+ const char* value) {
bool flag;
if (key == nullptr || value == nullptr) {
return false;
}
- CacheableStringPtr tempValue = securityProperties->find(key);
+ auto tempValue = securityProperties->find(key);
if (tempValue == nullptr) {
return (false);
}
@@ -156,7 +156,7 @@ BEGIN_TEST(NEW_CONFIG)
ASSERT(sp->connectTimeout() == std::chrono::milliseconds(345),
"expected 345 for connect timeout");
- PropertiesPtr securityProperties = sp->getSecurityProperties();
+ auto securityProperties = sp->getSecurityProperties();
ASSERT(checkSecurityProperties(securityProperties, "security-username",
"username") == true,
"SecurityProperties Not Stored");
diff --git a/cppcache/integration-test/testThinClientAfterRegionLive.cpp b/cppcache/integration-test/testThinClientAfterRegionLive.cpp
index ffaa631..d76aded 100644
--- a/cppcache/integration-test/testThinClientAfterRegionLive.cpp
+++ b/cppcache/integration-test/testThinClientAfterRegionLive.cpp
@@ -40,7 +40,7 @@ class DisconnectCacheListioner : public CacheListener {
public:
explicit DisconnectCacheListioner(int index) { m_index = index; };
- void afterRegionDisconnected(const RegionPtr& region) {
+ void afterRegionDisconnected(const std::shared_ptr<Region>& region) {
isRegionDead[m_index] = true;
LOG("After Region Disconnected event received");
}
@@ -59,12 +59,12 @@ auto cptr4 = std::make_shared<DisconnectCacheListioner>(3);
void createPooledRegionMine(bool callReadyForEventsAPI = false) {
auto& poolManager = getHelper()->getCache()->getPoolManager();
- PoolFactoryPtr poolFacPtr = poolManager.createFactory();
+ auto poolFacPtr = poolManager.createFactory();
poolFacPtr->setSubscriptionEnabled(true);
getHelper()->addServerLocatorEPs(locatorsG, poolFacPtr);
if ((poolManager.find("__TEST_POOL1__")) ==
nullptr) { // Pool does not exist with the same name.
- PoolPtr pptr = poolFacPtr->create("__TEST_POOL1__");
+ auto pptr = poolFacPtr->create("__TEST_POOL1__");
}
SLEEP(10000);
AttributesFactory af;
@@ -78,21 +78,21 @@ void createPooledRegionMine(bool callReadyForEventsAPI = false) {
LOG("poolName = ");
LOG("__TEST_POOL1__");
af.setCacheListener(cptr1);
- RegionAttributesPtr rattrsPtr1 = af.createRegionAttributes();
+ std::shared_ptr<RegionAttributes> rattrsPtr1 = af.createRegionAttributes();
af.setCacheListener(cptr2);
- RegionAttributesPtr rattrsPtr2 = af.createRegionAttributes();
+ std::shared_ptr<RegionAttributes> rattrsPtr2 = af.createRegionAttributes();
af.setCacheListener(cptr3);
- RegionAttributesPtr rattrsPtr3 = af.createRegionAttributes();
+ std::shared_ptr<RegionAttributes> rattrsPtr3 = af.createRegionAttributes();
af.setCacheListener(cptr4);
- RegionAttributesPtr rattrsPtr4 = af.createRegionAttributes();
+ std::shared_ptr<RegionAttributes> rattrsPtr4 = af.createRegionAttributes();
CacheImpl* cacheImpl =
CacheRegionHelper::getCacheImpl(getHelper()->cachePtr.get());
- RegionPtr region1;
+ std::shared_ptr<Region> region1;
cacheImpl->createRegion(regionNames[0], rattrsPtr1, region1);
- RegionPtr region2;
+ std::shared_ptr<Region> region2;
cacheImpl->createRegion(regionNames[1], rattrsPtr2, region2);
- RegionPtr subregion1 = region1->createSubregion(regionNames[0], rattrsPtr3);
- RegionPtr subregion2 = region2->createSubregion(regionNames[1], rattrsPtr4);
+ auto subregion1 = region1->createSubregion(regionNames[0], rattrsPtr3);
+ auto subregion2 = region2->createSubregion(regionNames[1], rattrsPtr4);
if (callReadyForEventsAPI) {
getHelper()->cachePtr->readyForEvents();
}
@@ -106,7 +106,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, NotAutoReady_CallReadyForEvents)
{
- PropertiesPtr props(Properties::create());
+ std::shared_ptr<Properties> props(Properties::create());
props->insert("auto-ready-for-events", "false");
initClient(true, props);
createPooledRegionMine(true);
@@ -115,7 +115,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, NotAutoReady_DontCallReadyForEvents)
{
- PropertiesPtr props(Properties::create());
+ std::shared_ptr<Properties> props(Properties::create());
props->insert("auto-ready-for-events", "false");
initClient(true, props);
createPooledRegionMine(false);
@@ -185,9 +185,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, populateServer)
{
SLEEP(10000);
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
- CacheableKeyPtr keyPtr = createKey("PXR");
- CacheableStringPtr valPtr = CacheableString::create("PXR1");
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+ auto keyPtr = createKey("PXR");
+ auto valPtr = CacheableString::create("PXR1");
regPtr->create(keyPtr, valPtr);
}
END_TASK_DEFINITION
diff --git a/cppcache/integration-test/testThinClientBigValue.cpp b/cppcache/integration-test/testThinClientBigValue.cpp
index c88065f..4ff1c54 100644
--- a/cppcache/integration-test/testThinClientBigValue.cpp
+++ b/cppcache/integration-test/testThinClientBigValue.cpp
@@ -34,9 +34,9 @@ using namespace test;
void grow(int* iptr) { *iptr = *iptr + GROWTH; }
-void putSize(RegionPtr& rptr, const char* buf, int size) {
+void putSize(std::shared_ptr<Region>& rptr, const char* buf, int size) {
char msg[1024];
- CacheableKeyPtr keyPtr = CacheableKey::create(buf);
+ auto keyPtr = CacheableKey::create(buf);
uint8_t base = 0;
uint8_t* valbuf = new uint8_t[size + 1];
@@ -48,8 +48,8 @@ void putSize(RegionPtr& rptr, const char* buf, int size) {
base++;
}
}
- CacheableBytesPtr valPtr = CacheableBytes::create(valbuf, size);
- // CacheableStringPtr valPtr = CacheableString::create( valbuf);
+ auto valPtr = CacheableBytes::create(valbuf, size);
+ // auto valPtr = CacheableString::create( valbuf);
sprintf(msg, "about to put key: %s, with value size: %d", buf, size);
LOG(msg);
rptr->put(keyPtr, valPtr);
@@ -58,7 +58,7 @@ void putSize(RegionPtr& rptr, const char* buf, int size) {
LOG(msg);
}
-void verify(CacheableBytesPtr& valuePtr, int size) {
+void verify(std::shared_ptr<CacheableBytes>& valuePtr, int size) {
char msg[200];
sprintf(msg, "verifying value of size %d", size);
ASSERT(size == 0 || valuePtr != nullptr, msg);
@@ -126,7 +126,7 @@ END_TASK(SetupClient2)
DUNIT_TASK(CLIENT1, puts)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
char buf[1024];
LOG("Beginning puts.");
int expectEntries = 0;
@@ -145,7 +145,7 @@ END_TASK(puts)
DUNIT_TASK(CLIENT2, VerifyPuts)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
// region should already have n entries...
int entriesExpected ATTR_UNUSED =
dunit::globals()->getIntValue("entriesToExpect");
@@ -153,8 +153,8 @@ DUNIT_TASK(CLIENT2, VerifyPuts)
for (int i = 0; i <= MAX_PAYLOAD; grow(&i)) {
char keybuf[100];
sprintf(keybuf, "key%010d", i);
- CacheableKeyPtr keyPtr = CacheableKey::create(keybuf);
- CacheableBytesPtr valPtr =
+ auto keyPtr = CacheableKey::create(keybuf);
+ auto valPtr =
std::dynamic_pointer_cast<CacheableBytes>(regPtr->get(keyPtr));
int ntry = 20;
while ((ntry-- > 0) && (valPtr == nullptr)) {
@@ -170,7 +170,7 @@ END_TASK(VerifyPuts)
DUNIT_TASK(CLIENT1, ManyPuts)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
LOG("Beginning many puts.");
int expectEntries = 0;
char keybuf[100];
@@ -188,7 +188,7 @@ END_TASK(ManyPuts)
DUNIT_TASK(CLIENT2, VerifyManyPuts)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
// region should already have n entries...
int entriesExpected = dunit::globals()->getIntValue("entriesToExpect");
@@ -206,7 +206,7 @@ END_TASK(VerifyManyPuts)
DUNIT_TASK(CLIENT1, UpdateManyPuts)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
LOG("Beginning updated many puts.");
int expectEntries = 0;
char keybuf[100];
@@ -225,7 +225,7 @@ END_TASK(UpdateManyPuts)
DUNIT_TASK(CLIENT2, VerifyOldManyPuts)
{
// region should given old entries from cache
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
int entriesExpected = dunit::globals()->getIntValue("entriesToExpect");
char keybuf[100];
@@ -243,7 +243,7 @@ END_TASK(VerifyOldManyPuts)
DUNIT_TASK(CLIENT2, VerifyUpdatedManyPuts)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
// region should already have n entries...
int entriesExpected = dunit::globals()->getIntValue("entriesToExpect");
// invalidate the region to force getting new values
@@ -264,13 +264,13 @@ END_TASK(VerifyUpdatedManyPuts)
DUNIT_TASK(CLIENT2, VerifyUpdatedManyPutsGetAll)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
// region should already have n entries...
int entriesExpected = dunit::globals()->getIntValue("entriesToExpect");
// invalidate the region to force getting new values
regPtr->localInvalidateRegion();
- VectorOfCacheableKey vec;
+ std::vector<std::shared_ptr<CacheableKey>> vec;
char keybuf[100];
for (int index = 0; index < entriesExpected; ++index) {
sprintf(keybuf, "keys1%010d", index);
@@ -309,12 +309,12 @@ END_TASK(UpdateManyPutsInt64)
DUNIT_TASK(CLIENT2, VerifyManyPutsInt64)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
int entriesExpected = dunit::globals()->getIntValue("entriesToExpect");
for (int64_t index = 0; index < entriesExpected; ++index) {
int64_t key = index * index * index;
- // CacheableStringPtr valPtr =
+ // auto valPtr =
// std::dynamic_pointer_cast<CacheableString>(regPtr->get(key));
auto valPtr = std::dynamic_pointer_cast<CacheableString>(
regPtr->get(CacheableInt64::create(key)));
@@ -324,11 +324,11 @@ DUNIT_TASK(CLIENT2, VerifyManyPutsInt64)
LOG("On client Found all int64 entries with "
"correct size via get.");
for (int64_t index = 0; index < entriesExpected; ++index) {
- // CacheableKeyPtr key =
+ // auto key =
// CacheableKey::create(CacheableInt64::create(index
// * index * index));
- CacheableKeyPtr key = CacheableInt64::create(index * index * index);
- RegionEntryPtr entry = regPtr->getEntry(key);
+ auto key = CacheableInt64::create(index * index * index);
+ auto entry = regPtr->getEntry(key);
ASSERT(entry != nullptr, "expected non-null entry");
auto valPtr =
std::dynamic_pointer_cast<CacheableString>(entry->getValue());
@@ -342,14 +342,14 @@ END_TASK(VerifyManyPutsInt64)
DUNIT_TASK(CLIENT2, VerifyUpdatedManyPutsInt64GetAll)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
// region should already have n entries...
int entriesExpected = dunit::globals()->getIntValue("entriesToExpect");
// invalidate the region to force getting new
// values
regPtr->localInvalidateRegion();
- VectorOfCacheableKey vec;
+ std::vector<std::shared_ptr<CacheableKey>> vec;
for (int64_t index = 0; index < entriesExpected; ++index) {
int64_t key = index * index * index;
vec.push_back(CacheableInt64::create(key));
diff --git a/cppcache/integration-test/testThinClientCacheableStringArray.cpp b/cppcache/integration-test/testThinClientCacheableStringArray.cpp
index b6f5696..b248500 100644
--- a/cppcache/integration-test/testThinClientCacheableStringArray.cpp
+++ b/cppcache/integration-test/testThinClientCacheableStringArray.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <ace/Task.h>
@@ -69,25 +68,29 @@ DUNIT_TASK(CLIENT1, StepOne)
{
initClientWithPool(true, "__TEST_POOL1__", locHostPort, nullptr, nullptr, 0,
true);
- SerializationRegistryPtr serializationRegistry =
+ auto serializationRegistry =
CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
->getSerializationRegistry();
serializationRegistry->addType(Position::createDeserializable);
serializationRegistry->addType(Portfolio::createDeserializable);
- RegionPtr regptr = getHelper()->createPooledRegion(
+ auto regptr = getHelper()->createPooledRegion(
_regionNames[0], USE_ACK, locHostPort, "__TEST_POOL1__", true, true);
- RegionAttributesPtr lattribPtr = regptr->getAttributes();
- RegionPtr subregPtr = regptr->createSubregion(_regionNames[1], lattribPtr);
+ std::shared_ptr<RegionAttributes> lattribPtr = regptr->getAttributes();
+ auto subregPtr = regptr->createSubregion(_regionNames[1], lattribPtr);
QueryHelper* qh = &QueryHelper::getHelper();
- CacheableStringPtr cstr[4] = {
- CacheableStringPtr(CacheableString::create((const char*)"Taaa", 4)),
- CacheableStringPtr(CacheableString::create((const char*)"Tbbb", 4)),
- CacheableStringPtr(CacheableString::create((const char*)"Tccc", 4)),
- CacheableStringPtr(CacheableString::create((const char*)"Tddd", 4))};
- CacheableStringArrayPtr nm = CacheableStringArray::create(cstr, 4);
+ std::shared_ptr<CacheableString> cstr[4] = {
+ std::shared_ptr<CacheableString>(
+ CacheableString::create((const char*)"Taaa", 4)),
+ std::shared_ptr<CacheableString>(
+ CacheableString::create((const char*)"Tbbb", 4)),
+ std::shared_ptr<CacheableString>(
+ CacheableString::create((const char*)"Tccc", 4)),
+ std::shared_ptr<CacheableString>(
+ CacheableString::create((const char*)"Tddd", 4))};
+ auto nm = CacheableStringArray::create(cstr, 4);
qh->populatePortfolioData(regptr, 4, 3, 2, nm);
qh->populatePositionData(subregPtr, 4, 3);
@@ -98,12 +101,11 @@ END_TASK(StepOne)
DUNIT_TASK(CLIENT1, StepThree)
{
try {
- QueryServicePtr qs =
- getHelper()->cachePtr->getQueryService("__TEST_POOL1__");
+ auto qs = getHelper()->cachePtr->getQueryService("__TEST_POOL1__");
char* qryStr = (char*)"select * from /Portfolios p where p.ID < 3";
- QueryPtr qry = qs->newQuery(qryStr);
- SelectResultsPtr results;
+ auto qry = qs->newQuery(qryStr);
+ std::shared_ptr<SelectResults> results;
results = qry->execute();
SelectResultsIterator iter = results->getIterator();
@@ -113,9 +115,9 @@ DUNIT_TASK(CLIENT1, StepThree)
LOG(buf);
while (iter.hasNext()) {
count--;
- SerializablePtr ser = iter.next();
- PortfolioPtr portfolio = std::dynamic_pointer_cast<Portfolio>(ser);
- PositionPtr position = std::dynamic_pointer_cast<Position>(ser);
+ auto ser = iter.next();
+ auto portfolio = std::dynamic_pointer_cast<Portfolio>(ser);
+ auto position = std::dynamic_pointer_cast<Position>(ser);
if (portfolio != nullptr) {
printf(" query pulled portfolio object ID %d, pkid %s\n",
diff --git a/cppcache/integration-test/testThinClientCacheables.cpp b/cppcache/integration-test/testThinClientCacheables.cpp
index 195da71..9a2efbb 100644
--- a/cppcache/integration-test/testThinClientCacheables.cpp
+++ b/cppcache/integration-test/testThinClientCacheables.cpp
@@ -14,8 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+#define ROOT_NAME "testThinClientCacheables"
+#define ROOT_SCOPE DISTRIBUTED_ACK
+
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include "BuiltinCacheableWrappers.hpp"
#include <Utils.hpp>
@@ -24,9 +27,6 @@
#include <string>
-#define ROOT_NAME "testThinClientCacheables"
-#define ROOT_SCOPE DISTRIBUTED_ACK
-
#include "CacheHelper.hpp"
using namespace apache::geode::client;
@@ -71,14 +71,15 @@ void createRegion(const char* name, bool ackMode,
LOG("createRegion() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
- clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
+ clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
void checkGets(int maxKeys, int8_t keyTypeId, int8_t valTypeId,
- const RegionPtr& dataReg, const RegionPtr& verifyReg) {
+ const std::shared_ptr<Region>& dataReg,
+ const std::shared_ptr<Region>& verifyReg) {
for (int i = 0; i < maxKeys; i++) {
CacheableWrapper* tmpkey =
CacheableWrapperFactory::createInstance(keyTypeId);
@@ -88,11 +89,11 @@ void checkGets(int maxKeys, int8_t keyTypeId, int8_t valTypeId,
ASSERT(tmpval != nullptr, "tmpval is nullptr");
tmpkey->initKey(i, KEYSIZE);
auto key = std::dynamic_pointer_cast<CacheableKey>(tmpkey->getCacheable());
- CacheablePtr val = dataReg->get(key);
+ auto val = dataReg->get(key);
// also check that value is in local cache
- RegionEntryPtr entry = dataReg->getEntry(key);
+ auto entry = dataReg->getEntry(key);
ASSERT(entry != nullptr, "entry is nullptr");
- CacheablePtr localVal = entry->getValue();
+ auto localVal = entry->getValue();
uint32_t keychksum = tmpkey->getCheckSum();
auto int32val = std::dynamic_pointer_cast<CacheableInt32>(
verifyReg->get(static_cast<int32_t>(keychksum)));
@@ -149,10 +150,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutsTask)
LOG("PutsTask started.");
static int taskIndexPut = 0;
- std::vector<int8_t> keyTypes =
- CacheableWrapperFactory::getRegisteredKeyTypes();
- std::vector<int8_t> valueTypes =
- CacheableWrapperFactory::getRegisteredValueTypes();
+ auto keyTypes = CacheableWrapperFactory::getRegisteredKeyTypes();
+ auto valueTypes = CacheableWrapperFactory::getRegisteredValueTypes();
size_t keyTypeIndex = taskIndexPut / valueTypes.size();
size_t valueTypeIndex = taskIndexPut % valueTypes.size();
@@ -170,8 +169,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutsTask)
(key->maxKeys() < DEFAULTNUMKEYS ? key->maxKeys() : DEFAULTNUMKEYS);
delete key;
- RegionPtr dataReg = getHelper()->getRegion(regionNames[0]);
- RegionPtr verifyReg = getHelper()->getRegion(regionNames[1]);
+ auto dataReg = getHelper()->getRegion(regionNames[0]);
+ auto verifyReg = getHelper()->getRegion(regionNames[1]);
for (int i = 0; i < maxKeys; i++) {
CacheableWrapper* tmpkey =
CacheableWrapperFactory::createInstance(keyTypeId);
@@ -202,9 +201,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutsTask)
verifyReg->put(static_cast<int32_t>(keychksum),
static_cast<int32_t>(valchksum));
// also check that value is in local cache
- RegionEntryPtr entry = dataReg->getEntry(
+ auto entry = dataReg->getEntry(
std::dynamic_pointer_cast<CacheableKey>(tmpkey->getCacheable()));
- CacheablePtr localVal;
+ std::shared_ptr<Cacheable> localVal;
if (entry != nullptr) {
localVal = entry->getValue();
}
@@ -224,10 +223,8 @@ DUNIT_TASK_DEFINITION(CLIENT2, GetsTask)
LOG("GetsTask started.");
static int taskIndexGet = 0;
- std::vector<int8_t> keyTypes =
- CacheableWrapperFactory::getRegisteredKeyTypes();
- std::vector<int8_t> valueTypes =
- CacheableWrapperFactory::getRegisteredValueTypes();
+ auto keyTypes = CacheableWrapperFactory::getRegisteredKeyTypes();
+ auto valueTypes = CacheableWrapperFactory::getRegisteredValueTypes();
size_t keyTypeIndex = taskIndexGet / valueTypes.size();
size_t valueTypeIndex = taskIndexGet % valueTypes.size();
@@ -245,8 +242,8 @@ DUNIT_TASK_DEFINITION(CLIENT2, GetsTask)
(key->maxKeys() < DEFAULTNUMKEYS ? key->maxKeys() : DEFAULTNUMKEYS);
delete key;
- RegionPtr dataReg = getHelper()->getRegion(regionNames[0]);
- RegionPtr verifyReg = getHelper()->getRegion(regionNames[1]);
+ auto dataReg = getHelper()->getRegion(regionNames[0]);
+ auto verifyReg = getHelper()->getRegion(regionNames[1]);
dataReg->localInvalidateRegion();
verifyReg->localInvalidateRegion();
checkGets(maxKeys, keyTypeId, valTypeId, dataReg, verifyReg);
diff --git a/cppcache/integration-test/testThinClientCacheablesLimits.cpp b/cppcache/integration-test/testThinClientCacheablesLimits.cpp
index 1b70a5f..f06eb6e 100644
--- a/cppcache/integration-test/testThinClientCacheablesLimits.cpp
+++ b/cppcache/integration-test/testThinClientCacheablesLimits.cpp
@@ -14,8 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+#define ROOT_NAME "testThinClientCacheablesLimits"
+#define ROOT_SCOPE DISTRIBUTED_ACK
+
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include "BuiltinCacheableWrappers.hpp"
#include <ace/OS.h>
@@ -23,8 +26,6 @@
#include <cstring>
-#define ROOT_NAME "testThinClientCacheablesLimits"
-#define ROOT_SCOPE DISTRIBUTED_ACK
#include "CacheHelper.hpp"
#include "ThinClientHelper.hpp"
@@ -64,8 +65,8 @@ void createRegion(const char* name, bool ackMode,
LOG("createRegion() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr = getHelper()->createRegion(name, ackMode, false, nullptr,
- clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, false, nullptr,
+ clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -105,15 +106,14 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, PutsTask)
{
int sizeArray = sizeof(keyArr) / sizeof(int);
- RegionPtr verifyReg = getHelper()->getRegion(_regionNames[1]);
+ auto verifyReg = getHelper()->getRegion(_regionNames[1]);
for (int count = 0; count < sizeArray; count++) {
uint8_t* ptr = createRandByteArray(keyArr[count]);
char* ptrChar = createRandCharArray(keyArr[count]);
- CacheableBytesPtr emptyBytesArr = CacheableBytes::create();
- CacheableBytesPtr bytePtrSent =
- CacheableBytes::createNoCopy(ptr, keyArr[count]);
- CacheableStringPtr stringPtrSent =
+ auto emptyBytesArr = CacheableBytes::create();
+ auto bytePtrSent = CacheableBytes::createNoCopy(ptr, keyArr[count]);
+ auto stringPtrSent =
CacheableString::createNoCopy(ptrChar, keyArr[count]);
verifyReg->put(KEY_BYTE, bytePtrSent);
diff --git a/cppcache/integration-test/testThinClientClearRegion.cpp b/cppcache/integration-test/testThinClientClearRegion.cpp
index 17307d0..3dbf838 100644
--- a/cppcache/integration-test/testThinClientClearRegion.cpp
+++ b/cppcache/integration-test/testThinClientClearRegion.cpp
@@ -71,8 +71,8 @@ DUNIT_TASK(CLIENT1, SetupClient1)
true);
getHelper()->createPooledRegion(regionNames[0], false, locHostPort,
"__TEST_POOL1__", true, true);
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
- AttributesMutatorPtr mtor = regPtr->getAttributesMutator();
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+ auto mtor = regPtr->getAttributesMutator();
auto lster = std::make_shared<MyCacheListener>();
auto wter = std::make_shared<MyCacheWriter>();
mtor->setCacheListener(lster);
@@ -87,10 +87,10 @@ DUNIT_TASK(CLIENT2, SetupClient2)
true);
getHelper()->createPooledRegion(regionNames[0], false, locHostPort,
"__TEST_POOL1__", true, true);
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
regPtr->registerAllKeys();
- CacheableKeyPtr keyPtr = CacheableKey::create((const char*)"key01");
- CacheableBytesPtr valPtr =
+ auto keyPtr = CacheableKey::create((const char*)"key01");
+ auto valPtr =
CacheableBytes::create(reinterpret_cast<const uint8_t*>("value01"), 7);
regPtr->put(keyPtr, valPtr);
ASSERT(regPtr->size() == 1, "size incorrect");
@@ -99,7 +99,7 @@ END_TASK(SetupClient2)
DUNIT_TASK(CLIENT1, clear)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
ASSERT(regPtr->size() == 1, "size incorrect");
regPtr->clear();
ASSERT(regPtr->size() == 0, "size incorrect");
@@ -108,10 +108,10 @@ END_TASK(clear)
DUNIT_TASK(CLIENT2, VerifyClear)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
ASSERT(regPtr->size() == 0, "size incorrect");
- CacheableKeyPtr keyPtr = CacheableKey::create((const char*)"key02");
- CacheableBytesPtr valPtr =
+ auto keyPtr = CacheableKey::create((const char*)"key02");
+ auto valPtr =
CacheableBytes::create(reinterpret_cast<const uint8_t*>("value02"), 7);
regPtr->put(keyPtr, valPtr);
ASSERT(regPtr->size() == 1, "size incorrect");
@@ -123,20 +123,20 @@ END_TASK(VerifyClear)
DUNIT_TASK(CLIENT1, VerifyClear1)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
ASSERT(regPtr->size() == 1, "size incorrect");
regPtr->localClear();
ASSERT(regPtr->size() == 0, "size incorrect");
- CacheableKeyPtr keyPtr = CacheableKey::create((const char*)"key02");
+ auto keyPtr = CacheableKey::create((const char*)"key02");
ASSERT(regPtr->containsKeyOnServer(keyPtr), "key should be there");
- RegionAttributesPtr attr = regPtr->getAttributes();
- CacheListenerPtr clp = attr->getCacheListener();
+ std::shared_ptr<RegionAttributes> attr = regPtr->getAttributes();
+ auto clp = attr->getCacheListener();
MyCacheListener* mcl = dynamic_cast<MyCacheListener*>(clp.get());
char buf[1024];
sprintf(buf, "listener clear count=%d", mcl->getClearCnt());
LOG(buf);
ASSERT(mcl->getClearCnt() == 2, buf);
- CacheWriterPtr cwp = attr->getCacheWriter();
+ auto cwp = attr->getCacheWriter();
MyCacheWriter* mcw = dynamic_cast<MyCacheWriter*>(cwp.get());
sprintf(buf, "writer clear count=%d", mcw->getClearCnt());
LOG(buf);
diff --git a/cppcache/integration-test/testThinClientConflation.cpp b/cppcache/integration-test/testThinClientConflation.cpp
index c13ae95..babd98c 100644
--- a/cppcache/integration-test/testThinClientConflation.cpp
+++ b/cppcache/integration-test/testThinClientConflation.cpp
@@ -80,18 +80,12 @@ class OperMonitor : public CacheListener {
ASSERT(m_value == 5, buf);
}
};
-typedef std::shared_ptr<OperMonitor> OperMonitorPtr;
-void setCacheListener(const char* regName, OperMonitorPtr monitor) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
+void setCacheListener(const char* regName, std::shared_ptr<OperMonitor> monitor) {
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheListener(monitor);
-}
-
-OperMonitorPtr mon1C1 = nullptr;
-OperMonitorPtr mon2C1 = nullptr;
-OperMonitorPtr mon1C2 = nullptr;
-OperMonitorPtr mon2C2 = nullptr;
+}std::shared_ptr<OperMonitor> mon1C1 = nullptr;std::shared_ptr<OperMonitor> mon2C1=nullptr;std::shared_ptr<OperMonitor> mon1C2=nullptr;std::shared_ptr<OperMonitor> mon2C2=nullptr;
const char* regions[] = {"ConflatedRegion", "NonConflatedRegion"};
@@ -99,7 +93,7 @@ const char* regions[] = {"ConflatedRegion", "NonConflatedRegion"};
#include "ThinClientTasks_C2S2.hpp"
#include "LocatorHelper.hpp"
-void initClientCache(OperMonitorPtr& mon1, OperMonitorPtr& mon2, int durableIdx,
+void initClientCache(std::shared_ptr<OperMonitor>& mon1, std::shared_ptr<OperMonitor>& mon2, int durableIdx,
const char* conflation) {
initClientAndTwoRegions(durableIdx, 0, std::chrono::seconds(300), conflation,
regions);
@@ -110,8 +104,8 @@ void initClientCache(OperMonitorPtr& mon1, OperMonitorPtr& mon2, int durableIdx,
setCacheListener(regions[0], mon1);
setCacheListener(regions[1], mon2);
- RegionPtr regPtr0 = getHelper()->getRegion(regions[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regions[1]);
+ auto regPtr0 = getHelper()->getRegion(regions[0]);
+ auto regPtr1 = getHelper()->getRegion(regions[1]);
regPtr0->registerAllKeys(true);
regPtr1->registerAllKeys(true);
diff --git a/cppcache/integration-test/testThinClientContainsKeyOnServer.cpp b/cppcache/integration-test/testThinClientContainsKeyOnServer.cpp
index b07bf1a..9e975b4 100644
--- a/cppcache/integration-test/testThinClientContainsKeyOnServer.cpp
+++ b/cppcache/integration-test/testThinClientContainsKeyOnServer.cpp
@@ -44,8 +44,8 @@ DUNIT_TASK(CLIENT1, SetupClient1)
true);
getHelper()->createPooledRegion(regionNames[0], false, locatorsG,
"__TEST_POOL1__", true, true);
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
- CacheableKeyPtr key = CacheableKey::create((const char*)"key01");
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+ auto key = CacheableKey::create((const char*)"key01");
ASSERT(!regPtr->containsKeyOnServer(key), "key should not be there");
}
END_TASK(SetupClient1)
@@ -56,17 +56,17 @@ DUNIT_TASK(CLIENT2, SetupClient2)
true);
getHelper()->createPooledRegion(regionNames[0], false, locatorsG,
"__TEST_POOL1__", true, true);
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
- CacheableKeyPtr key = CacheableKey::create((const char*)"key01");
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+ auto key = CacheableKey::create((const char*)"key01");
ASSERT(!regPtr->containsKeyOnServer(key), "key should not be there");
}
END_TASK(SetupClient2)
DUNIT_TASK(CLIENT1, puts)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
- CacheableKeyPtr keyPtr = CacheableKey::create((const char*)"key01");
- CacheableBytesPtr valPtr =
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+ auto keyPtr = CacheableKey::create((const char*)"key01");
+ auto valPtr =
CacheableBytes::create(reinterpret_cast<const uint8_t*>("value01"), 7);
regPtr->put(keyPtr, valPtr);
ASSERT(regPtr->containsKeyOnServer(keyPtr), "key should be there");
@@ -75,8 +75,8 @@ END_TASK(puts)
DUNIT_TASK(CLIENT2, VerifyPuts)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
- CacheableKeyPtr keyPtr = CacheableKey::create((const char*)"key01");
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+ auto keyPtr = CacheableKey::create((const char*)"key01");
ASSERT(regPtr->containsKeyOnServer(keyPtr), "key should be there");
}
END_TASK(VerifyPuts)
diff --git a/cppcache/integration-test/testThinClientCq.cpp b/cppcache/integration-test/testThinClientCq.cpp
index 81225db..fd2a51e 100644
--- a/cppcache/integration-test/testThinClientCq.cpp
+++ b/cppcache/integration-test/testThinClientCq.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <geode/CqAttributesFactory.hpp>
#include <geode/CqAttributes.hpp>
#include <geode/CqListener.hpp>
@@ -83,7 +82,7 @@ void initClientCq(const bool isthinClient) {
ASSERT(cacheHelper, "Failed to create a CacheHelper client instance.");
try {
- SerializationRegistryPtr serializationRegistry =
+ auto serializationRegistry =
CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
->getSerializationRegistry();
serializationRegistry->addType(Position::createDeserializable);
@@ -231,7 +230,6 @@ class MyCqStatusListener : public CqStatusListener {
m_cqsConnectedCount = 0;
}
};
-typedef std::shared_ptr<MyCqStatusListener> MyCqStatusListenerPtr;
DUNIT_TASK_DEFINITION(LOCATORSERVER, CreateLocator)
{
@@ -301,11 +299,11 @@ END_TASK_DEFINITION
void stepOne() {
initClientCq(true);
createRegionForCQ(regionNamesCq[0], USE_ACK, true);
- RegionPtr regptr = getHelper()->getRegion(regionNamesCq[0]);
- RegionAttributesPtr lattribPtr = regptr->getAttributes();
- RegionPtr subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
+ auto regptr = getHelper()->getRegion(regionNamesCq[0]);
+ std::shared_ptr<RegionAttributes> lattribPtr = regptr->getAttributes();
+ auto subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
- LOG("StepOne complete.");
+ LOG("StepOne complete.");
}
void initCqStatusClient() {
@@ -350,11 +348,11 @@ END_TASK_DEFINITION
void stepOne2() {
initClientCq(true);
createRegionForCQ(regionNamesCq[0], USE_ACK, true);
- RegionPtr regptr = getHelper()->getRegion(regionNamesCq[0]);
- RegionAttributesPtr lattribPtr = regptr->getAttributes();
- RegionPtr subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
+ auto regptr = getHelper()->getRegion(regionNamesCq[0]);
+ std::shared_ptr<RegionAttributes> lattribPtr = regptr->getAttributes();
+ auto subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
- LOG("StepOne2 complete.");
+ LOG("StepOne2 complete.");
}
DUNIT_TASK_DEFINITION(CLIENT2, StepOne2_PoolLocator)
@@ -363,17 +361,17 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepTwo)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesCq[0]);
- RegionPtr subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNamesCq[0]);
+ auto subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
- QueryHelper* qh = &QueryHelper::getHelper();
+ QueryHelper* qh = &QueryHelper::getHelper();
- if (!m_isPdx) {
- qh->populatePortfolioData(regPtr0, 2, 1, 1);
- qh->populatePositionData(subregPtr0, 2, 1);
- } else {
- qh->populatePortfolioPdxData(regPtr0, 2, 1, 1);
- qh->populatePositionPdxData(subregPtr0, 2, 1);
+ if (!m_isPdx) {
+ qh->populatePortfolioData(regPtr0, 2, 1, 1);
+ qh->populatePositionData(subregPtr0, 2, 1);
+ } else {
+ qh->populatePortfolioPdxData(regPtr0, 2, 1, 1);
+ qh->populatePositionPdxData(subregPtr0, 2, 1);
}
LOG("StepTwo complete.");
@@ -385,9 +383,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
uint8_t i = 0;
QueryHelper* qh ATTR_UNUSED = &QueryHelper::getHelper();
- PoolPtr pool =
+ auto pool =
getHelper()->getCache()->getPoolManager().find(regionNamesCq[0]);
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
if (pool != nullptr) {
// Using region name as pool name as in ThinClientCq.hpp
qs = pool->getQueryService();
@@ -398,8 +396,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
for (i = 0; i < MAX_LISTNER; i++) {
auto cqLstner = std::make_shared<MyCqListener>(i);
cqFac.addCqListener(cqLstner);
- CqAttributesPtr cqAttr = cqFac.create();
- CqQueryPtr qry = qs->newCq(cqNames[i], queryStrings[i], cqAttr);
+ auto cqAttr = cqFac.create();
+ auto qry = qs->newCq(cqNames[i], queryStrings[i], cqAttr);
}
try {
@@ -420,28 +418,28 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
{
try {
LOG("Testing bug #1026");
- RegionPtr regionPtr = getHelper()->getRegion(regionNamesCq[0]);
- regionPtr->put("1026_Key1", "asdas");
- regionPtr->put("1026_Key2",
- "Schüler"); // string with extended charater set
- regionPtr->put("1026_Key3",
- "Gebäude"); // string with extended charater set
- regionPtr->put("1026_Key4",
- "Königin"); // string with extended charater set
-
- const char* qryStr = "select * from /Portfolios p where p='Schüler'";
-
- CqListenerPtr cqLstner(new MyCqListener1026);
- cqFac.addCqListener(cqLstner);
- CqAttributesPtr cqAttr = cqFac.create();
- CqQueryPtr qry = qs->newCq((char*)"1026_MyCq", qryStr, cqAttr);
-
- // execute Cq Query with initial Results
- CqResultsPtr resultsPtr = qry->executeWithInitialResults();
-
- LOGINFO("ResultSet Query returned %d rows", resultsPtr->size());
- LOG("Testing bug #1026 Complete");
- // Iterate through the rows of the query result.
+ auto regionPtr = getHelper()->getRegion(regionNamesCq[0]);
+ regionPtr->put("1026_Key1", "asdas");
+ regionPtr->put("1026_Key2",
+ "Schüler"); // string with extended charater set
+ regionPtr->put("1026_Key3",
+ "Gebäude"); // string with extended charater set
+ regionPtr->put("1026_Key4",
+ "Königin"); // string with extended charater set
+
+ const char* qryStr = "select * from /Portfolios p where p='Schüler'";
+
+ std::shared_ptr<CqListener> cqLstner(new MyCqListener1026);
+ cqFac.addCqListener(cqLstner);
+ auto cqAttr = cqFac.create();
+ auto qry = qs->newCq((char*)"1026_MyCq", qryStr, cqAttr);
+
+ // execute Cq Query with initial Results
+ auto resultsPtr = qry->executeWithInitialResults();
+
+ LOGINFO("ResultSet Query returned %d rows", resultsPtr->size());
+ LOG("Testing bug #1026 Complete");
+ // Iterate through the rows of the query result.
} catch (const Exception& geodeExcp) {
LOGERROR("CqQuery Geode Exception: %s", geodeExcp.getMessage());
FAIL(geodeExcp.getMessage());
@@ -453,34 +451,34 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, StepTwo2)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesCq[0]);
- RegionPtr subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNamesCq[0]);
+ auto subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
- QueryHelper* qh = &QueryHelper::getHelper();
+ QueryHelper* qh = &QueryHelper::getHelper();
+
+ if (!m_isPdx) {
+ qh->populatePortfolioData(regPtr0, 3, 2, 1);
+ qh->populatePositionData(subregPtr0, 3, 2);
+ } else {
+ qh->populatePortfolioPdxData(regPtr0, 3, 2, 1);
+ qh->populatePositionPdxData(subregPtr0, 3, 2);
+ }
+ std::shared_ptr<Cacheable> port = nullptr;
+ for (int i = 1; i < 3; i++) {
if (!m_isPdx) {
- qh->populatePortfolioData(regPtr0, 3, 2, 1);
- qh->populatePositionData(subregPtr0, 3, 2);
+ port = std::shared_ptr<Cacheable>(new Portfolio(i, 2));
} else {
- qh->populatePortfolioPdxData(regPtr0, 3, 2, 1);
- qh->populatePositionPdxData(subregPtr0, 3, 2);
+ port = std::shared_ptr<Cacheable>(new PortfolioPdx(i, 2));
}
- CacheablePtr port = nullptr;
- for (int i = 1; i < 3; i++) {
- if (!m_isPdx) {
- port = CacheablePtr(new Portfolio(i, 2));
- } else {
- port = CacheablePtr(new PortfolioPdx(i, 2));
- }
-
- CacheableKeyPtr keyport = CacheableKey::create("port1-1");
- regPtr0->put(keyport, port);
- SLEEP(10); // sleep a while to allow server query to complete
- }
+ auto keyport = CacheableKey::create("port1-1");
+ regPtr0->put(keyport, port);
+ SLEEP(10); // sleep a while to allow server query to complete
+ }
- LOG("StepTwo2 complete. Sleeping .25 min for server query to complete...");
- SLEEP(15000); // sleep .25 min to allow server query to complete
+ LOG("StepTwo2 complete. Sleeping .25 min for server query to complete...");
+ SLEEP(15000); // sleep .25 min to allow server query to complete
}
END_TASK_DEFINITION
@@ -488,9 +486,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
{
QueryHelper* qh ATTR_UNUSED = &QueryHelper::getHelper();
- PoolPtr pool =
+ auto pool =
getHelper()->getCache()->getPoolManager().find(regionNamesCq[0]);
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
if (pool != nullptr) {
// Using region name as pool name as in ThinClientCq.hpp
qs = pool->getQueryService();
@@ -517,83 +515,83 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
for (i = 0; i < MAX_LISTNER; i++) {
sprintf(buf, "get info for cq[%s]:", cqNames[i]);
LOG(buf);
- CqQueryPtr cqy = qs->getCq(cqNames[i]);
- CqStatisticsPtr cqStats = cqy->getStatistics();
- sprintf(buf,
- "Cq[%s]From CqStatistics: numInserts[%d], numDeletes[%d], "
- "numUpdates[%d], numEvents[%d]",
- cqNames[i], cqStats->numInserts(), cqStats->numDeletes(),
- cqStats->numUpdates(), cqStats->numEvents());
- LOG(buf);
- for (j = 0; j <= i; j++) {
- inserts[j] += cqStats->numInserts();
- updates[j] += cqStats->numUpdates();
- deletes[j] += cqStats->numDeletes();
- events[j] += cqStats->numEvents();
- }
- CqAttributesPtr cqAttr = cqy->getCqAttributes();
- auto vl = cqAttr->getCqListeners();
- sprintf(buf, "number of listeners for cq[%s] is %zd", cqNames[i],
- vl.size());
- LOG(buf);
- ASSERT(vl.size() == i + 1, "incorrect number of listeners");
- if (i == (MAX_LISTNER - 1)) {
- MyCqListener* myLl[MAX_LISTNER];
- for (int k = 0; k < MAX_LISTNER; k++) {
- MyCqListener* ml = dynamic_cast<MyCqListener*>(vl[k].get());
- myLl[ml->getId()] = ml;
- }
- for (j = 0; j < MAX_LISTNER; j++) {
- MyCqListener* ml = myLl[j];
- sprintf(buf,
- "MyCount for Listener[%d]: numInserts[%d], numDeletes[%d], "
- "numUpdates[%d], numEvents[%d]",
- j, ml->getNumInserts(), ml->getNumDeletes(),
- ml->getNumUpdates(), ml->getNumEvents());
- LOG(buf);
- sprintf(buf,
- "sum of stats for Listener[%d]: numInserts[%d], "
- "numDeletes[%d], numUpdates[%d], numEvents[%d]",
- j, inserts[j], deletes[j], updates[j], events[j]);
- LOG(buf);
- ASSERT(ml->getNumInserts() == inserts[j],
- "accumulative insert count incorrect");
- ASSERT(ml->getNumUpdates() == updates[j],
- "accumulative updates count incorrect");
- ASSERT(ml->getNumDeletes() == deletes[j],
- "accumulative deletes count incorrect");
- ASSERT(ml->getNumEvents() == events[j],
- "accumulative events count incorrect");
- }
- LOG("removing listener");
- CqAttributesMutatorPtr cqAttrMtor = cqy->getCqAttributesMutator();
- CqListenerPtr ptr = vl[0];
- cqAttrMtor->removeCqListener(ptr);
- vl = cqAttr->getCqListeners();
- sprintf(buf, "number of listeners for cq[%s] is %zd", cqNames[i],
- vl.size());
- LOG(buf);
- ASSERT(vl.size() == i, "incorrect number of listeners");
- }
+ auto cqy = qs->getCq(cqNames[i]);
+ auto cqStats = cqy->getStatistics();
+ sprintf(buf,
+ "Cq[%s]From CqStatistics: numInserts[%d], numDeletes[%d], "
+ "numUpdates[%d], numEvents[%d]",
+ cqNames[i], cqStats->numInserts(), cqStats->numDeletes(),
+ cqStats->numUpdates(), cqStats->numEvents());
+ LOG(buf);
+ for (j = 0; j <= i; j++) {
+ inserts[j] += cqStats->numInserts();
+ updates[j] += cqStats->numUpdates();
+ deletes[j] += cqStats->numDeletes();
+ events[j] += cqStats->numEvents();
+ }
+ auto cqAttr = cqy->getCqAttributes();
+ auto vl = cqAttr->getCqListeners();
+ sprintf(buf, "number of listeners for cq[%s] is %zd", cqNames[i],
+ vl.size());
+ LOG(buf);
+ ASSERT(vl.size() == i + 1, "incorrect number of listeners");
+ if (i == (MAX_LISTNER - 1)) {
+ MyCqListener* myLl[MAX_LISTNER];
+ for (int k = 0; k < MAX_LISTNER; k++) {
+ MyCqListener* ml = dynamic_cast<MyCqListener*>(vl[k].get());
+ myLl[ml->getId()] = ml;
+ }
+ for (j = 0; j < MAX_LISTNER; j++) {
+ MyCqListener* ml = myLl[j];
+ sprintf(buf,
+ "MyCount for Listener[%d]: numInserts[%d], numDeletes[%d], "
+ "numUpdates[%d], numEvents[%d]",
+ j, ml->getNumInserts(), ml->getNumDeletes(),
+ ml->getNumUpdates(), ml->getNumEvents());
+ LOG(buf);
+ sprintf(buf,
+ "sum of stats for Listener[%d]: numInserts[%d], "
+ "numDeletes[%d], numUpdates[%d], numEvents[%d]",
+ j, inserts[j], deletes[j], updates[j], events[j]);
+ LOG(buf);
+ ASSERT(ml->getNumInserts() == inserts[j],
+ "accumulative insert count incorrect");
+ ASSERT(ml->getNumUpdates() == updates[j],
+ "accumulative updates count incorrect");
+ ASSERT(ml->getNumDeletes() == deletes[j],
+ "accumulative deletes count incorrect");
+ ASSERT(ml->getNumEvents() == events[j],
+ "accumulative events count incorrect");
+ }
+ LOG("removing listener");
+ auto cqAttrMtor = cqy->getCqAttributesMutator();
+ auto ptr = vl[0];
+ cqAttrMtor->removeCqListener(ptr);
+ vl = cqAttr->getCqListeners();
+ sprintf(buf, "number of listeners for cq[%s] is %zd", cqNames[i],
+ vl.size());
+ LOG(buf);
+ ASSERT(vl.size() == i, "incorrect number of listeners");
+ }
}
try {
- CqQueryPtr cqy = qs->getCq(cqNames[1]);
- cqy->stop();
-
- cqy = qs->getCq(cqNames[6]);
-
- sprintf(buf, "cq[%s] should have been running!", cqNames[6]);
- ASSERT(cqy->isRunning() == true, buf);
- bool got_exception = false;
- try {
- cqy->execute();
- } catch (IllegalStateException& excp) {
- std::string failmsg = "";
- failmsg += excp.getName();
- failmsg += ": ";
- failmsg += excp.getMessage();
- LOG(failmsg.c_str());
- got_exception = true;
+ auto cqy = qs->getCq(cqNames[1]);
+ cqy->stop();
+
+ cqy = qs->getCq(cqNames[6]);
+
+ sprintf(buf, "cq[%s] should have been running!", cqNames[6]);
+ ASSERT(cqy->isRunning() == true, buf);
+ bool got_exception = false;
+ try {
+ cqy->execute();
+ } catch (IllegalStateException& excp) {
+ std::string failmsg = "";
+ failmsg += excp.getName();
+ failmsg += ": ";
+ failmsg += excp.getMessage();
+ LOG(failmsg.c_str());
+ got_exception = true;
}
sprintf(buf, "cq[%s] should gotten exception!", cqNames[6]);
ASSERT(got_exception == true, buf);
@@ -621,43 +619,43 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
FAIL(failmsg.c_str());
excp.printStackTrace();
}
- CqServiceStatisticsPtr serviceStats = qs->getCqServiceStatistics();
- ASSERT(serviceStats != nullptr, "serviceStats is nullptr");
- sprintf(buf,
- "numCqsActive=%d, numCqsCreated=%d, "
- "numCqsClosed=%d,numCqsStopped=%d, numCqsOnClient=%d",
- serviceStats->numCqsActive(), serviceStats->numCqsCreated(),
- serviceStats->numCqsClosed(), serviceStats->numCqsStopped(),
- serviceStats->numCqsOnClient());
+ auto serviceStats = qs->getCqServiceStatistics();
+ ASSERT(serviceStats != nullptr, "serviceStats is nullptr");
+ sprintf(buf,
+ "numCqsActive=%d, numCqsCreated=%d, "
+ "numCqsClosed=%d,numCqsStopped=%d, numCqsOnClient=%d",
+ serviceStats->numCqsActive(), serviceStats->numCqsCreated(),
+ serviceStats->numCqsClosed(), serviceStats->numCqsStopped(),
+ serviceStats->numCqsOnClient());
+ LOG(buf);
+ /*
+ for(i=0; i < MAX_LISTNER; i++)
+ {
+ auto cqy = qs->getCq(cqNames[i]);
+ CqState::StateType state = cqy->getState();
+ CqState cqState;
+ cqState.setState(state);
+ sprintf(buf, "cq[%s] is in state[%s]", cqNames[i], cqState.toString());
LOG(buf);
- /*
- for(i=0; i < MAX_LISTNER; i++)
- {
- CqQueryPtr cqy = qs->getCq(cqNames[i]);
- CqState::StateType state = cqy->getState();
- CqState cqState;
- cqState.setState(state);
- sprintf(buf, "cq[%s] is in state[%s]", cqNames[i], cqState.toString());
- LOG(buf);
- }
- */
-
- ASSERT(serviceStats->numCqsActive() == 6, "active count incorrect!");
- ASSERT(serviceStats->numCqsCreated() == 9, "created count incorrect!");
- ASSERT(serviceStats->numCqsClosed() == 1, "closed count incorrect!");
- ASSERT(serviceStats->numCqsStopped() == 2, "stopped count incorrect!");
- ASSERT(serviceStats->numCqsOnClient() == 8, "cq count incorrect!");
-
- try {
- qs->stopCqs();
- } catch (Exception& excp) {
- std::string failmsg = "";
- failmsg += excp.getName();
- failmsg += ": ";
- failmsg += excp.getMessage();
- LOG(failmsg.c_str());
- FAIL(failmsg.c_str());
- excp.printStackTrace();
+ }
+ */
+
+ ASSERT(serviceStats->numCqsActive() == 6, "active count incorrect!");
+ ASSERT(serviceStats->numCqsCreated() == 9, "created count incorrect!");
+ ASSERT(serviceStats->numCqsClosed() == 1, "closed count incorrect!");
+ ASSERT(serviceStats->numCqsStopped() == 2, "stopped count incorrect!");
+ ASSERT(serviceStats->numCqsOnClient() == 8, "cq count incorrect!");
+
+ try {
+ qs->stopCqs();
+ } catch (Exception& excp) {
+ std::string failmsg = "";
+ failmsg += excp.getName();
+ failmsg += ": ";
+ failmsg += excp.getMessage();
+ LOG(failmsg.c_str());
+ FAIL(failmsg.c_str());
+ excp.printStackTrace();
}
sprintf(buf,
"numCqsActive=%d, numCqsCreated=%d, "
@@ -698,20 +696,20 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
i = 0;
auto cqLstner = std::make_shared<MyCqListener>(i);
cqFac.addCqListener(cqLstner);
- CqAttributesPtr cqAttr = cqFac.create();
- try {
- CqQueryPtr qry = qs->newCq(cqNames[i], queryStrings[i], cqAttr);
- qry->execute();
- qry->stop();
- qry->close();
- } catch (Exception& excp) {
- std::string failmsg = "";
- failmsg += excp.getName();
- failmsg += ": ";
- failmsg += excp.getMessage();
- LOG(failmsg.c_str());
- FAIL(failmsg.c_str());
- excp.printStackTrace();
+ auto cqAttr = cqFac.create();
+ try {
+ auto qry = qs->newCq(cqNames[i], queryStrings[i], cqAttr);
+ qry->execute();
+ qry->stop();
+ qry->close();
+ } catch (Exception& excp) {
+ std::string failmsg = "";
+ failmsg += excp.getName();
+ failmsg += ": ";
+ failmsg += excp.getMessage();
+ LOG(failmsg.c_str());
+ FAIL(failmsg.c_str());
+ excp.printStackTrace();
}
LOG("StepFour complete.");
@@ -798,41 +796,39 @@ DUNIT_TASK_DEFINITION(CLIENT1, createCQ)
{
SLEEP(10000);
// Create CqAttributes and Install Listener
- PoolPtr pool = getHelper()->getCache()->getPoolManager().find(regionName);
- QueryServicePtr qs = pool->getQueryService();
- CqAttributesFactory cqFac;
- auto cqLstner = std::make_shared<MyCqStatusListener>(100);
- cqFac.addCqListener(cqLstner);
- CqAttributesPtr cqAttr = cqFac.create();
- CqQueryPtr cq =
- qs->newCq(const_cast<char*>(cqName), cqQueryStatusString, cqAttr);
-
- cq->execute();
- SLEEP(20000);
-
- cqAttr = cq->getCqAttributes();
- auto vl = cqAttr->getCqListeners();
- MyCqStatusListener* myStatusCq =
- dynamic_cast<MyCqStatusListener*>(vl[0].get());
- LOGINFO("checkCQStatusOnConnect = %d ", myStatusCq->getCqsConnectedCount());
- ASSERT(myStatusCq->getCqsConnectedCount() == 1,
- "incorrect number of CqStatus Connected count.");
- LOG("createCQ complete.");
+ auto pool = getHelper()->getCache()->getPoolManager().find(regionName);
+ auto qs = pool->getQueryService();
+ CqAttributesFactory cqFac;
+ auto cqLstner = std::make_shared<MyCqStatusListener>(100);
+ cqFac.addCqListener(cqLstner);
+ auto cqAttr = cqFac.create();
+ auto cq = qs->newCq(const_cast<char*>(cqName), cqQueryStatusString, cqAttr);
+
+ cq->execute();
+ SLEEP(20000);
+
+ cqAttr = cq->getCqAttributes();
+ auto vl = cqAttr->getCqListeners();
+ MyCqStatusListener* myStatusCq =
+ dynamic_cast<MyCqStatusListener*>(vl[0].get());
+ LOGINFO("checkCQStatusOnConnect = %d ", myStatusCq->getCqsConnectedCount());
+ ASSERT(myStatusCq->getCqsConnectedCount() == 1,
+ "incorrect number of CqStatus Connected count.");
+ LOG("createCQ complete.");
}
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, createCQ_Pool)
{
- PoolPtr pool =
+ auto pool =
getHelper()->getCache()->getPoolManager().find("__TEST_POOL1__");
- QueryServicePtr qs = pool->getQueryService();
+ auto qs = pool->getQueryService();
CqAttributesFactory cqFac;
auto cqLstner = std::make_shared<MyCqStatusListener>(100);
cqFac.addCqListener(cqLstner);
- CqAttributesPtr cqAttr = cqFac.create();
+ auto cqAttr = cqFac.create();
- CqQueryPtr cq =
- qs->newCq(const_cast<char*>(cqName), cqQueryStatusString, cqAttr);
+ auto cq = qs->newCq(const_cast<char*>(cqName), cqQueryStatusString, cqAttr);
cq->execute();
SLEEP(20000);
@@ -844,14 +840,14 @@ DUNIT_TASK_DEFINITION(CLIENT1, createCQ_Pool)
ASSERT(myStatusCq->getCqsConnectedCount() == 1,
"incorrect number of CqStatus Connected count.");
- PoolPtr pool2 =
+ auto pool2 =
getHelper()->getCache()->getPoolManager().find("__TEST_POOL2__");
- QueryServicePtr qs2 = pool2->getQueryService();
+ auto qs2 = pool2->getQueryService();
CqAttributesFactory cqFac1;
auto cqLstner1 = std::make_shared<MyCqStatusListener>(101);
cqFac1.addCqListener(cqLstner1);
- CqAttributesPtr cqAttr1 = cqFac1.create();
- CqQueryPtr cq2 =
+ auto cqAttr1 = cqFac1.create();
+ auto cq2 =
qs2->newCq(const_cast<char*>(cqName1), cqQueryStatusString1, cqAttr1);
cq2->execute();
SLEEP(20000);
@@ -865,16 +861,16 @@ DUNIT_TASK_DEFINITION(CLIENT1, createCQ_Pool)
ASSERT(myStatusCq2->getCqsConnectedCount() == 1,
"incorrect number of CqStatus Connected count.");
- RegionPtr regPtr0 = getHelper()->getRegion(regionName);
- RegionPtr regPtr1 = getHelper()->getRegion(regionName1);
- CacheablePtr val = nullptr;
+ auto regPtr0 = getHelper()->getRegion(regionName);
+ auto regPtr1 = getHelper()->getRegion(regionName1);
+ std::shared_ptr<Cacheable> val = nullptr;
char KeyStr[256] = {0};
char valStr[256] = {0};
for (int i = 1; i <= 5; i++) {
ACE_OS::snprintf(KeyStr, 256, "Key-%d ", i);
ACE_OS::snprintf(valStr, 256, "val-%d ", i);
- CacheableKeyPtr keyport = CacheableKey::create(KeyStr);
- CacheablePtr valport = CacheableString::create(valStr);
+ auto keyport = CacheableKey::create(KeyStr);
+ auto valport = CacheableString::create(valStr);
regPtr0->put(keyport, valport);
regPtr1->put(keyport, valport);
SLEEP(10 * 1000); // sleep a while to allow server query to complete
@@ -894,12 +890,12 @@ DUNIT_TASK_DEFINITION(CLIENT1, createCQ_Pool)
END_TASK_DEFINITION
void executeCq(const char* poolName, const char* name) {
- PoolPtr pool = getHelper()->getCache()->getPoolManager().find(poolName);
- QueryServicePtr qs;
- if (pool != nullptr) {
- qs = pool->getQueryService();
+ auto pool = getHelper()->getCache()->getPoolManager().find(poolName);
+ std::shared_ptr<QueryService> qs;
+ if (pool != nullptr) {
+ qs = pool->getQueryService();
}
- CqQueryPtr cq = qs->getCq(const_cast<char*>(name));
+ auto cq = qs->getCq(const_cast<char*>(name));
cq->execute();
SLEEP(20000);
LOG("executeCq complete");
@@ -914,13 +910,13 @@ END_TASK_DEFINITION
void checkCQStatusOnConnect(const char* poolName, const char* name,
int connect) {
- PoolPtr pool = getHelper()->getCache()->getPoolManager().find(poolName);
- QueryServicePtr qs;
- if (pool != nullptr) {
- qs = pool->getQueryService();
+ auto pool = getHelper()->getCache()->getPoolManager().find(poolName);
+ std::shared_ptr<QueryService> qs;
+ if (pool != nullptr) {
+ qs = pool->getQueryService();
}
- CqQueryPtr cq = qs->getCq(const_cast<char*>(name));
- CqAttributesPtr cqAttr = cq->getCqAttributes();
+ auto cq = qs->getCq(const_cast<char*>(name));
+ auto cqAttr = cq->getCqAttributes();
auto vl = cqAttr->getCqListeners();
MyCqStatusListener* myStatusCq =
dynamic_cast<MyCqStatusListener*>(vl[0].get());
@@ -957,13 +953,13 @@ END_TASK_DEFINITION
void checkCQStatusOnDisConnect(const char* poolName, const char* cqName,
int disconnect) {
- PoolPtr pool = getHelper()->getCache()->getPoolManager().find(poolName);
- QueryServicePtr qs;
- if (pool != nullptr) {
- qs = pool->getQueryService();
+ auto pool = getHelper()->getCache()->getPoolManager().find(poolName);
+ std::shared_ptr<QueryService> qs;
+ if (pool != nullptr) {
+ qs = pool->getQueryService();
}
- CqQueryPtr cq = qs->getCq(const_cast<char*>(cqName));
- CqAttributesPtr cqAttr = cq->getCqAttributes();
+ auto cq = qs->getCq(const_cast<char*>(cqName));
+ auto cqAttr = cq->getCqAttributes();
auto vl = cqAttr->getCqListeners();
auto myStatusCq = std::dynamic_pointer_cast<MyCqStatusListener>(vl[0]);
LOGINFO("checkCQStatusOnDisConnect = %d ",
@@ -1007,33 +1003,33 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, putEntries)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionName);
- RegionPtr regPtr1 = getHelper()->getRegion(regionName1);
- CacheablePtr val = nullptr;
- char KeyStr[256] = {0};
- char valStr[256] = {0};
- for (int i = 1; i <= 5; i++) {
- ACE_OS::snprintf(KeyStr, 256, "Key-%d ", i);
- ACE_OS::snprintf(valStr, 256, "val-%d ", i);
- CacheableKeyPtr keyport = CacheableKey::create(KeyStr);
- CacheablePtr valport = CacheableString::create(valStr);
- regPtr0->put(keyport, valport);
- regPtr1->put(keyport, valport);
- SLEEP(10 * 1000); // sleep a while to allow server query to complete
- }
- LOGINFO("putEntries complete");
+ auto regPtr0 = getHelper()->getRegion(regionName);
+ auto regPtr1 = getHelper()->getRegion(regionName1);
+ std::shared_ptr<Cacheable> val = nullptr;
+ char KeyStr[256] = {0};
+ char valStr[256] = {0};
+ for (int i = 1; i <= 5; i++) {
+ ACE_OS::snprintf(KeyStr, 256, "Key-%d ", i);
+ ACE_OS::snprintf(valStr, 256, "val-%d ", i);
+ auto keyport = CacheableKey::create(KeyStr);
+ auto valport = CacheableString::create(valStr);
+ regPtr0->put(keyport, valport);
+ regPtr1->put(keyport, valport);
+ SLEEP(10 * 1000); // sleep a while to allow server query to complete
+ }
+ LOGINFO("putEntries complete");
}
END_TASK_DEFINITION
void checkCQStatusOnPutEvent(const char* poolName, const char* cqName,
int count) {
- PoolPtr pool = getHelper()->getCache()->getPoolManager().find(poolName);
- QueryServicePtr qs;
- if (pool != nullptr) {
- qs = pool->getQueryService();
+ auto pool = getHelper()->getCache()->getPoolManager().find(poolName);
+ std::shared_ptr<QueryService> qs;
+ if (pool != nullptr) {
+ qs = pool->getQueryService();
}
- CqQueryPtr cq = qs->getCq(const_cast<char*>(cqName));
- CqAttributesPtr cqAttr = cq->getCqAttributes();
+ auto cq = qs->getCq(const_cast<char*>(cqName));
+ auto cqAttr = cq->getCqAttributes();
auto vl = cqAttr->getCqListeners();
MyCqStatusListener* myStatusCq =
dynamic_cast<MyCqStatusListener*>(vl[0].get());
@@ -1061,115 +1057,114 @@ DUNIT_TASK_DEFINITION(CLIENT1, ProcessCQ)
{
SLEEP(10000);
// Create CqAttributes and Install Listener
- PoolPtr pool = getHelper()->getCache()->getPoolManager().find(regionName);
- QueryServicePtr qs = pool->getQueryService();
- CqAttributesFactory cqFac;
- auto cqLstner = std::make_shared<MyCqListener>(1);
- auto cqStatusLstner = std::make_shared<MyCqStatusListener>(100);
- cqFac.addCqListener(cqLstner);
- cqFac.addCqListener(cqStatusLstner);
- CqAttributesPtr cqAttr = cqFac.create();
-
- CqQueryPtr cq =
- qs->newCq(const_cast<char*>(cqName), cqQueryStatusString, cqAttr);
- cq->execute();
- SLEEP(20000);
- LOG("ProcessCQ Query executed.");
-
- RegionPtr regPtr0 = getHelper()->getRegion(regionName);
- CacheablePtr val = nullptr;
- char KeyStr[256] = {0};
- char valStr[256] = {0};
- for (int i = 1; i <= 5; i++) {
- ACE_OS::snprintf(KeyStr, 256, "Key-%d ", i);
- ACE_OS::snprintf(valStr, 256, "val-%d ", i);
- CacheableKeyPtr keyport = CacheableKey::create(KeyStr);
- CacheablePtr valport = CacheableString::create(valStr);
- regPtr0->put(keyport, valport);
- SLEEP(10 * 1000); // sleep a while to allow server query to complete
- }
- LOGINFO("putEntries complete");
-
- cqAttr = cq->getCqAttributes();
- auto vl = cqAttr->getCqListeners();
- ASSERT(vl.size() == 2, "incorrect number of CqListeners count.");
- MyCqStatusListener* myStatusCq =
- dynamic_cast<MyCqStatusListener*>(vl[1].get());
- LOGINFO("No of insert events = %d ", myStatusCq->getNumInserts());
- LOGINFO("No of OnCqConnected events = %d ",
- myStatusCq->getCqsConnectedCount());
- ASSERT(myStatusCq->getNumInserts() == 5,
- "incorrect number of CqStatus Updates count.");
- ASSERT(myStatusCq->getCqsConnectedCount() == 1,
- "incorrect number of CqStatus Connected count.");
-
- MyCqListener* myCq = dynamic_cast<MyCqListener*>(vl[0].get());
- LOGINFO("No of insert events = %d ", myCq->getNumInserts());
- ASSERT(myCq->getNumInserts() == 5,
- "incorrect number of CqStatus Updates count.");
-
- CqAttributesMutatorPtr cqAttrMtor = cq->getCqAttributesMutator();
- CqListenerPtr ptr = vl[0];
- cqAttrMtor->removeCqListener(ptr);
- vl = cqAttr->getCqListeners();
- LOGINFO("number of listeners = %d", vl.size());
-
- ASSERT(vl.size() == 1, "incorrect number of listeners");
-
- cqAttrMtor->removeCqListener(vl[0]);
- LOGINFO("removeCqListener again");
- vl = cqAttr->getCqListeners();
- LOGINFO("number of listeners = %d", vl.size());
-
- ASSERT(vl.size() == 0, "incorrect number of listeners");
-
- std::vector<CqListenerPtr> v2;
- v2.push_back(cqStatusLstner);
- v2.push_back(cqLstner);
- cqAttrMtor->setCqListeners(v2);
- LOG("ProcessCQ setCqListeneres done.");
-
- cqAttr = cq->getCqAttributes();
- auto vl3 = cqAttr->getCqListeners();
- ASSERT(vl3.size() == 2, "incorrect number of CqListeners count.");
-
- auto myStatusCq2 = std::dynamic_pointer_cast<MyCqStatusListener>(vl3[0]);
- myStatusCq2->clear();
-
- for (int i = 1; i <= 5; i++) {
- ACE_OS::snprintf(KeyStr, 256, "Key-%d ", i);
- ACE_OS::snprintf(valStr, 256, "val-%d ", i);
- CacheableKeyPtr keyport = CacheableKey::create(KeyStr);
- CacheablePtr valport = CacheableString::create(valStr);
- regPtr0->put(keyport, valport);
- SLEEP(10 * 1000); // sleep a while to allow server query to complete
- }
- LOGINFO("putEntries complete again");
-
- std::vector<CqListenerPtr> vl21;
- vl21.push_back(cqStatusLstner);
- vl21.push_back(cqLstner);
- cqFac.initCqListeners(vl21);
- LOGINFO("initCqListeners complete.");
-
- cqAttr = cq->getCqAttributes();
- auto vl2 = cqAttr->getCqListeners();
- ASSERT(vl2.size() == 2, "incorrect number of CqListeners count.");
- myStatusCq2 = std::dynamic_pointer_cast<MyCqStatusListener>(vl2[0]);
- LOGINFO("No of insert events = %d ", myStatusCq2->getNumUpdates());
- LOGINFO("No of OnCqConnected events = %d ",
- myStatusCq2->getCqsConnectedCount());
- ASSERT(myStatusCq2->getNumUpdates() == 5,
- "incorrect number of CqStatus Updates count.");
- ASSERT(myStatusCq2->getCqsConnectedCount() == 0,
- "incorrect number of CqStatus Connected count.");
-
- auto myCq2 = std::dynamic_pointer_cast<MyCqListener>(vl2[1]);
- LOGINFO("No of insert events = %d ", myCq2->getNumInserts());
- ASSERT(myCq2->getNumUpdates() == 5,
- "incorrect number of CqStatus Updates count.");
-
- LOG("ProcessCQ complete.");
+ auto pool = getHelper()->getCache()->getPoolManager().find(regionName);
+ auto qs = pool->getQueryService();
+ CqAttributesFactory cqFac;
+ auto cqLstner = std::make_shared<MyCqListener>(1);
+ auto cqStatusLstner = std::make_shared<MyCqStatusListener>(100);
+ cqFac.addCqListener(cqLstner);
+ cqFac.addCqListener(cqStatusLstner);
+ auto cqAttr = cqFac.create();
+
+ auto cq = qs->newCq(const_cast<char*>(cqName), cqQueryStatusString, cqAttr);
+ cq->execute();
+ SLEEP(20000);
+ LOG("ProcessCQ Query executed.");
+
+ auto regPtr0 = getHelper()->getRegion(regionName);
+ std::shared_ptr<Cacheable> val = nullptr;
+ char KeyStr[256] = {0};
+ char valStr[256] = {0};
+ for (int i = 1; i <= 5; i++) {
+ ACE_OS::snprintf(KeyStr, 256, "Key-%d ", i);
+ ACE_OS::snprintf(valStr, 256, "val-%d ", i);
+ auto keyport = CacheableKey::create(KeyStr);
+ auto valport = CacheableString::create(valStr);
+ regPtr0->put(keyport, valport);
+ SLEEP(10 * 1000); // sleep a while to allow server query to complete
+ }
+ LOGINFO("putEntries complete");
+
+ cqAttr = cq->getCqAttributes();
+ auto vl = cqAttr->getCqListeners();
+ ASSERT(vl.size() == 2, "incorrect number of CqListeners count.");
+ MyCqStatusListener* myStatusCq =
+ dynamic_cast<MyCqStatusListener*>(vl[1].get());
+ LOGINFO("No of insert events = %d ", myStatusCq->getNumInserts());
+ LOGINFO("No of OnCqConnected events = %d ",
+ myStatusCq->getCqsConnectedCount());
+ ASSERT(myStatusCq->getNumInserts() == 5,
+ "incorrect number of CqStatus Updates count.");
+ ASSERT(myStatusCq->getCqsConnectedCount() == 1,
+ "incorrect number of CqStatus Connected count.");
+
+ MyCqListener* myCq = dynamic_cast<MyCqListener*>(vl[0].get());
+ LOGINFO("No of insert events = %d ", myCq->getNumInserts());
+ ASSERT(myCq->getNumInserts() == 5,
+ "incorrect number of CqStatus Updates count.");
+
+ auto cqAttrMtor = cq->getCqAttributesMutator();
+ auto ptr = vl[0];
+ cqAttrMtor->removeCqListener(ptr);
+ vl = cqAttr->getCqListeners();
+ LOGINFO("number of listeners = %d", vl.size());
+
+ ASSERT(vl.size() == 1, "incorrect number of listeners");
+
+ cqAttrMtor->removeCqListener(vl[0]);
+ LOGINFO("removeCqListener again");
+ vl = cqAttr->getCqListeners();
+ LOGINFO("number of listeners = %d", vl.size());
+
+ ASSERT(vl.size() == 0, "incorrect number of listeners");
+
+ std::vector<std::shared_ptr<CqListener>> v2;
+ v2.push_back(cqStatusLstner);
+ v2.push_back(cqLstner);
+ cqAttrMtor->setCqListeners(v2);
+ LOG("ProcessCQ setCqListeneres done.");
+
+ cqAttr = cq->getCqAttributes();
+ auto vl3 = cqAttr->getCqListeners();
+ ASSERT(vl3.size() == 2, "incorrect number of CqListeners count.");
+
+ auto myStatusCq2 = std::dynamic_pointer_cast<MyCqStatusListener>(vl3[0]);
+ myStatusCq2->clear();
+
+ for (int i = 1; i <= 5; i++) {
+ ACE_OS::snprintf(KeyStr, 256, "Key-%d ", i);
+ ACE_OS::snprintf(valStr, 256, "val-%d ", i);
+ auto keyport = CacheableKey::create(KeyStr);
+ auto valport = CacheableString::create(valStr);
+ regPtr0->put(keyport, valport);
+ SLEEP(10 * 1000); // sleep a while to allow server query to complete
+ }
+ LOGINFO("putEntries complete again");
+
+ std::vector<std::shared_ptr<CqListener>> vl21;
+ vl21.push_back(cqStatusLstner);
+ vl21.push_back(cqLstner);
+ cqFac.initCqListeners(vl21);
+ LOGINFO("initCqListeners complete.");
+
+ cqAttr = cq->getCqAttributes();
+ auto vl2 = cqAttr->getCqListeners();
+ ASSERT(vl2.size() == 2, "incorrect number of CqListeners count.");
+ myStatusCq2 = std::dynamic_pointer_cast<MyCqStatusListener>(vl2[0]);
+ LOGINFO("No of insert events = %d ", myStatusCq2->getNumUpdates());
+ LOGINFO("No of OnCqConnected events = %d ",
+ myStatusCq2->getCqsConnectedCount());
+ ASSERT(myStatusCq2->getNumUpdates() == 5,
+ "incorrect number of CqStatus Updates count.");
+ ASSERT(myStatusCq2->getCqsConnectedCount() == 0,
+ "incorrect number of CqStatus Connected count.");
+
+ auto myCq2 = std::dynamic_pointer_cast<MyCqListener>(vl2[1]);
+ LOGINFO("No of insert events = %d ", myCq2->getNumInserts());
+ ASSERT(myCq2->getNumUpdates() == 5,
+ "incorrect number of CqStatus Updates count.");
+
+ LOG("ProcessCQ complete.");
}
END_TASK_DEFINITION
diff --git a/cppcache/integration-test/testThinClientCqDelta.cpp b/cppcache/integration-test/testThinClientCqDelta.cpp
index 40a2f8c..dcba00d2 100644
--- a/cppcache/integration-test/testThinClientCqDelta.cpp
+++ b/cppcache/integration-test/testThinClientCqDelta.cpp
@@ -53,7 +53,7 @@ class CqDeltaListener : public CqListener {
CqDeltaListener() : m_deltaCount(0), m_valueCount(0) {}
virtual void onEvent(const CqEvent& aCqEvent) {
- CacheableBytesPtr deltaValue = aCqEvent.getDeltaValue();
+ auto deltaValue = aCqEvent.getDeltaValue();
DeltaTestImpl newValue;
auto input = getHelper()->getCache()->createDataInput(
deltaValue->value(), deltaValue->length());
@@ -61,8 +61,7 @@ class CqDeltaListener : public CqListener {
if (newValue.getIntVar() == 5) {
m_deltaCount++;
}
- DeltaTestImplPtr dptr =
- std::static_pointer_cast<DeltaTestImpl>(aCqEvent.getNewValue());
+ auto dptr = std::static_pointer_cast<DeltaTestImpl>(aCqEvent.getNewValue());
if (dptr->getIntVar() == 5) {
m_valueCount++;
}
@@ -75,8 +74,8 @@ class CqDeltaListener : public CqListener {
int m_deltaCount;
int m_valueCount;
};
-typedef std::shared_ptr<CqDeltaListener> CqDeltaListenerPtr;
-CqDeltaListenerPtr g_CqListener;
+
+std::shared_ptr<CqDeltaListener> g_CqListener;
void initClient(const bool isthinClient) {
if (cacheHelper == nullptr) {
@@ -104,7 +103,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -116,7 +115,7 @@ void createPooledLRURegion(const char* name, bool ackMode, const char* locators,
bool clientNotificationEnabled = false,
bool cachingEnable = true) {
LOG(" createPooledLRURegion entered");
- RegionPtr regPtr = getHelper()->createPooledRegionDiscOverFlow(
+ auto regPtr = getHelper()->createPooledRegionDiscOverFlow(
name, ackMode, locators, poolname, cachingEnable,
clientNotificationEnabled, std::chrono::seconds(0),
std::chrono::seconds(0), std::chrono::seconds(0), std::chrono::seconds(0),
@@ -130,8 +129,8 @@ void createRegion(const char* name, bool ackMode,
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
// ack, caching
- RegionPtr regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
- clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
+ clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -148,7 +147,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateClient1)
createPooledRegion(regionNames[0], USE_ACK, locatorsG, "__TESTPOOL1_",
true);
try {
- SerializationRegistryPtr serializationRegistry =
+ auto serializationRegistry =
CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
->getSerializationRegistry();
@@ -165,7 +164,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, CreateClient2)
createPooledRegion(regionNames[0], USE_ACK, locatorsG, "__TESTPOOL1_",
true);
try {
- SerializationRegistryPtr serializationRegistry =
+ auto serializationRegistry =
CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
->getSerializationRegistry();
@@ -173,18 +172,17 @@ DUNIT_TASK_DEFINITION(CLIENT2, CreateClient2)
} catch (IllegalStateException&) {
// ignore exception caused by type reregistration.
}
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
- PoolPtr pool =
- getHelper()->getCache()->getPoolManager().find("__TESTPOOL1_");
- QueryServicePtr qs;
+ auto pool = getHelper()->getCache()->getPoolManager().find("__TESTPOOL1_");
+ std::shared_ptr<QueryService> qs;
qs = pool->getQueryService();
CqAttributesFactory cqFac;
g_CqListener = std::make_shared<CqDeltaListener>();
- CqListenerPtr cqListener = g_CqListener;
+ auto cqListener = g_CqListener;
cqFac.addCqListener(cqListener);
- CqAttributesPtr cqAttr = cqFac.create();
- CqQueryPtr qry =
+ auto cqAttr = cqFac.create();
+ auto qry =
qs->newCq("Cq_with_delta",
"select * from /DistRegionAck d where d.intVar > 4", cqAttr);
qs->executeCqs();
@@ -196,7 +194,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateClient1_NoPools)
initClientNoPools();
createRegion(regionNames[0], USE_ACK, true);
try {
- SerializationRegistryPtr serializationRegistry =
+ auto serializationRegistry =
CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
->getSerializationRegistry();
@@ -212,7 +210,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, CreateClient2_NoPools)
initClientNoPools();
createRegion(regionNames[0], USE_ACK, true);
try {
- SerializationRegistryPtr serializationRegistry =
+ auto serializationRegistry =
CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
->getSerializationRegistry();
@@ -220,16 +218,16 @@ DUNIT_TASK_DEFINITION(CLIENT2, CreateClient2_NoPools)
} catch (IllegalStateException&) {
// ignore exception caused by type reregistration.
}
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
qs = getHelper()->getQueryService();
CqAttributesFactory cqFac;
g_CqListener = std::make_shared<CqDeltaListener>();
- CqListenerPtr cqListener = g_CqListener;
+ auto cqListener = g_CqListener;
cqFac.addCqListener(cqListener);
- CqAttributesPtr cqAttr = cqFac.create();
- CqQueryPtr qry =
+ auto cqAttr = cqFac.create();
+ auto qry =
qs->newCq("Cq_with_delta",
"select * from /DistRegionAck d where d.intVar > 4", cqAttr);
qs->executeCqs();
@@ -238,10 +236,10 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, Client1_Put)
{
- CacheableKeyPtr keyPtr = createKey(keys[0]);
+ auto keyPtr = createKey(keys[0]);
auto dptr = std::make_shared<DeltaTestImpl>();
- CacheablePtr valPtr(dptr);
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ std::shared_ptr<Cacheable> valPtr(dptr);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
regPtr->put(keyPtr, valPtr);
dptr->setIntVar(5);
dptr->setDelta(true);
diff --git a/cppcache/integration-test/testThinClientCqDurable.cpp b/cppcache/integration-test/testThinClientCqDurable.cpp
index 1b2831d..7f8d092 100644
--- a/cppcache/integration-test/testThinClientCqDurable.cpp
+++ b/cppcache/integration-test/testThinClientCqDurable.cpp
@@ -16,7 +16,6 @@
*/
#include "fw_dunit.hpp"
#include "ThinClientHelper.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <geode/CqAttributesFactory.hpp>
#include <geode/CqAttributes.hpp>
#include <geode/CqListener.hpp>
@@ -61,7 +60,7 @@ const char* durableCQNamesClient2[] = {
static bool m_isPdx = false;
void initClientWithId(int ClientIdx, bool typeRegistered = false) {
- PropertiesPtr pp = Properties::create();
+ auto pp = Properties::create();
pp->insert("durable-client-id", durableIds[ClientIdx]);
pp->insert("durable-timeout", std::chrono::seconds(60));
pp->insert("notify-ack-interval", std::chrono::seconds(1));
@@ -70,7 +69,7 @@ void initClientWithId(int ClientIdx, bool typeRegistered = false) {
if (typeRegistered == false) {
try {
- SerializationRegistryPtr serializationRegistry =
+ auto serializationRegistry =
CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
->getSerializationRegistry();
serializationRegistry->addType(Position::createDeserializable);
@@ -90,9 +89,9 @@ class MyCqListener1 : public CqListener {
void onEvent(const CqEvent& cqe) {
m_cntEvents++;
char* opStr = (char*)"Default";
- CacheableInt32Ptr value(
+ std::shared_ptr<CacheableInt32> value(
std::dynamic_pointer_cast<CacheableInt32>(cqe.getNewValue()));
- CacheableInt32Ptr key(
+ std::shared_ptr<CacheableInt32> key(
std::dynamic_pointer_cast<CacheableInt32>(cqe.getKey()));
switch (cqe.getQueryOperation()) {
case CqOperation::OP_TYPE_CREATE: {
@@ -177,9 +176,9 @@ END_TASK_DEFINITION
void stepOne() {
initClientWithId(0);
createRegionForCQ(regionNamesCq[0], USE_ACK, true);
- RegionPtr regptr = getHelper()->getRegion(regionNamesCq[0]);
- RegionAttributesPtr lattribPtr = regptr->getAttributes();
- RegionPtr subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
+ auto regptr = getHelper()->getRegion(regionNamesCq[0]);
+ std::shared_ptr<RegionAttributes> lattribPtr = regptr->getAttributes();
+ auto subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
LOG("StepOne complete.");
}
@@ -340,9 +339,9 @@ END_TASK_DEFINITION
void stepOne2() {
initClientWithId(1);
createRegionForCQ(regionNamesCq[0], USE_ACK, true);
- RegionPtr regptr = getHelper()->getRegion(regionNamesCq[0]);
- RegionAttributesPtr lattribPtr = regptr->getAttributes();
- RegionPtr subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
+ auto regptr = getHelper()->getRegion(regionNamesCq[0]);
+ std::shared_ptr<RegionAttributes> lattribPtr = regptr->getAttributes();
+ auto subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
LOG("StepOne2 complete.");
}
@@ -353,8 +352,8 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepTwo)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesCq[0]);
- RegionPtr subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNamesCq[0]);
+ auto subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
QueryHelper* qh = &QueryHelper::getHelper();
if (!m_isPdx) {
@@ -373,9 +372,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
{
QueryHelper* qh ATTR_UNUSED = &QueryHelper::getHelper();
- PoolPtr pool =
+ auto pool =
getHelper()->getCache()->getPoolManager().find(regionNamesCq[0]);
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
if (pool != nullptr) {
qs = pool->getQueryService();
} else {
@@ -384,12 +383,12 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
CqAttributesFactory cqFac;
auto cqLstner = std::make_shared<MyCqListener>();
cqFac.addCqListener(cqLstner);
- CqAttributesPtr cqAttr = cqFac.create();
+ auto cqAttr = cqFac.create();
const char* qryStr = "select * from /Portfolios p where p.ID < 3";
- CqQueryPtr qry = qs->newCq(cqName, qryStr, cqAttr);
+ auto qry = qs->newCq(cqName, qryStr, cqAttr);
- SelectResultsPtr results;
+ std::shared_ptr<SelectResults> results;
try {
LOG("EXECUTE 1 START");
@@ -415,21 +414,21 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, StepTwo2)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesCq[0]);
- RegionPtr subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNamesCq[0]);
+ auto subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
QueryHelper* qh = &QueryHelper::getHelper();
qh->populatePortfolioData(regPtr0, 140, 30, 20);
qh->populatePositionData(subregPtr0, 140, 30);
- CacheablePtr port = nullptr;
+ std::shared_ptr<Cacheable> port = nullptr;
for (int i = 1; i < 140; i++) {
if (!m_isPdx) {
- port = CacheablePtr(new Portfolio(i, 20));
+ port = std::shared_ptr<Cacheable>(new Portfolio(i, 20));
} else {
- port = CacheablePtr(new PortfolioPdx(i, 20));
+ port = std::shared_ptr<Cacheable>(new PortfolioPdx(i, 20));
}
- CacheableKeyPtr keyport = CacheableKey::create("port1-1");
+ auto keyport = CacheableKey::create("port1-1");
regPtr0->put(keyport, port);
SLEEP(10); // sleep a while to allow server query to complete
}
@@ -462,7 +461,7 @@ void client1Up() {
LOG("Client1Up complete.");
QueryHelper* qh ATTR_UNUSED = &QueryHelper::getHelper();
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
qs = getHelper()
->getCache()
@@ -472,10 +471,10 @@ void client1Up() {
CqAttributesFactory cqFac;
auto cqLstner = std::make_shared<MyCqListener>();
cqFac.addCqListener(cqLstner);
- CqAttributesPtr cqAttr = cqFac.create();
+ auto cqAttr = cqFac.create();
const char* qryStr = "select * from /Portfolios p where p.ID < 3";
- CqQueryPtr qry = qs->newCq(cqName, qryStr, cqAttr);
+ auto qry = qs->newCq(cqName, qryStr, cqAttr);
try {
LOG("EXECUTE 1 START");
@@ -531,9 +530,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
{
QueryHelper* qh ATTR_UNUSED = &QueryHelper::getHelper();
- PoolPtr pool =
+ auto pool =
getHelper()->getCache()->getPoolManager().find(regionNamesCq[0]);
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
if (pool != nullptr) {
qs = pool->getQueryService();
} else {
@@ -545,7 +544,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
LOGINFO(
"CLIENT-1 StepFour: verifying getCq() behaviour for the invalid CQ "
"Name");
- CqQueryPtr invalidCqptr = qs->getCq("InValidCQ");
+ auto invalidCqptr = qs->getCq("InValidCQ");
ASSERT(
invalidCqptr == nullptr,
"Cqptr must be nullptr, as it getCq() is invoked on invalid CQ name");
@@ -555,10 +554,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
LOGINFO("Testing getCq(InvalidName) :: invalidCqptr is NOT nullptr");
}*/
- CqQueryPtr cqy = qs->getCq(cqName);
+ auto cqy = qs->getCq(cqName);
cqy->stop();
SLEEP(1500); // sleep 0.025 min to allow server stop query to complete
- CqStatisticsPtr cqStats = cqy->getStatistics();
+ auto cqStats = cqy->getStatistics();
sprintf(buf,
"numInserts[%d], numDeletes[%d], numUpdates[%d], numEvents[%d]",
cqStats->numInserts(), cqStats->numDeletes(),
@@ -679,16 +678,16 @@ void doThinClientCqDurable() {
DUNIT_TASK_DEFINITION(CLIENT1, RegisterCqs1)
{
- PoolPtr pool =
+ auto pool =
getHelper()->getCache()->getPoolManager().find(regionNamesCq[0]);
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
if (pool != nullptr) {
qs = pool->getQueryService();
} else {
qs = getHelper()->cachePtr->getQueryService();
}
CqAttributesFactory cqFac;
- CqAttributesPtr cqAttr = cqFac.create();
+ auto cqAttr = cqFac.create();
qs->newCq(durableCQNamesClient1[0],
"select * from /Portfolios p where p.ID < 3", cqAttr, true)
@@ -707,16 +706,16 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, RegisterCqsAfterClientup1)
{
- PoolPtr pool =
+ auto pool =
getHelper()->getCache()->getPoolManager().find(regionNamesCq[0]);
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
if (pool != nullptr) {
qs = pool->getQueryService();
} else {
qs = getHelper()->cachePtr->getQueryService();
}
CqAttributesFactory cqFac;
- CqAttributesPtr cqAttr = cqFac.create();
+ auto cqAttr = cqFac.create();
qs->newCq(durableCQNamesClient1[4],
"select * from /Portfolios p where p.ID < 3", cqAttr, true)
@@ -735,16 +734,16 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, RegisterCqs2)
{
- PoolPtr pool =
+ auto pool =
getHelper()->getCache()->getPoolManager().find(regionNamesCq[0]);
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
if (pool != nullptr) {
qs = pool->getQueryService();
} else {
qs = getHelper()->cachePtr->getQueryService();
}
CqAttributesFactory cqFac;
- CqAttributesPtr cqAttr = cqFac.create();
+ auto cqAttr = cqFac.create();
qs->newCq(durableCQNamesClient2[0],
"select * from /Portfolios p where p.ID < 3", cqAttr, true)
@@ -763,16 +762,16 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, RegisterCqsAfterClientup2)
{
- PoolPtr pool =
+ auto pool =
getHelper()->getCache()->getPoolManager().find(regionNamesCq[0]);
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
if (pool != nullptr) {
qs = pool->getQueryService();
} else {
qs = getHelper()->cachePtr->getQueryService();
}
CqAttributesFactory cqFac;
- CqAttributesPtr cqAttr = cqFac.create();
+ auto cqAttr = cqFac.create();
qs->newCq(durableCQNamesClient2[4],
"select * from /Portfolios p where p.ID < 3", cqAttr, true)
@@ -791,16 +790,16 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, VerifyCqs1)
{
- PoolPtr pool =
+ auto pool =
getHelper()->getCache()->getPoolManager().find(regionNamesCq[0]);
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
if (pool != nullptr) {
qs = pool->getQueryService();
} else {
qs = getHelper()->cachePtr->getQueryService();
}
- CacheableArrayListPtr durableCqListPtr = qs->getAllDurableCqsFromServer();
+ auto durableCqListPtr = qs->getAllDurableCqsFromServer();
ASSERT(durableCqListPtr != nullptr, "Durable CQ List should not be null");
ASSERT(durableCqListPtr->size() == 2, "Durable CQ List lenght should be 2");
@@ -815,16 +814,16 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, VerifyCqsAfterClientup1)
{
- PoolPtr pool =
+ auto pool =
getHelper()->getCache()->getPoolManager().find(regionNamesCq[0]);
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
if (pool != nullptr) {
qs = pool->getQueryService();
} else {
qs = getHelper()->cachePtr->getQueryService();
}
- CacheableArrayListPtr durableCqListPtr = qs->getAllDurableCqsFromServer();
+ auto durableCqListPtr = qs->getAllDurableCqsFromServer();
ASSERT(durableCqListPtr != nullptr, "Durable CQ List should not be null");
ASSERT(durableCqListPtr->size() == 4, "Durable CQ List length should be 4");
ASSERT(
@@ -844,15 +843,15 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, VerifyCqs2)
{
- PoolPtr pool =
+ auto pool =
getHelper()->getCache()->getPoolManager().find(regionNamesCq[0]);
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
if (pool != nullptr) {
qs = pool->getQueryService();
} else {
qs = getHelper()->cachePtr->getQueryService();
}
- CacheableArrayListPtr durableCqListPtr = qs->getAllDurableCqsFromServer();
+ auto durableCqListPtr = qs->getAllDurableCqsFromServer();
ASSERT(durableCqListPtr != nullptr, "Durable CQ List should not be null");
ASSERT(durableCqListPtr->size() == 4, "Durable CQ List lenght should be 4");
ASSERT(isDurableCQName(durableCqListPtr->at(0)->toString()->asChar(), 2,
@@ -872,15 +871,15 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, VerifyCqsAfterClientup2)
{
- PoolPtr pool =
+ auto pool =
getHelper()->getCache()->getPoolManager().find(regionNamesCq[0]);
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
if (pool != nullptr) {
qs = pool->getQueryService();
} else {
qs = getHelper()->cachePtr->getQueryService();
}
- CacheableArrayListPtr durableCqListPtr = qs->getAllDurableCqsFromServer();
+ auto durableCqListPtr = qs->getAllDurableCqsFromServer();
ASSERT(durableCqListPtr != nullptr, "Durable CQ List should not be null");
ASSERT(durableCqListPtr->size() == 8, "Durable CQ List lenght should be 8");
ASSERT(
@@ -911,16 +910,15 @@ DUNIT_TASK_DEFINITION(CLIENT2, VerifyCqsAfterClientup2)
END_TASK_DEFINITION
void verifyEmptyDurableCQList() {
- PoolPtr pool =
- getHelper()->getCache()->getPoolManager().find(regionNamesCq[0]);
- QueryServicePtr qs;
+ auto pool = getHelper()->getCache()->getPoolManager().find(regionNamesCq[0]);
+ std::shared_ptr<QueryService> qs;
if (pool != nullptr) {
qs = pool->getQueryService();
} else {
qs = getHelper()->cachePtr->getQueryService();
}
- CacheableArrayListPtr durableCqListPtr = qs->getAllDurableCqsFromServer();
+ auto durableCqListPtr = qs->getAllDurableCqsFromServer();
ASSERT(durableCqListPtr == nullptr, "Durable CQ List should be null");
}
diff --git a/cppcache/integration-test/testThinClientCqFailover.cpp b/cppcache/integration-test/testThinClientCqFailover.cpp
index b001985..7faaac9 100644
--- a/cppcache/integration-test/testThinClientCqFailover.cpp
+++ b/cppcache/integration-test/testThinClientCqFailover.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <geode/CqAttributesFactory.hpp>
#include <geode/CqAttributes.hpp>
#include <geode/CqListener.hpp>
@@ -118,7 +117,7 @@ void initClientCq(const bool isthinClient) {
ASSERT(cacheHelper, "Failed to create a CacheHelper client instance.");
try {
- SerializationRegistryPtr serializationRegistry =
+ auto serializationRegistry =
CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
->getSerializationRegistry();
serializationRegistry->addType(Position::createDeserializable);
@@ -156,9 +155,9 @@ void stepOne() {
createRegionForCQ(regionNamesCq[0], USE_ACK, true);
- RegionPtr regptr = getHelper()->getRegion(regionNamesCq[0]);
- RegionAttributesPtr lattribPtr = regptr->getAttributes();
- RegionPtr subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
+ auto regptr = getHelper()->getRegion(regionNamesCq[0]);
+ std::shared_ptr<RegionAttributes> lattribPtr = regptr->getAttributes();
+ auto subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
QueryHelper* qh = &QueryHelper::getHelper();
@@ -175,9 +174,9 @@ END_TASK_DEFINITION
void stepOne2() {
initClientCq(true);
createRegionForCQ(regionNamesCq[0], USE_ACK, true);
- RegionPtr regptr = getHelper()->getRegion(regionNamesCq[0]);
- RegionAttributesPtr lattribPtr = regptr->getAttributes();
- RegionPtr subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
+ auto regptr = getHelper()->getRegion(regionNamesCq[0]);
+ std::shared_ptr<RegionAttributes> lattribPtr = regptr->getAttributes();
+ auto subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
LOG("StepOne2 complete.");
}
@@ -203,9 +202,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
{
try {
- PoolPtr pool =
+ auto pool =
getHelper()->getCache()->getPoolManager().find(regionNamesCq[0]);
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
if (pool != nullptr) {
// Using region name as pool name as in ThinClientCq.hpp
qs = pool->getQueryService();
@@ -215,10 +214,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
CqAttributesFactory cqFac;
auto cqLstner = std::make_shared<MyCqListener>();
cqFac.addCqListener(cqLstner);
- CqAttributesPtr cqAttr = cqFac.create();
+ auto cqAttr = cqFac.create();
char* qryStr = (char*)"select * from /Portfolios p where p.ID != 2";
- CqQueryPtr qry = qs->newCq(cqName, qryStr, cqAttr);
+ auto qry = qs->newCq(cqName, qryStr, cqAttr);
qry->execute();
SLEEP(15000);
@@ -244,8 +243,8 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, StepThree2)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesCq[0]);
- RegionPtr subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNamesCq[0]);
+ auto subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
QueryHelper* qh = &QueryHelper::getHelper();
@@ -254,7 +253,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepThree2)
for (int i = 1; i < 150; i++) {
auto port = std::make_shared<Portfolio>(i, 150);
- CacheableKeyPtr keyport = CacheableKey::create((char*)"port1-1");
+ auto keyport = CacheableKey::create((char*)"port1-1");
regPtr0->put(keyport, port);
SLEEP(100); // sleep a while to allow server query to complete
}
@@ -268,7 +267,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree3)
{
auto pool =
getHelper()->getCache()->getPoolManager().find(regionNamesCq[0]);
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
if (pool != nullptr) {
// Using region name as pool name as in ThinClientCq.hpp
qs = pool->getQueryService();
@@ -279,7 +278,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree3)
ASSERT(qry != nullptr, "failed to get CqQuery");
auto cqAttr = qry->getCqAttributes();
ASSERT(cqAttr != nullptr, "failed to get CqAttributes");
- CqListenerPtr cqLstner = nullptr;
+ std::shared_ptr<CqListener> cqLstner = nullptr;
try {
auto vl = cqAttr->getCqListeners();
cqLstner = vl[0];
@@ -306,13 +305,13 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree3)
kst->stop();
myListener->setFailedOver();
/*
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesCq[0]);
- RegionPtr subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNamesCq[0]);
+ auto subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
for(int i=1; i < 1500; i++)
{
auto port = std::make_shared<Portfolio>(i, 15);
- CacheableKeyPtr keyport = CacheableKey::create("port1-1");
+ auto keyport = CacheableKey::create("port1-1");
try {
regPtr0->put(keyport, port);
} catch (...)
@@ -355,7 +354,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CloseCache1)
{
auto pool =
getHelper()->getCache()->getPoolManager().find(regionNamesCq[0]);
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
if (pool != nullptr) {
// Using region name as pool name as in ThinClientCq.hpp
qs = pool->getQueryService();
@@ -366,7 +365,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CloseCache1)
ASSERT(qry != nullptr, "failed to get CqQuery");
auto cqAttr = qry->getCqAttributes();
ASSERT(cqAttr != nullptr, "failed to get CqAttributes");
- CqListenerPtr cqLstner = nullptr;
+ std::shared_ptr<CqListener> cqLstner = nullptr;
try {
auto vl = cqAttr->getCqListeners();
cqLstner = vl[0];
diff --git a/cppcache/integration-test/testThinClientCqHAFailover.cpp b/cppcache/integration-test/testThinClientCqHAFailover.cpp
index b8c3e12..b520bb9 100644
--- a/cppcache/integration-test/testThinClientCqHAFailover.cpp
+++ b/cppcache/integration-test/testThinClientCqHAFailover.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <geode/CqAttributesFactory.hpp>
#include <geode/CqAttributes.hpp>
#include <geode/CqListener.hpp>
@@ -116,7 +115,7 @@ void initClientCq(int redundancyLevel) {
ASSERT(cacheHelper, "Failed to create a CacheHelper client instance.");
try {
- SerializationRegistryPtr serializationRegistry =
+ auto serializationRegistry =
CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
->getSerializationRegistry();
@@ -168,9 +167,9 @@ void stepOne() {
createRegionForCQ(regionNamesCq[0], USE_ACK, true, 1);
- RegionPtr regptr = getHelper()->getRegion(regionNamesCq[0]);
- RegionAttributesPtr lattribPtr = regptr->getAttributes();
- RegionPtr subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
+ auto regptr = getHelper()->getRegion(regionNamesCq[0]);
+ std::shared_ptr<RegionAttributes> lattribPtr = regptr->getAttributes();
+ auto subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
QueryHelper* qh = &QueryHelper::getHelper();
@@ -187,9 +186,9 @@ END_TASK_DEFINITION
void stepOne2() {
initClientCq(1);
createRegionForCQ(regionNamesCq[0], USE_ACK, true, 1);
- RegionPtr regptr = getHelper()->getRegion(regionNamesCq[0]);
- RegionAttributesPtr lattribPtr = regptr->getAttributes();
- RegionPtr subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
+ auto regptr = getHelper()->getRegion(regionNamesCq[0]);
+ std::shared_ptr<RegionAttributes> lattribPtr = regptr->getAttributes();
+ auto subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
LOG("StepOne2 complete.");
}
@@ -201,9 +200,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
{
try {
- PoolPtr pool =
+ auto pool =
getHelper()->getCache()->getPoolManager().find(regionNamesCq[0]);
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
if (pool != nullptr) {
qs = pool->getQueryService();
} else {
@@ -212,13 +211,13 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
CqAttributesFactory cqFac;
auto cqLstner = std::make_shared<MyCqListener>();
cqFac.addCqListener(cqLstner);
- CqAttributesPtr cqAttr = cqFac.create();
+ auto cqAttr = cqFac.create();
char* qryStr = (char*)"select * from /Portfolios p where p.ID != 1";
// char* qryStr = (char*)"select * from /Portfolios p where p.ID != 2";
// char* qryStr = (char*)"select * from /Portfolios p where p.ID < 3";
- CqQueryPtr qry = qs->newCq(cqName, qryStr, cqAttr);
- SelectResultsPtr results;
+ auto qry = qs->newCq(cqName, qryStr, cqAttr);
+ std::shared_ptr<SelectResults> results;
results = qry->executeWithInitialResults();
SelectResultsIterator iter = results->getIterator();
@@ -228,9 +227,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
LOG(buf);
while (iter.hasNext()) {
count--;
- SerializablePtr ser = iter.next();
- PortfolioPtr portfolio(dynamic_cast<Portfolio*>(ser.get()));
- PositionPtr position(dynamic_cast<Position*>(ser.get()));
+ auto ser = iter.next();
+ std::shared_ptr<Portfolio> portfolio(
+ dynamic_cast<Portfolio*>(ser.get()));
+ std::shared_ptr<Position> position(dynamic_cast<Position*>(ser.get()));
if (portfolio != nullptr) {
printf(" query pulled portfolio object ID %d, pkid %s\n",
@@ -277,8 +277,8 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, StepThree2)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesCq[0]);
- RegionPtr subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNamesCq[0]);
+ auto subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
QueryHelper* qh = &QueryHelper::getHelper();
@@ -287,7 +287,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepThree2)
for (int i = 1; i < 150; i++) {
auto port = std::make_shared<Portfolio>(i, 20);
- CacheableKeyPtr keyport = CacheableKey::create((char*)"port1-1");
+ auto keyport = CacheableKey::create((char*)"port1-1");
regPtr0->put(keyport, port);
SLEEP(100); // sleep a while to allow server query to complete
}
@@ -300,19 +300,19 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepThree3)
{
// using region name as pool name
- PoolPtr pool =
+ auto pool =
getHelper()->getCache()->getPoolManager().find(regionNamesCq[0]);
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
if (pool != nullptr) {
qs = pool->getQueryService();
} else {
qs = getHelper()->cachePtr->getQueryService();
}
- CqQueryPtr qry = qs->getCq(cqName);
+ auto qry = qs->getCq(cqName);
ASSERT(qry != nullptr, "failed to get CqQuery");
- CqAttributesPtr cqAttr = qry->getCqAttributes();
+ auto cqAttr = qry->getCqAttributes();
ASSERT(cqAttr != nullptr, "failed to get CqAttributes");
- CqListenerPtr cqLstner = nullptr;
+ std::shared_ptr<CqListener> cqLstner = nullptr;
try {
auto vl = cqAttr->getCqListeners();
cqLstner = vl[0];
@@ -339,13 +339,13 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree3)
kst->stop();
myListener->setFailedOver();
/*
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesCq[0]);
- RegionPtr subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNamesCq[0]);
+ auto subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
for(int i=1; i < 150; i++)
{
auto port = std::make_shared<Portfolio>(i, 20);
- CacheableKeyPtr keyport = CacheableKey::create("port1-1");
+ auto keyport = CacheableKey::create("port1-1");
try {
regPtr0->put(keyport, port);
} catch (...)
@@ -364,8 +364,8 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, StepThree4)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesCq[0]);
- RegionPtr subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNamesCq[0]);
+ auto subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
QueryHelper* qh = &QueryHelper::getHelper();
@@ -374,7 +374,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepThree4)
for (int i = 1; i < 150; i++) {
auto port = std::make_shared<Portfolio>(i, 20);
- CacheableKeyPtr keyport = CacheableKey::create("port1-1");
+ auto keyport = CacheableKey::create("port1-1");
regPtr0->put(keyport, port);
SLEEP(100); // sleep a while to allow server query to complete
}
@@ -387,19 +387,19 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, CloseCache1)
{
// using region name as pool name
- PoolPtr pool =
+ auto pool =
getHelper()->getCache()->getPoolManager().find(regionNamesCq[0]);
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
if (pool != nullptr) {
qs = pool->getQueryService();
} else {
qs = getHelper()->cachePtr->getQueryService();
}
- CqQueryPtr qry = qs->getCq(cqName);
+ auto qry = qs->getCq(cqName);
ASSERT(qry != nullptr, "failed to get CqQuery");
- CqAttributesPtr cqAttr = qry->getCqAttributes();
+ auto cqAttr = qry->getCqAttributes();
ASSERT(cqAttr != nullptr, "failed to get CqAttributes");
- CqListenerPtr cqLstner = nullptr;
+ std::shared_ptr<CqListener> cqLstner = nullptr;
try {
auto vl = cqAttr->getCqListeners();
cqLstner = vl[0];
diff --git a/cppcache/integration-test/testThinClientCqIR.cpp b/cppcache/integration-test/testThinClientCqIR.cpp
index c1dabf8..6f79495 100644
--- a/cppcache/integration-test/testThinClientCqIR.cpp
+++ b/cppcache/integration-test/testThinClientCqIR.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <string>
@@ -55,7 +54,7 @@ void initClientCq(const bool isthinClient) {
ASSERT(cacheHelper, "Failed to create a CacheHelper client instance.");
try {
- SerializationRegistryPtr serializationRegistry =
+ auto serializationRegistry =
CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
->getSerializationRegistry();
serializationRegistry->addType(Position::createDeserializable);
@@ -97,9 +96,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateClient1Regions)
initClientCq(true);
createRegionForCQ(regionNamesCq[0], USE_ACK, true);
createRegionForCQ(regionNamesCq[2], USE_ACK, true);
- RegionPtr regptr = getHelper()->getRegion(regionNamesCq[0]);
- RegionAttributesPtr lattribPtr = regptr->getAttributes();
- RegionPtr subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
+ auto regptr = getHelper()->getRegion(regionNamesCq[0]);
+ std::shared_ptr<RegionAttributes> lattribPtr = regptr->getAttributes();
+ auto subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
LOG("CreateClient1Regions complete.");
}
@@ -109,9 +108,9 @@ DUNIT_TASK_DEFINITION(CLIENT2, CreateClient2Regions)
{
initClientCq(true);
createRegionForCQ(regionNamesCq[0], USE_ACK, true);
- RegionPtr regptr = getHelper()->getRegion(regionNamesCq[0]);
- RegionAttributesPtr lattribPtr = regptr->getAttributes();
- RegionPtr subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
+ auto regptr = getHelper()->getRegion(regionNamesCq[0]);
+ std::shared_ptr<RegionAttributes> lattribPtr = regptr->getAttributes();
+ auto subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
LOG("CreateClient2Regions complete.");
}
@@ -119,9 +118,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, PopulateData)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesCq[0]);
- RegionPtr subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNamesCq[2]);
+ auto regPtr0 = getHelper()->getRegion(regionNamesCq[0]);
+ auto subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
+ auto regPtr1 = getHelper()->getRegion(regionNamesCq[2]);
QueryHelper* qh = &QueryHelper::getHelper();
@@ -134,18 +133,18 @@ DUNIT_TASK_DEFINITION(CLIENT1, PopulateData)
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, PutData)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesCq[0]);
- RegionPtr subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNamesCq[0]);
+ auto subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
QueryHelper* qh = &QueryHelper::getHelper();
qh->populatePortfolioPdxData(regPtr0, 150, 40, 150);
qh->populatePositionPdxData(subregPtr0, 150, 40);
- CacheablePtr port = nullptr;
+ std::shared_ptr<Cacheable> port = nullptr;
for (int i = 1; i < 150; i++) {
- port = CacheablePtr(new PortfolioPdx(i, 150));
+ port = std::shared_ptr<Cacheable>(new PortfolioPdx(i, 150));
- CacheableKeyPtr keyport = CacheableKey::create((char*)"port1-1");
+ auto keyport = CacheableKey::create((char*)"port1-1");
regPtr0->put(keyport, port);
SLEEP(100); // sleep a while to allow server query to complete
}
@@ -162,7 +161,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, QueryData)
// using region name as pool name
auto pool =
getHelper()->getCache()->getPoolManager().find(regionNamesCq[0]);
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
if (pool != nullptr) {
qs = pool->getQueryService();
} else {
@@ -294,7 +293,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, CheckRegionDestroy)
{
LOG("check region destory");
try {
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesCq[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNamesCq[0]);
if (regPtr0 == nullptr) {
LOG("regPtr0==nullptr");
} else {
diff --git a/cppcache/integration-test/testThinClientDeltaWithNotification.cpp b/cppcache/integration-test/testThinClientDeltaWithNotification.cpp
index 9bb59c9..9ba489f 100644
--- a/cppcache/integration-test/testThinClientDeltaWithNotification.cpp
+++ b/cppcache/integration-test/testThinClientDeltaWithNotification.cpp
@@ -81,7 +81,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -91,7 +91,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
void createPooledExpirationRegion(const char* name, const char* poolname) {
LOG("createPooledExpirationRegion() entered.");
// Entry time-to-live = 1 second.
- RegionPtr regPtr = getHelper()->createPooledRegionDiscOverFlow(
+ auto regPtr = getHelper()->createPooledRegionDiscOverFlow(
name, true, locatorsG, poolname, true, true, std::chrono::seconds(1),
std::chrono::seconds(0), std::chrono::seconds(0), std::chrono::seconds(0),
0, nullptr, ExpirationAction::LOCAL_INVALIDATE);
@@ -102,7 +102,7 @@ void createPooledLRURegion(const char* name, bool ackMode, const char* locators,
bool clientNotificationEnabled = false,
bool cachingEnable = true) {
LOG(" createPooledLRURegion entered");
- RegionPtr regPtr = getHelper()->createPooledRegionDiscOverFlow(
+ auto regPtr = getHelper()->createPooledRegionDiscOverFlow(
name, ackMode, locators, poolname, cachingEnable,
clientNotificationEnabled, std::chrono::seconds(0),
std::chrono::seconds(0), std::chrono::seconds(0), std::chrono::seconds(0),
@@ -116,8 +116,8 @@ void createRegion(const char* name, bool ackMode,
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
// ack, caching
- RegionPtr regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
- clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
+ clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -125,7 +125,7 @@ void createRegion(const char* name, bool ackMode,
void createLRURegion(const char* name, bool clientNotificationEnabled = false,
bool cachingEnable = true) {
LOG(" createPooledLRURegion entered");
- RegionPtr regPtr = getHelper()->createRegionDiscOverFlow(
+ auto regPtr = getHelper()->createRegionDiscOverFlow(
name, cachingEnable, clientNotificationEnabled, std::chrono::seconds(0),
std::chrono::seconds(0), std::chrono::seconds(0), std::chrono::seconds(0),
3 /*LruLimit = 3*/);
@@ -136,7 +136,7 @@ void createExpirationRegion(const char* name,
bool clientNotificationEnabled = false,
bool cachingEnable = true) {
LOG(" createPooledLRURegion entered");
- RegionPtr regPtr = getHelper()->createRegionDiscOverFlow(
+ auto regPtr = getHelper()->createRegionDiscOverFlow(
name, cachingEnable, clientNotificationEnabled, std::chrono::seconds(1),
std::chrono::seconds(0), std::chrono::seconds(0), std::chrono::seconds(0),
0, ExpirationAction::LOCAL_INVALIDATE);
@@ -194,7 +194,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, Client1_Init)
{
try {
- SerializationRegistryPtr serializationRegistry =
+ auto serializationRegistry =
CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
->getSerializationRegistry();
@@ -208,7 +208,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, Client2_Init)
{
try {
- SerializationRegistryPtr serializationRegistry =
+ auto serializationRegistry =
CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
->getSerializationRegistry();
@@ -216,9 +216,9 @@ DUNIT_TASK_DEFINITION(CLIENT2, Client2_Init)
} catch (IllegalStateException&) {
// ignore type reregistration exception.
}
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
- RegionPtr regPtr2 = getHelper()->getRegion(regionNames[2]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr2 = getHelper()->getRegion(regionNames[2]);
regPtr->registerRegex(".*");
regPtr1->registerRegex(".*");
regPtr2->registerRegex(".*");
@@ -234,11 +234,11 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, Client1_Put)
{
- CacheableKeyPtr keyPtr = createKey(keys[0]);
+ auto keyPtr = createKey(keys[0]);
DeltaEx* ptr = new DeltaEx();
auto pdxobj = std::make_shared<PdxDeltaEx>();
- CacheablePtr valPtr(ptr);
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ std::shared_ptr<Cacheable> valPtr(ptr);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
regPtr->put(keyPtr, valPtr);
// Client 2: fromDataCount = 1, fromDeltaCount = 0;
ptr->setDelta(true);
@@ -246,8 +246,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1_Put)
// Client 2: fromDataCount = 1, fromDeltaCount = 1;
DeltaEx* ptr1 = new DeltaEx();
- CacheablePtr valPtr1(ptr1);
- CacheableKeyPtr keyPtr1 = createKey(keys[1]);
+ std::shared_ptr<Cacheable> valPtr1(ptr1);
+ auto keyPtr1 = createKey(keys[1]);
regPtr->put(keyPtr1, valPtr1);
// Client 2: fromDataCount = 2, fromDeltaCount = 1;
ptr1->setDelta(true);
@@ -263,11 +263,11 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1_Put)
// For LRU with notification and disc overflow.
LOG("LRU with notification");
- CacheableKeyPtr keyPtr2 = createKey(keys[2]);
- CacheableKeyPtr keyPtr3 = createKey(keys[3]);
- CacheableKeyPtr keyPtr4 = createKey("LRUKEY4");
- CacheableKeyPtr keyPtr5 = createKey("LRUKEY5");
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto keyPtr2 = createKey(keys[2]);
+ auto keyPtr3 = createKey(keys[3]);
+ auto keyPtr4 = createKey("LRUKEY4");
+ auto keyPtr5 = createKey("LRUKEY5");
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
regPtr1->put(keyPtr2, valPtr1);
// Client 2: fromDataCount = 4, fromDeltaCount = 2;
@@ -292,9 +292,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1_Put)
// oldValue for listeners, fromData()
// is invoked, hence fromDataCount increases by 2.
- RegionPtr regPtr2 = getHelper()->getRegion(regionNames[2]);
+ auto regPtr2 = getHelper()->getRegion(regionNames[2]);
DeltaEx* ptr2 = new DeltaEx();
- CacheablePtr valPtr2(ptr2);
+ std::shared_ptr<Cacheable> valPtr2(ptr2);
regPtr2->put(1, valPtr2);
// Client 2: fromDataCount = 12, fromDeltaCount = 3;
// Sleep for 5 seconds to allow expiration at client 2.
diff --git a/cppcache/integration-test/testThinClientDisconnectionListioner.cpp b/cppcache/integration-test/testThinClientDisconnectionListioner.cpp
index 7e841e1..b7c0dbc 100644
--- a/cppcache/integration-test/testThinClientDisconnectionListioner.cpp
+++ b/cppcache/integration-test/testThinClientDisconnectionListioner.cpp
@@ -34,7 +34,7 @@ const char* locatorsG =
using namespace apache::geode::client;
using namespace test;
class DisconnectCacheListioner : public CacheListener {
- void afterRegionDisconnected(const RegionPtr& region) {
+ void afterRegionDisconnected(const std::shared_ptr<Region>& region) {
LOG("After Region Disconnected event received");
isDisconnected = true;
}
@@ -60,9 +60,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, populateServer)
{
SLEEP(10000);
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
- CacheableKeyPtr keyPtr = createKey("PXR");
- CacheableStringPtr valPtr = CacheableString::create("PXR1");
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+ auto keyPtr = createKey("PXR");
+ auto valPtr = CacheableString::create("PXR1");
regPtr->create(keyPtr, valPtr);
}
END_TASK_DEFINITION
diff --git a/cppcache/integration-test/testThinClientExecuteFunctionPrSHOP.cpp b/cppcache/integration-test/testThinClientExecuteFunctionPrSHOP.cpp
index 221d0e3..c168208 100644
--- a/cppcache/integration-test/testThinClientExecuteFunctionPrSHOP.cpp
+++ b/cppcache/integration-test/testThinClientExecuteFunctionPrSHOP.cpp
@@ -20,6 +20,7 @@
#include "fw_dunit.hpp"
#include "ThinClientHelper.hpp"
#include "testobject/VariousPdxTypes.hpp"
+#include <geode/FunctionService.hpp>
#include <geode/DefaultResultCollector.hpp>
using namespace PdxTests;
@@ -54,12 +55,13 @@ class MyResultCollector : public DefaultResultCollector {
: m_endResultCount(0), m_addResultCount(0), m_getResultCount(0) {}
~MyResultCollector() noexcept {}
- CacheableVectorPtr getResult(std::chrono::milliseconds timeout) override {
+ std::shared_ptr<CacheableVector> getResult(
+ std::chrono::milliseconds timeout) override {
m_getResultCount++;
return DefaultResultCollector::getResult(timeout);
}
- void addResult(const CacheablePtr& resultItem) override {
+ void addResult(const std::shared_ptr<Cacheable>& resultItem) override {
m_addResultCount++;
if (resultItem == nullptr) {
return;
@@ -88,7 +90,6 @@ class MyResultCollector : public DefaultResultCollector {
uint32_t m_addResultCount;
uint32_t m_getResultCount;
};
-typedef std::shared_ptr<MyResultCollector> MyResultCollectorPtr;
class MyResultCollector2 : public DefaultResultCollector {
public:
@@ -96,12 +97,12 @@ class MyResultCollector2 : public DefaultResultCollector {
: m_endResultCount(0), m_addResultCount(0), m_getResultCount(0) {}
~MyResultCollector2() noexcept {}
- CacheableVectorPtr getResult(std::chrono::milliseconds timeout) override {
+ std::shared_ptr<CacheableVector> getResult(std::chrono::milliseconds timeout) override {
m_getResultCount++;
return DefaultResultCollector::getResult(timeout);
}
- void addResult(const CacheablePtr& resultItem) override {
+ void addResult(const std::shared_ptr<Cacheable>& resultItem) override {
m_addResultCount++;
DefaultResultCollector::addResult(resultItem);
}
@@ -120,7 +121,6 @@ class MyResultCollector2 : public DefaultResultCollector {
uint32_t m_addResultCount;
uint32_t m_getResultCount;
};
-typedef std::shared_ptr<MyResultCollector2> MyResultCollectorPtr2;
DUNIT_TASK_DEFINITION(LOCATOR1, StartLocator1)
{
@@ -152,8 +152,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StartC1)
0, true, -1, -1, 60000, /*singlehop*/ true,
/*threadLocal*/ true);
- RegionPtr regPtr0 =
- createRegionAndAttachPool(poolRegNames[0], USE_ACK, nullptr);
+ auto regPtr0 = createRegionAndAttachPool(poolRegNames[0], USE_ACK, nullptr);
;
regPtr0->registerAllKeys();
@@ -163,28 +162,28 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest2)
{
- RegionPtr regPtr0 = getHelper()->getRegion(poolRegNames[0]);
+ auto regPtr0 = getHelper()->getRegion(poolRegNames[0]);
char buf[128];
for (int i = 0; i < 230; i++) {
sprintf(buf, "VALUE--%d", i);
- CacheablePtr value(CacheableString::create(buf));
+ std::shared_ptr<Cacheable> value(CacheableString::create(buf));
regPtr0->put(i, value);
}
LOG("Put done.");
try {
for (int k = 0; k < 210; k++) {
- CacheableVectorPtr routingObj = CacheableVector::create();
+ auto routingObj = CacheableVector::create();
for (int i = k; i < k + 20; i++) {
routingObj->push_back(CacheableInt32::create(i));
}
LOGINFO("routingObj size = %d ", routingObj->size());
- ExecutionPtr exe = FunctionService::onRegion(regPtr0);
+ auto exe = FunctionService::onRegion(regPtr0);
ASSERT(exe != nullptr, "onRegion Returned nullptr");
- CacheableVectorPtr resultList = CacheableVector::create();
+ auto resultList = CacheableVector::create();
LOG("Executing getFuncName function");
- CacheableVectorPtr executeFunctionResult =
+ auto executeFunctionResult =
exe->withFilter(routingObj)
->execute(getFuncName, std::chrono::seconds(15))
->getResult();
@@ -261,7 +260,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest2)
}
LOGINFO("getFuncName MyResultCollector done");
- CacheableVectorPtr executeFunctionResult2 =
+ auto executeFunctionResult2 =
exe->withFilter(routingObj)->execute(FEOnRegionPrSHOP)->getResult();
if (executeFunctionResult2 == nullptr) {
ASSERT(false, "executeFunctionResult2 is nullptr");
@@ -283,12 +282,11 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest2)
///////////////////////// Now same with ResultCollector
////////////////////////////
- MyResultCollectorPtr2 myRC2(new MyResultCollector2());
- CacheableVectorPtr executeFunctionResult21 =
- exe->withFilter(routingObj)
- ->withCollector(myRC2)
- ->execute(FEOnRegionPrSHOP)
- ->getResult();
+ std::shared_ptr<MyResultCollector2> myRC2(new MyResultCollector2());
+ auto executeFunctionResult21 = exe->withFilter(routingObj)
+ ->withCollector(myRC2)
+ ->execute(FEOnRegionPrSHOP)
+ ->getResult();
LOGINFO("add result count = %d", myRC2->getAddResultCount());
LOGINFO("end result count = %d", myRC2->getEndResultCount());
LOGINFO("get result count = %d", myRC2->getGetResultCount());
@@ -315,7 +313,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest2)
/////////////////////// Done with ResultCollector
////////////////////////////////
- CacheableVectorPtr executeFunctionResult3 =
+ auto executeFunctionResult3 =
exe->withFilter(routingObj)
->execute(FEOnRegionPrSHOP_OptimizeForWrite)
->getResult();
@@ -338,8 +336,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest2)
///////////////////////// Now same with ResultCollector
////////////////////////////
- MyResultCollectorPtr2 myRC3(new MyResultCollector2());
- CacheableVectorPtr executeFunctionResult31 =
+ std::shared_ptr<MyResultCollector2> myRC3(new MyResultCollector2());
+ auto executeFunctionResult31 =
exe->withFilter(routingObj)
->withCollector(myRC3)
->execute(FEOnRegionPrSHOP_OptimizeForWrite)
@@ -370,13 +368,12 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest2)
"withFilter");
}
- ExecutionPtr exc = FunctionService::onRegion(regPtr0);
- ASSERT(exc != nullptr, "onRegion Returned nullptr");
- // Now w/o filter, chk for singlehop
- CacheableVectorPtr executeFunctionResult2 =
- exc->execute(FEOnRegionPrSHOP)->getResult();
- if (executeFunctionResult2 == nullptr) {
- ASSERT(false, "executeFunctionResult2 is nullptr");
+ auto exc = FunctionService::onRegion(regPtr0);
+ ASSERT(exc != nullptr, "onRegion Returned nullptr");
+ // Now w/o filter, chk for singlehop
+ auto executeFunctionResult2 = exc->execute(FEOnRegionPrSHOP)->getResult();
+ if (executeFunctionResult2 == nullptr) {
+ ASSERT(false, "executeFunctionResult2 is nullptr");
} else {
sprintf(buf, "result count = %zd", executeFunctionResult2->size());
LOG(buf);
@@ -394,11 +391,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest2)
LOGINFO("FEOnRegionPrSHOP without Filter done");
// Now w/o filter chk single hop
- MyResultCollectorPtr2 resultCollector(new MyResultCollector2());
- CacheableVectorPtr executeFunctionResult21 =
- exc->withCollector(resultCollector)
- ->execute(FEOnRegionPrSHOP)
- ->getResult();
+ std::shared_ptr<MyResultCollector2> resultCollector(new MyResultCollector2());
+ auto executeFunctionResult21 = exc->withCollector(resultCollector)
+ ->execute(FEOnRegionPrSHOP)
+ ->getResult();
LOGINFO("add result count = %d", resultCollector->getAddResultCount());
LOGINFO("end result count = %d", resultCollector->getEndResultCount());
LOGINFO("get result count = %d", resultCollector->getGetResultCount());
@@ -426,8 +422,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest2)
LOGINFO("FEOnRegionPrSHOP done with ResultCollector without filter");
// Now w/o filter chk for singleHop
- MyResultCollectorPtr2 rC(new MyResultCollector2());
- CacheableVectorPtr executeFunctionResult31 =
+ std::shared_ptr<MyResultCollector2> rC(new MyResultCollector2());
+ auto executeFunctionResult31 =
exc->withCollector(rC)
->execute(FEOnRegionPrSHOP_OptimizeForWrite)
->getResult();
@@ -457,10 +453,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest2)
"Filter.");
// Now w/o filter chk for singleHop
- CacheableVectorPtr functionResult =
+ auto functionResult =
exc->execute(FEOnRegionPrSHOP_OptimizeForWrite)->getResult();
- if (functionResult == nullptr) {
- ASSERT(false, "functionResult is nullptr");
+ if (functionResult == nullptr) {
+ ASSERT(false, "functionResult is nullptr");
} else {
sprintf(buf, "result count = %zd", functionResult->size());
LOG(buf);
@@ -479,12 +475,12 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest2)
char KeyStr[256] = {0};
char valStr[256] = {0};
- CacheableVectorPtr fil = CacheableVector::create();
+ auto fil = CacheableVector::create();
for (int i = 0; i < 500; i++) {
ACE_OS::snprintf(KeyStr, 256, "KEY--%d ", i);
ACE_OS::snprintf(valStr, 256, "VALUE--%d ", i);
- CacheableStringPtr keyport = CacheableString::create(KeyStr);
- CacheablePtr valport = CacheableString::create(valStr);
+ auto keyport = CacheableString::create(KeyStr);
+ auto valport = CacheableString::create(valStr);
regPtr0->put(keyport, valport);
fil->push_back(CacheableString::create(KeyStr));
}
@@ -510,12 +506,12 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest2)
}
// Fire N Forget without filter keys
- CacheableArrayListPtr arrList = CacheableArrayList::create();
+ auto arrList = CacheableArrayList::create();
for (int i = 10; i < 200; i++) {
ACE_OS::snprintf(KeyStr, 256, "KEY--%d ", i);
arrList->push_back(CacheableString::create(KeyStr));
}
- ExecutionPtr ex = FunctionService::onRegion(regPtr0);
+ auto ex = FunctionService::onRegion(regPtr0);
ex->withArgs(arrList)->execute(putFuncIName);
LOGINFO(
"Executing ExecuteFunctionOnRegion on region for execKeys for "
diff --git a/cppcache/integration-test/testThinClientFixedPartitionResolver.cpp b/cppcache/integration-test/testThinClientFixedPartitionResolver.cpp
index 7d46c50..90f53a4 100644
--- a/cppcache/integration-test/testThinClientFixedPartitionResolver.cpp
+++ b/cppcache/integration-test/testThinClientFixedPartitionResolver.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include "BuiltinCacheableWrappers.hpp"
#include <Utils.hpp>
#include <geode/FixedPartitionResolver.hpp>
@@ -45,7 +44,7 @@ class CustomFixedPartitionResolver1 : public FixedPartitionResolver {
return "CustomFixedPartitionResolver1";
}
- CacheableKeyPtr getRoutingObject(const EntryEvent& opDetails) {
+ std::shared_ptr<CacheableKey> getRoutingObject(const EntryEvent& opDetails) {
LOG("CustomFixedPartitionResolver1::getRoutingObject()");
int32_t key = atoi(opDetails.getKey()->toString()->asChar());
int32_t newKey = key + 5;
@@ -84,7 +83,7 @@ class CustomFixedPartitionResolver2 : public FixedPartitionResolver {
return "CustomFixedPartitionResolver2";
}
- CacheableKeyPtr getRoutingObject(const EntryEvent& opDetails) {
+ std::shared_ptr<CacheableKey> getRoutingObject(const EntryEvent& opDetails) {
LOG("CustomFixedPartitionResolver2::getRoutingObject()");
int32_t key = atoi(opDetails.getKey()->toString()->asChar());
int32_t newKey = key + 4;
@@ -123,7 +122,7 @@ class CustomFixedPartitionResolver3 : public FixedPartitionResolver {
return "CustomFixedPartitionResolver3";
}
- CacheableKeyPtr getRoutingObject(const EntryEvent& opDetails) {
+ std::shared_ptr<CacheableKey> getRoutingObject(const EntryEvent& opDetails) {
LOG("CustomFixedPartitionResolver3::getRoutingObject()");
int32_t key = atoi(opDetails.getKey()->toString()->asChar());
int32_t newKey = key % 5;
@@ -228,7 +227,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask_REGION)
LOGDEBUG("CheckPrSingleHopForIntKeysTask_REGION create region = %s ",
partitionRegionName);
- RegionPtr dataReg = getHelper()->getRegion(partitionRegionName);
+ auto dataReg = getHelper()->getRegion(partitionRegionName);
for (int i = 0; i < 3000; i++) {
auto keyPtr =
@@ -321,7 +320,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask_REGION)
LOG("CheckPrSingleHopForIntKeysTask_REGION get completed.");
for (int i = 1000; i < 2000; i++) {
- VectorOfCacheableKey keys;
+ std::vector<std::shared_ptr<CacheableKey>> keys;
for (int j = i; j < i + 5; j++) {
keys.push_back(CacheableInt32::create(j));
}
diff --git a/cppcache/integration-test/testThinClientGetInterests.cpp b/cppcache/integration-test/testThinClientGetInterests.cpp
index aaa3102..abe4c3c 100644
--- a/cppcache/integration-test/testThinClientGetInterests.cpp
+++ b/cppcache/integration-test/testThinClientGetInterests.cpp
@@ -42,7 +42,7 @@ END_TASK(StartServer)
DUNIT_TASK(CLIENT1, SetupClient1)
{
- PropertiesPtr pp = Properties::create();
+ auto pp = Properties::create();
pp->insert("durable-client-id", durableIds[0]);
pp->insert("durable-timeout", std::chrono::seconds(300));
pp->insert("notify-ack-interval", std::chrono::seconds(1));
@@ -50,19 +50,19 @@ DUNIT_TASK(CLIENT1, SetupClient1)
initClientWithPool(true, "__TEST_POOL1__", locatorsG, nullptr, pp, 0, true);
getHelper()->createPooledRegion(regionNames[0], false, locatorsG,
"__TEST_POOL1__", true, true);
- CacheableKeyPtr keyPtr0 = CacheableString::create(keys[0]);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- VectorOfCacheableKey keys0;
+ auto keyPtr0 = CacheableString::create(keys[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ std::vector<std::shared_ptr<CacheableKey>> keys0;
keys0.push_back(keyPtr0);
regPtr0->registerKeys(keys0);
- CacheableKeyPtr keyPtr1 = CacheableString::create(keys[1]);
- VectorOfCacheableKey keys1;
+ auto keyPtr1 = CacheableString::create(keys[1]);
+ std::vector<std::shared_ptr<CacheableKey>> keys1;
keys1.push_back(keyPtr1);
regPtr0->registerKeys(keys1);
regPtr0->registerRegex(testregex[0]);
regPtr0->registerRegex(testregex[1]);
- CacheableKeyPtr keyPtr2 = CacheableString::create(keys[2]);
- VectorOfCacheableKey keys2;
+ auto keyPtr2 = CacheableString::create(keys[2]);
+ std::vector<std::shared_ptr<CacheableKey>> keys2;
keys2.push_back(keyPtr2);
keyPtr2 = CacheableString::create(keys[3]);
keys2.push_back(keyPtr2);
@@ -90,7 +90,7 @@ DUNIT_TASK(CLIENT1, SetupClient1)
}
for (int32_t i = 0; i < vreg.size(); i++) {
char buf[1024];
- CacheableStringPtr ptr = vreg[i];
+ auto ptr = vreg[i];
const char* reg = ptr->asChar();
sprintf(buf, "regex[%d]=%s", i, reg);
LOG(buf);
@@ -108,7 +108,7 @@ DUNIT_TASK(CLIENT1, SetupClient1)
auto vreg1 = regPtr0->getInterestListRegex();
for (int32_t i = 0; i < vreg1.size(); i++) {
char buf[1024];
- CacheableStringPtr ptr = vreg1[i];
+ auto ptr = vreg1[i];
sprintf(buf, "regex[%d]=%s", i, ptr->asChar());
LOG(buf);
}
diff --git a/cppcache/integration-test/testThinClientHADistOps.cpp b/cppcache/integration-test/testThinClientHADistOps.cpp
index 5060079..7719408 100644
--- a/cppcache/integration-test/testThinClientHADistOps.cpp
+++ b/cppcache/integration-test/testThinClientHADistOps.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
@@ -44,7 +43,7 @@ const char* locatorsG =
static int clientWithRedundancy = 0;
void initClient(int redundancyLevel) {
if (cacheHelper == nullptr) {
- PropertiesPtr config = Properties::create();
+ auto config = Properties::create();
if (clientWithRedundancy > 0) config->insert("grid-client", "true");
clientWithRedundancy += 1;
cacheHelper = new CacheHelper(redundancyLevel, config);
@@ -55,7 +54,7 @@ void initClient(int redundancyLevel) {
static int clientWithNothing = 0;
void initClient() {
if (cacheHelper == nullptr) {
- PropertiesPtr config = Properties::create();
+ auto config = Properties::create();
if (clientWithNothing > 1) config->insert("grid-client", "true");
clientWithNothing += 1;
cacheHelper = new CacheHelper(true, config);
@@ -66,7 +65,7 @@ void initClient() {
static int clientWithXml = 0;
void initClient(const char* clientXmlFile) {
if (cacheHelper == nullptr) {
- PropertiesPtr config = Properties::create();
+ auto config = Properties::create();
if (clientWithXml > 2) config->insert("grid-client", "true");
clientWithXml += 1;
cacheHelper = new CacheHelper(nullptr, clientXmlFile, config);
@@ -105,10 +104,10 @@ void _verifyEntry(const char* name, const char* key, const char* val,
LOG(buf);
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
// if the region is no ack, then we may need to wait...
if (noKey == false) { // need to find the key!
@@ -199,9 +198,9 @@ void destroyEntry(const char* name, const char* key) {
fprintf(stdout, "Destroying entry -- key: %s in region %s\n", key, name);
fflush(stdout);
// Destroy entry, verify entry is destroyed
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -219,8 +218,8 @@ void createRegion(const char* name, bool ackMode,
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
char* endpoints = nullptr;
- RegionPtr regPtr = getHelper()->createRegion(
- name, ackMode, true, nullptr, endpoints, clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
+ endpoints, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -232,10 +231,10 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- PoolPtr poolPtr = getHelper()->createPool(
+ auto poolPtr = getHelper()->createPool(
poolname, locators, nullptr, reduendency, clientNotificationEnabled);
- RegionPtr regPtr = getHelper()->createRegionAndAttachPool(
- name, ackMode, poolname, cachingEnable);
+ auto regPtr = getHelper()->createRegionAndAttachPool(name, ackMode, poolname,
+ cachingEnable);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Pooled Region created.");
}
@@ -245,10 +244,10 @@ void createEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -270,10 +269,10 @@ void updateEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -294,9 +293,9 @@ void doGetAgain(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "get region name%s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -326,9 +325,9 @@ void doNetsearch(const char* name, const char* key, const char* value) {
fflush(stdout);
static int count = 0;
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "netsearch region %s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -417,8 +416,8 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, RegisterClient1Keys)
{
- RegionPtr reg0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr reg1 = getHelper()->getRegion(regionNames[1]);
+ auto reg0 = getHelper()->getRegion(regionNames[0]);
+ auto reg1 = getHelper()->getRegion(regionNames[1]);
auto vec0 = reg0->serverKeys();
auto vec1 = reg1->serverKeys();
ASSERT(vec0.size() == 2, "Should have 2 keys in first region.");
@@ -443,13 +442,13 @@ DUNIT_TASK_DEFINITION(CLIENT1, RegisterClient1Keys)
doNetsearch(regionNames[0], keys[1], vals[1]);
doNetsearch(regionNames[1], keys[3], vals[3]);
- CacheableKeyPtr keyPtr1 = CacheableKey::create(keys[1]);
- CacheableKeyPtr keyPtr3 = CacheableKey::create(keys[3]);
+ auto keyPtr1 = CacheableKey::create(keys[1]);
+ auto keyPtr3 = CacheableKey::create(keys[3]);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
- VectorOfCacheableKey keys0, keys1;
+ std::vector<std::shared_ptr<CacheableKey>> keys0, keys1;
keys0.push_back(keyPtr1);
keys1.push_back(keyPtr3);
regPtr0->registerKeys(keys0);
@@ -463,13 +462,13 @@ DUNIT_TASK_DEFINITION(CLIENT2, RegisterClient2Keys)
doNetsearch(regionNames[0], keys[0], vals[0]);
doNetsearch(regionNames[1], keys[2], vals[2]);
- CacheableKeyPtr keyPtr0 = CacheableKey::create(keys[0]);
- CacheableKeyPtr keyPtr2 = CacheableKey::create(keys[2]);
+ auto keyPtr0 = CacheableKey::create(keys[0]);
+ auto keyPtr2 = CacheableKey::create(keys[2]);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
- VectorOfCacheableKey keys0, keys1;
+ std::vector<std::shared_ptr<CacheableKey>> keys0, keys1;
keys0.push_back(keyPtr0);
keys1.push_back(keyPtr2);
regPtr0->registerKeys(keys0);
diff --git a/cppcache/integration-test/testThinClientHAEventIDMap.cpp b/cppcache/integration-test/testThinClientHAEventIDMap.cpp
index b0e264d..ed94169 100644
--- a/cppcache/integration-test/testThinClientHAEventIDMap.cpp
+++ b/cppcache/integration-test/testThinClientHAEventIDMap.cpp
@@ -15,14 +15,17 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
-#include <ace/High_Res_Timer.h>
-#include <ace/OS.h>
#include <string>
#include <thread>
#include <chrono>
+#include <ace/High_Res_Timer.h>
+#include <ace/OS.h>
+
+#include <geode/EntryEvent.hpp>
+
+
#define ROOT_NAME "testThinClientHAEventIDMap"
#define ROOT_SCOPE DISTRIBUTED_ACK
@@ -38,7 +41,7 @@ class DupChecker : public CacheListener {
void check(const EntryEvent& event) {
m_ops++;
- CacheableKeyPtr key = event.getKey();
+ auto key = event.getKey();
auto value = std::dynamic_pointer_cast<CacheableInt32>(event.getNewValue());
const auto& item = m_map.find(key);
@@ -76,8 +79,6 @@ class DupChecker : public CacheListener {
virtual void afterRegionDestroy(const RegionEvent& event){};
};
-typedef std::shared_ptr<DupChecker> DupCheckerPtr;
-
///////////////////////////////////////////////////////
#define CLIENT1 s1p1
@@ -95,7 +96,7 @@ const char* locatorsG =
int g_redundancyLevel = 0;
void initClient() {
- PropertiesPtr props = Properties::create();
+ auto props = Properties::create();
props->insert("notify-ack-interval", std::chrono::hours(1)); // set to 1 hr.
props->insert("notify-dupcheck-life", std::chrono::hours(1));
@@ -138,10 +139,10 @@ void _verifyEntry(const char* name, const char* key, const char* val,
}
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
// if the region is no ack, then we may need to wait...
if (!isCreated) {
@@ -229,10 +230,10 @@ void _verifyIntEntry(const char* name, const char* key, const int val,
}
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
// if the region is no ack, then we may need to wait...
if (!isCreated) {
@@ -340,8 +341,8 @@ void createRegion(const char* name, bool ackMode,
fflush(stdout);
char* endpoints = nullptr;
// ack, caching
- RegionPtr regPtr = getHelper()->createRegion(
- name, ackMode, true, nullptr, endpoints, clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
+ endpoints, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -352,10 +353,10 @@ void createEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -377,10 +378,10 @@ void createIntEntry(const char* name, const char* key, const int value) {
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableInt32Ptr valPtr = CacheableInt32::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableInt32::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
// ASSERT( !regPtr->containsKey( keyPtr ), "Key should not have been found in
@@ -396,9 +397,10 @@ void createIntEntry(const char* name, const char* key, const int value) {
LOG("Entry created.");
}
-void setCacheListener(const char* regName, DupCheckerPtr checker) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
+void setCacheListener(const char* regName,
+ std::shared_ptr<DupChecker> checker) {
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheListener(checker);
}
@@ -411,13 +413,12 @@ const char* regionNames[] = {"DistRegionAck", "DistRegionNoAck"};
const bool USE_ACK = true;
const bool NO_ACK = false;
-
-DupCheckerPtr checker1;
-DupCheckerPtr checker2;
+std::shared_ptr<DupChecker> checker1;
+std::shared_ptr<DupChecker> checker2;
void initClientAndRegion(int redundancy,
bool clientNotificationEnabled = true) {
- PropertiesPtr pp = Properties::create();
+ auto pp = Properties::create();
getHelper()->createPoolWithLocators("__TESTPOOL1_", locatorsG,
clientNotificationEnabled, redundancy);
diff --git a/cppcache/integration-test/testThinClientHAFailover.cpp b/cppcache/integration-test/testThinClientHAFailover.cpp
index 58b10fd..583bfd6 100644
--- a/cppcache/integration-test/testThinClientHAFailover.cpp
+++ b/cppcache/integration-test/testThinClientHAFailover.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/High_Res_Timer.h>
#include <ace/OS.h>
@@ -49,7 +48,7 @@ void initClient(int redundancyLevel) {
s_isGridClient = !s_isGridClient;
if (cacheHelper == nullptr) {
- PropertiesPtr config = Properties::create();
+ auto config = Properties::create();
if (s_isGridClient) {
config->insert("grid-client", "true");
}
@@ -64,7 +63,7 @@ void initClient() // For POOL API redendency will be set at POOL level.
static bool s_isGridClient = true;
s_isGridClient = !s_isGridClient;
if (cacheHelper == nullptr) {
- PropertiesPtr config = Properties::create();
+ auto config = Properties::create();
if (s_isGridClient) {
config->insert("grid-client", "true");
}
@@ -106,10 +105,10 @@ void _verifyEntry(const char* name, const char* key, const char* val,
}
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
// if the region is no ack, then we may need to wait...
if (!isCreated) {
@@ -205,8 +204,8 @@ void createRegion(const char* name, bool ackMode,
fflush(stdout);
char* endpoints = nullptr;
// ack, caching
- RegionPtr regPtr = getHelper()->createRegion(
- name, ackMode, true, nullptr, endpoints, clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
+ endpoints, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -216,10 +215,10 @@ void createEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -241,10 +240,10 @@ void updateEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -266,9 +265,9 @@ void doNetsearch(const char* name, const char* key, const char* value) {
key, value, name);
fflush(stdout);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "netsearch region %s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -303,7 +302,7 @@ const char* regionNames[] = {"DistRegionAck", "DistRegionNoAck"};
const bool USE_ACK = true;
void initClientAndRegion(int redundancy) {
- PropertiesPtr pp = Properties::create();
+ auto pp = Properties::create();
g_redundancyLevel = redundancy;
getHelper()->createPoolWithLocators("__TESTPOOL1_", locatorsG, true,
redundancy);
@@ -385,13 +384,13 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, RegisterKeys)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
- CacheableKeyPtr keyPtr0 = CacheableKey::create(keys[0]);
- CacheableKeyPtr keyPtr2 = CacheableKey::create(keys[2]);
+ auto keyPtr0 = CacheableKey::create(keys[0]);
+ auto keyPtr2 = CacheableKey::create(keys[2]);
- VectorOfCacheableKey keys0, keys1;
+ std::vector<std::shared_ptr<CacheableKey>> keys0, keys1;
keys0.push_back(keyPtr0);
keys1.push_back(keyPtr2);
if (g_redundancyLevel > 1) {
@@ -503,11 +502,11 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepEight)
verifyEntry(regionNames[1], keys[2], vals[2]);
verifyEntry(regionNames[1], keys[3], vals[3]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
- CacheableKeyPtr keyPtr2 = CacheableKey::create(keys[2]);
+ auto keyPtr2 = CacheableKey::create(keys[2]);
- VectorOfCacheableKey keys1;
+ std::vector<std::shared_ptr<CacheableKey>> keys1;
keys1.push_back(keyPtr2);
regPtr1->unregisterKeys(keys1);
LOG("StepEight complete.");
diff --git a/cppcache/integration-test/testThinClientHAFailoverRegex.cpp b/cppcache/integration-test/testThinClientHAFailoverRegex.cpp
index 93e19c7..f662ad8 100644
--- a/cppcache/integration-test/testThinClientHAFailoverRegex.cpp
+++ b/cppcache/integration-test/testThinClientHAFailoverRegex.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/High_Res_Timer.h>
#include <ace/OS.h>
@@ -84,10 +83,10 @@ void _verifyEntry(const char* name, const char* key, const char* val,
}
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
// if the region is no ack, then we may need to wait...
if (!isCreated) {
@@ -182,8 +181,8 @@ void createRegion(const char* name, bool ackMode,
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
// ack, caching
- RegionPtr regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
- clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
+ clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -194,10 +193,10 @@ void createEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -219,10 +218,10 @@ void updateEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -244,9 +243,9 @@ void doNetsearch(const char* name, const char* key, const char* value) {
key, value, name);
fflush(stdout);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "netsearch region %s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -283,7 +282,7 @@ const char* regionNames[] = {"DistRegionAck", "DistRegionNoAck"};
const bool USE_ACK = true;
void initClientAndRegion(int redundancy) {
g_redundancyLevel = redundancy;
- PropertiesPtr pp = Properties::create();
+ auto pp = Properties::create();
getHelper()->createPoolWithLocators("__TESTPOOL1_", locatorsG, true,
redundancy);
getHelper()->createRegionAndAttachPool(regionNames[0], USE_ACK,
@@ -363,8 +362,8 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, RegisterRegexes)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
if (g_redundancyLevel > 1) {
regPtr0->registerRegex(testregex[0]);
@@ -421,8 +420,8 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, StepSix)
{
- RegionPtr reg0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr reg1 = getHelper()->getRegion(regionNames[1]);
+ auto reg0 = getHelper()->getRegion(regionNames[0]);
+ auto reg1 = getHelper()->getRegion(regionNames[1]);
auto vec0 = reg0->serverKeys();
auto vec1 = reg1->serverKeys();
ASSERT(vec0.size() == 2, "Should have 2 keys in first region.");
@@ -502,7 +501,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepEight)
verifyEntry(regionNames[1], keys[2], vals[2]);
verifyEntry(regionNames[1], keys[3], vals[3]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
regPtr1->unregisterRegex(testregex[2]);
LOG("StepEight complete.");
diff --git a/cppcache/integration-test/testThinClientHAMixedRedundancy.cpp b/cppcache/integration-test/testThinClientHAMixedRedundancy.cpp
index 7fd15ee..a232332 100644
--- a/cppcache/integration-test/testThinClientHAMixedRedundancy.cpp
+++ b/cppcache/integration-test/testThinClientHAMixedRedundancy.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/High_Res_Timer.h>
#include <ace/OS.h>
@@ -89,10 +88,10 @@ void _verifyEntry(const char* name, const char* key, const char* val,
}
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
// if the region is no ack, then we may need to wait...
if (!isCreated) {
@@ -188,8 +187,8 @@ void createRegion(const char* name, bool ackMode,
fflush(stdout);
char* endpoints = nullptr;
// ack, caching
- RegionPtr regPtr = getHelper()->createRegion(
- name, ackMode, true, nullptr, endpoints, clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
+ endpoints, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -200,10 +199,10 @@ void createEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -225,10 +224,10 @@ void updateEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -250,9 +249,9 @@ void doNetsearch(const char* name, const char* key, const char* value) {
key, value, name);
fflush(stdout);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "netsearch region %s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -288,7 +287,7 @@ const char* regionNames[] = {"DistRegionAck", "DistRegionNoAck"};
const bool USE_ACK = true;
#include "ThinClientTasks_C2S2.hpp"
void createCommRegions(int redundancy) {
- PropertiesPtr pp = Properties::create();
+ auto pp = Properties::create();
getHelper()->createPoolWithLocators("__TESTPOOL1_", locatorsG, true,
redundancy);
getHelper()->createRegionAndAttachPool(regionNames[0], USE_ACK,
@@ -343,13 +342,13 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepOne)
SLEEP(1000);
createEntry(regionNames[1], keys[3], vals[3]);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
- CacheableKeyPtr keyPtr0 = CacheableKey::create(keys[0]);
- CacheableKeyPtr keyPtr2 = CacheableKey::create(keys[2]);
+ auto keyPtr0 = CacheableKey::create(keys[0]);
+ auto keyPtr2 = CacheableKey::create(keys[2]);
- VectorOfCacheableKey keys0, keys1;
+ std::vector<std::shared_ptr<CacheableKey>> keys0, keys1;
keys0.push_back(keyPtr0);
keys1.push_back(keyPtr2);
regPtr0->registerKeys(keys0);
@@ -373,13 +372,13 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepTwo)
doNetsearch(regionNames[1], keys[2], vals[2]);
doNetsearch(regionNames[1], keys[3], vals[3]);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
- CacheableKeyPtr keyPtr1 = CacheableKey::create(keys[1]);
- CacheableKeyPtr keyPtr3 = CacheableKey::create(keys[3]);
+ auto keyPtr1 = CacheableKey::create(keys[1]);
+ auto keyPtr3 = CacheableKey::create(keys[3]);
- VectorOfCacheableKey keys0, keys1;
+ std::vector<std::shared_ptr<CacheableKey>> keys0, keys1;
keys0.push_back(keyPtr1);
keys1.push_back(keyPtr3);
regPtr0->registerKeys(keys0);
@@ -403,13 +402,13 @@ DUNIT_TASK_DEFINITION(CLIENT3, StepThree)
doNetsearch(regionNames[1], keys[2], vals[2]);
doNetsearch(regionNames[1], keys[3], vals[3]);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
- CacheableKeyPtr keyPtr0 = CacheableKey::create(keys[0]);
- CacheableKeyPtr keyPtr3 = CacheableKey::create(keys[3]);
+ auto keyPtr0 = CacheableKey::create(keys[0]);
+ auto keyPtr3 = CacheableKey::create(keys[3]);
- VectorOfCacheableKey keys0, keys1;
+ std::vector<std::shared_ptr<CacheableKey>> keys0, keys1;
keys0.push_back(keyPtr0);
keys1.push_back(keyPtr3);
regPtr0->registerKeys(keys0);
diff --git a/cppcache/integration-test/testThinClientHAPeriodicAck.cpp b/cppcache/integration-test/testThinClientHAPeriodicAck.cpp
index dae1da7..38ec5c0 100644
--- a/cppcache/integration-test/testThinClientHAPeriodicAck.cpp
+++ b/cppcache/integration-test/testThinClientHAPeriodicAck.cpp
@@ -15,14 +15,17 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
-#include <ace/High_Res_Timer.h>
-#include <ace/OS.h>
#include <string>
#include <thread>
#include <chrono>
+#include <ace/High_Res_Timer.h>
+#include <ace/OS.h>
+
+#include <geode/EntryEvent.hpp>
+
+
#define ROOT_NAME "testThinClientHAPeriodicAck"
#define ROOT_SCOPE DISTRIBUTED_ACK
@@ -38,7 +41,7 @@ class DupChecker : public CacheListener {
void check(const EntryEvent& event) {
m_ops++;
- CacheableKeyPtr key = event.getKey();
+ auto key = event.getKey();
auto value = std::dynamic_pointer_cast<CacheableInt32>(event.getNewValue());
const auto& item = m_map.find(key);
@@ -76,8 +79,6 @@ class DupChecker : public CacheListener {
virtual void afterRegionDestroy(const RegionEvent& event){};
};
-typedef std::shared_ptr<DupChecker> DupCheckerPtr;
-
///////////////////////////////////////////////////////
#define CLIENT1 s1p1
@@ -96,7 +97,7 @@ bool g_poolConfig = false;
bool g_poolLocators = false;
void initClient(int redundancyLevel) {
- PropertiesPtr props = Properties::create();
+ auto props = Properties::create();
props->insert("notify-ack-interval", std::chrono::seconds(1));
props->insert("notify-dupcheck-life", std::chrono::seconds(30));
@@ -108,7 +109,7 @@ void initClient(int redundancyLevel) {
}
void initClient() {
- PropertiesPtr props = Properties::create();
+ auto props = Properties::create();
props->insert("notify-ack-interval", std::chrono::seconds(1));
props->insert("notify-dupcheck-life", std::chrono::seconds(30));
@@ -151,10 +152,10 @@ void _verifyEntry(const char* name, const char* key, const char* val,
}
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
// if the region is no ack, then we may need to wait...
if (!isCreated) {
@@ -242,10 +243,10 @@ void _verifyIntEntry(const char* name, const char* key, const int val,
}
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
// if the region is no ack, then we may need to wait...
if (!isCreated) {
@@ -353,8 +354,8 @@ void createRegion(const char* name, bool ackMode,
fflush(stdout);
char* endpoints = nullptr;
// ack, caching
- RegionPtr regPtr = getHelper()->createRegion(
- name, ackMode, true, nullptr, endpoints, clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
+ endpoints, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -365,10 +366,10 @@ void createEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -390,10 +391,10 @@ void createIntEntry(const char* name, const char* key, const int value) {
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableInt32Ptr valPtr = CacheableInt32::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableInt32::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
// ASSERT( !regPtr->containsKey( keyPtr ), "Key should not have been found in
@@ -409,9 +410,10 @@ void createIntEntry(const char* name, const char* key, const int value) {
LOG("Entry created.");
}
-void setCacheListener(const char* regName, DupCheckerPtr checker) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
+void setCacheListener(const char* regName,
+ std::shared_ptr<DupChecker> checker) {
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheListener(checker);
}
@@ -424,12 +426,11 @@ const char* regionNames[] = {"DistRegionAck", "DistRegionNoAck"};
const bool USE_ACK = true;
const bool NO_ACK = false;
-
-DupCheckerPtr checker1;
-DupCheckerPtr checker2;
+std::shared_ptr<DupChecker> checker1;
+std::shared_ptr<DupChecker> checker2;
void initClientAndRegion(int redundancy) {
- PropertiesPtr pp = Properties::create();
+ auto pp = Properties::create();
getHelper()->createPoolWithLocators("__TESTPOOL1_", locatorsG, true,
redundancy);
getHelper()->createRegionAndAttachPool(regionNames[0], USE_ACK,
diff --git a/cppcache/integration-test/testThinClientHAQueryFailover.cpp b/cppcache/integration-test/testThinClientHAQueryFailover.cpp
index 18299df..178ae63 100644
--- a/cppcache/integration-test/testThinClientHAQueryFailover.cpp
+++ b/cppcache/integration-test/testThinClientHAQueryFailover.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <ace/Task.h>
@@ -85,7 +84,7 @@ void initClient() {
}
ASSERT(cacheHelper, "Failed to create a CacheHelper client instance.");
try {
- SerializationRegistryPtr serializationRegistry =
+ auto serializationRegistry =
CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
->getSerializationRegistry();
@@ -127,8 +126,8 @@ void createRegion(const char* name, bool ackMode,
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
char* endpoints = nullptr;
- RegionPtr regPtr = getHelper()->createRegion(
- name, ackMode, false, nullptr, endpoints, clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, false, nullptr,
+ endpoints, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -141,7 +140,7 @@ const bool NO_ACK ATTR_UNUSED = false;
KillServerThread* kst = nullptr;
void initClientAndRegion(int redundancy) {
- // PropertiesPtr pp = Properties::create();
+ // std::shared_ptr<Properties> pp = Properties::create();
getHelper()->createPoolWithLocators("__TESTPOOL1_", locatorsG, true,
redundancy);
getHelper()->createRegionAndAttachPool(regionNames[0], USE_ACK,
@@ -169,7 +168,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepOne)
initClient();
initClientAndRegion(1);
- RegionPtr rptr = getHelper()->cachePtr->getRegion(regionNames[0]);
+ auto rptr = getHelper()->cachePtr->getRegion(regionNames[0]);
auto port1 = std::make_shared<Portfolio>(1, 100);
auto port2 = std::make_shared<Portfolio>(2, 200);
@@ -199,17 +198,17 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
try {
kst = new KillServerThread();
- QueryServicePtr qs = nullptr;
+ std::shared_ptr<QueryService> qs = nullptr;
- PoolPtr pool =
+ auto pool =
getHelper()->getCache()->getPoolManager().find("__TESTPOOL1_");
qs = pool->getQueryService();
LOG("Got query service from pool");
for (int i = 0; i < 10000; i++) {
- QueryPtr qry = qs->newQuery("select distinct * from /Portfolios");
+ auto qry = qs->newQuery("select distinct * from /Portfolios");
- SelectResultsPtr results;
+ std::shared_ptr<SelectResults> results;
// try
//{
diff --git a/cppcache/integration-test/testThinClientHeapLRU.cpp b/cppcache/integration-test/testThinClientHeapLRU.cpp
index 83e45d4..6b7c907 100644
--- a/cppcache/integration-test/testThinClientHeapLRU.cpp
+++ b/cppcache/integration-test/testThinClientHeapLRU.cpp
@@ -14,17 +14,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+#define ROOT_NAME "TestThinClientHeapLRU"
+#define ROOT_SCOPE DISTRIBUTED_ACK
+
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include "BuiltinCacheableWrappers.hpp"
#include <string>
-
-#define ROOT_NAME "TestThinClientHeapLRU"
-#define ROOT_SCOPE DISTRIBUTED_ACK
-
#include "ThinClientHelper.hpp"
using namespace apache::geode::client;
@@ -41,7 +40,7 @@ const char* _regionNames[] = {"DistRegionAck"};
void createOnekEntries() {
CacheableHelper::registerBuiltins();
- RegionPtr dataReg = getHelper()->getRegion(_regionNames[0]);
+ auto dataReg = getHelper()->getRegion(_regionNames[0]);
for (int i = 0; i < 2048; i++) {
CacheableWrapper* tmpkey =
CacheableWrapperFactory::createInstance(GeodeTypeIds::CacheableInt32);
@@ -71,7 +70,7 @@ void createOnekEntries() {
DUNIT_TASK_DEFINITION(CLIENT1, StepOne)
{
- PropertiesPtr pp = Properties::create();
+ auto pp = Properties::create();
pp->insert("heap-lru-limit", 1);
pp->insert("heap-lru-delta", 10);
initClientWithPool(true, "__TEST_POOL1__", locatorsG, nullptr, pp, 0, true);
@@ -83,7 +82,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, StepTwo)
{
- PropertiesPtr pp = Properties::create();
+ auto pp = Properties::create();
pp->insert("heap-lru-limit", 1);
pp->insert("heap-lru-delta", 10);
initClientWithPool(true, "__TEST_POOL1__", locatorsG, nullptr, pp, 0, true);
diff --git a/cppcache/integration-test/testThinClientIntResPolKeysInv.cpp b/cppcache/integration-test/testThinClientIntResPolKeysInv.cpp
index d629560..7311f64 100644
--- a/cppcache/integration-test/testThinClientIntResPolKeysInv.cpp
+++ b/cppcache/integration-test/testThinClientIntResPolKeysInv.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <string>
@@ -77,10 +76,10 @@ void _verifyEntry(const char *name, const char *key, const char *val,
}
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
// if the region is no ack, then we may need to wait...
if (!isCreated) {
@@ -193,8 +192,8 @@ void createRegion(const char *name, bool ackMode, const char *endpoints,
LOG("createRegion() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr = getHelper()->createRegion(
- name, ackMode, true, nullptr, endpoints, clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
+ endpoints, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -205,13 +204,13 @@ void createEntry(const char *name, const char *key,
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
if (value == nullptr) {
value = "";
}
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -233,10 +232,10 @@ void updateEntry(const char *name, const char *key, const char *value) {
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -258,9 +257,9 @@ void doNetsearch(const char *name, const char *key, const char *value) {
key, value, name);
fflush(stdout);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "netsearch region %s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -361,7 +360,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepSeven)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
regPtr0->registerRegex(regex23);
verifyInvalid(regionNames[0], keys[1]);
@@ -376,7 +375,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, StepEight)
{
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
// regPtr1->registerRegex(regexWildcard);
regPtr1->registerAllKeys();
@@ -396,13 +395,13 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepNine)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
regPtr0->unregisterRegex(regex23);
- CacheableKeyPtr keyptr0 = CacheableKey::create(keys[0]);
- CacheableKeyPtr keyptr1 = CacheableKey::create(keys[1]);
- CacheableKeyPtr keyptr2 = CacheableKey::create(keys[2]);
- VectorOfCacheableKey keylist;
+ auto keyptr0 = CacheableKey::create(keys[0]);
+ auto keyptr1 = CacheableKey::create(keys[1]);
+ auto keyptr2 = CacheableKey::create(keys[2]);
+ std::vector<std::shared_ptr<CacheableKey>> keylist;
keylist.push_back(keyptr0);
keylist.push_back(keyptr1);
keylist.push_back(keyptr2);
diff --git a/cppcache/integration-test/testThinClientInterest1Cacheless.cpp b/cppcache/integration-test/testThinClientInterest1Cacheless.cpp
index 5dafd5d..3537365 100644
--- a/cppcache/integration-test/testThinClientInterest1Cacheless.cpp
+++ b/cppcache/integration-test/testThinClientInterest1Cacheless.cpp
@@ -17,7 +17,6 @@
#include "fw_dunit.hpp"
#include "ThinClientHelper.hpp"
-#include <geode/GeodeCppCache.hpp>
#define CLIENT1 s1p1
#define CLIENT2 s1p2
@@ -30,8 +29,6 @@ using namespace test;
class MyListener;
-typedef std::shared_ptr<MyListener> MyListenerPtr;
-
class MyListener : public CacheListener {
uint8_t m_gotit[5];
@@ -58,13 +55,11 @@ class MyListener : public CacheListener {
}
return true;
}
-};
-
-MyListenerPtr mylistner = nullptr;
+};std::shared_ptr<MyListener> mylistner = nullptr;
-void setCacheListener(const char* regName, MyListenerPtr regListener) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
+void setCacheListener(const char* regName, std::shared_ptr<MyListener> regListener) {
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheListener(regListener);
}
@@ -96,17 +91,17 @@ DUNIT_TASK(CLIENT2, setupClient2)
"__TEST_POOL1__", true, true);
mylistner = std::make_shared<MyListener>();
setCacheListener(regionNames[0], mylistner);
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
regPtr->registerAllKeys(false, true);
}
END_TASK(setupClient2)
DUNIT_TASK(CLIENT1, populateServer)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
for (int i = 0; i < 5; i++) {
- CacheableKeyPtr keyPtr = CacheableKey::create(keys[i]);
- regPtr->create(keyPtr, vals[i]);
+ auto keyPtr = CacheableKey::create(keys[i]);
+ regPtr->create(keyPtr, vals[i]);
}
SLEEP(1000);
}
diff --git a/cppcache/integration-test/testThinClientInterest1_Bug1001.cpp b/cppcache/integration-test/testThinClientInterest1_Bug1001.cpp
index 9a9498b..cbe58b3 100644
--- a/cppcache/integration-test/testThinClientInterest1_Bug1001.cpp
+++ b/cppcache/integration-test/testThinClientInterest1_Bug1001.cpp
@@ -27,8 +27,7 @@ using namespace test;
#include "locator_globals.hpp"
#include "LocatorHelper.hpp"
-
-CacheableStringPtr getUString(int index) {
+std::shared_ptr<CacheableString> getUString(int index) {
std::wstring baseStr(40, L'\x20AC');
wchar_t indexStr[15];
swprintf(indexStr, 14, L"%10d", index);
@@ -36,275 +35,274 @@ CacheableStringPtr getUString(int index) {
return CacheableString::create(baseStr.data(),
static_cast<int32_t>(baseStr.length()));
}
+ std::shared_ptr<CacheableString> getUAString(int index) {
+ std::wstring baseStr(40, L'A');
+ wchar_t indexStr[15];
+ swprintf(indexStr, 14, L"%10d", index);
+ baseStr.append(indexStr);
+ return CacheableString::create(baseStr.data(),
+ static_cast<int32_t>(baseStr.length()));
+ }
-CacheableStringPtr getUAString(int index) {
- std::wstring baseStr(40, L'A');
- wchar_t indexStr[15];
- swprintf(indexStr, 14, L"%10d", index);
- baseStr.append(indexStr);
- return CacheableString::create(baseStr.data(),
- static_cast<int32_t>(baseStr.length()));
-}
-
-DUNIT_TASK_DEFINITION(CLIENT1, SetupClient1)
- {
- initClientWithPool(true, "__TEST_POOL1__", locatorsG, nullptr, nullptr, 0,
- true);
- getHelper()->createPooledRegion(regionNames[0], false, locatorsG,
- "__TEST_POOL1__", true, true);
- }
-END_TASK_DEFINITION
+ DUNIT_TASK_DEFINITION(CLIENT1, SetupClient1)
+ {
+ initClientWithPool(true, "__TEST_POOL1__", locatorsG, nullptr, nullptr, 0,
+ true);
+ getHelper()->createPooledRegion(regionNames[0], false, locatorsG,
+ "__TEST_POOL1__", true, true);
+ }
+ END_TASK_DEFINITION
-DUNIT_TASK_DEFINITION(CLIENT1, populateServer)
- {
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
- for (int i = 0; i < 5; i++) {
- CacheableKeyPtr keyPtr = CacheableKey::create(keys[i]);
- regPtr->create(keyPtr, vals[i]);
- }
- SLEEP(200);
- }
-END_TASK_DEFINITION
+ DUNIT_TASK_DEFINITION(CLIENT1, populateServer)
+ {
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+ for (int i = 0; i < 5; i++) {
+ auto keyPtr = CacheableKey::create(keys[i]);
+ regPtr->create(keyPtr, vals[i]);
+ }
+ SLEEP(200);
+ }
+ END_TASK_DEFINITION
-DUNIT_TASK_DEFINITION(CLIENT2, setupClient2)
- {
- initClientWithPool(true, "__TEST_POOL1__", locatorsG, nullptr, nullptr, 0,
- true);
- getHelper()->createPooledRegion(regionNames[0], false, locatorsG,
- "__TEST_POOL1__", true, true);
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
- regPtr->registerAllKeys(false, true);
- }
-END_TASK_DEFINITION
+ DUNIT_TASK_DEFINITION(CLIENT2, setupClient2)
+ {
+ initClientWithPool(true, "__TEST_POOL1__", locatorsG, nullptr, nullptr, 0,
+ true);
+ getHelper()->createPooledRegion(regionNames[0], false, locatorsG,
+ "__TEST_POOL1__", true, true);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+ regPtr->registerAllKeys(false, true);
+ }
+ END_TASK_DEFINITION
-DUNIT_TASK_DEFINITION(CLIENT2, verify)
- {
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
- for (int i = 0; i < 5; i++) {
- CacheableKeyPtr keyPtr1 = CacheableKey::create(keys[i]);
- char buf[1024];
- sprintf(buf, "key[%s] should have been found", keys[i]);
- ASSERT(regPtr->containsKey(keyPtr1), buf);
- }
- }
-END_TASK_DEFINITION
+ DUNIT_TASK_DEFINITION(CLIENT2, verify)
+ {
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+ for (int i = 0; i < 5; i++) {
+ auto keyPtr1 = CacheableKey::create(keys[i]);
+ char buf[1024];
+ sprintf(buf, "key[%s] should have been found", keys[i]);
+ ASSERT(regPtr->containsKey(keyPtr1), buf);
+ }
+ }
+ END_TASK_DEFINITION
-DUNIT_TASK_DEFINITION(CLIENT1, updateKeys)
- {
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
- for (int index = 0; index < 5; ++index) {
- CacheableKeyPtr keyPtr = CacheableKey::create(keys[index]);
- regPtr->put(keyPtr, nvals[index]);
- }
- }
-END_TASK_DEFINITION
+ DUNIT_TASK_DEFINITION(CLIENT1, updateKeys)
+ {
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+ for (int index = 0; index < 5; ++index) {
+ auto keyPtr = CacheableKey::create(keys[index]);
+ regPtr->put(keyPtr, nvals[index]);
+ }
+ }
+ END_TASK_DEFINITION
-DUNIT_TASK_DEFINITION(CLIENT2, verifyUpdates)
- {
- SLEEP(2000);
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
- for (int index = 0; index < 5; ++index) {
- CacheableKeyPtr keyPtr = CacheableKey::create(keys[index]);
- char buf[1024];
- sprintf(buf, "key[%s] should have been found", keys[index]);
- ASSERT(regPtr->containsKey(keyPtr), buf);
- auto val = std::dynamic_pointer_cast<CacheableString>(
- regPtr->getEntry(keyPtr)->getValue());
- ASSERT(strcmp(val->asChar(), nvals[index]) == 0,
- "Incorrect value for key");
- }
- }
-END_TASK_DEFINITION
+ DUNIT_TASK_DEFINITION(CLIENT2, verifyUpdates)
+ {
+ SLEEP(2000);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+ for (int index = 0; index < 5; ++index) {
+ auto keyPtr = CacheableKey::create(keys[index]);
+ char buf[1024];
+ sprintf(buf, "key[%s] should have been found", keys[index]);
+ ASSERT(regPtr->containsKey(keyPtr), buf);
+ auto val = std::dynamic_pointer_cast<CacheableString>(
+ regPtr->getEntry(keyPtr)->getValue());
+ ASSERT(strcmp(val->asChar(), nvals[index]) == 0,
+ "Incorrect value for key");
+ }
+ }
+ END_TASK_DEFINITION
-DUNIT_TASK_DEFINITION(CLIENT1, PutUnicodeStrings)
- {
- RegionPtr reg0 = getHelper()->getRegion(regionNames[0]);
- for (int index = 0; index < 5; ++index) {
- CacheableStringPtr key = getUString(index);
- CacheablePtr val = Cacheable::create(index + 100);
- reg0->put(key, val);
- }
- LOG("PutUnicodeStrings complete.");
- }
-END_TASK_DEFINITION
+ DUNIT_TASK_DEFINITION(CLIENT1, PutUnicodeStrings)
+ {
+ auto reg0 = getHelper()->getRegion(regionNames[0]);
+ for (int index = 0; index < 5; ++index) {
+ auto key = getUString(index);
+ auto val = Cacheable::create(index + 100);
+ reg0->put(key, val);
+ }
+ LOG("PutUnicodeStrings complete.");
+ }
+ END_TASK_DEFINITION
-DUNIT_TASK_DEFINITION(CLIENT2, GetUnicodeStrings)
- {
- RegionPtr reg0 = getHelper()->getRegion(regionNames[0]);
- for (int index = 0; index < 5; ++index) {
- CacheableStringPtr key = getUString(index);
- auto val = std::dynamic_pointer_cast<CacheableInt32>(reg0->get(key));
- ASSERT(val != nullptr, "expected non-null value in get");
- ASSERT(val->value() == (index + 100), "unexpected value in get");
- }
- reg0->unregisterAllKeys();
- VectorOfCacheableKey vec;
- for (int index = 0; index < 5; ++index) {
- CacheableStringPtr key = getUString(index);
- vec.push_back(key);
- }
- reg0->registerKeys(vec);
- LOG("GetUnicodeStrings complete.");
- }
-END_TASK_DEFINITION
+ DUNIT_TASK_DEFINITION(CLIENT2, GetUnicodeStrings)
+ {
+ auto reg0 = getHelper()->getRegion(regionNames[0]);
+ for (int index = 0; index < 5; ++index) {
+ auto key = getUString(index);
+ auto val = std::dynamic_pointer_cast<CacheableInt32>(reg0->get(key));
+ ASSERT(val != nullptr, "expected non-null value in get");
+ ASSERT(val->value() == (index + 100), "unexpected value in get");
+ }
+ reg0->unregisterAllKeys();
+ std::vector<std::shared_ptr<CacheableKey>> vec;
+ for (int index = 0; index < 5; ++index) {
+ auto key = getUString(index);
+ vec.push_back(key);
+ }
+ reg0->registerKeys(vec);
+ LOG("GetUnicodeStrings complete.");
+ }
+ END_TASK_DEFINITION
-DUNIT_TASK_DEFINITION(CLIENT1, UpdateUnicodeStrings)
- {
- RegionPtr reg0 = getHelper()->getRegion(regionNames[0]);
- for (int index = 0; index < 5; ++index) {
- CacheableStringPtr key = getUString(index);
- CacheablePtr val = CacheableFloat::create(index + 20.0F);
- reg0->put(key, val);
- }
- LOG("UpdateUnicodeStrings complete.");
- }
-END_TASK_DEFINITION
+ DUNIT_TASK_DEFINITION(CLIENT1, UpdateUnicodeStrings)
+ {
+ auto reg0 = getHelper()->getRegion(regionNames[0]);
+ for (int index = 0; index < 5; ++index) {
+ auto key = getUString(index);
+ auto val = CacheableFloat::create(index + 20.0F);
+ reg0->put(key, val);
+ }
+ LOG("UpdateUnicodeStrings complete.");
+ }
+ END_TASK_DEFINITION
-DUNIT_TASK_DEFINITION(CLIENT2, CheckUpdateUnicodeStrings)
- {
- SLEEP(2000);
- RegionPtr reg0 = getHelper()->getRegion(regionNames[0]);
- for (int index = 0; index < 5; ++index) {
- CacheableStringPtr key = getUString(index);
- auto val = std::dynamic_pointer_cast<CacheableFloat>(
- reg0->getEntry(key)->getValue());
- ASSERT(val != nullptr, "expected non-null value in get");
- ASSERT(val->value() == (index + 20.0F), "unexpected value in get");
- }
- LOG("CheckUpdateUnicodeStrings complete.");
- }
-END_TASK_DEFINITION
+ DUNIT_TASK_DEFINITION(CLIENT2, CheckUpdateUnicodeStrings)
+ {
+ SLEEP(2000);
+ auto reg0 = getHelper()->getRegion(regionNames[0]);
+ for (int index = 0; index < 5; ++index) {
+ auto key = getUString(index);
+ auto val = std::dynamic_pointer_cast<CacheableFloat>(
+ reg0->getEntry(key)->getValue());
+ ASSERT(val != nullptr, "expected non-null value in get");
+ ASSERT(val->value() == (index + 20.0F), "unexpected value in get");
+ }
+ LOG("CheckUpdateUnicodeStrings complete.");
+ }
+ END_TASK_DEFINITION
-DUNIT_TASK_DEFINITION(CLIENT1, PutASCIIAsWideStrings)
- {
- RegionPtr reg0 = getHelper()->getRegion(regionNames[0]);
- for (int index = 0; index < 5; ++index) {
- CacheableStringPtr key = getUAString(index);
- CacheablePtr val = getUString(index + 20);
- reg0->put(key, val);
- }
- LOG("PutASCIIAsWideStrings complete.");
- }
-END_TASK_DEFINITION
+ DUNIT_TASK_DEFINITION(CLIENT1, PutASCIIAsWideStrings)
+ {
+ auto reg0 = getHelper()->getRegion(regionNames[0]);
+ for (int index = 0; index < 5; ++index) {
+ auto key = getUAString(index);
+ auto val = getUString(index + 20);
+ reg0->put(key, val);
+ }
+ LOG("PutASCIIAsWideStrings complete.");
+ }
+ END_TASK_DEFINITION
-DUNIT_TASK_DEFINITION(CLIENT2, GetASCIIAsWideStrings)
- {
- RegionPtr reg0 = getHelper()->getRegion(regionNames[0]);
- for (int index = 0; index < 5; ++index) {
- CacheableStringPtr key = getUAString(index);
- auto val = std::dynamic_pointer_cast<CacheableString>(reg0->get(key));
- CacheableStringPtr expectedVal = getUString(index + 20);
- ASSERT(val != nullptr, "expected non-null value in get");
- ASSERT(wcscmp(val->asWChar(), expectedVal->asWChar()) == 0,
- "unexpected value in get");
- ASSERT(*val.get() == *expectedVal.get(), "unexpected value in get");
- }
- VectorOfCacheableKey vec;
- for (int index = 0; index < 5; ++index) {
- CacheableStringPtr key = getUAString(index);
- vec.push_back(key);
- }
- reg0->registerKeys(vec);
- LOG("GetASCIIAsWideStrings complete.");
- }
-END_TASK_DEFINITION
+ DUNIT_TASK_DEFINITION(CLIENT2, GetASCIIAsWideStrings)
+ {
+ auto reg0 = getHelper()->getRegion(regionNames[0]);
+ for (int index = 0; index < 5; ++index) {
+ auto key = getUAString(index);
+ auto val = std::dynamic_pointer_cast<CacheableString>(reg0->get(key));
+ auto expectedVal = getUString(index + 20);
+ ASSERT(val != nullptr, "expected non-null value in get");
+ ASSERT(wcscmp(val->asWChar(), expectedVal->asWChar()) == 0,
+ "unexpected value in get");
+ ASSERT(*val.get() == *expectedVal.get(), "unexpected value in get");
+ }
+ std::vector<std::shared_ptr<CacheableKey>> vec;
+ for (int index = 0; index < 5; ++index) {
+ auto key = getUAString(index);
+ vec.push_back(key);
+ }
+ reg0->registerKeys(vec);
+ LOG("GetASCIIAsWideStrings complete.");
+ }
+ END_TASK_DEFINITION
-DUNIT_TASK_DEFINITION(CLIENT1, UpdateASCIIAsWideStrings)
- {
- RegionPtr reg0 = getHelper()->getRegion(regionNames[0]);
- for (int index = 0; index < 5; ++index) {
- CacheableStringPtr key = getUAString(index);
- CacheablePtr val = getUAString(index + 10);
- reg0->put(key, val);
- }
- LOG("UpdateASCIIAsWideStrings complete.");
- }
-END_TASK_DEFINITION
+ DUNIT_TASK_DEFINITION(CLIENT1, UpdateASCIIAsWideStrings)
+ {
+ auto reg0 = getHelper()->getRegion(regionNames[0]);
+ for (int index = 0; index < 5; ++index) {
+ auto key = getUAString(index);
+ auto val = getUAString(index + 10);
+ reg0->put(key, val);
+ }
+ LOG("UpdateASCIIAsWideStrings complete.");
+ }
+ END_TASK_DEFINITION
-DUNIT_TASK_DEFINITION(CLIENT2, CheckUpdateASCIIAsWideStrings)
- {
- SLEEP(2000);
- RegionPtr reg0 = getHelper()->getRegion(regionNames[0]);
- for (int index = 0; index < 5; ++index) {
- CacheableStringPtr key = getUAString(index);
- auto val = std::dynamic_pointer_cast<CacheableString>(reg0->get(key));
- CacheableStringPtr expectedVal = getUAString(index + 10);
- ASSERT(val != nullptr, "expected non-null value in get");
- ASSERT(*val.get() == *expectedVal.get(), "unexpected value in get");
- }
- LOG("CheckUpdateASCIIAsWideStrings complete.");
- }
-END_TASK_DEFINITION
+ DUNIT_TASK_DEFINITION(CLIENT2, CheckUpdateASCIIAsWideStrings)
+ {
+ SLEEP(2000);
+ auto reg0 = getHelper()->getRegion(regionNames[0]);
+ for (int index = 0; index < 5; ++index) {
+ auto key = getUAString(index);
+ auto val = std::dynamic_pointer_cast<CacheableString>(reg0->get(key));
+ auto expectedVal = getUAString(index + 10);
+ ASSERT(val != nullptr, "expected non-null value in get");
+ ASSERT(*val.get() == *expectedVal.get(), "unexpected value in get");
+ }
+ LOG("CheckUpdateASCIIAsWideStrings complete.");
+ }
+ END_TASK_DEFINITION
-DUNIT_TASK_DEFINITION(CLIENT1, CheckUpdateBug1001)
- {
- try {
- const wchar_t* str = L"Pivotal";
- CacheableStringPtr lCStringP = CacheableString::create(
- str, static_cast<int32_t>(wcslen(str) + 1) * sizeof(wchar_t));
- const wchar_t* lRtnCd ATTR_UNUSED = lCStringP->asWChar();
- } catch (const Exception& geodeExcp) {
- printf("%s: %s", geodeExcp.getName(), geodeExcp.getMessage());
- FAIL("Should not have got exception.");
- }
+ DUNIT_TASK_DEFINITION(CLIENT1, CheckUpdateBug1001)
+ {
+ try {
+ const wchar_t* str = L"Pivotal";
+ auto lCStringP = CacheableString::create(
+ str, static_cast<int32_t>(wcslen(str) + 1) * sizeof(wchar_t));
+ const wchar_t* lRtnCd ATTR_UNUSED = lCStringP->asWChar();
+ } catch (const Exception& geodeExcp) {
+ printf("%s: %s", geodeExcp.getName(), geodeExcp.getMessage());
+ FAIL("Should not have got exception.");
+ }
- try {
- const wchar_t* str = L"Pivotal?17?";
- CacheableStringPtr lCStringP = CacheableString::create(
- str, static_cast<int32_t>(wcslen(str) + 1) * sizeof(wchar_t));
- const wchar_t* lRtnCd ATTR_UNUSED = lCStringP->asWChar();
- } catch (const Exception& geodeExcp) {
- printf("%s: %s", geodeExcp.getName(), geodeExcp.getMessage());
- FAIL("Should not have got exception.");
- }
+ try {
+ const wchar_t* str = L"Pivotal?17?";
+ auto lCStringP = CacheableString::create(
+ str, static_cast<int32_t>(wcslen(str) + 1) * sizeof(wchar_t));
+ const wchar_t* lRtnCd ATTR_UNUSED = lCStringP->asWChar();
+ } catch (const Exception& geodeExcp) {
+ printf("%s: %s", geodeExcp.getName(), geodeExcp.getMessage());
+ FAIL("Should not have got exception.");
+ }
- LOG("CheckUpdateBug1001 complete.");
- }
-END_TASK_DEFINITION
+ LOG("CheckUpdateBug1001 complete.");
+ }
+ END_TASK_DEFINITION
-DUNIT_TASK_DEFINITION(CLIENT1, StopClient1)
- {
- cleanProc();
- LOG("CLIENT1 stopped");
- }
-END_TASK_DEFINITION
+ DUNIT_TASK_DEFINITION(CLIENT1, StopClient1)
+ {
+ cleanProc();
+ LOG("CLIENT1 stopped");
+ }
+ END_TASK_DEFINITION
-DUNIT_TASK_DEFINITION(CLIENT2, StopClient2)
- {
- cleanProc();
- LOG("CLIENT2 stopped");
- }
-END_TASK_DEFINITION
+ DUNIT_TASK_DEFINITION(CLIENT2, StopClient2)
+ {
+ cleanProc();
+ LOG("CLIENT2 stopped");
+ }
+ END_TASK_DEFINITION
-DUNIT_TASK_DEFINITION(SERVER1, StopServer)
- {
- if (isLocalServer) CacheHelper::closeServer(1);
- LOG("SERVER stopped");
- }
-END_TASK_DEFINITION
+ DUNIT_TASK_DEFINITION(SERVER1, StopServer)
+ {
+ if (isLocalServer) CacheHelper::closeServer(1);
+ LOG("SERVER stopped");
+ }
+ END_TASK_DEFINITION
-DUNIT_MAIN
- {
- CALL_TASK(CreateLocator1)
- CALL_TASK(CreateServer1_With_Locator);
- CALL_TASK(SetupClient1);
- CALL_TASK(populateServer);
- CALL_TASK(setupClient2);
- CALL_TASK(verify);
- CALL_TASK(updateKeys);
- CALL_TASK(verifyUpdates);
- CALL_TASK(PutUnicodeStrings);
- CALL_TASK(GetUnicodeStrings);
- CALL_TASK(UpdateUnicodeStrings);
- CALL_TASK(CheckUpdateUnicodeStrings);
- CALL_TASK(PutASCIIAsWideStrings);
- CALL_TASK(GetASCIIAsWideStrings);
- CALL_TASK(UpdateASCIIAsWideStrings);
- CALL_TASK(CheckUpdateASCIIAsWideStrings);
- CALL_TASK(CheckUpdateBug1001);
- CALL_TASK(StopClient1);
- CALL_TASK(StopClient2);
- CALL_TASK(StopServer);
- CALL_TASK(CloseLocator1);
- }
-END_MAIN
+ DUNIT_MAIN
+ {
+ CALL_TASK(CreateLocator1)
+ CALL_TASK(CreateServer1_With_Locator);
+ CALL_TASK(SetupClient1);
+ CALL_TASK(populateServer);
+ CALL_TASK(setupClient2);
+ CALL_TASK(verify);
+ CALL_TASK(updateKeys);
+ CALL_TASK(verifyUpdates);
+ CALL_TASK(PutUnicodeStrings);
+ CALL_TASK(GetUnicodeStrings);
+ CALL_TASK(UpdateUnicodeStrings);
+ CALL_TASK(CheckUpdateUnicodeStrings);
+ CALL_TASK(PutASCIIAsWideStrings);
+ CALL_TASK(GetASCIIAsWideStrings);
+ CALL_TASK(UpdateASCIIAsWideStrings);
+ CALL_TASK(CheckUpdateASCIIAsWideStrings);
+ CALL_TASK(CheckUpdateBug1001);
+ CALL_TASK(StopClient1);
+ CALL_TASK(StopClient2);
+ CALL_TASK(StopServer);
+ CALL_TASK(CloseLocator1);
+ }
+ END_MAIN
diff --git a/cppcache/integration-test/testThinClientInterestNotify.cpp b/cppcache/integration-test/testThinClientInterestNotify.cpp
index dc660fd..a191bee 100644
--- a/cppcache/integration-test/testThinClientInterestNotify.cpp
+++ b/cppcache/integration-test/testThinClientInterestNotify.cpp
@@ -124,11 +124,10 @@ class EventListener : public CacheListener {
ASSERT(m_destroys == destroys, logmsg);
}
};
-typedef std::shared_ptr<EventListener> EventListenerPtr;
-void setCacheListener(const char* regName, EventListenerPtr monitor) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
+void setCacheListener(const char* regName, std::shared_ptr<EventListener> monitor) {
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheListener(monitor);
}
@@ -136,18 +135,9 @@ void setCacheListener(const char* regName, EventListenerPtr monitor) {
// RegisterInterest API calls,
// RegionOther means no interest registered so no events should arrive except
// invalidates when NBS == false.
-
-EventListenerPtr clientTrueRegionTrue = nullptr;
-EventListenerPtr clientTrueRegionFalse = nullptr;
-EventListenerPtr clientTrueRegionOther = nullptr;
-/*
-EventListenerPtr clientFalseRegionTrue = nullptr;
-EventListenerPtr clientFalseRegionFalse = nullptr;
-EventListenerPtr clientFalseRegionOther = nullptr;
-EventListenerPtr clientDefaultRegionTrue = nullptr;
-EventListenerPtr clientDefaultRegionFalse = nullptr;
-EventListenerPtr clientDefaultRegionOther = nullptr;
-*/
+std::shared_ptr<EventListener> clientTrueRegionTrue = nullptr;
+std::shared_ptr<EventListener> clientTrueRegionFalse = nullptr;
+std::shared_ptr<EventListener> clientTrueRegionOther = nullptr;
const char* regions[] = {"RegionTrue", "RegionFalse", "RegionOther"};
const char* keysForRegex[] = {"key-regex-1", "key-regex-2", "key-regex-3"};
@@ -156,11 +146,11 @@ const char* keysForRegex[] = {"key-regex-1", "key-regex-2", "key-regex-3"};
#include "ThinClientTasks_C2S2.hpp"
#include "LocatorHelper.hpp"
-void initClientForInterestNotify(EventListenerPtr& mon1, EventListenerPtr& mon2,
- EventListenerPtr& mon3, const char* nbs,
- const char* clientName) {
- PropertiesPtr props = Properties::create();
- // props->insert( "notify-by-subscription-override", nbs );
+void initClientForInterestNotify(std::shared_ptr<EventListener>& mon1,
+ std::shared_ptr<EventListener>& mon2,
+ std::shared_ptr<EventListener>& mon3,
+ const char* nbs, const char* clientName) {
+ auto props = Properties::create();
initClient(true, props);
@@ -225,9 +215,9 @@ void feederDestroys() {
}
void registerInterests(const char* region, bool durable, bool receiveValues) {
- RegionPtr regionPtr = getHelper()->getRegion(region);
+ auto regionPtr = getHelper()->getRegion(region);
- VectorOfCacheableKey keysVector;
+ std::vector<std::shared_ptr<CacheableKey>> keysVector;
keysVector.push_back(CacheableKey::create(keys[0]));
keysVector.push_back(CacheableKey::create(keys[1]));
@@ -239,9 +229,9 @@ void registerInterests(const char* region, bool durable, bool receiveValues) {
}
void unregisterInterests(const char* region) {
- RegionPtr regionPtr = getHelper()->getRegion(region);
+ auto regionPtr = getHelper()->getRegion(region);
- VectorOfCacheableKey keysVector;
+ std::vector<std::shared_ptr<CacheableKey>> keysVector;
keysVector.push_back(CacheableKey::create(keys[0]));
keysVector.push_back(CacheableKey::create(keys[1]));
diff --git a/cppcache/integration-test/testThinClientLRUExpiration.cpp b/cppcache/integration-test/testThinClientLRUExpiration.cpp
index 4c33f24..c8569c8 100644
--- a/cppcache/integration-test/testThinClientLRUExpiration.cpp
+++ b/cppcache/integration-test/testThinClientLRUExpiration.cpp
@@ -22,7 +22,6 @@
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
-#include <geode/GeodeCppCache.hpp>
#include <geode/util/chrono/duration.hpp>
#define ROOT_NAME "testThinClientLRUExpiration"
@@ -52,9 +51,8 @@ const char* regionNames[] = {"DistRegionAck1", "DistRegionAck2",
"DistRegionAck5", "DistRegionAck"};
const bool USE_ACK = true;
const bool NO_ACK ATTR_UNUSED = false;
-
-TallyListenerPtr regListener;
-TallyWriterPtr regWriter;
+std::shared_ptr<TallyListener> regListener;
+std::shared_ptr<TallyWriter> regWriter;
bool registerKey = true;
void initClient(const bool isthinClient) {
if (cacheHelper == nullptr) {
@@ -73,7 +71,7 @@ CacheHelper* getHelper() {
ASSERT(cacheHelper != nullptr, "No cacheHelper initialized.");
return cacheHelper;
}
-void printAttribute(RegionAttributesPtr& attr) {
+void printAttribute(std::shared_ptr<RegionAttributes>& attr) {
printf("CachingEnable: %s\n",
attr->getCachingEnabled() ? "enabled" : "disabled");
printf("InitialCapacity: %d\n", attr->getInitialCapacity());
@@ -98,32 +96,32 @@ void printAttribute(RegionAttributesPtr& attr) {
// printf("getEndPoint: %s\n",attr->getEndpoints());
}
-void setCacheListener(const char* regName, TallyListenerPtr regListener) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
+void setCacheListener(const char* regName, std::shared_ptr<TallyListener> regListener) {
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheListener(regListener);
}
-void setCacheWriter(const char* regName, TallyWriterPtr regWriter) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
+void setCacheWriter(const char* regName, std::shared_ptr<TallyWriter> regWriter) {
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheWriter(regWriter);
}
void getRegionAttr(const char* name) {
- RegionPtr rptr = getHelper()->getRegion(name);
- RegionAttributesPtr m_currRegionAttributesPtr = rptr->getAttributes();
- printAttribute(m_currRegionAttributesPtr);
+ auto rptr = getHelper()->getRegion(name);
+ auto m_currRegionAttributesPtr = rptr->getAttributes();
+ printAttribute(m_currRegionAttributesPtr);
}
void ValidateDestroyRegion(const char* name) {
- RegionPtr rptr = getHelper()->getRegion(name);
- if (rptr == nullptr) {
- return;
- }
- try {
- rptr->put(1, 2);
- FAIL("Put should not be happened");
+ auto rptr = getHelper()->getRegion(name);
+ if (rptr == nullptr) {
+ return;
+ }
+ try {
+ rptr->put(1, 2);
+ FAIL("Put should not be happened");
} catch (RegionDestroyedException& ex) {
char buffer[1024];
sprintf(buffer, "Got expected exception %s: msg = %s", ex.getName(),
@@ -146,9 +144,10 @@ void createRegion(const char* name, bool ackMode,
ExpirationAction::Action action = ExpirationAction::DESTROY) {
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr = // getHelper()->createRegion( name, ackMode, true,
- // ettl,eit,rttl,rit,lel,action,endpoints,clientNotificationEnabled
- // );
+ auto
+ regPtr = // getHelper()->createRegion( name, ackMode, true,
+ // ettl,eit,rttl,rit,lel,action,endpoints,clientNotificationEnabled
+ // );
getHelper()->createRegionAndAttachPool(name, ackMode, "LRUPool", true,
ettl, eit, rttl, rit, lel, action);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -157,7 +156,7 @@ void createRegion(const char* name, bool ackMode,
}
void doRgnOperations(const char* name, int n, int rgnOpt = 0) {
- CacheableStringPtr value;
+ std::shared_ptr<CacheableString> value;
char buf[16];
if (rgnOpt == 0) {
memset(buf, 'A', 15);
@@ -166,42 +165,42 @@ void doRgnOperations(const char* name, int n, int rgnOpt = 0) {
value = CacheableString::create(buf);
ASSERT(value != nullptr, "Failed to create value.");
}
- RegionPtr rptr = getHelper()->getRegion(name);
- ASSERT(rptr != nullptr, "Region not found.");
- for (int i = 0; i < n; i++) {
- sprintf(buf, "KeyA - %d", i + 1);
- CacheableKeyPtr key = CacheableKey::create(buf);
- switch (rgnOpt) {
- case 0:
- rptr->put(key, value);
- break;
- case 1:
- rptr->invalidate(key);
- break;
- case 2:
- rptr->localInvalidate(key);
- break;
- case 3:
- rptr->destroy(key);
- break;
- case 4:
- rptr->localDestroy(key);
- break;
- case 5:
- rptr->get(key);
- break;
- }
+ auto rptr = getHelper()->getRegion(name);
+ ASSERT(rptr != nullptr, "Region not found.");
+ for (int i = 0; i < n; i++) {
+ sprintf(buf, "KeyA - %d", i + 1);
+ auto key = CacheableKey::create(buf);
+ switch (rgnOpt) {
+ case 0:
+ rptr->put(key, value);
+ break;
+ case 1:
+ rptr->invalidate(key);
+ break;
+ case 2:
+ rptr->localInvalidate(key);
+ break;
+ case 3:
+ rptr->destroy(key);
+ break;
+ case 4:
+ rptr->localDestroy(key);
+ break;
+ case 5:
+ rptr->get(key);
+ break;
+ }
}
}
void dumpCounters(const char* regName) {
- RegionPtr rptr = getHelper()->getRegion(regName);
- printf("Region size: %d\n", rptr->size());
- if (regListener != nullptr) {
- printf("counts:: creates: %d, updates: %d, invalidates: %d, destroys: %d\n",
- regListener->getCreates(), regListener->getUpdates(),
- regListener->getInvalidates(), regListener->getDestroys());
- }
+ auto rptr = getHelper()->getRegion(regName);
+ printf("Region size: %d\n", rptr->size());
+ if (regListener != nullptr) {
+ printf("counts:: creates: %d, updates: %d, invalidates: %d, destroys: %d\n",
+ regListener->getCreates(), regListener->getUpdates(),
+ regListener->getInvalidates(), regListener->getDestroys());
+ }
}
size_t getNumOfEntries(const char* regName, bool isValue = false) {
@@ -209,15 +208,15 @@ size_t getNumOfEntries(const char* regName, bool isValue = false) {
useRegionSize = !useRegionSize;
dumpCounters(regName);
- RegionPtr rptr = getHelper()->getRegion(regName);
- if (isValue) {
- auto v = rptr->values();
- printf("Region value size: %zd\n", v.size());
- return v.size();
- } else if (!useRegionSize) {
- auto v = rptr->keys();
- printf("Region key size: %zd\n", v.size());
- return v.size();
+ auto rptr = getHelper()->getRegion(regName);
+ if (isValue) {
+ auto v = rptr->values();
+ printf("Region value size: %zd\n", v.size());
+ return v.size();
+ } else if (!useRegionSize) {
+ auto v = rptr->keys();
+ printf("Region key size: %zd\n", v.size());
+ return v.size();
} else {
return rptr->size();
}
@@ -225,10 +224,10 @@ size_t getNumOfEntries(const char* regName, bool isValue = false) {
void localDestroyRegion(const char* name) {
LOG("localDestroyRegion() entered.");
- RegionPtr regPtr = getHelper()->getRegion(name);
- regPtr->localDestroyRegion();
- ASSERT(regPtr->isDestroyed() == true, "Expected Region to be destroyed");
- LOG("Locally Region destroyed.");
+ auto regPtr = getHelper()->getRegion(name);
+ regPtr->localDestroyRegion();
+ ASSERT(regPtr->isDestroyed() == true, "Expected Region to be destroyed");
+ LOG("Locally Region destroyed.");
}
void createThinClientRegion(
@@ -1204,8 +1203,8 @@ DUNIT_TASK(CLIENT2, StepTwoCase13)
regWriter = std::make_shared<TallyWriter>();
setCacheListener(regionNames[5], regListener);
setCacheWriter(regionNames[5], regWriter);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[5]);
- regPtr0->registerAllKeys();
+ auto regPtr0 = getHelper()->getRegion(regionNames[5]);
+ regPtr0->registerAllKeys();
}
END_TASK(StepTwoCase13)
diff --git a/cppcache/integration-test/testThinClientListenerCallbackArgTest.cpp b/cppcache/integration-test/testThinClientListenerCallbackArgTest.cpp
index 0c722ed..7b8bf17 100644
--- a/cppcache/integration-test/testThinClientListenerCallbackArgTest.cpp
+++ b/cppcache/integration-test/testThinClientListenerCallbackArgTest.cpp
@@ -48,8 +48,6 @@ const char* locatorsG =
using namespace apache::geode::client;
class CallbackListener;
-typedef std::shared_ptr<CallbackListener> CallbackListenerPtr;
-
class CallbackListener : public CacheListener {
private:
int m_creates;
@@ -59,8 +57,8 @@ class CallbackListener : public CacheListener {
int m_regionInvalidate;
int m_regionDestroy;
int m_regionClear;
- // CacheableStringPtr m_callbackArg;
- CacheablePtr m_callbackArg;
+ // std::shared_ptr<CacheableString> m_callbackArg;
+ std::shared_ptr<Cacheable> m_callbackArg;
public:
CallbackListener()
@@ -86,28 +84,28 @@ class CallbackListener : public CacheListener {
int getRegionInvalidates() { return m_regionInvalidate; }
int getRegionDestroys() { return m_regionDestroy; }
int getRegionClear() { return m_regionClear; }
- void setCallBackArg(const CacheablePtr& callbackArg) {
+ void setCallBackArg(const std::shared_ptr<Cacheable>& callbackArg) {
m_callbackArg = callbackArg;
}
- void check(CacheablePtr eventCallback, int& updateEvent) {
+ void check(std::shared_ptr<Cacheable> eventCallback, int& updateEvent) {
if (m_callbackArg != nullptr) {
try {
auto mCallbkArg = std::dynamic_pointer_cast<Portfolio>(m_callbackArg);
auto callbkArg = std::dynamic_pointer_cast<Portfolio>(eventCallback);
- CacheableStringPtr fromCallback = callbkArg->getPkid();
- CacheableStringPtr mCallback = mCallbkArg->getPkid();
+ auto fromCallback = callbkArg->getPkid();
+ auto mCallback = mCallbkArg->getPkid();
- LOGFINE(" values are %s === %s ", fromCallback->asChar(),
- mCallback->asChar());
+ LOGFINE(" values are %s === %s ", fromCallback->asChar(),
+ mCallback->asChar());
- if (*(fromCallback.get()) == *(mCallback.get())) {
- LOGFINE("values are same");
- updateEvent++;
- } else {
- LOGFINE("values are NOT same");
+ if (*(fromCallback.get()) == *(mCallback.get())) {
+ LOGFINE("values are same");
+ updateEvent++;
+ } else {
+ LOGFINE("values are NOT same");
}
} catch (const ClassCastException& ex) {
LOGFINE(" in class cast exception %s ", ex.getMessage());
@@ -169,189 +167,190 @@ class CallbackListener : public CacheListener {
}
};
//---------------------------------------------------------------------------------
-
-CallbackListenerPtr reg1Listener1 = nullptr;
-CacheableStringPtr callBackStrPtr;
-
-CacheablePtr callBackPortFolioPtr;
-
-void setCacheListener(const char* regName, CallbackListenerPtr regListener) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
- attrMutator->setCacheListener(regListener);
-}
-
-void validateEventCount(int line) {
- LOGINFO("ValidateEvents called from line (%d).", line);
- int num = reg1Listener1->getCreates();
- char buf[1024];
- sprintf(buf, "Didn't get expected callback arg in aftercreate event");
- ASSERT(7 == num, buf);
- num = reg1Listener1->getUpdates();
- sprintf(buf, "Didn't get expected callback arg in afterupdate events");
- ASSERT(3 == num, buf);
- num = reg1Listener1->getInvalidates();
- sprintf(buf, "Didn't get expected callback arg in afterInvalidates events");
- ASSERT(2 == num, buf);
- num = reg1Listener1->getDestroys();
- sprintf(buf, "Didn't get expected callback arg in afterdestroy events");
- ASSERT(5 == num, buf);
- num = reg1Listener1->getRegionInvalidates();
- sprintf(buf,
- "Didn't get expected callback arg in afterRegionInvalidates events");
- ASSERT(1 == num, buf);
- num = reg1Listener1->getRegionDestroys();
- sprintf(buf, "Didn't get expected callback arg in afterRegiondestroy events");
- ASSERT(1 == num, buf);
- num = reg1Listener1->getRegionClear();
- sprintf(buf, "Didn't get expected callback arg in afterRegionClear events");
- ASSERT(1 == num, buf);
-}
-
-DUNIT_TASK_DEFINITION(SERVER1, StartServer)
- {
- if (isLocalServer) {
- CacheHelper::initServer(1, "cacheserver_notify_subscription5.xml");
- }
- LOG("SERVER started");
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(CLIENT1, SetupClient1_Pool_Locator)
- {
- initClient(true);
-
- callBackStrPtr = CacheableString::create("Gemstone's Callback");
-
- createPooledRegion(regionNames[0], false /*ack mode*/, locatorsG,
- "__TEST_POOL1__", true /*client notification*/);
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
- serializationRegistry->addType(Portfolio::createDeserializable);
- serializationRegistry->addType(Position::createDeserializable);
- reg1Listener1 = std::make_shared<CallbackListener>();
- callBackPortFolioPtr = std::make_shared<Portfolio>(1, 0, nullptr);
-
- reg1Listener1->setCallBackArg(callBackPortFolioPtr);
- setCacheListener(regionNames[0], reg1Listener1);
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
- regPtr->registerAllKeys();
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(CLIENT2, SetupClient2_Pool_Locator)
- {
- initClient(true);
-
- callBackStrPtr = CacheableString::create("Gemstone's Callback");
-
- createPooledRegion(regionNames[0], false /*ack mode*/, locatorsG,
- "__TEST_POOL1__", true /*client notification*/);
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(CLIENT2, testCreatesAndUpdates)
- {
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
-
- callBackPortFolioPtr = std::make_shared<Portfolio>(1, 0, nullptr);
- regPtr->create("aaa", "bbb", callBackPortFolioPtr);
- regPtr->create(keys[1], vals[1], callBackPortFolioPtr);
- regPtr->put(keys[1], nvals[1], callBackPortFolioPtr);
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(CLIENT1, testInvalidates)
- {
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
-
- callBackPortFolioPtr = std::make_shared<Portfolio>(1, 0, nullptr);
- regPtr->localCreate(1234, 1234, callBackPortFolioPtr);
- regPtr->localCreate(12345, 12345, callBackPortFolioPtr);
- regPtr->localCreate(12346, 12346, callBackPortFolioPtr);
- regPtr->localPut(1234, vals[1], callBackPortFolioPtr);
- regPtr->localInvalidate(1234, callBackPortFolioPtr);
- ASSERT(regPtr->localRemove(12345, 12345, callBackPortFolioPtr) == true,
- "Result of remove should be true, as this value exists locally.");
- ASSERT(regPtr->containsKey(12345) == false, "containsKey should be false");
- ASSERT(regPtr->localRemoveEx(12346, callBackPortFolioPtr) == true,
- "Result of remove should be true, as this value exists locally.");
- ASSERT(regPtr->containsKey(12346) == false, "containsKey should be false");
- regPtr->invalidate(keys[1], callBackPortFolioPtr);
- regPtr->invalidateRegion(callBackPortFolioPtr);
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(CLIENT2, testDestroy)
- {
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
-
- callBackPortFolioPtr = std::make_shared<Portfolio>(1, 0, nullptr);
- regPtr->destroy(keys[1], callBackPortFolioPtr);
- ASSERT(regPtr->removeEx("aaa", callBackPortFolioPtr) == true,
- "Result of remove should be true, as this value exists.");
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(CLIENT2, testRemove)
- {
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
- regPtr->remove(keys[1], nvals[1], callBackPortFolioPtr);
- regPtr->destroyRegion(callBackPortFolioPtr);
- }
-END_TASK_DEFINITION
-DUNIT_TASK_DEFINITION(CLIENT1, testlocalClear)
- {
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
- regPtr->localClear(callBackPortFolioPtr);
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(CLIENT1, testValidate)
- {
- dunit::sleep(10000);
- validateEventCount(__LINE__);
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(CLIENT1, StopClient1)
- {
- cleanProc();
- LOG("CLIENT1 stopped");
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(CLIENT2, StopClient2)
- {
- cleanProc();
- LOG("CLIENT2 stopped");
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(SERVER1, StopServer)
- {
- if (isLocalServer) CacheHelper::closeServer(1);
- LOG("SERVER stopped");
- }
-END_TASK_DEFINITION
-
-DUNIT_MAIN
- {
- CALL_TASK(CreateLocator1);
- CALL_TASK(CreateServer1_With_Locator_XML5)
-
- CALL_TASK(SetupClient1_Pool_Locator);
- CALL_TASK(SetupClient2_Pool_Locator);
- CALL_TASK(testCreatesAndUpdates);
- CALL_TASK(testInvalidates);
- CALL_TASK(testDestroy);
- CALL_TASK(testCreatesAndUpdates);
- CALL_TASK(testlocalClear);
- CALL_TASK(testRemove);
- CALL_TASK(testValidate);
- CALL_TASK(StopClient1);
- CALL_TASK(StopClient2);
- CALL_TASK(StopServer);
- CALL_TASK(CloseLocator1);
- }
-END_MAIN
-
+ std::shared_ptr<CallbackListener> reg1Listener1 = nullptr;
+ std::shared_ptr<CacheableString> callBackStrPtr;
+ std::shared_ptr<Cacheable> callBackPortFolioPtr;
+
+ void setCacheListener(const char* regName,
+ std::shared_ptr<CallbackListener> regListener) {
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
+ attrMutator->setCacheListener(regListener);
+ }
+
+ void validateEventCount(int line) {
+ LOGINFO("ValidateEvents called from line (%d).", line);
+ int num = reg1Listener1->getCreates();
+ char buf[1024];
+ sprintf(buf, "Didn't get expected callback arg in aftercreate event");
+ ASSERT(7 == num, buf);
+ num = reg1Listener1->getUpdates();
+ sprintf(buf, "Didn't get expected callback arg in afterupdate events");
+ ASSERT(3 == num, buf);
+ num = reg1Listener1->getInvalidates();
+ sprintf(buf, "Didn't get expected callback arg in afterInvalidates events");
+ ASSERT(2 == num, buf);
+ num = reg1Listener1->getDestroys();
+ sprintf(buf, "Didn't get expected callback arg in afterdestroy events");
+ ASSERT(5 == num, buf);
+ num = reg1Listener1->getRegionInvalidates();
+ sprintf(buf,
+ "Didn't get expected callback arg in afterRegionInvalidates events");
+ ASSERT(1 == num, buf);
+ num = reg1Listener1->getRegionDestroys();
+ sprintf(buf,
+ "Didn't get expected callback arg in afterRegiondestroy events");
+ ASSERT(1 == num, buf);
+ num = reg1Listener1->getRegionClear();
+ sprintf(buf, "Didn't get expected callback arg in afterRegionClear events");
+ ASSERT(1 == num, buf);
+ }
+
+ DUNIT_TASK_DEFINITION(SERVER1, StartServer)
+ {
+ if (isLocalServer) {
+ CacheHelper::initServer(1, "cacheserver_notify_subscription5.xml");
+ }
+ LOG("SERVER started");
+ }
+ END_TASK_DEFINITION
+
+ DUNIT_TASK_DEFINITION(CLIENT1, SetupClient1_Pool_Locator)
+ {
+ initClient(true);
+
+ callBackStrPtr = CacheableString::create("Gemstone's Callback");
+
+ createPooledRegion(regionNames[0], false /*ack mode*/, locatorsG,
+ "__TEST_POOL1__", true /*client notification*/);
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
+ serializationRegistry->addType(Portfolio::createDeserializable);
+ serializationRegistry->addType(Position::createDeserializable);
+ reg1Listener1 = std::make_shared<CallbackListener>();
+ callBackPortFolioPtr = std::make_shared<Portfolio>(1, 0, nullptr);
+
+ reg1Listener1->setCallBackArg(callBackPortFolioPtr);
+ setCacheListener(regionNames[0], reg1Listener1);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+ regPtr->registerAllKeys();
+ }
+ END_TASK_DEFINITION
+
+ DUNIT_TASK_DEFINITION(CLIENT2, SetupClient2_Pool_Locator)
+ {
+ initClient(true);
+
+ callBackStrPtr = CacheableString::create("Gemstone's Callback");
+
+ createPooledRegion(regionNames[0], false /*ack mode*/, locatorsG,
+ "__TEST_POOL1__", true /*client notification*/);
+ }
+ END_TASK_DEFINITION
+
+ DUNIT_TASK_DEFINITION(CLIENT2, testCreatesAndUpdates)
+ {
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+
+ callBackPortFolioPtr = std::make_shared<Portfolio>(1, 0, nullptr);
+ regPtr->create("aaa", "bbb", callBackPortFolioPtr);
+ regPtr->create(keys[1], vals[1], callBackPortFolioPtr);
+ regPtr->put(keys[1], nvals[1], callBackPortFolioPtr);
+ }
+ END_TASK_DEFINITION
+
+ DUNIT_TASK_DEFINITION(CLIENT1, testInvalidates)
+ {
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+
+ callBackPortFolioPtr = std::make_shared<Portfolio>(1, 0, nullptr);
+ regPtr->localCreate(1234, 1234, callBackPortFolioPtr);
+ regPtr->localCreate(12345, 12345, callBackPortFolioPtr);
+ regPtr->localCreate(12346, 12346, callBackPortFolioPtr);
+ regPtr->localPut(1234, vals[1], callBackPortFolioPtr);
+ regPtr->localInvalidate(1234, callBackPortFolioPtr);
+ ASSERT(regPtr->localRemove(12345, 12345, callBackPortFolioPtr) == true,
+ "Result of remove should be true, as this value exists locally.");
+ ASSERT(regPtr->containsKey(12345) == false, "containsKey should be false");
+ ASSERT(regPtr->localRemoveEx(12346, callBackPortFolioPtr) == true,
+ "Result of remove should be true, as this value exists locally.");
+ ASSERT(regPtr->containsKey(12346) == false, "containsKey should be false");
+ regPtr->invalidate(keys[1], callBackPortFolioPtr);
+ regPtr->invalidateRegion(callBackPortFolioPtr);
+ }
+ END_TASK_DEFINITION
+
+ DUNIT_TASK_DEFINITION(CLIENT2, testDestroy)
+ {
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+
+ callBackPortFolioPtr = std::make_shared<Portfolio>(1, 0, nullptr);
+ regPtr->destroy(keys[1], callBackPortFolioPtr);
+ ASSERT(regPtr->removeEx("aaa", callBackPortFolioPtr) == true,
+ "Result of remove should be true, as this value exists.");
+ }
+ END_TASK_DEFINITION
+
+ DUNIT_TASK_DEFINITION(CLIENT2, testRemove)
+ {
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+ regPtr->remove(keys[1], nvals[1], callBackPortFolioPtr);
+ regPtr->destroyRegion(callBackPortFolioPtr);
+ }
+ END_TASK_DEFINITION
+ DUNIT_TASK_DEFINITION(CLIENT1, testlocalClear)
+ {
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+ regPtr->localClear(callBackPortFolioPtr);
+ }
+ END_TASK_DEFINITION
+
+ DUNIT_TASK_DEFINITION(CLIENT1, testValidate)
+ {
+ dunit::sleep(10000);
+ validateEventCount(__LINE__);
+ }
+ END_TASK_DEFINITION
+
+ DUNIT_TASK_DEFINITION(CLIENT1, StopClient1)
+ {
+ cleanProc();
+ LOG("CLIENT1 stopped");
+ }
+ END_TASK_DEFINITION
+
+ DUNIT_TASK_DEFINITION(CLIENT2, StopClient2)
+ {
+ cleanProc();
+ LOG("CLIENT2 stopped");
+ }
+ END_TASK_DEFINITION
+
+ DUNIT_TASK_DEFINITION(SERVER1, StopServer)
+ {
+ if (isLocalServer) CacheHelper::closeServer(1);
+ LOG("SERVER stopped");
+ }
+ END_TASK_DEFINITION
+
+ DUNIT_MAIN
+ {
+ CALL_TASK(CreateLocator1);
+ CALL_TASK(CreateServer1_With_Locator_XML5)
+
+ CALL_TASK(SetupClient1_Pool_Locator);
+ CALL_TASK(SetupClient2_Pool_Locator);
+ CALL_TASK(testCreatesAndUpdates);
+ CALL_TASK(testInvalidates);
+ CALL_TASK(testDestroy);
+ CALL_TASK(testCreatesAndUpdates);
+ CALL_TASK(testlocalClear);
+ CALL_TASK(testRemove);
+ CALL_TASK(testValidate);
+ CALL_TASK(StopClient1);
+ CALL_TASK(StopClient2);
+ CALL_TASK(StopServer);
+ CALL_TASK(CloseLocator1);
+ }
+ END_MAIN
diff --git a/cppcache/integration-test/testThinClientListenerEvents.cpp b/cppcache/integration-test/testThinClientListenerEvents.cpp
index 136a830..1e01204 100644
--- a/cppcache/integration-test/testThinClientListenerEvents.cpp
+++ b/cppcache/integration-test/testThinClientListenerEvents.cpp
@@ -30,8 +30,6 @@ using namespace test;
using namespace apache::geode::client;
class SimpleCacheListener;
-typedef std::shared_ptr<SimpleCacheListener> SimpleCacheListenerPtr;
-
// Use the "geode" namespace.
using namespace apache::geode::client;
@@ -59,7 +57,7 @@ class SimpleCacheListener : public CacheListener {
virtual void afterRegionDestroy(const RegionEvent& event) {
LOGINFO("SimpleCacheListener: Got an afterRegionDestroy event.");
}
- virtual void close(const RegionPtr& region) {
+ virtual void close(const std::shared_ptr<Region>& region) {
LOGINFO("SimpleCacheListener: Got an close event.");
}
@@ -88,33 +86,33 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, doRemoteGet)
{
- RegionPtr regionPtr = getHelper()->getRegion(regionNames[0]);
-
- AttributesMutatorPtr attrMutatorPtr = regionPtr->getAttributesMutator();
- auto regListener1 = std::make_shared<SimpleCacheListener>();
- attrMutatorPtr->setCacheListener(regListener1);
-
- // Put 3 Entries into the Region.
- regionPtr->put("Key1", "Value1");
- regionPtr->put("Key2", "Value2");
- regionPtr->put("Key3", "Value3");
-
- // Update Key3.
- regionPtr->put("Key3", "Value3-updated");
-
- // Destroy Key3.
- regionPtr->localDestroy("Key3");
-
- // Perform remote get (Locally destroyed).
- regionPtr->get("Key3");
- int toalFunCall = regListener1->getCount();
- ASSERT(4 == toalFunCall,
- "afterCreate() did not call expected number of times");
- // printf("[NIL_DEBUG_DUnitTest:149] Total Function Call =
- // %d.............\n",
- // toalFunCall);
- // printf("\n[NIL_DEBUG_DUnitTest:150:Remote get ended.
- // ..................\n");
+ auto regionPtr = getHelper()->getRegion(regionNames[0]);
+
+ auto attrMutatorPtr = regionPtr->getAttributesMutator();
+ auto regListener1 = std::make_shared<SimpleCacheListener>();
+ attrMutatorPtr->setCacheListener(regListener1);
+
+ // Put 3 Entries into the Region.
+ regionPtr->put("Key1", "Value1");
+ regionPtr->put("Key2", "Value2");
+ regionPtr->put("Key3", "Value3");
+
+ // Update Key3.
+ regionPtr->put("Key3", "Value3-updated");
+
+ // Destroy Key3.
+ regionPtr->localDestroy("Key3");
+
+ // Perform remote get (Locally destroyed).
+ regionPtr->get("Key3");
+ int toalFunCall = regListener1->getCount();
+ ASSERT(4 == toalFunCall,
+ "afterCreate() did not call expected number of times");
+ // printf("[NIL_DEBUG_DUnitTest:149] Total Function Call =
+ // %d.............\n",
+ // toalFunCall);
+ // printf("\n[NIL_DEBUG_DUnitTest:150:Remote get ended.
+ // ..................\n");
}
END_TASK_DEFINITION
diff --git a/cppcache/integration-test/testThinClientMultiDS.cpp b/cppcache/integration-test/testThinClientMultiDS.cpp
index 06ff8da..e6ee08d 100644
--- a/cppcache/integration-test/testThinClientMultiDS.cpp
+++ b/cppcache/integration-test/testThinClientMultiDS.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
@@ -35,7 +34,7 @@
static int clientWithNothing = 0;
void initClient() {
if (cacheHelper == nullptr) {
- PropertiesPtr config = Properties::create();
+ auto config = Properties::create();
if (clientWithNothing > 1) config->insert("grid-client", "true");
clientWithNothing += 1;
cacheHelper = new CacheHelper(true, config);
@@ -118,8 +117,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepOne_Pool_EndPoint)
"__TESTPOOL1_", false);
getHelper()->createRegionAndAttachPool(regionNames[1], NO_ACK,
"__TESTPOOL2_", false);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
for (int i = 0; i < 100; i++) {
regPtr0->put(keys[0], vals[0]);
regPtr1->put(keys[2], vals[2]);
@@ -151,8 +150,8 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepTwo_Pool_EndPoint)
"__TESTPOOL1_", false);
getHelper()->createRegionAndAttachPool(regionNames[1], NO_ACK,
"__TESTPOOL2_", false);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
for (int i = 0; i < 100; i++) {
regPtr0->put(keys[1], vals[1]);
regPtr1->put(keys[3], vals[3]);
@@ -168,8 +167,8 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepOne_1)
{
try {
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
auto checkPtr =
std::dynamic_pointer_cast<CacheableString>(regPtr0->get(keys[2]));
ASSERT(checkPtr == nullptr, "checkPtr should be null");
@@ -191,8 +190,8 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepOne_2)
{
try {
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
for (int i = 0; i < 100; i++) {
regPtr0->put(keys[0], regPtr1->get(keys[2]));
regPtr1->put(keys[2], regPtr0->get(keys[0]));
@@ -288,8 +287,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepOne_Pool_SecureEndPoint)
"__TESTPOOL1_", false);
getHelper()->createRegionAndAttachPool(regionNames[1], NO_ACK,
"__TESTPOOL2_", false);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
for (int i = 0; i < 100; i++) {
regPtr0->put(keys[0], vals[0]);
regPtr1->put(keys[2], vals[2]);
@@ -322,8 +321,8 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepTwo_Pool_SecureEndPoint)
"__TESTPOOL1_", false);
getHelper()->createRegionAndAttachPool(regionNames[1], NO_ACK,
"__TESTPOOL2_", false);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
for (int i = 0; i < 100; i++) {
regPtr0->put(keys[1], vals[1]);
regPtr1->put(keys[3], vals[3]);
@@ -339,8 +338,8 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepOne_secureclient1)
{
try {
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
auto checkPtr =
std::dynamic_pointer_cast<CacheableString>(regPtr0->get(keys[2]));
ASSERT(checkPtr == nullptr, "checkPtr should be null");
@@ -357,8 +356,8 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepOne_secureclient2)
{
try {
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
for (int i = 0; i < 100; i++) {
regPtr0->put(keys[0], regPtr1->get(keys[2]));
regPtr1->put(keys[2], regPtr0->get(keys[0]));
diff --git a/cppcache/integration-test/testThinClientNotificationWithDeltaWithoutcache.cpp b/cppcache/integration-test/testThinClientNotificationWithDeltaWithoutcache.cpp
index 5dfc70b..9536f3a 100644
--- a/cppcache/integration-test/testThinClientNotificationWithDeltaWithoutcache.cpp
+++ b/cppcache/integration-test/testThinClientNotificationWithDeltaWithoutcache.cpp
@@ -78,7 +78,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -91,8 +91,8 @@ void createRegionCachingDisabled(const char* name, bool ackMode,
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
// ack, caching
- RegionPtr regPtr = getHelper()->createRegion(name, ackMode, false, nullptr,
- clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, false, nullptr,
+ clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -110,7 +110,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateClient1)
createPooledRegion(regionNames[0], USE_ACK, locatorsG, "__TESTPOOL1_", true,
false); // without LRU
try {
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
serializationRegistry->addType(DeltaEx::create);
} catch (IllegalStateException&) {
// ignore exception caused by type reregistration.
@@ -123,7 +125,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateClient1_NoPools)
initClientNoPools();
createRegionCachingDisabled(regionNames[0], USE_ACK, true); // without LRU
try {
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
serializationRegistry->addType(DeltaEx::create);
} catch (IllegalStateException&) {
// ignore exception caused by type reregistration.
@@ -137,7 +141,9 @@ DUNIT_TASK_DEFINITION(CLIENT2, CreateClient2)
createPooledRegion(regionNames[0], USE_ACK, locatorsG, "__TESTPOOL1_", true,
false);
try {
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
serializationRegistry->addType(DeltaEx::create);
} catch (IllegalStateException&) {
// ignore exception caused by type reregistration.
@@ -152,7 +158,9 @@ DUNIT_TASK_DEFINITION(CLIENT2, CreateClient2_NoPools)
initClientNoPools();
createRegionCachingDisabled(regionNames[0], USE_ACK, true); // without LRU
try {
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
serializationRegistry->addType(DeltaEx::create);
} catch (IllegalStateException&) {
// ignore exception caused by type reregistration.
@@ -164,24 +172,21 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, Client2_RegisterInterest)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
- VectorOfCacheableKey vec;
- CacheableKeyPtr keyPtr = createKey(keys[0]);
- // CacheableKeyPtr keyPtr1 = createKey( keys[1] );
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+ std::vector<std::shared_ptr<CacheableKey>> vec;
+ auto keyPtr = createKey(keys[0]);
vec.push_back(keyPtr);
- // vec.push_back( keyPt1 );
regPtr->registerKeys(vec);
- // regPtr->registerAllKeys();
}
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, Client1_Put)
{
- CacheableKeyPtr keyPtr = createKey(keys[0]);
+ auto keyPtr = createKey(keys[0]);
DeltaEx* ptr = new DeltaEx();
- CacheablePtr valPtr(ptr);
+ std::shared_ptr<Cacheable> valPtr(ptr);
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
regPtr->put(keyPtr, valPtr);
ptr->setDelta(true);
regPtr->put(keyPtr, valPtr);
diff --git a/cppcache/integration-test/testThinClientPRPutAllFailover.cpp b/cppcache/integration-test/testThinClientPRPutAllFailover.cpp
index 1093191..daf66f6 100644
--- a/cppcache/integration-test/testThinClientPRPutAllFailover.cpp
+++ b/cppcache/integration-test/testThinClientPRPutAllFailover.cpp
@@ -14,8 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+#define ROOT_NAME "testThinClientPRPutAllFailover"
+#define ROOT_SCOPE DISTRIBUTED_ACK
+
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include "BuiltinCacheableWrappers.hpp"
#include <Utils.hpp>
@@ -23,10 +26,6 @@
#include <ace/High_Res_Timer.h>
#include "TallyListener.hpp"
#include <string>
-
-#define ROOT_NAME "testThinClientPRPutAllFailover"
-#define ROOT_SCOPE DISTRIBUTED_ACK
-
#include "CacheHelper.hpp"
// Include these 2 headers for access to CacheImpl for test hooks.
@@ -42,16 +41,15 @@ using namespace test;
#define CLIENT2 s2p1
#define SERVER1 s1p2
#define SERVER2 s2p2
-
-TallyListenerPtr reg1Listener1;
+std::shared_ptr<TallyListener> reg1Listener1;
bool isLocalServer = false;
static bool isLocator = false;
const char* locatorsG =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, 1);
-void setCacheListener(const char* regName, TallyListenerPtr regListener) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
+void setCacheListener(const char* regName, std::shared_ptr<TallyListener> regListener) {
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
attrMutator->setCacheListener(regListener);
}
@@ -107,35 +105,35 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, StepTwo_RegisterAllKeys)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
- regPtr0->registerAllKeys();
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
- regPtr1->registerAllKeys();
- LOG("StepTwo_Pooled_EndPoint_RegisterAllKeys complete.");
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
+ regPtr0->registerAllKeys();
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
+ regPtr1->registerAllKeys();
+ LOG("StepTwo_Pooled_EndPoint_RegisterAllKeys complete.");
}
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, PutAllOneTask)
{
LOG("PutAllOneTask started.");
- RegionPtr dataReg = getHelper()->getRegion(regionNames[0]);
- HashMapOfCacheable entryMap;
- entryMap.clear();
- char key[256];
- char value[256];
- for (int32_t item = 0; item < 1000; item++) {
- sprintf(key, "key-%d", item);
- sprintf(value, "%d", item);
- entryMap.emplace(CacheableKey::create(key),
- CacheableString::create(value));
- LOGDEBUG(
- "CPPTEST:PutAllOneTask Doing PutAll on key using key: = %s: & value: "
- "= "
- "%s",
- key, value);
- }
- try {
- dataReg->putAll(entryMap);
+ auto dataReg = getHelper()->getRegion(regionNames[0]);
+ HashMapOfCacheable entryMap;
+ entryMap.clear();
+ char key[256];
+ char value[256];
+ for (int32_t item = 0; item < 1000; item++) {
+ sprintf(key, "key-%d", item);
+ sprintf(value, "%d", item);
+ entryMap.emplace(CacheableKey::create(key),
+ CacheableString::create(value));
+ LOGDEBUG(
+ "CPPTEST:PutAllOneTask Doing PutAll on key using key: = %s: & value: "
+ "= "
+ "%s",
+ key, value);
+ }
+ try {
+ dataReg->putAll(entryMap);
} catch (Exception& ex) {
LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.getMessage());
FAIL(ex.getMessage());
@@ -152,24 +150,24 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, PutAllTwoTask)
{
LOG("PutAllTwoTask started.");
- RegionPtr dataReg = getHelper()->getRegion(regionNames[0]);
- HashMapOfCacheable entryMap;
- entryMap.clear();
- char key[256];
- char value[256];
- for (int32_t item = 1000; item < 2000; item++) {
- sprintf(key, "key-%d", item);
- sprintf(value, "%d", item);
- LOGDEBUG(
- "CPPTEST:PutAllTwoTask Doing PutAll on key using key: = %s: & value: "
- "= "
- "%s",
- key, value);
- entryMap.emplace(CacheableKey::create(key),
- CacheableString::create(value));
- }
- try {
- dataReg->putAll(entryMap);
+ auto dataReg = getHelper()->getRegion(regionNames[0]);
+ HashMapOfCacheable entryMap;
+ entryMap.clear();
+ char key[256];
+ char value[256];
+ for (int32_t item = 1000; item < 2000; item++) {
+ sprintf(key, "key-%d", item);
+ sprintf(value, "%d", item);
+ LOGDEBUG(
+ "CPPTEST:PutAllTwoTask Doing PutAll on key using key: = %s: & value: "
+ "= "
+ "%s",
+ key, value);
+ entryMap.emplace(CacheableKey::create(key),
+ CacheableString::create(value));
+ }
+ try {
+ dataReg->putAll(entryMap);
} catch (Exception& ex) {
LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.getMessage());
FAIL(ex.getMessage());
@@ -186,24 +184,24 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, PutAllThreeTask)
{
LOG("PutAllThreeTask started.");
- RegionPtr dataReg = getHelper()->getRegion(regionNames[0]);
- HashMapOfCacheable entryMap;
- entryMap.clear();
- char key[256];
- char value[256];
- for (int32_t item = 2000; item < 3000; item++) {
- sprintf(key, "key-%d", item);
- sprintf(value, "%d", item);
- LOGDEBUG(
- "CPPTEST:PutAllThreeTask Doing PutAll on key using key: = %s: & "
- "value: "
- "= %s",
- key, value);
- entryMap.emplace(CacheableKey::create(key),
- CacheableString::create(value));
- }
- try {
- dataReg->putAll(entryMap);
+ auto dataReg = getHelper()->getRegion(regionNames[0]);
+ HashMapOfCacheable entryMap;
+ entryMap.clear();
+ char key[256];
+ char value[256];
+ for (int32_t item = 2000; item < 3000; item++) {
+ sprintf(key, "key-%d", item);
+ sprintf(value, "%d", item);
+ LOGDEBUG(
+ "CPPTEST:PutAllThreeTask Doing PutAll on key using key: = %s: & "
+ "value: "
+ "= %s",
+ key, value);
+ entryMap.emplace(CacheableKey::create(key),
+ CacheableString::create(value));
+ }
+ try {
+ dataReg->putAll(entryMap);
} catch (Exception& ex) {
LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.getMessage());
FAIL(ex.getMessage());
@@ -220,24 +218,24 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, PutAllFourTask)
{
LOG("PutAllFourTask started.");
- RegionPtr dataReg = getHelper()->getRegion(regionNames[0]);
- HashMapOfCacheable entryMap;
- entryMap.clear();
- char key[256];
- char value[256];
- for (int32_t item = 3000; item < 4000; item++) {
- sprintf(key, "key-%d", item);
- sprintf(value, "%d", item);
- LOGDEBUG(
- "CPPTEST:PutAllFourTask Doing PutAll on key using key: = %s: & "
- "value: "
- "= %s",
- key, value);
- entryMap.emplace(CacheableKey::create(key),
- CacheableString::create(value));
- }
- try {
- dataReg->putAll(entryMap);
+ auto dataReg = getHelper()->getRegion(regionNames[0]);
+ HashMapOfCacheable entryMap;
+ entryMap.clear();
+ char key[256];
+ char value[256];
+ for (int32_t item = 3000; item < 4000; item++) {
+ sprintf(key, "key-%d", item);
+ sprintf(value, "%d", item);
+ LOGDEBUG(
+ "CPPTEST:PutAllFourTask Doing PutAll on key using key: = %s: & "
+ "value: "
+ "= %s",
+ key, value);
+ entryMap.emplace(CacheableKey::create(key),
+ CacheableString::create(value));
+ }
+ try {
+ dataReg->putAll(entryMap);
} catch (Exception& ex) {
LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.getMessage());
FAIL(ex.getMessage());
@@ -255,55 +253,55 @@ DUNIT_TASK_DEFINITION(CLIENT2, VerifyAllPutAllTask)
{
LOG("VerifyAllPutAllTask started.");
- RegionPtr dataReg = getHelper()->getRegion(regionNames[0]);
- ASSERT(dataReg != nullptr, "Region not found.");
- LOGINFO("dataregion size is %d: ", dataReg->size());
- LOGINFO("dataregion getCreates is %d: ", reg1Listener1->getCreates());
- ASSERT(reg1Listener1->getCreates() == 4000,
- "Got wrong number of creation events.");
-
- ASSERT(dataReg->size() == 4000, "Expected 4000 entries in region");
- char key[256];
- char value[256];
- for (int32_t item = 0; item < 4000; item++) {
- sprintf(key, "key-%d", item);
- sprintf(value, "%d", item);
- LOGDEBUG("CPPTEST:VerifyAllPutAllTask Doing get on key using: = %s: ",
- key);
- auto checkPtr = std::dynamic_pointer_cast<CacheableString>(
- dataReg->get(CacheableKey::create(key)));
- ASSERT(checkPtr != nullptr, "Value Ptr should not be null.");
- LOGDEBUG("CPPTEST:VerifyAllPutAllTask value is: = %s: ",
- checkPtr->asChar());
- ASSERT(atoi(checkPtr->asChar()) == item, "Value did not match.");
- }
- LOG("VerifyAllPutAllTask completed.");
+ auto dataReg = getHelper()->getRegion(regionNames[0]);
+ ASSERT(dataReg != nullptr, "Region not found.");
+ LOGINFO("dataregion size is %d: ", dataReg->size());
+ LOGINFO("dataregion getCreates is %d: ", reg1Listener1->getCreates());
+ ASSERT(reg1Listener1->getCreates() == 4000,
+ "Got wrong number of creation events.");
+
+ ASSERT(dataReg->size() == 4000, "Expected 4000 entries in region");
+ char key[256];
+ char value[256];
+ for (int32_t item = 0; item < 4000; item++) {
+ sprintf(key, "key-%d", item);
+ sprintf(value, "%d", item);
+ LOGDEBUG("CPPTEST:VerifyAllPutAllTask Doing get on key using: = %s: ",
+ key);
+ auto checkPtr = std::dynamic_pointer_cast<CacheableString>(
+ dataReg->get(CacheableKey::create(key)));
+ ASSERT(checkPtr != nullptr, "Value Ptr should not be null.");
+ LOGDEBUG("CPPTEST:VerifyAllPutAllTask value is: = %s: ",
+ checkPtr->asChar());
+ ASSERT(atoi(checkPtr->asChar()) == item, "Value did not match.");
+ }
+ LOG("VerifyAllPutAllTask completed.");
}
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, RemoveAllOneTask)
{
LOG("RemoveAllOneTask started.");
- RegionPtr dataReg = getHelper()->getRegion(regionNames[0]);
- HashMapOfCacheable entryMap;
- VectorOfCacheableKey keys;
- entryMap.clear();
- char key[256];
- char value[256];
- for (int32_t item = 0; item < 1000; item++) {
- sprintf(key, "key-%d", item);
- sprintf(value, "%d", item);
- entryMap.emplace(CacheableKey::create(key),
- CacheableString::create(value));
- keys.push_back(CacheableKey::create(key));
- LOGDEBUG(
- "CPPTEST:RemoveAllOneTask Doing PutAll on key using key: = %s: & "
- "value: = %s",
- key, value);
- }
- try {
- dataReg->putAll(entryMap);
- dataReg->removeAll(keys);
+ auto dataReg = getHelper()->getRegion(regionNames[0]);
+ HashMapOfCacheable entryMap;
+ std::vector<std::shared_ptr<CacheableKey>> keys;
+ entryMap.clear();
+ char key[256];
+ char value[256];
+ for (int32_t item = 0; item < 1000; item++) {
+ sprintf(key, "key-%d", item);
+ sprintf(value, "%d", item);
+ entryMap.emplace(CacheableKey::create(key),
+ CacheableString::create(value));
+ keys.push_back(CacheableKey::create(key));
+ LOGDEBUG(
+ "CPPTEST:RemoveAllOneTask Doing PutAll on key using key: = %s: & "
+ "value: = %s",
+ key, value);
+ }
+ try {
+ dataReg->putAll(entryMap);
+ dataReg->removeAll(keys);
} catch (Exception& ex) {
LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.getMessage());
FAIL(ex.getMessage());
@@ -320,26 +318,26 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, RemoveAllTwoTask)
{
LOG("RemoveAllTwoTask started.");
- RegionPtr dataReg = getHelper()->getRegion(regionNames[0]);
- HashMapOfCacheable entryMap;
- VectorOfCacheableKey keys;
- entryMap.clear();
- char key[256];
- char value[256];
- for (int32_t item = 1000; item < 2000; item++) {
- sprintf(key, "key-%d", item);
- sprintf(value, "%d", item);
- entryMap.emplace(CacheableKey::create(key),
- CacheableString::create(value));
- keys.push_back(CacheableKey::create(key));
- LOGDEBUG(
- "CPPTEST:RemoveAllTwoTask Doing RemoveAll on key using key: = %s: & "
- "value: = %s",
- key, value);
- }
- try {
- dataReg->putAll(entryMap);
- dataReg->removeAll(keys);
+ auto dataReg = getHelper()->getRegion(regionNames[0]);
+ HashMapOfCacheable entryMap;
+ std::vector<std::shared_ptr<CacheableKey>> keys;
+ entryMap.clear();
+ char key[256];
+ char value[256];
+ for (int32_t item = 1000; item < 2000; item++) {
+ sprintf(key, "key-%d", item);
+ sprintf(value, "%d", item);
+ entryMap.emplace(CacheableKey::create(key),
+ CacheableString::create(value));
+ keys.push_back(CacheableKey::create(key));
+ LOGDEBUG(
+ "CPPTEST:RemoveAllTwoTask Doing RemoveAll on key using key: = %s: & "
+ "value: = %s",
+ key, value);
+ }
+ try {
+ dataReg->putAll(entryMap);
+ dataReg->removeAll(keys);
} catch (Exception& ex) {
LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.getMessage());
FAIL(ex.getMessage());
@@ -356,27 +354,27 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, RemoveAllThreeTask)
{
LOG("RemoveAllThreeTask started.");
- RegionPtr dataReg = getHelper()->getRegion(regionNames[0]);
- HashMapOfCacheable entryMap;
- VectorOfCacheableKey keys;
- entryMap.clear();
- char key[256];
- char value[256];
- for (int32_t item = 2000; item < 3000; item++) {
- sprintf(key, "key-%d", item);
- sprintf(value, "%d", item);
- entryMap.emplace(CacheableKey::create(key),
- CacheableString::create(value));
- keys.push_back(CacheableKey::create(key));
- LOGDEBUG(
- "CPPTEST:RemoveAllThreeTask Doing RemoveAll on key using key: = %s: "
- "& "
- "value: = %s",
- key, value);
- }
- try {
- dataReg->putAll(entryMap);
- dataReg->removeAll(keys);
+ auto dataReg = getHelper()->getRegion(regionNames[0]);
+ HashMapOfCacheable entryMap;
+ std::vector<std::shared_ptr<CacheableKey>> keys;
+ entryMap.clear();
+ char key[256];
+ char value[256];
+ for (int32_t item = 2000; item < 3000; item++) {
+ sprintf(key, "key-%d", item);
+ sprintf(value, "%d", item);
+ entryMap.emplace(CacheableKey::create(key),
+ CacheableString::create(value));
+ keys.push_back(CacheableKey::create(key));
+ LOGDEBUG(
+ "CPPTEST:RemoveAllThreeTask Doing RemoveAll on key using key: = %s: "
+ "& "
+ "value: = %s",
+ key, value);
+ }
+ try {
+ dataReg->putAll(entryMap);
+ dataReg->removeAll(keys);
} catch (Exception& ex) {
LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.getMessage());
FAIL(ex.getMessage());
@@ -394,26 +392,26 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, RemoveAllFourTask)
{
LOG("RemoveAllFourTask started.");
- RegionPtr dataReg = getHelper()->getRegion(regionNames[0]);
- HashMapOfCacheable entryMap;
- VectorOfCacheableKey keys;
- entryMap.clear();
- char key[256];
- char value[256];
- for (int32_t item = 3000; item < 4000; item++) {
- sprintf(key, "key-%d", item);
- sprintf(value, "%d", item);
- entryMap.emplace(CacheableKey::create(key),
- CacheableString::create(value));
- keys.push_back(CacheableKey::create(key));
- LOGDEBUG(
- "CPPTEST:RemoveAllFourTask Doing RemoveAll on key using key: = %s: & "
- "value: = %s",
- key, value);
- }
- try {
- dataReg->putAll(entryMap);
- dataReg->removeAll(keys);
+ auto dataReg = getHelper()->getRegion(regionNames[0]);
+ HashMapOfCacheable entryMap;
+ std::vector<std::shared_ptr<CacheableKey>> keys;
+ entryMap.clear();
+ char key[256];
+ char value[256];
+ for (int32_t item = 3000; item < 4000; item++) {
+ sprintf(key, "key-%d", item);
+ sprintf(value, "%d", item);
+ entryMap.emplace(CacheableKey::create(key),
+ CacheableString::create(value));
+ keys.push_back(CacheableKey::create(key));
+ LOGDEBUG(
+ "CPPTEST:RemoveAllFourTask Doing RemoveAll on key using key: = %s: & "
+ "value: = %s",
+ key, value);
+ }
+ try {
+ dataReg->putAll(entryMap);
+ dataReg->removeAll(keys);
} catch (Exception& ex) {
LOGERROR("CPPTEST: Unexpected %s: %s", ex.getName(), ex.getMessage());
FAIL(ex.getMessage());
@@ -432,14 +430,14 @@ DUNIT_TASK_DEFINITION(CLIENT2, VerifyAllRemoveAllTask)
{
LOG("VerifyAllRemoveAllTask started.");
- RegionPtr dataReg = getHelper()->getRegion(regionNames[0]);
- ASSERT(dataReg != nullptr, "Region not found.");
- LOGINFO("dataregion size is %d: ", dataReg->size());
- LOGINFO("dataregion getDestroys is %d: ", reg1Listener1->getDestroys());
- ASSERT(reg1Listener1->getDestroys() == 4000,
- "Got wrong number of destroy events.");
- ASSERT(dataReg->size() == 0, "Expected 0 entries in region");
- LOG("VerifyAllRemoveAllTask completed.");
+ auto dataReg = getHelper()->getRegion(regionNames[0]);
+ ASSERT(dataReg != nullptr, "Region not found.");
+ LOGINFO("dataregion size is %d: ", dataReg->size());
+ LOGINFO("dataregion getDestroys is %d: ", reg1Listener1->getDestroys());
+ ASSERT(reg1Listener1->getDestroys() == 4000,
+ "Got wrong number of destroy events.");
+ ASSERT(dataReg->size() == 0, "Expected 0 entries in region");
+ LOG("VerifyAllRemoveAllTask completed.");
}
END_TASK_DEFINITION
diff --git a/cppcache/integration-test/testThinClientPRSingleHop.cpp b/cppcache/integration-test/testThinClientPRSingleHop.cpp
index 66d01b7..b86221c 100644
--- a/cppcache/integration-test/testThinClientPRSingleHop.cpp
+++ b/cppcache/integration-test/testThinClientPRSingleHop.cpp
@@ -15,22 +15,21 @@
* limitations under the License.
*/
+#define ROOT_NAME "testThinClientPRSingleHop"
+#define ROOT_SCOPE DISTRIBUTED_ACK
+
#include <string>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <ace/ACE.h>
-#include <geode/GeodeCppCache.hpp>
#include <geode/statistics/StatisticsFactory.hpp>
#include "fw_dunit.hpp"
#include "BuiltinCacheableWrappers.hpp"
#include "Utils.hpp"
-#define ROOT_NAME "testThinClientPRSingleHop"
-#define ROOT_SCOPE DISTRIBUTED_ACK
-
#include "CacheHelper.hpp"
// Include these 2 headers for access to CacheImpl for test hooks.
@@ -97,7 +96,7 @@ std::string convertHostToCanonicalForm(const char* endpoints) {
class putThread : public ACE_Task_Base {
private:
- RegionPtr regPtr;
+ std::shared_ptr<Region> regPtr;
int m_min;
int m_max;
bool m_isWarmUpTask;
@@ -115,7 +114,7 @@ class putThread : public ACE_Task_Base {
int svc(void) {
bool networkhop ATTR_UNUSED = false;
- CacheableKeyPtr keyPtr;
+ std::shared_ptr<CacheableKey> keyPtr;
int rand;
for (int i = m_min; i < m_max; i++) {
if (!m_isWarmUpTask) {
@@ -174,7 +173,7 @@ class putThread : public ACE_Task_Base {
}
}
LOG("releaseThreadLocalConnection PutThread");
- PoolPtr pool =
+ auto pool =
getHelper()->getCache()->getPoolManager().find("__TEST_POOL1__");
pool->releaseThreadLocalConnection();
LOG("releaseThreadLocalConnection PutThread done");
@@ -272,7 +271,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepOne_Pooled_LocatorTL)
{
initClient(true);
- RegionPtr regPtr = getHelper()->createPooledRegionStickySingleHop(
+ auto regPtr = getHelper()->createPooledRegionStickySingleHop(
regionNames[0], USE_ACK, locatorsG, "__TEST_POOL1__", false, false);
ASSERT(regPtr != nullptr, "Failed to create region.");
regPtr = getHelper()->createPooledRegionStickySingleHop(
@@ -288,7 +287,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, WarmUpTask)
LOG("WarmUpTask started.");
int failureCount = 0;
int metadatarefreshCount = 0;
- RegionPtr dataReg = getHelper()->getRegion(regionNames[0]);
+ auto dataReg = getHelper()->getRegion(regionNames[0]);
// This is to get MetaDataService going.
for (int i = 0; i < 2000; i++) {
@@ -369,7 +368,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, WarmUpTask3)
LOG("WarmUpTask3 started.");
int failureCount = 0;
int metadatarefreshCount = 0;
- RegionPtr dataReg = getHelper()->getRegion(regionNames[0]);
+ auto dataReg = getHelper()->getRegion(regionNames[0]);
// This is to get MetaDataService going.
for (int i = 0; i < 2000; i++) {
@@ -479,10 +478,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForAllKeysTask)
LOG("CheckPrSingleHopForAllKeysTask started.");
static int taskIndexPut = 0;
- std::vector<int8_t> keyTypes =
- CacheableWrapperFactory::getRegisteredKeyTypes();
- std::vector<int8_t> valueTypes =
- CacheableWrapperFactory::getRegisteredValueTypes();
+ auto keyTypes = CacheableWrapperFactory::getRegisteredKeyTypes();
+ auto valueTypes = CacheableWrapperFactory::getRegisteredValueTypes();
size_t keyTypeIndex = taskIndexPut / valueTypes.size();
size_t valueTypeIndex = taskIndexPut % valueTypes.size();
@@ -501,8 +498,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForAllKeysTask)
(key->maxKeys() < DEFAULTNUMKEYS ? key->maxKeys() : DEFAULTNUMKEYS);
delete key;
- RegionPtr dataReg = getHelper()->getRegion(regionNames[0]);
- RegionPtr verifyReg = getHelper()->getRegion(regionNames[1]);
+ auto dataReg = getHelper()->getRegion(regionNames[0]);
+ auto verifyReg = getHelper()->getRegion(regionNames[1]);
for (int i = 0; i < maxKeys; i++) {
CacheableWrapper* tmpkey =
CacheableWrapperFactory::createInstance(keyTypeId);
@@ -625,7 +622,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask2)
{
LOG("CheckPrSingleHopForIntKeysTask2 started.");
- RegionPtr dataReg = getHelper()->getRegion(regionNames[0]);
+ auto dataReg = getHelper()->getRegion(regionNames[0]);
for (int i = 2000; i < 3000; i++) {
auto keyPtr =
@@ -807,7 +804,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask2)
LOG("CheckPrSingleHopForIntKeysTask2 get completed.");
for (int i = 1000; i < 2000; i++) {
- VectorOfCacheableKey keys;
+ std::vector<std::shared_ptr<CacheableKey>> keys;
for (int j = i; j < i + 5; j++) {
keys.push_back(CacheableInt32::create(j));
}
@@ -863,8 +860,8 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForGetAllTask)
{
- RegionPtr dataReg = getHelper()->getRegion(regionNames[0]);
- VectorOfCacheableKey keys;
+ auto dataReg = getHelper()->getRegion(regionNames[0]);
+ std::vector<std::shared_ptr<CacheableKey>> keys;
for (int i = 0; i < 100; i++) {
auto keyPtr =
std::dynamic_pointer_cast<CacheableKey>(CacheableInt32::create(i));
@@ -887,7 +884,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask)
{
LOG("CheckPrSingleHopForIntKeysTask started.");
- RegionPtr dataReg = getHelper()->getRegion(regionNames[0]);
+ auto dataReg = getHelper()->getRegion(regionNames[0]);
for (int i = 2000; i < 3000; i++) {
auto keyPtr =
@@ -1048,7 +1045,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask)
LOG("CheckPrSingleHopForIntKeysTask get completed.");
for (int i = 1000; i < 2000; i++) {
- VectorOfCacheableKey keys;
+ std::vector<std::shared_ptr<CacheableKey>> keys;
for (int j = i; j < i + 5; j++) {
keys.push_back(CacheableInt32::create(j));
}
@@ -1150,7 +1147,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, CloseCache1)
{
- PoolPtr pool =
+ auto pool =
getHelper()->getCache()->getPoolManager().find("__TEST_POOL1__");
if (pool->getThreadLocalConnections()) {
LOG("releaseThreadLocalConnection1 doing...");
@@ -1235,8 +1232,8 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, CheckGetAllTask)
{
- RegionPtr dataReg = getHelper()->getRegion(regionNames[0]);
- VectorOfCacheableKey keys;
+ auto dataReg = getHelper()->getRegion(regionNames[0]);
+ std::vector<std::shared_ptr<CacheableKey>> keys;
for (int i = 0; i < 100000; i++) {
auto keyPtr =
std::dynamic_pointer_cast<CacheableKey>(CacheableInt32::create(i));
diff --git a/cppcache/integration-test/testThinClientPRSingleHopServerGroup.cpp b/cppcache/integration-test/testThinClientPRSingleHopServerGroup.cpp
index 1614bab..250e4ab 100644
--- a/cppcache/integration-test/testThinClientPRSingleHopServerGroup.cpp
+++ b/cppcache/integration-test/testThinClientPRSingleHopServerGroup.cpp
@@ -14,22 +14,22 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+#define ROOT_NAME "testThinClientPRSingleHopServerGroup"
+#define ROOT_SCOPE DISTRIBUTED_ACK
+
#include <string>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <ace/ACE.h>
-#include <geode/GeodeCppCache.hpp>
#include <geode/statistics/StatisticsFactory.hpp>
#include "fw_dunit.hpp"
#include "BuiltinCacheableWrappers.hpp"
#include "Utils.hpp"
-#define ROOT_NAME "testThinClientPRSingleHopServerGroup"
-#define ROOT_SCOPE DISTRIBUTED_ACK
-
#include "CacheHelper.hpp"
// Include these 2 headers for access to CacheImpl for test hooks.
@@ -98,7 +98,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask_CLIENT1)
int failureCount = 0;
int metadatarefreshCount = 0;
- RegionPtr dataReg = getHelper()->getRegion(regionNames[0]);
+ auto dataReg = getHelper()->getRegion(regionNames[0]);
for (int i = 0; i < 1000; i++) {
auto keyPtr =
@@ -189,7 +189,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask_CLIENT1)
LOG("CheckPrSingleHopForIntKeysTask_CLIENT1 get completed.");
for (int i = 1000; i < 2000; i++) {
- VectorOfCacheableKey keys;
+ std::vector<std::shared_ptr<CacheableKey>> keys;
for (int j = i; j < i + 5; j++) {
keys.push_back(CacheableInt32::create(j));
}
@@ -272,7 +272,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, CheckPrSingleHopForIntKeysTask_CLIENT2)
int failureCount = 0;
int metadatarefreshCount = 0;
- RegionPtr dataReg = getHelper()->getRegion(regionNames[0]);
+ auto dataReg = getHelper()->getRegion(regionNames[0]);
for (int i = 0; i < 1000; i++) {
auto keyPtr =
@@ -359,7 +359,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, CheckPrSingleHopForIntKeysTask_CLIENT2)
LOG("CheckPrSingleHopForIntKeysTask_CLIENT2 get completed.");
for (int i = 1000; i < 2000; i++) {
- VectorOfCacheableKey keys;
+ std::vector<std::shared_ptr<CacheableKey>> keys;
for (int j = i; j < i + 5; j++) {
keys.push_back(CacheableInt32::create(j));
}
@@ -435,7 +435,7 @@ DUNIT_TASK_DEFINITION(CLIENT3, CheckPrSingleHopForIntKeysTask_CLIENT3)
int failureCount = 0;
int metadatarefreshCount = 0;
- RegionPtr dataReg = getHelper()->getRegion(regionNames[0]);
+ auto dataReg = getHelper()->getRegion(regionNames[0]);
for (int i = 0; i < 1000; i++) {
auto keyPtr =
@@ -522,7 +522,7 @@ DUNIT_TASK_DEFINITION(CLIENT3, CheckPrSingleHopForIntKeysTask_CLIENT3)
LOG("CheckPrSingleHopForIntKeysTask_CLIENT3 get completed.");
for (int i = 1000; i < 2000; i++) {
- VectorOfCacheableKey keys;
+ std::vector<std::shared_ptr<CacheableKey>> keys;
for (int j = i; j < i + 5; j++) {
keys.push_back(CacheableInt32::create(j));
}
diff --git a/cppcache/integration-test/testThinClientPartitionResolver.cpp b/cppcache/integration-test/testThinClientPartitionResolver.cpp
index 53cc40e..b2c1a4e 100644
--- a/cppcache/integration-test/testThinClientPartitionResolver.cpp
+++ b/cppcache/integration-test/testThinClientPartitionResolver.cpp
@@ -14,8 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+#define ROOT_NAME "testThinClientPartitionResolver"
+#define ROOT_SCOPE DISTRIBUTED_ACK
+
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include "BuiltinCacheableWrappers.hpp"
#include <Utils.hpp>
#include <geode/PartitionResolver.hpp>
@@ -24,9 +27,6 @@
#include <string>
-#define ROOT_NAME "testThinClientPartitionResolver"
-#define ROOT_SCOPE DISTRIBUTED_ACK
-
#include "CacheHelper.hpp"
// Include these 2 headers for access to CacheImpl for test hooks.
@@ -48,7 +48,7 @@ class CustomPartitionResolver : public PartitionResolver {
return "CustomPartitionResolver";
}
- CacheableKeyPtr getRoutingObject(const EntryEvent &opDetails) {
+ std::shared_ptr<CacheableKey> getRoutingObject(const EntryEvent &opDetails) {
called = true;
LOG("CustomPartitionResolver::getRoutingObject()");
int32_t key = atoi(opDetails.getKey()->toString()->asChar());
@@ -57,7 +57,7 @@ class CustomPartitionResolver : public PartitionResolver {
}
};
CustomPartitionResolver *cpr = new CustomPartitionResolver();
-PartitionResolverPtr cptr(cpr);
+std::shared_ptr<PartitionResolver> cptr(cpr);
#define CLIENT1 s1p1
#define SERVER1 s2p1
@@ -119,8 +119,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutThroughPartitionResolver)
LOG("PutThroughPartitionResolver started.");
for (int i = 0; i < 100; i++) {
- // RegionPtr dataReg = getHelper()->getRegion("LocalRegion");
- RegionPtr dataReg = getHelper()->getRegion(regionNames[0]);
+ //auto dataReg = getHelper()->getRegion("LocalRegion");
+ auto dataReg = getHelper()->getRegion(regionNames[0]);
auto keyPtr =
std::dynamic_pointer_cast<CacheableKey>(CacheableInt32::create(i));
dataReg->put(keyPtr, keyPtr->hashcode());
diff --git a/cppcache/integration-test/testThinClientPdxDeltaWithNotification.cpp b/cppcache/integration-test/testThinClientPdxDeltaWithNotification.cpp
index a33f229..545a271 100644
--- a/cppcache/integration-test/testThinClientPdxDeltaWithNotification.cpp
+++ b/cppcache/integration-test/testThinClientPdxDeltaWithNotification.cpp
@@ -79,7 +79,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -89,7 +89,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
void createPooledExpirationRegion(const char* name, const char* poolname) {
LOG("createPooledExpirationRegion() entered.");
// Entry time-to-live = 1 second.
- RegionPtr regPtr = getHelper()->createPooledRegionDiscOverFlow(
+ auto regPtr = getHelper()->createPooledRegionDiscOverFlow(
name, true, locatorsG, poolname, true, true, std::chrono::seconds(1),
std::chrono::seconds(0), std::chrono::seconds(0), std::chrono::seconds(0),
0, nullptr, ExpirationAction::LOCAL_INVALIDATE);
@@ -100,7 +100,7 @@ void createPooledLRURegion(const char* name, bool ackMode, const char* locators,
bool clientNotificationEnabled = false,
bool cachingEnable = true) {
LOG(" createPooledLRURegion entered");
- RegionPtr regPtr = getHelper()->createPooledRegionDiscOverFlow(
+ auto regPtr = getHelper()->createPooledRegionDiscOverFlow(
name, ackMode, locators, poolname, cachingEnable,
clientNotificationEnabled, std::chrono::seconds(0),
std::chrono::seconds(0), std::chrono::seconds(0), std::chrono::seconds(0),
@@ -114,8 +114,8 @@ void createRegion(const char* name, bool ackMode,
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
// ack, caching
- RegionPtr regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
- clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
+ clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -123,7 +123,7 @@ void createRegion(const char* name, bool ackMode,
void createLRURegion(const char* name, bool clientNotificationEnabled = false,
bool cachingEnable = true) {
LOG(" createPooledLRURegion entered");
- RegionPtr regPtr = getHelper()->createRegionDiscOverFlow(
+ auto regPtr = getHelper()->createRegionDiscOverFlow(
name, cachingEnable, clientNotificationEnabled,
std::chrono::seconds::zero(), std::chrono::seconds(0),
std::chrono::seconds(0), std::chrono::seconds(0), 3 /*LruLimit = 3*/);
@@ -134,7 +134,7 @@ void createExpirationRegion(const char* name,
bool clientNotificationEnabled = false,
bool cachingEnable = true) {
LOG(" createPooledLRURegion entered");
- RegionPtr regPtr = getHelper()->createRegionDiscOverFlow(
+ auto regPtr = getHelper()->createRegionDiscOverFlow(
name, cachingEnable, clientNotificationEnabled, std::chrono::seconds(1),
std::chrono::seconds(0), std::chrono::seconds(0), std::chrono::seconds(0),
0, ExpirationAction::LOCAL_INVALIDATE);
@@ -191,7 +191,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, Client1_PdxInit)
{
try {
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
serializationRegistry->addPdxType(PdxDeltaEx::createDeserializable);
} catch (IllegalStateException&) {
// ignore type reregistration exception.
@@ -202,14 +204,16 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, Client2_PdxInit)
{
try {
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
serializationRegistry->addPdxType(PdxDeltaEx::createDeserializable);
} catch (IllegalStateException&) {
// ignore type reregistration exception.
}
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
- RegionPtr regPtr2 = getHelper()->getRegion(regionNames[2]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto regPtr2 = getHelper()->getRegion(regionNames[2]);
regPtr->registerRegex(".*");
regPtr1->registerRegex(".*");
regPtr2->registerRegex(".*");
@@ -225,11 +229,11 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, Client1_PdxPut)
{
- CacheableKeyPtr keyPtr = createKey(keys[0]);
+ auto keyPtr = createKey(keys[0]);
PdxDeltaEx* ptr = new PdxDeltaEx();
// auto pdxobj = std::make_shared<PdxDeltaEx>();
- CacheablePtr valPtr(ptr);
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ std::shared_ptr<Cacheable> valPtr(ptr);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
regPtr->put(keyPtr, valPtr);
// Client 2: fromDataCount = 1, fromDeltaCount = 0;
ptr->setDelta(true);
@@ -237,8 +241,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1_PdxPut)
// Client 2: fromDataCount = 1, fromDeltaCount = 1;
PdxDeltaEx* ptr1 = new PdxDeltaEx();
- CacheablePtr valPtr1(ptr1);
- CacheableKeyPtr keyPtr1 = createKey(keys[1]);
+ std::shared_ptr<Cacheable> valPtr1(ptr1);
+ auto keyPtr1 = createKey(keys[1]);
regPtr->put(keyPtr1, valPtr1);
// Client 2: fromDataCount = 2, fromDeltaCount = 1;
ptr1->setDelta(true);
@@ -255,11 +259,11 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1_PdxPut)
// For LRU with notification and disc overflow.
LOG("LRU with notification");
- CacheableKeyPtr keyPtr2 = createKey(keys[2]);
- CacheableKeyPtr keyPtr3 = createKey(keys[3]);
- CacheableKeyPtr keyPtr4 = createKey("LRUKEY4");
- CacheableKeyPtr keyPtr5 = createKey("LRUKEY5");
- RegionPtr regPtr1 = getHelper()->getRegion(regionNames[1]);
+ auto keyPtr2 = createKey(keys[2]);
+ auto keyPtr3 = createKey(keys[3]);
+ auto keyPtr4 = createKey("LRUKEY4");
+ auto keyPtr5 = createKey("LRUKEY5");
+ auto regPtr1 = getHelper()->getRegion(regionNames[1]);
regPtr1->put(keyPtr2, valPtr1);
// Client 2: fromDataCount = 4, fromDeltaCount = 2;
@@ -284,9 +288,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1_PdxPut)
// oldValue for listeners, fromData()
// is invoked, hence fromDataCount increases by 2.
- RegionPtr regPtr2 = getHelper()->getRegion(regionNames[2]);
+ auto regPtr2 = getHelper()->getRegion(regionNames[2]);
PdxDeltaEx* ptr2 = new PdxDeltaEx();
- CacheablePtr valPtr2(ptr2);
+ std::shared_ptr<Cacheable> valPtr2(ptr2);
regPtr2->put(1, valPtr2);
// Client 2: fromDataCount = 12, fromDeltaCount = 3;
// Sleep for 5 seconds to allow expiration at client 2.
diff --git a/cppcache/integration-test/testThinClientPdxEnum.cpp b/cppcache/integration-test/testThinClientPdxEnum.cpp
index 8d8ea75..780b3f4 100644
--- a/cppcache/integration-test/testThinClientPdxEnum.cpp
+++ b/cppcache/integration-test/testThinClientPdxEnum.cpp
@@ -16,7 +16,6 @@
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include "testobject/NestedPdxObject.hpp"
#include "ThinClientHelper.hpp"
#include "QueryStrings.hpp"
@@ -84,7 +83,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, putPdxWithEnum)
auto pdxobj2 = std::make_shared<PdxEnumTestClass>(1);
auto pdxobj3 = std::make_shared<PdxEnumTestClass>(2);
- RegionPtr rptr = getHelper()->getRegion("DistRegionAck");
+ auto rptr = getHelper()->getRegion("DistRegionAck");
// PUT Operations
rptr->put(CacheableInt32::create(0), pdxobj1);
@@ -105,15 +104,17 @@ DUNIT_TASK_DEFINITION(CLIENT1, pdxEnumQuery)
LOG("pdxEnumQuery started ");
try {
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
serializationRegistry->addPdxType(PdxEnumTestClass::createDeserializable);
LOG("PdxEnumTestClass Registered Successfully....");
} catch (apache::geode::client::IllegalStateException& /* ex*/) {
LOG("PdxEnumTestClass IllegalStateException");
}
- RegionPtr rptr = getHelper()->getRegion("DistRegionAck");
- SelectResultsPtr results = rptr->query("m_enumid.name = 'id2'");
+ auto rptr = getHelper()->getRegion("DistRegionAck");
+ auto results = rptr->query("m_enumid.name = 'id2'");
ASSERT(results->size() == 1, "query result should have one item");
auto rsptr = std::dynamic_pointer_cast<ResultSet>(results);
SelectResultsIterator iter = rsptr->getIterator();
@@ -123,10 +124,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, pdxEnumQuery)
}
QueryHelper* qh ATTR_UNUSED = &QueryHelper::getHelper();
- QueryServicePtr qs = nullptr;
- PoolPtr pool1 = findPool("__TEST_POOL1__");
+ std::shared_ptr<QueryService> qs = nullptr;
+ auto pool1 = findPool("__TEST_POOL1__");
qs = pool1->getQueryService();
- QueryPtr qry = qs->newQuery(
+ auto qry = qs->newQuery(
"select distinct * from /DistRegionAck this where m_enumid.name = "
"'id3'");
results = qry->execute();
diff --git a/cppcache/integration-test/testThinClientPdxInstance.cpp b/cppcache/integration-test/testThinClientPdxInstance.cpp
index 23b17e9..14ee006 100644
--- a/cppcache/integration-test/testThinClientPdxInstance.cpp
+++ b/cppcache/integration-test/testThinClientPdxInstance.cpp
@@ -15,13 +15,16 @@
* limitations under the License.
*/
-#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
+#include <string>
+#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
+
+#include "fw_dunit.hpp"
+#include <geode/PdxInstance.hpp>
+#include <geode/PdxInstanceFactory.hpp>
+#include <geode/WritablePdxInstance.hpp>
#include "testobject/PdxType.hpp"
#include "testobject/NestedPdxObject.hpp"
-#include <ace/OS.h>
-#include <string>
#include "CachePerfStats.hpp"
#include <LocalRegion.hpp>
#define ROOT_NAME "testThinClientPdxInstance"
@@ -93,7 +96,7 @@ bool generic2DCompare(T1** value1, T2** value2, int length,
void initClient(const bool isthinClient, bool isPdxReadSerailized) {
LOGINFO("isPdxReadSerailized = %d ", isPdxReadSerailized);
if (cacheHelper == nullptr) {
- PropertiesPtr config = Properties::create();
+ auto config = Properties::create();
config->insert("enable-time-statistics", "true");
LOGINFO("enabled-time-statistics ");
cacheHelper = new CacheHelper(isthinClient, false, isPdxReadSerailized,
@@ -104,7 +107,7 @@ void initClient(const bool isthinClient, bool isPdxReadSerailized) {
static int clientWithXml = 0;
void initClient(const char* clientXmlFile) {
if (cacheHelper == nullptr) {
- PropertiesPtr config = Properties::create();
+ auto config = Properties::create();
if (clientWithXml > 2) config->insert("grid-client", "true");
clientWithXml += 1;
config->insert("enable-time-statistics", "true");
@@ -129,7 +132,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -229,14 +232,14 @@ DUNIT_TASK_DEFINITION(CLIENT1, putPdxWithIdentityField)
LOG("putPdxWithIdentityField started ");
try {
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
serializationRegistry->addPdxType(SerializePdx::createDeserializable);
LOG("SerializePdx Registered Successfully....");
} catch (apache::geode::client::IllegalStateException& /* ex*/) {
LOG("SerializePdx IllegalStateException");
}
- RegionPtr rptr = getHelper()->getRegion(regionNames[0]);
+ auto rptr = getHelper()->getRegion(regionNames[0]);
// Creating object of type PdxObject
/*SerializePdxPtr*/ auto sp = std::make_shared<SerializePdx>(true);
@@ -253,27 +256,34 @@ DUNIT_TASK_DEFINITION(CLIENT1, putCacheableObjectArrayWithPdxFields)
LOG("putCacheableObjectArrayWithPdxFields started ");
try {
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
serializationRegistry->addPdxType(Address::createDeserializable);
LOG("Address Registered Successfully....");
} catch (apache::geode::client::IllegalStateException& /* ex*/) {
LOG("Address IllegalStateException");
}
- RegionPtr rptr = getHelper()->getRegion(regionNames[0]);
+ auto rptr = getHelper()->getRegion(regionNames[0]);
// Creating CacheableobjectArray of type PdxObject
- CacheableObjectArrayPtr objectArray = CacheableObjectArray::create();
- objectArray->push_back(AddressPtr(new Address(1, "street0", "city0")));
- objectArray->push_back(AddressPtr(new Address(2, "street1", "city1")));
- objectArray->push_back(AddressPtr(new Address(3, "street2", "city2")));
- objectArray->push_back(AddressPtr(new Address(4, "street3", "city3")));
- objectArray->push_back(AddressPtr(new Address(5, "street4", "city4")));
- objectArray->push_back(AddressPtr(new Address(6, "street5", "city5")));
- objectArray->push_back(AddressPtr(new Address(7, "street6", "city6")));
- objectArray->push_back(AddressPtr(new Address(8, "street7", "city7")));
- objectArray->push_back(AddressPtr(new Address(9, "street8", "city8")));
- objectArray->push_back(AddressPtr(new Address(10, "street9", "city9")));
+ std::shared_ptr<CacheableObjectArray> objectArray =
+ CacheableObjectArray::create();
+ objectArray->push_back(
+ std::shared_ptr<Address>(new Address(1, "street0", "city0")));
+ objectArray->push_back(
+ std::shared_ptr<Address>(new Address(2, "street1", "city1")));
+ objectArray->push_back(
+ std::shared_ptr<Address>(new Address(3, "street2", "city2")));
+ objectArray->push_back(
+ std::shared_ptr<Address>(new Address(4, "street3", "city3")));
+ objectArray->push_back(
+ std::shared_ptr<Address>(new Address(5, "street4", "city4")));
+ objectArray->push_back(
+ std::shared_ptr<Address>(new Address(6, "street5", "city5")));
+ objectArray->push_back(std::shared_ptr<Address>(new Address(7, "street6", "city6")));
+ objectArray->push_back(std::shared_ptr<Address>(new Address(8, "street7", "city7")));
+ objectArray->push_back(std::shared_ptr<Address>(new Address(9, "street8", "city8")));
+ objectArray->push_back(std::shared_ptr<Address>(new Address(10, "street9", "city9")));
// PUT Operation
rptr->put(CacheableInt32::create(100), objectArray);
@@ -288,14 +298,14 @@ DUNIT_TASK_DEFINITION(CLIENT2, verifyPdxIdentityField)
LOG("verifyPdxIdentityField started ");
try {
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
serializationRegistry->addPdxType(SerializePdx::createDeserializable);
LOG("SerializePdx Registered Successfully....");
} catch (apache::geode::client::IllegalStateException& /* ex*/) {
LOG("SerializePdx IllegalStateException");
}
- RegionPtr rptr = getHelper()->getRegion(regionNames[0]);
+ auto rptr = getHelper()->getRegion(regionNames[0]);
auto pi = std::dynamic_pointer_cast<PdxInstance>(
rptr->get(CacheableInt32::create(1)));
@@ -347,7 +357,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, verifyPdxIdentityField)
ASSERT(pi->hasField("i3") == false,
"There is no field i3 in SerializePdx1's PdxInstance stream");
- CacheableKeyPtr javaPdxHCKey = CacheableKey::create("javaPdxHC");
+ std::shared_ptr<CacheableKey> javaPdxHCKey = CacheableKey::create("javaPdxHC");
auto pIPtr2 = std::dynamic_pointer_cast<Cacheable>(rptr->get(javaPdxHCKey));
LOG("javaPdxHCKey get done");
CacheableInt32* val = dynamic_cast<CacheableInt32*>(pIPtr2.get());
@@ -407,14 +417,14 @@ DUNIT_TASK_DEFINITION(CLIENT2, verifyCacheableObjectArrayWithPdxField)
LOG("verifyCacheableObjectArrayWithPdxField started ");
try {
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
serializationRegistry->addPdxType(Address::createDeserializable);
LOG("Address Registered Successfully....");
} catch (apache::geode::client::IllegalStateException& /* ex*/) {
LOG("Address IllegalStateException");
}
- RegionPtr rptr = getHelper()->getRegion(regionNames[0]);
+ auto rptr = getHelper()->getRegion(regionNames[0]);
auto objectArrayPtr = std::dynamic_pointer_cast<CacheableObjectArray>(
rptr->get(CacheableInt32::create(100)));
@@ -424,7 +434,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, verifyCacheableObjectArrayWithPdxField)
auto pi = std::dynamic_pointer_cast<PdxInstance>(objectArrayPtr->at(i));
LOG("PdxInstancePtr obtained from CacheableObjectArray");
- PdxInstanceFactoryPtr pifPtr =
+ auto pifPtr =
cacheHelper->getCache()->createPdxInstanceFactory("PdxTests.Address");
LOG("PdxInstanceFactoryPtr created for PdxTests.Address....");
@@ -443,7 +453,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, verifyCacheableObjectArrayWithPdxField)
ASSERT(addrPtr.get()->equals(*(newAddrPtr.get())) == true,
"Both PdxInstances should be equal.");
- PdxInstancePtr retPtr = pifPtr->create();
+ auto retPtr = pifPtr->create();
LOG("PdxInstancePtr created....");
bool ret = false;
@@ -460,7 +470,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, putPdxWithNullIdentityFields)
{
LOG("putPdxWithNullIdentityFields started ");
- RegionPtr rptr = getHelper()->getRegion(regionNames[0]);
+ auto rptr = getHelper()->getRegion(regionNames[0]);
// Creating object of type PdxObject
auto sp = std::make_shared<SerializePdx>(false);
@@ -476,13 +486,13 @@ DUNIT_TASK_DEFINITION(CLIENT2, verifyPdxNullIdentityFieldHC)
{
LOG("verifyPdxNullIdentityFieldHC started ");
- RegionPtr rptr = getHelper()->getRegion(regionNames[0]);
+ auto rptr = getHelper()->getRegion(regionNames[0]);
auto pi = std::dynamic_pointer_cast<PdxInstance>(
rptr->get(CacheableInt32::create(2)));
LOG("PdxInstancePtr get complete");
- CacheableKeyPtr javaPdxHCKey = CacheableKey::create("javaPdxHC");
+ std::shared_ptr<CacheableKey> javaPdxHCKey = CacheableKey::create("javaPdxHC");
auto pIPtr2 = std::dynamic_pointer_cast<Cacheable>(rptr->get(javaPdxHCKey));
LOG("javaPdxHCKey get done");
CacheableInt32* val = dynamic_cast<CacheableInt32*>(pIPtr2.get());
@@ -505,7 +515,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, verifyPdxNullIdentityFieldHC)
LOGINFO("PdxObject ret = %d ", ret);
ASSERT(ret == true, "Both PdxInstances should be equal.");
- VectorOfCacheableKey keys1;
+ std::vector<std::shared_ptr<CacheableKey>> keys1;
keys1.push_back(CacheableInt32::create(1));
keys1.push_back(CacheableInt32::create(2));
@@ -521,9 +531,10 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, pdxPut)
{
LOG("pdxPut started ");
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
try {
- serializationRegistry->addPdxType(PdxTests::PdxType::createDeserializable);
+ serializationRegistry->addPdxType(
+ PdxTests::PdxType::createDeserializable);
LOG("PdxObject Registered Successfully....");
} catch (apache::geode::client::IllegalStateException& /* ex*/) {
LOG("PdxObject IllegalStateException");
@@ -532,9 +543,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, pdxPut)
// Creating object of type PdxObject
auto pdxobj = std::make_shared<PdxTests::PdxType>();
- CacheableKeyPtr keyport = CacheableKey::create("pdxput");
- CacheableKeyPtr keyport1 = CacheableKey::create("pdxput2");
- RegionPtr rptr = getHelper()->getRegion(regionNames[0]);
+ auto keyport = CacheableKey::create("pdxput");
+ auto keyport1 = CacheableKey::create("pdxput2");
+ auto rptr = getHelper()->getRegion(regionNames[0]);
// PUT Operation
rptr->put(keyport, pdxobj);
@@ -573,12 +584,12 @@ DUNIT_TASK_DEFINITION(CLIENT1, pdxPut)
.getPdxInstanceDeserializationTime() > 0,
"pdxInstanceDeserializationTime should be greater than 0.");
- CacheableStringPtr toString = pIPtr1->toString();
+ auto toString = pIPtr1->toString();
LOGINFO("pdxinstance toString = %s ", toString->asChar());
int pdxInstHashcode = pIPtr1->hashcode();
LOGINFO("pdxinstance hash code = %d ", pdxInstHashcode);
- CacheableKeyPtr javaPdxHCKey = CacheableKey::create("javaPdxHC");
+ auto javaPdxHCKey = CacheableKey::create("javaPdxHC");
auto pIPtr2 = std::dynamic_pointer_cast<Cacheable>(rptr->get(javaPdxHCKey));
LOG("In verifyPdxInstanceHashcode get done");
CacheableInt32* val = dynamic_cast<CacheableInt32*>(pIPtr2.get());
@@ -604,7 +615,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, getObject)
{
LOG("getObject started ");
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
try {
serializationRegistry->addPdxType(PdxTests::PdxType::createDeserializable);
LOG("PdxObject Registered Successfully....");
@@ -626,9 +637,9 @@ DUNIT_TASK_DEFINITION(CLIENT2, getObject)
LOG("ParentPdx IllegalStateException");
}
- CacheableKeyPtr keyport = CacheableKey::create("pdxput");
- CacheableKeyPtr keyport1 = CacheableKey::create("pdxput2");
- RegionPtr rptr = getHelper()->getRegion(regionNames[0]);
+ auto keyport = CacheableKey::create("pdxput");
+ auto keyport1 = CacheableKey::create("pdxput2");
+ auto rptr = getHelper()->getRegion(regionNames[0]);
auto pIPtr = std::dynamic_pointer_cast<PdxInstance>(rptr->get(keyport));
LOG("PdxObject get Successful....");
@@ -637,7 +648,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, getObject)
ASSERT(strcmp(pIPtr->getClassName(), "PdxTests.PdxType") == 0,
"pdxInstance.getClassName should return PdxTests.PdxType.");
- PdxSerializablePtr pt = pIPtr->getObject();
+ auto pt = pIPtr->getObject();
LOG("PdxObject getObject Successful....");
@@ -684,7 +695,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, getObject)
auto pIPtr1 = std::dynamic_pointer_cast<PdxInstance>(rptr->get(keyport1));
LOG("ParentPdxObject get Successful....");
- CacheableStringPtr toString = pIPtr1->toString();
+ auto toString = pIPtr1->toString();
LOGINFO("ParentPdxObject toString = %s ", toString->asChar());
auto pt1 = std::dynamic_pointer_cast<ParentPdx>(pIPtr1->getObject());
LOG("ParentPdxObject getObject Successful....");
@@ -736,16 +747,16 @@ DUNIT_TASK_DEFINITION(CLIENT2, verifyPdxInstanceEquals)
LOG("Task verifyPdxInstanceEquals started.");
try {
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
serializationRegistry->addPdxType(PdxTests::PdxType::createDeserializable);
LOG("PdxObject Registered Successfully....");
} catch (apache::geode::client::IllegalStateException& /* ex*/) {
LOG("PdxObject IllegalStateException");
}
- CacheableKeyPtr keyport = CacheableKey::create("pdxput");
- CacheableKeyPtr keyport1 = CacheableKey::create("pdxput2");
- RegionPtr rptr = getHelper()->getRegion(regionNames[0]);
+ auto keyport = CacheableKey::create("pdxput");
+ auto keyport1 = CacheableKey::create("pdxput2");
+ auto rptr = getHelper()->getRegion(regionNames[0]);
auto pIPtr1 = std::dynamic_pointer_cast<PdxInstance>(rptr->get(keyport));
LOG("get1 Successfully....");
@@ -775,9 +786,9 @@ DUNIT_TASK_DEFINITION(CLIENT2, verifyPdxInstanceHashcode)
{
LOG("verifyPdxInstanceHashcode started ");
- RegionPtr rptr = getHelper()->getRegion(regionNames[0]);
- CacheableKeyPtr keyport1 = CacheableKey::create("javaPdxHC");
- CacheableKeyPtr keyport2 = CacheableKey::create("pdxput2");
+ auto rptr = getHelper()->getRegion(regionNames[0]);
+ auto keyport1 = CacheableKey::create("javaPdxHC");
+ auto keyport2 = CacheableKey::create("pdxput2");
auto pIPtr1 = std::dynamic_pointer_cast<PdxInstance>(rptr->get(keyport2));
int pdxInstHashcode = pIPtr1->hashcode();
LOGINFO("pdxinstance hash code = %d ", pdxInstHashcode);
@@ -799,7 +810,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, accessPdxInstance)
{
LOG("accessPdxInstance started ");
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
try {
serializationRegistry->addPdxType(PdxTests::PdxType::createDeserializable);
LOG("PdxObject Registered Successfully....");
@@ -814,9 +825,9 @@ DUNIT_TASK_DEFINITION(CLIENT2, accessPdxInstance)
LOG("Address IllegalStateException");
}
- CacheableKeyPtr keyport = CacheableKey::create("pdxput");
- CacheableKeyPtr keyport1 = CacheableKey::create("pdxput2");
- RegionPtr rptr = getHelper()->getRegion(regionNames[0]);
+ auto keyport = CacheableKey::create("pdxput");
+ auto keyport1 = CacheableKey::create("pdxput2");
+ auto rptr = getHelper()->getRegion(regionNames[0]);
auto pIPtr = std::dynamic_pointer_cast<PdxInstance>(rptr->get(keyport));
LOGINFO("PdxInstancePtr created ");
@@ -1035,7 +1046,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, accessPdxInstance)
ASSERT(pIPtr->getFieldType("m_floatArray") == PdxFieldTypes::FLOAT_ARRAY,
"Type Value FLOAT_ARRAY Mismatch");
- CacheablePtr object = pIPtr->getCacheableField("m_pdxEnum");
+ auto object = pIPtr->getCacheableField("m_pdxEnum");
ASSERT(object != nullptr, "enumObject should not be nullptr");
auto enumObject = std::dynamic_pointer_cast<CacheableEnum>(object);
ASSERT(
@@ -1050,14 +1061,14 @@ DUNIT_TASK_DEFINITION(CLIENT2, accessPdxInstance)
ASSERT(pIPtr->getFieldType("m_pdxEnum") == PdxFieldTypes::OBJECT,
"Type Value OBJECT Mismatch");
- CacheableDatePtr dateObject = pIPtr->getCacheableDateField("m_dateTime");
+ auto dateObject = pIPtr->getCacheableDateField("m_dateTime");
ASSERT(dateObject != nullptr, "date should not be nullptr");
ASSERT((*(dateObject.get()) == *(pdxobjPtr->getDate().get())) == true,
"dateObject should be equal");
ASSERT(pIPtr->getFieldType("m_dateTime") == PdxFieldTypes::DATE,
"Type Value DATE Mismatch");
- CacheablePtr object2 = pIPtr->getCacheableField("m_map");
+ auto object2 = pIPtr->getCacheableField("m_map");
ASSERT(object2 != nullptr, "object2 should not be nullptr");
auto mapObject = std::dynamic_pointer_cast<CacheableHashMap>(object2);
ASSERT(genericValCompare(pdxobjPtr->getHashMap()->size(),
@@ -1139,7 +1150,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, accessPdxInstance)
auto pi = std::dynamic_pointer_cast<PdxInstance>(objectArray->at(i));
LOG("PdxInstancePtr obtained from CacheableObjectArray");
- PdxInstanceFactoryPtr pifPtr =
+ auto pifPtr =
cacheHelper->getCache()->createPdxInstanceFactory("PdxTests.Address");
LOG("PdxInstanceFactoryPtr created for PdxTests.Address....");
@@ -1158,7 +1169,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, accessPdxInstance)
ASSERT(addrPtr.get()->equals(*(newAddrPtr.get())) == true,
"Both PdxInstances should be equal.");
- PdxInstancePtr retPtr = pifPtr->create();
+ auto retPtr = pifPtr->create();
LOG("PdxInstancePtr created....");
bool ret = false;
@@ -1170,7 +1181,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, accessPdxInstance)
pIPtr = std::dynamic_pointer_cast<PdxInstance>(rptr->get(keyport1));
LOGINFO("PdxInstancePtr for ParentPdx object got ");
- CacheablePtr childObjPtr = pIPtr->getCacheableField("m_childPdx");
+ auto childObjPtr = pIPtr->getCacheableField("m_childPdx");
ASSERT(childObjPtr != nullptr, "childObjPtr should not be nullptr");
LOGINFO("got childPdx field ");
auto cpi = std::dynamic_pointer_cast<PdxInstance>(childObjPtr);
@@ -1189,14 +1200,14 @@ DUNIT_TASK_DEFINITION(CLIENT2, modifyPdxInstance)
{
LOG("modifyPdxInstance started ");
- RegionPtr rptr = getHelper()->getRegion(regionNames[0]);
- CacheableKeyPtr keyport = CacheableKey::create("pdxput");
- CacheableKeyPtr keyport1 = CacheableKey::create("pdxput2");
+ auto rptr = getHelper()->getRegion(regionNames[0]);
+ auto keyport = CacheableKey::create("pdxput");
+ auto keyport1 = CacheableKey::create("pdxput2");
auto pIPtr = std::dynamic_pointer_cast<PdxInstance>(rptr->get(keyport));
LOG("modifyPdxInstance get complete.");
- WritablePdxInstancePtr wpiPtr(pIPtr->createWriter());
+ std::shared_ptr<WritablePdxInstance> wpiPtr(pIPtr->createWriter());
ASSERT(pIPtr != nullptr, "pIPtr != nullptr expected");
int val = 0;
@@ -1617,12 +1628,12 @@ DUNIT_TASK_DEFINITION(CLIENT2, modifyPdxInstance)
ASSERT((*pIPtr.get() == *newPiPtr.get()) == false,
"PdxInstance should not be equal");
- CacheableDatePtr dateVal;
+ std::shared_ptr<CacheableDate> dateVal;
wpiPtr = pIPtr->createWriter();
time_t timeofday = 0;
const ACE_Time_Value currentTime = ACE_OS::gettimeofday();
timeofday = currentTime.sec();
- CacheableDatePtr datePtr = CacheableDate::create(timeofday);
+ auto datePtr = CacheableDate::create(timeofday);
wpiPtr->setField("m_dateTime", datePtr);
rptr->put(keyport, wpiPtr);
newPiPtr = std::dynamic_pointer_cast<PdxInstance>(rptr->get(keyport));
@@ -1646,12 +1657,12 @@ DUNIT_TASK_DEFINITION(CLIENT2, modifyPdxInstance)
"IllegalStateException");
}
- CacheablePtr object;
+ std::shared_ptr<Cacheable> object;
wpiPtr = pIPtr->createWriter();
- CacheableVectorPtr setVec = CacheableVector::create();
+ auto setVec = CacheableVector::create();
setVec->push_back(CacheableInt32::create(3));
setVec->push_back(CacheableInt32::create(4));
- wpiPtr->setField("m_vector", (CacheablePtr)setVec);
+ wpiPtr->setField("m_vector", (std::shared_ptr<Cacheable>)setVec);
rptr->put(keyport, wpiPtr);
newPiPtr = std::dynamic_pointer_cast<PdxInstance>(rptr->get(keyport));
ASSERT(newPiPtr->hasField("m_vector") == true, "m_vector = true expected");
@@ -1676,11 +1687,11 @@ DUNIT_TASK_DEFINITION(CLIENT2, modifyPdxInstance)
}
wpiPtr = pIPtr->createWriter();
- CacheableArrayListPtr setarr = CacheableArrayList::create();
+ auto setarr = CacheableArrayList::create();
setarr->push_back(CacheableInt32::create(3));
setarr->push_back(CacheableInt32::create(4));
setarr->push_back(CacheableInt32::create(5));
- wpiPtr->setField("m_arraylist", (CacheablePtr)setarr);
+ wpiPtr->setField("m_arraylist", (std::shared_ptr<Cacheable>)setarr);
rptr->put(keyport, wpiPtr);
newPiPtr = std::dynamic_pointer_cast<PdxInstance>(rptr->get(keyport));
ASSERT(newPiPtr->hasField("m_arraylist") == true,
@@ -1707,11 +1718,11 @@ DUNIT_TASK_DEFINITION(CLIENT2, modifyPdxInstance)
}
wpiPtr = pIPtr->createWriter();
- CacheableHashSetPtr hashset = CacheableHashSet::create();
+ auto hashset = CacheableHashSet::create();
hashset->insert(CacheableInt32::create(3));
hashset->insert(CacheableInt32::create(4));
hashset->insert(CacheableInt32::create(5));
- wpiPtr->setField("m_chs", (CacheablePtr)hashset);
+ wpiPtr->setField("m_chs", (std::shared_ptr<Cacheable>)hashset);
rptr->put(keyport, wpiPtr);
newPiPtr = std::dynamic_pointer_cast<PdxInstance>(rptr->get(keyport));
ASSERT(newPiPtr->hasField("m_chs") == true, "m_chs = true expected");
@@ -1733,11 +1744,11 @@ DUNIT_TASK_DEFINITION(CLIENT2, modifyPdxInstance)
}
wpiPtr = pIPtr->createWriter();
- CacheableHashMapPtr hashmap = CacheableHashMap::create();
+ auto hashmap = CacheableHashMap::create();
hashmap->emplace(CacheableInt32::create(3), CacheableInt32::create(3));
hashmap->emplace(CacheableInt32::create(4), CacheableInt32::create(4));
hashmap->emplace(CacheableInt32::create(5), CacheableInt32::create(5));
- wpiPtr->setField("m_map", (CacheablePtr)hashmap);
+ wpiPtr->setField("m_map", (std::shared_ptr<Cacheable>)hashmap);
rptr->put(keyport, wpiPtr);
newPiPtr = std::dynamic_pointer_cast<PdxInstance>(rptr->get(keyport));
ASSERT(newPiPtr->hasField("m_map") == true, "m_map = true expected");
@@ -1759,11 +1770,11 @@ DUNIT_TASK_DEFINITION(CLIENT2, modifyPdxInstance)
}
wpiPtr = pIPtr->createWriter();
- CacheableLinkedHashSetPtr linkedhashset = CacheableLinkedHashSet::create();
+ auto linkedhashset = CacheableLinkedHashSet::create();
linkedhashset->insert(CacheableInt32::create(3));
linkedhashset->insert(CacheableInt32::create(4));
linkedhashset->insert(CacheableInt32::create(5));
- wpiPtr->setField("m_clhs", (CacheablePtr)linkedhashset);
+ wpiPtr->setField("m_clhs", (std::shared_ptr<Cacheable>)linkedhashset);
rptr->put(keyport, wpiPtr);
newPiPtr = std::dynamic_pointer_cast<PdxInstance>(rptr->get(keyport));
ASSERT(newPiPtr->hasField("m_clhs") == true, "m_clhs = true expected");
@@ -1829,7 +1840,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, modifyPdxInstance)
wpiPtr = pIPtr->createWriter();
try {
- wpiPtr->setField("m_byteByteArray", (CacheablePtr)linkedhashset);
+ wpiPtr->setField("m_byteByteArray", (std::shared_ptr<Cacheable>)linkedhashset);
FAIL(
"setField on m_byteByteArray with linkedhashset value should throw "
"expected IllegalStateException");
@@ -1909,7 +1920,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, modifyPdxInstance)
pIPtr = std::dynamic_pointer_cast<PdxInstance>(rptr->get(keyport1));
LOGINFO("PdxInstancePtr for ParentPdx object got ");
- CacheablePtr childObjPtr = pIPtr->getCacheableField("m_childPdx");
+ auto childObjPtr = pIPtr->getCacheableField("m_childPdx");
ASSERT(childObjPtr != nullptr, "childObjPtr should not be nullptr");
LOGINFO("got childPdx field ");
auto cpi = std::dynamic_pointer_cast<PdxInstance>(childObjPtr);
@@ -1917,7 +1928,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, modifyPdxInstance)
wpiPtr = pIPtr->createWriter();
auto childpdxobjPtr = std::make_shared<ChildPdx>(2);
LOGINFO("created new childPdx");
- wpiPtr->setField("m_childPdx", (CacheablePtr)childpdxobjPtr);
+ wpiPtr->setField("m_childPdx", (std::shared_ptr<Cacheable>)childpdxobjPtr);
LOGINFO("childPdx seField done");
rptr->put(keyport1, wpiPtr);
newPiPtr = std::dynamic_pointer_cast<PdxInstance>(rptr->get(keyport1));
@@ -1978,8 +1989,8 @@ DUNIT_TASK_DEFINITION(CLIENT2, modifyPdxInstanceAndCheckLocally)
{
LOG("modifyPdxInstanceAndCheckLocally started ");
- RegionPtr rptr = getHelper()->getRegion(regionNames[0]);
- CacheableKeyPtr keyport = CacheableKey::create("pdxput");
+ auto rptr = getHelper()->getRegion(regionNames[0]);
+ auto keyport = CacheableKey::create("pdxput");
auto pIPtr = std::dynamic_pointer_cast<PdxInstance>(rptr->get(keyport));
LOG("modifyPdxInstanceAndCheckLocally get complete.");
@@ -2015,7 +2026,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, modifyPdxInstanceAndCheckLocally)
.getPdxInstanceDeserializationTime() > 0,
"pdxInstanceDeserializationTime should be greater than 0.");
- WritablePdxInstancePtr wpiPtr(pIPtr->createWriter());
+ std::shared_ptr<WritablePdxInstance> wpiPtr(pIPtr->createWriter());
ASSERT(pIPtr != nullptr, "pIPtr != nullptr expected");
int val = 0;
@@ -2274,12 +2285,12 @@ DUNIT_TASK_DEFINITION(CLIENT2, modifyPdxInstanceAndCheckLocally)
ASSERT((*pIPtr.get() == *newPiPtr.get()) == false,
"PdxInstance should not be equal");
- CacheableDatePtr dateVal;
+ std::shared_ptr<CacheableDate> dateVal;
wpiPtr = pIPtr->createWriter();
time_t timeofday = 0;
const ACE_Time_Value currentTime = ACE_OS::gettimeofday();
timeofday = currentTime.sec();
- CacheableDatePtr datePtr = CacheableDate::create(timeofday);
+ auto datePtr = CacheableDate::create(timeofday);
wpiPtr->setField("m_dateTime", datePtr);
rptr->put(keyport, wpiPtr);
newPiPtr = std::dynamic_pointer_cast<PdxInstance>(rptr->get(keyport));
@@ -2326,7 +2337,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, pdxIFPutGetTest)
{
LOG("pdxIFPutGetTest started ");
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
try {
serializationRegistry->addPdxType(Address::createDeserializable);
LOG("Address Registered Successfully....");
@@ -2355,11 +2366,11 @@ DUNIT_TASK_DEFINITION(CLIENT1, pdxIFPutGetTest)
LOG("ParentPdx IllegalStateException");
}
- RegionPtr rptr = getHelper()->getRegion(regionNames[0]);
+ auto rptr = getHelper()->getRegion(regionNames[0]);
auto pdxobj = std::make_shared<PdxTests::PdxType>();
- PdxInstanceFactoryPtr pifPtr =
+ auto pifPtr =
cacheHelper->getCache()->createPdxInstanceFactory("PdxTests.PdxType");
LOG("PdxInstanceFactoryPtr created....");
@@ -2465,14 +2476,14 @@ DUNIT_TASK_DEFINITION(CLIENT1, pdxIFPutGetTest)
pifPtr->writeObjectArray(
"", pdxobj->getCacheableObjectArrayEmptyPdxFieldName());
- PdxInstancePtr ret = pifPtr->create();
+ std::shared_ptr<PdxInstance> ret = pifPtr->create();
LOG("PdxInstancePtr created....");
LOGINFO("PdxInstance getClassName = %s ", ret->getClassName());
ASSERT(strcmp(ret->getClassName(), "PdxTests.PdxType") == 0,
"pdxInstance.getClassName should return PdxTests.PdxType.");
- PdxSerializablePtr psPtr = ret->getObject();
+ auto psPtr = ret->getObject();
LOG("getObject created....");
LOG("Statistics for for (PdxTests.PdxType) PdxInstance ");
@@ -2513,7 +2524,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, pdxIFPutGetTest)
ASSERT(obj1->equals(*obj2, false) == true, "PdxObjects should be equal.");
LOGINFO("Avinash Equal Finish");
- CacheableKeyPtr key = CacheableKey::create("pi");
+ auto key = CacheableKey::create("pi");
rptr->put(key, ret);
LOG("put done....");
@@ -2555,7 +2566,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, pdxIFPutGetTest)
int pdxInstHashcode = ret->hashcode();
LOGINFO("pdxinstance hash code = %d ", pdxInstHashcode);
- CacheableKeyPtr javaPdxHCKey = CacheableKey::create("javaPdxHC");
+ auto javaPdxHCKey = CacheableKey::create("javaPdxHC");
auto pIPtr2 = std::dynamic_pointer_cast<Cacheable>(rptr->get(javaPdxHCKey));
LOG("In pdxIFPutGetTest get done");
CacheableInt32* val = dynamic_cast<CacheableInt32*>(pIPtr2.get());
@@ -2567,7 +2578,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, pdxIFPutGetTest)
"Pdxhashcode hashcode not matched with java pdx hash code.");
auto pp = std::make_shared<ParentPdx>(10);
- PdxInstanceFactoryPtr if2 =
+ auto if2 =
cacheHelper->getCache()->createPdxInstanceFactory(
"testobject::ParentPdx");
if2->writeInt("m_parentId", pp->getParentId());
@@ -2583,14 +2594,14 @@ DUNIT_TASK_DEFINITION(CLIENT1, pdxIFPutGetTest)
if2->writeWideCharArray("m_wideCharArray", pp->getWideCharArray(), 2);
LOG("write set done....");
- PdxInstancePtr ip2 = if2->create();
+ std::shared_ptr<PdxInstance> ip2 = if2->create();
LOG("PdxInstancePtr created");
LOGINFO("PdxInstance getClassName = %s ", ip2->getClassName());
ASSERT(strcmp(ip2->getClassName(), "testobject::ParentPdx") == 0,
"pdxInstance.getClassName should return testobject::ParentPdx.");
- CacheableKeyPtr keyport = CacheableKey::create("pp");
+ auto keyport = CacheableKey::create("pp");
rptr->put(keyport, ip2);
LOG("put done....");
@@ -2629,7 +2640,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, pdxIFPutGetTest)
"pdxInstanceDeserializationTime should be greater than 0.");
auto pp1 = std::dynamic_pointer_cast<ParentPdx>(newPiPtr);
- LOG("got ParentPdxPtr....");
+ LOG("got std::shared_ptr<ParentPdx>....");
ParentPdx* rawPP1 = dynamic_cast<ParentPdx*>(pp1.get());
LOG("got rawPP1....");
@@ -2647,16 +2658,16 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, pdxInstanceWithEmptyKeys)
{
LOG("pdxInstanceWithEmptyKeys started ");
- RegionPtr rptr = getHelper()->getRegion(regionNames[0]);
- PdxInstanceFactoryPtr pifPtr =
+ auto rptr = getHelper()->getRegion(regionNames[0]);
+ auto pifPtr =
cacheHelper->getCache()->createPdxInstanceFactory("EMPTY_KEY_NAME");
LOG("PdxInstanceFactoryPtr created....");
bool falseValue = false;
pifPtr->writeBoolean("", falseValue);
- PdxInstancePtr putValue = pifPtr->create();
+ std::shared_ptr<PdxInstance> putValue = pifPtr->create();
- CacheableKeyPtr key = CacheableKey::create("pp");
+ auto key = CacheableKey::create("pp");
rptr->put(key, putValue);
LOG("put done with boolean Value and Empty Key....");
diff --git a/cppcache/integration-test/testThinClientPdxTests.cpp b/cppcache/integration-test/testThinClientPdxTests.cpp
index ca7621f..953b074 100644
--- a/cppcache/integration-test/testThinClientPdxTests.cpp
+++ b/cppcache/integration-test/testThinClientPdxTests.cpp
@@ -28,12 +28,16 @@
runPdxTests(true, false);
}
END_MAIN*/
+#include <string>
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
+
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
-#include <string>
+
+#include <geode/PdxInstance.hpp>
+#include <geode/UserFunctionExecutionException.hpp>
+#include <geode/FunctionService.hpp>
#define ROOT_NAME "testThinClientPdxTests"
#define ROOT_SCOPE DISTRIBUTED_ACK
@@ -81,7 +85,7 @@ bool genericValCompare(T1 value1, T2 value2) /*const*/
}
void initClient(const bool isthinClient, bool isPdxIgnoreUnreadFields,
- const PropertiesPtr& configPtr = nullptr) {
+ const std::shared_ptr<Properties>& configPtr = nullptr) {
LOGINFO("isPdxIgnoreUnreadFields = %d ", isPdxIgnoreUnreadFields);
if (cacheHelper == nullptr) {
cacheHelper = new CacheHelper(isthinClient, isPdxIgnoreUnreadFields, false,
@@ -94,7 +98,7 @@ void initClient(const bool isthinClient, bool isPdxIgnoreUnreadFields,
void initClientN(const bool isthinClient, bool isPdxIgnoreUnreadFields,
bool isPdxReadSerialized = false,
- const PropertiesPtr& configPtr = nullptr) {
+ const std::shared_ptr<Properties>& configPtr = nullptr) {
LOGINFO("isPdxIgnoreUnreadFields = %d ", isPdxIgnoreUnreadFields);
if (cacheHelper == nullptr) {
cacheHelper = new CacheHelper(isthinClient, isPdxIgnoreUnreadFields,
@@ -105,7 +109,7 @@ void initClientN(const bool isthinClient, bool isPdxIgnoreUnreadFields,
void stepOneN(bool isPdxIgnoreUnreadFields = false,
bool isPdxReadSerialized = false,
- PropertiesPtr config = nullptr) {
+ std::shared_ptr<Properties> config = nullptr) {
try {
// serializationRegistry->addType(Position::createDeserializable);
// serializationRegistry->addType(Portfolio::createDeserializable);
@@ -138,10 +142,11 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepTwoPoolLoc1)
END_TASK_DEFINITION
///////////////
-void initClient1WithClientName(const bool isthinClient,
- const PropertiesPtr& configPtr = nullptr) {
+void initClient1WithClientName(
+ const bool isthinClient,
+ const std::shared_ptr<Properties>& configPtr = nullptr) {
if (cacheHelper == nullptr) {
- PropertiesPtr config = configPtr;
+ auto config = configPtr;
if (config == nullptr) {
config = Properties::create();
}
@@ -151,10 +156,11 @@ void initClient1WithClientName(const bool isthinClient,
ASSERT(cacheHelper, "Failed to create a CacheHelper client instance.");
}
-void initClient2WithClientName(const bool isthinClient,
- const PropertiesPtr& configPtr = nullptr) {
+void initClient2WithClientName(
+ const bool isthinClient,
+ const std::shared_ptr<Properties>& configPtr = nullptr) {
if (cacheHelper == nullptr) {
- PropertiesPtr config = configPtr;
+ auto config = configPtr;
if (config == nullptr) {
config = Properties::create();
}
@@ -186,7 +192,7 @@ void stepOneForClient2(bool isPdxIgnoreUnreadFields = false) {
LOG("StepOne complete.");
}
void stepOne(bool isPdxIgnoreUnreadFields = false,
- PropertiesPtr config = nullptr) {
+ std::shared_ptr<Properties> config = nullptr) {
try {
// serializationRegistry->addType(Position::createDeserializable);
// serializationRegistry->addType(Portfolio::createDeserializable);
@@ -261,7 +267,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepOnePoolLocSysConfig)
{
LOG("Starting Step One with Pool + Locator lists");
- PropertiesPtr config = Properties::create();
+ auto config = Properties::create();
config->insert("on-client-disconnect-clear-pdxType-Ids", "true");
stepOne(false, config);
}
@@ -270,7 +276,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, StepTwoPoolLocSysConfig)
{
LOG("Starting Step One with Pool + Locator lists");
- PropertiesPtr config = Properties::create();
+ auto config = Properties::create();
config->insert("on-client-disconnect-clear-pdxType-Ids", "true");
stepOne(false, config);
}
@@ -383,8 +389,8 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepTwoPoolLoc_PDX)
}
END_TASK_DEFINITION
-void checkPdxInstanceToStringAtServer(RegionPtr regionPtr) {
- CacheableKeyPtr keyport = CacheableKey::create("success");
+void checkPdxInstanceToStringAtServer(std::shared_ptr<Region> regionPtr) {
+ auto keyport = CacheableKey::create("success");
auto boolPtr =
std::dynamic_pointer_cast<CacheableBoolean>(regionPtr->get(keyport));
bool val = boolPtr->value();
@@ -396,7 +402,9 @@ void checkPdxInstanceToStringAtServer(RegionPtr regionPtr) {
// testPdxWriterAPIsWithInvalidArgs
DUNIT_TASK_DEFINITION(CLIENT1, testPdxWriterAPIsWithInvalidArgs)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
serializationRegistry->addPdxType(InvalidPdxUsage::createDeserializable);
} catch (const IllegalStateException&) {
@@ -410,11 +418,11 @@ DUNIT_TASK_DEFINITION(CLIENT1, testPdxWriterAPIsWithInvalidArgs)
// ignore exception
}
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
int expectedExceptionCount = 0;
// Put operation
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto pdxobj = std::make_shared<PdxTests::InvalidPdxUsage>();
regPtr0->put(keyport, pdxobj);
@@ -430,9 +438,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, testPdxWriterAPIsWithInvalidArgs)
"toDataExceptionCount");
// Get Operation and check fromDataExceptionCount, Expected is 41.
- PdxTests::InvalidPdxUsagePtr obj2 =
- std::dynamic_pointer_cast<PdxTests::InvalidPdxUsage>(
- regPtr0->get(keyport));
+ auto obj2 = std::dynamic_pointer_cast<PdxTests::InvalidPdxUsage>(
+ regPtr0->get(keyport));
// LOGINFO("TASK::testPdxWriterAPIsWithInvalidArgs:: fromData ExceptionCOunt
// :: %d ", obj2->getfromDataExceptionCount());
expectedExceptionCount = obj2->getfromDataExceptionCount();
@@ -446,7 +453,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, testPdxReaderAPIsWithInvalidArgs)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
serializationRegistry->addPdxType(InvalidPdxUsage::createDeserializable);
} catch (const IllegalStateException&) {
@@ -459,13 +468,12 @@ DUNIT_TASK_DEFINITION(CLIENT2, testPdxReaderAPIsWithInvalidArgs)
// ignore exception
}
int expectedExceptionCount = 0;
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
// Get Operation. Check fromDataExceptionCount. Expected is 41.
- CacheableKeyPtr keyport1 = CacheableKey::create(1);
- PdxTests::InvalidPdxUsagePtr obj1 =
- std::dynamic_pointer_cast<PdxTests::InvalidPdxUsage>(
- regPtr0->get(keyport1));
+ auto keyport1 = CacheableKey::create(1);
+ auto obj1 = std::dynamic_pointer_cast<PdxTests::InvalidPdxUsage>(
+ regPtr0->get(keyport1));
// Check the exception count:: expected is 41.
// LOGINFO("TASK::testPdxReaderAPIsWithInvalidArgs:: fromDataExceptionCount
@@ -482,7 +490,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, testPutWithMultilevelInheritance)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
serializationRegistry->addPdxType(PdxTests::Child::createDeserializable);
@@ -490,17 +500,17 @@ DUNIT_TASK_DEFINITION(CLIENT1, testPutWithMultilevelInheritance)
// ignore exception
}
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
int expectedExceptionCount ATTR_UNUSED = 0;
// Put operation
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto pdxobj = std::make_shared<PdxTests::Child>();
regPtr0->put(keyport, pdxobj);
LOGINFO("TASK::testPutWithMultilevelInheritance:: Put successful");
// Get Operation and check fromDataExceptionCount, Expected is 41.
- PdxTests::ChildPtr obj2 =
+ auto obj2 =
std::dynamic_pointer_cast<PdxTests::Child>(regPtr0->get(keyport));
// LOGINFO("Task: testPutWithMultilevelInheritance: got members :: %d %d %d
// %d
@@ -517,7 +527,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, testGetWithMultilevelInheritance)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
serializationRegistry->addPdxType(PdxTests::Child::createDeserializable);
@@ -525,10 +537,10 @@ DUNIT_TASK_DEFINITION(CLIENT2, testGetWithMultilevelInheritance)
// ignore exception
}
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheableKeyPtr keyport1 = CacheableKey::create(1);
- PdxTests::ChildPtr obj1 =
+ auto keyport1 = CacheableKey::create(1);
+ auto obj1 =
std::dynamic_pointer_cast<PdxTests::Child>(regPtr0->get(keyport1));
auto pdxobj = std::make_shared<PdxTests::Child>();
@@ -549,10 +561,10 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, JavaPutGet1)
{
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheableKeyPtr keyport = CacheableKey::create(1);
- CacheableInt32Ptr valPtr = CacheableInt32::create(123);
+ auto keyport = CacheableKey::create(1);
+ auto valPtr = CacheableInt32::create(123);
regPtr0->put(keyport, valPtr);
auto getVal =
@@ -569,7 +581,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, JavaPutGet1)
cacheHelper->getCache()->getPdxReadSerialized());
auto jsonDoc =
std::dynamic_pointer_cast<PdxInstance>(regPtr0->get("jsondoc1"));
- CacheableStringPtr toString = jsonDoc->toString();
+ auto toString = jsonDoc->toString();
LOGINFO("Task:JavaPutGet: Result = %s ", toString->asChar());
/*
int16_t age = 0;
@@ -582,11 +594,11 @@ DUNIT_TASK_DEFINITION(CLIENT1, JavaPutGet1)
jsonDoc->getField("lastName", &stringVal1);
*/
- CacheablePtr object2 = jsonDoc->getCacheableField("kids");
+ auto object2 = jsonDoc->getCacheableField("kids");
auto listPtr = std::dynamic_pointer_cast<CacheableLinkedList>(object2);
LOGINFO("Task:JavaPutGet: list size = %d", listPtr->size());
- CacheableLinkedListPtr m_linkedlist = CacheableLinkedList::create();
+ auto m_linkedlist = CacheableLinkedList::create();
m_linkedlist->push_back(CacheableString::create("Manan"));
m_linkedlist->push_back(CacheableString::create("Nishka"));
@@ -604,10 +616,13 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, JavaPutGet)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
- serializationRegistry->addPdxType(PdxTests::PdxType::createDeserializable);
+ serializationRegistry->addPdxType(
+ PdxTests::PdxType::createDeserializable);
} catch (const IllegalStateException&) {
// ignore exception
}
@@ -618,13 +633,13 @@ DUNIT_TASK_DEFINITION(CLIENT1, JavaPutGet)
// ignore exception
}
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto pdxobj = std::make_shared<PdxTests::PdxType>();
regPtr0->put(keyport, pdxobj);
- PdxTests::PdxTypePtr obj2 =
+ auto obj2 =
std::dynamic_pointer_cast<PdxTests::PdxType>(regPtr0->get(keyport));
auto boolPtr =
@@ -633,16 +648,18 @@ DUNIT_TASK_DEFINITION(CLIENT1, JavaPutGet)
LOGDEBUG("Task:JavaPutGet: isEqual = %d", isEqual);
ASSERT(isEqual == true,
"Task JavaPutGet:Objects of type PdxType should be equal");
-
}
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, JavaGet)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
- serializationRegistry->addPdxType(PdxTests::PdxType::createDeserializable);
+ serializationRegistry->addPdxType(
+ PdxTests::PdxType::createDeserializable);
} catch (const IllegalStateException&) {
// ignore exception
}
@@ -652,17 +669,17 @@ DUNIT_TASK_DEFINITION(CLIENT2, JavaGet)
// ignore exception
}
LOGDEBUG("JavaGet-1 Line_309");
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheableKeyPtr keyport1 = CacheableKey::create(1);
+ auto keyport1 = CacheableKey::create(1);
auto pdxobj = std::make_shared<PdxTests::PdxType>();
LOGDEBUG("JavaGet-2 Line_314");
- PdxTests::PdxTypePtr obj1 =
+ auto obj1 =
std::dynamic_pointer_cast<PdxTests::PdxType>(regPtr0->get(keyport1));
LOGDEBUG("JavaGet-3 Line_316");
- CacheableKeyPtr keyport2 = CacheableKey::create("putFromjava");
+ auto keyport2 = CacheableKey::create("putFromjava");
LOGDEBUG("JavaGet-4 Line_316");
- PdxTests::PdxTypePtr obj2 =
+ auto obj2 =
std::dynamic_pointer_cast<PdxTests::PdxType>(regPtr0->get(keyport2));
LOGDEBUG("JavaGet-5 Line_320");
}
@@ -670,7 +687,9 @@ END_TASK_DEFINITION
/***************************************************************/
DUNIT_TASK_DEFINITION(CLIENT2, putAtVersionTwoR21)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
serializationRegistry->addPdxType(
@@ -679,9 +698,9 @@ DUNIT_TASK_DEFINITION(CLIENT2, putAtVersionTwoR21)
// ignore exception
}
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto np = std::make_shared<PdxTypesR2V2>();
regPtr0->put(keyport, np);
@@ -698,7 +717,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, getPutAtVersionOneR22)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
serializationRegistry->addPdxType(
@@ -707,9 +728,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, getPutAtVersionOneR22)
// ignore exception
}
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto np = std::make_shared<PdxTypesV1R2>();
auto pRet = std::dynamic_pointer_cast<PdxTypesV1R2>(regPtr0->get(keyport));
@@ -726,9 +747,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, getPutAtVersionTwoR23)
{
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto np = std::make_shared<PdxTypesR2V2>();
@@ -746,9 +767,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, getPutAtVersionOneR24)
{
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto np = std::make_shared<PdxTypesV1R2>();
auto pRet = std::dynamic_pointer_cast<PdxTypesV1R2>(regPtr0->get(keyport));
@@ -765,17 +786,20 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, putAtVersionOne31)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
- serializationRegistry->addPdxType(PdxTests::PdxType3V1::createDeserializable);
+ serializationRegistry->addPdxType(
+ PdxTests::PdxType3V1::createDeserializable);
} catch (const IllegalStateException&) {
// ignore exception
}
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto np = std::make_shared<PdxType3V1>();
regPtr0->put(keyport, np);
@@ -791,7 +815,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, getPutAtVersionTwo32)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
serializationRegistry->addPdxType(
@@ -800,10 +826,10 @@ DUNIT_TASK_DEFINITION(CLIENT2, getPutAtVersionTwo32)
// ignore exception
}
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
auto np = std::make_shared<PdxTypes3V2>();
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto pRet = std::dynamic_pointer_cast<PdxTypes3V2>(regPtr0->get(keyport));
bool isEqual = np->equals(pRet);
@@ -818,9 +844,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, getPutAtVersionOne33)
{
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto np = std::make_shared<PdxType3V1>();
auto pRet = std::dynamic_pointer_cast<PdxType3V1>(regPtr0->get(keyport));
@@ -837,11 +863,11 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, getPutAtVersionTwo34)
{
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
auto np = std::make_shared<PdxTypes3V2>();
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto pRet = std::dynamic_pointer_cast<PdxTypes3V2>(regPtr0->get(keyport));
@@ -857,16 +883,19 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, putAtVersionOne21)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
- serializationRegistry->addPdxType(PdxTests::PdxType2V1::createDeserializable);
+ serializationRegistry->addPdxType(
+ PdxTests::PdxType2V1::createDeserializable);
} catch (const IllegalStateException&) {
// ignore exception
}
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto np = std::make_shared<PdxType2V1>();
regPtr0->put(keyport, np);
@@ -882,7 +911,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, getPutAtVersionTwo22)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
serializationRegistry->addPdxType(
@@ -891,10 +922,10 @@ DUNIT_TASK_DEFINITION(CLIENT2, getPutAtVersionTwo22)
// ignore exception
}
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
auto np = std::make_shared<PdxTypes2V2>();
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto pRet = std::dynamic_pointer_cast<PdxTypes2V2>(regPtr0->get(keyport));
bool isEqual = np->equals(pRet);
@@ -909,11 +940,11 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, getPutAtVersionOne23)
{
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
auto np = std::make_shared<PdxType2V1>();
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto pRet = std::dynamic_pointer_cast<PdxType2V1>(regPtr0->get(keyport));
@@ -929,9 +960,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, getPutAtVersionTwo24)
{
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
auto np = std::make_shared<PdxTypes2V2>();
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto pRet = std::dynamic_pointer_cast<PdxTypes2V2>(regPtr0->get(keyport));
@@ -947,22 +978,25 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, putAtVersionOne11)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
- serializationRegistry->addPdxType(PdxTests::PdxType1V1::createDeserializable);
+ serializationRegistry->addPdxType(
+ PdxTests::PdxType1V1::createDeserializable);
} catch (const IllegalStateException&) {
// ignore exception
}
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto np = std::make_shared<PdxTests::PdxType1V1>();
regPtr0->put(keyport, np);
- PdxTests::PdxType1V1Ptr pRet =
+ auto pRet =
std::dynamic_pointer_cast<PdxTests::PdxType1V1>(regPtr0->get(keyport));
bool isEqual = np->equals(pRet);
@@ -975,7 +1009,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, putAtVersionTwo1)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
serializationRegistry->addPdxType(
@@ -986,9 +1022,9 @@ DUNIT_TASK_DEFINITION(CLIENT2, putAtVersionTwo1)
PdxTests::PdxTypesR1V2::reset(false);
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto np = std::make_shared<PdxTypesR1V2>();
regPtr0->put(keyport, np);
@@ -1004,7 +1040,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, getPutAtVersionOne2)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
serializationRegistry->addPdxType(
@@ -1013,11 +1051,11 @@ DUNIT_TASK_DEFINITION(CLIENT1, getPutAtVersionOne2)
// ignore exception
}
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
auto np = std::make_shared<PdxTypesV1R1>();
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto pRet = std::dynamic_pointer_cast<PdxTypesV1R1>(regPtr0->get(keyport));
@@ -1033,10 +1071,10 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, getPutAtVersionTwo3)
{
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
auto np = std::make_shared<PdxTypesR1V2>();
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto pRet = std::dynamic_pointer_cast<PdxTypesR1V2>(regPtr0->get(keyport));
bool isEqual = np->equals(pRet);
@@ -1051,10 +1089,10 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, getPutAtVersionOne4)
{
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
auto np = std::make_shared<PdxTypesV1R1>();
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto pRet = std::dynamic_pointer_cast<PdxTypesV1R1>(regPtr0->get(keyport));
bool isEqual = np->equals(pRet);
@@ -1069,11 +1107,11 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, getPutAtVersionTwo5)
{
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
auto np = std::make_shared<PdxTypesR1V2>();
// GET
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto pRet = std::dynamic_pointer_cast<PdxTypesR1V2>(regPtr0->get(keyport));
@@ -1089,10 +1127,10 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, getPutAtVersionOne6)
{
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
auto np = std::make_shared<PdxTypesV1R1>();
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto pRet = std::dynamic_pointer_cast<PdxTypesV1R1>(regPtr0->get(keyport));
bool isEqual = np->equals(pRet);
@@ -1107,7 +1145,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, putV2PdxUI)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
serializationRegistry->addPdxType(
@@ -1117,9 +1157,9 @@ DUNIT_TASK_DEFINITION(CLIENT2, putV2PdxUI)
}
// PdxTests::PdxTypesIgnoreUnreadFieldsV2::reset(false);
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
auto np = std::make_shared<PdxTypesIgnoreUnreadFieldsV2>();
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
regPtr0->put(keyport, np);
auto pRet = std::dynamic_pointer_cast<PdxTypesIgnoreUnreadFieldsV2>(
@@ -1137,7 +1177,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, putV1PdxUI)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
serializationRegistry->addPdxType(
@@ -1146,8 +1188,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, putV1PdxUI)
// ignore exception
}
// PdxTests::PdxTypesIgnoreUnreadFieldsV1::reset(false);
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto keyport = CacheableKey::create(1);
auto pRet = std::dynamic_pointer_cast<PdxTypesIgnoreUnreadFieldsV1>(
regPtr0->get(keyport));
@@ -1157,10 +1199,10 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, getV2PdxUI)
{
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
auto np = std::make_shared<PdxTypesIgnoreUnreadFieldsV2>();
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto pRet = std::dynamic_pointer_cast<PdxTypesIgnoreUnreadFieldsV2>(
regPtr0->get(keyport));
@@ -1174,7 +1216,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, getPutAtVersionTwo12)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
serializationRegistry->addPdxType(
@@ -1183,11 +1227,11 @@ DUNIT_TASK_DEFINITION(CLIENT2, getPutAtVersionTwo12)
// ignore exception
}
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
auto np = std::make_shared<PdxTypes1V2>();
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto pRet = std::dynamic_pointer_cast<PdxTypes1V2>(regPtr0->get(keyport));
@@ -1203,10 +1247,10 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, getPutAtVersionOne13)
{
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
auto np = std::make_shared<PdxType1V1>();
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto pRet = std::dynamic_pointer_cast<PdxType1V1>(regPtr0->get(keyport));
bool isEqual = np->equals(pRet);
@@ -1223,10 +1267,10 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, getPutAtVersionTwo14)
{
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
auto np = std::make_shared<PdxTypes1V2>();
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto pRet = std::dynamic_pointer_cast<PdxTypes1V2>(regPtr0->get(keyport));
bool isEqual = np->equals(pRet);
@@ -1242,11 +1286,11 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, getPutAtVersionOne15)
{
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
auto np = std::make_shared<PdxType1V1>();
// GET
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto pRet = std::dynamic_pointer_cast<PdxType1V1>(regPtr0->get(keyport));
@@ -1277,10 +1321,10 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, getPutAtVersionTwo16)
{
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
auto np = std::make_shared<PdxTypes1V2>();
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto pRet = std::dynamic_pointer_cast<PdxTypes1V2>(regPtr0->get(keyport));
bool isEqual = np->equals(pRet);
@@ -1306,24 +1350,28 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, Puts2)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
- serializationRegistry->addPdxType(PdxTests::PdxTypes1::createDeserializable);
- serializationRegistry->addPdxType(PdxTests::PdxTypes2::createDeserializable);
+ serializationRegistry->addPdxType(
+ PdxTests::PdxTypes1::createDeserializable);
+ serializationRegistry->addPdxType(
+ PdxTests::PdxTypes2::createDeserializable);
} catch (const IllegalStateException&) {
// ignore exception
}
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto pdxobj = std::make_shared<PdxTests::PdxTypes1>();
regPtr0->put(keyport, pdxobj);
- CacheableKeyPtr keyport2 = CacheableKey::create(2);
+ auto keyport2 = CacheableKey::create(2);
auto pdxobj2 = std::make_shared<PdxTests::PdxTypes2>();
@@ -1343,9 +1391,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, forCleanup)
{
LOGINFO("Do put to clean the pdxtype registry");
try {
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto pdxobj = std::make_shared<PdxTests::PdxTypes1>();
@@ -1359,15 +1407,15 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, Puts22)
{
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto pdxobj = std::make_shared<PdxTests::PdxTypes1>();
regPtr0->put(keyport, pdxobj);
- CacheableKeyPtr keyport2 = CacheableKey::create(2);
+ auto keyport2 = CacheableKey::create(2);
auto pdxobj2 = std::make_shared<PdxTests::PdxTypes2>();
@@ -1385,19 +1433,22 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, Get2)
{
-
try {
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
- serializationRegistry->addPdxType(PdxTests::PdxTypes1::createDeserializable);
- serializationRegistry->addPdxType(PdxTests::PdxTypes2::createDeserializable);
+ serializationRegistry->addPdxType(
+ PdxTests::PdxTypes1::createDeserializable);
+ serializationRegistry->addPdxType(
+ PdxTests::PdxTypes2::createDeserializable);
} catch (const IllegalStateException&) {
// ignore exception
}
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheableKeyPtr keyport = CacheableKey::create(2);
- PdxTests::PdxTypes2Ptr obj2 =
+ auto keyport = CacheableKey::create(2);
+ auto obj2 =
std::dynamic_pointer_cast<PdxTests::PdxTypes2>(regPtr0->get(keyport));
LOG("Get2 complete.\n");
@@ -1406,9 +1457,12 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, PutAndVerifyPdxInGet)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
- serializationRegistry->addPdxType(PdxTests::PdxType::createDeserializable);
+ serializationRegistry->addPdxType(
+ PdxTests::PdxType::createDeserializable);
} catch (const IllegalStateException&) {
// ignore exception
}
@@ -1419,15 +1473,15 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutAndVerifyPdxInGet)
// ignore exception
}
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto pdxobj = std::make_shared<PdxTests::PdxType>();
regPtr0->put(keyport, pdxobj);
- PdxTests::PdxTypePtr obj2 =
+ auto obj2 =
std::dynamic_pointer_cast<PdxTests::PdxType>(regPtr0->get(keyport));
checkPdxInstanceToStringAtServer(regPtr0);
@@ -1472,7 +1526,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, PutAndVerifyNestedPdxInGet)
{
LOG("PutAndVerifyNestedPdxInGet started.");
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
serializationRegistry->addPdxType(NestedPdx::createDeserializable);
@@ -1481,21 +1537,23 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutAndVerifyNestedPdxInGet)
}
try {
- serializationRegistry->addPdxType(PdxTests::PdxTypes1::createDeserializable);
+ serializationRegistry->addPdxType(
+ PdxTests::PdxTypes1::createDeserializable);
} catch (const IllegalStateException&) {
// ignore exception
}
try {
- serializationRegistry->addPdxType(PdxTests::PdxTypes2::createDeserializable);
+ serializationRegistry->addPdxType(
+ PdxTests::PdxTypes2::createDeserializable);
} catch (const IllegalStateException&) {
// ignore exception
}
auto p1 = std::make_shared<NestedPdx>();
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
regPtr0->put(keyport, p1);
@@ -1510,7 +1568,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, PutMixedVersionNestedPdx)
{
LOG("PutMixedVersionNestedPdx started.");
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
serializationRegistry->addPdxType(
@@ -1520,13 +1580,15 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutMixedVersionNestedPdx)
}
try {
- serializationRegistry->addPdxType(PdxTests::PdxTypes1::createDeserializable);
+ serializationRegistry->addPdxType(
+ PdxTests::PdxTypes1::createDeserializable);
} catch (const IllegalStateException&) {
// ignore exception
}
try {
- serializationRegistry->addPdxType(PdxTests::PdxTypes2::createDeserializable);
+ serializationRegistry->addPdxType(
+ PdxTests::PdxTypes2::createDeserializable);
} catch (const IllegalStateException&) {
// ignore exception
}
@@ -1536,12 +1598,12 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutMixedVersionNestedPdx)
auto p2 = std::make_shared<MixedVersionNestedPdx>();
auto p3 = std::make_shared<MixedVersionNestedPdx>();
LOG("RegionPtr regPtr0 = getHelper()->getRegion(\"DistRegionAck\");");
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
- LOG("CacheableKeyPtr keyport1 = CacheableKey::create(1);");
- CacheableKeyPtr keyport1 = CacheableKey::create(1);
- CacheableKeyPtr keyport2 = CacheableKey::create(2);
- CacheableKeyPtr keyport3 = CacheableKey::create(3);
+ LOG("std::shared_ptr<CacheableKey> keyport1 = CacheableKey::create(1);");
+ auto keyport1 = CacheableKey::create(1);
+ auto keyport2 = CacheableKey::create(2);
+ auto keyport3 = CacheableKey::create(3);
LOG("regPtr0->put(keyport1, p1 );");
regPtr0->put(keyport1, p1);
@@ -1555,7 +1617,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, PutAndVerifyPdxInGFSInGet)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
serializationRegistry->addType(
PdxInsideIGeodeSerializable::createDeserializable);
@@ -1614,10 +1678,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutAndVerifyPdxInGFSInGet)
// ignore exception
}
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
auto np = std::make_shared<PdxInsideIGeodeSerializable>();
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
regPtr0->put(keyport, np);
// GET
@@ -1632,7 +1696,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, VerifyPdxInGFSGetOnly)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
serializationRegistry->addType(
PdxInsideIGeodeSerializable::createDeserializable);
@@ -1691,11 +1757,11 @@ DUNIT_TASK_DEFINITION(CLIENT2, VerifyPdxInGFSGetOnly)
// ignore exception
}
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
auto orig = std::make_shared<PdxInsideIGeodeSerializable>();
// GET
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto pRet = std::dynamic_pointer_cast<PdxInsideIGeodeSerializable>(
regPtr0->get(keyport));
ASSERT(pRet->equals(orig) == true,
@@ -1709,7 +1775,9 @@ DUNIT_TASK_DEFINITION(CLIENT2, VerifyMixedVersionNestedGetOnly)
{
LOG("VerifyMixedVersionNestedGetOnly started.");
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
serializationRegistry->addPdxType(
MixedVersionNestedPdx::createDeserializable);
@@ -1718,23 +1786,25 @@ DUNIT_TASK_DEFINITION(CLIENT2, VerifyMixedVersionNestedGetOnly)
}
try {
- serializationRegistry->addPdxType(PdxTests::PdxTypes1::createDeserializable);
+ serializationRegistry->addPdxType(
+ PdxTests::PdxTypes1::createDeserializable);
} catch (const IllegalStateException&) {
// ignore exception
}
try {
- serializationRegistry->addPdxType(PdxTests::PdxTypes2::createDeserializable);
+ serializationRegistry->addPdxType(
+ PdxTests::PdxTypes2::createDeserializable);
} catch (const IllegalStateException&) {
// ignore exception
}
auto p1 = std::make_shared<MixedVersionNestedPdx>();
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheableKeyPtr keyport1 = CacheableKey::create(1);
- CacheableKeyPtr keyport2 = CacheableKey::create(2);
- CacheableKeyPtr keyport3 = CacheableKey::create(3);
+ auto keyport1 = CacheableKey::create(1);
+ auto keyport2 = CacheableKey::create(2);
+ auto keyport3 = CacheableKey::create(3);
auto obj1 = std::dynamic_pointer_cast<MixedVersionNestedPdx>(
regPtr0->get(keyport1));
@@ -1753,7 +1823,9 @@ DUNIT_TASK_DEFINITION(CLIENT2, VerifyNestedGetOnly)
{
LOG("VerifyNestedGetOnly started.");
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
serializationRegistry->addPdxType(NestedPdx::createDeserializable);
} catch (const IllegalStateException&) {
@@ -1761,21 +1833,23 @@ DUNIT_TASK_DEFINITION(CLIENT2, VerifyNestedGetOnly)
}
try {
- serializationRegistry->addPdxType(PdxTests::PdxTypes1::createDeserializable);
+ serializationRegistry->addPdxType(
+ PdxTests::PdxTypes1::createDeserializable);
} catch (const IllegalStateException&) {
// ignore exception
}
try {
- serializationRegistry->addPdxType(PdxTests::PdxTypes2::createDeserializable);
+ serializationRegistry->addPdxType(
+ PdxTests::PdxTypes2::createDeserializable);
} catch (const IllegalStateException&) {
// ignore exception
}
auto p1 = std::make_shared<NestedPdx>();
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto obj2 = std::dynamic_pointer_cast<NestedPdx>(regPtr0->get(keyport));
@@ -1787,9 +1861,12 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, VerifyGetOnly)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
- serializationRegistry->addPdxType(PdxTests::PdxType::createDeserializable);
+ serializationRegistry->addPdxType(
+ PdxTests::PdxType::createDeserializable);
} catch (const IllegalStateException&) {
// ignore exception
}
@@ -1800,10 +1877,10 @@ DUNIT_TASK_DEFINITION(CLIENT2, VerifyGetOnly)
// ignore exception
}
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheableKeyPtr keyport = CacheableKey::create(1);
- PdxTests::PdxTypePtr obj2 =
+ auto keyport = CacheableKey::create(1);
+ auto obj2 =
std::dynamic_pointer_cast<PdxTests::PdxType>(regPtr0->get(keyport));
checkPdxInstanceToStringAtServer(regPtr0);
@@ -1842,7 +1919,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, PutAndVerifyVariousPdxTypes)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
serializationRegistry->addPdxType(PdxTypes1::createDeserializable);
} catch (const IllegalStateException&) {
@@ -1905,11 +1984,11 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutAndVerifyVariousPdxTypes)
// Region region0 = CacheHelper.GetVerifyRegion<object,
// object>(m_regionNames[0]);
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
bool flag = false;
{
auto p1 = std::make_shared<PdxTypes1>();
- CacheableKeyPtr keyport = CacheableKey::create(11);
+ auto keyport = CacheableKey::create(11);
regPtr0->put(keyport, p1);
auto pRet = std::dynamic_pointer_cast<PdxTypes1>(regPtr0->get(keyport));
@@ -1951,7 +2030,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutAndVerifyVariousPdxTypes)
{
auto p2 = std::make_shared<PdxTypes2>();
- CacheableKeyPtr keyport2 = CacheableKey::create(12);
+ auto keyport2 = CacheableKey::create(12);
regPtr0->put(keyport2, p2);
auto pRet2 = std::dynamic_pointer_cast<PdxTypes2>(regPtr0->get(keyport2));
@@ -1993,7 +2072,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutAndVerifyVariousPdxTypes)
{
auto p3 = std::make_shared<PdxTypes3>();
- CacheableKeyPtr keyport3 = CacheableKey::create(13);
+ auto keyport3 = CacheableKey::create(13);
regPtr0->put(keyport3, p3);
auto pRet3 = std::dynamic_pointer_cast<PdxTypes3>(regPtr0->get(keyport3));
@@ -2035,7 +2114,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutAndVerifyVariousPdxTypes)
{
auto p4 = std::make_shared<PdxTypes4>();
- CacheableKeyPtr keyport4 = CacheableKey::create(14);
+ auto keyport4 = CacheableKey::create(14);
regPtr0->put(keyport4, p4);
auto pRet4 = std::dynamic_pointer_cast<PdxTypes4>(regPtr0->get(keyport4));
@@ -2077,7 +2156,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutAndVerifyVariousPdxTypes)
{
auto p5 = std::make_shared<PdxTypes5>();
- CacheableKeyPtr keyport5 = CacheableKey::create(15);
+ auto keyport5 = CacheableKey::create(15);
regPtr0->put(keyport5, p5);
auto pRet5 = std::dynamic_pointer_cast<PdxTypes5>(regPtr0->get(keyport5));
@@ -2119,7 +2198,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutAndVerifyVariousPdxTypes)
{
auto p6 = std::make_shared<PdxTypes6>();
- CacheableKeyPtr keyport6 = CacheableKey::create(16);
+ auto keyport6 = CacheableKey::create(16);
regPtr0->put(keyport6, p6);
auto pRet6 = std::dynamic_pointer_cast<PdxTypes6>(regPtr0->get(keyport6));
@@ -2161,7 +2240,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutAndVerifyVariousPdxTypes)
{
auto p7 = std::make_shared<PdxTypes7>();
- CacheableKeyPtr keyport7 = CacheableKey::create(17);
+ auto keyport7 = CacheableKey::create(17);
regPtr0->put(keyport7, p7);
auto pRet7 = std::dynamic_pointer_cast<PdxTypes7>(regPtr0->get(keyport7));
@@ -2203,7 +2282,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutAndVerifyVariousPdxTypes)
{
auto p8 = std::make_shared<PdxTypes8>();
- CacheableKeyPtr keyport8 = CacheableKey::create(18);
+ auto keyport8 = CacheableKey::create(18);
regPtr0->put(keyport8, p8);
auto pRet8 = std::dynamic_pointer_cast<PdxTypes8>(regPtr0->get(keyport8));
@@ -2245,7 +2324,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutAndVerifyVariousPdxTypes)
{
auto p9 = std::make_shared<PdxTypes9>();
- CacheableKeyPtr keyport9 = CacheableKey::create(19);
+ auto keyport9 = CacheableKey::create(19);
regPtr0->put(keyport9, p9);
auto pRet9 = std::dynamic_pointer_cast<PdxTypes9>(regPtr0->get(keyport9));
@@ -2287,7 +2366,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutAndVerifyVariousPdxTypes)
{
auto p10 = std::make_shared<PdxTypes10>();
- CacheableKeyPtr keyport10 = CacheableKey::create(20);
+ auto keyport10 = CacheableKey::create(20);
regPtr0->put(keyport10, p10);
auto pRet10 =
std::dynamic_pointer_cast<PdxTypes10>(regPtr0->get(keyport10));
@@ -2336,20 +2415,20 @@ END_TASK_DEFINITION
// C1.generateJavaPdxType
DUNIT_TASK_DEFINITION(CLIENT1, generateJavaPdxType)
{
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheablePtr args = CacheableKey::create("saveAllJavaPdxTypes");
- CacheableKeyPtr key = CacheableKey::create(1);
- CacheableVectorPtr routingObj = CacheableVector::create();
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto args = CacheableKey::create("saveAllJavaPdxTypes");
+ auto key = CacheableKey::create(1);
+ auto routingObj = CacheableVector::create();
routingObj->push_back(key);
- ExecutionPtr funcExec = FunctionService::onRegion(regPtr0);
+ auto funcExec = FunctionService::onRegion(regPtr0);
- ResultCollectorPtr collector = funcExec->withArgs(args)
- ->withFilter(routingObj)
- ->execute("ComparePdxTypes");
+ auto collector = funcExec->withArgs(args)
+ ->withFilter(routingObj)
+ ->execute("ComparePdxTypes");
ASSERT(collector != nullptr, "onRegion collector nullptr");
- CacheableVectorPtr result = collector->getResult();
+ auto result = collector->getResult();
LOGINFO("NIL:: testTCPDXTests: result->size = %d ", result->size());
if (result == nullptr) {
ASSERT(false, "echo String : result is nullptr");
@@ -2398,7 +2477,9 @@ END_TASK_DEFINITION
// C1.putAllPdxTypes
DUNIT_TASK_DEFINITION(CLIENT1, putAllPdxTypes)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
serializationRegistry->addPdxType(PdxTypes1::createDeserializable);
@@ -2454,46 +2535,46 @@ DUNIT_TASK_DEFINITION(CLIENT1, putAllPdxTypes)
// serializationRegistry->addPdxType(PdxTests.PortfolioPdx.CreateDeserializable);
// serializationRegistry->addPdxType(PdxTests.PositionPdx.CreateDeserializable);
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
auto p1 = std::make_shared<PdxTypes1>();
- CacheableKeyPtr keyport1 = CacheableKey::create(p1->getClassName());
+ auto keyport1 = CacheableKey::create(p1->getClassName());
regPtr0->put(keyport1, p1);
auto p2 = std::make_shared<PdxTypes2>();
- CacheableKeyPtr keyport2 = CacheableKey::create(p2->getClassName());
+ auto keyport2 = CacheableKey::create(p2->getClassName());
regPtr0->put(keyport2, p2);
auto p3 = std::make_shared<PdxTypes3>();
- CacheableKeyPtr keyport3 = CacheableKey::create(p3->getClassName());
+ auto keyport3 = CacheableKey::create(p3->getClassName());
regPtr0->put(keyport3, p3);
auto p4 = std::make_shared<PdxTypes4>();
- CacheableKeyPtr keyport4 = CacheableKey::create(p4->getClassName());
+ auto keyport4 = CacheableKey::create(p4->getClassName());
regPtr0->put(keyport4, p4);
auto p5 = std::make_shared<PdxTypes5>();
- CacheableKeyPtr keyport5 = CacheableKey::create(p5->getClassName());
+ auto keyport5 = CacheableKey::create(p5->getClassName());
regPtr0->put(keyport5, p5);
auto p6 = std::make_shared<PdxTypes6>();
- CacheableKeyPtr keyport6 = CacheableKey::create(p6->getClassName());
+ auto keyport6 = CacheableKey::create(p6->getClassName());
regPtr0->put(keyport6, p6);
auto p7 = std::make_shared<PdxTypes7>();
- CacheableKeyPtr keyport7 = CacheableKey::create(p7->getClassName());
+ auto keyport7 = CacheableKey::create(p7->getClassName());
regPtr0->put(keyport7, p7);
auto p8 = std::make_shared<PdxTypes8>();
- CacheableKeyPtr keyport8 = CacheableKey::create(p8->getClassName());
+ auto keyport8 = CacheableKey::create(p8->getClassName());
regPtr0->put(keyport8, p8);
auto p9 = std::make_shared<PdxTypes9>();
- CacheableKeyPtr keyport9 = CacheableKey::create(p9->getClassName());
+ auto keyport9 = CacheableKey::create(p9->getClassName());
regPtr0->put(keyport9, p9);
auto p10 = std::make_shared<PdxTypes10>();
- CacheableKeyPtr keyport10 = CacheableKey::create(p10->getClassName());
+ auto keyport10 = CacheableKey::create(p10->getClassName());
regPtr0->put(keyport10, p10);
//
@@ -2503,20 +2584,20 @@ END_TASK_DEFINITION
// C1.verifyDotNetPdxTypes
DUNIT_TASK_DEFINITION(CLIENT1, verifyDotNetPdxTypes)
{
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheablePtr args = CacheableKey::create("compareDotNETPdxTypes");
- CacheableKeyPtr key = CacheableKey::create(1);
- CacheableVectorPtr routingObj = CacheableVector::create();
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto args = CacheableKey::create("compareDotNETPdxTypes");
+ auto key = CacheableKey::create(1);
+ auto routingObj = CacheableVector::create();
routingObj->push_back(key);
- ExecutionPtr funcExec = FunctionService::onRegion(regPtr0);
+ auto funcExec = FunctionService::onRegion(regPtr0);
- ResultCollectorPtr collector = funcExec->withArgs(args)
- ->withFilter(routingObj)
- ->execute("ComparePdxTypes");
+ auto collector = funcExec->withArgs(args)
+ ->withFilter(routingObj)
+ ->execute("ComparePdxTypes");
ASSERT(collector != nullptr, "onRegion collector nullptr");
- CacheableVectorPtr result = collector->getResult();
+ auto result = collector->getResult();
LOGINFO("NIL:: testTCPDXTests:verifyDotNetPdxTypes result->size = %d ",
result->size());
if (result == nullptr) {
@@ -2568,17 +2649,20 @@ END_TASK_DEFINITION
// c1.client1PutsV1Object
DUNIT_TASK_DEFINITION(CLIENT1, client1PutsV1Object)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
- serializationRegistry->addPdxType(PdxTests::PdxType3V1::createDeserializable);
+ serializationRegistry->addPdxType(
+ PdxTests::PdxType3V1::createDeserializable);
} catch (const IllegalStateException&) {
// ignore exception
}
PdxTests::PdxType3V1::reset(false);
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto keyport = CacheableKey::create(1);
auto np = std::make_shared<PdxType3V1>();
regPtr0->put(keyport, np);
@@ -2587,7 +2671,9 @@ END_TASK_DEFINITION
// c2.client2GetsV1ObjectAndPutsV2Object
DUNIT_TASK_DEFINITION(CLIENT2, client2GetsV1ObjectAndPutsV2Object)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
serializationRegistry->addPdxType(
@@ -2596,10 +2682,10 @@ DUNIT_TASK_DEFINITION(CLIENT2, client2GetsV1ObjectAndPutsV2Object)
// ignore exception
}
PdxTests::PdxTypes3V2::reset(false);
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
// get v1 object
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
auto pRet = std::dynamic_pointer_cast<PdxTypes3V2>(regPtr0->get(keyport));
// now put v2 object
@@ -2612,18 +2698,18 @@ END_TASK_DEFINITION
// c3.client3GetsV2Object
DUNIT_TASK_DEFINITION(CLIENT3, client3GetsV2Object)
{
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheablePtr args = CacheableKey::create("compareDotNETPdxTypes");
- CacheableKeyPtr key = CacheableKey::create(1);
- CacheableVectorPtr routingObj = CacheableVector::create();
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto args = CacheableKey::create("compareDotNETPdxTypes");
+ auto key = CacheableKey::create(1);
+ auto routingObj = CacheableVector::create();
routingObj->push_back(key);
- ExecutionPtr funcExec = FunctionService::onRegion(regPtr0);
+ auto funcExec = FunctionService::onRegion(regPtr0);
- ResultCollectorPtr collector = funcExec->execute("IterateRegion");
+ auto collector = funcExec->execute("IterateRegion");
ASSERT(collector != nullptr, "onRegion collector nullptr");
- CacheableVectorPtr result = collector->getResult();
+ auto result = collector->getResult();
LOGINFO("NIL:: testTCPDXTests:verifyDotNetPdxTypes result->size = %d ",
result->size());
if (result == nullptr) {
@@ -2673,7 +2759,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, VerifyVariousPdxGets)
{
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
serializationRegistry->addPdxType(PdxTypes1::createDeserializable);
@@ -2729,11 +2817,11 @@ DUNIT_TASK_DEFINITION(CLIENT2, VerifyVariousPdxGets)
// serializationRegistry->addPdxType(PdxTests.PortfolioPdx.CreateDeserializable);
// serializationRegistry->addPdxType(PdxTests.PositionPdx.CreateDeserializable);
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
bool flag = false;
{
auto p1 = std::make_shared<PdxTypes1>();
- CacheableKeyPtr keyport = CacheableKey::create(11);
+ auto keyport = CacheableKey::create(11);
auto pRet = std::dynamic_pointer_cast<PdxTypes1>(regPtr0->get(keyport));
flag = p1->equals(pRet);
@@ -2775,7 +2863,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, VerifyVariousPdxGets)
{
auto p2 = std::make_shared<PdxTypes2>();
- CacheableKeyPtr keyport2 = CacheableKey::create(12);
+ auto keyport2 = CacheableKey::create(12);
auto pRet2 = std::dynamic_pointer_cast<PdxTypes2>(regPtr0->get(keyport2));
flag = p2->equals(pRet2);
@@ -2817,7 +2905,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, VerifyVariousPdxGets)
{
auto p3 = std::make_shared<PdxTypes3>();
- CacheableKeyPtr keyport3 = CacheableKey::create(13);
+ auto keyport3 = CacheableKey::create(13);
auto pRet3 = std::dynamic_pointer_cast<PdxTypes3>(regPtr0->get(keyport3));
flag = p3->equals(pRet3);
@@ -2859,7 +2947,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, VerifyVariousPdxGets)
{
auto p4 = std::make_shared<PdxTypes4>();
- CacheableKeyPtr keyport4 = CacheableKey::create(14);
+ auto keyport4 = CacheableKey::create(14);
auto pRet4 = std::dynamic_pointer_cast<PdxTypes4>(regPtr0->get(keyport4));
flag = p4->equals(pRet4);
@@ -2901,7 +2989,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, VerifyVariousPdxGets)
{
auto p5 = std::make_shared<PdxTypes5>();
- CacheableKeyPtr keyport5 = CacheableKey::create(15);
+ auto keyport5 = CacheableKey::create(15);
auto pRet5 = std::dynamic_pointer_cast<PdxTypes5>(regPtr0->get(keyport5));
flag = p5->equals(pRet5);
@@ -2943,7 +3031,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, VerifyVariousPdxGets)
{
auto p6 = std::make_shared<PdxTypes6>();
- CacheableKeyPtr keyport6 = CacheableKey::create(16);
+ auto keyport6 = CacheableKey::create(16);
auto pRet6 = std::dynamic_pointer_cast<PdxTypes6>(regPtr0->get(keyport6));
flag = p6->equals(pRet6);
@@ -2985,7 +3073,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, VerifyVariousPdxGets)
{
auto p7 = std::make_shared<PdxTypes7>();
- CacheableKeyPtr keyport7 = CacheableKey::create(17);
+ auto keyport7 = CacheableKey::create(17);
auto pRet7 = std::dynamic_pointer_cast<PdxTypes7>(regPtr0->get(keyport7));
flag = p7->equals(pRet7);
@@ -3027,7 +3115,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, VerifyVariousPdxGets)
{
auto p8 = std::make_shared<PdxTypes8>();
- CacheableKeyPtr keyport8 = CacheableKey::create(18);
+ auto keyport8 = CacheableKey::create(18);
auto pRet8 = std::dynamic_pointer_cast<PdxTypes8>(regPtr0->get(keyport8));
flag = p8->equals(pRet8);
@@ -3069,7 +3157,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, VerifyVariousPdxGets)
{
auto p9 = std::make_shared<PdxTypes9>();
- CacheableKeyPtr keyport9 = CacheableKey::create(19);
+ auto keyport9 = CacheableKey::create(19);
auto pRet9 = std::dynamic_pointer_cast<PdxTypes9>(regPtr0->get(keyport9));
flag = p9->equals(pRet9);
@@ -3111,7 +3199,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, VerifyVariousPdxGets)
{
auto p10 = std::make_shared<PdxTypes10>();
- CacheableKeyPtr keyport10 = CacheableKey::create(20);
+ auto keyport10 = CacheableKey::create(20);
auto pRet10 =
std::dynamic_pointer_cast<PdxTypes10>(regPtr0->get(keyport10));
@@ -3157,13 +3245,13 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, putOperation)
{
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
regPtr0->put(1, 1);
// Verify the CLientName.::putOperation
- // RegionPtr testReg = getHelper()->getRegion("testregion");
- CacheablePtr valuePtr1 = regPtr0->get("clientName1");
+ // auto testReg = getHelper()->getRegion("testregion");
+ auto valuePtr1 = regPtr0->get("clientName1");
const char* clientName1 =
(std::dynamic_pointer_cast<CacheableString>(valuePtr1))->asChar();
LOGINFO(" C1.putOperation Got ClientName1 = %s ", clientName1);
@@ -3174,13 +3262,13 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, getOperation)
{
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
- CacheableKeyPtr keyport = CacheableKey::create(1);
- CacheablePtr value = regPtr0->get(keyport);
+ auto keyport = CacheableKey::create(1);
+ auto value = regPtr0->get(keyport);
// Verify Client Name for C2
- CacheablePtr valuePtr2 = regPtr0->get("clientName2");
+ auto valuePtr2 = regPtr0->get("clientName2");
const char* clientName2 =
(std::dynamic_pointer_cast<CacheableString>(valuePtr2))->asChar();
LOGINFO(" C2.getOperation Got ClientName2 = %s ", clientName2);
@@ -3191,11 +3279,14 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, putCharTypes)
{
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
try {
- serializationRegistry->addPdxType(PdxTests::CharTypes::createDeserializable);
+ serializationRegistry->addPdxType(
+ PdxTests::CharTypes::createDeserializable);
} catch (const IllegalStateException&) {
// ignore exception
}
@@ -3204,7 +3295,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, putCharTypes)
LOG("Trying to populate PDX objects.....\n");
auto pdxobj = std::make_shared<PdxTests::CharTypes>();
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
// PUT Operation
regPtr0->put(keyport, pdxobj);
@@ -3221,21 +3312,24 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, getCharTypes)
{
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
LOG("Trying to GET PDX objects.....\n");
try {
- serializationRegistry->addPdxType(PdxTests::CharTypes::createDeserializable);
+ serializationRegistry->addPdxType(
+ PdxTests::CharTypes::createDeserializable);
} catch (const IllegalStateException&) {
// ignore exception
}
auto localPdxptr = std::make_shared<PdxTests::CharTypes>();
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
LOG("Client-2 PdxTests::CharTypes GET OP Start....");
- PdxTests::CharTypesPtr remotePdxptr =
+ auto remotePdxptr =
std::dynamic_pointer_cast<PdxTests::CharTypes>(regPtr0->get(keyport));
LOG("Client-2 PdxTests::CharTypes GET OP Done....");
@@ -3261,12 +3355,15 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
{
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
// QueryHelper * qh = &QueryHelper::getHelper();
try {
- serializationRegistry->addPdxType(PdxTests::PdxType::createDeserializable);
+ serializationRegistry->addPdxType(
+ PdxTests::PdxType::createDeserializable);
} catch (const IllegalStateException&) {
// ignore exception
}
@@ -3281,27 +3378,37 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
LOG("Trying to populate PDX objects.....\n");
auto pdxobj = std::make_shared<PdxTests::PdxType>();
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
// PUT Operation
regPtr0->put(keyport, pdxobj);
LOG("PdxTests::PdxType: PUT Done successfully....");
// PUT CacheableObjectArray as a Value
- CacheableKeyPtr keyport2 = CacheableKey::create(2);
- CacheableObjectArrayPtr m_objectArray;
+ auto keyport2 = CacheableKey::create(2);
+ std::shared_ptr<CacheableObjectArray> m_objectArray;
m_objectArray = CacheableObjectArray::create();
- m_objectArray->push_back(AddressPtr(new Address(1, "street0", "city0")));
- m_objectArray->push_back(AddressPtr(new Address(2, "street1", "city1")));
- m_objectArray->push_back(AddressPtr(new Address(3, "street2", "city2")));
- m_objectArray->push_back(AddressPtr(new Address(4, "street3", "city3")));
- m_objectArray->push_back(AddressPtr(new Address(5, "street4", "city4")));
- m_objectArray->push_back(AddressPtr(new Address(6, "street5", "city5")));
- m_objectArray->push_back(AddressPtr(new Address(7, "street6", "city6")));
- m_objectArray->push_back(AddressPtr(new Address(8, "street7", "city7")));
- m_objectArray->push_back(AddressPtr(new Address(9, "street8", "city8")));
- m_objectArray->push_back(AddressPtr(new Address(10, "street9", "city9")));
+ m_objectArray->push_back(
+ std::shared_ptr<Address>(new Address(1, "street0", "city0")));
+ m_objectArray->push_back(
+ std::shared_ptr<Address>(new Address(2, "street1", "city1")));
+ m_objectArray->push_back(
+ std::shared_ptr<Address>(new Address(3, "street2", "city2")));
+ m_objectArray->push_back(
+ std::shared_ptr<Address>(new Address(4, "street3", "city3")));
+ m_objectArray->push_back(
+ std::shared_ptr<Address>(new Address(5, "street4", "city4")));
+ m_objectArray->push_back(
+ std::shared_ptr<Address>(new Address(6, "street5", "city5")));
+ m_objectArray->push_back(
+ std::shared_ptr<Address>(new Address(7, "street6", "city6")));
+ m_objectArray->push_back(
+ std::shared_ptr<Address>(new Address(8, "street7", "city7")));
+ m_objectArray->push_back(
+ std::shared_ptr<Address>(new Address(9, "street8", "city8")));
+ m_objectArray->push_back(
+ std::shared_ptr<Address>(new Address(10, "street9", "city9")));
// PUT Operation
regPtr0->put(keyport2, m_objectArray);
@@ -3348,8 +3455,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
// Now update new keys with updated stats values, so that other client can
// verify these values with its stats.
- CacheableKeyPtr keyport3 = CacheableKey::create(3);
- CacheableKeyPtr keyport4 = CacheableKey::create(4);
+ auto keyport3 = CacheableKey::create(3);
+ auto keyport4 = CacheableKey::create(4);
regPtr0->put(keyport3,
CacheableInt32::create(lregPtr->getCacheImpl()
->getCachePerfStats()
@@ -3367,14 +3474,17 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, StepFour)
{
// initClient(true);
- RegionPtr regPtr0 = getHelper()->getRegion("DistRegionAck");
+ auto regPtr0 = getHelper()->getRegion("DistRegionAck");
// QueryHelper * qh = &QueryHelper::getHelper();
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
LOG("Trying to GET PDX objects.....\n");
try {
- serializationRegistry->addPdxType(PdxTests::PdxType::createDeserializable);
+ serializationRegistry->addPdxType(
+ PdxTests::PdxType::createDeserializable);
} catch (const IllegalStateException&) {
// ignore exception
}
@@ -3386,31 +3496,31 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepFour)
}
// Create local CacheableObjectArray
- CacheableObjectArrayPtr m_localObjectArray;
+ std::shared_ptr<CacheableObjectArray> m_localObjectArray;
m_localObjectArray = CacheableObjectArray::create();
m_localObjectArray->push_back(
- AddressPtr(new Address(1, "street0", "city0")));
+ std::shared_ptr<Address>(new Address(1, "street0", "city0")));
m_localObjectArray->push_back(
- AddressPtr(new Address(2, "street1", "city1")));
+ std::shared_ptr<Address>(new Address(2, "street1", "city1")));
m_localObjectArray->push_back(
- AddressPtr(new Address(3, "street2", "city2")));
+ std::shared_ptr<Address>(new Address(3, "street2", "city2")));
m_localObjectArray->push_back(
- AddressPtr(new Address(4, "street3", "city3")));
+ std::shared_ptr<Address>(new Address(4, "street3", "city3")));
m_localObjectArray->push_back(
- AddressPtr(new Address(5, "street4", "city4")));
+ std::shared_ptr<Address>(new Address(5, "street4", "city4")));
m_localObjectArray->push_back(
- AddressPtr(new Address(6, "street5", "city5")));
+ std::shared_ptr<Address>(new Address(6, "street5", "city5")));
m_localObjectArray->push_back(
- AddressPtr(new Address(7, "street6", "city6")));
+ std::shared_ptr<Address>(new Address(7, "street6", "city6")));
m_localObjectArray->push_back(
- AddressPtr(new Address(8, "street7", "city7")));
+ std::shared_ptr<Address>(new Address(8, "street7", "city7")));
m_localObjectArray->push_back(
- AddressPtr(new Address(9, "street8", "city8")));
+ std::shared_ptr<Address>(new Address(9, "street8", "city8")));
m_localObjectArray->push_back(
- AddressPtr(new Address(10, "street9", "city9")));
+ std::shared_ptr<Address>(new Address(10, "street9", "city9")));
// Get remote CacheableObjectArray on key 2
- CacheableKeyPtr keyport2 = CacheableKey::create(2);
+ auto keyport2 = CacheableKey::create(2);
LOGINFO("Client-2 PdxTests::PdxType GET OP Start....");
auto remoteCObjArray =
std::dynamic_pointer_cast<CacheableObjectArray>(regPtr0->get(keyport2));
@@ -3440,9 +3550,9 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepFour)
auto localPdxptr = std::make_shared<PdxTests::PdxType>();
- CacheableKeyPtr keyport = CacheableKey::create(1);
+ auto keyport = CacheableKey::create(1);
LOG("Client-2 PdxTests::PdxType GET OP Start....");
- PdxTests::PdxTypePtr remotePdxptr =
+ auto remotePdxptr =
std::dynamic_pointer_cast<PdxTests::PdxType>(regPtr0->get(keyport));
LOG("Client-2 PdxTests::PdxType GET OP Done....");
@@ -3498,8 +3608,8 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepFour)
->getCachePerfStats()
.getPdxDeSerializationBytes());
- CacheableKeyPtr keyport3 = CacheableKey::create(3);
- CacheableKeyPtr keyport4 = CacheableKey::create(4);
+ auto keyport3 = CacheableKey::create(3);
+ auto keyport4 = CacheableKey::create(4);
auto int32Ptr =
std::dynamic_pointer_cast<CacheableInt32>(regPtr0->get(keyport3));
auto int64Ptr =
diff --git a/cppcache/integration-test/testThinClientPoolAttrTest.cpp b/cppcache/integration-test/testThinClientPoolAttrTest.cpp
index 5d72831..369eb89 100644
--- a/cppcache/integration-test/testThinClientPoolAttrTest.cpp
+++ b/cppcache/integration-test/testThinClientPoolAttrTest.cpp
@@ -18,8 +18,6 @@
#include "ThinClientHelper.hpp"
#include "testUtils.hpp"
-#include "geode/GeodeCppCache.hpp"
-
/* This is to test
1) If Connections are left idle ,they timed out to min connections.
2) To validate PoolAttributes.
@@ -41,11 +39,11 @@ const char* poolName = "__TEST_POOL1__";
const char* poolName1 = "clientPool";
const char* serverGroup = "ServerGroup1";
-CachePtr cachePtr;
+std::shared_ptr<Cache> cachePtr;
class putThread : public ACE_Task_Base {
private:
- RegionPtr regPtr;
+ std::shared_ptr<Region> regPtr;
public:
explicit putThread(const char* name) : regPtr(getHelper()->getRegion(name)) {}
@@ -71,8 +69,7 @@ class putThread : public ACE_Task_Base {
};
void doAttrTestingAndCreatePool(const char* poolName) {
- PoolFactoryPtr poolFacPtr =
- getHelper()->getCache()->getPoolManager().createFactory();
+ auto poolFacPtr = getHelper()->getCache()->getPoolManager().createFactory();
poolFacPtr->setFreeConnectionTimeout(std::chrono::milliseconds(10000));
poolFacPtr->setLoadConditioningInterval(std::chrono::milliseconds(60000));
poolFacPtr->setSocketBufferSize(1024);
@@ -94,52 +91,50 @@ void doAttrTestingAndCreatePool(const char* poolName) {
// poolFacPtr->setMultiuserSecurityMode(true);
poolFacPtr->setPRSingleHopEnabled(false);
- PoolPtr pptr = poolFacPtr->create(poolName);
-
- // Validate the attributes
- ASSERT(pptr->getFreeConnectionTimeout() == std::chrono::milliseconds(10000),
- "FreeConnectionTimeout Should have been 10000");
- ASSERT(
- pptr->getLoadConditioningInterval() == std::chrono::milliseconds(60000),
- "LoadConditioningInterval Should have been 60000");
- ASSERT(pptr->getSocketBufferSize() == 1024,
- "SocketBufferSize Should have been 1024");
- ASSERT(pptr->getReadTimeout() == std::chrono::milliseconds(10000),
- "ReadTimeout Should have been 10000");
- ASSERT(pptr->getMinConnections() == 4, "MinConnections Should have been 4");
- ASSERT(pptr->getMaxConnections() == 8, "MaxConnections Should have been 8");
- ASSERT(pptr->getIdleTimeout() == std::chrono::seconds(5),
- "IdleTimeout Should have been 5s");
- ASSERT(pptr->getRetryAttempts() == 5, "RetryAttempts Should have been 5");
- ASSERT(pptr->getPingInterval() == std::chrono::milliseconds(120000),
- "PingInterval Should have been 120000");
- ASSERT(
- pptr->getUpdateLocatorListInterval() == std::chrono::milliseconds(122000),
- "UpdateLocatorListInterval Should have been 122000");
- ASSERT(pptr->getStatisticInterval() == std::chrono::milliseconds(120000),
- "StatisticInterval Should have been 120000");
- ASSERT(strcmp(pptr->getServerGroup(), "ServerGroup1") == 0,
- "ServerGroup Should have been ServerGroup1");
- ASSERT(pptr->getSubscriptionEnabled() == true,
- "SubscriptionEnabled Should have been true");
- ASSERT(pptr->getSubscriptionRedundancy() == 1,
- "SubscriptionRedundancy Should have been 1");
- ASSERT(pptr->getSubscriptionMessageTrackingTimeout() ==
- std::chrono::milliseconds(500000),
- "SubscriptionMessageTrackingTimeout Should have been 500000");
- ASSERT(
- pptr->getSubscriptionAckInterval() == std::chrono::milliseconds(120000),
- "SubscriptionAckInterval Should have been 120000");
- // ASSERT(pptr->getMultiuserSecurityMode()==true,"SetMultiuserSecurityMode
- // Should have been true");
- ASSERT(pptr->getPRSingleHopEnabled() == false,
- "PRSingleHopEnabled should have been false");
+ auto pptr = poolFacPtr->create(poolName);
+
+ // Validate the attributes
+ ASSERT(pptr->getFreeConnectionTimeout() == std::chrono::milliseconds(10000),
+ "FreeConnectionTimeout Should have been 10000");
+ ASSERT(pptr->getLoadConditioningInterval() == std::chrono::milliseconds(60000),
+ "LoadConditioningInterval Should have been 60000");
+ ASSERT(pptr->getSocketBufferSize() == 1024,
+ "SocketBufferSize Should have been 1024");
+ ASSERT(pptr->getReadTimeout() == std::chrono::milliseconds(10000),
+ "ReadTimeout Should have been 10000");
+ ASSERT(pptr->getMinConnections() == 4, "MinConnections Should have been 4");
+ ASSERT(pptr->getMaxConnections() == 8, "MaxConnections Should have been 8");
+ ASSERT(pptr->getIdleTimeout() == std::chrono::seconds(5),
+ "IdleTimeout Should have been 5s");
+ ASSERT(pptr->getRetryAttempts() == 5, "RetryAttempts Should have been 5");
+ ASSERT(pptr->getPingInterval() == std::chrono::milliseconds(120000),
+ "PingInterval Should have been 120000");
+ ASSERT(
+ pptr->getUpdateLocatorListInterval() == std::chrono::milliseconds(122000),
+ "UpdateLocatorListInterval Should have been 122000");
+ ASSERT(pptr->getStatisticInterval() == std::chrono::milliseconds(120000),
+ "StatisticInterval Should have been 120000");
+ ASSERT(strcmp(pptr->getServerGroup(), "ServerGroup1") == 0,
+ "ServerGroup Should have been ServerGroup1");
+ ASSERT(pptr->getSubscriptionEnabled() == true,
+ "SubscriptionEnabled Should have been true");
+ ASSERT(pptr->getSubscriptionRedundancy() == 1,
+ "SubscriptionRedundancy Should have been 1");
+ ASSERT(pptr->getSubscriptionMessageTrackingTimeout() ==
+ std::chrono::milliseconds(500000),
+ "SubscriptionMessageTrackingTimeout Should have been 500000");
+ ASSERT(pptr->getSubscriptionAckInterval() == std::chrono::milliseconds(120000),
+ "SubscriptionAckInterval Should have been 120000");
+ // ASSERT(pptr->getMultiuserSecurityMode()==true,"SetMultiuserSecurityMode
+ // Should have been true");
+ ASSERT(pptr->getPRSingleHopEnabled() == false,
+ "PRSingleHopEnabled should have been false");
}
void doAttrTesting(const char* poolName1) {
- // PoolFactoryPtr poolFacPtr = cachePtr->getPoolFactory();
- PoolPtr pptr = getHelper()->getCache()->getPoolManager().find(poolName1);
- // PoolPtr pptr = poolFacPtr->find(poolName1);
+ //auto poolFacPtr = cachePtr->getPoolFactory();
+ auto pptr = getHelper()->getCache()->getPoolManager().find(poolName1);
+ // auto pptr = poolFacPtr->find(poolName1);
ASSERT(strcmp(pptr->getName(), "clientPool") == 0,
"Pool name should have been clientPool");
@@ -199,25 +194,24 @@ END_TASK(StartS12)
DUNIT_TASK(CLIENT1, StartC1)
{
- PropertiesPtr props = Properties::create();
- props->insert("redundancy-monitor-interval", "120s");
- props->insert("statistic-sampling-enabled", "false");
- props->insert("statistic-sample-rate", "120s");
-
- initClient(true, props);
-
- doAttrTestingAndCreatePool(poolName);
-
- // Do PoolCreation testing , create another pool with same name
- PoolFactoryPtr poolFacPtr =
- getHelper()->getCache()->getPoolManager().createFactory();
- try {
- PoolPtr pptr = poolFacPtr->create(poolName);
- FAIL("Pool creation with same name should fail");
- } catch (IllegalStateException&) {
- LOG("OK:Pool creation with same name should fail");
- } catch (...) {
- FAIL("Pool creation with same name should fail");
+ auto props = Properties::create();
+ props->insert("redundancy-monitor-interval", "120s");
+ props->insert("statistic-sampling-enabled", "false");
+ props->insert("statistic-sample-rate", "120s");
+
+ initClient(true, props);
+
+ doAttrTestingAndCreatePool(poolName);
+
+ // Do PoolCreation testing , create another pool with same name
+ auto poolFacPtr = getHelper()->getCache()->getPoolManager().createFactory();
+ try {
+ auto pptr = poolFacPtr->create(poolName);
+ FAIL("Pool creation with same name should fail");
+ } catch (IllegalStateException&) {
+ LOG("OK:Pool creation with same name should fail");
+ } catch (...) {
+ FAIL("Pool creation with same name should fail");
}
createRegionAndAttachPool(poolRegNames[0], USE_ACK, poolName);
@@ -227,26 +221,26 @@ END_TASK(StartC1)
DUNIT_TASK(CLIENT2, StartC2)
{
- PropertiesPtr props = Properties::create();
- std::string path = "cacheserver_pool_client.xml";
- std::string duplicateFile;
- CacheHelper::createDuplicateXMLFile(duplicateFile, path);
-
- props->insert("cache-xml-file", duplicateFile.c_str());
-
- try {
- LOG(" starts client");
- initClient(true, props);
- LOG(" started client");
- ASSERT(getHelper()
- ->getCache()
- ->getPoolManager()
- .find("clientPoolMultiUser")
- ->getMultiuserAuthentication() == true,
- "MultiUser secure mode should be true for Pool");
- } catch (const Exception& excp) {
- LOG("Exception during client 2 XML creation");
- LOG(excp.getMessage());
+ auto props = Properties::create();
+ std::string path = "cacheserver_pool_client.xml";
+ std::string duplicateFile;
+ CacheHelper::createDuplicateXMLFile(duplicateFile, path);
+
+ props->insert("cache-xml-file", duplicateFile.c_str());
+
+ try {
+ LOG(" starts client");
+ initClient(true, props);
+ LOG(" started client");
+ ASSERT(getHelper()
+ ->getCache()
+ ->getPoolManager()
+ .find("clientPoolMultiUser")
+ ->getMultiuserAuthentication() == true,
+ "MultiUser secure mode should be true for Pool");
+ } catch (const Exception& excp) {
+ LOG("Exception during client 2 XML creation");
+ LOG(excp.getMessage());
}
doAttrTesting(poolName1);
}
diff --git a/cppcache/integration-test/testThinClientPoolExecuteFunction.cpp b/cppcache/integration-test/testThinClientPoolExecuteFunction.cpp
index fc582fe..36d3c24 100644
--- a/cppcache/integration-test/testThinClientPoolExecuteFunction.cpp
+++ b/cppcache/integration-test/testThinClientPoolExecuteFunction.cpp
@@ -17,13 +17,15 @@
#include "fw_dunit.hpp"
#include "ThinClientHelper.hpp"
#include "testobject/VariousPdxTypes.hpp"
+
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
-
#include <ace/ACE.h>
+#include <geode/PdxInstanceFactory.hpp>
+#include <geode/UserFunctionExecutionException.hpp>
+#include <geode/FunctionService.hpp>
#include <geode/DefaultResultCollector.hpp>
-
using namespace PdxTests;
/* This is to test
1- funtion execution on pool
@@ -122,12 +124,13 @@ class MyResultCollector : public DefaultResultCollector {
m_getResultCount(0) {}
~MyResultCollector() {}
- CacheableVectorPtr getResult(std::chrono::milliseconds timeout) override {
+ std::shared_ptr<CacheableVector> getResult(
+ std::chrono::milliseconds timeout) override {
m_getResultCount++;
return DefaultResultCollector::getResult(timeout);
}
- void addResult(const CacheablePtr& resultItem) override {
+ void addResult(const std::shared_ptr<Cacheable>& resultItem) override {
m_addResultCount++;
if (resultItem == nullptr) {
return;
@@ -156,11 +159,10 @@ class MyResultCollector : public DefaultResultCollector {
uint32_t m_addResultCount;
uint32_t m_getResultCount;
};
-_GF_PTR_DEF_(MyResultCollector, MyResultCollectorPtr)
template <class _T>
bool validateResultTypeAndAllowUserFunctionExecutionException(
- const int32_t index, const CacheablePtr& result) {
+ const int32_t index, const std::shared_ptr<Cacheable>& result) {
if (auto intValue = std::dynamic_pointer_cast<_T>(result)) {
LOGINFO("%s is %d ", typeid(_T).name(), intValue->value());
return true;
@@ -181,7 +183,7 @@ bool validateResultTypeAndAllowUserFunctionExecutionException(
}
bool validateResultTypeIsUserFunctionExecutionException(
- const int32_t index, const CacheablePtr& result) {
+ const int32_t index, const std::shared_ptr<Cacheable>& result) {
if (auto uFEPtr =
std::dynamic_pointer_cast<UserFunctionExecutionException>(result)) {
LOGINFO("Done casting to uFEPtr");
@@ -197,7 +199,7 @@ bool validateResultTypeIsUserFunctionExecutionException(
}
template <class _T>
-bool validateResultType(const int32_t index, const CacheablePtr& result) {
+bool validateResultType(const int32_t index, const std::shared_ptr<Cacheable>& result) {
return false;
}
@@ -261,7 +263,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
}
SLEEP(10000); // let the put finish
try {
- CacheablePtr args = CacheableBoolean::create(1);
+ std::shared_ptr<Cacheable> args = CacheableBoolean::create(1);
auto routingObj = CacheableVector::create();
for (int i = 0; i < 34; i++) {
if (i % 2 == 0) continue;
@@ -275,7 +277,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
auto exc = FunctionService::onRegion(regPtr0);
ASSERT(exc != nullptr, "onRegion Returned nullptr");
args = CacheableKey::create("echoString");
- CacheablePtr args1 = CacheableKey::create("echoBoolean");
+ std::shared_ptr<Cacheable> args1 = CacheableKey::create("echoBoolean");
auto exe1 = exc->withArgs(args);
auto exe2 = exe1->withArgs(args1);
@@ -343,16 +345,6 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
->withArgs(args)
->execute(getFuncName)
->getResult();
- /****
- **decomposed from above long expression:
- exc = exc->withFilter(routingObj);
- ASSERT(exc!=nullptr, "withFilter Returned nullptr");
- exc = exc->withArgs(args);
- ASSERT(exc!=nullptr, "withArgs Returned nullptr");
- ResultCollectorPtr rc = exc->execute(getFuncName, getResult);
- ASSERT(rc!=nullptr, "execute Returned nullptr");
- CacheableVectorPtr executeFunctionResult = rc->getResult();
- */
if (executeFunctionResult == nullptr) {
ASSERT(false, "region get: executeFunctionResult is nullptr");
} else {
@@ -382,7 +374,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
LOG(buf);
verifyGetResults()
} else {
- CacheablePtr tmp = resultList->operator[](i);
+ std::shared_ptr<Cacheable> tmp = resultList->operator[](i);
if (tmp != nullptr) {
printf(" in typeid = %d \n", tmp->typeId());
@@ -441,7 +433,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
for (int i = 0; i < 34; i++) {
if (i % 2 == 0) continue;
sprintf(buf, "KEY--%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
+ auto key = CacheableKey::create(buf);
auto value =
std::dynamic_pointer_cast<CacheableString>(regPtr0->get(key));
sprintf(buf, "Region put: result[%d]=%s", i, value->asChar());
@@ -626,8 +618,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
// test data independant function
// test get function with result
args = routingObj;
- // ExecutionPtr exc=nullptr;
- // CacheableVectorPtr executeFunctionResult = nullptr;
+
// test data independant function on one server
LOG("test data independant get function on one server");
exc = FunctionService::onServer(getHelper()->cachePtr);
@@ -684,7 +675,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
// onServers-------------------------------//
try {
- SerializationRegistryPtr serializationRegistry =
+ auto serializationRegistry =
CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
->getSerializationRegistry();
serializationRegistry->addPdxType(
@@ -766,7 +757,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
for (int i = 0; i < 34; i++) {
sprintf(buf, "KEY--pdx%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
+ auto key = CacheableKey::create(buf);
regPtr0->put(key, pdxobj);
}
LOGINFO("put on pdxObject done");
@@ -775,7 +766,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
for (int i = 0; i < 34; i++) {
if (i % 2 == 0) continue;
sprintf(buf, "KEY--pdx%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
+ auto key = CacheableKey::create(buf);
pdxInstanceRoutingObj->push_back(key);
}
@@ -1128,7 +1119,7 @@ END_TASK_DEFINITION
class putThread : public ACE_Task_Base {
private:
- RegionPtr regPtr;
+ std::shared_ptr<Region> regPtr;
int m_min;
int m_max;
int m_failureCount;
@@ -1136,7 +1127,7 @@ class putThread : public ACE_Task_Base {
volatile bool m_stop;
public:
- putThread(RegionPtr rp, int min, int max, bool isWarmUpTask)
+ putThread(std::shared_ptr<Region> rp, int min, int max, bool isWarmUpTask)
: regPtr(rp),
m_min(min),
m_max(max),
@@ -1150,8 +1141,8 @@ class putThread : public ACE_Task_Base {
int svc(void) {
bool networkhop ATTR_UNUSED = false;
- CacheablePtr args = nullptr;
- ResultCollectorPtr rPtr = nullptr;
+ std::shared_ptr<Cacheable> args = nullptr;
+ std::shared_ptr<ResultCollector> rPtr = nullptr;
auto regPtr0 = getHelper()->getRegion(poolRegNames[0]);
while (!m_stop) {
for (int i = m_min; i < m_max; i++) {
@@ -1188,8 +1179,8 @@ class putThread : public ACE_Task_Base {
void executeFunction() {
auto regPtr0 = getHelper()->getRegion(poolRegNames[0]);
TestUtils::getCacheImpl(getHelper()->cachePtr)->getAndResetNetworkHopFlag();
- CacheablePtr args = nullptr;
- ResultCollectorPtr rPtr = nullptr;
+std::shared_ptr<Cacheable> args = nullptr;
+std::shared_ptr<ResultCollector> rPtr = nullptr;
int failureCount = 0;
LOGINFO("executeFunction started");
for (int i = 0; i < 300; i++) {
diff --git a/cppcache/integration-test/testThinClientPoolExecuteFunctionDisableChunkHandlerThread.cpp b/cppcache/integration-test/testThinClientPoolExecuteFunctionDisableChunkHandlerThread.cpp
index 7479da0..ec1a91d 100644
--- a/cppcache/integration-test/testThinClientPoolExecuteFunctionDisableChunkHandlerThread.cpp
+++ b/cppcache/integration-test/testThinClientPoolExecuteFunctionDisableChunkHandlerThread.cpp
@@ -15,6 +15,7 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
+#include <geode/FunctionService.hpp>
#include "ThinClientHelper.hpp"
#include "testobject/VariousPdxTypes.hpp"
#include <ace/OS.h>
@@ -85,8 +86,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StartC1)
// createPool(poolName, locHostPort,serverGroup, nullptr, 0, true );
// createRegionAndAttachPool(poolRegNames[0],USE_ACK, poolName);
- RegionPtr regPtr0 =
- createRegionAndAttachPool(poolRegNames[0], USE_ACK, nullptr);
+ auto regPtr0 = createRegionAndAttachPool(poolRegNames[0], USE_ACK, nullptr);
; // getHelper()->createRegion( poolRegNames[0], USE_ACK);
regPtr0->registerAllKeys();
@@ -133,7 +133,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StartTestClient)
{
LOG("in before starting StartTestClient");
- PropertiesPtr config = Properties::create();
+ auto config = Properties::create();
config->insert("disable-chunk-handler-thread", "true");
config->insert("read-timeout-unit-in-millis", "true");
config->insert("ping-interval", "-1");
@@ -144,8 +144,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StartTestClient)
-1, -1, -1, true, false);
// createPool(poolName, locHostPort,serverGroup, nullptr, 0, true );
- RegionPtr regPtr0 =
- createRegionAndAttachPool(poolRegNames[0], USE_ACK, nullptr);
+ auto regPtr0 = createRegionAndAttachPool(poolRegNames[0], USE_ACK, nullptr);
; // getHelper()->createRegion( poolRegNames[0], USE_ACK);
LOG("StartTestClient complete.");
@@ -155,7 +154,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, StartTestClient2)
{
LOG("in before starting StartTestClient");
- PropertiesPtr config = Properties::create();
+ auto config = Properties::create();
config->insert("disable-chunk-handler-thread", "true");
config->insert("read-timeout-unit-in-millis", "true");
config->insert("ping-interval", "-1");
@@ -166,8 +165,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, StartTestClient2)
-1, -1, -1, true, false);
// createPool(poolName, locHostPort,serverGroup, nullptr, 0, true );
- RegionPtr regPtr0 =
- createRegionAndAttachPool(poolRegNames[0], USE_ACK, nullptr);
+ auto regPtr0 = createRegionAndAttachPool(poolRegNames[0], USE_ACK, nullptr);
; // getHelper()->createRegion( poolRegNames[0], USE_ACK);
LOG("StartTestClient complete.");
@@ -176,13 +174,13 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, clientPuts)
{
- RegionPtr regPtr0 = getHelper()->getRegion(poolRegNames[0]);
+ auto regPtr0 = getHelper()->getRegion(poolRegNames[0]);
char buf[128];
for (int i = 1; i <= 500; i++) {
- CacheablePtr value(CacheableInt32::create(i));
+ std::shared_ptr<Cacheable> value(CacheableInt32::create(i));
sprintf(buf, "am-%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
+ auto key = CacheableKey::create(buf);
regPtr0->put(key, value);
}
LOG("clientPuts complete.");
@@ -191,7 +189,7 @@ END_TASK_DEFINITION
class putThread : public ACE_Task_Base {
private:
- RegionPtr regPtr;
+ std::shared_ptr<Region> regPtr;
int m_min;
int m_max;
int m_failureCount;
@@ -199,7 +197,7 @@ class putThread : public ACE_Task_Base {
volatile bool m_stop;
public:
- putThread(RegionPtr rp, int min, int max, bool isWarmUpTask)
+ putThread(std::shared_ptr<Region> rp, int min, int max, bool isWarmUpTask)
: regPtr(rp),
m_min(min),
m_max(max),
@@ -213,19 +211,19 @@ class putThread : public ACE_Task_Base {
int svc(void) {
bool networkhop ATTR_UNUSED = false;
- CacheableKeyPtr keyPtr;
- CacheablePtr args = nullptr;
- ResultCollectorPtr rPtr = nullptr;
- RegionPtr regPtr0 = getHelper()->getRegion(poolRegNames[0]);
+ std::shared_ptr<CacheableKey> keyPtr;
+ std::shared_ptr<Cacheable> args = nullptr;
+ std::shared_ptr<ResultCollector> rPtr = nullptr;
+ auto regPtr0 = getHelper()->getRegion(poolRegNames[0]);
while (!m_stop) {
for (int i = m_min; i < m_max; i++) {
try {
char buf[128];
sprintf(buf, "am-%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
- CacheableVectorPtr routingObj = CacheableVector::create();
+ auto key = CacheableKey::create(buf);
+ auto routingObj = CacheableVector::create();
routingObj->push_back(key);
- ExecutionPtr exc = FunctionService::onRegion(regPtr0);
+ auto exc = FunctionService::onRegion(regPtr0);
exc->execute(routingObj, args, rPtr, getFuncName2,
std::chrono::seconds(300))
->getResult();
@@ -250,10 +248,10 @@ class putThread : public ACE_Task_Base {
};
void executeFunction() {
- RegionPtr regPtr0 = getHelper()->getRegion(poolRegNames[0]);
+ auto regPtr0 = getHelper()->getRegion(poolRegNames[0]);
TestUtils::getCacheImpl(getHelper()->cachePtr)->getAndResetNetworkHopFlag();
- CacheablePtr args = nullptr;
- ResultCollectorPtr rPtr = nullptr;
+ std::shared_ptr<Cacheable> args = nullptr;
+ std::shared_ptr<ResultCollector> rPtr = nullptr;
int failureCount = 0;
LOGINFO("executeFunction started");
for (int i = 0; i < 300; i++) {
@@ -265,10 +263,10 @@ void executeFunction() {
}
char buf[128];
sprintf(buf, "am-%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
- CacheableVectorPtr routingObj = CacheableVector::create();
+ auto key = CacheableKey::create(buf);
+ auto routingObj = CacheableVector::create();
routingObj->push_back(key);
- ExecutionPtr exc = FunctionService::onRegion(regPtr0);
+ auto exc = FunctionService::onRegion(regPtr0);
exc->execute(routingObj, args, rPtr, getFuncName2,
std::chrono::seconds(300))
->getResult();
@@ -282,7 +280,7 @@ putThread* threads[nThreads];
DUNIT_TASK_DEFINITION(CLIENT1, dofuncOps)
{
- RegionPtr regPtr0 = getHelper()->getRegion(poolRegNames[0]);
+ auto regPtr0 = getHelper()->getRegion(poolRegNames[0]);
// check nextwork hop for single key
executeFunction();
diff --git a/cppcache/integration-test/testThinClientPoolExecuteFunctionPrSHOP.cpp b/cppcache/integration-test/testThinClientPoolExecuteFunctionPrSHOP.cpp
index 855efa5..2669ec7 100644
--- a/cppcache/integration-test/testThinClientPoolExecuteFunctionPrSHOP.cpp
+++ b/cppcache/integration-test/testThinClientPoolExecuteFunctionPrSHOP.cpp
@@ -20,11 +20,15 @@
#include "fw_dunit.hpp"
#include "ThinClientHelper.hpp"
#include "testobject/VariousPdxTypes.hpp"
+#include <geode/PdxInstanceFactory.hpp>
+#include <geode/UserFunctionExecutionException.hpp>
+#include <geode/FunctionService.hpp>
+#include <geode/DefaultResultCollector.hpp>
#include "SerializationRegistry.hpp"
#include "CacheRegionHelper.hpp"
#include "CacheImpl.hpp"
-#include <geode/DefaultResultCollector.hpp>
+
using namespace PdxTests;
@@ -123,12 +127,13 @@ class MyResultCollector : public DefaultResultCollector {
: m_endResultCount(0), m_addResultCount(0), m_getResultCount(0) {}
~MyResultCollector() noexcept {}
- CacheableVectorPtr getResult(std::chrono::milliseconds timeout) override {
+ std::shared_ptr<CacheableVector> getResult(
+ std::chrono::milliseconds timeout) override {
m_getResultCount++;
return DefaultResultCollector::getResult(timeout);
}
- void addResult(const CacheablePtr& resultItem) override {
+ void addResult(const std::shared_ptr<Cacheable>& resultItem) override {
m_addResultCount++;
if (resultItem == nullptr) {
return;
@@ -157,11 +162,10 @@ class MyResultCollector : public DefaultResultCollector {
uint32_t m_addResultCount;
uint32_t m_getResultCount;
};
-_GF_PTR_DEF_(MyResultCollector, MyResultCollectorPtr)
template <class _T>
bool validateResultTypeAndAllowUserFunctionExecutionException(
- const int32_t index, const CacheablePtr& result) {
+ const int32_t index, const std::shared_ptr<Cacheable>& result) {
if (auto intValue = std::dynamic_pointer_cast<_T>(result)) {
LOGINFO("%s is %d ", typeid(_T).name(), intValue->value());
return true;
@@ -182,7 +186,7 @@ bool validateResultTypeAndAllowUserFunctionExecutionException(
}
bool validateResultTypeIsUserFunctionExecutionException(
- const int32_t index, const CacheablePtr& result) {
+ const int32_t index, const std::shared_ptr<Cacheable>& result) {
if (auto uFEPtr =
std::dynamic_pointer_cast<UserFunctionExecutionException>(result)) {
LOGINFO("Done casting to uFEPtr");
@@ -198,7 +202,7 @@ bool validateResultTypeIsUserFunctionExecutionException(
}
template <class _T>
-bool validateResultType(const int32_t index, const CacheablePtr& result) {
+bool validateResultType(const int32_t index, const std::shared_ptr<Cacheable>& result) {
return false;
}
@@ -253,7 +257,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
}
SLEEP(10000); // let the put finish
try {
- CacheablePtr args = CacheableBoolean::create(1);
+ std::shared_ptr<Cacheable> args = CacheableBoolean::create(1);
auto routingObj = CacheableVector::create();
for (int i = 0; i < 34; i++) {
if (i % 2 == 0) continue;
@@ -267,7 +271,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
auto exc = FunctionService::onRegion(regPtr0);
ASSERT(exc != nullptr, "onRegion Returned nullptr");
args = CacheableKey::create("echoString");
- CacheablePtr args1 = CacheableKey::create("echoBoolean");
+ std::shared_ptr<Cacheable> args1 = CacheableKey::create("echoBoolean");
auto exe1 = exc->withArgs(args);
auto exe2 = exe1->withArgs(args1);
@@ -341,9 +345,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
ASSERT(exc!=nullptr, "withFilter Returned nullptr");
exc = exc->withArgs(args);
ASSERT(exc!=nullptr, "withArgs Returned nullptr");
- ResultCollectorPtr rc = exc->execute(getFuncName);
+ auto rc = exc->execute(getFuncName);
ASSERT(rc!=nullptr, "execute Returned nullptr");
- CacheableVectorPtr executeFunctionResult = rc->getResult();
+ auto executeFunctionResult = rc->getResult();
*/
if (executeFunctionResult == nullptr) {
ASSERT(false, "region get: executeFunctionResult is nullptr");
@@ -374,7 +378,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
LOG(buf);
verifyGetResults()
} else {
- CacheablePtr tmp = resultList->operator[](i);
+ std::shared_ptr<Cacheable> tmp = resultList->operator[](i);
if (tmp != nullptr) {
printf(" in typeid = %d \n", tmp->typeId());
@@ -433,7 +437,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
for (int i = 0; i < 34; i++) {
if (i % 2 == 0) continue;
sprintf(buf, "KEY--%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
+ auto key = CacheableKey::create(buf);
auto value =
std::dynamic_pointer_cast<CacheableString>(regPtr0->get(key));
sprintf(buf, "Region put: result[%d]=%s", i, value->asChar());
@@ -618,8 +622,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
// test data independant function
// test get function with result
args = routingObj;
- // ExecutionPtr exc=nullptr;
- // CacheableVectorPtr executeFunctionResult = nullptr;
+
// test data independant function on one server
LOG("test data independant get function on one server");
exc = FunctionService::onServer(getHelper()->cachePtr);
@@ -676,7 +679,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
// onServers-------------------------------//
try {
- SerializationRegistryPtr serializationRegistry =
+ auto serializationRegistry =
CacheRegionHelper::getCacheImpl(getHelper()->getCache().get())
->getSerializationRegistry();
@@ -759,7 +762,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
for (int i = 0; i < 34; i++) {
sprintf(buf, "KEY--pdx%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
+ auto key = CacheableKey::create(buf);
regPtr0->put(key, pdxobj);
}
LOGINFO("put on pdxObject done");
@@ -768,7 +771,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
for (int i = 0; i < 34; i++) {
if (i % 2 == 0) continue;
sprintf(buf, "KEY--pdx%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
+ auto key = CacheableKey::create(buf);
pdxInstanceRoutingObj->push_back(key);
}
diff --git a/cppcache/integration-test/testThinClientPoolExecuteFunctionThrowsException.cpp b/cppcache/integration-test/testThinClientPoolExecuteFunctionThrowsException.cpp
index 9b3bbd6..d2befe3 100644
--- a/cppcache/integration-test/testThinClientPoolExecuteFunctionThrowsException.cpp
+++ b/cppcache/integration-test/testThinClientPoolExecuteFunctionThrowsException.cpp
@@ -17,13 +17,14 @@
#define ROOT_NAME "testThinClientPoolExecuteFunctionThrowsException"
-#include "fw_dunit.hpp"
-#include "ThinClientHelper.hpp"
-#include "testobject/VariousPdxTypes.hpp"
-
#include <thread>
#include <chrono>
+#include "fw_dunit.hpp"
+#include "ThinClientHelper.hpp"
+#include "testobject/VariousPdxTypes.hpp"
+#include <geode/UserFunctionExecutionException.hpp>
+#include <geode/FunctionService.hpp>
#include <geode/DefaultResultCollector.hpp>
using namespace PdxTests;
@@ -58,42 +59,48 @@ char* FEOnRegionPrSHOP_OptimizeForWrite =
(char*)"FEOnRegionPrSHOP_OptimizeForWrite";
char* FETimeOut = (char*)"FunctionExecutionTimeOut";
-#define verifyGetResults() \
- bool found = false; \
- for (int j = 0; j < 34; j++) { \
- if (j % 2 == 0) continue; \
- sprintf(buf, "VALUE--%d", j); \
- if (strcmp(buf, dynCast<CacheableStringPtr>(resultList->operator[](i)) \
- ->asChar()) == 0) { \
- LOGINFO( \
- "buf = %s " \
- "dynCast<CacheableStringPtr>(resultList->operator[](i))->asChar() " \
- "= %s ", \
- buf, \
- dynCast<CacheableStringPtr>(resultList->operator[](i))->asChar()); \
- found = true; \
- break; \
- } \
- } \
+#define verifyGetResults() \
+ bool found = false; \
+ for (int j = 0; j < 34; j++) { \
+ if (j % 2 == 0) continue; \
+ sprintf(buf, "VALUE--%d", j); \
+ if (strcmp(buf, dynCast<std::shared_ptr<CacheableString>>( \
+ resultList->operator[](i)) \
+ ->asChar()) == 0) { \
+ LOGINFO( \
+ "buf = %s " \
+ "dynCast<std::shared_ptr<CacheableString>>(resultList->operator[](" \
+ "i))->asChar() " \
+ "= %s ", \
+ buf, \
+ dynCast<std::shared_ptr<CacheableString>>(resultList->operator[](i)) \
+ ->asChar()); \
+ found = true; \
+ break; \
+ } \
+ } \
ASSERT(found, "this returned value is invalid");
-#define verifyGetKeyResults() \
- bool found = false; \
- for (int j = 0; j < 34; j++) { \
- if (j % 2 == 0) continue; \
- sprintf(buf, "KEY--%d", j); \
- if (strcmp(buf, dynCast<CacheableStringPtr>(resultList->operator[](i)) \
- ->asChar()) == 0) { \
- LOGINFO( \
- "buf = %s " \
- "dynCast<CacheableStringPtr>(resultList->operator[](i))->asChar() " \
- "= %s ", \
- buf, \
- dynCast<CacheableStringPtr>(resultList->operator[](i))->asChar()); \
- found = true; \
- break; \
- } \
- } \
+#define verifyGetKeyResults() \
+ bool found = false; \
+ for (int j = 0; j < 34; j++) { \
+ if (j % 2 == 0) continue; \
+ sprintf(buf, "KEY--%d", j); \
+ if (strcmp(buf, dynCast<std::shared_ptr<CacheableString>>( \
+ resultList->operator[](i)) \
+ ->asChar()) == 0) { \
+ LOGINFO( \
+ "buf = %s " \
+ "dynCast<std::shared_ptr<CacheableString>>(resultList->operator[](" \
+ "i))->asChar() " \
+ "= %s ", \
+ buf, \
+ dynCast<std::shared_ptr<CacheableString>>(resultList->operator[](i)) \
+ ->asChar()); \
+ found = true; \
+ break; \
+ } \
+ } \
ASSERT(found, "this returned KEY is invalid");
#define verifyPutResults() \
@@ -114,12 +121,13 @@ class MyResultCollector : public DefaultResultCollector {
: m_endResultCount(0), m_addResultCount(0), m_getResultCount(0) {}
~MyResultCollector() {}
- CacheableVectorPtr getResult(std::chrono::milliseconds timeout) override {
+ std::shared_ptr<CacheableVector> getResult(
+ std::chrono::milliseconds timeout) override {
m_getResultCount++;
return DefaultResultCollector::getResult(timeout);
}
- void addResult(const CacheablePtr& resultItem) override {
+ void addResult(const std::shared_ptr<Cacheable>& resultItem) override {
m_addResultCount++;
if (resultItem == nullptr) {
return;
@@ -148,7 +156,6 @@ class MyResultCollector : public DefaultResultCollector {
uint32_t m_addResultCount;
uint32_t m_getResultCount;
};
-typedef std::shared_ptr<MyResultCollector> MyResultCollectorPtr;
DUNIT_TASK_DEFINITION(LOCATOR1, StartLocator1)
{
@@ -182,8 +189,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StartC1)
// createPool(poolName, locHostPort,serverGroup, nullptr, 0, true );
// createRegionAndAttachPool(poolRegNames[0],USE_ACK, poolName);
- RegionPtr regPtr0 =
- createRegionAndAttachPool(poolRegNames[0], USE_ACK, nullptr);
+ auto regPtr0 = createRegionAndAttachPool(poolRegNames[0], USE_ACK, nullptr);
; // getHelper()->createRegion( poolRegNames[0], USE_ACK);
regPtr0->registerAllKeys();
@@ -193,15 +199,15 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
{
- RegionPtr regPtr0 = getHelper()->getRegion(poolRegNames[0]);
+ auto regPtr0 = getHelper()->getRegion(poolRegNames[0]);
char buf[128];
for (int i = 0; i < 34; i++) {
sprintf(buf, "VALUE--%d", i);
- CacheablePtr value(CacheableString::create(buf));
+ std::shared_ptr<Cacheable> value(CacheableString::create(buf));
sprintf(buf, "KEY--%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
+ auto key = CacheableKey::create(buf);
regPtr0->put(key, value);
}
std::this_thread::sleep_for(
@@ -211,41 +217,40 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
// onRegion-------------------------------//
for (int i = 1; i <= 200; i++) {
- CacheablePtr value(CacheableInt32::create(i));
+ std::shared_ptr<Cacheable> value(CacheableInt32::create(i));
sprintf(buf, "execKey-%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
+ auto key = CacheableKey::create(buf);
regPtr0->put(key, value);
}
LOG("Put for execKey's on region complete.");
LOG("Adding filter");
- CacheableArrayListPtr arrList = CacheableArrayList::create();
- for (int i = 100; i < 120; i++) {
- sprintf(buf, "execKey-%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
- arrList->push_back(key);
- }
+ auto arrList = CacheableArrayList::create();
+ for (int i = 100; i < 120; i++) {
+ sprintf(buf, "execKey-%d", i);
+ auto key = CacheableKey::create(buf);
+ arrList->push_back(key);
+ }
- CacheableVectorPtr filter = CacheableVector::create();
- for (int i = 100; i < 120; i++) {
- sprintf(buf, "execKey-%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
- filter->push_back(key);
- }
- LOG("Adding filter done.");
+ auto filter = CacheableVector::create();
+ for (int i = 100; i < 120; i++) {
+ sprintf(buf, "execKey-%d", i);
+ auto key = CacheableKey::create(buf);
+ filter->push_back(key);
+ }
+ LOG("Adding filter done.");
- CacheablePtr args = CacheableBoolean::create(1);
+ auto args = CacheableBoolean::create(1);
- ExecutionPtr funcExec = FunctionService::onRegion(regPtr0);
- ASSERT(funcExec != nullptr, "onRegion Returned nullptr");
+ auto funcExec = FunctionService::onRegion(regPtr0);
+ ASSERT(funcExec != nullptr, "onRegion Returned nullptr");
- ResultCollectorPtr collector =
- funcExec->withArgs(args)->withFilter(filter)->execute(
- exFuncNameSendException, std::chrono::seconds(15));
- ASSERT(collector != nullptr, "onRegion collector nullptr");
+ auto collector = funcExec->withArgs(args)->withFilter(filter)->execute(
+ exFuncNameSendException, std::chrono::seconds(15));
+ ASSERT(collector != nullptr, "onRegion collector nullptr");
- CacheableVectorPtr result = collector->getResult();
+ auto result = collector->getResult();
if (result == nullptr) {
ASSERT(false, "echo String : result is nullptr");
@@ -273,12 +278,12 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
std::this_thread::sleep_for(std::chrono::seconds(2));
try {
- CacheableVectorPtr fil = CacheableVector::create();
+ auto fil = CacheableVector::create();
fil->push_back(CacheableInt32::create(1));
- ExecutionPtr exe = FunctionService::onRegion(regPtr0);
+ auto exe = FunctionService::onRegion(regPtr0);
LOGINFO("Executing the exception test it is expected to throw.");
- CacheableVectorPtr executeFunctionResult3 =
+ auto executeFunctionResult3 =
funcExec->withArgs(arrList)
->withFilter(filter)
->execute("ThinClientRegionExceptionTest",
diff --git a/cppcache/integration-test/testThinClientPoolExecuteHAFunction.cpp b/cppcache/integration-test/testThinClientPoolExecuteHAFunction.cpp
index c779a1c..be5ac9c 100644
--- a/cppcache/integration-test/testThinClientPoolExecuteHAFunction.cpp
+++ b/cppcache/integration-test/testThinClientPoolExecuteHAFunction.cpp
@@ -72,12 +72,13 @@ class MyResultCollector : public DefaultResultCollector {
: m_endResultCount(0), m_addResultCount(0), m_getResultCount(0) {}
~MyResultCollector() {}
- CacheableVectorPtr getResult(std::chrono::milliseconds timeout) override {
+ std::shared_ptr<CacheableVector> getResult(
+ std::chrono::milliseconds timeout) override {
m_getResultCount++;
return DefaultResultCollector::getResult(timeout);
}
- void addResult(const CacheablePtr& resultItem) override {
+ void addResult(const std::shared_ptr<Cacheable>& resultItem) override {
m_addResultCount++;
if (resultItem == nullptr) {
return;
@@ -153,8 +154,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StartC1)
// createPool(poolName, locHostPort,serverGroup, nullptr, 0, true );
// createRegionAndAttachPool(poolRegNames[0],USE_ACK, poolName);
- RegionPtr regPtr0 =
- createRegionAndAttachPool(poolRegNames[0], USE_ACK, nullptr);
+ auto regPtr0 = createRegionAndAttachPool(poolRegNames[0], USE_ACK, nullptr);
; // getHelper()->createRegion( poolRegNames[0], USE_ACK);
regPtr0->registerAllKeys();
@@ -168,7 +168,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StartC11)
createPool(poolName, locHostPort, serverGroup, 0, true);
createRegionAndAttachPool(poolRegNames[0], USE_ACK, poolName);
- RegionPtr regPtr0 = getHelper()->getRegion(poolRegNames[0]);
+ auto regPtr0 = getHelper()->getRegion(poolRegNames[0]);
regPtr0->registerAllKeys();
LOG("Clnt1Init complete.");
@@ -194,7 +194,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
for (int i = 0; i < 34; i++) {
if (i % 2 == 0) continue;
sprintf(buf, "KEY--%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
+ auto key = CacheableKey::create(buf);
routingObj->push_back(key);
}
// UNUSED bool getResult = true;
diff --git a/cppcache/integration-test/testThinClientPoolExecuteHAFunctionPrSHOP.cpp b/cppcache/integration-test/testThinClientPoolExecuteHAFunctionPrSHOP.cpp
index 77e3a31..dd613df 100644
--- a/cppcache/integration-test/testThinClientPoolExecuteHAFunctionPrSHOP.cpp
+++ b/cppcache/integration-test/testThinClientPoolExecuteHAFunctionPrSHOP.cpp
@@ -72,12 +72,13 @@ class MyResultCollector : public DefaultResultCollector {
: m_endResultCount(0), m_addResultCount(0), m_getResultCount(0) {}
~MyResultCollector() noexcept {}
- CacheableVectorPtr getResult(std::chrono::milliseconds timeout) override {
+ std::shared_ptr<CacheableVector> getResult(
+ std::chrono::milliseconds timeout) override {
m_getResultCount++;
return DefaultResultCollector::getResult(timeout);
}
- void addResult(const CacheablePtr& resultItem) override {
+ void addResult(const std::shared_ptr<Cacheable>& resultItem) override {
m_addResultCount++;
if (resultItem == nullptr) {
return;
@@ -151,8 +152,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StartC1)
// createPool(poolName, locHostPort,serverGroup, nullptr, 0, true );
// createRegionAndAttachPool(poolRegNames[0],USE_ACK, poolName);
- RegionPtr regPtr0 =
- createRegionAndAttachPool(poolRegNames[0], USE_ACK, nullptr);
+ auto regPtr0 = createRegionAndAttachPool(poolRegNames[0], USE_ACK, nullptr);
// getHelper()->createRegion( poolRegNames[0], USE_ACK);
regPtr0->registerAllKeys();
@@ -166,7 +166,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StartC11)
createPool(poolName, locHostPort, serverGroup, 0, true);
createRegionAndAttachPool(poolRegNames[0], USE_ACK, poolName);
- RegionPtr regPtr0 = getHelper()->getRegion(poolRegNames[0]);
+ auto regPtr0 = getHelper()->getRegion(poolRegNames[0]);
regPtr0->registerAllKeys();
LOG("Clnt1Init complete.");
@@ -196,7 +196,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OpTest)
routingObj->push_back(key);
}
// UNUSED bool getResult = true;
- ExecutionPtr exc = FunctionService::onRegion(regPtr0);
+ auto exc = FunctionService::onRegion(regPtr0);
ASSERT(exc != nullptr, "onRegion Returned nullptr");
auto resultList = CacheableVector::create();
@@ -270,7 +270,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, Client1OnServerHATest)
for (int i = 0; i < 34; i++) {
if (i % 2 == 0) continue;
sprintf(buf, "KEY--%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
+ auto key = CacheableKey::create(buf);
routingObj->push_back(key);
}
diff --git a/cppcache/integration-test/testThinClientPoolRedundancy.cpp b/cppcache/integration-test/testThinClientPoolRedundancy.cpp
index 1703a6a..f196171 100644
--- a/cppcache/integration-test/testThinClientPoolRedundancy.cpp
+++ b/cppcache/integration-test/testThinClientPoolRedundancy.cpp
@@ -113,9 +113,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateClient1_1)
feedEntries(0);
- RegionPtr regPtr0 = getHelper()->getRegion(poolRegNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(poolRegNames[1]);
- RegionPtr regPtr2 = getHelper()->getRegion(poolRegNames[2]);
+ auto regPtr0 = getHelper()->getRegion(poolRegNames[0]);
+ auto regPtr1 = getHelper()->getRegion(poolRegNames[1]);
+ auto regPtr2 = getHelper()->getRegion(poolRegNames[2]);
regPtr0->registerAllKeys(false, true);
regPtr1->registerAllKeys(false, true);
@@ -141,9 +141,9 @@ DUNIT_TASK_DEFINITION(CLIENT2, CreateClient2_1)
feedEntries(1);
- RegionPtr regPtr0 = getHelper()->getRegion(poolRegNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(poolRegNames[1]);
- RegionPtr regPtr2 = getHelper()->getRegion(poolRegNames[2]);
+ auto regPtr0 = getHelper()->getRegion(poolRegNames[0]);
+ auto regPtr1 = getHelper()->getRegion(poolRegNames[1]);
+ auto regPtr2 = getHelper()->getRegion(poolRegNames[2]);
regPtr0->registerAllKeys(false, true);
regPtr1->registerAllKeys(false, true);
@@ -172,9 +172,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateClient1_2)
feedEntries(0);
- RegionPtr regPtr0 = getHelper()->getRegion(poolRegNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(poolRegNames[1]);
- RegionPtr regPtr2 = getHelper()->getRegion(poolRegNames[2]);
+ auto regPtr0 = getHelper()->getRegion(poolRegNames[0]);
+ auto regPtr1 = getHelper()->getRegion(poolRegNames[1]);
+ auto regPtr2 = getHelper()->getRegion(poolRegNames[2]);
regPtr0->registerAllKeys(false, true);
regPtr1->registerAllKeys(false, true);
@@ -200,9 +200,9 @@ DUNIT_TASK_DEFINITION(CLIENT2, CreateClient2_2)
feedEntries(1);
- RegionPtr regPtr0 = getHelper()->getRegion(poolRegNames[0]);
- RegionPtr regPtr1 = getHelper()->getRegion(poolRegNames[1]);
- RegionPtr regPtr2 = getHelper()->getRegion(poolRegNames[2]);
+ auto regPtr0 = getHelper()->getRegion(poolRegNames[0]);
+ auto regPtr1 = getHelper()->getRegion(poolRegNames[1]);
+ auto regPtr2 = getHelper()->getRegion(poolRegNames[2]);
regPtr0->registerAllKeys(false, true);
regPtr1->registerAllKeys(false, true);
@@ -268,9 +268,9 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, VerifyK1C1New2)
{
- RegionPtr regPtr = getHelper()->getRegion(poolRegNames[2]);
+ auto regPtr = getHelper()->getRegion(poolRegNames[2]);
- CacheableKeyPtr keyPtr = createKey(keys[1]);
+ auto keyPtr = createKey(keys[1]);
auto checkPtr =
std::dynamic_pointer_cast<CacheableString>(regPtr->get(keyPtr));
diff --git a/cppcache/integration-test/testThinClientPoolRegInterest.cpp b/cppcache/integration-test/testThinClientPoolRegInterest.cpp
index 87b99bd..be45207 100644
--- a/cppcache/integration-test/testThinClientPoolRegInterest.cpp
+++ b/cppcache/integration-test/testThinClientPoolRegInterest.cpp
@@ -61,7 +61,7 @@ DUNIT_TASK(CLIENT1, StartC1)
createPool(poolName, locHostPort, serverGroup, 0, true);
createRegionAndAttachPool(poolRegNames[0], USE_ACK, poolName);
- RegionPtr regPtr0 = getHelper()->getRegion(poolRegNames[0]);
+ auto regPtr0 = getHelper()->getRegion(poolRegNames[0]);
regPtr0->registerAllKeys();
LOG("Clnt1Init complete.");
diff --git a/cppcache/integration-test/testThinClientPutAllPRSingleHop.cpp b/cppcache/integration-test/testThinClientPutAllPRSingleHop.cpp
index a2ffc8c..703fe72 100644
--- a/cppcache/integration-test/testThinClientPutAllPRSingleHop.cpp
+++ b/cppcache/integration-test/testThinClientPutAllPRSingleHop.cpp
@@ -14,22 +14,22 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+#define ROOT_NAME "testThinClientPutAllPRSingleHop"
+#define ROOT_SCOPE DISTRIBUTED_ACK
+
#include <string>
#include <ace/ACE.h>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
-#include <geode/GeodeCppCache.hpp>
#include <geode/statistics/StatisticsFactory.hpp>
#include "fw_dunit.hpp"
#include "BuiltinCacheableWrappers.hpp"
#include "Utils.hpp"
-#define ROOT_NAME "testThinClientPutAllPRSingleHop"
-#define ROOT_SCOPE DISTRIBUTED_ACK
-
#include "CacheHelper.hpp"
// Include these 2 headers for access to CacheImpl for test hooks.
@@ -107,7 +107,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepOne_Pooled_EndpointTL)
{
initClient(true);
- RegionPtr regPtr = getHelper()->createPooledRegionStickySingleHop(
+ auto regPtr = getHelper()->createPooledRegionStickySingleHop(
regionNames[0], USE_ACK, nullptr, "__TEST_POOL1__", false, false);
ASSERT(regPtr != nullptr, "Failed to create region.");
regPtr = getHelper()->createPooledRegionStickySingleHop(
@@ -123,7 +123,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, WarmUpTask)
LOG("WarmUpTask started.");
int failureCount = 0;
int metadatarefreshCount = 0;
- RegionPtr dataReg = getHelper()->getRegion(regionNames[0]);
+ auto dataReg = getHelper()->getRegion(regionNames[0]);
// This is to get MetaDataService going.
for (int i = 3000; i < 8000; i++) {
@@ -199,7 +199,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopForIntKeysTask)
{
LOG("CheckPrSingleHopForIntKeysTask started.");
- RegionPtr dataReg = getHelper()->getRegion(regionNames[0]);
+ auto dataReg = getHelper()->getRegion(regionNames[0]);
LOG("CheckPrSingleHopForIntKeysTask get completed.");
@@ -261,7 +261,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopRemoveAllForIntKeysTask)
{
LOG("CheckPrSingleHopRemoveAllForIntKeysTask started.");
- RegionPtr dataReg = getHelper()->getRegion(regionNames[0]);
+ auto dataReg = getHelper()->getRegion(regionNames[0]);
LOG("CheckPrSingleHopForIntKeysTask get completed.");
@@ -269,7 +269,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CheckPrSingleHopRemoveAllForIntKeysTask)
LOGINFO("Iteration removeAll Start ");
try {
HashMapOfCacheable valMap;
- VectorOfCacheableKey keys;
+ std::vector<std::shared_ptr<CacheableKey>> keys;
for (int j = 1000; j < 25000; j++) {
auto keyPtr = CacheableInt32::create(j);
auto valPtr = CacheableInt32::create(keyPtr->hashcode());
@@ -335,7 +335,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, CloseCache1)
{
- PoolPtr pool =
+ auto pool =
getHelper()->getCache()->getPoolManager().find("__TEST_POOL1__");
if (pool->getThreadLocalConnections()) {
LOG("releaseThreadLocalConnection1 doing...");
diff --git a/cppcache/integration-test/testThinClientPutWithDelta.cpp b/cppcache/integration-test/testThinClientPutWithDelta.cpp
index 568d93d..44356bc 100644
--- a/cppcache/integration-test/testThinClientPutWithDelta.cpp
+++ b/cppcache/integration-test/testThinClientPutWithDelta.cpp
@@ -72,7 +72,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -85,8 +85,8 @@ void createRegion(const char* name, bool ackMode, const char* endpoints,
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
// ack, caching
- RegionPtr regPtr = getHelper()->createRegion(
- name, ackMode, true, nullptr, endpoints, clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, true, nullptr,
+ endpoints, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -111,7 +111,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepOne)
{
LOG("Step one entered");
try {
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
serializationRegistry->addType(DeltaEx::create);
} catch (IllegalStateException&) {
// ignore exception caused by type reregistration.
@@ -119,9 +121,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepOne)
DeltaEx::toDeltaCount = 0;
DeltaEx::toDataCount = 0;
- CacheableKeyPtr keyPtr = createKey(keys[0]);
+ auto keyPtr = createKey(keys[0]);
auto valPtr = std::make_shared<DeltaEx>();
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
regPtr->put(keyPtr, valPtr);
valPtr->setDelta(true);
regPtr->put(keyPtr, valPtr);
@@ -147,7 +149,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepOne_DisableDelta)
DeltaEx::toDeltaCount = 0;
DeltaEx::toDataCount = 0;
try {
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
serializationRegistry->addType(DeltaEx::create);
} catch (IllegalStateException&) {
diff --git a/cppcache/integration-test/testThinClientRegionQueryDifferentServerConfigs.cpp b/cppcache/integration-test/testThinClientRegionQueryDifferentServerConfigs.cpp
index 893bfdc..3761381 100644
--- a/cppcache/integration-test/testThinClientRegionQueryDifferentServerConfigs.cpp
+++ b/cppcache/integration-test/testThinClientRegionQueryDifferentServerConfigs.cpp
@@ -24,7 +24,6 @@
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <string>
#include "QueryStrings.hpp"
#include "QueryHelper.hpp"
@@ -54,7 +53,9 @@ void initClient() {
initClient(true);
ASSERT(getHelper() != nullptr, "null CacheHelper");
try {
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
serializationRegistry->addType(Position::createDeserializable);
serializationRegistry->addType(Portfolio::createDeserializable);
}
@@ -89,12 +90,12 @@ DUNIT_TASK_DEFINITION(CLIENT1, InitClientCreateRegionAndRunQueries)
{
LOG("Starting Step One with Pool + Locator lists");
initClient();
- PoolPtr pool1 = nullptr;
+ std::shared_ptr<Pool> pool1 = nullptr;
pool1 = createPool(poolNames[0], locHostPort, sGNames[0], 0, true);
createRegionAndAttachPool(qRegionNames[0], USE_ACK, poolNames[0]);
// populate the region
- RegionPtr reg = getHelper()->getRegion(qRegionNames[0]);
+ auto reg = getHelper()->getRegion(qRegionNames[0]);
QueryHelper& qh = QueryHelper::getHelper();
qh.populatePortfolioData(reg, qh.getPortfolioSetSize(),
qh.getPortfolioNumSets());
@@ -102,11 +103,11 @@ DUNIT_TASK_DEFINITION(CLIENT1, InitClientCreateRegionAndRunQueries)
std::string qry1Str = (std::string) "select * from /" + qRegionNames[0];
std::string qry2Str = (std::string) "select * from /" + qRegionNames[1];
- QueryServicePtr qs = nullptr;
+ std::shared_ptr<QueryService> qs = nullptr;
qs = pool1->getQueryService();
- SelectResultsPtr results;
- QueryPtr qry = qs->newQuery(qry1Str.c_str());
+ std::shared_ptr<SelectResults> results;
+ auto qry = qs->newQuery(qry1Str.c_str());
results = qry->execute();
ASSERT(
results->size() == qh.getPortfolioSetSize() * qh.getPortfolioNumSets(),
@@ -150,13 +151,13 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateRegionAndRunQueries)
{
LOG("Starting Step Two with Pool + Locator list");
// Create pool2
- PoolPtr pool2 = nullptr;
+ std::shared_ptr<Pool> pool2 = nullptr;
pool2 = createPool(poolNames[1], locHostPort, sGNames[1], 0, true);
createRegionAndAttachPool(qRegionNames[1], USE_ACK, poolNames[1]);
// populate the region
- RegionPtr reg = getHelper()->getRegion(qRegionNames[1]);
+ auto reg = getHelper()->getRegion(qRegionNames[1]);
QueryHelper& qh = QueryHelper::getHelper();
qh.populatePositionData(reg, qh.getPositionSetSize(),
qh.getPositionNumSets());
@@ -164,10 +165,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateRegionAndRunQueries)
std::string qry1Str = (std::string) "select * from /" + qRegionNames[0];
std::string qry2Str = (std::string) "select * from /" + qRegionNames[1];
- QueryServicePtr qs = nullptr;
+ std::shared_ptr<QueryService> qs = nullptr;
qs = pool2->getQueryService();
- SelectResultsPtr results;
- QueryPtr qry;
+ std::shared_ptr<SelectResults> results;
+ std::shared_ptr<Query> qry;
// now region queries
try {
diff --git a/cppcache/integration-test/testThinClientRegionQueryExclusiveness.cpp b/cppcache/integration-test/testThinClientRegionQueryExclusiveness.cpp
index 3575b7b..3fcf179 100644
--- a/cppcache/integration-test/testThinClientRegionQueryExclusiveness.cpp
+++ b/cppcache/integration-test/testThinClientRegionQueryExclusiveness.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <ace/Task.h>
@@ -58,7 +57,7 @@ const char* qRegionNames[] = {"Portfolios", "Positions"};
void clientOperations() {
initClient(true);
try {
- SerializationRegistryPtr serializationRegistry =
+ auto serializationRegistry =
CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
->getSerializationRegistry();
@@ -68,11 +67,11 @@ void clientOperations() {
// ignore exception
}
- PoolPtr pool1 = nullptr;
+ std::shared_ptr<Pool> pool1 = nullptr;
pool1 = createPool(poolNames[0], locHostPort, nullptr, 0, true);
createRegionAndAttachPool(qRegionNames[0], USE_ACK, poolNames[0]);
- RegionPtr rptr = getHelper()->cachePtr->getRegion(qRegionNames[0]);
+ auto rptr = getHelper()->cachePtr->getRegion(qRegionNames[0]);
auto p1 = std::make_shared<Portfolio>(1, 100);
auto p2 = std::make_shared<Portfolio>(2, 100);
auto p3 = std::make_shared<Portfolio>(3, 100);
@@ -83,11 +82,11 @@ void clientOperations() {
rptr->put("3", p3);
rptr->put("4", p4);
- QueryServicePtr qs = nullptr;
+ std::shared_ptr<QueryService> qs = nullptr;
qs = pool1->getQueryService();
- QueryPtr qry1 = qs->newQuery("select distinct * from /Portfolios");
- SelectResultsPtr results1 = qry1->execute();
+ auto qry1 = qs->newQuery("select distinct * from /Portfolios");
+ auto results1 = qry1->execute();
ASSERT(results1->size() == 4,
"Expected 4 as number of portfolio objects put were 4");
@@ -97,8 +96,8 @@ void clientOperations() {
try {
LOG("Going to execute the query");
- QueryPtr qry2 = qs->newQuery("select distinct * from /Portfolios");
- SelectResultsPtr results2 = qry2->execute();
+ auto qry2 = qs->newQuery("select distinct * from /Portfolios");
+ auto results2 = qry2->execute();
ASSERT(results2->size() == 4, "Failed verification");
} catch (...) {
FAIL("Got an exception!");
diff --git a/cppcache/integration-test/testThinClientRemoteQueryFailover.cpp b/cppcache/integration-test/testThinClientRemoteQueryFailover.cpp
index d770a39..2021848 100644
--- a/cppcache/integration-test/testThinClientRemoteQueryFailover.cpp
+++ b/cppcache/integration-test/testThinClientRemoteQueryFailover.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <ace/Task.h>
@@ -116,7 +115,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, RegisterTypesAndCreatePoolAndRegion)
initClient(true);
try {
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
serializationRegistry->addType(Position::createDeserializable);
serializationRegistry->addType(Portfolio::createDeserializable);
@@ -131,7 +132,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, RegisterTypesAndCreatePoolAndRegion)
createPool(poolNames[0], locHostPort, nullptr, 0, true);
createRegionAndAttachPool(qRegionNames[0], USE_ACK, poolNames[0]);
- RegionPtr rptr = getHelper()->cachePtr->getRegion(qRegionNames[0]);
+ auto rptr = getHelper()->cachePtr->getRegion(qRegionNames[0]);
auto port1 = std::make_shared<Portfolio>(1, 100);
auto port2 = std::make_shared<Portfolio>(2, 200);
@@ -152,18 +153,18 @@ DUNIT_TASK_DEFINITION(CLIENT1, ValidateQueryExecutionAcrossServerFailure)
try {
kst = new KillServerThread();
- QueryServicePtr qs = nullptr;
+ std::shared_ptr<QueryService> qs = nullptr;
if (isPoolConfig) {
- PoolPtr pool1 = findPool(poolNames[0]);
+ auto pool1 = findPool(poolNames[0]);
qs = pool1->getQueryService();
} else {
qs = getHelper()->cachePtr->getQueryService();
}
for (int i = 0; i < 10000; i++) {
- QueryPtr qry = qs->newQuery("select distinct * from /Portfolios");
+ auto qry = qs->newQuery("select distinct * from /Portfolios");
- SelectResultsPtr results;
+ std::shared_ptr<SelectResults> results;
results = qry->execute();
if (i == 10) {
diff --git a/cppcache/integration-test/testThinClientRemoteQueryFailoverPdx.cpp b/cppcache/integration-test/testThinClientRemoteQueryFailoverPdx.cpp
index 3242cc2..f8e4447 100644
--- a/cppcache/integration-test/testThinClientRemoteQueryFailoverPdx.cpp
+++ b/cppcache/integration-test/testThinClientRemoteQueryFailoverPdx.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <ace/Task.h>
@@ -113,7 +112,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, RegisterTypesAndCreatePoolAndRegion)
initClient(true);
try {
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
serializationRegistry->addType(Position::createDeserializable);
serializationRegistry->addType(Portfolio::createDeserializable);
@@ -127,7 +128,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, RegisterTypesAndCreatePoolAndRegion)
createPool(poolNames[0], locHostPort, nullptr, 0, true);
createRegionAndAttachPool(qRegionNames[0], USE_ACK, poolNames[0]);
- RegionPtr rptr = getHelper()->cachePtr->getRegion(qRegionNames[0]);
+ auto rptr = getHelper()->cachePtr->getRegion(qRegionNames[0]);
auto port1 = std::make_shared<PortfolioPdx>(1, 100);
auto port2 = std::make_shared<PortfolioPdx>(2, 200);
@@ -148,18 +149,18 @@ DUNIT_TASK_DEFINITION(CLIENT1, ValidateQueryExecutionAcrossServerFailure)
try {
kst = new KillServerThread();
- QueryServicePtr qs = nullptr;
+ std::shared_ptr<QueryService> qs = nullptr;
if (isPoolConfig) {
- PoolPtr pool1 = findPool(poolNames[0]);
+ auto pool1 = findPool(poolNames[0]);
qs = pool1->getQueryService();
} else {
qs = getHelper()->cachePtr->getQueryService();
}
for (int i = 0; i < 10000; i++) {
- QueryPtr qry = qs->newQuery("select distinct * from /Portfolios");
+ auto qry = qs->newQuery("select distinct * from /Portfolios");
- SelectResultsPtr results;
+ std::shared_ptr<SelectResults> results;
results = qry->execute();
if (i == 10) {
diff --git a/cppcache/integration-test/testThinClientRemoteQueryRS.cpp b/cppcache/integration-test/testThinClientRemoteQueryRS.cpp
index ddff1dc..acb91a5 100644
--- a/cppcache/integration-test/testThinClientRemoteQueryRS.cpp
+++ b/cppcache/integration-test/testThinClientRemoteQueryRS.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <string>
@@ -57,7 +56,9 @@ void stepOne() {
// Create just one pool and attach all regions to that.
initClient(true);
try {
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
serializationRegistry->addType(Position::createDeserializable);
serializationRegistry->addType(Portfolio::createDeserializable);
serializationRegistry->addPdxType(PositionPdx::createDeserializable);
@@ -73,9 +74,9 @@ void stepOne() {
createRegionAndAttachPool(qRegionNames[2], USE_ACK, poolNames[0]);
createRegionAndAttachPool(qRegionNames[3], USE_ACK, poolNames[0]);
- RegionPtr regptr = getHelper()->getRegion(qRegionNames[0]);
- RegionAttributesPtr lattribPtr = regptr->getAttributes();
- RegionPtr subregPtr = regptr->createSubregion(qRegionNames[1], lattribPtr);
+ auto regptr = getHelper()->getRegion(qRegionNames[0]);
+ std::shared_ptr<RegionAttributes> lattribPtr = regptr->getAttributes();
+ auto subregPtr = regptr->createSubregion(qRegionNames[1], lattribPtr);
LOG("StepOne complete.");
}
@@ -125,12 +126,12 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
{
- RegionPtr regPtr0 = getHelper()->getRegion(qRegionNames[0]);
- RegionPtr subregPtr0 = regPtr0->getSubregion("Positions");
- RegionPtr regPtr1 = getHelper()->getRegion(qRegionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(qRegionNames[0]);
+ auto subregPtr0 = regPtr0->getSubregion("Positions");
+ auto regPtr1 = getHelper()->getRegion(qRegionNames[1]);
- RegionPtr regPtr2 = getHelper()->getRegion(qRegionNames[2]);
- RegionPtr regPtr3 = getHelper()->getRegion(qRegionNames[3]);
+ auto regPtr2 = getHelper()->getRegion(qRegionNames[2]);
+ auto regPtr3 = getHelper()->getRegion(qRegionNames[3]);
QueryHelper* qh = &QueryHelper::getHelper();
@@ -175,17 +176,17 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
bool doAnyErrorOccured = false;
QueryHelper* qh = &QueryHelper::getHelper();
- QueryServicePtr qs = nullptr;
+ std::shared_ptr<QueryService> qs = nullptr;
if (isPoolConfig) {
- PoolPtr pool1 = findPool(poolNames[0]);
+ auto pool1 = findPool(poolNames[0]);
qs = pool1->getQueryService();
} else {
qs = getHelper()->cachePtr->getQueryService();
}
for (int i = 0; i < QueryStrings::RSOPLsize(); i++) {
- QueryPtr qry =
+ auto qry =
qs->newQuery(const_cast<char*>(resultsetQueriesOPL[i].query()));
- SelectResultsPtr results = qry->execute();
+ auto results = qry->execute();
if (!qh->verifyRS(results, resultsetRowCountsOPL[i])) {
char failmsg[100] = {0};
ACE_OS::sprintf(failmsg, "Query verify failed for query index %d", i);
@@ -202,16 +203,14 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
}
if (!m_isPdx) {
- SerializablePtr ser = (*rsptr)[rows];
+ auto ser = (*rsptr)[rows];
if (std::dynamic_pointer_cast<Portfolio>(ser)) {
- PortfolioPtr portfolio =
- std::static_pointer_cast<Portfolio>(ser);
+ auto portfolio = std::static_pointer_cast<Portfolio>(ser);
printf(
" query idx %d pulled portfolio object ID %d, pkid :: %s\n",
i, portfolio->getID(), portfolio->getPkid()->asChar());
} else if (std::dynamic_pointer_cast<Position>(ser)) {
- PositionPtr position =
- std::static_pointer_cast<Position>(ser);
+ auto position = std::static_pointer_cast<Position>(ser);
printf(
" query idx %d pulled position object secId %s, shares :: "
"%d\n",
@@ -227,17 +226,15 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
}
}
} else {
- SerializablePtr pdxser = (*rsptr)[rows];
+ auto pdxser = (*rsptr)[rows];
if (std::dynamic_pointer_cast<PortfolioPdx>(pdxser)) {
- PortfolioPdxPtr portfoliopdx =
- std::static_pointer_cast<PortfolioPdx>(pdxser);
+ auto portfoliopdx = std::static_pointer_cast<PortfolioPdx>(pdxser);
printf(
" query idx %d pulled portfolioPdx object ID %d, pkid %s :: "
"\n",
i, portfoliopdx->getID(), portfoliopdx->getPkid());
} else if (std::dynamic_pointer_cast<PositionPdx>(pdxser)) {
- PositionPdxPtr positionpdx =
- std::static_pointer_cast<PositionPdx>(pdxser);
+ auto positionpdx = std::static_pointer_cast<PositionPdx>(pdxser);
printf(
" query idx %d pulled positionPdx object secId %s, shares %d "
" "
@@ -278,9 +275,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFive)
bool doAnyErrorOccured = false;
QueryHelper* qh = &QueryHelper::getHelper();
- QueryServicePtr qs = nullptr;
+ std::shared_ptr<QueryService> qs = nullptr;
if (isPoolConfig) {
- PoolPtr pool1 = findPool(poolNames[0]);
+ auto pool1 = findPool(poolNames[0]);
qs = pool1->getQueryService();
} else {
qs = getHelper()->cachePtr->getQueryService();
@@ -296,9 +293,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFive)
}
if (resultsetQueries[i].category != unsupported) {
- QueryPtr qry =
- qs->newQuery(const_cast<char*>(resultsetQueries[i].query()));
- SelectResultsPtr results = qry->execute();
+ auto qry = qs->newQuery(const_cast<char*>(resultsetQueries[i].query()));
+ auto results = qry->execute();
if (!qh->verifyRS(results, (qh->isExpectedRowsConstantRS(i)
? resultsetRowCounts[i]
: resultsetRowCounts[i] *
@@ -318,17 +314,15 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFive)
}
if (!m_isPdx) {
- SerializablePtr ser = (*rsptr)[rows];
+ auto ser = (*rsptr)[rows];
if (std::dynamic_pointer_cast<Portfolio>(ser)) {
- PortfolioPtr portfolio =
- std::static_pointer_cast<Portfolio>(ser);
+ auto portfolio = std::static_pointer_cast<Portfolio>(ser);
printf(
" query idx %d pulled portfolio object ID %d, pkid :: "
"%s\n",
i, portfolio->getID(), portfolio->getPkid()->asChar());
} else if (std::dynamic_pointer_cast<Position>(ser)) {
- PositionPtr position =
- std::static_pointer_cast<Position>(ser);
+ auto position = std::static_pointer_cast<Position>(ser);
printf(
" query idx %d pulled position object secId %s, shares :: "
"%d\n",
@@ -344,20 +338,17 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFive)
}
}
} else {
- SerializablePtr pdxser = (*rsptr)[rows];
+ auto pdxser = (*rsptr)[rows];
if (std::dynamic_pointer_cast<PortfolioPdx>(pdxser)) {
- PortfolioPdxPtr portfoliopdx =
- std::static_pointer_cast<PortfolioPdx>(
- pdxser);
+ auto portfoliopdx =
+ std::static_pointer_cast<PortfolioPdx>(pdxser);
printf(
" query idx %d pulled portfolioPdx object ID %d, pkid %s "
":: "
"\n",
i, portfoliopdx->getID(), portfoliopdx->getPkid());
} else if (std::dynamic_pointer_cast<PositionPdx>(pdxser)) {
- PositionPdxPtr positionpdx =
- std::static_pointer_cast<PositionPdx>(
- pdxser);
+ auto positionpdx = std::static_pointer_cast<PositionPdx>(pdxser);
printf(
" query idx %d pulled positionPdx object secId %s, shares "
"%d "
@@ -399,9 +390,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepSix)
bool doAnyErrorOccured = false;
QueryHelper* qh = &QueryHelper::getHelper();
- QueryServicePtr qs = nullptr;
+ std::shared_ptr<QueryService> qs = nullptr;
if (isPoolConfig) {
- PoolPtr pool1 = findPool(poolNames[0]);
+ auto pool1 = findPool(poolNames[0]);
qs = pool1->getQueryService();
} else {
qs = getHelper()->cachePtr->getQueryService();
@@ -409,12 +400,12 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepSix)
for (int i = 0; i < QueryStrings::RSPsize(); i++) {
if (resultsetparamQueries[i].category != unsupported) {
- QueryPtr qry =
+ auto qry =
qs->newQuery(const_cast<char*>(resultsetparamQueries[i].query()));
// LOGINFO("NIL::229:Retrieved QueryString = %s",
// qry->getQueryString());
- CacheableVectorPtr paramList = CacheableVector::create();
+ auto paramList = CacheableVector::create();
for (int j = 0; j < noofQueryParam[i]; j++) {
// LOGINFO("NIL::260: queryparamSet[%d][%d] = %s", i, j,
// queryparamSet[i][j]);
@@ -425,7 +416,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepSix)
}
}
- SelectResultsPtr results = qry->execute(paramList);
+ auto results = qry->execute(paramList);
if (!qh->verifyRS(results, (qh->isExpectedRowsConstantPQRS(i)
? resultsetRowCountsPQ[i]
: resultsetRowCountsPQ[i] *
@@ -445,16 +436,14 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepSix)
}
if (!m_isPdx) {
- SerializablePtr ser = (*rsptr)[rows];
+ auto ser = (*rsptr)[rows];
if (std::dynamic_pointer_cast<Portfolio>(ser)) {
- PortfolioPtr portfolio =
- std::static_pointer_cast<Portfolio>(ser);
+ auto portfolio = std::static_pointer_cast<Portfolio>(ser);
printf(
" query idx %d pulled portfolio object ID %d, pkid %s : \n",
i, portfolio->getID(), portfolio->getPkid()->asChar());
} else if (std::dynamic_pointer_cast<Position>(ser)) {
- PositionPtr position =
- std::static_pointer_cast<Position>(ser);
+ auto position = std::static_pointer_cast<Position>(ser);
printf(
" query idx %d pulled position object secId %s, shares %d "
": "
@@ -471,18 +460,16 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepSix)
}
}
} else {
- SerializablePtr ser = (*rsptr)[rows];
+ auto ser = (*rsptr)[rows];
if (std::dynamic_pointer_cast<PortfolioPdx>(ser)) {
- PortfolioPdxPtr portfoliopdx =
- std::static_pointer_cast<PortfolioPdx>(ser);
+ auto portfoliopdx = std::static_pointer_cast<PortfolioPdx>(ser);
printf(
" query idx %d pulled portfolioPdx object ID %d, pkid %s "
": "
"\n",
i, portfoliopdx->getID(), portfoliopdx->getPkid());
} else if (std::dynamic_pointer_cast<PositionPdx>(ser)) {
- PositionPdxPtr positionpdx =
- std::static_pointer_cast<PositionPdx>(ser);
+ auto positionpdx = std::static_pointer_cast<PositionPdx>(ser);
printf(
" query idx %d pulled positionPdx object secId %s, shares "
"%d "
@@ -515,9 +502,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, DoQueryRSError)
{
QueryHelper* qh ATTR_UNUSED = &QueryHelper::getHelper();
- QueryServicePtr qs = nullptr;
+ std::shared_ptr<QueryService> qs = nullptr;
if (isPoolConfig) {
- PoolPtr pool1 = findPool(poolNames[0]);
+ auto pool1 = findPool(poolNames[0]);
qs = pool1->getQueryService();
} else {
qs = getHelper()->cachePtr->getQueryService();
@@ -525,11 +512,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, DoQueryRSError)
for (int i = 0; i < QueryStrings::RSsize(); i++) {
if (resultsetQueries[i].category == unsupported) {
- QueryPtr qry =
- qs->newQuery(const_cast<char*>(resultsetQueries[i].query()));
+ auto qry = qs->newQuery(const_cast<char*>(resultsetQueries[i].query()));
try {
- SelectResultsPtr results = qry->execute();
+ auto results = qry->execute();
char failmsg[100] = {0};
ACE_OS::sprintf(failmsg, "Query exception didnt occur for index %d",
diff --git a/cppcache/integration-test/testThinClientRemoteQuerySS.cpp b/cppcache/integration-test/testThinClientRemoteQuerySS.cpp
index b205fa0..a27fba9 100644
--- a/cppcache/integration-test/testThinClientRemoteQuerySS.cpp
+++ b/cppcache/integration-test/testThinClientRemoteQuerySS.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <string>
@@ -65,106 +64,103 @@ std::string checkNullString(const std::string* str) {
return ((str == nullptr) ? "(null)" : *str);
}
-void _printFields(CacheablePtr field, Struct* ssptr, int32_t& fields) {
- try {
- if (auto portfolio = std::dynamic_pointer_cast<Portfolio>(field)) {
- printf(" pulled %s :- ID %d, pkid %s\n",
- ssptr->getFieldName(fields).c_str(), portfolio->getID(),
- checkNullString(portfolio->getPkid()->asChar()));
- printf(" pulled %s :- ID %d, pkid %s\n",
- ssptr->getFieldName(fields).c_str(), portfolio->getID(),
- checkNullString(portfolio->getPkid()->asChar()));
- } else if (auto position = std::dynamic_pointer_cast<Position>(field)) {
- printf(" pulled %s :- secId %s, shares %d\n",
- ssptr->getFieldName(fields).c_str(),
- checkNullString(position->getSecId()->asChar()),
- position->getSharesOutstanding());
- } else if (auto portfolioPdx =
- std::dynamic_pointer_cast<PortfolioPdx>(field)) {
- printf(" pulled %s :- ID %d, pkid %s\n",
- ssptr->getFieldName(fields).c_str(),
- portfolioPdx->getID(),
- checkNullString(portfolioPdx->getPkid()));
- } else if (auto positionPdx = std::dynamic_pointer_cast<PositionPdx>(field)) {
- printf(" pulled %s :- secId %s, shares %d\n",
- ssptr->getFieldName(fields).c_str(),
- checkNullString(positionPdx->getSecId()),
- positionPdx->getSharesOutstanding());
- } else {
- if (auto str = std::dynamic_pointer_cast<CacheableString>(field)) {
- if (str->isWideString()) {
- printf(" pulled %s :- %S\n",
- ssptr->getFieldName(fields).c_str(),
- checkNullString(str->asWChar()));
- } else {
- printf(" pulled %s :- %s\n",
- ssptr->getFieldName(fields).c_str(),
- checkNullString(str->asChar()));
- }
- } else if (auto boolptr =
- std::dynamic_pointer_cast<CacheableBoolean>(field)) {
- printf(" pulled %s :- %s\n",
+void _printFields(std::shared_ptr<Cacheable> field, Struct* ssptr,
+ int32_t& fields) {
+ try {
+ if (auto portfolio = std::dynamic_pointer_cast<Portfolio>(field)) {
+ printf(" pulled %s :- ID %d, pkid %s\n",
+ ssptr->getFieldName(fields).c_str(), portfolio->getID(),
+ checkNullString(portfolio->getPkid()->asChar()));
+ printf(" pulled %s :- ID %d, pkid %s\n",
+ ssptr->getFieldName(fields).c_str(), portfolio->getID(),
+ checkNullString(portfolio->getPkid()->asChar()));
+ } else if (auto position = std::dynamic_pointer_cast<Position>(field)) {
+ printf(" pulled %s :- secId %s, shares %d\n",
+ ssptr->getFieldName(fields).c_str(),
+ checkNullString(position->getSecId()->asChar()),
+ position->getSharesOutstanding());
+ } else if (auto portfolioPdx =
+ std::dynamic_pointer_cast<PortfolioPdx>(field)) {
+ printf(" pulled %s :- ID %d, pkid %s\n",
+ ssptr->getFieldName(fields).c_str(), portfolioPdx->getID(),
+ checkNullString(portfolioPdx->getPkid()));
+ } else if (auto positionPdx =
+ std::dynamic_pointer_cast<PositionPdx>(field)) {
+ printf(" pulled %s :- secId %s, shares %d\n",
ssptr->getFieldName(fields).c_str(),
- boolptr->toString()->asChar());
+ checkNullString(positionPdx->getSecId()),
+ positionPdx->getSharesOutstanding());
} else {
- if (auto ptr = std::dynamic_pointer_cast<CacheableKey>(field)) {
- char buff[1024] = {'\0'};
- ptr->logString(&buff[0], 1024);
- printf(" pulled %s :- %s \n",
- ssptr->getFieldName(fields).c_str(), buff);
- } else if (auto strArr =
- std::dynamic_pointer_cast<CacheableStringArray>(field)) {
- printf(" string array object printing \n\n");
- for (int stri = 0; stri < strArr->length(); stri++) {
- if (strArr->operator[](stri)->isWideString()) {
- printf(" pulled %s(%d) - %S \n",
- ssptr->getFieldName(fields).c_str(), stri,
- checkNullString(strArr->operator[](stri)->asWChar()));
- } else {
- printf(" pulled %s(%d) - %s \n",
- ssptr->getFieldName(fields).c_str(), stri,
- checkNullString(strArr->operator[](stri)->asChar()));
- }
- }
- } else if (auto map =
- std::dynamic_pointer_cast<CacheableHashMap>(field)) {
- int index = 0;
- for (const auto& iter : *map) {
- printf(" hashMap %d of %zd ... \n", ++index, map->size());
- _printFields(iter.first, ssptr, fields);
- _printFields(iter.second, ssptr, fields);
+ if (auto str = std::dynamic_pointer_cast<CacheableString>(field)) {
+ if (str->isWideString()) {
+ printf(" pulled %s :- %S\n", ssptr->getFieldName(fields).c_str(),
+ checkNullString(str->asWChar()));
+ } else {
+ printf(" pulled %s :- %s\n", ssptr->getFieldName(fields).c_str(),
+ checkNullString(str->asChar()));
}
- printf(" end of map \n");
- } else if (auto structimpl = std::dynamic_pointer_cast<Struct>(field)) {
- printf(" structImpl %s {\n",
- ssptr->getFieldName(fields).c_str());
- for (int32_t inner_fields = 0; inner_fields < structimpl->length();
- inner_fields++) {
- SerializablePtr field = (*structimpl)[inner_fields];
- if (field == nullptr) {
- printf("we got null fields here, probably we have nullptr data\n");
- continue;
- }
-
- _printFields(field, structimpl.get(), inner_fields);
-
- } // end of field iterations
- printf(" } //end of %s\n",
- ssptr->getFieldName(fields).c_str());
+ } else if (auto boolptr =
+ std::dynamic_pointer_cast<CacheableBoolean>(field)) {
+ printf(" pulled %s :- %s\n", ssptr->getFieldName(fields).c_str(),
+ boolptr->toString()->asChar());
} else {
- printf(
- "unknown field data.. couldn't even convert it to Cacheable "
- "variants\n");
+ if (auto ptr = std::dynamic_pointer_cast<CacheableKey>(field)) {
+ char buff[1024] = {'\0'};
+ ptr->logString(&buff[0], 1024);
+ printf(" pulled %s :- %s \n", ssptr->getFieldName(fields).c_str(),
+ buff);
+ } else if (auto strArr =
+ std::dynamic_pointer_cast<CacheableStringArray>(field)) {
+ printf(" string array object printing \n\n");
+ for (int stri = 0; stri < strArr->length(); stri++) {
+ if (strArr->operator[](stri)->isWideString()) {
+ printf(" pulled %s(%d) - %S \n",
+ ssptr->getFieldName(fields).c_str(), stri,
+ checkNullString(strArr->operator[](stri)->asWChar()));
+ } else {
+ printf(" pulled %s(%d) - %s \n",
+ ssptr->getFieldName(fields).c_str(), stri,
+ checkNullString(strArr->operator[](stri)->asChar()));
+ }
+ }
+ } else if (auto map =
+ std::dynamic_pointer_cast<CacheableHashMap>(field)) {
+ int index = 0;
+ for (const auto& iter : *map) {
+ printf(" hashMap %d of %zd ... \n", ++index, map->size());
+ _printFields(iter.first, ssptr, fields);
+ _printFields(iter.second, ssptr, fields);
+ }
+ printf(" end of map \n");
+ } else if (auto structimpl = std::dynamic_pointer_cast<Struct>(field)) {
+ printf(" structImpl %s {\n", ssptr->getFieldName(fields).c_str());
+ for (int32_t inner_fields = 0; inner_fields < structimpl->length();
+ inner_fields++) {
+ auto field = (*structimpl)[inner_fields];
+ if (field == nullptr) {
+ printf(
+ "we got null fields here, probably we have nullptr data\n");
+ continue;
+ }
+
+ _printFields(field, structimpl.get(), inner_fields);
+
+ } // end of field iterations
+ printf(" } //end of %s\n", ssptr->getFieldName(fields).c_str());
+ } else {
+ printf(
+ "unknown field data.. couldn't even convert it to Cacheable "
+ "variants\n");
+ }
}
- }
- } // end of else
+ } // end of else
} catch (const std::out_of_range& e) {
printf("Caught a non-fatal out_of_range exception: %s", e.what());
}
}
-void _verifyStructSet(StructSetPtr& ssptr, int i) {
+void _verifyStructSet(std::shared_ptr<StructSet>& ssptr, int i) {
printf("query idx %d \n", i);
for (int32_t rows = 0; rows < ssptr->size(); rows++) {
if (rows > (int32_t)QueryHelper::getHelper().getPortfolioSetSize()) {
@@ -179,7 +175,7 @@ void _verifyStructSet(StructSetPtr& ssptr, int i) {
printf(" Row : %d \n", rows);
for (int32_t fields = 0; fields < siptr->length(); fields++) {
- SerializablePtr field = (*siptr)[fields];
+ auto field = (*siptr)[fields];
if (field == nullptr) {
printf("we got null fields here, probably we have nullptr data\n");
continue;
@@ -205,9 +201,9 @@ void compareMaps(HashMapOfCacheable& map, HashMapOfCacheable& expectedMap) {
const auto& expectedVal = expectedIter->second;
if (std::dynamic_pointer_cast<PositionPdx>(expectedVal)) {
- const PositionPdxPtr& posVal =
+ const std::shared_ptr<PositionPdx>& posVal =
std::dynamic_pointer_cast<PositionPdx>(val);
- const PositionPdxPtr& expectedPosVal =
+ const std::shared_ptr<PositionPdx>& expectedPosVal =
std::static_pointer_cast<PositionPdx>(expectedVal);
ASSERT(*expectedPosVal->getSecId() == *posVal->getSecId(),
"Expected the secIDs to be equal in PositionPdx");
@@ -215,9 +211,9 @@ void compareMaps(HashMapOfCacheable& map, HashMapOfCacheable& expectedMap) {
posVal->getSharesOutstanding(),
"Expected the sharesOutstanding to be equal in PositionPdx");
} else {
- const PortfolioPdxPtr& portVal =
+ const std::shared_ptr<PortfolioPdx>& portVal =
std::dynamic_pointer_cast<PortfolioPdx>(val);
- const PortfolioPdxPtr& expectedPortVal =
+ const std::shared_ptr<PortfolioPdx>& expectedPortVal =
std::dynamic_pointer_cast<PortfolioPdx>(expectedVal);
ASSERT(expectedPortVal->getID() == portVal->getID(),
"Expected the IDs to be equal in PortfolioPdx");
@@ -230,7 +226,9 @@ void compareMaps(HashMapOfCacheable& map, HashMapOfCacheable& expectedMap) {
void stepOne() {
initGridClient(true);
try {
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
serializationRegistry->addType(Position::createDeserializable);
serializationRegistry->addType(Portfolio::createDeserializable);
@@ -248,9 +246,9 @@ void stepOne() {
createRegionAndAttachPool(qRegionNames[2], USE_ACK, poolNames[0]);
createRegionAndAttachPool(qRegionNames[3], USE_ACK, poolNames[0]);
- RegionPtr regptr = getHelper()->getRegion(qRegionNames[0]);
- RegionAttributesPtr lattribPtr = regptr->getAttributes();
- RegionPtr subregPtr = regptr->createSubregion(qRegionNames[1], lattribPtr);
+ auto regptr = getHelper()->getRegion(qRegionNames[0]);
+ std::shared_ptr<RegionAttributes> lattribPtr = regptr->getAttributes();
+ auto subregPtr = regptr->createSubregion(qRegionNames[1], lattribPtr);
LOG("StepOne complete.");
}
@@ -330,7 +328,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
bool doAnyErrorOccured = false;
auto* qh = &QueryHelper::getHelper();
- QueryServicePtr qs = nullptr;
+ std::shared_ptr<QueryService> qs = nullptr;
if (isPoolConfig) {
auto pool1 = findPool(poolNames[0]);
qs = pool1->getQueryService();
@@ -370,7 +368,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFive)
bool doAnyErrorOccured = false;
auto qh = &QueryHelper::getHelper();
- QueryServicePtr qs = nullptr;
+ std::shared_ptr<QueryService> qs = nullptr;
if (isPoolConfig) {
auto pool1 = findPool(poolNames[0]);
qs = pool1->getQueryService();
@@ -421,7 +419,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepSix)
bool doAnyErrorOccured = false;
auto* qh = &QueryHelper::getHelper();
- QueryServicePtr qs = nullptr;
+ std::shared_ptr<QueryService> qs = nullptr;
if (isPoolConfig) {
auto pool1 = findPool(poolNames[0]);
qs = pool1->getQueryService();
@@ -491,8 +489,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, GetAll)
int numSecIds = sizeof(secIds) / sizeof(char*);
- VectorOfCacheableKey posKeys;
- VectorOfCacheableKey portKeys;
+ std::vector<std::shared_ptr<CacheableKey>> posKeys;
+ std::vector<std::shared_ptr<CacheableKey>> portKeys;
HashMapOfCacheable expectedPosMap;
HashMapOfCacheable expectedPortMap;
@@ -564,7 +562,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, DoQuerySSError)
{
auto* qh ATTR_UNUSED = &QueryHelper::getHelper();
- QueryServicePtr qs = nullptr;
+ std::shared_ptr<QueryService> qs = nullptr;
if (isPoolConfig) {
auto pool1 = findPool(poolNames[0]);
qs = pool1->getQueryService();
diff --git a/cppcache/integration-test/testThinClientRemoteQueryTimeout.cpp b/cppcache/integration-test/testThinClientRemoteQueryTimeout.cpp
index 07bd6f9..08da6a1 100644
--- a/cppcache/integration-test/testThinClientRemoteQueryTimeout.cpp
+++ b/cppcache/integration-test/testThinClientRemoteQueryTimeout.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <string>
@@ -58,7 +57,9 @@ static bool m_isPdx = false;
void stepOne() {
initClient(true);
try {
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
serializationRegistry->addType(Position::createDeserializable);
serializationRegistry->addType(Portfolio::createDeserializable);
@@ -71,9 +72,9 @@ void stepOne() {
createPool(poolNames[0], locHostPort, nullptr, 0, true);
createRegionAndAttachPool(qRegionNames[0], USE_ACK, poolNames[0]);
- RegionPtr regptr = getHelper()->getRegion(qRegionNames[0]);
- RegionAttributesPtr lattribPtr = regptr->getAttributes();
- RegionPtr subregPtr = regptr->createSubregion(qRegionNames[1], lattribPtr);
+ auto regptr = getHelper()->getRegion(qRegionNames[0]);
+ std::shared_ptr<RegionAttributes> lattribPtr = regptr->getAttributes();
+ auto subregPtr = regptr->createSubregion(qRegionNames[1], lattribPtr);
LOG("StepOne complete.");
}
@@ -119,8 +120,8 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepTwo)
{
- RegionPtr regPtr0 = getHelper()->getRegion(qRegionNames[0]);
- RegionPtr subregPtr0 = regPtr0->getSubregion(qRegionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(qRegionNames[0]);
+ auto subregPtr0 = regPtr0->getSubregion(qRegionNames[1]);
QueryHelper* qh = &QueryHelper::getHelper();
@@ -140,17 +141,16 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
{
QueryHelper* qh ATTR_UNUSED = &QueryHelper::getHelper();
- QueryServicePtr qs = nullptr;
+ std::shared_ptr<QueryService> qs = nullptr;
if (isPoolConfig) {
- PoolPtr pool1 = findPool(poolNames[0]);
+ auto pool1 = findPool(poolNames[0]);
qs = pool1->getQueryService();
} else {
qs = getHelper()->cachePtr->getQueryService();
}
- QueryPtr qry =
- qs->newQuery(const_cast<char*>(resultsetQueries[34].query()));
+ auto qry = qs->newQuery(const_cast<char*>(resultsetQueries[34].query()));
- SelectResultsPtr results;
+ std::shared_ptr<SelectResults> results;
try {
LOG("EXECUTE 1 START");
@@ -184,17 +184,16 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
{
QueryHelper* qh ATTR_UNUSED = &QueryHelper::getHelper();
- QueryServicePtr qs = nullptr;
+ std::shared_ptr<QueryService> qs = nullptr;
if (isPoolConfig) {
- PoolPtr pool1 = findPool(poolNames[0]);
+ auto pool1 = findPool(poolNames[0]);
qs = pool1->getQueryService();
} else {
qs = getHelper()->cachePtr->getQueryService();
}
- QueryPtr qry =
- qs->newQuery(const_cast<char*>(resultsetQueries[34].query()));
+ auto qry = qs->newQuery(const_cast<char*>(resultsetQueries[34].query()));
- SelectResultsPtr results;
+ std::shared_ptr<SelectResults> results;
try {
LOG("EXECUTE 2 START");
@@ -224,17 +223,16 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFive)
{
QueryHelper* qh ATTR_UNUSED = &QueryHelper::getHelper();
- QueryServicePtr qs = nullptr;
+ std::shared_ptr<QueryService> qs = nullptr;
if (isPoolConfig) {
- PoolPtr pool1 = findPool(poolNames[0]);
+ auto pool1 = findPool(poolNames[0]);
qs = pool1->getQueryService();
} else {
qs = getHelper()->cachePtr->getQueryService();
}
- QueryPtr qry =
- qs->newQuery(const_cast<char*>(structsetQueries[17].query()));
+ auto qry = qs->newQuery(const_cast<char*>(structsetQueries[17].query()));
- SelectResultsPtr results;
+ std::shared_ptr<SelectResults> results;
try {
LOG("EXECUTE 3 START");
@@ -268,17 +266,16 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepSix)
{
QueryHelper* qh ATTR_UNUSED = &QueryHelper::getHelper();
- QueryServicePtr qs = nullptr;
+ std::shared_ptr<QueryService> qs = nullptr;
if (isPoolConfig) {
- PoolPtr pool1 = findPool(poolNames[0]);
+ auto pool1 = findPool(poolNames[0]);
qs = pool1->getQueryService();
} else {
qs = getHelper()->cachePtr->getQueryService();
}
- QueryPtr qry =
- qs->newQuery(const_cast<char*>(structsetQueries[17].query()));
+ auto qry = qs->newQuery(const_cast<char*>(structsetQueries[17].query()));
- SelectResultsPtr results;
+ std::shared_ptr<SelectResults> results;
try {
LOG("EXECUTE 4 START");
@@ -308,22 +305,22 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepSeven)
{
QueryHelper* qh ATTR_UNUSED = &QueryHelper::getHelper();
- QueryServicePtr qs = nullptr;
+ std::shared_ptr<QueryService> qs = nullptr;
if (isPoolConfig) {
- PoolPtr pool1 = findPool(poolNames[0]);
+ auto pool1 = findPool(poolNames[0]);
qs = pool1->getQueryService();
} else {
qs = getHelper()->cachePtr->getQueryService();
}
- QueryPtr qry =
+ auto qry =
qs->newQuery(const_cast<char*>(structsetParamQueries[5].query()));
- SelectResultsPtr results;
+ std::shared_ptr<SelectResults> results;
try {
LOG("EXECUTE 5 START");
- CacheableVectorPtr paramList = CacheableVector::create();
+ auto paramList = CacheableVector::create();
for (int j = 0; j < numSSQueryParam[5]; j++) {
if (atoi(queryparamSetSS[5][j]) != 0) {
@@ -361,22 +358,22 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepEight)
{
QueryHelper* qh ATTR_UNUSED = &QueryHelper::getHelper();
- QueryServicePtr qs = nullptr;
+ std::shared_ptr<QueryService> qs = nullptr;
if (isPoolConfig) {
- PoolPtr pool1 = findPool(poolNames[0]);
+ auto pool1 = findPool(poolNames[0]);
qs = pool1->getQueryService();
} else {
qs = getHelper()->cachePtr->getQueryService();
}
- QueryPtr qry =
+ auto qry =
qs->newQuery(const_cast<char*>(structsetParamQueries[5].query()));
- SelectResultsPtr results;
+ std::shared_ptr<SelectResults> results;
try {
LOG("EXECUTE 6 START");
- CacheableVectorPtr paramList = CacheableVector::create();
+ auto paramList = CacheableVector::create();
for (int j = 0; j < numSSQueryParam[5]; j++) {
if (atoi(queryparamSetSS[5][j]) != 0) {
@@ -411,17 +408,16 @@ DUNIT_TASK_DEFINITION(CLIENT1, verifyNegativeValueTimeout)
{
QueryHelper* qh ATTR_UNUSED = &QueryHelper::getHelper();
- QueryServicePtr qs = nullptr;
+ std::shared_ptr<QueryService> qs = nullptr;
if (isPoolConfig) {
- PoolPtr pool1 = findPool(poolNames[0]);
+ auto pool1 = findPool(poolNames[0]);
qs = pool1->getQueryService();
} else {
qs = getHelper()->cachePtr->getQueryService();
}
- QueryPtr qry =
- qs->newQuery(const_cast<char*>(resultsetQueries[34].query()));
+ auto qry = qs->newQuery(const_cast<char*>(resultsetQueries[34].query()));
- SelectResultsPtr results;
+ std::shared_ptr<SelectResults> results;
try {
LOG("Task::verifyNegativeValueTimeout - EXECUTE 1 START");
@@ -457,17 +453,16 @@ DUNIT_TASK_DEFINITION(CLIENT1, verifyLargeValueTimeout)
{
QueryHelper* qh ATTR_UNUSED = &QueryHelper::getHelper();
- QueryServicePtr qs = nullptr;
+ std::shared_ptr<QueryService> qs = nullptr;
if (isPoolConfig) {
- PoolPtr pool1 = findPool(poolNames[0]);
+ auto pool1 = findPool(poolNames[0]);
qs = pool1->getQueryService();
} else {
qs = getHelper()->cachePtr->getQueryService();
}
- QueryPtr qry =
- qs->newQuery(const_cast<char*>(resultsetQueries[34].query()));
+ auto qry = qs->newQuery(const_cast<char*>(resultsetQueries[34].query()));
- SelectResultsPtr results;
+ std::shared_ptr<SelectResults> results;
try {
LOG("Task:: verifyLargeValueTimeout - EXECUTE 1 START");
diff --git a/cppcache/integration-test/testThinClientRemoteRegionQuery.cpp b/cppcache/integration-test/testThinClientRemoteRegionQuery.cpp
index d7414ab..57b4d70 100644
--- a/cppcache/integration-test/testThinClientRemoteRegionQuery.cpp
+++ b/cppcache/integration-test/testThinClientRemoteRegionQuery.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <string>
@@ -87,7 +86,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepOnePoolLocator)
{
initClient(true);
try {
- SerializationRegistryPtr serializationRegistry = CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())->getSerializationRegistry();
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
serializationRegistry->addType(Position::createDeserializable);
serializationRegistry->addType(Portfolio::createDeserializable);
@@ -105,9 +106,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepOnePoolLocator)
createPool(poolNames[1], locHostPort, nullptr, 0, true);
createRegionAndAttachPool(qRegionNames[3], USE_ACK, poolNames[1]);
- RegionPtr regptr = getHelper()->getRegion(qRegionNames[0]);
- RegionAttributesPtr lattribPtr = regptr->getAttributes();
- RegionPtr subregPtr = regptr->createSubregion(qRegionNames[1], lattribPtr);
+ auto regptr = getHelper()->getRegion(qRegionNames[0]);
+ std::shared_ptr<RegionAttributes> lattribPtr = regptr->getAttributes();
+ auto subregPtr = regptr->createSubregion(qRegionNames[1], lattribPtr);
LOG("StepOne complete.");
}
@@ -115,12 +116,12 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepTwo)
{
- RegionPtr regPtr0 = getHelper()->getRegion(qRegionNames[0]);
- RegionPtr subregPtr0 = regPtr0->getSubregion(qRegionNames[1]);
- RegionPtr regPtr1 = getHelper()->getRegion(qRegionNames[1]);
+ auto regPtr0 = getHelper()->getRegion(qRegionNames[0]);
+ auto subregPtr0 = regPtr0->getSubregion(qRegionNames[1]);
+ auto regPtr1 = getHelper()->getRegion(qRegionNames[1]);
- RegionPtr regPtr2 = getHelper()->getRegion(qRegionNames[2]);
- RegionPtr regPtr3 = getHelper()->getRegion(qRegionNames[3]);
+ auto regPtr2 = getHelper()->getRegion(qRegionNames[2]);
+ auto regPtr3 = getHelper()->getRegion(qRegionNames[3]);
QueryHelper* qh = &QueryHelper::getHelper();
@@ -162,7 +163,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
{
bool doAnyErrorOccured = false;
- RegionPtr region = getHelper()->getRegion(qRegionNames[0]);
+ auto region = getHelper()->getRegion(qRegionNames[0]);
for (int i = 0; i < QueryStrings::RQsize(); i++) {
if (m_isPdx) {
@@ -178,8 +179,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
continue;
}
- SelectResultsPtr results =
- region->query(const_cast<char*>(regionQueries[i].query()));
+ auto results = region->query(const_cast<char*>(regionQueries[i].query()));
if (results->size() != regionQueryRowCounts[i]) {
char failmsg[100] = {0};
@@ -194,7 +194,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
}
try {
- SelectResultsPtr results = region->query("");
+ auto results = region->query("");
FAIL("Expected IllegalArgumentException exception for empty predicate");
} catch (apache::geode::client::IllegalArgumentException ex) {
LOG("got expected IllegalArgumentException exception for empty "
@@ -203,9 +203,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
}
try {
- SelectResultsPtr results =
- region->query(const_cast<char*>(regionQueries[0].query()),
- std::chrono::seconds(2200000));
+ auto results = region->query(const_cast<char*>(regionQueries[0].query()),
+ std::chrono::seconds(2200000));
FAIL("Expected IllegalArgumentException exception for invalid timeout");
} catch (apache::geode::client::IllegalArgumentException ex) {
LOG("got expected IllegalArgumentException exception for invalid "
@@ -214,8 +213,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
}
try {
- SelectResultsPtr results =
- region->query(const_cast<char*>(regionQueries[0].query()), std::chrono::seconds(-1));
+ auto results = region->query(const_cast<char*>(regionQueries[0].query()),
+ std::chrono::seconds(-1));
FAIL("Expected IllegalArgumentException exception for invalid timeout");
} catch (apache::geode::client::IllegalArgumentException ex) {
LOG("got expected IllegalArgumentException exception for invalid "
@@ -223,7 +222,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
LOG(ex.getMessage());
}
try {
- SelectResultsPtr results = region->query("bad predicate");
+ auto results = region->query("bad predicate");
FAIL("Expected QueryException exception for wrong predicate");
} catch (QueryException ex) {
LOG("got expected QueryException exception for wrong predicate:");
@@ -245,7 +244,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
{
bool doAnyErrorOccured = false;
- RegionPtr region = getHelper()->getRegion(qRegionNames[0]);
+ auto region = getHelper()->getRegion(qRegionNames[0]);
for (int i = 0; i < QueryStrings::RQsize(); i++) {
if (regionQueries[i].category == unsupported) {
@@ -322,7 +321,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFive)
{
bool doAnyErrorOccured = false;
- RegionPtr region = getHelper()->getRegion(qRegionNames[0]);
+ auto region = getHelper()->getRegion(qRegionNames[0]);
for (int i = 0; i < QueryStrings::RQsize(); i++) {
if (regionQueries[i].category == unsupported) {
@@ -330,7 +329,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFive)
}
try {
- SerializablePtr result =
+ auto result =
region->selectValue(const_cast<char*>(regionQueries[i].query()));
/*
@@ -427,7 +426,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, QueryError)
{
- RegionPtr region = getHelper()->getRegion(qRegionNames[0]);
+ auto region = getHelper()->getRegion(qRegionNames[0]);
for (int i = 0; i < QueryStrings::RQsize(); i++) {
if ((regionQueries[i].category != unsupported) ||
@@ -437,7 +436,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, QueryError)
}
try {
- SelectResultsPtr results =
+ auto results =
region->query(const_cast<char*>(regionQueries[i].query()));
char failmsg[100] = {0};
diff --git a/cppcache/integration-test/testThinClientRemoveOps.cpp b/cppcache/integration-test/testThinClientRemoveOps.cpp
index b619426..9c4ba67 100644
--- a/cppcache/integration-test/testThinClientRemoveOps.cpp
+++ b/cppcache/integration-test/testThinClientRemoveOps.cpp
@@ -16,7 +16,6 @@
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include "testobject/PdxType.hpp"
@@ -58,7 +57,7 @@ END_TASK_DEFINITION
void initClient(const bool isthinClient) {
if (cacheHelper == nullptr) {
- PropertiesPtr config = Properties::create();
+ auto config = Properties::create();
if (g_isGridClient) {
config->insert("grid-client", "true");
}
@@ -98,10 +97,10 @@ void _verifyEntry(const char* name, const char* key, const char* val,
LOG(buf);
free(buf);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
- CacheableKeyPtr keyPtr = createKey(key);
+ auto keyPtr = createKey(key);
// if the region is no ack, then we may need to wait...
if (noKey == false) { // need to find the key!
@@ -193,8 +192,8 @@ void createRegion(const char* name, bool ackMode,
LOG("createRegion() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr = getHelper()->createRegion(
- name, ackMode, cachingEnable, nullptr, clientNotificationEnabled);
+ auto regPtr = getHelper()->createRegion(name, ackMode, cachingEnable, nullptr,
+ clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -206,7 +205,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -219,10 +218,10 @@ void putEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Put entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -243,10 +242,10 @@ void localPutEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Put entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
regPtr->localPut(keyPtr, valPtr);
@@ -262,9 +261,9 @@ void createEntryTwice(const char* name, const char* key, const char* value) {
sprintf(message, "Creating entry -- key: %s value: %s in region %s\n", key,
value, name);
LOG(message);
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
+ auto regPtr = getHelper()->getRegion(name);
regPtr->create(keyPtr, valPtr);
try {
regPtr->create(keyPtr, valPtr);
@@ -285,10 +284,10 @@ void updateEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
@@ -309,9 +308,9 @@ void doGetAgain(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "get region name%s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -341,9 +340,9 @@ void doNetsearch(const char* name, const char* key, const char* value) {
fflush(stdout);
static int count = 0;
// Get entry created in Process A, verify entry is correct
- CacheableKeyPtr keyPtr = CacheableKey::create(key);
+ auto keyPtr = CacheableKey::create(key);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
fprintf(stdout, "netsearch region %s\n", regPtr->getName());
fflush(stdout);
ASSERT(regPtr != nullptr, "Region not found.");
@@ -450,11 +449,11 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepFive)
{
- RegionPtr reg0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr reg1 = getHelper()->getRegion(regionNames[1]);
+ auto reg0 = getHelper()->getRegion(regionNames[0]);
+ auto reg1 = getHelper()->getRegion(regionNames[1]);
- CacheableKeyPtr keyPtr = CacheableString::create(keys[0]);
- CacheableKeyPtr keyPtr1 = CacheableString::create(keys[2]);
+ auto keyPtr = CacheableString::create(keys[0]);
+ auto keyPtr1 = CacheableString::create(keys[2]);
// Try removing non-existent entry from regions, result should be false.
ASSERT(reg0->remove(keys[4], vals[4]) == false,
@@ -536,11 +535,11 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, StepSix)
{
- RegionPtr reg0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr reg1 = getHelper()->getRegion(regionNames[1]);
+ auto reg0 = getHelper()->getRegion(regionNames[0]);
+ auto reg1 = getHelper()->getRegion(regionNames[1]);
- CacheableKeyPtr keyPtr = CacheableString::create(keys[1]);
- CacheableKeyPtr keyPtr1 = CacheableString::create(keys[3]);
+ auto keyPtr = CacheableString::create(keys[1]);
+ auto keyPtr1 = CacheableString::create(keys[3]);
putEntry(regionNames[0], keys[1], nvals[1]);
putEntry(regionNames[1], keys[3], nvals[3]);
@@ -637,10 +636,10 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepSix)
putEntry(regionNames[1], keys[3], vals[3]);
reg0->localInvalidate(keys[1]);
reg1->localInvalidate(keys[3]);
- ASSERT(reg0->remove(keys[1], (CacheablePtr) nullptr) == false,
+ ASSERT(reg0->remove(keys[1], (std::shared_ptr<Cacheable>)nullptr) == false,
"Result of remove should be false, as this value is not present "
"locally, but present only on server.");
- ASSERT(reg1->remove(keys[3], (CacheablePtr) nullptr) == false,
+ ASSERT(reg1->remove(keys[3], (std::shared_ptr<Cacheable>)nullptr) == false,
"Result of remove should be false, as this value is not present "
"locally, but present only on server.");
ASSERT(reg0->containsKey(keys[1]) == true, "containsKey should be true");
@@ -659,8 +658,8 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepSix)
ASSERT(reg1->remove("NewKey3", "NewValue3") == false,
"Result of remove should be false, as this value is not present "
"locally, and not present on server.");
- CacheableKeyPtr keyPtr2 = CacheableString::create("NewKey1");
- CacheableKeyPtr keyPtr3 = CacheableString::create("NewKey3");
+ auto keyPtr2 = CacheableString::create("NewKey1");
+ auto keyPtr3 = CacheableString::create("NewKey3");
ASSERT(reg0->containsKey("NewKey1") == false,
"containsKey should be false");
ASSERT(reg0->containsKeyOnServer(keyPtr2) == false,
@@ -673,12 +672,14 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepSix)
// Try removing a entry with a null value, which is not present on client as
// well as server, result should be false.
- ASSERT(reg0->remove("NewKey1", (CacheablePtr) nullptr) == false,
- "Result of remove should be false, as this value is not present "
- "locally, and not present on server.");
- ASSERT(reg1->remove("NewKey3", (CacheablePtr) nullptr) == false,
- "Result of remove should be false, as this value is not present "
- "locally, and not present on server.");
+ ASSERT(
+ reg0->remove("NewKey1", (std::shared_ptr<Cacheable>)nullptr) == false,
+ "Result of remove should be false, as this value is not present "
+ "locally, and not present on server.");
+ ASSERT(
+ reg1->remove("NewKey3", (std::shared_ptr<Cacheable>)nullptr) == false,
+ "Result of remove should be false, as this value is not present "
+ "locally, and not present on server.");
ASSERT(reg0->containsKey("NewKey1") == false,
"containsKey should be false");
ASSERT(reg0->containsKeyOnServer(keyPtr2) == false,
@@ -715,10 +716,10 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepSix)
putEntry(regionNames[1], keys[3], nvals[3]);
reg0->destroy(keys[1]);
reg1->destroy(keys[3]);
- ASSERT(reg0->remove(keys[1], (CacheablePtr) nullptr) == false,
+ ASSERT(reg0->remove(keys[1], (std::shared_ptr<Cacheable>)nullptr) == false,
"Result of remove should be false, as this value does not exist "
"locally, but exists on server.");
- ASSERT(reg1->remove(keys[3], (CacheablePtr) nullptr) == false,
+ ASSERT(reg1->remove(keys[3], (std::shared_ptr<Cacheable>)nullptr) == false,
"Result of remove should be false, as this value does not exist "
"locally, but exists on server.");
ASSERT(reg0->containsKey(keys[1]) == false, "containsKey should be false");
@@ -841,12 +842,14 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepSix)
reg1->localPut(keys[3], vals[3]);
reg0->invalidate(keys[1]);
reg1->invalidate(keys[3]);
- ASSERT(reg0->localRemove(keys[1], (CacheablePtr) nullptr) == true,
- "Result of remove should be true, as this value does not exists "
- "locally.");
- ASSERT(reg1->localRemove(keys[3], (CacheablePtr) nullptr) == true,
- "Result of remove should be true, as this value does not exists "
- "locally.");
+ ASSERT(
+ reg0->localRemove(keys[1], (std::shared_ptr<Cacheable>)nullptr) == true,
+ "Result of remove should be true, as this value does not exists "
+ "locally.");
+ ASSERT(
+ reg1->localRemove(keys[3], (std::shared_ptr<Cacheable>)nullptr) == true,
+ "Result of remove should be true, as this value does not exists "
+ "locally.");
ASSERT(reg0->containsKey(keys[1]) == false, "containsKey should be false");
ASSERT(reg1->containsKey(keys[3]) == false, "containsKey should be false");
LOG("Step6.13 complete.");
@@ -854,10 +857,12 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepSix)
// Try locally removing an entry (value) with a nullptr.
reg0->localPut(keys[1], vals[1]);
reg1->localPut(keys[3], vals[3]);
- ASSERT(reg0->localRemove(keys[1], (CacheablePtr) nullptr) == false,
+ ASSERT(reg0->localRemove(keys[1], (std::shared_ptr<Cacheable>)nullptr) ==
+ false,
"Result of remove should be false, as this value does not exists "
"locally.");
- ASSERT(reg1->localRemove(keys[3], (CacheablePtr) nullptr) == false,
+ ASSERT(reg1->localRemove(keys[3], (std::shared_ptr<Cacheable>)nullptr) ==
+ false,
"Result of remove should be false, as this value does not exists "
"locally.");
ASSERT(reg0->containsKey(keys[1]) == true, "containsKey should be true");
@@ -884,10 +889,12 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepSix)
reg1->localPut(keys[3], vals[3]);
reg0->localDestroy(keys[1]);
reg1->localDestroy(keys[3]);
- ASSERT(reg0->localRemove(keys[1], (CacheablePtr) nullptr) == false,
+ ASSERT(reg0->localRemove(keys[1], (std::shared_ptr<Cacheable>)nullptr) ==
+ false,
"Result of remove should be false, as this value does not exists "
"locally.");
- ASSERT(reg1->localRemove(keys[3], (CacheablePtr) nullptr) == false,
+ ASSERT(reg1->localRemove(keys[3], (std::shared_ptr<Cacheable>)nullptr) ==
+ false,
"Result of remove should be false, as this value does not exists "
"locally.");
ASSERT(reg0->containsKey(keys[1]) == false, "containsKey should be false");
@@ -920,10 +927,10 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepEight)
{
- RegionPtr reg = getHelper()->getRegion(regionNames[2]);
+ auto reg = getHelper()->getRegion(regionNames[2]);
- CacheableKeyPtr keyPtr = CacheableString::create(keys[0]);
- CacheableKeyPtr keyPtr1 = CacheableString::create(keys[1]);
+ auto keyPtr = CacheableString::create(keys[0]);
+ auto keyPtr1 = CacheableString::create(keys[1]);
// Try removing a entry which is present on client (value) but invalidated
// on
@@ -974,10 +981,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepEight)
reg->localDestroy(keys[0]);
reg->localDestroy(keys[1]);
SLEEP(10000); // This is for expiration on server to execute.
- ASSERT(reg->remove(keys[0], (CacheablePtr) nullptr) == true,
+ ASSERT(reg->remove(keys[0], (std::shared_ptr<Cacheable>)nullptr) == true,
"Result of remove should be true, as this value is not present "
"locally, & not present on server.");
- ASSERT(reg->remove(keys[1], (CacheablePtr) nullptr) == true,
+ ASSERT(reg->remove(keys[1], (std::shared_ptr<Cacheable>)nullptr) == true,
"Result of remove should be true, as this value is not present "
"locally, & not present on server.");
ASSERT(reg->containsKeyOnServer(keyPtr) == false,
@@ -1013,11 +1020,11 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepEight)
putEntry(regionNames[2], keys[1], nvals[1]);
SLEEP(10000); // This is for expiration on server to execute.
ASSERT(
- reg->remove(keys[0], (CacheablePtr) nullptr) == false,
+ reg->remove(keys[0], (std::shared_ptr<Cacheable>)nullptr) == false,
"Result of remove should be false, as this value is present locally, "
"& not present on server.");
ASSERT(
- reg->remove(keys[1], (CacheablePtr) nullptr) == false,
+ reg->remove(keys[1], (std::shared_ptr<Cacheable>)nullptr) == false,
"Result of remove should be false, as this value is present locally, "
"& not present on server.");
ASSERT(reg->containsKey(keys[0]) == true, "containsKey should be true");
@@ -1038,10 +1045,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepEight)
reg->invalidate(keys[0]);
reg->invalidate(keys[1]);
SLEEP(10000); // This is for expiration on server to execute.
- ASSERT(reg->remove(keys[0], (CacheablePtr) nullptr) == true,
+ ASSERT(reg->remove(keys[0], (std::shared_ptr<Cacheable>)nullptr) == true,
"Result of remove should be true, as this value is not present "
"locally, & not present on server.");
- ASSERT(reg->remove(keys[1], (CacheablePtr) nullptr) == true,
+ ASSERT(reg->remove(keys[1], (std::shared_ptr<Cacheable>)nullptr) == true,
"Result of remove should be true, as this value is not present "
"locally, & not present on server.");
ASSERT(reg->containsKey(keys[0]) == false, "containsKey should be false");
@@ -1076,7 +1083,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepEight)
ASSERT(reg->size() == 2, "region size should be equal to 2");
- VectorOfCacheableKey keys = reg->keys();
+ std::vector<std::shared_ptr<CacheableKey>> keys = reg->keys();
LOGINFO("Region keys = %d ", keys.size());
ASSERT(keys.size() == reg->size(),
"region size should be equal to keys size");
@@ -1105,11 +1112,11 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFiveA)
{
putEntry(regionNames[0], keys[0], vals[0]);
putEntry(regionNames[1], keys[2], vals[2]);
- RegionPtr reg0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr reg1 = getHelper()->getRegion(regionNames[1]);
+ auto reg0 = getHelper()->getRegion(regionNames[0]);
+ auto reg1 = getHelper()->getRegion(regionNames[1]);
- CacheableKeyPtr keyPtr = CacheableString::create(keys[0]);
- CacheableKeyPtr keyPtr1 = CacheableString::create(keys[2]);
+ auto keyPtr = CacheableString::create(keys[0]);
+ auto keyPtr1 = CacheableString::create(keys[2]);
// Try removing non-existent entry from regions, result should be false.
ASSERT(reg0->removeEx(keys[4]) == false,
@@ -1173,7 +1180,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFiveA)
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepTwelve)
{
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
int intKey = 1;
int intVal = 1;
@@ -1274,7 +1281,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepTwelve)
LOG("Expected : localDestroy should have failed.");
}
- CacheableInt32Ptr x;
+ std::shared_ptr<CacheableInt32> x;
try {
regPtr0->localCreate(x, 1);
LOG("Entry with null key and value locally created successfully");
@@ -1322,7 +1329,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepTwelve)
auto keyObject1 = std::make_shared<PdxTests::PdxType>();
regPtr0->localCreate(keyObject1, x);
- CacheablePtr retVal = regPtr0->get(keyObject1);
+ auto retVal = regPtr0->get(keyObject1);
ASSERT(retVal == x, "retVal and x should match.");
regPtr0->localInvalidate(keyObject1);
retVal = regPtr0->get(keyObject1);
@@ -1385,7 +1392,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepTwelve)
auto keyObject3 = std::make_shared<PdxTests::PdxType>();
regPtr0->localCreate(keyObject3, "testString");
if (regPtr0->containsKey(keyObject3)) {
- CacheablePtr strVal1 = regPtr0->get(keyObject3);
+ auto strVal1 = regPtr0->get(keyObject3);
ASSERT(strcmp(strVal1->toString()->asChar(), "testString") == 0,
"strVal should be testString.");
}
@@ -1401,7 +1408,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepTwelve)
auto keyObject4 = std::make_shared<PdxTests::PdxType>();
auto valObject1 = std::make_shared<PdxTests::PdxType>();
regPtr0->localCreate(keyObject4, valObject1);
- PdxTests::PdxTypePtr objVal1 =
+ auto objVal1 =
std::dynamic_pointer_cast<PdxTests::PdxType>(regPtr0->get(keyObject4));
ASSERT(valObject1 == objVal1, "valObject and objVal should match.");
regPtr0->localInvalidate(keyObject4);
@@ -1436,7 +1443,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepTwelve)
}*/
createRegion("ABC", USE_ACK, true, true);
- RegionPtr regPtr2 = getHelper()->getRegion("ABC");
+ auto regPtr2 = getHelper()->getRegion("ABC");
regPtr2->localDestroyRegion();
try {
regPtr2->localCreate(CacheableString::create("XY"),
@@ -1451,11 +1458,11 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, StepSixA)
{
- RegionPtr reg0 = getHelper()->getRegion(regionNames[0]);
- RegionPtr reg1 = getHelper()->getRegion(regionNames[1]);
+ auto reg0 = getHelper()->getRegion(regionNames[0]);
+ auto reg1 = getHelper()->getRegion(regionNames[1]);
- CacheableKeyPtr keyPtr = CacheableString::create(keys[1]);
- CacheableKeyPtr keyPtr1 = CacheableString::create(keys[3]);
+ auto keyPtr = CacheableString::create(keys[1]);
+ auto keyPtr1 = CacheableString::create(keys[3]);
putEntry(regionNames[0], keys[1], nvals[1]);
putEntry(regionNames[1], keys[3], nvals[3]);
@@ -1518,8 +1525,8 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepSixA)
"Result of remove should be false, as this value is not present.");
ASSERT(reg1->removeEx("NewKey3") == false,
"Result of remove should be false, as this value is not present.");
- CacheableKeyPtr keyPtr2 = CacheableString::create("NewKey1");
- CacheableKeyPtr keyPtr3 = CacheableString::create("NewKey3");
+ auto keyPtr2 = CacheableString::create("NewKey1");
+ auto keyPtr3 = CacheableString::create("NewKey3");
ASSERT(reg0->containsKey("NewKey1") == false,
"containsKey should be false");
ASSERT(reg0->containsKeyOnServer(keyPtr2) == false,
diff --git a/cppcache/integration-test/testThinClientSSLAuthCorrupt.cpp b/cppcache/integration-test/testThinClientSSLAuthCorrupt.cpp
index c042045..e9f3517 100644
--- a/cppcache/integration-test/testThinClientSSLAuthCorrupt.cpp
+++ b/cppcache/integration-test/testThinClientSSLAuthCorrupt.cpp
@@ -16,7 +16,6 @@
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <string>
@@ -41,7 +40,7 @@ const char* locatorsG =
void initClient(const bool isthinClient) {
if (cacheHelper == nullptr) {
- PropertiesPtr props = Properties::create();
+ auto props = Properties::create();
props->insert("ssl-enabled", "true");
std::string keystore = std::string(ACE_OS::getenv("TESTSRC")) + "/keystore";
std::string pubkey = keystore + "/client_truststore.pem";
@@ -139,7 +138,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateRegions1_PoolLocators)
createPooledRegion(regionNames[0], USE_ACK, locatorsG, "__TESTPOOL1_",
true);
createPooledRegion(regionNames[1], NO_ACK, locatorsG, "__TESTPOOL1_", true);
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
try {
regPtr->registerAllKeys(false, false, false);
FAIL("Should have got NotConnectedException during registerAllKeys");
diff --git a/cppcache/integration-test/testThinClientSSLAuthFail.cpp b/cppcache/integration-test/testThinClientSSLAuthFail.cpp
index 12b1fad..96a35e0 100644
--- a/cppcache/integration-test/testThinClientSSLAuthFail.cpp
+++ b/cppcache/integration-test/testThinClientSSLAuthFail.cpp
@@ -16,7 +16,6 @@
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <string>
@@ -41,7 +40,7 @@ const char* locatorsG =
void initClient(const bool isthinClient) {
if (cacheHelper == nullptr) {
- PropertiesPtr props = Properties::create();
+ auto props = Properties::create();
props->insert("ssl-enabled", "true");
std::string keystore = std::string(ACE_OS::getenv("TESTSRC")) + "/keystore";
std::string pubkey = keystore + "/client_truststore.pem";
@@ -71,7 +70,7 @@ void createPooledRegion(const char* name, bool ackMode, const char* locators,
LOG("createRegion_Pool() entered.");
fprintf(stdout, "Creating region -- %s ackMode is %d\n", name, ackMode);
fflush(stdout);
- RegionPtr regPtr =
+ auto regPtr =
getHelper()->createPooledRegion(name, ackMode, locators, poolname,
cachingEnable, clientNotificationEnabled);
ASSERT(regPtr != nullptr, "Failed to create region.");
@@ -84,10 +83,10 @@ void createEntry(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
+ auto regPtr = getHelper()->getRegion(name);
ASSERT(regPtr != nullptr, "Region not found.");
ASSERT(!regPtr->containsKey(keyPtr),
@@ -139,7 +138,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateRegions1_PoolLocators)
createPooledRegion(regionNames[0], USE_ACK, locatorsG, "__TESTPOOL1_",
true);
createPooledRegion(regionNames[1], NO_ACK, locatorsG, "__TESTPOOL1_", true);
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
try {
regPtr->registerAllKeys(false, false, false);
FAIL("Should have got NotConnectedException during registerAllKeys");
diff --git a/cppcache/integration-test/testThinClientSSLAuthUntrusted.cpp b/cppcache/integration-test/testThinClientSSLAuthUntrusted.cpp
index ba0fb57..880e83f 100644
--- a/cppcache/integration-test/testThinClientSSLAuthUntrusted.cpp
+++ b/cppcache/integration-test/testThinClientSSLAuthUntrusted.cpp
@@ -16,7 +16,6 @@
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
#include <string>
@@ -41,7 +40,7 @@ const char* locatorsG =
void initClient(const bool isthinClient) {
if (cacheHelper == nullptr) {
- PropertiesPtr props = Properties::create();
+ auto props = Properties::create();
props->insert("ssl-enabled", "true");
std::string keystore = std::string(ACE_OS::getenv("TESTSRC")) + "/keystore";
std::string pubkey = keystore + "/client_truststore.pem";
@@ -140,7 +139,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateRegions1_PoolLocators)
createPooledRegion(regionNames[0], USE_ACK, locatorsG, "__TESTPOOL1_",
true);
createPooledRegion(regionNames[1], NO_ACK, locatorsG, "__TESTPOOL1_", true);
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
try {
regPtr->registerAllKeys(false, false, false);
FAIL("Should have got NotConnectedException during registerAllKeys");
diff --git a/cppcache/integration-test/testThinClientSSLWithSecurityAuthz.cpp b/cppcache/integration-test/testThinClientSSLWithSecurityAuthz.cpp
index 069b495..3d8c00a 100644
--- a/cppcache/integration-test/testThinClientSSLWithSecurityAuthz.cpp
+++ b/cppcache/integration-test/testThinClientSSLWithSecurityAuthz.cpp
@@ -15,9 +15,9 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <geode/FunctionService.hpp>
#include <geode/Execution.hpp>
+#include <geode/CqAttributesFactory.hpp>
#define ROOT_NAME "testThinClientSSLWithSecurityAuthz"
#define ROOT_SCOPE DISTRIBUTED_ACK
@@ -33,7 +33,7 @@ using namespace apache::geode::client;
const char* locHostPort =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, 1);
-CredentialGeneratorPtr credentialGeneratorHandler;
+std::shared_ptr<CredentialGenerator> credentialGeneratorHandler;
std::string getXmlPath() {
char xmlPath[1000] = {'\0'};
@@ -119,7 +119,7 @@ opCodeList::value_type tmpAArr[] = {OP_CREATE, OP_UPDATE,
const char* regionNamesAuth[] = {"DistRegionAck"};
void initClientAuth(char UserType) {
- PropertiesPtr config = Properties::create();
+ auto config = Properties::create();
opCodeList wr(tmpWArr, tmpWArr + sizeof tmpWArr / sizeof *tmpWArr);
opCodeList rt(tmpRArr, tmpRArr + sizeof tmpRArr / sizeof *tmpRArr);
opCodeList ad(tmpAArr, tmpAArr + sizeof tmpAArr / sizeof *tmpAArr);
@@ -232,13 +232,13 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
for (int i = 0; i < 5; i++) {
entrymap.emplace(CacheableKey::create(i), CacheableInt32::create(i));
}
- RegionPtr regPtr = getHelper()->getRegion(regionNamesAuth[0]);
+ auto regPtr = getHelper()->getRegion(regionNamesAuth[0]);
regPtr->putAll(entrymap);
LOG("PutAll completed successfully");
for (int i = 0; i < 5; i++) {
regPtr->invalidate(CacheableKey::create(i));
}
- VectorOfCacheableKey entrykeys;
+ std::vector<std::shared_ptr<CacheableKey>> entrykeys;
for (int i = 0; i < 5; i++) {
entrykeys.push_back(CacheableKey::create(i));
}
@@ -250,9 +250,9 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
}
regPtr->query("1=1");
LOG("Query completed successfully");
- PoolPtr pool =
+ auto pool =
getHelper()->getCache()->getPoolManager().find(regionNamesAuth[0]);
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
if (pool != nullptr) {
// Using region name as pool name
qs = pool->getQueryService();
@@ -263,7 +263,7 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
sprintf(queryString, "select * from /%s", regionNamesAuth[0]);
CqAttributesFactory cqFac;
auto cqAttrs = cqFac.create();
- CqQueryPtr qry = qs->newCq("cq_security", queryString, cqAttrs);
+ auto qry = qs->newCq("cq_security", queryString, cqAttrs);
qs->executeCqs();
LOG("CQ completed successfully");
if (pool != nullptr) {
@@ -287,7 +287,7 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
LOG("Region created successfully");
createEntry(regionNamesAuth[0], keys[2], vals[2]);
LOG("Entry created successfully");
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
if (regPtr0 != nullptr) {
LOG("Going to do registerAllKeys");
regPtr0->registerAllKeys();
@@ -316,7 +316,7 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
for (int i = 0; i < 5; i++) {
entrymap.emplace(CacheableKey::create(i), CacheableInt32::create(i));
}
- RegionPtr regPtr = getHelper()->getRegion(regionNamesAuth[0]);
+ auto regPtr = getHelper()->getRegion(regionNamesAuth[0]);
regPtr->putAll(entrymap);
LOG("PutAll completed successfully");
invalidateEntry(regionNamesAuth[0], keys[0]);
@@ -336,8 +336,8 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
}
HANDLE_NO_NOT_AUTHORIZED_EXCEPTION
try {
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
- CacheableKeyPtr keyPtr = CacheableKey::create(keys[2]);
+ auto regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
+ auto keyPtr = CacheableKey::create(keys[2]);
auto checkPtr =
std::dynamic_pointer_cast<CacheableString>(regPtr0->get(keyPtr));
if (checkPtr != nullptr) {
@@ -351,7 +351,7 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
}
}
HANDLE_NOT_AUTHORIZED_EXCEPTION
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
try {
LOG("Going to do registerAllKeys");
regPtr0->registerAllKeys();
@@ -363,7 +363,7 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
for (int i = 0; i < 5; i++) {
regPtr0->invalidate(CacheableKey::create(i));
}
- VectorOfCacheableKey entrykeys;
+ std::vector<std::shared_ptr<CacheableKey>> entrykeys;
for (int i = 0; i < 5; i++) {
entrykeys.push_back(CacheableKey::create(i));
}
@@ -381,11 +381,11 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
}
HANDLE_NOT_AUTHORIZED_EXCEPTION
- PoolPtr pool =
+ auto pool =
getHelper()->getCache()->getPoolManager().find(regionNamesAuth[0]);
try {
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
if (pool != nullptr) {
// Using region name as pool name
qs = pool->getQueryService();
@@ -396,7 +396,7 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
sprintf(queryString, "select * from /%s", regionNamesAuth[0]);
CqAttributesFactory cqFac;
auto cqAttrs = cqFac.create();
- CqQueryPtr qry = qs->newCq("cq_security", queryString, cqAttrs);
+ auto qry = qs->newCq("cq_security", queryString, cqAttrs);
qs->executeCqs();
FAIL("CQ should not have completed successfully");
}
@@ -423,7 +423,7 @@ DUNIT_TASK_DEFINITION(READER_CLIENT, StepThree)
{
initCredentialGenerator();
initClientAuth('R');
- RegionPtr rptr;
+ std::shared_ptr<Region> rptr;
char buf[100];
int i = 102;
@@ -431,9 +431,9 @@ DUNIT_TASK_DEFINITION(READER_CLIENT, StepThree)
rptr = getHelper()->getRegion(regionNamesAuth[0]);
sprintf(buf, "%s: %d", rptr->getName(), i);
- CacheableKeyPtr key = createKey(buf);
+ auto key = createKey(buf);
sprintf(buf, "testUpdate::%s: value of %d", rptr->getName(), i);
- CacheableStringPtr valuePtr = CacheableString::create(buf);
+ auto valuePtr = CacheableString::create(buf);
try {
LOG("Trying put Operation");
rptr->put(key, valuePtr);
@@ -463,8 +463,8 @@ DUNIT_TASK_DEFINITION(READER_CLIENT, StepThree)
"Key should not have been found in the region");
try {
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
- CacheableKeyPtr keyPtr = CacheableKey::create(keys[2]);
+ auto regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
+ auto keyPtr = CacheableKey::create(keys[2]);
auto checkPtr =
std::dynamic_pointer_cast<CacheableString>(regPtr0->get(keyPtr));
if (checkPtr != nullptr) {
@@ -478,7 +478,7 @@ DUNIT_TASK_DEFINITION(READER_CLIENT, StepThree)
}
HANDLE_NO_NOT_AUTHORIZED_EXCEPTION
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
if (regPtr0 != nullptr) {
try {
LOG("Going to do registerAllKeys");
@@ -501,7 +501,7 @@ DUNIT_TASK_DEFINITION(READER_CLIENT, StepThree)
HANDLE_NOT_AUTHORIZED_EXCEPTION
try {
- VectorOfCacheableKey entrykeys;
+ std::vector<std::shared_ptr<CacheableKey>> entrykeys;
for (int i = 0; i < 5; i++) {
entrykeys.push_back(CacheableKey::create(i));
}
@@ -521,11 +521,11 @@ DUNIT_TASK_DEFINITION(READER_CLIENT, StepThree)
}
HANDLE_NOT_AUTHORIZED_EXCEPTION
- PoolPtr pool =
+ auto pool =
getHelper()->getCache()->getPoolManager().find(regionNamesAuth[0]);
try {
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
if (pool != nullptr) {
// Using region name as pool name
qs = pool->getQueryService();
@@ -536,7 +536,7 @@ DUNIT_TASK_DEFINITION(READER_CLIENT, StepThree)
sprintf(queryString, "select * from /%s", regionNamesAuth[0]);
CqAttributesFactory cqFac;
auto cqAttrs = cqFac.create();
- CqQueryPtr qry = qs->newCq("cq_security", queryString, cqAttrs);
+ auto qry = qs->newCq("cq_security", queryString, cqAttrs);
qs->executeCqs();
// FAIL("CQ should not have completed successfully");
}
diff --git a/cppcache/integration-test/testThinClientSecurityAuthentication.cpp b/cppcache/integration-test/testThinClientSecurityAuthentication.cpp
index 9a1d2f4..2259f16 100644
--- a/cppcache/integration-test/testThinClientSecurityAuthentication.cpp
+++ b/cppcache/integration-test/testThinClientSecurityAuthentication.cpp
@@ -16,7 +16,6 @@
*/
#include "fw_dunit.hpp"
#include "ThinClientHelper.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
@@ -32,7 +31,7 @@ using namespace test;
const char* locHostPort =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, 1);
const char* regionNamesAuth[] = {"DistRegionAck", "DistRegionNoAck"};
-CredentialGeneratorPtr credentialGeneratorHandler;
+std::shared_ptr<CredentialGenerator> credentialGeneratorHandler;
std::string getXmlPath() {
char xmlPath[1000] = {'\0'};
@@ -72,31 +71,31 @@ void initCredentialGenerator() {
}
void initClientAuth(char credentialsType) {
- PropertiesPtr config = Properties::create();
- if (credentialGeneratorHandler == nullptr) {
- FAIL("credentialGeneratorHandler is nullptr");
- }
- bool insertAuthInit = true;
- switch (credentialsType) {
- case 'C':
- credentialGeneratorHandler->getValidCredentials(config);
- config->insert("security-password",
- config->find("security-username")->asChar());
- printf("Username is %s and Password is %s ",
- config->find("security-username")->asChar(),
- config->find("security-password")->asChar());
- break;
- case 'I':
- credentialGeneratorHandler->getInvalidCredentials(config);
- config->insert("security-password", "junk");
- printf("Username is %s and Password is %s ",
- config->find("security-username")->asChar(),
- config->find("security-password")->asChar());
- break;
- case 'N':
- default:
- insertAuthInit = false;
- break;
+ auto config = Properties::create();
+ if (credentialGeneratorHandler == nullptr) {
+ FAIL("credentialGeneratorHandler is nullptr");
+ }
+ bool insertAuthInit = true;
+ switch (credentialsType) {
+ case 'C':
+ credentialGeneratorHandler->getValidCredentials(config);
+ config->insert("security-password",
+ config->find("security-username")->asChar());
+ printf("Username is %s and Password is %s ",
+ config->find("security-username")->asChar(),
+ config->find("security-password")->asChar());
+ break;
+ case 'I':
+ credentialGeneratorHandler->getInvalidCredentials(config);
+ config->insert("security-password", "junk");
+ printf("Username is %s and Password is %s ",
+ config->find("security-username")->asChar(),
+ config->find("security-password")->asChar());
+ break;
+ case 'N':
+ default:
+ insertAuthInit = false;
+ break;
}
if (insertAuthInit) {
// config->insert(
@@ -196,9 +195,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepTwo)
createRegionForSecurity(regionNamesAuth[0], USE_ACK, true);
createEntry(regionNamesAuth[0], keys[0], vals[0]);
updateEntry(regionNamesAuth[0], keys[0], nvals[0]);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
- regPtr0->containsKeyOnServer(
- apache::geode::client::CacheableKey::create(keys[0]));
+ auto regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
+ regPtr0->containsKeyOnServer(
+ apache::geode::client::CacheableKey::create(keys[0]));
} catch (const apache::geode::client::Exception& other) {
other.printStackTrace();
FAIL(other.getMessage());
@@ -255,18 +254,18 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepFive)
SLEEP(80);
try {
createRegionForSecurity(regionNamesAuth[1], USE_ACK, true);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
- CacheableKeyPtr keyPtr = CacheableKey::create(keys[0]);
- auto checkPtr =
- std::dynamic_pointer_cast<CacheableString>(regPtr0->get(keyPtr));
- if (checkPtr != nullptr && !strcmp(nvals[0], checkPtr->asChar())) {
- LOG("checkPtr is not null");
- char buf[1024];
- sprintf(buf, "In net search, get returned %s for key %s",
- checkPtr->asChar(), keys[0]);
- LOG(buf);
- } else {
- LOG("checkPtr is nullptr");
+ auto regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
+ auto keyPtr = CacheableKey::create(keys[0]);
+ auto checkPtr =
+ std::dynamic_pointer_cast<CacheableString>(regPtr0->get(keyPtr));
+ if (checkPtr != nullptr && !strcmp(nvals[0], checkPtr->asChar())) {
+ LOG("checkPtr is not null");
+ char buf[1024];
+ sprintf(buf, "In net search, get returned %s for key %s",
+ checkPtr->asChar(), keys[0]);
+ LOG(buf);
+ } else {
+ LOG("checkPtr is nullptr");
}
} catch (const apache::geode::client::Exception& other) {
other.printStackTrace();
@@ -328,23 +327,23 @@ void createEntryTx(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Create entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
- ASSERT(regPtr != nullptr, "Region not found.");
+ auto regPtr = getHelper()->getRegion(name);
+ ASSERT(regPtr != nullptr, "Region not found.");
- // ASSERT( !regPtr->containsKey( keyPtr ), "Key should not have been found in
- // region." );
- // ASSERT( !regPtr->containsValueForKey( keyPtr ), "Value should not have been
- // found in region." );
+ // ASSERT( !regPtr->containsKey( keyPtr ), "Key should not have been found in
+ // region." );
+ // ASSERT( !regPtr->containsValueForKey( keyPtr ), "Value should not have been
+ // found in region." );
- // regPtr->create( keyPtr, valPtr );
- regPtr->put(keyPtr, valPtr);
- LOG("Created entry.");
+ // regPtr->create( keyPtr, valPtr );
+ regPtr->put(keyPtr, valPtr);
+ LOG("Created entry.");
- // verifyEntry( name, key, value );
- LOG("Entry created.");
+ // verifyEntry( name, key, value );
+ LOG("Entry created.");
}
void updateEntryTx(const char* name, const char* key, const char* value) {
@@ -353,21 +352,21 @@ void updateEntryTx(const char* name, const char* key, const char* value) {
value, name);
fflush(stdout);
// Update entry, verify entry is correct
- CacheableKeyPtr keyPtr = createKey(key);
- CacheableStringPtr valPtr = CacheableString::create(value);
+ auto keyPtr = createKey(key);
+ auto valPtr = CacheableString::create(value);
- RegionPtr regPtr = getHelper()->getRegion(name);
- ASSERT(regPtr != nullptr, "Region not found.");
+ auto regPtr = getHelper()->getRegion(name);
+ ASSERT(regPtr != nullptr, "Region not found.");
- ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
- ASSERT(regPtr->containsValueForKey(keyPtr),
- "Value should have been found in region.");
+ ASSERT(regPtr->containsKey(keyPtr), "Key should have been found in region.");
+ ASSERT(regPtr->containsValueForKey(keyPtr),
+ "Value should have been found in region.");
- regPtr->put(keyPtr, valPtr);
- LOG("Put entry.");
+ regPtr->put(keyPtr, valPtr);
+ LOG("Put entry.");
- verifyEntry(name, key, value);
- LOG("Entry updated.");
+ verifyEntry(name, key, value);
+ LOG("Entry updated.");
}
DUNIT_TASK_DEFINITION(CLIENT1, StepEight)
@@ -375,31 +374,30 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepEight)
initClientAuth(CORRECT_CREDENTIALS);
try {
createRegionForSecurity(regionNamesAuth[1], USE_ACK, true);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesAuth[1]);
- CacheTransactionManagerPtr txManager =
- getHelper()->getCache()->getCacheTransactionManager();
- LOG("txManager got");
- txManager->begin();
- LOG("txManager begin done");
- createEntryTx(regionNamesAuth[1], "TxKey", "TxValue");
- LOG("createEntryTx done");
- txManager->commit();
- LOG("txManager commit done");
-
- CacheableKeyPtr keyPtr = CacheableKey::create("TxKey");
- auto checkPtr =
- std::dynamic_pointer_cast<CacheableString>(regPtr0->get(keyPtr));
- ASSERT(checkPtr != nullptr, "Value not found.");
- LOGINFO("checkPtr->asChar() = %s ", checkPtr->asChar());
- ASSERT(strcmp("TxValue", checkPtr->asChar()) == 0, "Value not correct.");
- if (checkPtr != nullptr && !strcmp("TxValue", checkPtr->asChar())) {
- LOG("checkPtr is not null");
- char buf[1024];
- sprintf(buf, "In net search, get returned %s for key %s",
- checkPtr->asChar(), "TxKey");
- LOG(buf);
- } else {
- LOG("checkPtr is nullptr");
+ auto regPtr0 = getHelper()->getRegion(regionNamesAuth[1]);
+ auto txManager = getHelper()->getCache()->getCacheTransactionManager();
+ LOG("txManager got");
+ txManager->begin();
+ LOG("txManager begin done");
+ createEntryTx(regionNamesAuth[1], "TxKey", "TxValue");
+ LOG("createEntryTx done");
+ txManager->commit();
+ LOG("txManager commit done");
+
+ auto keyPtr = CacheableKey::create("TxKey");
+ auto checkPtr =
+ std::dynamic_pointer_cast<CacheableString>(regPtr0->get(keyPtr));
+ ASSERT(checkPtr != nullptr, "Value not found.");
+ LOGINFO("checkPtr->asChar() = %s ", checkPtr->asChar());
+ ASSERT(strcmp("TxValue", checkPtr->asChar()) == 0, "Value not correct.");
+ if (checkPtr != nullptr && !strcmp("TxValue", checkPtr->asChar())) {
+ LOG("checkPtr is not null");
+ char buf[1024];
+ sprintf(buf, "In net search, get returned %s for key %s",
+ checkPtr->asChar(), "TxKey");
+ LOG(buf);
+ } else {
+ LOG("checkPtr is nullptr");
}
txManager->begin();
diff --git a/cppcache/integration-test/testThinClientSecurityAuthenticationMU.cpp b/cppcache/integration-test/testThinClientSecurityAuthenticationMU.cpp
index 9ae69aa..f032935 100644
--- a/cppcache/integration-test/testThinClientSecurityAuthenticationMU.cpp
+++ b/cppcache/integration-test/testThinClientSecurityAuthenticationMU.cpp
@@ -19,7 +19,6 @@
#include "fw_dunit.hpp"
#include "ThinClientHelper.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
@@ -35,7 +34,7 @@ using namespace test;
const char* locHostPort =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, 1);
const char* regionNamesAuth[] = {"DistRegionAck", "DistRegionNoAck"};
-CredentialGeneratorPtr credentialGeneratorHandler;
+std::shared_ptr<CredentialGenerator> credentialGeneratorHandler;
std::string getXmlPath() {
char xmlPath[1000] = {'\0'};
@@ -72,12 +71,11 @@ void initCredentialGenerator() {
loopNum++;
if (loopNum > 2) loopNum = 1;
-}
-PropertiesPtr userCreds;
+} std::shared_ptr<Properties> userCreds;
void initClientAuth(char credentialsType) {
printf(" in initclientAuth 0 = %c ", credentialsType);
userCreds = Properties::create();
- PropertiesPtr config = Properties::create();
+ auto config = Properties::create();
if (credentialGeneratorHandler == nullptr) {
FAIL("credentialGeneratorHandler is nullptr");
}
@@ -189,11 +187,11 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepOne)
false, -1, true, 0);
LOG(" 5");
// need to insure pool name
- PoolPtr pool = getPool(regionNamesAuth[0]);
+ auto pool = getPool(regionNamesAuth[0]);
LOG(" 6");
if (pool != nullptr) {
LOG(" 7");
- RegionServicePtr virtualCache = getVirtualCache(userCreds, pool);
+ auto virtualCache = getVirtualCache(userCreds, pool);
LOG(" 8");
virtualCache->getRegion(regionNamesAuth[0])->put(keys[0], vals[0]);
LOG("Operation allowed, something is wrong.");
@@ -222,10 +220,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepTwo)
false, -1, true, 0);
char buff[128] = {'\0'};
sprintf(buff, "%s_0", regionNamesAuth[0]);
- PoolPtr pool = getPool(regionNamesAuth[0]);
+ auto pool = getPool(regionNamesAuth[0]);
if (pool != nullptr) {
- RegionServicePtr virtualCache = getVirtualCache(userCreds, pool);
- RegionPtr virtualRegion = virtualCache->getRegion(regionNamesAuth[0]);
+ auto virtualCache = getVirtualCache(userCreds, pool);
+ auto virtualRegion = virtualCache->getRegion(regionNamesAuth[0]);
virtualRegion->create(keys[0], vals[0]);
virtualRegion->put(keys[0], nvals[0]);
virtualRegion->containsKeyOnServer(
@@ -251,9 +249,9 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepThree)
createRegionForSecurity(regionNamesAuth[0], USE_ACK, false, nullptr,
false, -1, true, 0);
// need to insure pool name
- PoolPtr pool = getPool(regionNamesAuth[0]);
+ auto pool = getPool(regionNamesAuth[0]);
if (pool != nullptr) {
- RegionServicePtr virtualCache = getVirtualCache(userCreds, pool);
+ auto virtualCache = getVirtualCache(userCreds, pool);
virtualCache->getRegion(regionNamesAuth[0])->put(keys[0], vals[0]);
} else {
LOG("Pool is nullptr");
@@ -282,9 +280,9 @@ DUNIT_TASK_DEFINITION(CLIENT3, StepFour)
createRegionForSecurity(regionNamesAuth[0], USE_ACK, false, nullptr,
false, -1, true, 0);
// need to insure pool name
- PoolPtr pool = getPool(regionNamesAuth[0]);
+ auto pool = getPool(regionNamesAuth[0]);
if (pool != nullptr) {
- RegionServicePtr virtualCache = getVirtualCache(userCreds, pool);
+ auto virtualCache = getVirtualCache(userCreds, pool);
virtualCache->getRegion(regionNamesAuth[0])->put(keys[0], vals[0]);
} else {
LOG("Pool is nullptr");
@@ -314,16 +312,16 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepFive)
createRegionForSecurity(regionNamesAuth[1], USE_ACK, false, nullptr,
false, -1, true, 0);
// need to insure pool name
- PoolPtr pool = getPool(regionNamesAuth[1]);
- RegionServicePtr virtualCache;
- RegionPtr virtualRegion;
+ auto pool = getPool(regionNamesAuth[1]);
+ std::shared_ptr<RegionService> virtualCache;
+ std::shared_ptr<Region> virtualRegion;
if (pool != nullptr) {
virtualCache = getVirtualCache(userCreds, pool);
virtualRegion = virtualCache->getRegion(regionNamesAuth[1]);
} else {
LOG("Pool is nullptr");
}
- CacheableKeyPtr keyPtr = CacheableKey::create(keys[0]);
+ auto keyPtr = CacheableKey::create(keys[0]);
LOG("before get");
auto checkPtr = std::dynamic_pointer_cast<CacheableString>(
virtualRegion->get(keyPtr));
@@ -353,10 +351,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepSix)
false, -1, true, 0);
char buff[128] = {'\0'};
sprintf(buff, "%s_1", regionNamesAuth[0]);
- PoolPtr pool = getPool(regionNamesAuth[0]);
+ auto pool = getPool(regionNamesAuth[0]);
if (pool != nullptr) {
- RegionServicePtr virtualCache = getVirtualCache(userCreds, pool);
- RegionPtr virtualRegion = virtualCache->getRegion(regionNamesAuth[0]);
+ auto virtualCache = getVirtualCache(userCreds, pool);
+ auto virtualRegion = virtualCache->getRegion(regionNamesAuth[0]);
virtualRegion->create(keys[0], vals[0]);
virtualRegion->put(keys[0], nvals[0]);
LOG("Operation allowed, something is wrong.");
@@ -389,10 +387,10 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepSeven)
false, -1, true, 0);
char buff[128] = {'\0'};
sprintf(buff, "%s_0", regionNamesAuth[0]);
- PoolPtr pool = getPool(regionNamesAuth[0]);
+ auto pool = getPool(regionNamesAuth[0]);
if (pool != nullptr) {
- RegionServicePtr virtualCache = getVirtualCache(userCreds, pool);
- RegionPtr virtualRegion = virtualCache->getRegion(regionNamesAuth[0]);
+ auto virtualCache = getVirtualCache(userCreds, pool);
+ auto virtualRegion = virtualCache->getRegion(regionNamesAuth[0]);
virtualRegion->create(keys[0], vals[0]);
virtualRegion->put(keys[0], nvals[0]);
LOG("Operation allowed, something is wrong.");
@@ -420,9 +418,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepEight)
createRegionForSecurity(regionNamesAuth[1], USE_ACK, false, nullptr,
false, -1, true, 0);
// need to insure pool name
- PoolPtr pool = getPool(regionNamesAuth[1]);
- RegionServicePtr virtualCache;
- RegionPtr virtualRegion;
+ auto pool = getPool(regionNamesAuth[1]);
+ std::shared_ptr<RegionService> virtualCache;
+ std::shared_ptr<Region> virtualRegion;
if (pool != nullptr) {
virtualCache = getVirtualCache(userCreds, pool);
virtualRegion = virtualCache->getRegion(regionNamesAuth[1]);
@@ -430,29 +428,29 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepEight)
LOG("Pool is nullptr");
}
- CacheTransactionManagerPtr txManager =
+ auto txManager =
getHelper()->getCache()->getCacheTransactionManager();
- LOG("txManager got");
- txManager->begin();
- LOG("txManager begin done");
- virtualRegion->put("TxKey", "TxValue");
- LOG("createEntryTx done");
- txManager->commit();
- LOG("txManager commit done");
-
- auto checkPtr = std::dynamic_pointer_cast<CacheableString>(
- virtualRegion->get("TxKey"));
- ASSERT(checkPtr != nullptr, "Value not found.");
- LOGINFO("checkPtr->asChar() = %s ", checkPtr->asChar());
- ASSERT(strcmp("TxValue", checkPtr->asChar()) == 0, "Value not correct.");
- if (checkPtr != nullptr && !strcmp("TxValue", checkPtr->asChar())) {
- LOG("checkPtr is not null");
- char buf[1024];
- sprintf(buf, "In net search, get returned %s for key %s",
- checkPtr->asChar(), "TxKey");
- LOG(buf);
- } else {
- LOG("checkPtr is nullptr");
+ LOG("txManager got");
+ txManager->begin();
+ LOG("txManager begin done");
+ virtualRegion->put("TxKey", "TxValue");
+ LOG("createEntryTx done");
+ txManager->commit();
+ LOG("txManager commit done");
+
+ auto checkPtr = std::dynamic_pointer_cast<CacheableString>(
+ virtualRegion->get("TxKey"));
+ ASSERT(checkPtr != nullptr, "Value not found.");
+ LOGINFO("checkPtr->asChar() = %s ", checkPtr->asChar());
+ ASSERT(strcmp("TxValue", checkPtr->asChar()) == 0, "Value not correct.");
+ if (checkPtr != nullptr && !strcmp("TxValue", checkPtr->asChar())) {
+ LOG("checkPtr is not null");
+ char buf[1024];
+ sprintf(buf, "In net search, get returned %s for key %s",
+ checkPtr->asChar(), "TxKey");
+ LOG(buf);
+ } else {
+ LOG("checkPtr is nullptr");
}
txManager->begin();
diff --git a/cppcache/integration-test/testThinClientSecurityAuthenticationSetAuthInitialize.cpp b/cppcache/integration-test/testThinClientSecurityAuthenticationSetAuthInitialize.cpp
index e2599af..e71a08a 100644
--- a/cppcache/integration-test/testThinClientSecurityAuthenticationSetAuthInitialize.cpp
+++ b/cppcache/integration-test/testThinClientSecurityAuthenticationSetAuthInitialize.cpp
@@ -18,7 +18,6 @@
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
-#include <geode/GeodeCppCache.hpp>
#include <geode/AuthInitialize.hpp>
#include "fw_dunit.hpp"
@@ -31,7 +30,7 @@ using namespace test;
const char* locHostPort =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, 1);
const char* regionNamesAuth[] = {"DistRegionAck", "DistRegionNoAck"};
-CredentialGeneratorPtr credentialGeneratorHandler;
+std::shared_ptr<CredentialGenerator> credentialGeneratorHandler;
std::string getXmlPath() {
char xmlPath[1000] = {'\0'};
@@ -51,10 +50,10 @@ class UserPasswordAuthInit : public AuthInitialize {
~UserPasswordAuthInit() {}
- PropertiesPtr getCredentials(const PropertiesPtr& securityprops,
- const char* server) {
+ std::shared_ptr<Properties> getCredentials(
+ const std::shared_ptr<Properties>& securityprops, const char* server) {
// LOGDEBUG("UserPasswordAuthInit: inside userPassword::getCredentials");
- CacheablePtr userName;
+ std::shared_ptr<Cacheable> userName;
if (securityprops == nullptr ||
(userName = securityprops->find(SECURITY_USERNAME)) == nullptr) {
throw AuthenticationFailedException(
@@ -64,15 +63,15 @@ class UserPasswordAuthInit : public AuthInitialize {
auto credentials = Properties::create();
credentials->insert(SECURITY_USERNAME, userName->toString()->asChar());
- CacheableStringPtr passwd = securityprops->find(SECURITY_PASSWORD);
- // If password is not provided then use empty string as the password.
- if (passwd == nullptr) {
- passwd = CacheableString::create("");
- }
- credentials->insert(SECURITY_PASSWORD, passwd->asChar());
- // LOGDEBUG("UserPasswordAuthInit: inserted username:password - %s:%s",
- // userName->toString()->asChar(), passwd->toString()->asChar());
- return credentials;
+ auto passwd = securityprops->find(SECURITY_PASSWORD);
+ // If password is not provided then use empty string as the password.
+ if (passwd == nullptr) {
+ passwd = CacheableString::create("");
+ }
+ credentials->insert(SECURITY_PASSWORD, passwd->asChar());
+ // LOGDEBUG("UserPasswordAuthInit: inserted username:password - %s:%s",
+ // userName->toString()->asChar(), passwd->toString()->asChar());
+ return credentials;
}
void close() { return; }
@@ -135,9 +134,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, TestAuthentication)
createRegionForSecurity(regionNamesAuth[0], USE_ACK, true);
createEntry(regionNamesAuth[0], keys[0], vals[0]);
updateEntry(regionNamesAuth[0], keys[0], nvals[0]);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
- regPtr0->containsKeyOnServer(
- apache::geode::client::CacheableKey::create(keys[0]));
+ auto regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
+ regPtr0->containsKeyOnServer(
+ apache::geode::client::CacheableKey::create(keys[0]));
} catch (const apache::geode::client::Exception& other) {
other.printStackTrace();
FAIL(other.getMessage());
diff --git a/cppcache/integration-test/testThinClientSecurityAuthorization.cpp b/cppcache/integration-test/testThinClientSecurityAuthorization.cpp
index 0055922..fadf78b 100644
--- a/cppcache/integration-test/testThinClientSecurityAuthorization.cpp
+++ b/cppcache/integration-test/testThinClientSecurityAuthorization.cpp
@@ -15,7 +15,8 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
+#include <geode/FunctionService.hpp>
+#include <geode/CqAttributesFactory.hpp>
#define ROOT_NAME "testThinClientSecurityAuthentication"
#define ROOT_SCOPE DISTRIBUTED_ACK
@@ -31,7 +32,7 @@ using namespace apache::geode::client;
const char* locHostPort =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, 1);
-CredentialGeneratorPtr credentialGeneratorHandler;
+std::shared_ptr<CredentialGenerator> credentialGeneratorHandler;
std::string getXmlPath() {
char xmlPath[1000] = {'\0'};
@@ -117,7 +118,7 @@ opCodeList::value_type tmpAArr[] = {OP_CREATE, OP_UPDATE,
const char* regionNamesAuth[] = {"DistRegionAck"};
void initClientAuth(char UserType) {
- PropertiesPtr config = Properties::create();
+ auto config = Properties::create();
opCodeList wr(tmpWArr, tmpWArr + sizeof tmpWArr / sizeof *tmpWArr);
opCodeList rt(tmpRArr, tmpRArr + sizeof tmpRArr / sizeof *tmpRArr);
opCodeList ad(tmpAArr, tmpAArr + sizeof tmpAArr / sizeof *tmpAArr);
@@ -213,14 +214,14 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
LOG("Tying Region creation");
createRegionForSecurity(regionNamesAuth[0], USE_ACK, true);
- RegionPtr regPtr = getHelper()->getRegion(regionNamesAuth[0]);
+ auto regPtr = getHelper()->getRegion(regionNamesAuth[0]);
LOG("Region created successfully");
//---------------------for region clear tests-----
regPtr->put(1, 1);
regPtr->clear();
- CacheablePtr getVal = regPtr->get(1);
+ auto getVal = regPtr->get(1);
if (getVal == nullptr) {
LOG("Get completed after region.clear successfully");
} else {
@@ -244,7 +245,7 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
for (int i = 0; i < 5; i++) {
regPtr->invalidate(CacheableKey::create(i));
}
- VectorOfCacheableKey entrykeys;
+ std::vector<std::shared_ptr<CacheableKey>> entrykeys;
for (int i = 0; i < 5; i++) {
entrykeys.push_back(CacheableKey::create(i));
}
@@ -261,9 +262,9 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
regPtr->query("1=1");
LOG("Query completed successfully");
- PoolPtr pool =
+ auto pool =
getHelper()->getCache()->getPoolManager().find(regionNamesAuth[0]);
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
if (pool != nullptr) {
// Using region name as pool name
qs = pool->getQueryService();
@@ -274,7 +275,7 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
sprintf(queryString, "select * from /%s", regionNamesAuth[0]);
CqAttributesFactory cqFac;
auto cqAttrs = cqFac.create();
- CqQueryPtr qry = qs->newCq("cq_security", queryString, cqAttrs);
+ auto qry = qs->newCq("cq_security", queryString, cqAttrs);
qs->executeCqs();
qs->closeCqs();
LOG("CQ completed successfully");
@@ -306,7 +307,7 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
LOG("Region created successfully");
createEntry(regionNamesAuth[0], keys[2], vals[2]);
LOG("Entry created successfully");
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
if (regPtr0 != nullptr) {
LOG("Going to do registerAllKeys");
regPtr0->registerAllKeys();
@@ -335,7 +336,7 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
for (int i = 0; i < 5; i++) {
entrymap.emplace(CacheableKey::create(i), CacheableInt32::create(i));
}
- RegionPtr regPtr = getHelper()->getRegion(regionNamesAuth[0]);
+ auto regPtr = getHelper()->getRegion(regionNamesAuth[0]);
regPtr->putAll(entrymap);
LOG("PutAll completed successfully");
invalidateEntry(regionNamesAuth[0], keys[0]);
@@ -355,7 +356,7 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
}
HANDLE_NO_NOT_AUTHORIZED_EXCEPTION
try {
- RegionPtr regPtr = getHelper()->getRegion(regionNamesAuth[0]);
+ auto regPtr = getHelper()->getRegion(regionNamesAuth[0]);
LOG("containsKeyOnServer");
regPtr->containsKeyOnServer(
apache::geode::client::CacheableKey::create(keys[2]));
@@ -364,8 +365,8 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
HANDLE_NOT_AUTHORIZED_EXCEPTION
try {
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
- CacheableKeyPtr keyPtr = CacheableKey::create(keys[2]);
+ auto regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
+ auto keyPtr = CacheableKey::create(keys[2]);
auto checkPtr =
std::dynamic_pointer_cast<CacheableString>(regPtr0->get(keyPtr));
if (checkPtr != nullptr) {
@@ -379,7 +380,7 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
}
}
HANDLE_NOT_AUTHORIZED_EXCEPTION
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
try {
LOG("Going to do registerAllKeys");
regPtr0->registerAllKeys();
@@ -391,7 +392,7 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
for (int i = 0; i < 5; i++) {
regPtr0->invalidate(CacheableKey::create(i));
}
- VectorOfCacheableKey entrykeys;
+ std::vector<std::shared_ptr<CacheableKey>> entrykeys;
for (int i = 0; i < 5; i++) {
entrykeys.push_back(CacheableKey::create(i));
}
@@ -408,11 +409,11 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
}
HANDLE_NOT_AUTHORIZED_EXCEPTION
- PoolPtr pool =
+ auto pool =
getHelper()->getCache()->getPoolManager().find(regionNamesAuth[0]);
try {
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
if (pool != nullptr) {
// Using region name as pool name
qs = pool->getQueryService();
@@ -423,7 +424,7 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
sprintf(queryString, "select * from /%s", regionNamesAuth[0]);
CqAttributesFactory cqFac;
auto cqAttrs = cqFac.create();
- CqQueryPtr qry = qs->newCq("cq_security", queryString, cqAttrs);
+ auto qry = qs->newCq("cq_security", queryString, cqAttrs);
qs->executeCqs();
FAIL("CQ should not have completed successfully");
}
@@ -448,7 +449,7 @@ DUNIT_TASK_DEFINITION(READER_CLIENT, StepThree)
{
initCredentialGenerator();
initClientAuth('R');
- RegionPtr rptr;
+ std::shared_ptr<Region> rptr;
char buf[100];
int i = 102;
@@ -456,9 +457,9 @@ DUNIT_TASK_DEFINITION(READER_CLIENT, StepThree)
rptr = getHelper()->getRegion(regionNamesAuth[0]);
sprintf(buf, "%s: %d", rptr->getName(), i);
- CacheableKeyPtr key = createKey(buf);
+ auto key = createKey(buf);
sprintf(buf, "testUpdate::%s: value of %d", rptr->getName(), i);
- CacheableStringPtr valuePtr = CacheableString::create(buf);
+ auto valuePtr = CacheableString::create(buf);
try {
LOG("Trying put Operation");
rptr->put(key, valuePtr);
@@ -494,8 +495,8 @@ DUNIT_TASK_DEFINITION(READER_CLIENT, StepThree)
"Key should not have been found in the region");
try {
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
- CacheableKeyPtr keyPtr = CacheableKey::create(keys[2]);
+ auto regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
+ auto keyPtr = CacheableKey::create(keys[2]);
auto checkPtr =
std::dynamic_pointer_cast<CacheableString>(regPtr0->get(keyPtr));
if (checkPtr != nullptr) {
@@ -511,13 +512,13 @@ DUNIT_TASK_DEFINITION(READER_CLIENT, StepThree)
try {
LOG("Trying region clear..");
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
regPtr0->clear();
FAIL("Should have got NotAuthorizedException for region.clear ops");
}
HANDLE_NOT_AUTHORIZED_EXCEPTION
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
if (regPtr0 != nullptr) {
try {
LOG("Going to do registerAllKeys");
@@ -547,7 +548,7 @@ DUNIT_TASK_DEFINITION(READER_CLIENT, StepThree)
HANDLE_NO_NOT_AUTHORIZED_EXCEPTION
try {
- VectorOfCacheableKey entrykeys;
+ std::vector<std::shared_ptr<CacheableKey>> entrykeys;
for (int i = 0; i < 5; i++) {
entrykeys.push_back(CacheableKey::create(i));
}
@@ -566,11 +567,11 @@ DUNIT_TASK_DEFINITION(READER_CLIENT, StepThree)
}
HANDLE_NOT_AUTHORIZED_EXCEPTION
- PoolPtr pool =
+ auto pool =
getHelper()->getCache()->getPoolManager().find(regionNamesAuth[0]);
try {
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
if (pool != nullptr) {
// Using region name as pool name
qs = pool->getQueryService();
@@ -581,7 +582,7 @@ DUNIT_TASK_DEFINITION(READER_CLIENT, StepThree)
sprintf(queryString, "select * from /%s", regionNamesAuth[0]);
CqAttributesFactory cqFac;
auto cqAttrs = cqFac.create();
- CqQueryPtr qry = qs->newCq("cq_security", queryString, cqAttrs);
+ auto qry = qs->newCq("cq_security", queryString, cqAttrs);
qs->executeCqs();
// FAIL("CQ should not have completed successfully");
}
@@ -621,7 +622,7 @@ DUNIT_TASK_DEFINITION(READER_CLIENT, StepThree)
try {
if (pool != nullptr) {
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
FunctionService::onRegion(regPtr0)
->execute("securityTest")
->getResult();
diff --git a/cppcache/integration-test/testThinClientSecurityAuthorizationMU.cpp b/cppcache/integration-test/testThinClientSecurityAuthorizationMU.cpp
index f29f166..3e3a22d 100644
--- a/cppcache/integration-test/testThinClientSecurityAuthorizationMU.cpp
+++ b/cppcache/integration-test/testThinClientSecurityAuthorizationMU.cpp
@@ -15,9 +15,11 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <geode/FunctionService.hpp>
#include <geode/Execution.hpp>
+#include <geode/UserFunctionExecutionException.hpp>
+#include <geode/AttributesFactory.hpp>
+#include <geode/CqAttributesFactory.hpp>
#define ROOT_NAME "testThinClientSecurityAuthenticationMU"
#define ROOT_SCOPE DISTRIBUTED_ACK
@@ -33,7 +35,7 @@ using namespace apache::geode::client;
const char* locHostPort =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, 1);
-CredentialGeneratorPtr credentialGeneratorHandler;
+std::shared_ptr<CredentialGenerator> credentialGeneratorHandler;
char* exFuncNameSendException = (char*)"executeFunction_SendException";
std::string getXmlPath() {
@@ -118,11 +120,10 @@ opCodeList::value_type tmpAArr[] = {OP_CREATE, OP_UPDATE,
#define TYPE_USER_CLIENT 'U'
const char* regionNamesAuth[] = {"DistRegionAck"};
-
-PropertiesPtr userCreds;
+std::shared_ptr<Properties> userCreds;
void initClientAuth(char UserType) {
userCreds = Properties::create();
- PropertiesPtr config = Properties::create();
+ auto config = Properties::create();
opCodeList wr(tmpWArr, tmpWArr + sizeof tmpWArr / sizeof *tmpWArr);
opCodeList rt(tmpRArr, tmpRArr + sizeof tmpRArr / sizeof *tmpRArr);
opCodeList ad(tmpAArr, tmpAArr + sizeof tmpAArr / sizeof *tmpAArr);
@@ -220,9 +221,9 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
-1, true, 0);
LOG("Region created successfully");
LOG("Tying Entry creation");
- RegionServicePtr virtualCache;
- RegionPtr regionPtr;
- PoolPtr pool = getPool(regionNamesAuth[0]);
+ std::shared_ptr<RegionService> virtualCache;
+ std::shared_ptr<Region> regionPtr;
+ auto pool = getPool(regionNamesAuth[0]);
LOG(" 6");
if (pool != nullptr) {
LOG(" 7");
@@ -238,7 +239,7 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
regionPtr->put(1, 1);
regionPtr->clear();
- CacheablePtr getVal = regionPtr->get(1);
+ auto getVal = regionPtr->get(1);
if (getVal == nullptr) {
LOG("Get completed after region.clear successfully");
} else {
@@ -258,7 +259,7 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
for (int i = 0; i < 5; i++) {
entrymap.emplace(CacheableKey::create(i), CacheableInt32::create(i));
}
- // RegionPtr regPtr = getHelper()->getRegion(regionNamesAuth[0]);
+ //auto regPtr = getHelper()->getRegion(regionNamesAuth[0]);
regionPtr->putAll(entrymap);
LOG("PutAll completed successfully");
/*for (int i=0; i<5; i++) {
@@ -269,7 +270,7 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
auto keysvec = regionPtr->serverKeys();
LOG("GetServerKeys check passed for ADMIN");
- VectorOfCacheableKey entrykeys;
+ std::vector<std::shared_ptr<CacheableKey>> entrykeys;
for (int i = 0; i < 5; i++) {
entrykeys.push_back(CacheableKey::create(i));
}
@@ -283,7 +284,7 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
regionPtr->query("1=1");
LOG("Query completed successfully");
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
// Using region name as pool name
try {
qs = pool->getQueryService();
@@ -301,9 +302,9 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
char queryString[100];
sprintf(queryString, "select * from /%s", regionNamesAuth[0]);
- QueryPtr qry = qs->newQuery(queryString);
+ auto qry = qs->newQuery(queryString);
- SelectResultsPtr results;
+ std::shared_ptr<SelectResults> results;
printf(" before query executing\n");
results = qry->execute(std::chrono::seconds(850));
LOG("Query completed successfully");
@@ -311,7 +312,7 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
sprintf(queryString, "select * from /%s", regionNamesAuth[0]);
CqAttributesFactory cqFac;
auto cqAttrs = cqFac.create();
- CqQueryPtr cqQry = qs->newCq("cq_security", queryString, cqAttrs);
+ auto cqQry = qs->newCq("cq_security", queryString, cqAttrs);
cqQry->execute();
cqQry->close();
LOG("CQ completed successfully");
@@ -320,7 +321,7 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
// TODO:
// FunctionService::onServer(pool)->execute("securityTest",
// true)->getResult();
- // FunctionServicePtr funcServ = virtualCache->getFunctionService();
+ // auto funcServ = virtualCache->getFunctionService();
// funcServ->onServer()->execute("securityTest", true)->getResult();
FunctionService::onServer(virtualCache)
->execute("securityTest")
@@ -346,20 +347,20 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
auto value = CacheableInt32::create(i);
sprintf(buf, "execKey-%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
+ auto key = CacheableKey::create(buf);
regionPtr->put(key, value);
}
LOG("Put for execKey's on region complete.");
LOG("Adding filter");
- CacheableArrayListPtr arrList = CacheableArrayList::create();
+ auto arrList = CacheableArrayList::create();
for (int i = 100; i < 120; i++) {
sprintf(buf, "execKey-%d", i);
auto key = CacheableKey::create(buf);
arrList->push_back(key);
}
- CacheableVectorPtr filter = CacheableVector::create();
+ auto filter = CacheableVector::create();
for (int i = 100; i < 120; i++) {
sprintf(buf, "execKey-%d", i);
auto key = CacheableKey::create(buf);
@@ -367,18 +368,17 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
}
LOG("Adding filter done.");
- CacheablePtr args = CacheableBoolean::create(1);
+ auto args = CacheableBoolean::create(1);
// UNUSED bool getResult = true;
- ExecutionPtr funcExec = FunctionService::onRegion(regionPtr);
+ auto funcExec = FunctionService::onRegion(regionPtr);
ASSERT(funcExec != nullptr, "onRegion Returned nullptr");
- ResultCollectorPtr collector =
- funcExec->withArgs(args)->withFilter(filter)->execute(
- exFuncNameSendException, std::chrono::seconds(15));
+ auto collector = funcExec->withArgs(args)->withFilter(filter)->execute(
+ exFuncNameSendException, std::chrono::seconds(15));
ASSERT(collector != nullptr, "onRegion collector nullptr");
- CacheableVectorPtr result = collector->getResult();
+ auto result = collector->getResult();
if (result == nullptr) {
ASSERT(false, "echo String : result is nullptr");
@@ -495,7 +495,7 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
LOG("Entry created successfully");
virtualCache->close();
LOG("Cache close successfully");
- // RegionPtr regPtr0 = getHelper()->getRegion( regionNamesAuth[0] );
+ // auto regPtr0 = getHelper()->getRegion( regionNamesAuth[0] );
/*if (regPtr != nullptr ) {
LOG("Going to do registerAllKeys");
// regPtr->registerAllKeys();
@@ -507,7 +507,7 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
try {
LOG("Trying operation using real region in multiusersecure mode");
- RegionPtr regPtr = getHelper()->getRegion(regionNamesAuth[0]);
+ auto regPtr = getHelper()->getRegion(regionNamesAuth[0]);
regPtr->put("key", "val");
}
HANDLE_NOT_AUTHORIZED_EXCEPTION
@@ -524,9 +524,9 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
createRegionForSecurity(regionNamesAuth[0], USE_ACK, true, nullptr, false,
-1, true, 0);
LOG("Region created successfully");
- RegionServicePtr virtualCache;
- RegionPtr regionPtr;
- PoolPtr pool = getPool(regionNamesAuth[0]);
+ std::shared_ptr<RegionService> virtualCache;
+ std::shared_ptr<Region> regionPtr;
+ auto pool = getPool(regionNamesAuth[0]);
LOG(" 6");
if (pool != nullptr) {
LOG(" 7");
@@ -549,7 +549,7 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
for (int i = 0; i < 5; i++) {
entrymap.emplace(CacheableKey::create(i), CacheableInt32::create(i));
}
- // RegionPtr regPtr = getHelper()->getRegion(regionNamesAuth[0]);
+ // auto regPtr = getHelper()->getRegion(regionNamesAuth[0]);
regionPtr->putAll(entrymap);
LOG("PutAll completed successfully");
// invalidateEntry( regionNamesAuth[0], keys[0] );
@@ -573,9 +573,9 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
HANDLE_NO_NOT_AUTHORIZED_EXCEPTION
try {
- RegionServicePtr virtualCache;
- RegionPtr regionPtr;
- PoolPtr pool = getPool(regionNamesAuth[0]);
+ std::shared_ptr<RegionService> virtualCache;
+ std::shared_ptr<Region> regionPtr;
+ auto pool = getPool(regionNamesAuth[0]);
if (pool != nullptr) {
virtualCache = getVirtualCache(userCreds, pool);
regionPtr = virtualCache->getRegion(regionNamesAuth[0]);
@@ -590,10 +590,10 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
HANDLE_NOT_AUTHORIZED_EXCEPTION
try {
- // RegionPtr regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
- RegionServicePtr virtualCache;
- RegionPtr regionPtr;
- PoolPtr pool = getPool(regionNamesAuth[0]);
+ // auto regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
+ std::shared_ptr<RegionService> virtualCache;
+ std::shared_ptr<Region> regionPtr;
+ auto pool = getPool(regionNamesAuth[0]);
LOG(" 6");
if (pool != nullptr) {
LOG(" 7");
@@ -604,7 +604,7 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
} else {
LOG("Pool is nullptr");
}
- CacheableKeyPtr keyPtr = CacheableKey::create(keys[2]);
+ auto keyPtr = CacheableKey::create(keys[2]);
auto checkPtr =
std::dynamic_pointer_cast<CacheableString>(regionPtr->get(keyPtr));
if (checkPtr != nullptr) {
@@ -618,7 +618,7 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
}
}
HANDLE_NOT_AUTHORIZED_EXCEPTION
- // RegionPtr regPtr0 = getHelper()->getRegion( regionNamesAuth[0] );
+ // auto regPtr0 = getHelper()->getRegion( regionNamesAuth[0] );
try {
LOG("Going to do registerAllKeys");
@@ -628,9 +628,9 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
HANDLE_NOT_AUTHORIZED_EXCEPTION
try {
- RegionServicePtr virtualCache;
- RegionPtr regionPtr;
- PoolPtr pool = getPool(regionNamesAuth[0]);
+ std::shared_ptr<RegionService> virtualCache;
+ std::shared_ptr<Region> regionPtr;
+ auto pool = getPool(regionNamesAuth[0]);
LOG(" 6");
if (pool != nullptr) {
LOG(" 7");
@@ -645,7 +645,7 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
/* for (int i=0; i<5; i++) {
regPtr0->invalidate(CacheableKey::create(i));
}*/
- VectorOfCacheableKey entrykeys;
+ std::vector<std::shared_ptr<CacheableKey>> entrykeys;
for (int i = 0; i < 5; i++) {
entrykeys.push_back(CacheableKey::create(i));
}
@@ -658,9 +658,9 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
HANDLE_NOT_AUTHORIZED_EXCEPTION
try {
- RegionServicePtr virtualCache;
- RegionPtr regionPtr;
- PoolPtr pool = getPool(regionNamesAuth[0]);
+ std::shared_ptr<RegionService> virtualCache;
+ std::shared_ptr<Region> regionPtr;
+ auto pool = getPool(regionNamesAuth[0]);
LOG(" 6");
if (pool != nullptr) {
LOG(" 7");
@@ -677,29 +677,29 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
HANDLE_NOT_AUTHORIZED_EXCEPTION
try {
- RegionServicePtr virtualCache;
- PoolPtr pool = getPool(regionNamesAuth[0]);
+ std::shared_ptr<RegionService> virtualCache;
+ auto pool = getPool(regionNamesAuth[0]);
virtualCache = getVirtualCache(userCreds, pool);
- QueryServicePtr qs = virtualCache->getQueryService();
+ auto qs = virtualCache->getQueryService();
char queryString[100];
sprintf(queryString, "select * from /%s", regionNamesAuth[0]);
CqAttributesFactory cqFac;
auto cqAttrs = cqFac.create();
- CqQueryPtr qry = qs->newCq("cq_security", queryString, cqAttrs);
+ auto qry = qs->newCq("cq_security", queryString, cqAttrs);
qs->executeCqs();
FAIL("CQ should not have completed successfully");
}
HANDLE_NOT_AUTHORIZED_EXCEPTION
try {
- RegionServicePtr virtualCache;
- PoolPtr pool = getPool(regionNamesAuth[0]);
+ std::shared_ptr<RegionService> virtualCache;
+ auto pool = getPool(regionNamesAuth[0]);
virtualCache = getVirtualCache(userCreds, pool);
// FunctionService::onServer(pool)->execute("securityTest",
// true)->getResult();
// FAIL("Function execution should not have completed successfully");
- // FunctionServicePtr funcServ = virtualCache->getFunctionService();
+ // auto funcServ = virtualCache->getFunctionService();
// funcServ->onServer()->execute("securityTest", true)->getResult();
FunctionService::onServer(virtualCache)
->execute("securityTest")
@@ -708,13 +708,13 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
HANDLE_NOT_AUTHORIZED_EXCEPTION
try {
- RegionServicePtr virtualCache;
- PoolPtr pool = getPool(regionNamesAuth[0]);
+ std::shared_ptr<RegionService> virtualCache;
+ auto pool = getPool(regionNamesAuth[0]);
virtualCache = getVirtualCache(userCreds, pool);
// FunctionService::onServer(pool)->execute("securityTest",
// true)->getResult();
// FAIL("Function execution should not have completed successfully");
- // FunctionServicePtr funcServ = virtualCache->getFunctionService();
+ // auto funcServ = virtualCache->getFunctionService();
// funcServ->onServers()->execute("securityTest", true)->getResult();
FunctionService::onServers(virtualCache)
->execute("securityTest")
@@ -723,10 +723,10 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
HANDLE_NOT_AUTHORIZED_EXCEPTION
try {
- RegionServicePtr virtualCache;
- PoolPtr pool = getPool(regionNamesAuth[0]);
+ std::shared_ptr<RegionService> virtualCache;
+ auto pool = getPool(regionNamesAuth[0]);
virtualCache = getVirtualCache(userCreds, pool);
- RegionPtr regionPtr;
+ std::shared_ptr<Region> regionPtr;
regionPtr = virtualCache->getRegion(regionNamesAuth[0]);
//-----------------------Test with
@@ -738,20 +738,20 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
auto value = CacheableInt32::create(i);
sprintf(buf, "execKey-%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
+ auto key = CacheableKey::create(buf);
regionPtr->put(key, value);
}
LOG("Put for execKey's on region complete.");
LOG("Adding filter");
- CacheableArrayListPtr arrList = CacheableArrayList::create();
+ auto arrList = CacheableArrayList::create();
for (int i = 100; i < 120; i++) {
sprintf(buf, "execKey-%d", i);
auto key = CacheableKey::create(buf);
arrList->push_back(key);
}
- CacheableVectorPtr filter = CacheableVector::create();
+ auto filter = CacheableVector::create();
for (int i = 100; i < 120; i++) {
sprintf(buf, "execKey-%d", i);
auto key = CacheableKey::create(buf);
@@ -759,14 +759,14 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
}
LOG("Adding filter done.");
- CacheablePtr args = CacheableBoolean::create(1);
+ auto args = CacheableBoolean::create(1);
// UNUSED bool getResult = true;
LOG("OnServers with sendException");
- ExecutionPtr funcExec = FunctionService::onServers(virtualCache);
+ auto funcExec = FunctionService::onServers(virtualCache);
- ResultCollectorPtr collector = funcExec->withArgs(args)->execute(
+ auto collector = funcExec->withArgs(args)->execute(
exFuncNameSendException, std::chrono::seconds(15));
//----------------------------------------------------------------------------------------------//
@@ -774,10 +774,10 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
HANDLE_NOT_AUTHORIZED_EXCEPTION
try {
- RegionServicePtr virtualCache;
- PoolPtr pool = getPool(regionNamesAuth[0]);
+ std::shared_ptr<RegionService> virtualCache;
+ auto pool = getPool(regionNamesAuth[0]);
virtualCache = getVirtualCache(userCreds, pool);
- RegionPtr regionPtr;
+ std::shared_ptr<Region> regionPtr;
regionPtr = virtualCache->getRegion(regionNamesAuth[0]);
// FunctionService::onServer(pool)->execute("securityTest",
@@ -790,35 +790,35 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
HANDLE_NOT_AUTHORIZED_EXCEPTION
try {
- RegionServicePtr virtualCache;
- PoolPtr pool = getPool(regionNamesAuth[0]);
- virtualCache = getVirtualCache(userCreds, pool);
- RegionPtr regionPtr;
- regionPtr = virtualCache->getRegion(regionNamesAuth[0]);
-
- //-----------------------Test with
- // sendException-------------------------------//
- LOG("Function execution with sendException with expected Authorization "
- "exception with onRegion");
- char buf[128];
- for (int i = 1; i <= 200; i++) {
- auto value = CacheableInt32::create(i);
-
- sprintf(buf, "execKey-%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
- regionPtr->put(key, value);
- }
- LOG("Put for execKey's on region complete.");
-
- LOG("Adding filter");
- CacheableArrayListPtr arrList = CacheableArrayList::create();
- for (int i = 100; i < 120; i++) {
- sprintf(buf, "execKey-%d", i);
- auto key = CacheableKey::create(buf);
- arrList->push_back(key);
+ std::shared_ptr<RegionService> virtualCache;
+ auto pool = getPool(regionNamesAuth[0]);
+ virtualCache = getVirtualCache(userCreds, pool);
+ std::shared_ptr<Region> regionPtr;
+ regionPtr = virtualCache->getRegion(regionNamesAuth[0]);
+
+ //-----------------------Test with
+ // sendException-------------------------------//
+ LOG("Function execution with sendException with expected Authorization "
+ "exception with onRegion");
+ char buf[128];
+ for (int i = 1; i <= 200; i++) {
+ auto value = CacheableInt32::create(i);
+
+ sprintf(buf, "execKey-%d", i);
+ auto key = CacheableKey::create(buf);
+ regionPtr->put(key, value);
+ }
+ LOG("Put for execKey's on region complete.");
+
+ LOG("Adding filter");
+ auto arrList = CacheableArrayList::create();
+ for (int i = 100; i < 120; i++) {
+ sprintf(buf, "execKey-%d", i);
+ auto key = CacheableKey::create(buf);
+ arrList->push_back(key);
}
- CacheableVectorPtr filter = CacheableVector::create();
+ auto filter = CacheableVector::create();
for (int i = 100; i < 120; i++) {
sprintf(buf, "execKey-%d", i);
auto key = CacheableKey::create(buf);
@@ -826,30 +826,29 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
}
LOG("Adding filter done.");
- CacheablePtr args = CacheableBoolean::create(1);
+ auto args = CacheableBoolean::create(1);
// UNUSED bool getResult = true;
LOG("OnServers with sendException");
- ExecutionPtr funcExec = FunctionService::onRegion(regionPtr);
+ auto funcExec = FunctionService::onRegion(regionPtr);
- ResultCollectorPtr collector =
- funcExec->withArgs(args)->withFilter(filter)->execute(
- exFuncNameSendException, std::chrono::seconds(15));
+ auto collector = funcExec->withArgs(args)->withFilter(filter)->execute(
+ exFuncNameSendException, std::chrono::seconds(15));
- //----------------------------------------------------------------------------------------------//
+ //----------------------------------------------------------------------------------------------//
- // FunctionService::onServer(pool)->execute("securityTest",
- // true)->getResult();
- // FAIL("Function execution should not have completed successfully");
- // FunctionService::onRegion(regionPtr)->execute("securityTest",
- // true)->getResult();
+ // FunctionService::onServer(pool)->execute("securityTest",
+ // true)->getResult();
+ // FAIL("Function execution should not have completed successfully");
+ // FunctionService::onRegion(regionPtr)->execute("securityTest",
+ // true)->getResult();
}
HANDLE_NOT_AUTHORIZED_EXCEPTION
- RegionServicePtr virtualCache;
- RegionPtr regionPtr;
- PoolPtr pool = getPool(regionNamesAuth[0]);
+ std::shared_ptr<RegionService> virtualCache;
+ std::shared_ptr<Region> regionPtr;
+ auto pool = getPool(regionNamesAuth[0]);
LOG(" 6");
if (pool != nullptr) {
LOG(" 7");
@@ -878,9 +877,9 @@ DUNIT_TASK_DEFINITION(READER_CLIENT, StepThree)
createRegionForSecurity(regionNamesAuth[0], USE_ACK, false, nullptr, false,
-1, true, 0);
- RegionServicePtr virtualCache;
- RegionPtr rptr;
- PoolPtr pool = getPool(regionNamesAuth[0]);
+ std::shared_ptr<RegionService> virtualCache;
+ std::shared_ptr<Region> rptr;
+ auto pool = getPool(regionNamesAuth[0]);
LOG(" 6");
if (pool != nullptr) {
LOG(" 7");
@@ -894,9 +893,9 @@ DUNIT_TASK_DEFINITION(READER_CLIENT, StepThree)
// rptr = getHelper()->getRegion(regionNamesAuth[0]);
sprintf(buf, "%s: %d", rptr->getName(), i);
- CacheableKeyPtr key = createKey(buf);
+ auto key = createKey(buf);
sprintf(buf, "testUpdate::%s: value of %d", rptr->getName(), i);
- CacheableStringPtr valuePtr = CacheableString::create(buf);
+ auto valuePtr = CacheableString::create(buf);
try {
LOG("Trying put Operation");
rptr->put(key, valuePtr);
@@ -936,22 +935,22 @@ DUNIT_TASK_DEFINITION(READER_CLIENT, StepThree)
// region");
try {
- // RegionPtr regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
- CacheableKeyPtr keyPtr = CacheableKey::create(keys[2]);
- auto checkPtr =
- std::dynamic_pointer_cast<CacheableString>(rptr->get(keyPtr));
- if (checkPtr != nullptr) {
- char buf[1024];
- sprintf(buf, "In net search, get returned %s for key %s",
- checkPtr->asChar(), keys[2]);
- LOG(buf);
- } else {
- LOG("checkPtr is nullptr");
- }
+ //auto regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
+ auto keyPtr = CacheableKey::create(keys[2]);
+ auto checkPtr =
+ std::dynamic_pointer_cast<CacheableString>(rptr->get(keyPtr));
+ if (checkPtr != nullptr) {
+ char buf[1024];
+ sprintf(buf, "In net search, get returned %s for key %s",
+ checkPtr->asChar(), keys[2]);
+ LOG(buf);
+ } else {
+ LOG("checkPtr is nullptr");
+ }
}
HANDLE_NO_NOT_AUTHORIZED_EXCEPTION
- // RegionPtr regPtr0 = getHelper()->getRegion( regionNamesAuth[0] );
+ //auto regPtr0 = getHelper()->getRegion( regionNamesAuth[0] );
if (rptr != nullptr) {
try {
LOG("Going to do registerAllKeys");
@@ -981,7 +980,7 @@ DUNIT_TASK_DEFINITION(READER_CLIENT, StepThree)
HANDLE_NO_NOT_AUTHORIZED_EXCEPTION
try {
- VectorOfCacheableKey entrykeys;
+ std::vector<std::shared_ptr<CacheableKey>> entrykeys;
for (int i = 0; i < 5; i++) {
entrykeys.push_back(CacheableKey::create(i));
}
@@ -1005,7 +1004,7 @@ DUNIT_TASK_DEFINITION(READER_CLIENT, StepThree)
// FunctionService::onServer(pool)->execute("securityTest",
// true)->getResult();
// FAIL("Function execution should not have completed successfully");
- // FunctionServicePtr funcServ = virtualCache->getFunctionService();
+ //auto funcServ = virtualCache->getFunctionService();
// funcServ->onServer()->execute("securityTest", true)->getResult();
FunctionService::onServer(virtualCache)
->execute("securityTest")
diff --git a/cppcache/integration-test/testThinClientSecurityCQAuthorizationMU.cpp b/cppcache/integration-test/testThinClientSecurityCQAuthorizationMU.cpp
index 56f8088..599b26d 100644
--- a/cppcache/integration-test/testThinClientSecurityCQAuthorizationMU.cpp
+++ b/cppcache/integration-test/testThinClientSecurityCQAuthorizationMU.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <geode/CqAttributesFactory.hpp>
#include <geode/CqAttributes.hpp>
#include <geode/CqListener.hpp>
@@ -54,7 +53,7 @@ using namespace apache::geode::client;
const char* locHostPort =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, 1);
-CredentialGeneratorPtr credentialGeneratorHandler;
+std::shared_ptr<CredentialGenerator> credentialGeneratorHandler;
#define CLIENT1 s1p1
#define SERVER1 s2p1
#define CLIENT2 s1p2
@@ -148,76 +147,76 @@ void initCredentialGenerator() {
FAIL("credentialGeneratorHandler is nullptr");
}
}
-
-PropertiesPtr userCreds;
-void initClientCq(const bool isthinClient) {
- userCreds = Properties::create();
- PropertiesPtr config = Properties::create();
- // credentialGeneratorHandler->getAuthInit(config);
- credentialGeneratorHandler->getValidCredentials(userCreds);
-
- if (cacheHelper == nullptr) {
- cacheHelper = new CacheHelper(isthinClient, config);
- }
- ASSERT(cacheHelper, "Failed to create a CacheHelper client instance.");
- try {
- SerializationRegistryPtr serializationRegistry =
- CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
- ->getSerializationRegistry();
- serializationRegistry->addType(Position::createDeserializable);
- serializationRegistry->addType(Portfolio::createDeserializable);
- } catch (const IllegalStateException&) {
- // ignore exception
- }
-}
-
-DUNIT_TASK_DEFINITION(CLIENT1, CreateServer1)
- {
- initCredentialGenerator();
- std::string cmdServerAuthenticator;
-
- if (isLocalServer) {
- cmdServerAuthenticator = credentialGeneratorHandler->getServerCmdParams(
- "authenticator:authorizer:authorizerPP", getXmlPath());
- printf("string %s", cmdServerAuthenticator.c_str());
- CacheHelper::initServer(
- 1, "remotequery.xml", nullptr,
- const_cast<char*>(cmdServerAuthenticator.c_str()));
- LOG("Server1 started");
- }
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(CLIENT1, CreateServer2)
- {
- std::string cmdServerAuthenticator;
-
- if (isLocalServer) {
- cmdServerAuthenticator = credentialGeneratorHandler->getServerCmdParams(
- "authenticator:authorizer:authorizerPP", getXmlPath());
- printf("string %s", cmdServerAuthenticator.c_str());
- CacheHelper::initServer(
- 2, "remotequery2.xml", nullptr,
- const_cast<char*>(cmdServerAuthenticator.c_str()));
- LOG("Server2 started");
- }
- SLEEP(20000);
- }
-END_TASK_DEFINITION
-
-void stepOne(bool pool = false, bool locator = false) {
- LOG("StepOne1 complete. 1");
- initClientCq(true);
- LOG("StepOne1 complete. 2");
- createRegionForCQMU(regionNamesCq[0], USE_ACK, true, 0, nullptr, false, true);
- LOG("StepOne1 complete. 3");
- RegionPtr regptr = getHelper()->getRegion(regionNamesCq[0]);
- LOG("StepOne1 complete. 4");
- RegionAttributesPtr lattribPtr = regptr->getAttributes();
- LOG("StepOne1 complete. 5");
- RegionPtr subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
-
- LOG("StepOne complete.");
+ std::shared_ptr<Properties> userCreds;
+ void initClientCq(const bool isthinClient) {
+ userCreds = Properties::create();
+ auto config = Properties::create();
+ // credentialGeneratorHandler->getAuthInit(config);
+ credentialGeneratorHandler->getValidCredentials(userCreds);
+
+ if (cacheHelper == nullptr) {
+ cacheHelper = new CacheHelper(isthinClient, config);
+ }
+ ASSERT(cacheHelper, "Failed to create a CacheHelper client instance.");
+ try {
+ auto serializationRegistry =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get())
+ ->getSerializationRegistry();
+ serializationRegistry->addType(Position::createDeserializable);
+ serializationRegistry->addType(Portfolio::createDeserializable);
+ } catch (const IllegalStateException&) {
+ // ignore exception
+ }
+ }
+
+ DUNIT_TASK_DEFINITION(CLIENT1, CreateServer1)
+ {
+ initCredentialGenerator();
+ std::string cmdServerAuthenticator;
+
+ if (isLocalServer) {
+ cmdServerAuthenticator = credentialGeneratorHandler->getServerCmdParams(
+ "authenticator:authorizer:authorizerPP", getXmlPath());
+ printf("string %s", cmdServerAuthenticator.c_str());
+ CacheHelper::initServer(
+ 1, "remotequery.xml", nullptr,
+ const_cast<char*>(cmdServerAuthenticator.c_str()));
+ LOG("Server1 started");
+ }
+ }
+ END_TASK_DEFINITION
+
+ DUNIT_TASK_DEFINITION(CLIENT1, CreateServer2)
+ {
+ std::string cmdServerAuthenticator;
+
+ if (isLocalServer) {
+ cmdServerAuthenticator = credentialGeneratorHandler->getServerCmdParams(
+ "authenticator:authorizer:authorizerPP", getXmlPath());
+ printf("string %s", cmdServerAuthenticator.c_str());
+ CacheHelper::initServer(
+ 2, "remotequery2.xml", nullptr,
+ const_cast<char*>(cmdServerAuthenticator.c_str()));
+ LOG("Server2 started");
+ }
+ SLEEP(20000);
+ }
+ END_TASK_DEFINITION
+
+ void stepOne(bool pool = false, bool locator = false) {
+ LOG("StepOne1 complete. 1");
+ initClientCq(true);
+ LOG("StepOne1 complete. 2");
+ createRegionForCQMU(regionNamesCq[0], USE_ACK, true, 0, nullptr, false,
+ true);
+ LOG("StepOne1 complete. 3");
+ auto regptr = getHelper()->getRegion(regionNamesCq[0]);
+ LOG("StepOne1 complete. 4");
+ std::shared_ptr<RegionAttributes> lattribPtr = regptr->getAttributes();
+ LOG("StepOne1 complete. 5");
+ auto subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
+
+ LOG("StepOne complete.");
}
void stepOne2(bool pool = false, bool locator = false) {
@@ -226,11 +225,11 @@ void stepOne2(bool pool = false, bool locator = false) {
LOG("StepOne2 complete. 2");
createRegionForCQMU(regionNamesCq[0], USE_ACK, true, 0, nullptr, false, true);
LOG("StepOne2 complete. 3");
- RegionPtr regptr = getHelper()->getRegion(regionNamesCq[0]);
+ auto regptr = getHelper()->getRegion(regionNamesCq[0]);
LOG("StepOne2 complete. 4");
- RegionAttributesPtr lattribPtr = regptr->getAttributes();
+ std::shared_ptr<RegionAttributes> lattribPtr = regptr->getAttributes();
LOG("StepOne2 complete. 5");
- RegionPtr subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
+ auto subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
LOG("StepOne2 complete.");
}
@@ -245,21 +244,20 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepOne2_PoolEP)
stepOne2(true, false);
}
END_TASK_DEFINITION
-
-PoolPtr getPool(const char* name) {
+ std::shared_ptr<Pool> getPool(const char* name) {
return getHelper()->getCache()->getPoolManager().find(name);
+ }
+ std::shared_ptr<RegionService> getVirtualCache(
+ std::shared_ptr<Properties> creds, const char* name) {
+ return getHelper()->getCache()->createAuthenticatedView(creds, name);
}
-RegionServicePtr getVirtualCache(PropertiesPtr creds, const char* name) {
- return getHelper()->getCache()->createAuthenticatedView(creds, name);
-}
-
-static RegionServicePtr userCache;
-static QueryServicePtr userQueryService;
+static std::shared_ptr<RegionService> userCache;
+static std::shared_ptr<QueryService> userQueryService;
DUNIT_TASK_DEFINITION(CLIENT1, StepTwo)
{
- PropertiesPtr creds = Properties::create();
+ auto creds = Properties::create();
char tmp[25] = {'\0'};
sprintf(tmp, "user%d", 4);
@@ -267,10 +265,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepTwo)
creds->insert("security-password", tmp);
userCache = getVirtualCache(creds, regionNamesCq[0]);
- RegionPtr regPtr0 = userCache->getRegion(regionNamesCq[0]);
- RegionPtr subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
+ auto regPtr0 = userCache->getRegion(regionNamesCq[0]);
+ auto subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
- LOG("StepTwo complete.");
+ LOG("StepTwo complete.");
}
END_TASK_DEFINITION
@@ -281,7 +279,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
// userCache = getVirtualCache(userCreds, regionNamesCq[0]);
userQueryService = userCache->getQueryService();
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
qs = userQueryService;
@@ -290,10 +288,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
auto cqLstner = std::make_shared<MyCqListener>(i);
CqAttributesFactory cqFac;
cqFac.addCqListener(cqLstner);
- CqAttributesPtr cqAttr = cqFac.create();
+ auto cqAttr = cqFac.create();
- CqQueryPtr qry = qs->newCq(cqNames[i], queryStrings[i], cqAttr);
- qry->execute();
+ auto qry = qs->newCq(cqNames[i], queryStrings[i], cqAttr);
+ qry->execute();
}
LOG("EXECUTE 1 START");
@@ -316,7 +314,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, StepTwo2)
{
- PropertiesPtr creds = Properties::create();
+ auto creds = Properties::create();
char tmp[25] = {'\0'};
sprintf(tmp, "user%d", 3);
@@ -324,32 +322,32 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepTwo2)
creds->insert("security-password", tmp);
userCache = getVirtualCache(creds, regionNamesCq[0]);
- RegionPtr regPtr0 = userCache->getRegion(regionNamesCq[0]);
- RegionPtr subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
+ auto regPtr0 = userCache->getRegion(regionNamesCq[0]);
+ auto subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
- QueryHelper* qh = &QueryHelper::getHelper();
+ QueryHelper* qh = &QueryHelper::getHelper();
- qh->populatePortfolioData(regPtr0, 3, 2, 1);
- qh->populatePositionData(subregPtr0, 3, 2);
- for (int i = 1; i <= 4; i++) {
- auto port = std::make_shared<Portfolio>(i, 2);
+ qh->populatePortfolioData(regPtr0, 3, 2, 1);
+ qh->populatePositionData(subregPtr0, 3, 2);
+ for (int i = 1; i <= 4; i++) {
+ auto port = std::make_shared<Portfolio>(i, 2);
- char tmp[25] = {'\0'};
- sprintf(tmp, "port1-%d", i);
- CacheableKeyPtr keyport = CacheableKey::create(tmp);
+ char tmp[25] = {'\0'};
+ sprintf(tmp, "port1-%d", i);
+ auto keyport = CacheableKey::create(tmp);
regPtr0->put(keyport, port);
SLEEP(10); // sleep a while to allow server query to complete
- }
+ }
- LOG("StepTwo2 complete. Sleeping .25 min for server query to complete...");
- SLEEP(15000); // sleep .25 min to allow server query to complete
+ LOG("StepTwo2 complete. Sleeping .25 min for server query to complete...");
+ SLEEP(15000); // sleep .25 min to allow server query to complete
}
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
{
- // CachePtr userCache = getVirtualCache(userCreds, regionNamesCq[0]);
- QueryServicePtr qs;
+ //auto userCache = getVirtualCache(userCreds, regionNamesCq[0]);
+ std::shared_ptr<QueryService> qs;
qs = userQueryService;
@@ -372,8 +370,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
for (i = 0; i < MAX_LISTNER; i++) {
sprintf(buf, "get info for cq[%s]:", cqNames[i]);
LOG(buf);
- CqQueryPtr cqy = qs->getCq(cqNames[i]);
- // CqStatisticsPtr cqStats = cqy->getStatistics();
+ auto cqy = qs->getCq(cqNames[i]);
+ //auto cqStats = cqy->getStatistics();
}
// if key port1-4 then only query 3 and 4 will satisfied
@@ -401,10 +399,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
{
sprintf(buf, "get info for cq[%s]:", cqNames[i]);
LOG(buf);
- CqQueryPtr cqy = qs->getCq(cqNames[i]);
+ auto cqy = qs->getCq(cqNames[i]);
cqy->stop();
cqy->close();
- // CqStatisticsPtr cqStats = cqy->getStatistics();
+ //auto cqStats = cqy->getStatistics();
}*/
// userCache->close();
@@ -434,8 +432,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour2)
for (i = 0; i < MAX_LISTNER; i++) {
sprintf(buf, "get info for cq[%s]:", cqNames[i]);
LOG(buf);
- CqQueryPtr cqy = qs->getCq(cqNames[i]);
- // CqStatisticsPtr cqStats = cqy->getStatistics();
+ auto cqy = qs->getCq(cqNames[i]);
+ //auto cqStats = cqy->getStatistics();
}
// if key port1-4 then only query 3 and 4 will satisfied
@@ -463,10 +461,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour2)
{
sprintf(buf, "get info for cq[%s]:", cqNames[i]);
LOG(buf);
- CqQueryPtr cqy = qs->getCq(cqNames[i]);
+ auto cqy = qs->getCq(cqNames[i]);
cqy->stop();
cqy->close();
- // CqStatisticsPtr cqStats = cqy->getStatistics();
+ //auto cqStats = cqy->getStatistics();
}*/
userCache->close();
diff --git a/cppcache/integration-test/testThinClientSecurityDH.cpp b/cppcache/integration-test/testThinClientSecurityDH.cpp
index fb2b142..e46cc81 100644
--- a/cppcache/integration-test/testThinClientSecurityDH.cpp
+++ b/cppcache/integration-test/testThinClientSecurityDH.cpp
@@ -16,7 +16,6 @@
*/
#include "fw_dunit.hpp"
#include "ThinClientHelper.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
@@ -59,7 +58,7 @@ using namespace test;
const char* locHostPort =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, 1);
const char* regionNamesAuth[] = {"DistRegionAck", "DistRegionNoAck"};
-CredentialGeneratorPtr credentialGeneratorHandler;
+std::shared_ptr<CredentialGenerator> credentialGeneratorHandler;
std::string getXmlPath() {
char xmlPath[1000] = {'\0'};
@@ -105,7 +104,7 @@ void initClientAuth(char credentialsType, const char* dhAlgo) {
printf("Initializing Client with %s credential and %s DH Algo\n",
credentialsType == CORRECT_CREDENTIALS ? "Valid" : "Invalid", dhAlgo);
- PropertiesPtr config = Properties::create();
+ auto config = Properties::create();
config->insert("security-client-dhalgo", dhAlgo);
std::string testsrc = ACE_OS::getenv("TESTSRC");
@@ -191,18 +190,18 @@ void InitCorrectClients(const char* dhAlgo) {
void DoNetSearch() {
try {
createRegionForSecurity(regionNamesAuth[1], USE_ACK, true);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
- CacheableKeyPtr keyPtr = CacheableKey::create(keys[0]);
- auto checkPtr =
- std::dynamic_pointer_cast<CacheableString>(regPtr0->get(keyPtr));
- if (checkPtr != nullptr && !strcmp(nvals[0], checkPtr->asChar())) {
- LOG("checkPtr is not null");
- char buf[1024];
- sprintf(buf, "In net search, get returned %s for key %s",
- checkPtr->asChar(), keys[0]);
- LOG(buf);
- } else {
- LOG("checkPtr is nullptr");
+ auto regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
+ auto keyPtr = CacheableKey::create(keys[0]);
+ auto checkPtr =
+ std::dynamic_pointer_cast<CacheableString>(regPtr0->get(keyPtr));
+ if (checkPtr != nullptr && !strcmp(nvals[0], checkPtr->asChar())) {
+ LOG("checkPtr is not null");
+ char buf[1024];
+ sprintf(buf, "In net search, get returned %s for key %s",
+ checkPtr->asChar(), keys[0]);
+ LOG(buf);
+ } else {
+ LOG("checkPtr is nullptr");
}
} catch (const apache::geode::client::Exception& other) {
other.printStackTrace();
diff --git a/cppcache/integration-test/testThinClientSecurityDH_MU.cpp b/cppcache/integration-test/testThinClientSecurityDH_MU.cpp
index c98f510..8dc1555 100644
--- a/cppcache/integration-test/testThinClientSecurityDH_MU.cpp
+++ b/cppcache/integration-test/testThinClientSecurityDH_MU.cpp
@@ -19,7 +19,6 @@
#include "fw_dunit.hpp"
#include "ThinClientHelper.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <ace/OS.h>
#include <ace/High_Res_Timer.h>
@@ -62,7 +61,7 @@ using namespace test;
const char* locHostPort =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, 1);
const char* regionNamesAuth[] = {"DistRegionAck", "DistRegionNoAck"};
-CredentialGeneratorPtr credentialGeneratorHandler;
+std::shared_ptr<CredentialGenerator> credentialGeneratorHandler;
std::string getXmlPath() {
char xmlPath[1000] = {'\0'};
@@ -104,44 +103,44 @@ void initCredentialGenerator() {
if (loopNum > 2) loopNum = 1;
}
-static PropertiesPtr userCreds;
+static std::shared_ptr<Properties> userCreds;
void initClientAuth(char credentialsType, const char* dhAlgo) {
printf("Initializing Client with %s credential and %s DH Algo\n",
credentialsType == CORRECT_CREDENTIALS ? "Valid" : "Invalid", dhAlgo);
- PropertiesPtr config = Properties::create();
- userCreds = Properties::create();
-
- config->insert("security-client-dhalgo", dhAlgo);
- std::string testsrc = ACE_OS::getenv("TESTSRC");
- testsrc += "/keystore/geode.pem";
- printf("KeyStore Path is: %s", testsrc.c_str());
- config->insert("security-client-kspath", testsrc.c_str());
-
- if (credentialGeneratorHandler == nullptr) {
- FAIL("credentialGeneratorHandler is nullptr");
- }
- bool insertAuthInit = true;
- switch (credentialsType) {
- case CORRECT_CREDENTIALS:
- credentialGeneratorHandler->getValidCredentials(userCreds);
- userCreds->insert("security-password",
- userCreds->find("security-username")->asChar());
- printf("Username is %s and Password is %s ",
- userCreds->find("security-username")->asChar(),
- userCreds->find("security-password")->asChar());
- break;
- case INCORRECT_CREDENTIALS:
- credentialGeneratorHandler->getInvalidCredentials(userCreds);
- userCreds->insert("security-password", "junk");
- printf("Username is %s and Password is %s ",
- userCreds->find("security-username")->asChar(),
- userCreds->find("security-password")->asChar());
- break;
- default:
- insertAuthInit = false;
- break;
+ auto config = Properties::create();
+ userCreds = Properties::create();
+
+ config->insert("security-client-dhalgo", dhAlgo);
+ std::string testsrc = ACE_OS::getenv("TESTSRC");
+ testsrc += "/keystore/geode.pem";
+ printf("KeyStore Path is: %s", testsrc.c_str());
+ config->insert("security-client-kspath", testsrc.c_str());
+
+ if (credentialGeneratorHandler == nullptr) {
+ FAIL("credentialGeneratorHandler is nullptr");
+ }
+ bool insertAuthInit = true;
+ switch (credentialsType) {
+ case CORRECT_CREDENTIALS:
+ credentialGeneratorHandler->getValidCredentials(userCreds);
+ userCreds->insert("security-password",
+ userCreds->find("security-username")->asChar());
+ printf("Username is %s and Password is %s ",
+ userCreds->find("security-username")->asChar(),
+ userCreds->find("security-password")->asChar());
+ break;
+ case INCORRECT_CREDENTIALS:
+ credentialGeneratorHandler->getInvalidCredentials(userCreds);
+ userCreds->insert("security-password", "junk");
+ printf("Username is %s and Password is %s ",
+ userCreds->find("security-username")->asChar(),
+ userCreds->find("security-password")->asChar());
+ break;
+ default:
+ insertAuthInit = false;
+ break;
}
if (insertAuthInit) {
// credentialGeneratorHandler->getAuthInit(config);
@@ -165,16 +164,16 @@ void InitIncorrectClients(const char* dhAlgo) {
try {
createRegionForSecurity(regionNamesAuth[0], USE_ACK, false, nullptr, false,
-1, true, 0);
- PoolPtr pool = getPool(regionNamesAuth[0]);
- LOG(" 6");
- if (pool != nullptr) {
- LOG(" 7");
- RegionServicePtr virtualCache = getVirtualCache(userCreds, pool);
- LOG(" 8");
- virtualCache->getRegion(regionNamesAuth[0])->put(keys[0], vals[0]);
- LOG("Operation allowed, something is wrong.");
- }
- FAIL("Should have thrown AuthenticationFailedException.");
+ auto pool = getPool(regionNamesAuth[0]);
+ LOG(" 6");
+ if (pool != nullptr) {
+ LOG(" 7");
+ auto virtualCache = getVirtualCache(userCreds, pool);
+ LOG(" 8");
+ virtualCache->getRegion(regionNamesAuth[0])->put(keys[0], vals[0]);
+ LOG("Operation allowed, something is wrong.");
+ }
+ FAIL("Should have thrown AuthenticationFailedException.");
} catch (const apache::geode::client::AuthenticationFailedException& other) {
other.printStackTrace();
LOG(other.getMessage());
@@ -196,15 +195,15 @@ void InitCorrectClients(const char* dhAlgo) {
try {
createRegionForSecurity(regionNamesAuth[0], USE_ACK, false, nullptr, false,
-1, true, 0);
- PoolPtr pool = getPool(regionNamesAuth[0]);
- LOG(" 6");
+ auto pool = getPool(regionNamesAuth[0]);
+ LOG(" 6");
- LOG(" 7");
- RegionServicePtr virtualCache = getVirtualCache(userCreds, pool);
- LOG(" 8");
- RegionPtr regionPtr = virtualCache->getRegion(regionNamesAuth[0]);
+ LOG(" 7");
+ auto virtualCache = getVirtualCache(userCreds, pool);
+ LOG(" 8");
+ auto regionPtr = virtualCache->getRegion(regionNamesAuth[0]);
- for (int i = 0; i < 100; i++) regionPtr->put(keys[0], vals[0]);
+ for (int i = 0; i < 100; i++) regionPtr->put(keys[0], vals[0]);
} catch (const apache::geode::client::Exception& other) {
other.printStackTrace();
FAIL(other.getMessage());
@@ -216,25 +215,25 @@ void DoNetSearch() {
try {
createRegionForSecurity(regionNamesAuth[1], USE_ACK, false, nullptr, false,
-1, true, 0);
- PoolPtr pool = getPool(regionNamesAuth[1]);
- LOG(" 6");
-
- LOG(" 7");
- RegionServicePtr virtualCache = getVirtualCache(userCreds, pool);
- LOG(" 8");
- RegionPtr regionPtr = virtualCache->getRegion(regionNamesAuth[1]);
-
- CacheableKeyPtr keyPtr = CacheableKey::create(keys[0]);
- auto checkPtr =
- std::dynamic_pointer_cast<CacheableString>(regionPtr->get(keyPtr));
- if (checkPtr != nullptr && !strcmp(vals[0], checkPtr->asChar())) {
- LOG("checkPtr is not null");
- char buf[1024];
- sprintf(buf, "In net search, get returned %s for key %s",
- checkPtr->asChar(), keys[0]);
- LOG(buf);
- } else {
- LOG("checkPtr is nullptr");
+ auto pool = getPool(regionNamesAuth[1]);
+ LOG(" 6");
+
+ LOG(" 7");
+ auto virtualCache = getVirtualCache(userCreds, pool);
+ LOG(" 8");
+ auto regionPtr = virtualCache->getRegion(regionNamesAuth[1]);
+
+ auto keyPtr = CacheableKey::create(keys[0]);
+ auto checkPtr =
+ std::dynamic_pointer_cast<CacheableString>(regionPtr->get(keyPtr));
+ if (checkPtr != nullptr && !strcmp(vals[0], checkPtr->asChar())) {
+ LOG("checkPtr is not null");
+ char buf[1024];
+ sprintf(buf, "In net search, get returned %s for key %s",
+ checkPtr->asChar(), keys[0]);
+ LOG(buf);
+ } else {
+ LOG("checkPtr is nullptr");
}
} catch (const apache::geode::client::Exception& other) {
other.printStackTrace();
diff --git a/cppcache/integration-test/testThinClientSecurityDurableCQAuthorizationMU.cpp b/cppcache/integration-test/testThinClientSecurityDurableCQAuthorizationMU.cpp
index 0e3fe5a..3bc5104 100644
--- a/cppcache/integration-test/testThinClientSecurityDurableCQAuthorizationMU.cpp
+++ b/cppcache/integration-test/testThinClientSecurityDurableCQAuthorizationMU.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <geode/CqAttributesFactory.hpp>
#include <geode/CqAttributes.hpp>
#include <geode/CqListener.hpp>
@@ -54,7 +53,7 @@ using namespace apache::geode::client;
const char* locHostPort =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, 1);
-CredentialGeneratorPtr credentialGeneratorHandler;
+std::shared_ptr<CredentialGenerator> credentialGeneratorHandler;
#define CLIENT1 s1p1
#define SERVER1 s2p1
#define CLIENT2 s1p2
@@ -148,86 +147,86 @@ void initCredentialGenerator() {
FAIL("credentialGeneratorHandler is nullptr");
}
}
-
-PropertiesPtr userCreds;
-const char* durableIds[] = {"DurableId1", "DurableId2"};
-void initClientCq(const bool isthinClient, int clientIdx) {
- userCreds = Properties::create();
- PropertiesPtr config = Properties::create();
- // credentialGeneratorHandler->getAuthInit(config);
- credentialGeneratorHandler->getValidCredentials(userCreds);
-
- config->insert("durable-client-id", durableIds[clientIdx]);
- config->insert("durable-timeout", std::chrono::seconds(60));
- config->insert("notify-ack-interval", std::chrono::seconds(1));
-
- if (cacheHelper == nullptr) {
- cacheHelper = new CacheHelper(isthinClient, config);
- }
- ASSERT(cacheHelper, "Failed to create a CacheHelper client instance.");
- try {
- CacheImpl* cacheImpl =
- CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get());
- cacheImpl->getSerializationRegistry()->addType(
- Position::createDeserializable);
- cacheImpl->getSerializationRegistry()->addType(
- Portfolio::createDeserializable);
- } catch (const IllegalStateException&) {
- // ignore exception
- }
-}
-
-bool closeLogicalCache = false;
-bool logicalCacheKeepAlive = false;
-bool durableCq = false;
-
-DUNIT_TASK_DEFINITION(CLIENT1, CreateServer1)
- {
- initCredentialGenerator();
- std::string cmdServerAuthenticator;
-
- if (isLocalServer) {
- cmdServerAuthenticator = credentialGeneratorHandler->getServerCmdParams(
- "authenticator:authorizerPP", getXmlPath());
- printf("string %s", cmdServerAuthenticator.c_str());
- CacheHelper::initServer(
- 1, "remotequery.xml", nullptr,
- const_cast<char*>(cmdServerAuthenticator.c_str()));
- LOG("Server1 started");
- }
- }
-END_TASK_DEFINITION
-
-DUNIT_TASK_DEFINITION(CLIENT1, CreateServer2)
- {
- std::string cmdServerAuthenticator;
-
- if (isLocalServer) {
- cmdServerAuthenticator = credentialGeneratorHandler->getServerCmdParams(
- "authenticator:authorizerPP", getXmlPath());
- printf("string %s", cmdServerAuthenticator.c_str());
- CacheHelper::initServer(
- 2, "remotequery2.xml", nullptr,
- const_cast<char*>(cmdServerAuthenticator.c_str()));
- LOG("Server2 started");
- }
- SLEEP(20000);
- }
-END_TASK_DEFINITION
-
-void stepOne(bool pool = false, bool locator = false) {
- LOG("StepOne1 complete. 1");
- initClientCq(true, 0);
- LOG("StepOne1 complete. 2");
- createRegionForCQMU(regionNamesCq[0], USE_ACK, true, 0, nullptr, false, true);
- LOG("StepOne1 complete. 3");
- RegionPtr regptr = getHelper()->getRegion(regionNamesCq[0]);
- LOG("StepOne1 complete. 4");
- RegionAttributesPtr lattribPtr = regptr->getAttributes();
- LOG("StepOne1 complete. 5");
- RegionPtr subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
-
- LOG("StepOne complete.");
+ std::shared_ptr<Properties> userCreds;
+ const char* durableIds[] = {"DurableId1", "DurableId2"};
+ void initClientCq(const bool isthinClient, int clientIdx) {
+ userCreds = Properties::create();
+ auto config = Properties::create();
+ // credentialGeneratorHandler->getAuthInit(config);
+ credentialGeneratorHandler->getValidCredentials(userCreds);
+
+ config->insert("durable-client-id", durableIds[clientIdx]);
+ config->insert("durable-timeout", std::chrono::seconds(60));
+ config->insert("notify-ack-interval", std::chrono::seconds(1));
+
+ if (cacheHelper == nullptr) {
+ cacheHelper = new CacheHelper(isthinClient, config);
+ }
+ ASSERT(cacheHelper, "Failed to create a CacheHelper client instance.");
+ try {
+ CacheImpl* cacheImpl =
+ CacheRegionHelper::getCacheImpl(cacheHelper->getCache().get());
+ cacheImpl->getSerializationRegistry()->addType(
+ Position::createDeserializable);
+ cacheImpl->getSerializationRegistry()->addType(
+ Portfolio::createDeserializable);
+ } catch (const IllegalStateException&) {
+ // ignore exception
+ }
+ }
+
+ bool closeLogicalCache = false;
+ bool logicalCacheKeepAlive = false;
+ bool durableCq = false;
+
+ DUNIT_TASK_DEFINITION(CLIENT1, CreateServer1)
+ {
+ initCredentialGenerator();
+ std::string cmdServerAuthenticator;
+
+ if (isLocalServer) {
+ cmdServerAuthenticator = credentialGeneratorHandler->getServerCmdParams(
+ "authenticator:authorizerPP", getXmlPath());
+ printf("string %s", cmdServerAuthenticator.c_str());
+ CacheHelper::initServer(
+ 1, "remotequery.xml", nullptr,
+ const_cast<char*>(cmdServerAuthenticator.c_str()));
+ LOG("Server1 started");
+ }
+ }
+ END_TASK_DEFINITION
+
+ DUNIT_TASK_DEFINITION(CLIENT1, CreateServer2)
+ {
+ std::string cmdServerAuthenticator;
+
+ if (isLocalServer) {
+ cmdServerAuthenticator = credentialGeneratorHandler->getServerCmdParams(
+ "authenticator:authorizerPP", getXmlPath());
+ printf("string %s", cmdServerAuthenticator.c_str());
+ CacheHelper::initServer(
+ 2, "remotequery2.xml", nullptr,
+ const_cast<char*>(cmdServerAuthenticator.c_str()));
+ LOG("Server2 started");
+ }
+ SLEEP(20000);
+ }
+ END_TASK_DEFINITION
+
+ void stepOne(bool pool = false, bool locator = false) {
+ LOG("StepOne1 complete. 1");
+ initClientCq(true, 0);
+ LOG("StepOne1 complete. 2");
+ createRegionForCQMU(regionNamesCq[0], USE_ACK, true, 0, nullptr, false,
+ true);
+ LOG("StepOne1 complete. 3");
+ auto regptr = getHelper()->getRegion(regionNamesCq[0]);
+ LOG("StepOne1 complete. 4");
+ std::shared_ptr<RegionAttributes> lattribPtr = regptr->getAttributes();
+ LOG("StepOne1 complete. 5");
+ auto subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
+
+ LOG("StepOne complete.");
}
void readyForEvents() {
@@ -245,11 +244,11 @@ void stepOne2(bool pool = false, bool locator = false) {
LOG("StepOne2 complete. 2");
createRegionForCQMU(regionNamesCq[0], USE_ACK, true, 0, nullptr, false, true);
LOG("StepOne2 complete. 3");
- RegionPtr regptr = getHelper()->getRegion(regionNamesCq[0]);
+ auto regptr = getHelper()->getRegion(regionNamesCq[0]);
LOG("StepOne2 complete. 4");
- RegionAttributesPtr lattribPtr = regptr->getAttributes();
+ std::shared_ptr<RegionAttributes> lattribPtr = regptr->getAttributes();
LOG("StepOne2 complete. 5");
- RegionPtr subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
+ auto subregPtr = regptr->createSubregion(regionNamesCq[1], lattribPtr);
LOG("StepOne2 complete.");
}
@@ -264,21 +263,20 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepOne2_PoolEP)
stepOne2(true, false);
}
END_TASK_DEFINITION
-
-PoolPtr getPool(const char* name) {
+ std::shared_ptr<Pool> getPool(const char* name) {
return getHelper()->getCache()->getPoolManager().find(name);
+ }
+ std::shared_ptr<RegionService> getVirtualCache(
+ std::shared_ptr<Properties> creds, const char* name) {
+ return getHelper()->getCache()->createAuthenticatedView(creds, name);
}
-RegionServicePtr getVirtualCache(PropertiesPtr creds, const char* name) {
- return getHelper()->getCache()->createAuthenticatedView(creds, name);
-}
-
-static RegionServicePtr userCache;
-static QueryServicePtr userQueryService;
+static std::shared_ptr<RegionService> userCache;
+static std::shared_ptr<QueryService> userQueryService;
DUNIT_TASK_DEFINITION(CLIENT1, StepTwo)
{
- PropertiesPtr creds = Properties::create();
+ auto creds = Properties::create();
char tmp[25] = {'\0'};
sprintf(tmp, "user%d", 4);
@@ -286,15 +284,15 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepTwo)
creds->insert("security-password", tmp);
userCache = getVirtualCache(creds, regionNamesCq[0]);
- RegionPtr regPtr0 = userCache->getRegion(regionNamesCq[0]);
- RegionPtr subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
+ auto regPtr0 = userCache->getRegion(regionNamesCq[0]);
+ auto subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
- // QueryHelper * qh = &QueryHelper::getHelper();
+ // QueryHelper * qh = &QueryHelper::getHelper();
- // qh->populatePortfolioData(regPtr0 , 2, 1, 1);
- // qh->populatePositionData(subregPtr0, 2, 1);
+ // qh->populatePortfolioData(regPtr0 , 2, 1, 1);
+ // qh->populatePositionData(subregPtr0, 2, 1);
- LOG("StepTwo complete.");
+ LOG("StepTwo complete.");
}
END_TASK_DEFINITION
@@ -309,7 +307,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
// userCache = getVirtualCache(userCreds, regionNamesCq[0]);
userQueryService = userCache->getQueryService();
- QueryServicePtr qs;
+ std::shared_ptr<QueryService> qs;
qs = userQueryService;
@@ -318,10 +316,9 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepThree)
auto cqLstner = std::make_shared<MyCqListener>(i);
CqAttributesFactory cqFac;
cqFac.addCqListener(cqLstner);
- CqAttributesPtr cqAttr = cqFac.create();
+ auto cqAttr = cqFac.create();
printf("adding new cq = %s , %d", cqNames[i], durableCq);
- CqQueryPtr qry =
- qs->newCq(cqNames[i], queryStrings[i], cqAttr, durableCq);
+ auto qry = qs->newCq(cqNames[i], queryStrings[i], cqAttr, durableCq);
qry->execute();
}
@@ -353,7 +350,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, StepTwo2)
{
- PropertiesPtr creds = Properties::create();
+ auto creds = Properties::create();
char tmp[25] = {'\0'};
sprintf(tmp, "user%d", 3);
@@ -361,31 +358,31 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepTwo2)
creds->insert("security-password", tmp);
userCache = getVirtualCache(creds, regionNamesCq[0]);
- RegionPtr regPtr0 = userCache->getRegion(regionNamesCq[0]);
- RegionPtr subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
+ auto regPtr0 = userCache->getRegion(regionNamesCq[0]);
+ auto subregPtr0 = regPtr0->getSubregion(regionNamesCq[1]);
- QueryHelper* qh = &QueryHelper::getHelper();
+ QueryHelper* qh = &QueryHelper::getHelper();
- qh->populatePortfolioData(regPtr0, 3, 2, 1);
- qh->populatePositionData(subregPtr0, 3, 2);
- for (int i = 1; i <= 4; i++) {
- auto port = std::make_shared<Portfolio>(i, 2);
+ qh->populatePortfolioData(regPtr0, 3, 2, 1);
+ qh->populatePositionData(subregPtr0, 3, 2);
+ for (int i = 1; i <= 4; i++) {
+ auto port = std::make_shared<Portfolio>(i, 2);
- char tmp[25] = {'\0'};
- sprintf(tmp, "port1-%d", i);
- CacheableKeyPtr keyport = CacheableKey::create(tmp);
+ char tmp[25] = {'\0'};
+ sprintf(tmp, "port1-%d", i);
+ auto keyport = CacheableKey::create(tmp);
regPtr0->put(keyport, port);
SLEEP(10); // sleep a while to allow server query to complete
- }
+ }
- LOG("StepTwo2 complete. Sleeping .25 min for server query to complete...");
- SLEEP(15000); // sleep .25 min to allow server query to complete
+ LOG("StepTwo2 complete. Sleeping .25 min for server query to complete...");
+ SLEEP(15000); // sleep .25 min to allow server query to complete
}
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
{
- // CachePtr userCache = getVirtualCache(userCreds, regionNamesCq[0]);
+ //auto userCache = getVirtualCache(userCreds, regionNamesCq[0]);
auto qs = userQueryService;
char buf[1024];
@@ -406,8 +403,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
for (i = 0; i < MAX_LISTNER; i++) {
sprintf(buf, "get info for cq[%s]:", cqNames[i]);
LOG(buf);
- CqQueryPtr cqy = qs->getCq(cqNames[i]);
- // CqStatisticsPtr cqStats = cqy->getStatistics();
+ auto cqy = qs->getCq(cqNames[i]);
+ //auto cqStats = cqy->getStatistics();
}
// if key port1-4 then only query 3 and 4 will satisfied
@@ -439,7 +436,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, StepFour2)
{
SLEEP(15000); // sleep .25 min
- // CachePtr userCache = getVirtualCache(userCreds, regionNamesCq[0]);
+ //auto userCache = getVirtualCache(userCreds, regionNamesCq[0]);
userQueryService = userCache->getQueryService();
auto qs = userQueryService;
@@ -461,8 +458,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour2)
for (i = 0; i < MAX_LISTNER; i++) {
sprintf(buf, "get info for cq[%s]:", cqNames[i]);
LOG(buf);
- CqQueryPtr cqy = qs->getCq(cqNames[i]);
- // CqStatisticsPtr cqStats = cqy->getStatistics();
+ auto cqy = qs->getCq(cqNames[i]);
+ //auto cqStats = cqy->getStatistics();
}
if ((durableCq && !logicalCacheKeepAlive && !closeLogicalCache) ||
@@ -517,10 +514,10 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour2)
{
sprintf(buf, "get info for cq[%s]:", cqNames[i]);
LOG(buf);
- CqQueryPtr cqy = qs->getCq(cqNames[i]);
+ auto cqy = qs->getCq(cqNames[i]);
cqy->stop();
cqy->close();
- // CqStatisticsPtr cqStats = cqy->getStatistics();
+ //auto cqStats = cqy->getStatistics();
}*/
userCache->close();
diff --git a/cppcache/integration-test/testThinClientSecurityMultiUserTest.cpp b/cppcache/integration-test/testThinClientSecurityMultiUserTest.cpp
index f0a1972..8442dd5 100644
--- a/cppcache/integration-test/testThinClientSecurityMultiUserTest.cpp
+++ b/cppcache/integration-test/testThinClientSecurityMultiUserTest.cpp
@@ -17,7 +17,6 @@
#include "fw_dunit.hpp"
#include <string>
#include <cstdlib>
-#include <geode/GeodeCppCache.hpp>
#include <geode/FunctionService.hpp>
#include <geode/Execution.hpp>
@@ -35,7 +34,7 @@ using namespace apache::geode::client;
const char* locHostPort =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, 1);
-CredentialGeneratorPtr credentialGeneratorHandler;
+std::shared_ptr<CredentialGenerator> credentialGeneratorHandler;
std::string getXmlPath() {
char xmlPath[1000] = {'\0'};
@@ -101,211 +100,216 @@ void initCredentialGenerator() {
//#define USER_CLIENT s2p2
const char* regionNamesAuth[] = {"DistRegionAck"};
-
-PropertiesPtr userCreds;
-void initClientAuth() {
- userCreds = Properties::create();
- PropertiesPtr config = Properties::create();
- credentialGeneratorHandler->getAuthInit(config);
-
- credentialGeneratorHandler->getValidCredentials(userCreds);
-
- try {
- initClient(true, config);
- } catch (...) {
- throw;
- }
-}
-
-typedef enum { OP_GET = 0, OP_PUT = 1 } UserOpCode;
-
-class UserThread : public ACE_Task_Base {
- int m_numberOfOps;
- int m_numberOfUsers;
- RegionServicePtr m_userCache;
- RegionPtr m_userRegion;
- int m_userId;
- bool m_failed;
- bool getValidOps;
- int m_totalOpsPassed;
-
- int getNextOp() { return (rand() % 17) % 2; }
-
- int getNextKeyIdx() {
- if (getValidOps) {
- getValidOps = false;
- return m_userId;
- } else {
- getValidOps = true;
- }
- int nextNumber = (rand() % 541) % (m_numberOfUsers + 1);
- if (nextNumber == m_userId) return (nextNumber + 1) % (m_numberOfUsers + 1);
- return nextNumber;
- }
-
- void getOp() {
- LOG("Get ops");
- bool isPassed = false;
- char key[10] = {'\0'};
- try {
- int nextKey = getNextKeyIdx();
-
- sprintf(key, "key%d", nextKey);
- char tmp[256] = {'\0'};
- sprintf(tmp, "User is doing get. user id = %d, key = %s", m_userId, key);
- LOG(tmp);
- isPassed = ifUserIdInKey(key);
- m_userRegion->get(key);
- LOG("op got passed");
- m_totalOpsPassed++;
- } catch (const apache::geode::client::NotAuthorizedException&) {
- LOG("NotAuthorizedException Caught");
- if (isPassed) {
- char tmp[256] = {'\0'};
- sprintf(tmp, "Get ops should have passed for user id = %d for key = %s",
- m_userId, key);
- LOG(tmp);
- m_failed = true;
- }
- } catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- m_failed = true;
- char tmp[256] = {'\0'};
- sprintf(tmp, "Some other geode exception got for user id = %d", m_userId);
- LOG(tmp);
- LOG(other.getMessage());
- m_failed = true;
- } catch (...) {
- m_failed = true;
- char tmp[256] = {'\0'};
- sprintf(tmp, "Some other exception got for user id = %d", m_userId);
- LOG(tmp);
- }
- }
-
- void putOp() {
- LOG("Put ops");
- bool isPassed = false;
- char key[10] = {'\0'};
- try {
- int nextKey = getNextKeyIdx();
-
- sprintf(key, "key%d", nextKey);
- char tmp[256] = {'\0'};
- sprintf(tmp, "User is doing put. user id = %d, key = %s", m_userId, key);
- LOG(tmp);
- isPassed = ifUserIdInKey(key);
- m_userRegion->put(key, "val");
- LOG("op got passed");
- m_totalOpsPassed++;
- } catch (const apache::geode::client::NotAuthorizedException&) {
- LOG("NotAuthorizedException Caught");
- if (isPassed) {
- char tmp[256] = {'\0'};
- sprintf(tmp, "Put ops should have passed for user id = %d for key = %s",
- m_userId, key);
- LOG(tmp);
- m_failed = true;
- }
- } catch (const apache::geode::client::Exception& other) {
- other.printStackTrace();
- m_failed = true;
- char tmp[256] = {'\0'};
- sprintf(tmp, "Some other geode exception got for user id = %d", m_userId);
- LOG(tmp);
- LOG(other.getMessage());
- m_failed = true;
- } catch (...) {
- m_failed = true;
- char tmp[256] = {'\0'};
- sprintf(tmp, "Some other exception got for user id = %d", m_userId);
- LOG(tmp);
- }
- }
-
- bool ifUserIdInKey(const char* key) {
- std::string s1(key);
- char tmp[10];
- sprintf(tmp, "%d", m_userId);
- std::string userId(tmp);
-
- size_t found = s1.rfind(userId);
- if (found != std::string::npos) return true;
- return false;
- }
-
- public:
- UserThread() {
- getValidOps = true;
- m_totalOpsPassed = 0;
- }
- void setParameters(int numberOfOps, int userId, PoolPtr pool,
- int numberOfUsers) {
- printf("userthread constructor nOo = %d, userid = %d, numberOfUsers = %d\n",
- numberOfOps, userId, numberOfUsers);
- m_userId = userId;
- m_failed = false;
- PropertiesPtr creds = Properties::create();
- char tmp[25] = {'\0'};
- sprintf(tmp, "user%d", userId);
-
- creds->insert("security-username", tmp);
- creds->insert("security-password", tmp);
-
- m_numberOfOps = numberOfOps;
- m_userCache = getVirtualCache(creds, pool);
- m_userRegion = m_userCache->getRegion(regionNamesAuth[0]);
- m_numberOfUsers = numberOfUsers;
- }
-
- void start() { activate(THR_NEW_LWP | THR_JOINABLE); }
-
- void stop() {
- /*if (m_run) {
- m_run = false;
- wait();
- }*/
- }
-
- int svc(void) {
- int nOps = 0;
- char key[10] = {'\0'};
- char val[10] = {'\0'};
- printf("User thread first put started\n");
- // users data
- sprintf(key, "key%d", m_userId);
- sprintf(val, "val%d", m_userId);
- printf("User thread first put started key = %s val =%s\n", key, val);
- m_userRegion->put(key, val);
- printf("User thread first put completed\n");
- while (nOps++ < m_numberOfOps && !m_failed) {
- int nextOp = getNextOp();
- switch (nextOp) {
- case 0:
- getOp();
- break;
- case 1:
- putOp();
- break;
- default:
- LOG("Something is worng.");
- break;
- }
- }
- m_userCache->close();
- return 0;
- }
-
- bool isUserOpsFailed() {
- if (m_failed) {
- char tmp[256] = {'\0'};
- sprintf(tmp, "User ops failed for this user id = %d", m_userId);
- LOG(tmp);
- }
- return m_failed;
- }
-
- int getTotalOpsPassed() { return m_totalOpsPassed; }
+ std::shared_ptr<Properties> userCreds;
+ void initClientAuth() {
+ userCreds = Properties::create();
+ auto config = Properties::create();
+ credentialGeneratorHandler->getAuthInit(config);
+
+ credentialGeneratorHandler->getValidCredentials(userCreds);
+
+ try {
+ initClient(true, config);
+ } catch (...) {
+ throw;
+ }
+ }
+
+ typedef enum { OP_GET = 0, OP_PUT = 1 } UserOpCode;
+
+ class UserThread : public ACE_Task_Base {
+ int m_numberOfOps;
+ int m_numberOfUsers;
+ std::shared_ptr<RegionService> m_userCache;
+ std::shared_ptr<Region> m_userRegion;
+ int m_userId;
+ bool m_failed;
+ bool getValidOps;
+ int m_totalOpsPassed;
+
+ int getNextOp() { return (rand() % 17) % 2; }
+
+ int getNextKeyIdx() {
+ if (getValidOps) {
+ getValidOps = false;
+ return m_userId;
+ } else {
+ getValidOps = true;
+ }
+ int nextNumber = (rand() % 541) % (m_numberOfUsers + 1);
+ if (nextNumber == m_userId)
+ return (nextNumber + 1) % (m_numberOfUsers + 1);
+ return nextNumber;
+ }
+
+ void getOp() {
+ LOG("Get ops");
+ bool isPassed = false;
+ char key[10] = {'\0'};
+ try {
+ int nextKey = getNextKeyIdx();
+
+ sprintf(key, "key%d", nextKey);
+ char tmp[256] = {'\0'};
+ sprintf(tmp, "User is doing get. user id = %d, key = %s", m_userId, key);
+ LOG(tmp);
+ isPassed = ifUserIdInKey(key);
+ m_userRegion->get(key);
+ LOG("op got passed");
+ m_totalOpsPassed++;
+ } catch (const apache::geode::client::NotAuthorizedException&) {
+ LOG("NotAuthorizedException Caught");
+ if (isPassed) {
+ char tmp[256] = {'\0'};
+ sprintf(tmp,
+ "Get ops should have passed for user id = %d for key = %s",
+ m_userId, key);
+ LOG(tmp);
+ m_failed = true;
+ }
+ } catch (const apache::geode::client::Exception& other) {
+ other.printStackTrace();
+ m_failed = true;
+ char tmp[256] = {'\0'};
+ sprintf(tmp, "Some other geode exception got for user id = %d",
+ m_userId);
+ LOG(tmp);
+ LOG(other.getMessage());
+ m_failed = true;
+ } catch (...) {
+ m_failed = true;
+ char tmp[256] = {'\0'};
+ sprintf(tmp, "Some other exception got for user id = %d", m_userId);
+ LOG(tmp);
+ }
+ }
+
+ void putOp() {
+ LOG("Put ops");
+ bool isPassed = false;
+ char key[10] = {'\0'};
+ try {
+ int nextKey = getNextKeyIdx();
+
+ sprintf(key, "key%d", nextKey);
+ char tmp[256] = {'\0'};
+ sprintf(tmp, "User is doing put. user id = %d, key = %s", m_userId, key);
+ LOG(tmp);
+ isPassed = ifUserIdInKey(key);
+ m_userRegion->put(key, "val");
+ LOG("op got passed");
+ m_totalOpsPassed++;
+ } catch (const apache::geode::client::NotAuthorizedException&) {
+ LOG("NotAuthorizedException Caught");
+ if (isPassed) {
+ char tmp[256] = {'\0'};
+ sprintf(tmp,
+ "Put ops should have passed for user id = %d for key = %s",
+ m_userId, key);
+ LOG(tmp);
+ m_failed = true;
+ }
+ } catch (const apache::geode::client::Exception& other) {
+ other.printStackTrace();
+ m_failed = true;
+ char tmp[256] = {'\0'};
+ sprintf(tmp, "Some other geode exception got for user id = %d",
+ m_userId);
+ LOG(tmp);
+ LOG(other.getMessage());
+ m_failed = true;
+ } catch (...) {
+ m_failed = true;
+ char tmp[256] = {'\0'};
+ sprintf(tmp, "Some other exception got for user id = %d", m_userId);
+ LOG(tmp);
+ }
+ }
+
+ bool ifUserIdInKey(const char* key) {
+ std::string s1(key);
+ char tmp[10];
+ sprintf(tmp, "%d", m_userId);
+ std::string userId(tmp);
+
+ size_t found = s1.rfind(userId);
+ if (found != std::string::npos) return true;
+ return false;
+ }
+
+ public:
+ UserThread() {
+ getValidOps = true;
+ m_totalOpsPassed = 0;
+ }
+ void setParameters(int numberOfOps, int userId, std::shared_ptr<Pool> pool,
+ int numberOfUsers) {
+ printf(
+ "userthread constructor nOo = %d, userid = %d, numberOfUsers = %d\n",
+ numberOfOps, userId, numberOfUsers);
+ m_userId = userId;
+ m_failed = false;
+ auto creds = Properties::create();
+ char tmp[25] = {'\0'};
+ sprintf(tmp, "user%d", userId);
+
+ creds->insert("security-username", tmp);
+ creds->insert("security-password", tmp);
+
+ m_numberOfOps = numberOfOps;
+ m_userCache = getVirtualCache(creds, pool);
+ m_userRegion = m_userCache->getRegion(regionNamesAuth[0]);
+ m_numberOfUsers = numberOfUsers;
+ }
+
+ void start() { activate(THR_NEW_LWP | THR_JOINABLE); }
+
+ void stop() {
+ /*if (m_run) {
+ m_run = false;
+ wait();
+ }*/
+ }
+
+ int svc(void) {
+ int nOps = 0;
+ char key[10] = {'\0'};
+ char val[10] = {'\0'};
+ printf("User thread first put started\n");
+ // users data
+ sprintf(key, "key%d", m_userId);
+ sprintf(val, "val%d", m_userId);
+ printf("User thread first put started key = %s val =%s\n", key, val);
+ m_userRegion->put(key, val);
+ printf("User thread first put completed\n");
+ while (nOps++ < m_numberOfOps && !m_failed) {
+ int nextOp = getNextOp();
+ switch (nextOp) {
+ case 0:
+ getOp();
+ break;
+ case 1:
+ putOp();
+ break;
+ default:
+ LOG("Something is worng.");
+ break;
+ }
+ }
+ m_userCache->close();
+ return 0;
+ }
+
+ bool isUserOpsFailed() {
+ if (m_failed) {
+ char tmp[256] = {'\0'};
+ sprintf(tmp, "User ops failed for this user id = %d", m_userId);
+ LOG(tmp);
+ }
+ return m_failed;
+ }
+
+ int getTotalOpsPassed() { return m_totalOpsPassed; }
};
DUNIT_TASK_DEFINITION(CLIENT_1, StartServer1)
@@ -358,7 +362,7 @@ DUNIT_TASK_DEFINITION(CLIENT_1, StepOne)
createRegionForSecurity(regionNamesAuth[0], USE_ACK, false, nullptr,
false, -1, true, 0);
LOG("Region created successfully");
- PoolPtr pool = getPool(regionNamesAuth[0]);
+ auto pool = getPool(regionNamesAuth[0]);
int m_numberOfUsers = 3;
int m_numberOfOps = 10;
UserThread* uthreads = new UserThread[m_numberOfUsers];
diff --git a/cppcache/integration-test/testThinClientSecurityPostAuthorization.cpp b/cppcache/integration-test/testThinClientSecurityPostAuthorization.cpp
index eb77561..0a3cf34 100644
--- a/cppcache/integration-test/testThinClientSecurityPostAuthorization.cpp
+++ b/cppcache/integration-test/testThinClientSecurityPostAuthorization.cpp
@@ -24,7 +24,6 @@
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include "CacheHelper.hpp"
#include "ThinClientHelper.hpp"
#include <ace/Process.h>
@@ -66,7 +65,7 @@ const char* locHostPort =
const char* regionNamesAuth[] = {"DistRegionAck"};
void initClientAuth(char userType, int clientNum = 1) {
- PropertiesPtr config = Properties::create();
+ auto config = Properties::create();
config->insert("security-client-auth-library", "securityImpl");
config->insert("security-client-auth-factory",
"createUserPasswordAuthInitInstance");
@@ -123,7 +122,8 @@ const char* getServerSecurityParams() {
return serverSecurityParams.c_str();
}
-void getKeysVector(VectorOfCacheableKey& keysVec, int numKeys) {
+void getKeysVector(std::vector<std::shared_ptr<CacheableKey>>& keysVec,
+ int numKeys) {
for (int index = 0; index < numKeys; ++index) {
keysVec.push_back(CacheableString::create(keys[index]));
}
@@ -131,9 +131,9 @@ void getKeysVector(VectorOfCacheableKey& keysVec, int numKeys) {
void checkValuesMap(HashMapOfCacheable& values, int clientNum, int numKeys) {
int expectedNum = 0;
- CacheableKeyPtr key;
- CacheableStringPtr val;
- CacheableStringPtr expectedVal;
+ std::shared_ptr<CacheableKey> key;
+ std::shared_ptr<CacheableString> val;
+ std::shared_ptr<CacheableString> expectedVal;
for (int index = clientNum - 1; index < numKeys; index += clientNum) {
++expectedNum;
key = CacheableString::create(keys[index]);
@@ -151,14 +151,15 @@ void checkValuesMap(HashMapOfCacheable& values, int clientNum, int numKeys) {
void checkExceptionsMap(HashMapOfException& exceptions, int clientNum,
int numKeys) {
int expectedNum = 0;
- CacheableKeyPtr key;
+ std::shared_ptr<CacheableKey> key;
for (int index = 0; index < numKeys; ++index) {
if ((index + 1) % clientNum != 0) {
++expectedNum;
key = CacheableString::create(keys[index]);
const auto& iter = exceptions.find(key);
ASSERT(iter != exceptions.end(), "key not found in exceptions map");
- ASSERT(std::dynamic_pointer_cast<NotAuthorizedExceptionPtr>(iter->second),
+ ASSERT(std::dynamic_pointer_cast<std::shared_ptr<NotAuthorizedException>>(
+ iter->second),
"unexpected exception type in exception map");
printf("Got expected NotAuthorizedException: %s",
iter->second->getMessage());
@@ -209,21 +210,21 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
verifyDestroyed(regionNamesAuth[0], keys[0]);
destroyRegion(regionNamesAuth[0]);
- CacheableKeyPtr key0 = CacheableKey::create(keys[0]);
- CacheableStringPtr val0 = CacheableString::create(vals[0]);
- CacheableKeyPtr key2 = CacheableKey::create(keys[2]);
- CacheableStringPtr val2 = CacheableString::create(nvals[2]);
+ auto key0 = CacheableKey::create(keys[0]);
+ auto val0 = CacheableString::create(vals[0]);
+ auto key2 = CacheableKey::create(keys[2]);
+ auto val2 = CacheableString::create(nvals[2]);
createRegionForSecurity(regionNamesAuth[0], USE_ACK, true);
createEntry(regionNamesAuth[0], keys[0], vals[0]);
createEntry(regionNamesAuth[0], keys[2], nvals[2]);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
if (regPtr0 != nullptr) {
regPtr0->registerAllKeys();
regPtr0->unregisterAllKeys();
}
- VectorOfCacheableKey keysVec;
+ std::vector<std::shared_ptr<CacheableKey>> keysVec;
keysVec.push_back(key0);
keysVec.push_back(key2);
auto values = regPtr0->getAll(keysVec);
@@ -259,8 +260,8 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
try {
createRegionForSecurity(regionNamesAuth[0], USE_ACK, true);
- RegionPtr regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
- CacheableKeyPtr keyPtr = CacheableKey::create(keys[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
+ auto keyPtr = CacheableKey::create(keys[0]);
auto checkPtr =
std::dynamic_pointer_cast<CacheableString>(regPtr0->get(keyPtr));
FAIL("Should get NotAuthorizedException");
@@ -285,9 +286,9 @@ DUNIT_TASK_DEFINITION(READER_CLIENT, StepThree)
initClientAuth('R', 2);
createRegionForSecurity(regionNamesAuth[0], USE_ACK, true);
- VectorOfCacheableKey keys;
+ std::vector<std::shared_ptr<CacheableKey>> keys;
getKeysVector(keys, 6);
- RegionPtr rptr = getHelper()->getRegion(regionNamesAuth[0]);
+ auto rptr = getHelper()->getRegion(regionNamesAuth[0]);
auto values = rptr->getAll(keys);
checkValuesMap(values, 2, 6);
@@ -301,9 +302,9 @@ DUNIT_TASK_DEFINITION(READER2_CLIENT, StepFour)
initClientAuth('R', 3);
createRegionForSecurity(regionNamesAuth[0], USE_ACK, true);
- VectorOfCacheableKey keys;
+ std::vector<std::shared_ptr<CacheableKey>> keys;
getKeysVector(keys, 6);
- RegionPtr rptr = getHelper()->getRegion(regionNamesAuth[0]);
+ auto rptr = getHelper()->getRegion(regionNamesAuth[0]);
auto values = rptr->getAll(keys);
checkValuesMap(values, 3, 6);
diff --git a/cppcache/integration-test/testThinClientStatistics.cpp b/cppcache/integration-test/testThinClientStatistics.cpp
index e5b8449..5165478 100644
--- a/cppcache/integration-test/testThinClientStatistics.cpp
+++ b/cppcache/integration-test/testThinClientStatistics.cpp
@@ -120,7 +120,7 @@ static int selector(const dirent* d) {
/* Common Functions */
void initClientWithStats() {
- PropertiesPtr pp = Properties::create();
+ auto pp = Properties::create();
pp->insert("statistic-sampling-enabled", "true");
pp->insert("statistic-sample-rate", std::chrono::seconds(1));
pp->insert("statistic-archive-file", "./statArchive.gfs");
@@ -132,7 +132,7 @@ void initClientWithStats() {
}
void initClientWithStatsDisabled() {
- PropertiesPtr pp = Properties::create();
+ auto pp = Properties::create();
pp->insert("statistic-sampling-enabled", "false");
// pp->insert("statistic-sample-rate", 1);
// pp->insert("statistic-archive-file", "./statArchive.gfs");
@@ -143,21 +143,21 @@ void initClientWithStatsDisabled() {
}
void DoRegionOpsAndVerify() {
- RegionPtr regPtr0 = getHelper()->getRegion(regionNames[0]);
+ auto regPtr0 = getHelper()->getRegion(regionNames[0]);
for (int index = 0; index < 5; index++) {
char key[100] = {0};
char value[100] = {0};
ACE_OS::sprintf(key, "Key-%d", index);
ACE_OS::sprintf(value, "Value-%d", index);
- CacheableKeyPtr keyptr = CacheableKey::create(key);
- CacheablePtr valuePtr = CacheableString::create(value);
+ auto keyptr = CacheableKey::create(key);
+ auto valuePtr = CacheableString::create(value);
regPtr0->put(keyptr, valuePtr);
}
- CacheableKeyPtr keyptr = CacheableKey::create("Key-0");
+ auto keyptr = CacheableKey::create("Key-0");
- RegionEntryPtr regEntry = regPtr0->getEntry(keyptr);
+ auto regEntry = regPtr0->getEntry(keyptr);
LOGINFO("regEntry->isDestroyed() = %d ", regEntry->isDestroyed());
ASSERT(
@@ -166,7 +166,7 @@ void DoRegionOpsAndVerify() {
bool flag ATTR_UNUSED = regPtr0->remove(keyptr);
- RegionEntryPtr remRegEntry = regPtr0->getEntry(keyptr);
+ auto remRegEntry = regPtr0->getEntry(keyptr);
ASSERT(remRegEntry == nullptr,
"regionEntry pointer to removed entry must be nullptr");
@@ -180,7 +180,7 @@ void DoRegionOpsAndVerify() {
}
auto cacheStatptr = std::make_shared<CacheStatistics>();
- // CacheStatisticsPtr cacheStatptr;
+ // std::shared_ptr<CacheStatistics> cacheStatptr;
try {
auto cache = std::dynamic_pointer_cast<Cache>(
regPtr0->getRegionService()); // This depends on LocalCache
@@ -189,7 +189,7 @@ void DoRegionOpsAndVerify() {
cache->getDistributedSystem().getSystemProperties().statisticsEnabled();
LOGINFO("statisticsEnabled = %d ", flag);
cacheStatptr = regEntry->getStatistics();
- } catch (StatisticsDisabledException& ex) {
+ } catch (StatisticsDisabledException&) {
LOGINFO("Exception Caught:: StatisticsDisabledException");
} catch (GeodeConfigException& e) {
LOGINFO("Exception Caught:: %s", e.getMessage());
@@ -204,7 +204,7 @@ void DoRegionOpsAndVerify() {
}
void initClientWithStatsAndLog(const char* str, int fileLimit, int diskLimit) {
- PropertiesPtr pp = Properties::create();
+ auto pp = Properties::create();
pp->insert("log-file", str);
pp->insert("log-level", "fine");
pp->insert("log-file-size-limit", fileLimit);
diff --git a/cppcache/integration-test/testThinClientTicket303.cpp b/cppcache/integration-test/testThinClientTicket303.cpp
index e369906..b156db6 100644
--- a/cppcache/integration-test/testThinClientTicket303.cpp
+++ b/cppcache/integration-test/testThinClientTicket303.cpp
@@ -27,7 +27,7 @@
void createAuthzRegion() {
initCredentialGenerator();
initClientAuth('A');
- RegionPtr regPtr = createOverflowRegion(regionNamesAuth[0], false, 1);
+ auto regPtr = createOverflowRegion(regionNamesAuth[0], false, 1);
ASSERT(regPtr != nullptr, "Failed to create region.");
LOG("Region created.");
}
@@ -66,7 +66,7 @@ END_TASK_DEFINITION
// check that tracking work correctly with put.
DUNIT_TASK_DEFINITION(CLIENT1, PutAndVerification)
{
- RegionPtr rptr = getHelper()->getRegion(regionNamesAuth[0]);
+ auto rptr = getHelper()->getRegion(regionNamesAuth[0]);
rptr->put("key-1", "client1-value1");
rptr->put("key-2", "client1-value2");
rptr->put("key-3", "client1-value3");
diff --git a/cppcache/integration-test/testThinClientTicket304.cpp b/cppcache/integration-test/testThinClientTicket304.cpp
index d19758d..6953116 100644
--- a/cppcache/integration-test/testThinClientTicket304.cpp
+++ b/cppcache/integration-test/testThinClientTicket304.cpp
@@ -76,7 +76,7 @@ END_TASK_DEFINITION
// check that tracking works correctly with put.
DUNIT_TASK_DEFINITION(CLIENT1, PutOnClient1)
{
- RegionPtr rptr = getHelper()->getRegion(regionNamesAuth[0]);
+ auto rptr = getHelper()->getRegion(regionNamesAuth[0]);
rptr->put("key-1", "client1-value1");
rptr->put("key-2", "client1-value2");
rptr->put("key-3", "client1-value3");
@@ -85,7 +85,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutOnClient1)
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, RegisterInterestAllOnClient2)
{
- RegionPtr rptr = getHelper()->getRegion(regionNamesAuth[0]);
+ auto rptr = getHelper()->getRegion(regionNamesAuth[0]);
thread1 = new putThread(rptr, true);
thread1->start();
LOG("RegisterInterest started on client 2");
@@ -93,7 +93,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, RegisterInterestAllOnClient2)
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, DestroyEntryOnClient1)
{
- RegionPtr rptr = getHelper()->getRegion(regionNamesAuth[0]);
+ auto rptr = getHelper()->getRegion(regionNamesAuth[0]);
rptr->destroy("key-3");
LOG("DestroyEntryOnClient1 completed");
}
@@ -114,14 +114,14 @@ DUNIT_TASK_DEFINITION(CLIENT2, VerifyOnClient2)
verifyEntry(regionNamesAuth[0], "key-1", "client1-value1");
verifyEntry(regionNamesAuth[0], "key-2", "client1-value2");
verifyDestroyed(regionNamesAuth[0], "key-3");
- RegionPtr rptr = getHelper()->getRegion(regionNamesAuth[0]);
+ auto rptr = getHelper()->getRegion(regionNamesAuth[0]);
rptr->localDestroyRegion();
LOG("VerifyOnClient2 completed");
}
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, RegisterInterestKeysOnClient2)
{
- RegionPtr rptr = getHelper()->getRegion(regionNamesAuth[0]);
+ auto rptr = getHelper()->getRegion(regionNamesAuth[0]);
thread1 = new putThread(rptr);
thread1->setParams(5, 3, 1);
thread1->start();
@@ -130,7 +130,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, RegisterInterestKeysOnClient2)
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, RegisterRegexClient2)
{
- RegionPtr rptr = getHelper()->getRegion(regionNamesAuth[0]);
+ auto rptr = getHelper()->getRegion(regionNamesAuth[0]);
thread1 = new putThread(rptr);
thread1->setParams(6, 3, 1);
thread1->start();
@@ -140,7 +140,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, CreateRegionOnClient1)
;
{
- RegionPtr rptr = getHelper()->getRegion(regionNamesAuth[0]);
+ auto rptr = getHelper()->getRegion(regionNamesAuth[0]);
rptr->localDestroyRegion();
SLEEP(10000);
createRegion(regionNamesAuth[0], false, true);
diff --git a/cppcache/integration-test/testThinClientTicket317.cpp b/cppcache/integration-test/testThinClientTicket317.cpp
index 91dcb88..c3f837e 100644
--- a/cppcache/integration-test/testThinClientTicket317.cpp
+++ b/cppcache/integration-test/testThinClientTicket317.cpp
@@ -68,7 +68,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, doLocalDestroyAndDestroy)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
regPtr->localDestroy(keys[0]);
regPtr->destroy(keys[0]);
verifyDestroyed(regionNames[0], keys[0]);
@@ -77,8 +77,8 @@ DUNIT_TASK_DEFINITION(CLIENT2, doLocalDestroyAndDestroy)
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, verifyKeyDestroyedOnServer)
{
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
- CacheablePtr value = regPtr->get(keys[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
+ auto value = regPtr->get(keys[0]);
if (value != nullptr) {
FAIL("Entry not destroyed on server.");
}
@@ -87,7 +87,7 @@ END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT1, verifyKeyDestroyedfromClient1)
{
try {
- RegionPtr regPtr = getHelper()->getRegion(regionNames[0]);
+ auto regPtr = getHelper()->getRegion(regionNames[0]);
regPtr->get(keys[0]);
} catch (const EntryNotFoundException&) {
// expected
diff --git a/cppcache/integration-test/testThinClientTracking.cpp b/cppcache/integration-test/testThinClientTracking.cpp
index b39eb2b..0992518 100644
--- a/cppcache/integration-test/testThinClientTracking.cpp
+++ b/cppcache/integration-test/testThinClientTracking.cpp
@@ -31,14 +31,14 @@ putThread *thread2 = nullptr;
void createAuthzRegion() {
initCredentialGenerator();
initClientAuth('A');
- RegionPtr rptr;
+ std::shared_ptr<Region> rptr;
createRegion(regionNamesAuth[0], false, true);
rptr = getHelper()->getRegion(regionNamesAuth[0]);
rptr->registerAllKeys();
}
void verifyEntry(const char *value) {
- RegionPtr rptr = getHelper()->getRegion(regionNamesAuth[0]);
- RegionEntryPtr entry = rptr->getEntry("key-1");
+ auto rptr = getHelper()->getRegion(regionNamesAuth[0]);
+ auto entry = rptr->getEntry("key-1");
ASSERT(entry != nullptr, "Key should have been found in region.");
auto valuePtr = std::dynamic_pointer_cast<CacheableString>(entry->getValue());
char buf1[1024];
@@ -92,7 +92,7 @@ END_TASK_DEFINITION
// check that tracking work correctly with put.
DUNIT_TASK_DEFINITION(CLIENT1, PutOnClient1)
{
- RegionPtr rptr = getHelper()->getRegion(regionNamesAuth[0]);
+ auto rptr = getHelper()->getRegion(regionNamesAuth[0]);
thread1 = new putThread(rptr);
thread1->setParams(0, 1, 1, true);
thread1->start();
@@ -101,7 +101,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutOnClient1)
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, PutOnClient2)
{
- RegionPtr rptr = getHelper()->getRegion(regionNamesAuth[0]);
+ auto rptr = getHelper()->getRegion(regionNamesAuth[0]);
thread2 = new putThread(rptr);
thread2->setParams(0, 1, 1);
thread2->start();
@@ -135,7 +135,7 @@ END_TASK_DEFINITION
// check that tracking work correctly with destroy.
DUNIT_TASK_DEFINITION(CLIENT1, DestroyOnClient1)
{
- RegionPtr rptr = getHelper()->getRegion(regionNamesAuth[0]);
+ auto rptr = getHelper()->getRegion(regionNamesAuth[0]);
thread1 = new putThread(rptr);
thread1->setParams(0, 1, 1, true);
thread1->start();
@@ -144,7 +144,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, DestroyOnClient1)
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, DestroyOnClient2)
{
- RegionPtr rptr = getHelper()->getRegion(regionNamesAuth[0]);
+ auto rptr = getHelper()->getRegion(regionNamesAuth[0]);
thread2 = new putThread(rptr);
thread2->setParams(2, 1, 1);
thread2->start();
@@ -177,7 +177,7 @@ END_TASK_DEFINITION
// check that Conversion from Tracked Map Entry and back work correctly
DUNIT_TASK_DEFINITION(CLIENT1, PutTrackedMapOnClient1)
{
- RegionPtr rptr = getHelper()->getRegion(regionNamesAuth[0]);
+ auto rptr = getHelper()->getRegion(regionNamesAuth[0]);
thread1 = new putThread(rptr);
thread1->setParams(0, 1, 1, true);
thread1->start();
@@ -186,7 +186,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, PutTrackedMapOnClient1)
END_TASK_DEFINITION
DUNIT_TASK_DEFINITION(CLIENT2, PutTrackedMapOnClient2)
{
- RegionPtr rptr = getHelper()->getRegion(regionNamesAuth[0]);
+ auto rptr = getHelper()->getRegion(regionNamesAuth[0]);
thread2 = new putThread(rptr);
thread2->setParams(0, 10, 1, false, true);
thread2->start();
diff --git a/cppcache/integration-test/testThinClientWriterException.cpp b/cppcache/integration-test/testThinClientWriterException.cpp
index 6015536..de4b2a0 100644
--- a/cppcache/integration-test/testThinClientWriterException.cpp
+++ b/cppcache/integration-test/testThinClientWriterException.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include "ThinClientHelper.hpp"
#include "ace/Process.h"
#include "TallyListener.hpp"
@@ -33,52 +32,50 @@
*/
using namespace apache::geode::client::testframework::security;
using namespace apache::geode::client;
-
-TallyListenerPtr regListener;
-TallyWriterPtr regWriter;
+std::shared_ptr<TallyListener> regListener;
+std::shared_ptr<TallyWriter> regWriter;
const char* locHostPort =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, 1);
const char* regionNamesAuth[] = {"DistRegionAck"};
-
-CredentialGeneratorPtr credentialGeneratorHandler;
-
-std::string getXmlPath() {
- char xmlPath[1000] = {'\0'};
- const char* path = ACE_OS::getenv("TESTSRC");
- ASSERT(path != nullptr,
- "Environment variable TESTSRC for test source directory is not set.");
- strncpy(xmlPath, path, strlen(path) - strlen("cppcache"));
- strcat(xmlPath, "xml/Security/");
- return std::string(xmlPath);
-}
-
-void initCredentialGenerator() {
- static int loopNum = 1;
-
- switch (loopNum) {
- case 1: {
- credentialGeneratorHandler = CredentialGenerator::create("DUMMY");
- break;
- }
- case 2: {
- credentialGeneratorHandler = CredentialGenerator::create("LDAP");
- break;
- }
- default:
- case 3: {
- credentialGeneratorHandler = CredentialGenerator::create("PKCS");
- break;
- }
- }
-
- if (credentialGeneratorHandler == nullptr) {
- FAIL("credentialGeneratorHandler is nullptr");
- }
-
- loopNum++;
- if (loopNum > 2) loopNum = 1;
+ std::shared_ptr<CredentialGenerator> credentialGeneratorHandler;
+
+ std::string getXmlPath() {
+ char xmlPath[1000] = {'\0'};
+ const char* path = ACE_OS::getenv("TESTSRC");
+ ASSERT(path != nullptr,
+ "Environment variable TESTSRC for test source directory is not set.");
+ strncpy(xmlPath, path, strlen(path) - strlen("cppcache"));
+ strcat(xmlPath, "xml/Security/");
+ return std::string(xmlPath);
+ }
+
+ void initCredentialGenerator() {
+ static int loopNum = 1;
+
+ switch (loopNum) {
+ case 1: {
+ credentialGeneratorHandler = CredentialGenerator::create("DUMMY");
+ break;
+ }
+ case 2: {
+ credentialGeneratorHandler = CredentialGenerator::create("LDAP");
+ break;
+ }
+ default:
+ case 3: {
+ credentialGeneratorHandler = CredentialGenerator::create("PKCS");
+ break;
+ }
+ }
+
+ if (credentialGeneratorHandler == nullptr) {
+ FAIL("credentialGeneratorHandler is nullptr");
+ }
+
+ loopNum++;
+ if (loopNum > 2) loopNum = 1;
}
opCodeList::value_type tmpRArr[] = {OP_GET, OP_REGISTER_INTEREST,
@@ -105,7 +102,7 @@ opCodeList::value_type tmpRArr[] = {OP_GET, OP_REGISTER_INTEREST,
#define READER_CLIENT s2p1
void initClientAuth() {
- PropertiesPtr config = Properties::create();
+ auto config = Properties::create();
opCodeList rt(tmpRArr, tmpRArr + sizeof tmpRArr / sizeof *tmpRArr);
credentialGeneratorHandler->getAuthInit(config);
credentialGeneratorHandler->getAllowedCredentialsForOps(rt, config, nullptr);
@@ -120,10 +117,10 @@ void initClientAuth() {
}
}
-void setCacheWriter(const char* regName, TallyWriterPtr regWriter) {
- RegionPtr reg = getHelper()->getRegion(regName);
- AttributesMutatorPtr attrMutator = reg->getAttributesMutator();
- attrMutator->setCacheWriter(regWriter);
+void setCacheWriter(const char* regName, std::shared_ptr<TallyWriter> regWriter) {
+ auto reg = getHelper()->getRegion(regName);
+ auto attrMutator = reg->getAttributesMutator();
+ attrMutator->setCacheWriter(regWriter);
}
DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StartServer1)
@@ -155,7 +152,7 @@ END_TASK_DEFINITION
void startClient() {
initCredentialGenerator();
initClientAuth();
- RegionPtr rptr;
+ std::shared_ptr<Region> rptr;
char buf[100];
int i = 102;
LOG("Creating region in READER_CLIENT , no-ack, no-cache, with-listener and "
@@ -167,9 +164,9 @@ void startClient() {
rptr = getHelper()->getRegion(regionNamesAuth[0]);
rptr->registerAllKeys();
sprintf(buf, "%s: %d", rptr->getName(), i);
- CacheableKeyPtr key = createKey(buf);
+ auto key = createKey(buf);
sprintf(buf, "testUpdate::%s: value of %d", rptr->getName(), i);
- CacheableStringPtr valuePtr = CacheableString::create(buf);
+ auto valuePtr = CacheableString::create(buf);
try {
LOG("Trying put Operation");
rptr->put(key, valuePtr);
diff --git a/cppcache/integration-test/testUtils.hpp b/cppcache/integration-test/testUtils.hpp
index 9c1b2f1..1e331bd 100644
--- a/cppcache/integration-test/testUtils.hpp
+++ b/cppcache/integration-test/testUtils.hpp
@@ -19,7 +19,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#include <geode/GeodeCppCache.hpp>
/* use CacheHelper to gain the impl pointer from cache or region object
*/
@@ -47,11 +46,11 @@ namespace unitTests {
class TestUtils {
public:
- static RegionInternal* getRegionInternal(RegionPtr& rptr) {
+ static RegionInternal* getRegionInternal(std::shared_ptr<Region>& rptr) {
return dynamic_cast<RegionInternal*>(rptr.get());
}
- static CacheImpl* getCacheImpl(const CachePtr& cptr) {
+ static CacheImpl* getCacheImpl(const std::shared_ptr<Cache>& cptr) {
return CacheRegionHelper::getCacheImpl(cptr.get());
}
@@ -59,7 +58,8 @@ class TestUtils {
return cacheImpl.getPdxTypeRegistry()->testNumberOfPreservedData();
}
- static bool waitForKey(CacheableKeyPtr& keyPtr, RegionPtr& rptr, int maxTry,
+ static bool waitForKey(std::shared_ptr<CacheableKey>& keyPtr,
+ std::shared_ptr<Region>& rptr, int maxTry,
uint32_t msleepTime) {
int tries = 0;
bool found = false;
@@ -69,8 +69,9 @@ class TestUtils {
}
return found;
}
- static bool waitForValueForKey(CacheableKeyPtr& keyPtr, RegionPtr& rptr,
- int maxTry, uint32_t msleepTime) {
+ static bool waitForValueForKey(std::shared_ptr<CacheableKey>& keyPtr,
+ std::shared_ptr<Region>& rptr, int maxTry,
+ uint32_t msleepTime) {
int tries = 0;
bool found = false;
while ((tries < maxTry) && (!(found = rptr->containsValueForKey(keyPtr)))) {
@@ -79,7 +80,8 @@ class TestUtils {
}
return found;
}
- static bool waitForValueForKeyGoAway(CacheableKeyPtr& keyPtr, RegionPtr& rptr,
+ static bool waitForValueForKeyGoAway(std::shared_ptr<CacheableKey>& keyPtr,
+ std::shared_ptr<Region>& rptr,
int maxTry, uint32_t msleepTime) {
int tries = 0;
bool found = true;
@@ -89,8 +91,8 @@ class TestUtils {
}
return found;
}
- static bool waitForValueNotNULL(CacheableStringPtr& valPtr, int maxTry,
- uint32_t msleepTime) {
+ static bool waitForValueNotNULL(std::shared_ptr<CacheableString>& valPtr,
+ int maxTry, uint32_t msleepTime) {
int tries = 0;
bool found = false;
// @TODO: ? How will valPtr every point to something else in this loop?
@@ -101,9 +103,10 @@ class TestUtils {
return !found;
}
- static int waitForValue(CacheableKeyPtr& keyPtr, int expected,
- CacheableStringPtr& valPtr, RegionPtr& rptr,
- int maxTry, uint32_t msleepTime) {
+ static int waitForValue(std::shared_ptr<CacheableKey>& keyPtr, int expected,
+ std::shared_ptr<CacheableString>& valPtr,
+ std::shared_ptr<Region>& rptr, int maxTry,
+ uint32_t msleepTime) {
int tries = 0;
int val = 0;
do {
@@ -115,14 +118,14 @@ class TestUtils {
} while ((val != expected) && (tries < maxTry));
return val;
}
- static void showKeys(RegionPtr& rptr) {
+ static void showKeys(std::shared_ptr<Region>& rptr) {
char buf[2048];
if (rptr == nullptr) {
sprintf(buf, "this region does not exist!\n");
LOG(buf);
return;
}
- VectorOfCacheableKey v = rptr->keys();
+ std::vector<std::shared_ptr<CacheableKey>> v = rptr->keys();
auto len = v.size();
sprintf(buf, "Total keys in region %s : %zu\n", rptr->getName(), len);
LOG(buf);
@@ -134,19 +137,19 @@ class TestUtils {
LOG(buf);
}
}
- static void showKeyValues(RegionPtr& rptr) {
+ static void showKeyValues(std::shared_ptr<Region>& rptr) {
char buf[2048];
if (rptr == nullptr) {
sprintf(buf, "this region does not exist!\n");
LOG(buf);
return;
}
- VectorOfCacheableKey v = rptr->keys();
+ std::vector<std::shared_ptr<CacheableKey>> v = rptr->keys();
auto len = v.size();
sprintf(buf, "Total keys in region %s : %zu\n", rptr->getName(), len);
LOG(buf);
for (uint32_t i = 0; i < len; i++) {
- CacheableKeyPtr keyPtr = v[i];
+ auto keyPtr = v[i];
char keyText[100];
keyPtr->logString(keyText, 100);
auto valPtr =
@@ -157,7 +160,7 @@ class TestUtils {
LOG(buf);
}
}
- static void showValues(RegionPtr& rptr) {
+ static void showValues(std::shared_ptr<Region>& rptr) {
char buf[2048];
if (rptr == nullptr) {
sprintf(buf, "this region does not exist!\n");
diff --git a/cppcache/integration-test/testXmlCacheCreationWithOverFlow.cpp b/cppcache/integration-test/testXmlCacheCreationWithOverFlow.cpp
index 23f7df7..99588dd 100644
--- a/cppcache/integration-test/testXmlCacheCreationWithOverFlow.cpp
+++ b/cppcache/integration-test/testXmlCacheCreationWithOverFlow.cpp
@@ -17,8 +17,8 @@
#define ROOT_NAME "testXmlCacheCreationWithOverFlow"
-#include <geode/GeodeCppCache.hpp>
-
+#include <geode/CacheFactory.hpp>
+#include <geode/Region.hpp>
#include <string>
#include <iostream>
@@ -28,8 +28,8 @@ using namespace apache::geode::client;
int testXmlCacheCreationWithOverflow() {
char* host_name = (char*)"XML_CACHE_CREATION_TEST";
- CacheFactoryPtr cacheFactory;
- CachePtr cptr;
+ std::shared_ptr<CacheFactory> cacheFactory;
+ std::shared_ptr<Cache> cptr;
const uint32_t totalSubRegionsRoot1 = 2;
const uint32_t totalRootRegions = 2;
@@ -97,13 +97,13 @@ int testXmlCacheCreationWithOverflow() {
std::cout << "vc[" << i << "].m_reaPtr=" << vrp.at(i).get() << std::endl;
std::cout << "vc[" << i << "]=" << vrp.at(i)->getName() << std::endl;
}
- RegionPtr regPtr1 = vrp.at(0);
+ auto regPtr1 = vrp.at(0);
uint32_t i ATTR_UNUSED = 0;
std::cout << "Test if the number of sub regions with the root region Root1 are "
"correct"
<< std::endl;
- VectorOfRegion vr = regPtr1->subregions(true);
+ std::vector<std::shared_ptr<Region>> vr = regPtr1->subregions(true);
std::cout << " vr.size=" << vr.size() << std::endl;
if (vr.size() != totalSubRegionsRoot1) {
std::cout << "Number of Subregions does not match" << std::endl;
@@ -120,13 +120,13 @@ int testXmlCacheCreationWithOverflow() {
std::cout << "Test if the nesting of regions is correct" << std::endl;
const char* parentName;
const char* childName;
- RegionPtr regPtr2 = vrp.at(1);
- VectorOfRegion vsr = regPtr2->subregions(true);
+ auto regPtr2 = vrp.at(1);
+ std::vector<std::shared_ptr<Region>> vsr = regPtr2->subregions(true);
for (uint32_t i = 0; i < static_cast<uint32_t>(vsr.size()); i++) {
Region* regPtr = vsr.at(i).get();
childName = regPtr->getName();
- RegionPtr x = regPtr->getParentRegion();
+ auto x = regPtr->getParentRegion();
parentName = (x.get())->getName();
if (strcmp(childName, "SubSubRegion221") == 0) {
if (strcmp(parentName, "SubRegion22") != 0) {
@@ -143,7 +143,7 @@ int testXmlCacheCreationWithOverflow() {
std::cout << "Test the attributes of region" << std::endl;
- RegionAttributesPtr raPtr = regPtr1->getAttributes();
+ std::shared_ptr<RegionAttributes> raPtr = regPtr1->getAttributes();
RegionAttributes* regAttr = raPtr.get();
std::cout << "Attributes of root region Root1 are : " << std::endl;
@@ -191,7 +191,7 @@ int testXmlCacheCreationWithOverflow() {
printf(" persistence function1 = %s\n", libFun);
std::cout << "persistence library = " << regAttr->getPersistenceLibrary() << std::endl;
std::cout << "persistence function = " << regAttr->getPersistenceFactory() << std::endl;
- PropertiesPtr pconfig = regAttr->getPersistenceProperties();
+ auto pconfig = regAttr->getPersistenceProperties();
if (pconfig != nullptr) {
std::cout << " persistence property is not null" << std::endl;
std::cout << " persistencedir = "
@@ -202,14 +202,14 @@ int testXmlCacheCreationWithOverflow() {
}
std::cout << "****Attributes of Root1 are correctly set****" << std::endl;
- RegionAttributesPtr raPtr2 = regPtr2->getAttributes();
+ std::shared_ptr<RegionAttributes> raPtr2 = regPtr2->getAttributes();
const char* lib2 = raPtr2->getPersistenceLibrary();
const char* libFun2 = raPtr2->getPersistenceFactory();
printf(" persistence library2 = %s\n", lib2);
printf(" persistence function2 = %s\n", libFun2);
std::cout << "persistence library = " << raPtr2->getPersistenceLibrary() << std::endl;
std::cout << "persistence function = " << raPtr2->getPersistenceFactory() << std::endl;
- PropertiesPtr pconfig2 = raPtr2->getPersistenceProperties();
+ auto pconfig2 = raPtr2->getPersistenceProperties();
if (pconfig2 != nullptr) {
std::cout << " persistence property is not null for Root2" << std::endl;
std::cout << " persistencedir2 = "
diff --git a/cppcache/integration-test/testXmlCacheCreationWithPools.cpp b/cppcache/integration-test/testXmlCacheCreationWithPools.cpp
index 6ffc6a3..7655bec 100644
--- a/cppcache/integration-test/testXmlCacheCreationWithPools.cpp
+++ b/cppcache/integration-test/testXmlCacheCreationWithPools.cpp
@@ -21,7 +21,6 @@
#include "fw_dunit.hpp"
-#include <geode/GeodeCppCache.hpp>
#include <geode/util/chrono/duration.hpp>
#define CLIENT1 s1p1
@@ -46,7 +45,7 @@ using namespace std;
#define SLIST vector<string>
-bool findString(string& item, CacheableStringArrayPtr array) {
+bool findString(string& item, std::shared_ptr<CacheableStringArray> array) {
for (int size = 0; size < array->length(); size++) {
if (strcmp(item.c_str(), array->operator[](size)->asChar()) == 0) {
return true;
@@ -56,7 +55,8 @@ bool findString(string& item, CacheableStringArrayPtr array) {
return false;
}
-bool checkStringArray(SLIST& first, CacheableStringArrayPtr second) {
+bool checkStringArray(SLIST& first,
+ std::shared_ptr<CacheableStringArray> second) {
if (second == nullptr && first.size() > 0) return false;
if (second == nullptr && first.size() == 0) return true;
@@ -72,9 +72,10 @@ bool checkStringArray(SLIST& first, CacheableStringArrayPtr second) {
return true;
}
-bool checkPoolAttribs(PoolPtr pool, SLIST& locators, SLIST& servers,
- int freeConnectionTimeout, int loadConditioningInterval,
- int minConnections, int maxConnections, int retryAttempts,
+bool checkPoolAttribs(std::shared_ptr<Pool> pool, SLIST& locators,
+ SLIST& servers, int freeConnectionTimeout,
+ int loadConditioningInterval, int minConnections,
+ int maxConnections, int retryAttempts,
std::chrono::milliseconds idleTimeout, int pingInterval,
const char* name, int readTimeout,
const char* serverGroup, int socketBufferSize,
@@ -88,7 +89,7 @@ bool checkPoolAttribs(PoolPtr pool, SLIST& locators, SLIST& servers,
char logmsg[500] = {0};
if (pool == nullptr) {
- LOG("checkPoolAttribs: PoolPtr is nullptr");
+ LOG("checkPoolAttribs: std::shared_ptr<Pool> is nullptr");
return false;
}
@@ -255,8 +256,8 @@ bool checkPoolAttribs(PoolPtr pool, SLIST& locators, SLIST& servers,
int testXmlCacheCreationWithPools() {
char* host_name = (char*)"XML_CACHE_CREATION_TEST";
- CacheFactoryPtr cacheFactory;
- CachePtr cptr;
+ std::shared_ptr<CacheFactory> cacheFactory;
+ std::shared_ptr<Cache> cptr;
std::cout << "create DistributedSytem with name=" << host_name << std::endl;
try {
@@ -305,9 +306,9 @@ int testXmlCacheCreationWithPools() {
std::cout << "vc[" << i << "].m_regionPtr=" << vrp.at(i).get() << std::endl;
std::cout << "vc[" << i << "]=" << vrp.at(i)->getName() << std::endl;
}
- RegionPtr regPtr1 = vrp.at(0);
+ auto regPtr1 = vrp.at(0);
- VectorOfRegion vr = regPtr1->subregions(true);
+ std::vector<std::shared_ptr<Region>> vr = regPtr1->subregions(true);
std::cout << "Test if the number of sub regions with the root region Root1 "
"are correct"
<< std::endl;
@@ -327,9 +328,9 @@ int testXmlCacheCreationWithPools() {
// TODO - global Issue is that we cannot have config with server and locator
// pools. Check if this assumption is valid and if so then break up this test.
- RegionPtr subRegPtr = vr.at(0);
+ auto subRegPtr = vr.at(0);
- RegionPtr regPtr2 = vrp.at(1);
+ auto regPtr2 = vrp.at(1);
std::cout << "Test if the number of sub regions with the root region Root2 "
"are correct"
@@ -363,9 +364,9 @@ int testXmlCacheCreationWithPools() {
return -1;
}
- PoolPtr poolOfReg1 = cptr->getPoolManager().find(poolNameReg1);
- PoolPtr poolOfSubReg = cptr->getPoolManager().find(poolNameSubReg);
- PoolPtr poolOfReg2 = cptr->getPoolManager().find(poolNameReg2);
+ auto poolOfReg1 = cptr->getPoolManager().find(poolNameReg1);
+ auto poolOfSubReg = cptr->getPoolManager().find(poolNameSubReg);
+ auto poolOfReg2 = cptr->getPoolManager().find(poolNameReg2);
SLIST locators;
SLIST servers;
SLIST emptylist;
@@ -477,8 +478,8 @@ int testXmlCacheCreationWithPools() {
int testXmlDeclarativeCacheCreation() {
char* host_name = (char*)"XML_DECLARATIVE_CACHE_CREATION_TEST";
- CacheFactoryPtr cacheFactory;
- CachePtr cptr;
+ std::shared_ptr<CacheFactory> cacheFactory;
+ std::shared_ptr<Cache> cptr;
std::string directory(ACE_OS::getenv("TESTSRC"));
@@ -519,9 +520,9 @@ int testXmlDeclarativeCacheCreation() {
std::cout << "vc[" << i << "].m_reaPtr=" << vrp.at(i).get() << std::endl;
std::cout << "vc[" << i << "]=" << vrp.at(i)->getName() << std::endl;
}
- RegionPtr regPtr1 = vrp.at(0);
+ auto regPtr1 = vrp.at(0);
- RegionAttributesPtr raPtr = regPtr1->getAttributes();
+ std::shared_ptr<RegionAttributes> raPtr = regPtr1->getAttributes();
RegionAttributes* regAttr = raPtr.get();
std::cout << "Test Attributes of root region Root1 " << std::endl;
std::cout << "Region name " << regPtr1->getName() << std::endl;
diff --git a/cppcache/integration-test/testXmlCacheCreationWithRefid.cpp b/cppcache/integration-test/testXmlCacheCreationWithRefid.cpp
index 1d398a8..74fe4ef 100644
--- a/cppcache/integration-test/testXmlCacheCreationWithRefid.cpp
+++ b/cppcache/integration-test/testXmlCacheCreationWithRefid.cpp
@@ -21,7 +21,7 @@
#include <iostream>
#include <math.h>
-#include <geode/GeodeCppCache.hpp>
+#include <geode/CacheFactory.hpp>
#include "fw_helper.hpp"
@@ -29,8 +29,8 @@ using namespace apache::geode::client;
int testXmlCacheCreationWithRefid(const char* fileName) {
char* host_name = (char*)"XML_CACHE_CREATION_TEST";
- CacheFactoryPtr cacheFactory;
- CachePtr cptr;
+ std::shared_ptr<CacheFactory> cacheFactory;
+ std::shared_ptr<Cache> cptr;
char* path = ACE_OS::getenv("TESTSRC");
std::string directory(path);
@@ -63,13 +63,13 @@ int testXmlCacheCreationWithRefid(const char* fileName) {
return -1;
}
- RegionPtr Root1;
- RegionPtr SubRegion1;
- RegionPtr SubRegion11;
- RegionPtr SubRegion2;
+ std::shared_ptr<Region> Root1;
+ std::shared_ptr<Region> SubRegion1;
+ std::shared_ptr<Region> SubRegion11;
+ std::shared_ptr<Region> SubRegion2;
- RegionPtr Root2;
- RegionPtr SubRegion21;
+ std::shared_ptr<Region> Root2;
+ std::shared_ptr<Region> SubRegion21;
std::cout << "Verify whether all the regions are created" << std::endl;
@@ -88,7 +88,7 @@ int testXmlCacheCreationWithRefid(const char* fileName) {
std::cout << "Verify whether region 'SubRegion11' has correct attributes" << std::endl;
- RegionAttributesPtr atts = SubRegion11->getAttributes();
+ auto atts = SubRegion11->getAttributes();
if (atts->getCachingEnabled() != true) {
LOGINFO("Caching is not enabled in SubRegion11");
diff --git a/cppcache/src/AdminRegion.cpp b/cppcache/src/AdminRegion.cpp
index b3cea1b..c386cd3 100644
--- a/cppcache/src/AdminRegion.cpp
+++ b/cppcache/src/AdminRegion.cpp
@@ -24,9 +24,8 @@
namespace apache {
namespace geode {
namespace client {
-
-AdminRegionPtr AdminRegion::create(CacheImpl* cache,
- ThinClientBaseDM* distMan) {
+std::shared_ptr<AdminRegion> AdminRegion::create(CacheImpl* cache,
+ ThinClientBaseDM* distMan) {
auto adminRegion = std::make_shared<AdminRegion>();
auto& props = cache->getDistributedSystem().getSystemProperties();
@@ -66,14 +65,14 @@ TcrConnectionManager* AdminRegion::getConnectionManager() {
return m_connectionMgr;
}
-void AdminRegion::put(const CacheableKeyPtr& keyPtr,
- const CacheablePtr& valuePtr) {
+void AdminRegion::put(const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Cacheable>& valuePtr) {
GfErrType err = putNoThrow(keyPtr, valuePtr);
GfErrTypeToException("AdminRegion::put", err);
}
-GfErrType AdminRegion::putNoThrow(const CacheableKeyPtr& keyPtr,
- const CacheablePtr& valuePtr) {
+GfErrType AdminRegion::putNoThrow(const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Cacheable>& valuePtr) {
// put obj to region
GfErrType err = GF_NOERR;
diff --git a/cppcache/src/AdminRegion.hpp b/cppcache/src/AdminRegion.hpp
index 3efdfdf..d2cc295 100644
--- a/cppcache/src/AdminRegion.hpp
+++ b/cppcache/src/AdminRegion.hpp
@@ -44,6 +44,8 @@ namespace client {
class CacheImpl;
class ThinClientBaseDM;
class TcrConnectionManager;
+class CacheableKey;
+
class AdminRegion : private NonCopyable,
private NonAssignable,
@@ -55,8 +57,8 @@ class AdminRegion : private NonCopyable,
ACE_RW_Thread_Mutex m_rwLock;
bool m_destroyPending;
- GfErrType putNoThrow(const CacheableKeyPtr& keyPtr,
- const CacheablePtr& valuePtr);
+ GfErrType putNoThrow(const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Cacheable>& valuePtr);
TcrConnectionManager* getConnectionManager();
AdminRegion()
@@ -76,11 +78,10 @@ class AdminRegion : private NonCopyable,
const bool& isDestroyed();
void close();
void init();
- void put(const CacheableKeyPtr& keyPtr, const CacheablePtr& valuePtr);
+ void put(const std::shared_ptr<CacheableKey>& keyPtr, const std::shared_ptr<Cacheable>& valuePtr);
friend class apache::geode::statistics::HostStatSampler;
};
-typedef std::shared_ptr<AdminRegion> AdminRegionPtr;
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/AttributesFactory.cpp b/cppcache/src/AttributesFactory.cpp
index d45d193..72a3cea 100644
--- a/cppcache/src/AttributesFactory.cpp
+++ b/cppcache/src/AttributesFactory.cpp
@@ -33,23 +33,26 @@ class Region;
AttributesFactory::AttributesFactory() : m_regionAttributes() {}
AttributesFactory::AttributesFactory(
- const RegionAttributesPtr& regionAttributes)
+ const std::shared_ptr<RegionAttributes>& regionAttributes)
: m_regionAttributes(*regionAttributes) {}
AttributesFactory::~AttributesFactory() {}
-void AttributesFactory::setCacheLoader(const CacheLoaderPtr& cacheLoader) {
+void AttributesFactory::setCacheLoader(
+ const std::shared_ptr<CacheLoader>& cacheLoader) {
m_regionAttributes.m_cacheLoader = cacheLoader;
}
-void AttributesFactory::setCacheWriter(const CacheWriterPtr& cacheWriter) {
+void AttributesFactory::setCacheWriter(
+ const std::shared_ptr<CacheWriter>& cacheWriter) {
m_regionAttributes.m_cacheWriter = cacheWriter;
}
-void AttributesFactory::setCacheListener(const CacheListenerPtr& aListener) {
+void AttributesFactory::setCacheListener(
+ const std::shared_ptr<CacheListener>& aListener) {
m_regionAttributes.m_cacheListener = aListener;
}
void AttributesFactory::setPartitionResolver(
- const PartitionResolverPtr& aResolver) {
+ const std::shared_ptr<PartitionResolver>& aResolver) {
m_regionAttributes.m_partitionResolver = aResolver;
}
@@ -114,7 +117,7 @@ void AttributesFactory::setStatisticsEnabled( bool statisticsEnabled)
*/
std::unique_ptr<RegionAttributes> AttributesFactory::createRegionAttributes() {
- RegionAttributesPtr res;
+ std::shared_ptr<RegionAttributes> res;
validateAttributes(m_regionAttributes);
return std::unique_ptr<RegionAttributes>(
new RegionAttributes(m_regionAttributes));
@@ -178,14 +181,15 @@ void AttributesFactory::setCachingEnabled(bool cachingEnabled) {
}
void AttributesFactory::setPersistenceManager(
- const PersistenceManagerPtr& persistenceManager,
- const PropertiesPtr& props) {
+ const std::shared_ptr<PersistenceManager>& persistenceManager,
+ const std::shared_ptr<Properties>& props) {
m_regionAttributes.m_persistenceManager = persistenceManager;
m_regionAttributes.m_persistenceProperties = props;
}
-void AttributesFactory::setPersistenceManager(const char* lib, const char* func,
- const PropertiesPtr& config) {
+void AttributesFactory::setPersistenceManager(
+ const char* lib, const char* func,
+ const std::shared_ptr<Properties>& config) {
m_regionAttributes.setPersistenceManager(lib, func, config);
}
diff --git a/cppcache/src/AttributesMutator.cpp b/cppcache/src/AttributesMutator.cpp
index dbd5dab..7f866b0 100644
--- a/cppcache/src/AttributesMutator.cpp
+++ b/cppcache/src/AttributesMutator.cpp
@@ -22,7 +22,7 @@ namespace apache {
namespace geode {
namespace client {
-AttributesMutator::AttributesMutator(const RegionPtr& region)
+AttributesMutator::AttributesMutator(const std::shared_ptr<Region>& region)
: m_region(region) {}
AttributesMutator::~AttributesMutator() { m_region = nullptr; }
@@ -80,7 +80,8 @@ uint32_t AttributesMutator::setLruEntriesLimit(uint32_t entriesLimit) {
return rImpl->adjustLruEntriesLimit(entriesLimit);
}
-void AttributesMutator::setCacheListener(const CacheListenerPtr& aListener) {
+void AttributesMutator::setCacheListener(
+ const std::shared_ptr<CacheListener>& aListener) {
RegionInternal* rImpl = dynamic_cast<RegionInternal*>(m_region.get());
rImpl->adjustCacheListener(aListener);
}
@@ -91,7 +92,8 @@ void AttributesMutator::setCacheListener(const char* libpath,
rImpl->adjustCacheListener(libpath, factoryFuncName);
}
-void AttributesMutator::setCacheLoader(const CacheLoaderPtr& aLoader) {
+void AttributesMutator::setCacheLoader(
+ const std::shared_ptr<CacheLoader>& aLoader) {
RegionInternal* rImpl = dynamic_cast<RegionInternal*>(m_region.get());
rImpl->adjustCacheLoader(aLoader);
}
@@ -102,7 +104,8 @@ void AttributesMutator::setCacheLoader(const char* libpath,
rImpl->adjustCacheLoader(libpath, factoryFuncName);
}
-void AttributesMutator::setCacheWriter(const CacheWriterPtr& aWriter) {
+void AttributesMutator::setCacheWriter(
+ const std::shared_ptr<CacheWriter>& aWriter) {
RegionInternal* rImpl = dynamic_cast<RegionInternal*>(m_region.get());
rImpl->adjustCacheWriter(aWriter);
}
diff --git a/cppcache/src/BucketServerLocation.hpp b/cppcache/src/BucketServerLocation.hpp
index 4e9a592..5abf852 100644
--- a/cppcache/src/BucketServerLocation.hpp
+++ b/cppcache/src/BucketServerLocation.hpp
@@ -22,19 +22,16 @@
#include "ServerLocation.hpp"
#include <string>
-
namespace apache {
namespace geode {
namespace client {
-_GF_PTR_DEF_(BucketServerLocation, BucketServerLocationPtr)
-
class BucketServerLocation : public ServerLocation {
private:
int m_bucketId;
bool m_isPrimary;
int8_t m_version;
- CacheableStringArrayPtr m_serverGroups;
+ std::shared_ptr<CacheableStringArray> m_serverGroups;
int8_t m_numServerGroups;
public:
@@ -70,9 +67,9 @@ class BucketServerLocation : public ServerLocation {
m_isPrimary(isPrimary),
m_version(version) {
int32_t size = static_cast<int32_t>(serverGroups.size());
- CacheableStringPtr* ptrArr = nullptr;
+ std::shared_ptr<CacheableString>* ptrArr = nullptr;
if (size > 0) {
- ptrArr = new CacheableStringPtr[size];
+ ptrArr = new std::shared_ptr<CacheableString>[size];
for (int i = 0; i < size; i++) {
ptrArr[i] = CacheableString::create(
serverGroups[i].c_str(),
@@ -116,9 +113,9 @@ class BucketServerLocation : public ServerLocation {
m_isPrimary = input.readBoolean();
m_version = input.read();
m_numServerGroups = input.read();
- CacheableStringPtr* serverGroups = nullptr;
+ std::shared_ptr<CacheableString>* serverGroups = nullptr;
if (m_numServerGroups > 0) {
- serverGroups = new CacheableStringPtr[m_numServerGroups];
+ serverGroups = new std::shared_ptr<CacheableString>[m_numServerGroups];
for (int i = 0; i < m_numServerGroups; i++) {
serverGroups[i] = input.readNativeString();
}
@@ -171,7 +168,7 @@ class BucketServerLocation : public ServerLocation {
this->m_serverGroups = rhs.m_serverGroups;
}
- inline CacheableStringArrayPtr getServerGroups() { return m_serverGroups; }
+ inline std::shared_ptr<CacheableStringArray> getServerGroups() { return m_serverGroups; }
};
} // namespace client
diff --git a/cppcache/src/Cache.cpp b/cppcache/src/Cache.cpp
index 14e7800..40d2142 100644
--- a/cppcache/src/Cache.cpp
+++ b/cppcache/src/Cache.cpp
@@ -86,10 +86,9 @@ void Cache::close(bool keepalive) {
} catch (...) {
}
}
-
-RegionPtr Cache::getRegion(const char* path) {
+std::shared_ptr<Region> Cache::getRegion(const char* path) {
LOGDEBUG("Cache::getRegion");
- RegionPtr result;
+ std::shared_ptr<Region> result;
m_cacheImpl->getRegion(path, result);
if (result != nullptr) {
@@ -114,8 +113,8 @@ RegionPtr Cache::getRegion(const char* path) {
* regions when the function returns
*/
-VectorOfRegion Cache::rootRegions() {
- VectorOfRegion regions;
+std::vector<std::shared_ptr<Region>> Cache::rootRegions() {
+ std::vector<std::shared_ptr<Region>> regions;
m_cacheImpl->rootRegions(regions);
return regions;
}
@@ -123,30 +122,27 @@ VectorOfRegion Cache::rootRegions() {
RegionFactory Cache::createRegionFactory(RegionShortcut preDefinedRegion) {
return m_cacheImpl->createRegionFactory(preDefinedRegion);
}
-
-QueryServicePtr Cache::getQueryService() {
- return m_cacheImpl->getQueryService();
-}
-
-QueryServicePtr Cache::getQueryService(const char* poolName) {
- return m_cacheImpl->getQueryService(poolName);
-}
-
-CacheTransactionManagerPtr Cache::getCacheTransactionManager() {
- return m_cacheImpl->getCacheTransactionManager();
-}
-
-TypeRegistry& Cache::getTypeRegistry() { return *(m_typeRegistry.get()); }
-
-Cache::Cache(const std::string& name, PropertiesPtr dsProp,
- bool ignorePdxUnreadFields, bool readPdxSerialized,
- const AuthInitializePtr& authInitialize) {
- auto dsPtr = DistributedSystem::create(DEFAULT_DS_NAME, this, dsProp);
- dsPtr->connect();
- m_cacheImpl = std::unique_ptr<CacheImpl>(
- new CacheImpl(this, name, std::move(dsPtr), ignorePdxUnreadFields,
- readPdxSerialized, authInitialize));
- m_typeRegistry = std::unique_ptr<TypeRegistry>(new TypeRegistry(*this));
+ std::shared_ptr<QueryService> Cache::getQueryService() {
+ return m_cacheImpl->getQueryService();
+ }
+ std::shared_ptr<QueryService> Cache::getQueryService(const char* poolName) {
+ return m_cacheImpl->getQueryService(poolName);
+ }
+ std::shared_ptr<CacheTransactionManager> Cache::getCacheTransactionManager() {
+ return m_cacheImpl->getCacheTransactionManager();
+ }
+
+ TypeRegistry& Cache::getTypeRegistry() { return *(m_typeRegistry.get()); }
+
+ Cache::Cache(const std::string& name, std::shared_ptr<Properties> dsProp,
+ bool ignorePdxUnreadFields, bool readPdxSerialized,
+ const std::shared_ptr<AuthInitialize>& authInitialize) {
+ auto dsPtr = DistributedSystem::create(DEFAULT_DS_NAME, this, dsProp);
+ dsPtr->connect();
+ m_cacheImpl = std::unique_ptr<CacheImpl>(
+ new CacheImpl(this, name, std::move(dsPtr), ignorePdxUnreadFields,
+ readPdxSerialized, authInitialize));
+ m_typeRegistry = std::unique_ptr<TypeRegistry>(new TypeRegistry(*this));
}
Cache::~Cache() = default;
@@ -176,11 +172,11 @@ void Cache::initializeDeclarativeCache(const char* cacheXml) {
void Cache::readyForEvents() { m_cacheImpl->readyForEvents(); }
-bool Cache::isPoolInMultiuserMode(RegionPtr regionPtr) {
+bool Cache::isPoolInMultiuserMode(std::shared_ptr<Region> regionPtr) {
const char* poolName = regionPtr->getAttributes()->getPoolName();
if (poolName != nullptr) {
- PoolPtr poolPtr = regionPtr->getCache()->getPoolManager().find(poolName);
+ auto poolPtr = regionPtr->getCache()->getPoolManager().find(poolName);
if (poolPtr != nullptr && !poolPtr->isDestroyed()) {
return poolPtr->getMultiuserAuthentication();
}
@@ -195,45 +191,43 @@ bool Cache::getPdxIgnoreUnreadFields() {
bool Cache::getPdxReadSerialized() {
return m_cacheImpl->getPdxReadSerialized();
}
-
-PdxInstanceFactoryPtr Cache::createPdxInstanceFactory(const char* className) {
- return std::make_shared<PdxInstanceFactoryImpl>(
- className, m_cacheImpl->m_cacheStats, m_cacheImpl->getPdxTypeRegistry(),
- this,
- m_cacheImpl->getDistributedSystem()
- .getSystemProperties()
- .getEnableTimeStatistics());
-}
-
-RegionServicePtr Cache::createAuthenticatedView(
- PropertiesPtr userSecurityProperties, const char* poolName) {
- if (poolName == nullptr) {
- auto pool = m_cacheImpl->getPoolManager().getDefaultPool();
- if (!this->isClosed() && pool != nullptr) {
- return pool->createSecureUserCache(userSecurityProperties,
- m_cacheImpl.get());
- }
-
- throw IllegalStateException(
- "Either cache has been closed or there are more than two pool."
- "Pass poolname to get the secure Cache");
- } else {
- if (!this->isClosed()) {
- if (poolName != nullptr) {
- PoolPtr poolPtr = m_cacheImpl->getPoolManager().find(poolName);
- if (poolPtr != nullptr && !poolPtr->isDestroyed()) {
- return poolPtr->createSecureUserCache(userSecurityProperties,
- m_cacheImpl.get());
- }
- throw IllegalStateException(
- "Either pool not found or it has been destroyed");
- }
- throw IllegalArgumentException("poolname is nullptr");
- }
-
- throw IllegalStateException("Cache has been closed");
- }
- return nullptr;
+ std::shared_ptr<PdxInstanceFactory> Cache::createPdxInstanceFactory(const char* className) {
+ return std::make_shared<PdxInstanceFactoryImpl>(
+ className, m_cacheImpl->m_cacheStats, m_cacheImpl->getPdxTypeRegistry(),
+ this,
+ m_cacheImpl->getDistributedSystem()
+ .getSystemProperties()
+ .getEnableTimeStatistics());
+ }
+ std::shared_ptr<RegionService> Cache::createAuthenticatedView(
+ std::shared_ptr<Properties> userSecurityProperties, const char* poolName) {
+ if (poolName == nullptr) {
+ auto pool = m_cacheImpl->getPoolManager().getDefaultPool();
+ if (!this->isClosed() && pool != nullptr) {
+ return pool->createSecureUserCache(userSecurityProperties,
+ m_cacheImpl.get());
+ }
+
+ throw IllegalStateException(
+ "Either cache has been closed or there are more than two pool."
+ "Pass poolname to get the secure Cache");
+ } else {
+ if (!this->isClosed()) {
+ if (poolName != nullptr) {
+ auto poolPtr = m_cacheImpl->getPoolManager().find(poolName);
+ if (poolPtr != nullptr && !poolPtr->isDestroyed()) {
+ return poolPtr->createSecureUserCache(userSecurityProperties,
+ m_cacheImpl.get());
+ }
+ throw IllegalStateException(
+ "Either pool not found or it has been destroyed");
+ }
+ throw IllegalArgumentException("poolname is nullptr");
+ }
+
+ throw IllegalStateException("Cache has been closed");
+ }
+ return nullptr;
}
StatisticsFactory* Cache::getStatisticsFactory() const {
diff --git a/cppcache/src/CacheConfig.hpp b/cppcache/src/CacheConfig.hpp
index c57db3c..f374f64 100644
--- a/cppcache/src/CacheConfig.hpp
+++ b/cppcache/src/CacheConfig.hpp
@@ -51,7 +51,7 @@ namespace apache {
namespace geode {
namespace client {
-typedef std::map<std::string, RegionConfigPtr> RegionConfigMapT;
+typedef std::map<std::string, std::shared_ptr<RegionConfig>> RegionConfigMapT;
class CPPCACHE_EXPORT CacheConfig {
public:
diff --git a/cppcache/src/CacheFactory.cpp b/cppcache/src/CacheFactory.cpp
index cb6e180..abe0058 100644
--- a/cppcache/src/CacheFactory.cpp
+++ b/cppcache/src/CacheFactory.cpp
@@ -50,14 +50,13 @@ extern ACE_Recursive_Thread_Mutex* g_disconnectLock;
namespace apache {
namespace geode {
namespace client {
-
-CacheFactoryPtr CacheFactory::createCacheFactory(
- const PropertiesPtr& configPtr) {
+std::shared_ptr<CacheFactory> CacheFactory::createCacheFactory(
+ const std::shared_ptr<Properties>& configPtr) {
return std::make_shared<CacheFactory>(configPtr);
}
void CacheFactory::create_(const char* name, const char* id_data,
- CachePtr& cptr, bool readPdxSerialized) {
+ std::shared_ptr<Cache>& cptr, bool readPdxSerialized) {
cptr = nullptr;
if (name == nullptr) {
throw IllegalArgumentException("CacheFactory::create: name is nullptr");
@@ -83,54 +82,53 @@ CacheFactory::CacheFactory() {
dsProp = nullptr;
}
-CacheFactory::CacheFactory(const PropertiesPtr dsProps) {
+CacheFactory::CacheFactory(const std::shared_ptr<Properties> dsProps) {
ignorePdxUnreadFields = false;
pdxReadSerialized = false;
this->dsProp = dsProps;
}
+ std::shared_ptr<Cache> CacheFactory::create() {
+ ACE_Guard<ACE_Recursive_Thread_Mutex> connectGuard(*g_disconnectLock);
-CachePtr CacheFactory::create() {
- ACE_Guard<ACE_Recursive_Thread_Mutex> connectGuard(*g_disconnectLock);
-
- LOGFINE("CacheFactory called DistributedSystem::connect");
- auto cache = create(DEFAULT_CACHE_NAME, nullptr);
+ LOGFINE("CacheFactory called DistributedSystem::connect");
+ auto cache = create(DEFAULT_CACHE_NAME, nullptr);
- auto& cacheImpl = cache->m_cacheImpl;
- const auto& serializationRegistry = cacheImpl->getSerializationRegistry();
- const auto& pdxTypeRegistry = cacheImpl->getPdxTypeRegistry();
- const auto& memberListForVersionStamp =
- std::ref(*(cacheImpl->getMemberListForVersionStamp()));
+ auto& cacheImpl = cache->m_cacheImpl;
+ const auto& serializationRegistry = cacheImpl->getSerializationRegistry();
+ const auto& pdxTypeRegistry = cacheImpl->getPdxTypeRegistry();
+ const auto& memberListForVersionStamp =
+ std::ref(*(cacheImpl->getMemberListForVersionStamp()));
- serializationRegistry->addType2(
- std::bind(TXCommitMessage::create, memberListForVersionStamp));
+ serializationRegistry->addType2(
+ std::bind(TXCommitMessage::create, memberListForVersionStamp));
- serializationRegistry->addType(
- GeodeTypeIds::PdxType,
- std::bind(PdxType::CreateDeserializable, pdxTypeRegistry));
+ serializationRegistry->addType(
+ GeodeTypeIds::PdxType,
+ std::bind(PdxType::CreateDeserializable, pdxTypeRegistry));
- serializationRegistry->addType(
- std::bind(VersionTag::createDeserializable, memberListForVersionStamp));
+ serializationRegistry->addType(
+ std::bind(VersionTag::createDeserializable, memberListForVersionStamp));
- serializationRegistry->addType2(
- GeodeTypeIdsImpl::DiskVersionTag,
- std::bind(DiskVersionTag::createDeserializable,
- memberListForVersionStamp));
+ serializationRegistry->addType2(
+ GeodeTypeIdsImpl::DiskVersionTag,
+ std::bind(DiskVersionTag::createDeserializable,
+ memberListForVersionStamp));
- serializationRegistry->setPdxTypeHandler([](DataInput& dataInput) {
- return PdxHelper::deserializePdx(dataInput, false);
- });
+ serializationRegistry->setPdxTypeHandler([](DataInput& dataInput) {
+ return PdxHelper::deserializePdx(dataInput, false);
+ });
- pdxTypeRegistry->setPdxIgnoreUnreadFields(cache->getPdxIgnoreUnreadFields());
- pdxTypeRegistry->setPdxReadSerialized(cache->getPdxReadSerialized());
+ pdxTypeRegistry->setPdxIgnoreUnreadFields(cache->getPdxIgnoreUnreadFields());
+ pdxTypeRegistry->setPdxReadSerialized(cache->getPdxReadSerialized());
- return cache;
+ return cache;
}
-
-CachePtr CacheFactory::create(const char* name,
- const CacheAttributesPtr& attrs /*= nullptr*/) {
+std::shared_ptr<Cache> CacheFactory::create(
+ const char* name,
+ const std::shared_ptr<CacheAttributes>& attrs /*= nullptr*/) {
ACE_Guard<ACE_Recursive_Thread_Mutex> connectGuard(*g_disconnectLock);
- CachePtr cptr;
+ std::shared_ptr<Cache> cptr;
create_(name, "", cptr, pdxReadSerialized);
cptr->m_cacheImpl->setAttributes(attrs);
try {
@@ -162,27 +160,24 @@ CachePtr CacheFactory::create(const char* name,
}
CacheFactory::~CacheFactory() {}
-
-CacheFactoryPtr CacheFactory::set(const char* name, const char* value) {
+ std::shared_ptr<CacheFactory> CacheFactory::set(const char* name, const char* value) {
if (this->dsProp == nullptr) {
this->dsProp = Properties::create();
}
this->dsProp->insert(name, value);
return shared_from_this();
}
-
-CacheFactoryPtr CacheFactory::setAuthInitialize(
- const AuthInitializePtr& handler) {
+ std::shared_ptr<CacheFactory> CacheFactory::setAuthInitialize(
+ const std::shared_ptr<AuthInitialize>& handler) {
this->authInitialize = handler;
return shared_from_this();
+ }
+ std::shared_ptr<CacheFactory> CacheFactory::setPdxIgnoreUnreadFields(
+ bool ignore) {
+ ignorePdxUnreadFields = ignore;
+ return shared_from_this();
}
-
-CacheFactoryPtr CacheFactory::setPdxIgnoreUnreadFields(bool ignore) {
- ignorePdxUnreadFields = ignore;
- return shared_from_this();
-}
-
-CacheFactoryPtr CacheFactory::setPdxReadSerialized(bool prs) {
+std::shared_ptr<CacheFactory> CacheFactory::setPdxReadSerialized(bool prs) {
pdxReadSerialized = prs;
return shared_from_this();
}
diff --git a/cppcache/src/CacheImpl.cpp b/cppcache/src/CacheImpl.cpp
index bd09521..a897fec 100644
--- a/cppcache/src/CacheImpl.cpp
+++ b/cppcache/src/CacheImpl.cpp
@@ -49,7 +49,7 @@ using namespace apache::geode::client;
CacheImpl::CacheImpl(Cache* c, const std::string& name,
std::unique_ptr<DistributedSystem> sys, bool iPUF,
bool readPdxSerialized,
- const AuthInitializePtr& authInitialize)
+ const std::shared_ptr<AuthInitialize>& authInitialize)
: m_name(name),
m_defaultPool(nullptr),
m_ignorePdxUnreadFields(iPUF),
@@ -76,7 +76,7 @@ CacheImpl::CacheImpl(Cache* c, const std::string& name,
m_threadPool(new ThreadPool(
m_distributedSystem->getSystemProperties().threadPoolSize())),
m_authInitialize(authInitialize) {
- m_cacheTXManager = InternalCacheTransactionManager2PCPtr(
+ m_cacheTXManager = std::shared_ptr<InternalCacheTransactionManager2PC>(
new InternalCacheTransactionManager2PCImpl(c));
m_regions = new MapOfRegionWithLock();
@@ -132,7 +132,7 @@ void CacheImpl::netDown() {
void CacheImpl::revive() { m_tcrConnectionManager->revive(); }
CacheImpl::RegionKind CacheImpl::getRegionKind(
- const RegionAttributesPtr& rattrs) const {
+ const std::shared_ptr<RegionAttributes>& rattrs) const {
RegionKind regionKind = CPP_REGION;
const char* endpoints = nullptr;
@@ -152,7 +152,7 @@ CacheImpl::RegionKind CacheImpl::getRegionKind(
regionKind = THINCLIENT_REGION;
}
} else if (rattrs->getPoolName()) {
- PoolPtr pPtr = getCache()->getPoolManager().find(rattrs->getPoolName());
+ auto pPtr = getCache()->getPoolManager().find(rattrs->getPoolName());
if ((pPtr != nullptr && (pPtr->getSubscriptionRedundancy() > 0 ||
pPtr->getSubscriptionEnabled())) ||
m_tcrConnectionManager->isDurable()) {
@@ -175,8 +175,7 @@ int CacheImpl::removeRegion(const char* name) {
MapOfRegionGuard guard(m_regions->mutex());
return m_regions->unbind(name);
}
-
-QueryServicePtr CacheImpl::getQueryService(bool noInit) {
+std::shared_ptr<QueryService> CacheImpl::getQueryService(bool noInit) {
if (m_defaultPool != nullptr) {
if (m_defaultPool->isDestroyed()) {
throw IllegalStateException("Pool has been destroyed.");
@@ -193,20 +192,19 @@ QueryServicePtr CacheImpl::getQueryService(bool noInit) {
}
return m_remoteQueryServicePtr;
}
-
-QueryServicePtr CacheImpl::getQueryService(const char* poolName) {
- if (poolName == nullptr || strlen(poolName) == 0) {
- throw IllegalArgumentException("PoolName is nullptr or not defined..");
- }
- PoolPtr pool = getCache()->getPoolManager().find(poolName);
-
- if (pool != nullptr) {
- if (pool->isDestroyed()) {
- throw IllegalStateException("Pool has been destroyed.");
- }
- return pool->getQueryService();
- } else {
- throw IllegalArgumentException("Pool not found..");
+ std::shared_ptr<QueryService> CacheImpl::getQueryService(const char* poolName) {
+ if (poolName == nullptr || strlen(poolName) == 0) {
+ throw IllegalArgumentException("PoolName is nullptr or not defined..");
+ }
+ auto pool = getCache()->getPoolManager().find(poolName);
+
+ if (pool != nullptr) {
+ if (pool->isDestroyed()) {
+ throw IllegalStateException("Pool has been destroyed.");
+ }
+ return pool->getQueryService();
+ } else {
+ throw IllegalArgumentException("Pool not found..");
}
}
@@ -229,7 +227,7 @@ const std::string& CacheImpl::getName() const {
bool CacheImpl::isClosed() const { return m_closed; }
-void CacheImpl::setAttributes(const CacheAttributesPtr& attrs) {
+void CacheImpl::setAttributes(const std::shared_ptr<CacheAttributes>& attrs) {
if (m_attributes == nullptr && attrs != nullptr) {
m_attributes = attrs;
}
@@ -290,13 +288,12 @@ void CacheImpl::close(bool keepalive) {
++q) {
// TODO: remove dynamic_cast here by having RegionInternal in the regions
// map
- RegionInternalPtr rImpl =
+ auto rImpl =
std::dynamic_pointer_cast<RegionInternal>((*q).int_id_);
- if (rImpl != nullptr) {
- rImpl->destroyRegionNoThrow(
- nullptr, false,
- CacheEventFlags::LOCAL | CacheEventFlags::CACHE_CLOSE);
- }
+ if (rImpl != nullptr) {
+ rImpl->destroyRegionNoThrow(
+ nullptr, false, CacheEventFlags::LOCAL | CacheEventFlags::CACHE_CLOSE);
+ }
}
if (m_evictionControllerPtr != nullptr) {
@@ -335,7 +332,7 @@ void CacheImpl::close(bool keepalive) {
bool CacheImpl::isCacheDestroyPending() const { return m_destroyPending; }
void CacheImpl::validateRegionAttributes(
- const char* name, const RegionAttributesPtr& attrs) const {
+ const char* name, const std::shared_ptr<RegionAttributes>& attrs) const {
RegionKind kind = getRegionKind(attrs);
std::string buffer = "Cache::createRegion: \"";
buffer += name;
@@ -352,8 +349,8 @@ void CacheImpl::validateRegionAttributes(
// do a load using a real C++ loader, instead of passing a member function
// pointer here
void CacheImpl::createRegion(const char* name,
- const RegionAttributesPtr& aRegionAttributes,
- RegionPtr& regionPtr) {
+ const std::shared_ptr<RegionAttributes>& aRegionAttributes,
+ std::shared_ptr<Region>& regionPtr) {
{
ACE_Guard<ACE_Thread_Mutex> _guard(m_initDoneLock);
if (!m_initDone) {
@@ -384,13 +381,13 @@ void CacheImpl::createRegion(const char* name,
}
validateRegionAttributes(name, aRegionAttributes);
- RegionInternalPtr rpImpl = nullptr;
+std::shared_ptr<RegionInternal> rpImpl = nullptr;
{
// For multi threading and the operations between bind and find seems to be
// hard to be atomic since a regionImpl needs to be valid before it can be
// bound
MapOfRegionGuard guard1(m_regions->mutex());
- RegionPtr tmp;
+ std::shared_ptr<Region> tmp;
if (0 == m_regions->find(namestr, tmp)) {
char buffer[256];
ACE_OS::snprintf(
@@ -439,12 +436,12 @@ void CacheImpl::createRegion(const char* name,
rpImpl->addDisMessToQueue();
// Instantiate a PersistenceManager object if DiskPolicy is overflow
if (aRegionAttributes->getDiskPolicy() == DiskPolicyType::OVERFLOWS) {
- PersistenceManagerPtr pmPtr = aRegionAttributes->getPersistenceManager();
+ auto pmPtr = aRegionAttributes->getPersistenceManager();
if (pmPtr == nullptr) {
throw NullPointerException(
"PersistenceManager could not be instantiated");
}
- PropertiesPtr props = aRegionAttributes->getPersistenceProperties();
+ auto props = aRegionAttributes->getPersistenceProperties();
pmPtr->init(regionPtr, props);
rpImpl->setPersistenceManager(pmPtr);
}
@@ -459,21 +456,20 @@ void CacheImpl::createRegion(const char* name,
if (!props.isGridClient()) {
const char* poolName = aRegionAttributes->getPoolName();
if (poolName != nullptr) {
- PoolPtr pool = getCache()->getPoolManager().find(poolName);
- if (pool != nullptr && !pool->isDestroyed() &&
- pool->getPRSingleHopEnabled()) {
- ThinClientPoolDM* poolDM =
- dynamic_cast<ThinClientPoolDM*>(pool.get());
- if ((poolDM != nullptr) &&
- (poolDM->getClientMetaDataService() != nullptr)) {
- LOGFINE(
- "enqueued region %s for initial metadata refresh for "
- "singlehop ",
- name);
- poolDM->getClientMetaDataService()->enqueueForMetadataRefresh(
- regionPtr->getFullPath(), 0);
- }
- }
+ auto pool = getCache()->getPoolManager().find(poolName);
+ if (pool != nullptr && !pool->isDestroyed() &&
+ pool->getPRSingleHopEnabled()) {
+ ThinClientPoolDM* poolDM = dynamic_cast<ThinClientPoolDM*>(pool.get());
+ if ((poolDM != nullptr) &&
+ (poolDM->getClientMetaDataService() != nullptr)) {
+ LOGFINE(
+ "enqueued region %s for initial metadata refresh for "
+ "singlehop ",
+ name);
+ poolDM->getClientMetaDataService()->enqueueForMetadataRefresh(
+ regionPtr->getFullPath(), 0);
+ }
+ }
}
}
}
@@ -497,7 +493,7 @@ void CacheImpl::createRegion(const char* name,
* @throws IllegalArgumentException if path is null, the empty string, or "/"
*/
-void CacheImpl::getRegion(const char* path, RegionPtr& rptr) {
+void CacheImpl::getRegion(const char* path, std::shared_ptr<Region>& rptr) {
TryReadGuard guardCacheDestroy(m_destroyCacheMutex, m_destroyPending);
if (m_destroyPending) {
rptr = nullptr;
@@ -523,7 +519,7 @@ void CacheImpl::getRegion(const char* path, RegionPtr& rptr) {
// find second separator
uint32_t idx = static_cast<uint32_t>(fullname.find('/'));
std::string stepname = fullname.substr(0, idx);
- RegionPtr region;
+ std::shared_ptr<Region> region;
if (0 == m_regions->find(stepname, region)) {
if (stepname == fullname) {
// done...
@@ -542,7 +538,7 @@ void CacheImpl::getRegion(const char* path, RegionPtr& rptr) {
std::shared_ptr<RegionInternal> CacheImpl::createRegion_internal(
const std::string& name, const std::shared_ptr<RegionInternal>& rootRegion,
- const RegionAttributesPtr& attrs, const CacheStatisticsPtr& csptr,
+ const std::shared_ptr<RegionAttributes>& attrs, const std::shared_ptr<CacheStatistics>& csptr,
bool shared) {
if (attrs == nullptr) {
throw IllegalArgumentException(
@@ -550,7 +546,7 @@ std::shared_ptr<RegionInternal> CacheImpl::createRegion_internal(
"RegionAttributes is null");
}
- RegionInternalPtr rptr = nullptr;
+std::shared_ptr<RegionInternal> rptr = nullptr;
RegionKind regionKind = getRegionKind(attrs);
const char* poolName = attrs->getPoolName();
const char* regionEndpoints = attrs->getEndpoints();
@@ -564,7 +560,7 @@ std::shared_ptr<RegionInternal> CacheImpl::createRegion_internal(
}*/
if (poolName != nullptr) {
- PoolPtr pool = getCache()->getPoolManager().find(poolName);
+ auto pool = getCache()->getPoolManager().find(poolName);
if (pool != nullptr && !pool->isDestroyed()) {
bool isMultiUserSecureMode = pool->getMultiuserAuthentication();
if (isMultiUserSecureMode && (attrs->getCachingEnabled())) {
@@ -619,7 +615,7 @@ std::shared_ptr<RegionInternal> CacheImpl::createRegion_internal(
return rptr;
}
-void CacheImpl::rootRegions(VectorOfRegion& regions) {
+void CacheImpl::rootRegions(std::vector<std::shared_ptr<Region>>& regions) {
regions.clear();
MapOfRegionGuard guard(m_regions->mutex());
if (m_regions->current_size() == 0) return;
@@ -743,8 +739,8 @@ RegionFactory CacheImpl::createRegionFactory(RegionShortcut preDefinedRegion) {
return RegionFactory(preDefinedRegion, this);
}
-std::map<std::string, RegionAttributesPtr> CacheImpl::getRegionShortcut() {
- std::map<std::string, RegionAttributesPtr> preDefined;
+std::map<std::string, std::shared_ptr<RegionAttributes>> CacheImpl::getRegionShortcut() {
+ std::map<std::string, std::shared_ptr<RegionAttributes>> preDefined;
{
// PROXY
@@ -783,21 +779,19 @@ std::map<std::string, RegionAttributesPtr> CacheImpl::getRegionShortcut() {
return preDefined;
}
-
-PdxTypeRegistryPtr CacheImpl::getPdxTypeRegistry() const {
+ std::shared_ptr<PdxTypeRegistry> CacheImpl::getPdxTypeRegistry() const {
return m_pdxTypeRegistry;
-}
-
-SerializationRegistryPtr CacheImpl::getSerializationRegistry() const {
- return m_serializationRegistry;
+ }
+ std::shared_ptr<SerializationRegistry> CacheImpl::getSerializationRegistry()
+ const {
+ return m_serializationRegistry;
}
ThreadPool* CacheImpl::getThreadPool() { return m_threadPool; }
-
-CacheTransactionManagerPtr CacheImpl::getCacheTransactionManager() {
+std::shared_ptr<CacheTransactionManager>
+CacheImpl::getCacheTransactionManager() {
return m_cacheTXManager;
-}
-MemberListForVersionStampPtr CacheImpl::getMemberListForVersionStamp() {
+} std::shared_ptr<MemberListForVersionStamp> CacheImpl::getMemberListForVersionStamp() {
static auto versionStampMemIdList =
new std::shared_ptr<MemberListForVersionStamp>(
new MemberListForVersionStamp());
diff --git a/cppcache/src/CacheImpl.hpp b/cppcache/src/CacheImpl.hpp
index d830f7c..614d98c 100644
--- a/cppcache/src/CacheImpl.hpp
+++ b/cppcache/src/CacheImpl.hpp
@@ -65,7 +65,6 @@ class CacheFactory;
class ExpiryTaskManager;
class PdxTypeRegistry;
class SerializationRegistry;
-typedef std::shared_ptr<SerializationRegistry> SerializationRegistryPtr;
/**
* @class Cache Cache.hpp
@@ -114,7 +113,7 @@ class CPPCACHE_EXPORT CacheImpl : private NonCopyable, private NonAssignable {
m_serverGroupFlag = serverGroupFlag;
}
- MemberListForVersionStampPtr getMemberListForVersionStamp();
+ std::shared_ptr<MemberListForVersionStamp> getMemberListForVersionStamp();
/** Returns the name of this cache.
* @return the string name of this cache
@@ -132,10 +131,10 @@ class CPPCACHE_EXPORT CacheImpl : private NonCopyable, private NonAssignable {
bool isClosed() const;
/** Get the <code>CacheAttributes</code> for this cache. */
- inline CacheAttributesPtr getAttributes() const { return m_attributes; }
+ inline std::shared_ptr<CacheAttributes> getAttributes() const { return m_attributes; }
/** Set the <code>CacheAttributes</code> for this cache. */
- void setAttributes(const CacheAttributesPtr& attrs);
+ void setAttributes(const std::shared_ptr<CacheAttributes>& attrs);
/**
* Returns the distributed system that this cache was
@@ -171,10 +170,10 @@ class CPPCACHE_EXPORT CacheImpl : private NonCopyable, private NonAssignable {
* @throws UnknownException otherwise
*/
void createRegion(const char* name,
- const RegionAttributesPtr& aRegionAttributes,
- RegionPtr& regionPtr);
+ const std::shared_ptr<RegionAttributes>& aRegionAttributes,
+ std::shared_ptr<Region>& regionPtr);
- void getRegion(const char* path, RegionPtr& rptr);
+ void getRegion(const char* path, std::shared_ptr<Region>& rptr);
/**
* Returns a set of root regions in the cache. Does not cause any
@@ -185,7 +184,7 @@ class CPPCACHE_EXPORT CacheImpl : private NonCopyable, private NonAssignable {
* regions when the function returns
*/
- void rootRegions(VectorOfRegion& regions);
+ void rootRegions(std::vector<std::shared_ptr<Region>>& regions);
/**
* FUTURE: not used currently. Gets the number of seconds a cache
@@ -205,7 +204,7 @@ class CPPCACHE_EXPORT CacheImpl : private NonCopyable, private NonAssignable {
virtual RegionFactory createRegionFactory(RegionShortcut preDefinedRegion);
- CacheTransactionManagerPtr getCacheTransactionManager();
+ std::shared_ptr<CacheTransactionManager> getCacheTransactionManager();
/**
* @brief destructor
@@ -216,7 +215,7 @@ class CPPCACHE_EXPORT CacheImpl : private NonCopyable, private NonAssignable {
*/
CacheImpl(Cache* c, const std::string& name,
std::unique_ptr<DistributedSystem> sys, bool ignorePdxUnreadFields,
- bool readPdxSerialized, const AuthInitializePtr& authInitialize);
+ bool readPdxSerialized, const std::shared_ptr<AuthInitialize>& authInitialize);
void initServices();
EvictionController* getEvictionController();
@@ -234,15 +233,15 @@ class CPPCACHE_EXPORT CacheImpl : private NonCopyable, private NonAssignable {
int removeRegion(const char* name);
- QueryServicePtr getQueryService(bool noInit = false);
+ std::shared_ptr<QueryService> getQueryService(bool noInit = false);
- QueryServicePtr getQueryService(const char* poolName);
+ std::shared_ptr<QueryService> getQueryService(const char* poolName);
std::shared_ptr<RegionInternal> createRegion_internal(
const std::string& name,
const std::shared_ptr<RegionInternal>& rootRegion,
- const RegionAttributesPtr& attrs, const CacheStatisticsPtr& csptr,
- bool shared);
+ const std::shared_ptr<RegionAttributes>& attrs,
+ const std::shared_ptr<CacheStatistics>& csptr, bool shared);
/**
* Send the "client ready" message to the server.
@@ -271,18 +270,18 @@ class CPPCACHE_EXPORT CacheImpl : private NonCopyable, private NonAssignable {
bool getPdxReadSerialized() { return m_readPdxSerialized; }
bool isCacheDestroyPending() const;
- static std::map<std::string, RegionAttributesPtr> getRegionShortcut();
+ static std::map<std::string, std::shared_ptr<RegionAttributes>> getRegionShortcut();
- PdxTypeRegistryPtr getPdxTypeRegistry() const;
+ std::shared_ptr<PdxTypeRegistry> getPdxTypeRegistry() const;
- SerializationRegistryPtr getSerializationRegistry() const;
+ std::shared_ptr<SerializationRegistry> getSerializationRegistry() const;
inline CachePerfStats& getCachePerfStats() { return *m_cacheStats; }
PoolManager& getPoolManager() { return *m_poolManager; }
ThreadPool* getThreadPool();
- inline const AuthInitializePtr& getAuthInitialize() {
+ inline const std::shared_ptr<AuthInitialize>& getAuthInitialize() {
return m_authInitialize;
}
@@ -290,7 +289,7 @@ class CPPCACHE_EXPORT CacheImpl : private NonCopyable, private NonAssignable {
std::atomic<bool> m_networkhop;
std::atomic<int> m_blacklistBucketTimeout;
std::atomic<int8_t> m_serverGroupFlag;
- PoolPtr m_defaultPool;
+ std::shared_ptr<Pool> m_defaultPool;
bool m_ignorePdxUnreadFields;
bool m_readPdxSerialized;
std::unique_ptr<ExpiryTaskManager> m_expiryTaskManager;
@@ -307,12 +306,12 @@ class CPPCACHE_EXPORT CacheImpl : private NonCopyable, private NonAssignable {
THINCLIENT_POOL_REGION
};
- RegionKind getRegionKind(const RegionAttributesPtr& rattrs) const;
+ RegionKind getRegionKind(const std::shared_ptr<RegionAttributes>& rattrs) const;
void sendNotificationCloseMsgs();
void validateRegionAttributes(const char* name,
- const RegionAttributesPtr& attrs) const;
+ const std::shared_ptr<RegionAttributes>& attrs) const;
inline void getSubRegions(MapOfRegionWithLock& srm) {
MapOfRegionGuard guard(m_regions->mutex());
@@ -332,22 +331,22 @@ class CPPCACHE_EXPORT CacheImpl : private NonCopyable, private NonAssignable {
Cache* m_implementee;
ACE_Recursive_Thread_Mutex m_mutex;
Condition m_cond;
- CacheAttributesPtr m_attributes;
+ std::shared_ptr<CacheAttributes> m_attributes;
EvictionController* m_evictionControllerPtr;
TcrConnectionManager* m_tcrConnectionManager;
- RemoteQueryServicePtr m_remoteQueryServicePtr;
+ std::shared_ptr<RemoteQueryService> m_remoteQueryServicePtr;
ACE_RW_Thread_Mutex m_destroyCacheMutex;
volatile bool m_destroyPending;
volatile bool m_initDone;
ACE_Thread_Mutex m_initDoneLock;
- AdminRegionPtr m_adminRegion;
- CacheTransactionManagerPtr m_cacheTXManager;
+ std::shared_ptr<AdminRegion> m_adminRegion;
+ std::shared_ptr<CacheTransactionManager> m_cacheTXManager;
MemberListForVersionStamp& m_memberListForVersionStamp;
- SerializationRegistryPtr m_serializationRegistry;
- PdxTypeRegistryPtr m_pdxTypeRegistry;
+ std::shared_ptr<SerializationRegistry> m_serializationRegistry;
+ std::shared_ptr<PdxTypeRegistry> m_pdxTypeRegistry;
ThreadPool* m_threadPool;
- const AuthInitializePtr m_authInitialize;
+ const std::shared_ptr<AuthInitialize> m_authInitialize;
friend class CacheFactory;
friend class Cache;
diff --git a/cppcache/src/CacheListener.cpp b/cppcache/src/CacheListener.cpp
index 86284e3..ff55208 100644
--- a/cppcache/src/CacheListener.cpp
+++ b/cppcache/src/CacheListener.cpp
@@ -28,7 +28,7 @@ CacheListener::CacheListener() {}
CacheListener::~CacheListener() {}
-void CacheListener::close(const RegionPtr& region) {}
+void CacheListener::close(const std::shared_ptr<Region>& region) {}
void CacheListener::afterCreate(const EntryEvent& event) {}
@@ -46,7 +46,8 @@ void CacheListener::afterRegionClear(const RegionEvent& event) {}
void CacheListener::afterRegionLive(const RegionEvent& event) {}
-void CacheListener::afterRegionDisconnected(const RegionPtr& region) {}
+void CacheListener::afterRegionDisconnected(
+ const std::shared_ptr<Region>& region) {}
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/CacheLoader.cpp b/cppcache/src/CacheLoader.cpp
index d8d3efb..4bc9c71 100644
--- a/cppcache/src/CacheLoader.cpp
+++ b/cppcache/src/CacheLoader.cpp
@@ -26,4 +26,4 @@ CacheLoader::CacheLoader() {}
CacheLoader::~CacheLoader() {}
-void CacheLoader::close(const RegionPtr& rp) {}
+void CacheLoader::close(const std::shared_ptr<Region>& rp) {}
diff --git a/cppcache/src/CacheTransactionManagerImpl.cpp b/cppcache/src/CacheTransactionManagerImpl.cpp
index 28bf287..ecf5594 100644
--- a/cppcache/src/CacheTransactionManagerImpl.cpp
+++ b/cppcache/src/CacheTransactionManagerImpl.cpp
@@ -113,8 +113,7 @@ void CacheTransactionManagerImpl::commit() {
}
}
- TXCommitMessagePtr commit =
- std::static_pointer_cast<TXCommitMessage>(reply.getValue());
+ auto commit = std::static_pointer_cast<TXCommitMessage>(reply.getValue());
txCleaner.clean();
commit->apply(m_cache);
@@ -123,9 +122,9 @@ void CacheTransactionManagerImpl::commit() {
{
try
{
- TransactionEventPtr event(new
- TransactionEvent(txState->getTransactionId(), CachePtr(m_cache),
- commit->getEvents(m_cache)));
+ std::shared_ptr<TransactionEvent> event(new
+ TransactionEvent(txState->getTransactionId(),
+ std::shared_ptr<Cache>(m_cache), commit->getEvents(m_cache)));
m_writer->beforeCommit(event);
} catch(const TransactionWriterException& ex)
{
@@ -307,7 +306,7 @@ GfErrType CacheTransactionManagerImpl::rollback(TXState* txState,
/* if(err == GF_NOERR && callListener)
{
- // TXCommitMessagePtr commit =
+ // auto commit =
std::static_pointer_cast<TXCommitMessage>(reply.getValue());
noteRollbackSuccess(txState, nullptr);
}
@@ -328,8 +327,7 @@ ThinClientPoolDM* CacheTransactionManagerImpl::getDM() {
}
Cache* CacheTransactionManagerImpl::getCache() { return m_cache; }
-
-TransactionIdPtr CacheTransactionManagerImpl::suspend() {
+std::shared_ptr<TransactionId> CacheTransactionManagerImpl::suspend() {
// get the current state of the thread
TXState* txState = TSSTXStateWrapper::s_geodeTSSTXState->getTXState();
if (txState == nullptr) {
@@ -382,7 +380,7 @@ TransactionIdPtr CacheTransactionManagerImpl::suspend() {
return txState->getTransactionId();
}
-void CacheTransactionManagerImpl::resume(TransactionIdPtr transactionId) {
+void CacheTransactionManagerImpl::resume(std::shared_ptr<TransactionId> transactionId) {
// get the current state of the thread
if (TSSTXStateWrapper::s_geodeTSSTXState->getTXState() != nullptr) {
GfErrTypeThrowException("A transaction is already in progress",
@@ -401,15 +399,15 @@ void CacheTransactionManagerImpl::resume(TransactionIdPtr transactionId) {
resumeTxUsingTxState(txState);
}
-bool CacheTransactionManagerImpl::isSuspended(TransactionIdPtr transactionId) {
+bool CacheTransactionManagerImpl::isSuspended(std::shared_ptr<TransactionId> transactionId) {
return isSuspendedTx(
(std::static_pointer_cast<TXId>(transactionId))->getId());
}
-bool CacheTransactionManagerImpl::tryResume(TransactionIdPtr transactionId) {
+bool CacheTransactionManagerImpl::tryResume(std::shared_ptr<TransactionId> transactionId) {
return tryResume(transactionId, true);
}
-bool CacheTransactionManagerImpl::tryResume(TransactionIdPtr transactionId,
- bool cancelExpiryTask) {
+bool CacheTransactionManagerImpl::tryResume(
+ std::shared_ptr<TransactionId> transactionId, bool cancelExpiryTask) {
// get the current state of the thread
if (TSSTXStateWrapper::s_geodeTSSTXState->getTXState() != nullptr) {
LOGFINE("A transaction is already in progress. Cannot resume transaction.");
@@ -426,7 +424,7 @@ bool CacheTransactionManagerImpl::tryResume(TransactionIdPtr transactionId,
}
bool CacheTransactionManagerImpl::tryResume(
- TransactionIdPtr transactionId, std::chrono::milliseconds waitTime) {
+ std::shared_ptr<TransactionId> transactionId, std::chrono::milliseconds waitTime) {
// get the current state of the thread
if (TSSTXStateWrapper::s_geodeTSSTXState->getTXState() != nullptr) {
LOGFINE("A transaction is already in progress. Cannot resume transaction.");
@@ -484,7 +482,7 @@ void CacheTransactionManagerImpl::resumeTxUsingTxState(TXState* txState,
}
}
-bool CacheTransactionManagerImpl::exists(TransactionIdPtr transactionId) {
+bool CacheTransactionManagerImpl::exists(std::shared_ptr<TransactionId> transactionId) {
return findTx((std::static_pointer_cast<TXId>(transactionId))->getId());
}
@@ -571,8 +569,7 @@ bool CacheTransactionManagerImpl::isSuspendedTx(int32_t txId) {
} else {
return true;
}
-}
-TransactionIdPtr CacheTransactionManagerImpl::getTransactionId() {
+} std::shared_ptr<TransactionId> CacheTransactionManagerImpl::getTransactionId() {
TXState* txState = TSSTXStateWrapper::s_geodeTSSTXState->getTXState();
if (txState == nullptr) {
return nullptr;
@@ -581,18 +578,20 @@ TransactionIdPtr CacheTransactionManagerImpl::getTransactionId() {
}
}
/*
-void CacheTransactionManagerImpl::setWriter(TransactionWriterPtr writer)
+void CacheTransactionManagerImpl::setWriter(std::shared_ptr<TransactionWriter>
+writer)
{
m_writer = writer;
}
-
-TransactionWriterPtr CacheTransactionManagerImpl::getWriter()
+ std::shared_ptr<TransactionWriter> CacheTransactionManagerImpl::getWriter()
{
return m_writer;
}
-void CacheTransactionManagerImpl::addListener(TransactionListenerPtr aListener)
+void
+CacheTransactionManagerImpl::addListener(std::shared_ptr<TransactionListener>
+aListener)
{
if(aListener == nullptr)
{
@@ -605,7 +604,8 @@ GF_CACHE_ILLEGAL_ARGUMENT_EXCEPTION);
}
}
-void CacheTransactionManagerImpl::removeListener(TransactionListenerPtr
+void
+CacheTransactionManagerImpl::removeListener(std::shared_ptr<TransactionListener>
aListener)
{
if(aListener == nullptr)
@@ -620,60 +620,63 @@ GF_CACHE_ILLEGAL_ARGUMENT_EXCEPTION);
}
void CacheTransactionManagerImpl::noteCommitFailure(TXState* txState, const
-TXCommitMessagePtr& commitMessage)
+std::shared_ptr<TXCommitMessage>& commitMessage)
{
VectorOfEntryEvent events;
if(commitMessage!= nullptr)
{
events = commitMessage->getEvents(m_cache);
}
- TransactionEventPtr event(new
-TransactionEvent(txState->getTransactionId(), CachePtr(m_cache), events));
+ std::shared_ptr<TransactionEvent> event(new
+TransactionEvent(txState->getTransactionId(), std::shared_ptr<Cache>(m_cache),
+events));
for(HashSetOfSharedBase::Iterator iter = m_listeners.begin();
m_listeners.end() != iter; iter++)
{
- TransactionListenerPtr listener =
+ auto listener =
std::static_pointer_cast<TransactionListener>(*iter);
listener->afterFailedCommit(event);
}
}
void CacheTransactionManagerImpl::noteCommitSuccess(TXState* txState, const
-TXCommitMessagePtr& commitMessage)
+std::shared_ptr<TXCommitMessage>& commitMessage)
{
VectorOfEntryEvent events;
if(commitMessage!= nullptr)
{
events = commitMessage->getEvents(m_cache);
}
- TransactionEventPtr event(new
-TransactionEvent(txState->getTransactionId(), CachePtr(m_cache), events));
+ std::shared_ptr<TransactionEvent> event(new
+TransactionEvent(txState->getTransactionId(), std::shared_ptr<Cache>(m_cache),
+events));
for(HashSetOfSharedBase::Iterator iter = m_listeners.begin();
m_listeners.end() != iter; iter++)
{
- TransactionListenerPtr listener =
-std::static_pointer_cast<TransactionListenerPtr>(*iter);
+ auto listener =
+std::static_pointer_cast<std::shared_ptr<TransactionListener>>(*iter);
listener->afterCommit(event);
}
}
void CacheTransactionManagerImpl::noteRollbackSuccess(TXState* txState, const
-TXCommitMessagePtr& commitMessage)
+std::shared_ptr<TXCommitMessage>& commitMessage)
{
VectorOfEntryEvent events;
if(commitMessage!= nullptr)
{
events = commitMessage->getEvents(m_cache);
}
- TransactionEventPtr event(new
-TransactionEvent(txState->getTransactionId(), CachePtr(m_cache), events));
+ std::shared_ptr<TransactionEvent> event(new
+TransactionEvent(txState->getTransactionId(), std::shared_ptr<Cache>(m_cache),
+events));
for(HashSetOfSharedBase::Iterator iter = m_listeners.begin();
m_listeners.end() != iter; iter++)
{
- TransactionListenerPtr listener =
+ auto listener =
std::static_pointer_cast<TransactionListener>(*iter);
listener->afterRollback(event);
}
diff --git a/cppcache/src/CacheTransactionManagerImpl.hpp b/cppcache/src/CacheTransactionManagerImpl.hpp
index 0ca7d53..098f704 100644
--- a/cppcache/src/CacheTransactionManagerImpl.hpp
+++ b/cppcache/src/CacheTransactionManagerImpl.hpp
@@ -43,16 +43,18 @@ class CacheTransactionManagerImpl
virtual void commit() override;
virtual void rollback() override;
virtual bool exists() override;
- virtual TransactionIdPtr suspend() override;
- virtual void resume(TransactionIdPtr transactionId) override;
- virtual bool isSuspended(TransactionIdPtr transactionId) override;
- virtual bool tryResume(TransactionIdPtr transactionId) override;
- bool tryResume(TransactionIdPtr transactionId, bool cancelExpiryTask);
- virtual bool tryResume(TransactionIdPtr transactionId,
+ virtual std::shared_ptr<TransactionId> suspend() override;
+ virtual void resume(std::shared_ptr<TransactionId> transactionId) override;
+ virtual bool isSuspended(
+ std::shared_ptr<TransactionId> transactionId) override;
+ virtual bool tryResume(std::shared_ptr<TransactionId> transactionId) override;
+ bool tryResume(std::shared_ptr<TransactionId> transactionId,
+ bool cancelExpiryTask);
+ virtual bool tryResume(std::shared_ptr<TransactionId> transactionId,
std::chrono::milliseconds waitTime) override;
- virtual bool exists(TransactionIdPtr transactionId) override;
+ virtual bool exists(std::shared_ptr<TransactionId> transactionId) override;
- virtual TransactionIdPtr getTransactionId() override;
+ virtual std::shared_ptr<TransactionId> getTransactionId() override;
TXState* getSuspendedTx(int32_t txId);
diff --git a/cppcache/src/CacheWriter.cpp b/cppcache/src/CacheWriter.cpp
index 1938eb2..f8ff46d 100644
--- a/cppcache/src/CacheWriter.cpp
+++ b/cppcache/src/CacheWriter.cpp
@@ -28,7 +28,7 @@ CacheWriter::CacheWriter() {}
CacheWriter::~CacheWriter() {}
-void CacheWriter::close(const RegionPtr& region) {}
+void CacheWriter::close(const std::shared_ptr<Region>& region) {}
bool CacheWriter::beforeUpdate(const EntryEvent& event) { return true; }
diff --git a/cppcache/src/CacheXmlParser.cpp b/cppcache/src/CacheXmlParser.cpp
index 2f77042..02b07ee 100644
--- a/cppcache/src/CacheXmlParser.cpp
+++ b/cppcache/src/CacheXmlParser.cpp
@@ -600,7 +600,7 @@ void CacheXmlParser::startPool(const xmlChar** atts) {
"A pool cannot be created without a name";
throw CacheXmlException(s.c_str());
}
- PoolFactoryPtr factory = m_cache->getPoolManager().createFactory();
+ auto factory = m_cache->getPoolManager().createFactory();
const char* poolName = nullptr;
@@ -1033,7 +1033,7 @@ void CacheXmlParser::endRegionAttributes() {
"CacheXmlParser::endRegion:AttributesFactory is null");
}
- RegionAttributesPtr regionAttributesPtr =
+ std::shared_ptr<RegionAttributes> regionAttributesPtr =
attrsFactory->createRegionAttributes();
auto regionPtr = std::static_pointer_cast<RegionXmlCreation>(_stack.top());
diff --git a/cppcache/src/CacheXmlParser.hpp b/cppcache/src/CacheXmlParser.hpp
index 025c83a..c0882c1 100644
--- a/cppcache/src/CacheXmlParser.hpp
+++ b/cppcache/src/CacheXmlParser.hpp
@@ -60,13 +60,13 @@ class CPPCACHE_EXPORT CacheXmlParser : public CacheXml {
CacheXmlCreation* m_cacheCreation;
std::string m_error;
int32_t m_nestedRegions;
- PropertiesPtr m_config;
+ std::shared_ptr<Properties> m_config;
std::string m_parserMessage;
bool m_flagCacheXmlException;
bool m_flagIllegalStateException;
bool m_flagAnyOtherException;
bool m_flagExpirationAttribute;
- std::map<std::string, RegionAttributesPtr> namedRegions;
+ std::map<std::string, std::shared_ptr<RegionAttributes>> namedRegions;
std::shared_ptr<PoolFactory> m_poolFactory;
Cache* m_cache;
diff --git a/cppcache/src/CacheableDate.cpp b/cppcache/src/CacheableDate.cpp
index ca147de..f6098b3 100644
--- a/cppcache/src/CacheableDate.cpp
+++ b/cppcache/src/CacheableDate.cpp
@@ -85,8 +85,7 @@ CacheableDate::CacheableDate(const CacheableDate::duration& value) {
}
CacheableDate::~CacheableDate() {}
-
-CacheableStringPtr CacheableDate::toString() const {
+std::shared_ptr<CacheableString> CacheableDate::toString() const {
char buffer[25];
struct tm date = {0};
time_t sec = m_timevalue / 1000;
diff --git a/cppcache/src/CacheableObjectArray.cpp b/cppcache/src/CacheableObjectArray.cpp
index afd3e8a..0ebd9bd 100644
--- a/cppcache/src/CacheableObjectArray.cpp
+++ b/cppcache/src/CacheableObjectArray.cpp
@@ -43,7 +43,7 @@ void CacheableObjectArray::fromData(DataInput& input) {
input.read(); // ignore string typeid
uint16_t classLen = input.readInt16();
input.advanceCursor(classLen);
- CacheablePtr obj;
+ std::shared_ptr<Cacheable> obj;
for (int32_t index = 0; index < len; index++) {
input.readObject(obj);
push_back(obj);
diff --git a/cppcache/src/CacheableObjectPartList.cpp b/cppcache/src/CacheableObjectPartList.cpp
index 3a991ec..f8d5f05 100644
--- a/cppcache/src/CacheableObjectPartList.cpp
+++ b/cppcache/src/CacheableObjectPartList.cpp
@@ -35,10 +35,10 @@ void CacheableObjectPartList::fromData(DataInput& input) {
const auto hasKeys = input.readBoolean();
int32_t len = input.readInt32();
if (len > 0) {
- CacheableKeyPtr key;
- CacheablePtr value;
- CacheableStringPtr exMsgPtr;
- ExceptionPtr ex;
+ std::shared_ptr<CacheableKey> key;
+ std::shared_ptr<Cacheable> value;
+ std::shared_ptr<CacheableString> exMsgPtr;
+ std::shared_ptr<Exception> ex;
// bool isException;
int32_t keysOffset = (m_keysOffset != nullptr ? *m_keysOffset : 0);
for (int32_t index = keysOffset; index < keysOffset + len; ++index) {
@@ -76,7 +76,7 @@ void CacheableObjectPartList::fromData(DataInput& input) {
}
} else {
input.readObject(value);
- CacheablePtr oldValue;
+ std::shared_ptr<Cacheable> oldValue;
if (m_addToLocalCache) {
// for both register interest and getAll it is desired
// to overwrite an invalidated entry
@@ -89,7 +89,7 @@ void CacheableObjectPartList::fromData(DataInput& input) {
updateCount = pos->second;
m_updateCountMap->erase(pos);
}
- VersionTagPtr versionTag;
+ std::shared_ptr<VersionTag> versionTag;
GfErrType err =
m_region->putLocal("getAll", false, key, value, oldValue, true,
updateCount, m_destroyTracker, versionTag);
diff --git a/cppcache/src/CacheableObjectPartList.hpp b/cppcache/src/CacheableObjectPartList.hpp
index eba59b6..64d25b8 100644
--- a/cppcache/src/CacheableObjectPartList.hpp
+++ b/cppcache/src/CacheableObjectPartList.hpp
@@ -25,7 +25,6 @@
#include <geode/DataOutput.hpp>
#include <geode/DataInput.hpp>
#include <geode/Cacheable.hpp>
-#include <geode/VectorT.hpp>
#include <geode/HashMapT.hpp>
#include "MapWithLock.hpp"
@@ -52,11 +51,11 @@ class ThinClientRegion;
*/
class CacheableObjectPartList : public Cacheable {
protected:
- const VectorOfCacheableKey* m_keys;
+ const std::vector<std::shared_ptr<CacheableKey>> * m_keys;
uint32_t* m_keysOffset;
- HashMapOfCacheablePtr m_values;
- HashMapOfExceptionPtr m_exceptions;
- VectorOfCacheableKeyPtr m_resultKeys;
+ std::shared_ptr<HashMapOfCacheable> m_values;
+ std::shared_ptr<HashMapOfException> m_exceptions;
+ std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>> m_resultKeys;
ThinClientRegion* m_region;
MapOfUpdateCounters* m_updateCountMap;
int32_t m_destroyTracker;
@@ -94,14 +93,14 @@ class CacheableObjectPartList : public Cacheable {
* map of exceptions and region to populate with the values
* obtained in fromData
*/
- CacheableObjectPartList(const VectorOfCacheableKey* keys,
- uint32_t* keysOffset,
- const HashMapOfCacheablePtr& values,
- const HashMapOfExceptionPtr& exceptions,
- const VectorOfCacheableKeyPtr& resultKeys,
- ThinClientRegion* region,
- MapOfUpdateCounters* trackerMap,
- int32_t destroyTracker, bool addToLocalCache)
+ CacheableObjectPartList(
+ const std::vector<std::shared_ptr<CacheableKey>>* keys,
+ uint32_t* keysOffset, const std::shared_ptr<HashMapOfCacheable>& values,
+ const std::shared_ptr<HashMapOfException>& exceptions,
+ const std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>>&
+ resultKeys,
+ ThinClientRegion* region, MapOfUpdateCounters* trackerMap,
+ int32_t destroyTracker, bool addToLocalCache)
: m_keys(keys),
m_keysOffset(keysOffset),
m_values(values),
@@ -153,8 +152,6 @@ class CacheableObjectPartList : public Cacheable {
virtual uint32_t objectSize() const;
};
-typedef std::shared_ptr<CacheableObjectPartList> CacheableObjectPartListPtr;
-
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/CacheableToken.cpp b/cppcache/src/CacheableToken.cpp
index 51e44f3..e75c101 100644
--- a/cppcache/src/CacheableToken.cpp
+++ b/cppcache/src/CacheableToken.cpp
@@ -26,14 +26,13 @@
using namespace apache::geode::client;
//---- statics
-
-CacheableTokenPtr CacheableToken::invalidToken =
+std::shared_ptr<CacheableToken> CacheableToken::invalidToken =
std::make_shared<CacheableToken>(CacheableToken::INVALID);
-CacheableTokenPtr CacheableToken::destroyedToken =
+std::shared_ptr<CacheableToken> CacheableToken::destroyedToken =
std::make_shared<CacheableToken>(CacheableToken::DESTROYED);
-CacheableTokenPtr CacheableToken::overflowedToken =
+std::shared_ptr<CacheableToken> CacheableToken::overflowedToken =
std::make_shared<CacheableToken>(CacheableToken::OVERFLOWED);
-CacheableTokenPtr CacheableToken::tombstoneToken =
+std::shared_ptr<CacheableToken> CacheableToken::tombstoneToken =
std::make_shared<CacheableToken>(CacheableToken::TOMBSTONE);
//----- serialization
@@ -70,8 +69,7 @@ CacheableToken::~CacheableToken() {}
* Display this object as 'string', which depend on the implementation in
* the subclasses
* The default implementation renders the classname.
- */
-CacheableStringPtr CacheableToken::toString() const {
+ */ std::shared_ptr<CacheableString> CacheableToken::toString() const {
static const char* ctstrings[] = {
"CacheableToken::NOT_USED", "CacheableToken::INVALID",
"CacheableToken::DESTROYED", "CacheableToken::OVERFLOWED",
diff --git a/cppcache/src/CacheableToken.hpp b/cppcache/src/CacheableToken.hpp
index 99e67a9..44a27a9 100644
--- a/cppcache/src/CacheableToken.hpp
+++ b/cppcache/src/CacheableToken.hpp
@@ -28,7 +28,6 @@ namespace geode {
namespace client {
class CPPCACHE_EXPORT CacheableToken;
-typedef std::shared_ptr<CacheableToken> CacheableTokenPtr;
/** Implement a non-mutable int64_t wrapper that can serve as a distributable
* key object for cacheing as well as being a 64 bit value. */
@@ -38,16 +37,22 @@ class CPPCACHE_EXPORT CacheableToken : public Cacheable {
TokenType m_value;
- static CacheableTokenPtr invalidToken;
- static CacheableTokenPtr destroyedToken;
- static CacheableTokenPtr overflowedToken;
- static CacheableTokenPtr tombstoneToken;
+ static std::shared_ptr<CacheableToken> invalidToken;
+ static std::shared_ptr<CacheableToken> destroyedToken;
+ static std::shared_ptr<CacheableToken> overflowedToken;
+ static std::shared_ptr<CacheableToken> tombstoneToken;
public:
- inline static CacheableTokenPtr& invalid() { return invalidToken; }
- inline static CacheableTokenPtr& destroyed() { return destroyedToken; }
- inline static CacheableTokenPtr& overflowed() { return overflowedToken; }
- inline static CacheableTokenPtr& tombstone() { return tombstoneToken; }
+ inline static std::shared_ptr<CacheableToken>& invalid() { return invalidToken; }
+ inline static std::shared_ptr<CacheableToken>& destroyed() {
+ return destroyedToken;
+ }
+ inline static std::shared_ptr<CacheableToken>& overflowed() {
+ return overflowedToken;
+ }
+ inline static std::shared_ptr<CacheableToken>& tombstone() {
+ return tombstoneToken;
+ }
/**
*@brief serialize this object
**/
@@ -89,22 +94,22 @@ class CPPCACHE_EXPORT CacheableToken : public Cacheable {
inline bool isTombstone() { return m_value == TOMBSTONE; }
- static bool isToken(const CacheablePtr& ptr) {
+ static bool isToken(const std::shared_ptr<Cacheable>& ptr) {
return (invalidToken == ptr) || (destroyedToken == ptr) ||
(overflowedToken == ptr) || (tombstoneToken == ptr);
}
- static bool isInvalid(const CacheablePtr& ptr) { return invalidToken == ptr; }
+ static bool isInvalid(const std::shared_ptr<Cacheable>& ptr) { return invalidToken == ptr; }
- static bool isDestroyed(const CacheablePtr& ptr) {
+ static bool isDestroyed(const std::shared_ptr<Cacheable>& ptr) {
return destroyedToken == ptr;
}
- static bool isOverflowed(const CacheablePtr& ptr) {
+ static bool isOverflowed(const std::shared_ptr<Cacheable>& ptr) {
return overflowedToken == ptr;
}
- static bool isTombstone(const CacheablePtr& ptr) {
+ static bool isTombstone(const std::shared_ptr<Cacheable>& ptr) {
return tombstoneToken == ptr;
}
@@ -113,7 +118,7 @@ class CPPCACHE_EXPORT CacheableToken : public Cacheable {
* the subclasses. The default implementation renders the classname.
* This returns constant strings of the form "CacheableToken::INVALID".
*/
- virtual CacheableStringPtr toString() const;
+ virtual std::shared_ptr<CacheableString> toString() const;
virtual uint32_t objectSize() const;
diff --git a/cppcache/src/ClientConnectionResponse.hpp b/cppcache/src/ClientConnectionResponse.hpp
index 1eead76..ab25dc8 100644
--- a/cppcache/src/ClientConnectionResponse.hpp
+++ b/cppcache/src/ClientConnectionResponse.hpp
@@ -44,7 +44,6 @@ class ClientConnectionResponse : public ServerLocationResponse {
bool m_serverFound;
ServerLocation m_server;
};
-typedef std::shared_ptr<ClientConnectionResponse> ClientConnectionResponsePtr;
} // namespace client
} // namespace geode
diff --git a/cppcache/src/ClientHealthStats.hpp b/cppcache/src/ClientHealthStats.hpp
index b40f74a..8d01782 100644
--- a/cppcache/src/ClientHealthStats.hpp
+++ b/cppcache/src/ClientHealthStats.hpp
@@ -66,10 +66,12 @@ class ClientHealthStats : public Serializable {
/**
* Factory method for creating an instance of ClientHealthStats
*/
- static ClientHealthStatsPtr create(int gets, int puts, int misses,
- int listCalls, int numThreads,
- int64_t cpuTime = 0, int cpus = 0) {
- return ClientHealthStatsPtr(new ClientHealthStats(
+ static std::shared_ptr<ClientHealthStats> create(int gets, int puts,
+ int misses, int listCalls,
+ int numThreads,
+ int64_t cpuTime = 0,
+ int cpus = 0) {
+ return std::shared_ptr<ClientHealthStats>(new ClientHealthStats(
gets, puts, misses, listCalls, numThreads, cpuTime, cpus));
}
~ClientHealthStats();
@@ -86,7 +88,7 @@ class ClientHealthStats : public Serializable {
int m_numThread; // ProcessStats.threads;
int64_t m_processCpuTime; //
int m_cpus;
- CacheableDatePtr m_updateTime; // Last updateTime
+ std::shared_ptr<CacheableDate> m_updateTime; // Last updateTime
};
} // namespace client
diff --git a/cppcache/src/ClientMetadata.cpp b/cppcache/src/ClientMetadata.cpp
index dccfa98..c3dd4f1 100644
--- a/cppcache/src/ClientMetadata.cpp
+++ b/cppcache/src/ClientMetadata.cpp
@@ -26,9 +26,9 @@ namespace geode {
namespace client {
ClientMetadata::ClientMetadata(
- int totalNumBuckets, CacheableStringPtr colocatedWith,
+ int totalNumBuckets, std::shared_ptr<CacheableString> colocatedWith,
ThinClientPoolDM* tcrdm,
- std::vector<FixedPartitionAttributesImplPtr>* fpaSet)
+ std::vector<std::shared_ptr<FixedPartitionAttributesImpl>>* fpaSet)
: m_partitionNames(nullptr),
m_previousOne(nullptr),
m_totalNumBuckets(totalNumBuckets),
@@ -107,15 +107,14 @@ int ClientMetadata::getTotalNumBuckets() {
LOGFINE("Inside getPartitionResolver");
return m_partitionResolver;
}*/
-
-CacheableStringPtr ClientMetadata::getColocatedWith() {
+std::shared_ptr<CacheableString> ClientMetadata::getColocatedWith() {
// ReadGuard guard (m_readWriteLock);
return m_colocatedWith;
}
-void ClientMetadata::getServerLocation(int bucketId, bool tryPrimary,
- BucketServerLocationPtr& serverLocation,
- int8_t& version) {
+void ClientMetadata::getServerLocation(
+ int bucketId, bool tryPrimary,
+ std::shared_ptr<BucketServerLocation>& serverLocation, int8_t& version) {
// ReadGuard guard (m_readWriteLock);
checkBucketId(bucketId);
// BucketServerLocationsType locations =
@@ -182,40 +181,40 @@ void ClientMetadata::updateBucketServerLocations(
for (BucketServerLocationsType::iterator iter =
bucketServerLocations.begin();
iter != bucketServerLocations.end(); ++iter) {
- CacheableStringArrayPtr groups = (*iter)->getServerGroups();
- if ((groups != nullptr) && (groups->length() > 0)) {
- bool added = false;
- for (int i = 0; i < groups->length(); i++) {
- CacheableStringPtr cs = (*groups)[i];
- if (cs->length() > 0) {
- std::string str = cs->toString();
- if ((ACE_OS::strcmp(str.c_str(), serverGroup.c_str()) == 0)) {
- added = true;
- if ((*iter)->isPrimary()) {
- primaries.push_back(*iter);
- break;
- } else {
- secondaries.push_back(*iter);
- break;
- }
- }
- } else {
- added = true;
- if ((*iter)->isPrimary()) {
- primaries.push_back(*iter);
- } else {
- secondaries.push_back(*iter);
- }
- }
- }
- if (!added) {
- (*iter)->setServername(nullptr);
- if ((*iter)->isPrimary()) {
- primaries.push_back(*iter);
- } else {
- secondaries.push_back(*iter);
- }
- }
+ auto groups = (*iter)->getServerGroups();
+ if ((groups != nullptr) && (groups->length() > 0)) {
+ bool added = false;
+ for (int i = 0; i < groups->length(); i++) {
+ auto cs = (*groups)[i];
+ if (cs->length() > 0) {
+ std::string str = cs->toString();
+ if ((ACE_OS::strcmp(str.c_str(), serverGroup.c_str()) == 0)) {
+ added = true;
+ if ((*iter)->isPrimary()) {
+ primaries.push_back(*iter);
+ break;
+ } else {
+ secondaries.push_back(*iter);
+ break;
+ }
+ }
+ } else {
+ added = true;
+ if ((*iter)->isPrimary()) {
+ primaries.push_back(*iter);
+ } else {
+ secondaries.push_back(*iter);
+ }
+ }
+ }
+ if (!added) {
+ (*iter)->setServername(nullptr);
+ if ((*iter)->isPrimary()) {
+ primaries.push_back(*iter);
+ } else {
+ secondaries.push_back(*iter);
+ }
+ }
}
}
@@ -338,48 +337,46 @@ void ClientMetadata::populateDummyServers(int bucketId,
}
int ClientMetadata::assignFixedBucketId(const char* partitionName,
- CacheableKeyPtr resolvekey) {
+ std::shared_ptr<CacheableKey> resolvekey) {
LOGDEBUG(
"FPR assignFixedBucketId partititonname = %s , m_fpaMap.size() = %d ",
partitionName, m_fpaMap.size());
FixedMapType::iterator iter = m_fpaMap.find(partitionName);
if (iter != m_fpaMap.end()) {
- std::vector<int> attList = iter->second;
- int32_t hc = resolvekey->hashcode();
- int bucketId = std::abs(hc % (attList.at(0)));
- int partitionBucketID = bucketId + attList.at(1);
- return partitionBucketID;
+ auto attList =iter->second;
+ int32_t hc = resolvekey->hashcode();
+ int bucketId = std::abs(hc % (attList.at(0)));
+ int partitionBucketID = bucketId + attList.at(1);
+ return partitionBucketID;
} else {
return -1;
}
}
-std::vector<BucketServerLocationPtr> ClientMetadata::adviseServerLocations(
- int bucketId) {
+std::vector<std::shared_ptr<BucketServerLocation>>
+ClientMetadata::adviseServerLocations(int bucketId) {
checkBucketId(bucketId);
return m_bucketServerLocationsList[bucketId];
}
-
-BucketServerLocationPtr ClientMetadata::advisePrimaryServerLocation(
- int bucketId) {
- std::vector<BucketServerLocationPtr> locations =
- adviseServerLocations(bucketId);
- for (std::vector<BucketServerLocationPtr>::iterator iter = locations.begin();
+std::shared_ptr<BucketServerLocation>
+ClientMetadata::advisePrimaryServerLocation(int bucketId) {
+ auto locations = adviseServerLocations(bucketId);
+ for (std::vector<std::shared_ptr<BucketServerLocation>>::iterator iter =
+ locations.begin();
iter != locations.end(); ++iter) {
- BucketServerLocationPtr location = *iter;
+ auto location = *iter;
if (location->isPrimary()) {
return location;
}
}
return nullptr;
}
-
-BucketServerLocationPtr ClientMetadata::adviseRandomServerLocation() {
+ std::shared_ptr<BucketServerLocation> ClientMetadata::adviseRandomServerLocation() {
if (m_bucketServerLocationsList.size() > 0) {
RandGen randGen;
size_t random = randGen(m_bucketServerLocationsList.size());
checkBucketId(random);
- std::vector<BucketServerLocationPtr> locations =
+ auto locations =
m_bucketServerLocationsList[random];
if (locations.size() == 0) return nullptr;
return locations.at(0);
diff --git a/cppcache/src/ClientMetadata.hpp b/cppcache/src/ClientMetadata.hpp
index c137772..e346984 100644
--- a/cppcache/src/ClientMetadata.hpp
+++ b/cppcache/src/ClientMetadata.hpp
@@ -40,8 +40,8 @@ namespace client {
class ThinClientPoolDM;
class ClientMetadata;
-typedef std::shared_ptr<ClientMetadata> ClientMetadataPtr;
-typedef std::vector<BucketServerLocationPtr> BucketServerLocationsType;
+typedef std::vector<std::shared_ptr<BucketServerLocation>>
+ BucketServerLocationsType;
// typedef std::map<int,BucketServerLocationsType >
// BucketServerLocationsListType;
typedef std::vector<BucketServerLocationsType> BucketServerLocationsListType;
@@ -50,13 +50,13 @@ typedef std::map<std::string, std::vector<int> > FixedMapType;
class CPPCACHE_EXPORT ClientMetadata : public NonAssignable {
private:
void setPartitionNames();
- CacheableHashSetPtr m_partitionNames;
+ std::shared_ptr<CacheableHashSet> m_partitionNames;
BucketServerLocationsListType m_bucketServerLocationsList;
- ClientMetadataPtr m_previousOne;
+ std::shared_ptr<ClientMetadata> m_previousOne;
int m_totalNumBuckets;
- // PartitionResolverPtr m_partitionResolver;
- CacheableStringPtr m_colocatedWith;
+ // std::shared_ptr<PartitionResolver> m_partitionResolver;
+ std::shared_ptr<CacheableString> m_colocatedWith;
// ACE_RW_Thread_Mutex m_readWriteLock;
ThinClientPoolDM* m_tcrdm;
FixedMapType m_fpaMap;
@@ -69,29 +69,32 @@ class CPPCACHE_EXPORT ClientMetadata : public NonAssignable {
}
public:
- void setPreviousone(ClientMetadataPtr cptr) { m_previousOne = cptr; }
+ void setPreviousone(std::shared_ptr<ClientMetadata> cptr) {
+ m_previousOne = cptr;
+ }
~ClientMetadata();
ClientMetadata();
- ClientMetadata(int totalNumBuckets, CacheableStringPtr colocatedWith,
- ThinClientPoolDM* tcrdm,
- std::vector<FixedPartitionAttributesImplPtr>* fpaSet);
+ ClientMetadata(
+ int totalNumBuckets, std::shared_ptr<CacheableString> colocatedWith,
+ ThinClientPoolDM* tcrdm,
+ std::vector<std::shared_ptr<FixedPartitionAttributesImpl>>* fpaSet);
void getServerLocation(int bucketId, bool tryPrimary,
- BucketServerLocationPtr& serverLocation,
+ std::shared_ptr<BucketServerLocation>& serverLocation,
int8_t& version);
// ServerLocation getPrimaryServerLocation(int bucketId);
void updateBucketServerLocations(
int bucketId, BucketServerLocationsType bucketServerLocations);
void removeBucketServerLocation(BucketServerLocation serverLocation);
int getTotalNumBuckets();
- // PartitionResolverPtr getPartitionResolver();
- CacheableStringPtr getColocatedWith();
+ // std::shared_ptr<PartitionResolver> getPartitionResolver();
+ std::shared_ptr<CacheableString> getColocatedWith();
void populateDummyServers(int bucketId, BucketServerLocationsType serverlist);
int assignFixedBucketId(const char* partitionName,
- CacheableKeyPtr resolvekey);
- CacheableHashSetPtr& getFixedPartitionNames() {
+ std::shared_ptr<CacheableKey> resolvekey);
+ std::shared_ptr<CacheableHashSet>& getFixedPartitionNames() {
/* if(m_fpaMap.size() >0)
{
- CacheableHashSetPtr partitionNames = CacheableHashSet::create();
+ auto partitionNames = CacheableHashSet::create();
for ( FixedMapType::iterator it=m_fpaMap.begin() ; it != m_fpaMap.end();
it++ ) {
partitionNames->insert(CacheableString::create(((*it).first).c_str()));
@@ -101,9 +104,11 @@ class CPPCACHE_EXPORT ClientMetadata : public NonAssignable {
return m_partitionNames;
}
ClientMetadata(ClientMetadata& other);
- std::vector<BucketServerLocationPtr> adviseServerLocations(int bucketId);
- BucketServerLocationPtr advisePrimaryServerLocation(int bucketId);
- BucketServerLocationPtr adviseRandomServerLocation();
+ std::vector<std::shared_ptr<BucketServerLocation>> adviseServerLocations(
+ int bucketId);
+ std::shared_ptr<BucketServerLocation> advisePrimaryServerLocation(
+ int bucketId);
+ std::shared_ptr<BucketServerLocation> adviseRandomServerLocation();
};
} // namespace client
} // namespace geode
diff --git a/cppcache/src/ClientMetadataService.cpp b/cppcache/src/ClientMetadataService.cpp
index f313ae6..e2a4f33 100644
--- a/cppcache/src/ClientMetadataService.cpp
+++ b/cppcache/src/ClientMetadataService.cpp
@@ -118,7 +118,7 @@ void ClientMetadataService::getClientPRMetadata(const char* regionFullPath) {
// this message to server and get metadata from server.
TcrMessageReply reply(true, nullptr);
std::string path(regionFullPath);
- ClientMetadataPtr cptr = nullptr;
+ std::shared_ptr<ClientMetadata> cptr = nullptr;
{
ReadGuard guard(m_regionMetadataLock);
RegionMetadataMapType::iterator itr = m_regionMetaDataMap.find(path);
@@ -126,7 +126,7 @@ void ClientMetadataService::getClientPRMetadata(const char* regionFullPath) {
cptr = itr->second;
}
}
- ClientMetadataPtr newCptr = nullptr;
+ std::shared_ptr<ClientMetadata> newCptr = nullptr;
if (cptr == nullptr) {
TcrMessageGetClientPartitionAttributes request(tcrdm->getConnectionManager()
@@ -152,7 +152,7 @@ void ClientMetadataService::getClientPRMetadata(const char* regionFullPath) {
if (cptr == nullptr) {
return;
}
- CacheableStringPtr colocatedWith;
+ std::shared_ptr<CacheableString> colocatedWith;
if (cptr != nullptr) {
colocatedWith = cptr->getColocatedWith();
}
@@ -180,9 +180,8 @@ void ClientMetadataService::getClientPRMetadata(const char* regionFullPath) {
}
}
}
-
-ClientMetadataPtr ClientMetadataService::SendClientPRMetadata(
- const char* regionPath, ClientMetadataPtr cptr) {
+std::shared_ptr<ClientMetadata> ClientMetadataService::SendClientPRMetadata(
+ const char* regionPath, std::shared_ptr<ClientMetadata> cptr) {
ThinClientPoolDM* tcrdm = dynamic_cast<ThinClientPoolDM*>(m_pool);
if (tcrdm == nullptr) {
throw IllegalArgumentException(
@@ -197,40 +196,42 @@ ClientMetadataPtr ClientMetadataService::SendClientPRMetadata(
// send this message to server and get metadata from server.
LOGFINE("Now sending GET_CLIENT_PR_METADATA for getting from server: %s",
regionPath);
- RegionPtr region = nullptr;
- GfErrType err = tcrdm->sendSyncRequest(request, reply);
- if (err == GF_NOERR &&
- reply.getMessageType() == TcrMessage::RESPONSE_CLIENT_PR_METADATA) {
- tcrdm->getConnectionManager().getCacheImpl()->getRegion(regionPath, region);
- if (region != nullptr) {
- LocalRegion* lregion = dynamic_cast<LocalRegion*>(region.get());
- lregion->getRegionStats()->incMetaDataRefreshCount();
- }
- std::vector<BucketServerLocationsType>* metadata = reply.getMetadata();
- if (metadata == nullptr) return nullptr;
- if (metadata->empty()) {
- delete metadata;
- return nullptr;
- }
- auto newCptr = std::make_shared<ClientMetadata>(*cptr);
- for (std::vector<BucketServerLocationsType>::iterator iter =
- metadata->begin();
- iter != metadata->end(); ++iter) {
- if (!(*iter).empty()) {
- newCptr->updateBucketServerLocations((*iter).at(0)->getBucketId(),
- (*iter));
- }
- }
+std::shared_ptr<Region> region = nullptr;
+GfErrType err = tcrdm->sendSyncRequest(request, reply);
+if (err == GF_NOERR &&
+ reply.getMessageType() == TcrMessage::RESPONSE_CLIENT_PR_METADATA) {
+ tcrdm->getConnectionManager().getCacheImpl()->getRegion(regionPath, region);
+ if (region != nullptr) {
+ LocalRegion* lregion = dynamic_cast<LocalRegion*>(region.get());
+ lregion->getRegionStats()->incMetaDataRefreshCount();
+ }
+ std::vector<BucketServerLocationsType>* metadata = reply.getMetadata();
+ if (metadata == nullptr) return nullptr;
+ if (metadata->empty()) {
delete metadata;
- return newCptr;
+ return nullptr;
}
- return nullptr;
+ auto newCptr = std::make_shared<ClientMetadata>(*cptr);
+ for (std::vector<BucketServerLocationsType>::iterator iter =
+ metadata->begin();
+ iter != metadata->end(); ++iter) {
+ if (!(*iter).empty()) {
+ newCptr->updateBucketServerLocations((*iter).at(0)->getBucketId(),
+ (*iter));
+ }
+ }
+ delete metadata;
+ return newCptr;
+}
+return nullptr;
}
void ClientMetadataService::getBucketServerLocation(
- const RegionPtr& region, const CacheableKeyPtr& key,
- const CacheablePtr& value, const SerializablePtr& aCallbackArgument,
- bool isPrimary, BucketServerLocationPtr& serverLocation, int8_t& version) {
+ const std::shared_ptr<Region>& region,
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument, bool isPrimary,
+ std::shared_ptr<BucketServerLocation>& serverLocation, int8_t& version) {
// ACE_Guard< ACE_Recursive_Thread_Mutex > guard( m_regionMetadataLock );
if (region != nullptr) {
ReadGuard guard(m_regionMetadataLock);
@@ -239,7 +240,7 @@ void ClientMetadataService::getBucketServerLocation(
"size is %d",
m_regionMetaDataMap.size());
std::string path(region->getFullPath());
- ClientMetadataPtr cptr = nullptr;
+ std::shared_ptr<ClientMetadata> cptr = nullptr;
const auto& itr = m_regionMetaDataMap.find(path);
if (itr != m_regionMetaDataMap.end()) {
cptr = itr->second;
@@ -247,7 +248,7 @@ void ClientMetadataService::getBucketServerLocation(
if (!cptr) {
return;
}
- CacheableKeyPtr resolvekey;
+ std::shared_ptr<CacheableKey> resolvekey;
const auto& resolver = region->getAttributes()->getPartitionResolver();
EntryEvent event(region, key, value, nullptr, aCallbackArgument, false);
@@ -289,15 +290,14 @@ void ClientMetadataService::removeBucketServerLocation(
for (RegionMetadataMapType::iterator regionMetadataIter =
m_regionMetaDataMap.begin();
regionMetadataIter != m_regionMetaDataMap.end(); regionMetadataIter++) {
- ClientMetadataPtr cptr = (*regionMetadataIter).second;
+ auto cptr = (*regionMetadataIter).second;
if (cptr != nullptr) {
// Yogesh has commented out this as it was causing a SIGV
// clientMetadata->removeBucketServerLocation(serverLocation);
}
}
}
-
-ClientMetadataPtr ClientMetadataService::getClientMetadata(
+std::shared_ptr<ClientMetadata> ClientMetadataService::getClientMetadata(
const char* regionFullPath) {
ReadGuard guard(m_regionMetadataLock);
RegionMetadataMapType::iterator regionMetadataIter =
@@ -308,8 +308,8 @@ ClientMetadataPtr ClientMetadataService::getClientMetadata(
return nullptr;
}
-void ClientMetadataService::populateDummyServers(const char* regionName,
- ClientMetadataPtr cptr) {
+void ClientMetadataService::populateDummyServers(
+ const char* regionName, std::shared_ptr<ClientMetadata> cptr) {
WriteGuard guard(m_regionMetadataLock);
m_regionMetaDataMap[regionName] = cptr;
}
@@ -321,7 +321,7 @@ void ClientMetadataService::enqueueForMetadataRefresh(
throw IllegalArgumentException(
"ClientMetaData: pool cast to ThinClientPoolDM failed");
}
- RegionPtr region;
+ std::shared_ptr<Region> region;
auto cache = tcrdm->getConnectionManager().getCacheImpl();
cache->getRegion(regionFullPath, region);
@@ -354,9 +354,8 @@ void ClientMetadataService::enqueueForMetadataRefresh(
}
}
}
-
-ClientMetadataPtr ClientMetadataService::getClientMetadata(
- const RegionPtr& region) {
+std::shared_ptr<ClientMetadata> ClientMetadataService::getClientMetadata(
+ const std::shared_ptr<Region>& region) {
ReadGuard guard(m_regionMetadataLock);
const auto& entry = m_regionMetaDataMap.find(region->getFullPath());
@@ -368,10 +367,10 @@ ClientMetadataPtr ClientMetadataService::getClientMetadata(
return entry->second;
}
-ClientMetadataService::ServerToFilterMapPtr
-ClientMetadataService::getServerToFilterMap(const VectorOfCacheableKey& keys,
- const RegionPtr& region,
- bool isPrimary) {
+std::shared_ptr<ClientMetadataService::ServerToFilterMap>
+ClientMetadataService::getServerToFilterMap(
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ const std::shared_ptr<Region>& region, bool isPrimary) {
auto clientMetadata = getClientMetadata(region);
if (!clientMetadata) {
return nullptr;
@@ -379,13 +378,13 @@ ClientMetadataService::getServerToFilterMap(const VectorOfCacheableKey& keys,
auto serverToFilterMap = std::make_shared<ServerToFilterMap>();
- VectorOfCacheableKey keysWhichLeft;
- std::map<int, BucketServerLocationPtr> buckets;
+ std::vector<std::shared_ptr<CacheableKey>> keysWhichLeft;
+ std::map<int, std::shared_ptr<BucketServerLocation>> buckets;
for (const auto& key : keys) {
LOGDEBUG("cmds = %s", key->toString()->toString());
const auto resolver = region->getAttributes()->getPartitionResolver();
- CacheableKeyPtr resolveKey;
+ std::shared_ptr<CacheableKey> resolveKey;
if (resolver == nullptr) {
// client has not registered PartitionResolver
@@ -398,18 +397,18 @@ ClientMetadataService::getServerToFilterMap(const VectorOfCacheableKey& keys,
int bucketId =
std::abs(resolveKey->hashcode() % clientMetadata->getTotalNumBuckets());
- VectorOfCacheableKeyPtr keyList = nullptr;
+ std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>> > keyList = nullptr;
const auto& bucketsIter = buckets.find(bucketId);
if (bucketsIter == buckets.end()) {
int8_t version = -1;
// auto serverLocation = std::make_shared<BucketServerLocation>();
- BucketServerLocationPtr serverLocation = nullptr;
- clientMetadata->getServerLocation(bucketId, isPrimary, serverLocation,
- version);
- if (!(serverLocation && serverLocation->isValid())) {
- keysWhichLeft.push_back(key);
- continue;
+ std::shared_ptr<BucketServerLocation> serverLocation = nullptr;
+ clientMetadata->getServerLocation(bucketId, isPrimary, serverLocation,
+ version);
+ if (!(serverLocation && serverLocation->isValid())) {
+ keysWhichLeft.push_back(key);
+ continue;
}
buckets[bucketId] = serverLocation;
@@ -417,7 +416,7 @@ ClientMetadataService::getServerToFilterMap(const VectorOfCacheableKey& keys,
const auto& itrRes = serverToFilterMap->find(serverLocation);
if (itrRes == serverToFilterMap->end()) {
- keyList = std::make_shared<VectorOfCacheableKey>();
+ keyList = std::make_shared<std::vector<std::shared_ptr<CacheableKey>> >();
serverToFilterMap->emplace(serverLocation, keyList);
} else {
keyList = itrRes->second;
@@ -458,9 +457,11 @@ ClientMetadataService::getServerToFilterMap(const VectorOfCacheableKey& keys,
}
void ClientMetadataService::markPrimaryBucketForTimeout(
- const RegionPtr& region, const CacheableKeyPtr& key,
- const CacheablePtr& value, const SerializablePtr& aCallbackArgument,
- bool isPrimary, BucketServerLocationPtr& serverLocation, int8_t& version) {
+ const std::shared_ptr<Region>& region,
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument, bool isPrimary,
+ std::shared_ptr<BucketServerLocation>& serverLocation, int8_t& version) {
if (m_bucketWaitTimeout == std::chrono::milliseconds::zero()) return;
WriteGuard guard(m_PRbucketStatusLock);
@@ -485,15 +486,16 @@ void ClientMetadataService::markPrimaryBucketForTimeout(
}
}
-ClientMetadataService::BucketToKeysMapPtr
+std::shared_ptr<ClientMetadataService::BucketToKeysMap>
ClientMetadataService::groupByBucketOnClientSide(
- const RegionPtr& region, const CacheableVectorPtr& keySet,
- const ClientMetadataPtr& metadata) {
+ const std::shared_ptr<Region>& region,
+ const std::shared_ptr<CacheableVector>& keySet,
+ const std::shared_ptr<ClientMetadata>& metadata) {
auto bucketToKeysMap = std::make_shared<BucketToKeysMap>();
for (const auto& k : *keySet) {
const auto key = std::static_pointer_cast<CacheableKey>(k);
const auto resolver = region->getAttributes()->getPartitionResolver();
- CacheableKeyPtr resolvekey;
+ std::shared_ptr<CacheableKey> resolvekey;
EntryEvent event(region, key, nullptr, nullptr, nullptr, false);
int bucketId = -1;
if (resolver) {
@@ -525,7 +527,7 @@ ClientMetadataService::groupByBucketOnClientSide(
}
}
- CacheableHashSetPtr bucketKeys;
+ std::shared_ptr<CacheableHashSet> bucketKeys;
const auto& iter = bucketToKeysMap->find(bucketId);
if (iter == bucketToKeysMap->end()) {
@@ -541,11 +543,11 @@ ClientMetadataService::groupByBucketOnClientSide(
return bucketToKeysMap;
}
-ClientMetadataService::ServerToKeysMapPtr
+std::shared_ptr<ClientMetadataService::ServerToKeysMap>
ClientMetadataService::getServerToFilterMapFESHOP(
- const CacheableVectorPtr& routingKeys, const RegionPtr& region,
- bool isPrimary) {
- ClientMetadataPtr cptr = getClientMetadata(region->getFullPath());
+ const std::shared_ptr<CacheableVector>& routingKeys,
+ const std::shared_ptr<Region>& region, bool isPrimary) {
+ auto cptr = getClientMetadata(region->getFullPath());
if (!cptr) {
enqueueForMetadataRefresh(region->getFullPath(), 0);
@@ -579,7 +581,7 @@ ClientMetadataService::getServerToFilterMapFESHOP(
const auto& serverLocation = serverToBucket.first;
const auto& buckets = serverToBucket.second;
for (const auto& bucket : *buckets) {
- CacheableHashSetPtr serverToKeysEntry;
+ std::shared_ptr<CacheableHashSet> serverToKeysEntry;
const auto& iter = serverToKeysMap->find(serverLocation);
if (iter == serverToKeysMap->end()) {
serverToKeysEntry = CacheableHashSet::create();
@@ -597,12 +599,11 @@ ClientMetadataService::getServerToFilterMapFESHOP(
}
return serverToKeysMap;
}
-
-BucketServerLocationPtr ClientMetadataService::findNextServer(
+std::shared_ptr<BucketServerLocation> ClientMetadataService::findNextServer(
const ClientMetadataService::ServerToBucketsMap& serverToBucketsMap,
const ClientMetadataService::BucketSet& currentBucketSet) {
size_t max = 0;
- std::vector<BucketServerLocationPtr> nodesOfEqualSize;
+ std::vector<std::shared_ptr<BucketServerLocation>> nodesOfEqualSize;
for (const auto& serverToBucketEntry : serverToBucketsMap) {
const auto& serverLocation = serverToBucketEntry.first;
@@ -638,8 +639,9 @@ BucketServerLocationPtr ClientMetadataService::findNextServer(
return nullptr;
}
-ClientMetadataService::ServerToBucketsMapPtr ClientMetadataService::pruneNodes(
- const ClientMetadataPtr& metadata, const BucketSet& buckets) {
+std::shared_ptr<ClientMetadataService::ServerToBucketsMap>
+ClientMetadataService::pruneNodes(
+ const std::shared_ptr<ClientMetadata>& metadata, const BucketSet& buckets) {
BucketSet bucketSetWithoutServer;
ServerToBucketsMap serverToBucketsMap;
@@ -658,7 +660,7 @@ ClientMetadataService::ServerToBucketsMapPtr ClientMetadataService::pruneNodes(
}
for (const auto& location : locations) {
- BucketSetPtr bucketSet;
+ std::shared_ptr<BucketSet> bucketSet;
const auto& itrRes = serverToBucketsMap.find(location);
if (itrRes == serverToBucketsMap.end()) {
@@ -673,7 +675,7 @@ ClientMetadataService::ServerToBucketsMapPtr ClientMetadataService::pruneNodes(
}
auto itrRes = serverToBucketsMap.begin();
- BucketServerLocationPtr randomFirstServer;
+ std::shared_ptr<BucketServerLocation> randomFirstServer;
if (serverToBucketsMap.empty()) {
LOGDEBUG(
"ClientMetadataService::pruneNodes serverToBucketsMap is empty so "
@@ -743,10 +745,10 @@ ClientMetadataService::ServerToBucketsMapPtr ClientMetadataService::pruneNodes(
return prunedServerToBucketsMap;
}
-ClientMetadataService::ServerToBucketsMapPtr
-ClientMetadataService::groupByServerToAllBuckets(const RegionPtr& region,
- bool optimizeForWrite) {
- ClientMetadataPtr cptr = getClientMetadata(region->getFullPath());
+std::shared_ptr<ClientMetadataService::ServerToBucketsMap>
+ClientMetadataService::groupByServerToAllBuckets(
+ const std::shared_ptr<Region>& region, bool optimizeForWrite) {
+ auto cptr = getClientMetadata(region->getFullPath());
if (cptr == nullptr) {
enqueueForMetadataRefresh(region->getFullPath(), false);
return nullptr;
@@ -759,10 +761,10 @@ ClientMetadataService::groupByServerToAllBuckets(const RegionPtr& region,
return groupByServerToBuckets(cptr, bucketSet, optimizeForWrite);
}
-ClientMetadataService::ServerToBucketsMapPtr
-ClientMetadataService::groupByServerToBuckets(const ClientMetadataPtr& metadata,
- const BucketSet& bucketSet,
- bool optimizeForWrite) {
+std::shared_ptr<ClientMetadataService::ServerToBucketsMap>
+ClientMetadataService::groupByServerToBuckets(
+ const std::shared_ptr<ClientMetadata>& metadata, const BucketSet& bucketSet,
+ bool optimizeForWrite) {
if (optimizeForWrite) {
auto serverToBucketsMap = std::make_shared<ServerToBucketsMap>();
BucketSet bucketsWithoutServer(bucketSet.size());
@@ -777,7 +779,7 @@ ClientMetadataService::groupByServerToBuckets(const ClientMetadataPtr& metadata,
continue;
}
- BucketSetPtr buckets;
+ std::shared_ptr<BucketSet> buckets;
const auto& itrRes = serverToBucketsMap->find(serverLocation);
if (itrRes == serverToBucketsMap->end()) {
buckets = std::make_shared<BucketSet>();
@@ -805,9 +807,11 @@ ClientMetadataService::groupByServerToBuckets(const ClientMetadataPtr& metadata,
}
void ClientMetadataService::markPrimaryBucketForTimeoutButLookSecondaryBucket(
- const RegionPtr& region, const CacheableKeyPtr& key,
- const CacheablePtr& value, const SerializablePtr& aCallbackArgument,
- bool isPrimary, BucketServerLocationPtr& serverLocation, int8_t& version) {
+ const std::shared_ptr<Region>& region,
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument, bool isPrimary,
+ std::shared_ptr<BucketServerLocation>& serverLocation, int8_t& version) {
if (m_bucketWaitTimeout == std::chrono::milliseconds::zero()) return;
WriteGuard guard(m_PRbucketStatusLock);
@@ -825,19 +829,19 @@ void ClientMetadataService::markPrimaryBucketForTimeoutButLookSecondaryBucket(
getBucketServerLocation(region, key, value, aCallbackArgument, true,
serverLocation, version);
- ClientMetadataPtr cptr = nullptr;
- {
- ReadGuard guard(m_regionMetadataLock);
- RegionMetadataMapType::iterator cptrIter =
- m_regionMetaDataMap.find(region->getFullPath());
+std::shared_ptr<ClientMetadata> cptr = nullptr;
+{
+ ReadGuard guard(m_regionMetadataLock);
+ RegionMetadataMapType::iterator cptrIter =
+ m_regionMetaDataMap.find(region->getFullPath());
- if (cptrIter != m_regionMetaDataMap.end()) {
- cptr = cptrIter->second;
- }
+ if (cptrIter != m_regionMetaDataMap.end()) {
+ cptr = cptrIter->second;
+ }
- if (cptr == nullptr) {
- return;
- }
+ if (cptr == nullptr) {
+ return;
+ }
}
LOGFINE("Setting in markPrimaryBucketForTimeoutButLookSecondaryBucket");
@@ -846,7 +850,7 @@ void ClientMetadataService::markPrimaryBucketForTimeoutButLookSecondaryBucket(
for (int32_t i = 0; i < totalBuckets; i++) {
int8_t version;
- BucketServerLocationPtr bsl;
+ std::shared_ptr<BucketServerLocation> bsl;
cptr->getServerLocation(i, false, bsl, version);
if (bsl == serverLocation) {
diff --git a/cppcache/src/ClientMetadataService.hpp b/cppcache/src/ClientMetadataService.hpp
index 19b236d..d9f0538 100644
--- a/cppcache/src/ClientMetadataService.hpp
+++ b/cppcache/src/ClientMetadataService.hpp
@@ -45,7 +45,8 @@ namespace client {
class ClienMetadata;
-typedef std::map<std::string, ClientMetadataPtr> RegionMetadataMapType;
+typedef std::map<std::string, std::shared_ptr<ClientMetadata>>
+ RegionMetadataMapType;
class BucketStatus {
private:
@@ -114,92 +115,101 @@ class ClientMetadataService : public ACE_Task_Base,
void getClientPRMetadata(const char* regionFullPath);
void getBucketServerLocation(
- const RegionPtr& region, const CacheableKeyPtr& key,
- const CacheablePtr& value, const SerializablePtr& aCallbackArgument,
- bool isPrimary, BucketServerLocationPtr& serverLocation, int8_t& version);
+ const std::shared_ptr<Region>& region,
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument, bool isPrimary,
+ std::shared_ptr<BucketServerLocation>& serverLocation, int8_t& version);
void removeBucketServerLocation(BucketServerLocation serverLocation);
- ClientMetadataPtr getClientMetadata(const char* regionFullPath);
+ std::shared_ptr<ClientMetadata> getClientMetadata(const char* regionFullPath);
void populateDummyServers(const char* regionName,
- ClientMetadataPtr clientmetadata);
+ std::shared_ptr<ClientMetadata> clientmetadata);
void enqueueForMetadataRefresh(const char* regionFullPath,
int8_t serverGroupFlag);
- typedef std::unordered_map<BucketServerLocationPtr, VectorOfCacheableKeyPtr,
- dereference_hash<BucketServerLocationPtr>,
- dereference_equal_to<BucketServerLocationPtr>>
+ typedef std::unordered_map<
+ std::shared_ptr<BucketServerLocation>,
+ std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>>,
+ dereference_hash<std::shared_ptr<BucketServerLocation>>,
+ dereference_equal_to<std::shared_ptr<BucketServerLocation>>>
ServerToFilterMap;
- typedef std::shared_ptr<ServerToFilterMap> ServerToFilterMapPtr;
- ServerToFilterMapPtr getServerToFilterMap(const VectorOfCacheableKey& keys,
- const RegionPtr& region,
- bool isPrimary);
+ std::shared_ptr<ServerToFilterMap> getServerToFilterMap(
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ const std::shared_ptr<Region>& region, bool isPrimary);
void markPrimaryBucketForTimeout(
- const RegionPtr& region, const CacheableKeyPtr& key,
- const CacheablePtr& value, const SerializablePtr& aCallbackArgument,
- bool isPrimary, BucketServerLocationPtr& serverLocation, int8_t& version);
+ const std::shared_ptr<Region>& region,
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument, bool isPrimary,
+ std::shared_ptr<BucketServerLocation>& serverLocation, int8_t& version);
void markPrimaryBucketForTimeoutButLookSecondaryBucket(
- const RegionPtr& region, const CacheableKeyPtr& key,
- const CacheablePtr& value, const SerializablePtr& aCallbackArgument,
- bool isPrimary, BucketServerLocationPtr& serverLocation, int8_t& version);
+ const std::shared_ptr<Region>& region,
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument, bool isPrimary,
+ std::shared_ptr<BucketServerLocation>& serverLocation, int8_t& version);
bool isBucketMarkedForTimeout(const char* regionFullPath, int32_t bucketid);
typedef std::unordered_set<int32_t> BucketSet;
- typedef std::shared_ptr<BucketSet> BucketSetPtr;
- typedef std::unordered_map<BucketServerLocationPtr, BucketSetPtr,
- dereference_hash<BucketServerLocationPtr>,
- dereference_equal_to<BucketServerLocationPtr>>
+ typedef std::unordered_map<
+ std::shared_ptr<BucketServerLocation>, std::shared_ptr<BucketSet>,
+ dereference_hash<std::shared_ptr<BucketServerLocation>>,
+ dereference_equal_to<std::shared_ptr<BucketServerLocation>>>
ServerToBucketsMap;
- typedef std::shared_ptr<ServerToBucketsMap> ServerToBucketsMapPtr;
// bool AreBucketSetsEqual(const BucketSet& currentBucketSet,
// const BucketSet& bucketSet);
- BucketServerLocationPtr findNextServer(
+ std::shared_ptr<BucketServerLocation> findNextServer(
const ServerToBucketsMap& serverToBucketsMap,
const BucketSet& currentBucketSet);
- typedef std::unordered_map<int32_t, CacheableHashSetPtr> BucketToKeysMap;
- typedef std::shared_ptr<BucketToKeysMap> BucketToKeysMapPtr;
- BucketToKeysMapPtr groupByBucketOnClientSide(
- const RegionPtr& region, const CacheableVectorPtr& keySet,
- const ClientMetadataPtr& metadata);
-
- typedef std::unordered_map<BucketServerLocationPtr, CacheableHashSetPtr,
- dereference_hash<BucketServerLocationPtr>,
- dereference_equal_to<BucketServerLocationPtr>>
+ typedef std::unordered_map<int32_t, std::shared_ptr<CacheableHashSet>>
+ BucketToKeysMap;
+ std::shared_ptr<BucketToKeysMap> groupByBucketOnClientSide(
+ const std::shared_ptr<Region>& region,
+ const std::shared_ptr<CacheableVector>& keySet,
+ const std::shared_ptr<ClientMetadata>& metadata);
+
+ typedef std::unordered_map<
+ std::shared_ptr<BucketServerLocation>, std::shared_ptr<CacheableHashSet>,
+ dereference_hash<std::shared_ptr<BucketServerLocation>>,
+ dereference_equal_to<std::shared_ptr<BucketServerLocation>>>
ServerToKeysMap;
- typedef std::shared_ptr<ServerToKeysMap> ServerToKeysMapPtr;
- ServerToKeysMapPtr getServerToFilterMapFESHOP(
- const CacheableVectorPtr& keySet, const RegionPtr& region,
- bool isPrimary);
+ std::shared_ptr<ServerToKeysMap> getServerToFilterMapFESHOP(
+ const std::shared_ptr<CacheableVector>& keySet,
+ const std::shared_ptr<Region>& region, bool isPrimary);
- ClientMetadataService::ServerToBucketsMapPtr groupByServerToAllBuckets(
- const RegionPtr& region, bool optimizeForWrite);
+ std::shared_ptr<ClientMetadataService::ServerToBucketsMap>
+ groupByServerToAllBuckets(const std::shared_ptr<Region>& region,
+ bool optimizeForWrite);
- ClientMetadataService::ServerToBucketsMapPtr groupByServerToBuckets(
- const ClientMetadataPtr& metadata, const BucketSet& bucketSet,
- bool optimizeForWrite);
+ std::shared_ptr<ClientMetadataService::ServerToBucketsMap>
+ groupByServerToBuckets(const std::shared_ptr<ClientMetadata>& metadata,
+ const BucketSet& bucketSet, bool optimizeForWrite);
- ClientMetadataService::ServerToBucketsMapPtr pruneNodes(
- const ClientMetadataPtr& metadata, const BucketSet& buckets);
+ std::shared_ptr<ClientMetadataService::ServerToBucketsMap> pruneNodes(
+ const std::shared_ptr<ClientMetadata>& metadata,
+ const BucketSet& buckets);
private:
- // const PartitionResolverPtr& getResolver(const RegionPtr& region, const
- // CacheableKeyPtr& key,
- // const SerializablePtr& aCallbackArgument);
+ // const std::shared_ptr<PartitionResolver>& getResolver(const
+ // std::shared_ptr<Region>& region, const std::shared_ptr<CacheableKey>& key,
+ // const std::shared_ptr<Serializable>& aCallbackArgument);
- // BucketServerLocation getServerLocation(ClientMetadataPtr cptr, int
- // bucketId, bool isPrimary);
+ // BucketServerLocation getServerLocation(std::shared_ptr<ClientMetadata>
+ // cptr, int bucketId, bool isPrimary);
- ClientMetadataPtr SendClientPRMetadata(const char* regionPath,
- ClientMetadataPtr cptr);
+ std::shared_ptr<ClientMetadata> SendClientPRMetadata(
+ const char* regionPath, std::shared_ptr<ClientMetadata> cptr);
- ClientMetadataPtr getClientMetadata(const RegionPtr& region);
+ std::shared_ptr<ClientMetadata> getClientMetadata(const std::shared_ptr<Region>& region);
private:
// ACE_Recursive_Thread_Mutex m_regionMetadataLock;
diff --git a/cppcache/src/ClientProxyMembershipID.cpp b/cppcache/src/ClientProxyMembershipID.cpp
index d9aa1fb..faebe7f 100644
--- a/cppcache/src/ClientProxyMembershipID.cpp
+++ b/cppcache/src/ClientProxyMembershipID.cpp
@@ -220,7 +220,7 @@ void ClientProxyMembershipID::fromData(DataInput& input) {
// deserialization for PR FX HA
uint8_t* hostAddr;
int32_t len, hostPort, dcport, vPID;
- CacheableStringPtr hostname, dsName, uniqueTag, durableClientId;
+ std::shared_ptr<CacheableString> hostname, dsName, uniqueTag, durableClientId;
int8_t splitbrain, vmKind;
len = input.readArrayLen(); // inetaddress len
@@ -266,7 +266,7 @@ void ClientProxyMembershipID::fromData(DataInput& input) {
Serializable* ClientProxyMembershipID::readEssentialData(DataInput& input) {
uint8_t* hostAddr;
int32_t len, hostPort, vmViewId = 0;
- CacheableStringPtr hostname, dsName, uniqueTag, vmViewIdstr;
+ std::shared_ptr<CacheableString> hostname, dsName, uniqueTag, vmViewIdstr;
len = input.readArrayLen(); // inetaddress len
m_hostAddrLocalMem = true;
diff --git a/cppcache/src/ClientProxyMembershipID.hpp b/cppcache/src/ClientProxyMembershipID.hpp
index 991e0c7..fa3d8a7 100644
--- a/cppcache/src/ClientProxyMembershipID.hpp
+++ b/cppcache/src/ClientProxyMembershipID.hpp
@@ -32,7 +32,6 @@ namespace geode {
namespace client {
class ClientProxyMembershipID;
-typedef std::shared_ptr<ClientProxyMembershipID> ClientProxyMembershipIDPtr;
class ClientProxyMembershipID : public DSMemberForVersionStamp {
public:
@@ -94,10 +93,10 @@ class ClientProxyMembershipID : public DSMemberForVersionStamp {
offset += ACE_OS::snprintf(hostInfo + offset, 255 - offset, ":%x",
m_hostAddr[i]);
}
- CacheableStringPtr tempHashCode = CacheableString::create(hostInfo, offset);
- result = result + tempHashCode->hashcode();
- result = result + m_hostPort;
- return result;
+ auto tempHashCode = CacheableString::create(hostInfo, offset);
+ result = result + tempHashCode->hashcode();
+ result = result + m_hostPort;
+ return result;
}
virtual bool operator==(const CacheableKey& other) const {
diff --git a/cppcache/src/ConcurrentEntriesMap.cpp b/cppcache/src/ConcurrentEntriesMap.cpp
index b1bd1fa..d3978c1 100644
--- a/cppcache/src/ConcurrentEntriesMap.cpp
+++ b/cppcache/src/ConcurrentEntriesMap.cpp
@@ -70,12 +70,12 @@ void ConcurrentEntriesMap::clear() {
ConcurrentEntriesMap::~ConcurrentEntriesMap() { delete[] m_segments; }
-GfErrType ConcurrentEntriesMap::create(const CacheableKeyPtr& key,
- const CacheablePtr& newValue,
- MapEntryImplPtr& me,
- CacheablePtr& oldValue, int updateCount,
- int destroyTracker,
- VersionTagPtr versionTag) {
+GfErrType ConcurrentEntriesMap::create(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& newValue,
+ std::shared_ptr<MapEntryImpl>& me, std::shared_ptr<Cacheable>& oldValue,
+ int updateCount, int destroyTracker,
+ std::shared_ptr<VersionTag> versionTag) {
GfErrType err = GF_NOERR;
if ((err = segmentFor(key)->create(key, newValue, me, oldValue, updateCount,
destroyTracker, versionTag)) == GF_NOERR &&
@@ -85,10 +85,10 @@ GfErrType ConcurrentEntriesMap::create(const CacheableKeyPtr& key,
return err;
}
-GfErrType ConcurrentEntriesMap::invalidate(const CacheableKeyPtr& key,
- MapEntryImplPtr& me,
- CacheablePtr& oldValue,
- VersionTagPtr versionTag) {
+GfErrType ConcurrentEntriesMap::invalidate(
+ const std::shared_ptr<CacheableKey>& key, std::shared_ptr<MapEntryImpl>& me,
+ std::shared_ptr<Cacheable>& oldValue,
+ std::shared_ptr<VersionTag> versionTag) {
bool isTokenAdded = false;
GfErrType err =
segmentFor(key)->invalidate(key, me, oldValue, versionTag, isTokenAdded);
@@ -98,12 +98,13 @@ GfErrType ConcurrentEntriesMap::invalidate(const CacheableKeyPtr& key,
return err;
}
-GfErrType ConcurrentEntriesMap::put(const CacheableKeyPtr& key,
- const CacheablePtr& newValue,
- MapEntryImplPtr& me, CacheablePtr& oldValue,
+GfErrType ConcurrentEntriesMap::put(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& newValue,
+ std::shared_ptr<MapEntryImpl>& me,
+ std::shared_ptr<Cacheable>& oldValue,
int updateCount, int destroyTracker,
- VersionTagPtr versionTag, bool& isUpdate,
- DataInput* delta) {
+ std::shared_ptr<VersionTag> versionTag,
+ bool& isUpdate, DataInput* delta) {
GfErrType err = GF_NOERR;
if ((err = segmentFor(key)->put(key, newValue, me, oldValue, updateCount,
destroyTracker, isUpdate, versionTag,
@@ -116,21 +117,23 @@ GfErrType ConcurrentEntriesMap::put(const CacheableKeyPtr& key,
return err;
}
-bool ConcurrentEntriesMap::get(const CacheableKeyPtr& key, CacheablePtr& value,
- MapEntryImplPtr& me) {
+bool ConcurrentEntriesMap::get(const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<Cacheable>& value,
+ std::shared_ptr<MapEntryImpl>& me) {
return segmentFor(key)->getEntry(key, me, value);
}
-void ConcurrentEntriesMap::getEntry(const CacheableKeyPtr& key,
- MapEntryImplPtr& result,
- CacheablePtr& value) const {
+void ConcurrentEntriesMap::getEntry(const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& result,
+ std::shared_ptr<Cacheable>& value) const {
segmentFor(key)->getEntry(key, result, value);
}
-GfErrType ConcurrentEntriesMap::remove(const CacheableKeyPtr& key,
- CacheablePtr& result,
- MapEntryImplPtr& me, int updateCount,
- VersionTagPtr versionTag,
+GfErrType ConcurrentEntriesMap::remove(const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<Cacheable>& result,
+ std::shared_ptr<MapEntryImpl>& me,
+ int updateCount,
+ std::shared_ptr<VersionTag> versionTag,
bool afterRemote) {
bool isEntryFound = true;
GfErrType err;
@@ -142,26 +145,30 @@ GfErrType ConcurrentEntriesMap::remove(const CacheableKeyPtr& key,
return err;
}
-bool ConcurrentEntriesMap::containsKey(const CacheableKeyPtr& key) const {
+bool ConcurrentEntriesMap::containsKey(
+ const std::shared_ptr<CacheableKey>& key) const {
// MapSegment* segment = segmentFor( key );
return segmentFor(key)->containsKey(key);
}
-void ConcurrentEntriesMap::getKeys(VectorOfCacheableKey& result) const {
+void ConcurrentEntriesMap::getKeys(
+ std::vector<std::shared_ptr<CacheableKey>>& result) const {
result.reserve(this->size());
for (int index = 0; index < m_concurrency; ++index) {
m_segments[index].getKeys(result);
}
}
-void ConcurrentEntriesMap::getEntries(VectorOfRegionEntry& result) const {
+void ConcurrentEntriesMap::getEntries(
+ std::vector<std::shared_ptr<RegionEntry>>& result) const {
result.reserve(this->size());
for (int index = 0; index < m_concurrency; ++index) {
m_segments[index].getEntries(result);
}
}
-void ConcurrentEntriesMap::getValues(VectorOfCacheable& result) const {
+void ConcurrentEntriesMap::getValues(
+ std::vector<std::shared_ptr<Cacheable>>& result) const {
result.reserve(this->size());
for (int index = 0; index < m_concurrency; ++index) {
m_segments[index].getValues(result);
@@ -170,11 +177,10 @@ void ConcurrentEntriesMap::getValues(VectorOfCacheable& result) const {
uint32_t ConcurrentEntriesMap::size() const { return m_size; }
-int ConcurrentEntriesMap::addTrackerForEntry(const CacheableKeyPtr& key,
- CacheablePtr& oldValue,
- bool addIfAbsent,
- bool failIfPresent,
- bool incUpdateCount) {
+int ConcurrentEntriesMap::addTrackerForEntry(
+ const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<Cacheable>& oldValue, bool addIfAbsent, bool failIfPresent,
+ bool incUpdateCount) {
// This function is disabled if concurrency checks are enabled. The versioning
// changes takes care of the version and no need for tracking the entry
if (m_concurrencyChecksEnabled) return -1;
@@ -182,7 +188,8 @@ int ConcurrentEntriesMap::addTrackerForEntry(const CacheableKeyPtr& key,
failIfPresent, incUpdateCount);
}
-void ConcurrentEntriesMap::removeTrackerForEntry(const CacheableKeyPtr& key) {
+void ConcurrentEntriesMap::removeTrackerForEntry(
+ const std::shared_ptr<CacheableKey>& key) {
// This function is disabled if concurrency checks are enabled. The versioning
// changes takes care of the version and no need for tracking the entry
if (m_concurrencyChecksEnabled) return;
@@ -230,12 +237,14 @@ void ConcurrentEntriesMap::reapTombstones(
m_segments[index].reapTombstones(gcVersions);
}
}
-void ConcurrentEntriesMap::reapTombstones(CacheableHashSetPtr removedKeys) {
+void ConcurrentEntriesMap::reapTombstones(
+ std::shared_ptr<CacheableHashSet> removedKeys) {
for (int index = 0; index < m_concurrency; ++index) {
m_segments[index].reapTombstones(removedKeys);
}
}
-GfErrType ConcurrentEntriesMap::isTombstone(CacheableKeyPtr& key,
- MapEntryImplPtr& me, bool& result) {
+GfErrType ConcurrentEntriesMap::isTombstone(std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& me,
+ bool& result) {
return segmentFor(key)->isTombstone(key, me, result);
}
diff --git a/cppcache/src/ConcurrentEntriesMap.hpp b/cppcache/src/ConcurrentEntriesMap.hpp
index 72c7bdc..773c79a 100644
--- a/cppcache/src/ConcurrentEntriesMap.hpp
+++ b/cppcache/src/ConcurrentEntriesMap.hpp
@@ -51,14 +51,15 @@ class CPPCACHE_EXPORT ConcurrentEntriesMap : public EntriesMap {
* Return a reference to the segment for which the given key would
* be stored.
*/
- virtual MapSegment* segmentFor(const CacheableKeyPtr& key) const {
+ virtual MapSegment* segmentFor(
+ const std::shared_ptr<CacheableKey>& key) const {
return &(m_segments[segmentIdx(key)]);
}
/**
* Return the segment index number for the given key.
*/
- inline int segmentIdx(const CacheableKeyPtr& key) const {
+ inline int segmentIdx(const std::shared_ptr<CacheableKey>& key) const {
return segmentIdx(key->hashcode());
}
@@ -87,66 +88,78 @@ class CPPCACHE_EXPORT ConcurrentEntriesMap : public EntriesMap {
virtual void clear();
- virtual GfErrType put(const CacheableKeyPtr& key,
- const CacheablePtr& newValue, MapEntryImplPtr& me,
- CacheablePtr& oldValue, int updateCount,
- int destroyTracker, VersionTagPtr versionTag,
+ virtual GfErrType put(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& newValue,
+ std::shared_ptr<MapEntryImpl>& me,
+ std::shared_ptr<Cacheable>& oldValue, int updateCount,
+ int destroyTracker,
+ std::shared_ptr<VersionTag> versionTag,
bool& isUpdate = EntriesMap::boolVal,
DataInput* delta = nullptr);
- virtual GfErrType invalidate(const CacheableKeyPtr& key, MapEntryImplPtr& me,
- CacheablePtr& oldValue,
- VersionTagPtr versionTag);
- virtual GfErrType create(const CacheableKeyPtr& key,
- const CacheablePtr& newValue, MapEntryImplPtr& me,
- CacheablePtr& oldValue, int updateCount,
- int destroyTracker, VersionTagPtr versionTag);
- virtual bool get(const CacheableKeyPtr& key, CacheablePtr& value,
- MapEntryImplPtr& me);
+ virtual GfErrType invalidate(const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& me,
+ std::shared_ptr<Cacheable>& oldValue,
+ std::shared_ptr<VersionTag> versionTag);
+ virtual GfErrType create(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& newValue,
+ std::shared_ptr<MapEntryImpl>& me,
+ std::shared_ptr<Cacheable>& oldValue,
+ int updateCount, int destroyTracker,
+ std::shared_ptr<VersionTag> versionTag);
+ virtual bool get(const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<Cacheable>& value,
+ std::shared_ptr<MapEntryImpl>& me);
/**
* @brief get MapEntry for key.
* TODO: return GfErrType like other methods
*/
- virtual void getEntry(const CacheableKeyPtr& key, MapEntryImplPtr& result,
- CacheablePtr& value) const;
+ virtual void getEntry(const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& result,
+ std::shared_ptr<Cacheable>& value) const;
/**
* @brief remove the entry for key from the map.
*/
- virtual GfErrType remove(const CacheableKeyPtr& key, CacheablePtr& result,
- MapEntryImplPtr& me, int updateCount,
- VersionTagPtr versionTag, bool afterRemote);
+ virtual GfErrType remove(const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<Cacheable>& result,
+ std::shared_ptr<MapEntryImpl>& me, int updateCount,
+ std::shared_ptr<VersionTag> versionTag,
+ bool afterRemote);
/**
* @brief return true if there exists an entry for the key.
*/
- virtual bool containsKey(const CacheableKeyPtr& key) const;
+ virtual bool containsKey(const std::shared_ptr<CacheableKey>& key) const;
/**
* @brief return the all the keys in a list.
*/
- virtual void getKeys(VectorOfCacheableKey& result) const;
+ virtual void getKeys(
+ std::vector<std::shared_ptr<CacheableKey>>& result) const;
/**
* @brief return all the entries in a list.
*/
- virtual void getEntries(VectorOfRegionEntry& result) const;
+ virtual void getEntries(
+ std::vector<std::shared_ptr<RegionEntry>>& result) const;
/**
* @brief return all values in a list.
*/
- virtual void getValues(VectorOfCacheable& result) const;
+ virtual void getValues(std::vector<std::shared_ptr<Cacheable>>& result) const;
/**
* @brief return the number of entries in the map.
*/
virtual uint32_t size() const;
- virtual int addTrackerForEntry(const CacheableKeyPtr& key,
- CacheablePtr& oldValue, bool addIfAbsent,
- bool failIfPresent, bool incUpdateCount);
+ virtual int addTrackerForEntry(const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<Cacheable>& oldValue,
+ bool addIfAbsent, bool failIfPresent,
+ bool incUpdateCount);
- virtual void removeTrackerForEntry(const CacheableKeyPtr& key);
+ virtual void removeTrackerForEntry(const std::shared_ptr<CacheableKey>& key);
virtual int addTrackerForAllEntries(MapOfUpdateCounters& updateCounterMap,
bool addDestroyTracking);
@@ -154,12 +167,13 @@ class CPPCACHE_EXPORT ConcurrentEntriesMap : public EntriesMap {
virtual void removeDestroyTracking();
virtual void reapTombstones(std::map<uint16_t, int64_t>& gcVersions);
- virtual void reapTombstones(CacheableHashSetPtr removedKeys);
+ virtual void reapTombstones(std::shared_ptr<CacheableHashSet> removedKeys);
/**
* for internal testing, returns if an entry is a tombstone
*/
- virtual GfErrType isTombstone(CacheableKeyPtr& key, MapEntryImplPtr& me,
+ virtual GfErrType isTombstone(std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& me,
bool& result);
/**
diff --git a/cppcache/src/CqAttributesFactory.cpp b/cppcache/src/CqAttributesFactory.cpp
index 7d94f82..3cfdf72 100644
--- a/cppcache/src/CqAttributesFactory.cpp
+++ b/cppcache/src/CqAttributesFactory.cpp
@@ -23,14 +23,16 @@ using namespace apache::geode::client;
CqAttributesFactory::CqAttributesFactory() {
m_cqAttributes = std::make_shared<CqAttributesImpl>();
}
-CqAttributesFactory::CqAttributesFactory(const CqAttributesPtr &cqAttributes) {
+CqAttributesFactory::CqAttributesFactory(
+ const std::shared_ptr<CqAttributes> &cqAttributes) {
auto vl = cqAttributes->getCqListeners();
m_cqAttributes = std::make_shared<CqAttributesImpl>();
std::static_pointer_cast<CqAttributesImpl>(m_cqAttributes)
->setCqListeners(vl);
}
-void CqAttributesFactory::addCqListener(const CqListenerPtr &cqListener) {
+void CqAttributesFactory::addCqListener(
+ const std::shared_ptr<CqListener> &cqListener) {
if (cqListener == nullptr) {
throw IllegalArgumentException("addCqListener parameter was null");
}
@@ -43,8 +45,7 @@ void CqAttributesFactory::initCqListeners(
std::static_pointer_cast<CqAttributesImpl>(m_cqAttributes)
->setCqListeners(cqListeners);
}
-
-CqAttributesPtr CqAttributesFactory::create() {
- return CqAttributesPtr(
+std::shared_ptr<CqAttributes> CqAttributesFactory::create() {
+ return std::shared_ptr<CqAttributes>(
std::static_pointer_cast<CqAttributesImpl>(m_cqAttributes)->clone());
}
diff --git a/cppcache/src/CqAttributesImpl.cpp b/cppcache/src/CqAttributesImpl.cpp
index 42ce999..a7ff16b 100644
--- a/cppcache/src/CqAttributesImpl.cpp
+++ b/cppcache/src/CqAttributesImpl.cpp
@@ -27,7 +27,7 @@ CqAttributes::listener_container_type CqAttributesImpl::getCqListeners() {
return m_cqListeners;
}
-void CqAttributesImpl::addCqListener(const CqListenerPtr& cql) {
+void CqAttributesImpl::addCqListener(const std::shared_ptr<CqListener>& cql) {
if (cql == nullptr) {
throw IllegalArgumentException("addCqListener parameter was null");
}
@@ -67,15 +67,17 @@ void CqAttributesImpl::setCqListeners(
}
}
-void CqAttributesImpl::removeCqListener(const CqListenerPtr& cql) {
+void CqAttributesImpl::removeCqListener(
+ const std::shared_ptr<CqListener>& cql) {
if (cql == nullptr) {
throw IllegalArgumentException("removeCqListener parameter was null");
}
ACE_Guard<ACE_Recursive_Thread_Mutex> _guard(m_mutex);
if (!m_cqListeners.empty()) {
m_cqListeners.erase(
- std::remove_if(m_cqListeners.begin(), m_cqListeners.end(),
- [cql](CqListenerPtr l) -> bool { return cql == l; }),
+ std::remove_if(
+ m_cqListeners.begin(), m_cqListeners.end(),
+ [cql](std::shared_ptr<CqListener> l) -> bool { return cql == l; }),
m_cqListeners.end());
try {
cql->close();
diff --git a/cppcache/src/CqAttributesImpl.hpp b/cppcache/src/CqAttributesImpl.hpp
index 8f1a4de..8e2c747 100644
--- a/cppcache/src/CqAttributesImpl.hpp
+++ b/cppcache/src/CqAttributesImpl.hpp
@@ -58,10 +58,10 @@ class CPPCACHE_EXPORT CqAttributesImpl : public CqAttributes {
* @see CqListener
* @return CqListener Object, returns null if there is no CqListener.
*/
- CqListenerPtr getCqListener();
- void addCqListener(const CqListenerPtr& cql);
+ std::shared_ptr<CqListener> getCqListener();
+ void addCqListener(const std::shared_ptr<CqListener>& cql);
void setCqListeners(const listener_container_type& addedListeners);
- void removeCqListener(const CqListenerPtr& cql);
+ void removeCqListener(const std::shared_ptr<CqListener>& cql);
CqAttributesImpl* clone();
private:
diff --git a/cppcache/src/CqAttributesMutatorImpl.cpp b/cppcache/src/CqAttributesMutatorImpl.cpp
index 4af8a3e..9e14199 100644
--- a/cppcache/src/CqAttributesMutatorImpl.cpp
+++ b/cppcache/src/CqAttributesMutatorImpl.cpp
@@ -17,15 +17,18 @@
#include "CqAttributesMutatorImpl.hpp"
#include "CqAttributesImpl.hpp"
using namespace apache::geode::client;
-CqAttributesMutatorImpl::CqAttributesMutatorImpl(const CqAttributesPtr& impl)
+CqAttributesMutatorImpl::CqAttributesMutatorImpl(
+ const std::shared_ptr<CqAttributes>& impl)
: m_cqAttributes(impl) {}
-void CqAttributesMutatorImpl::addCqListener(const CqListenerPtr& aListener) {
+void CqAttributesMutatorImpl::addCqListener(
+ const std::shared_ptr<CqListener>& aListener) {
std::static_pointer_cast<CqAttributesImpl>(m_cqAttributes)
->addCqListener(aListener);
}
-void CqAttributesMutatorImpl::removeCqListener(const CqListenerPtr& aListener) {
+void CqAttributesMutatorImpl::removeCqListener(
+ const std::shared_ptr<CqListener>& aListener) {
std::static_pointer_cast<CqAttributesImpl>(m_cqAttributes)
->removeCqListener(aListener);
}
diff --git a/cppcache/src/CqAttributesMutatorImpl.hpp b/cppcache/src/CqAttributesMutatorImpl.hpp
index 389f93b..b0a8108 100644
--- a/cppcache/src/CqAttributesMutatorImpl.hpp
+++ b/cppcache/src/CqAttributesMutatorImpl.hpp
@@ -22,7 +22,6 @@
#include <geode/geode_globals.hpp>
#include <geode/geode_types.hpp>
-#include <geode/VectorT.hpp>
#include <geode/CqAttributesMutator.hpp>
#include <geode/CqAttributes.hpp>
@@ -45,14 +44,14 @@ namespace client {
*/
class CPPCACHE_EXPORT CqAttributesMutatorImpl : public CqAttributesMutator {
public:
- CqAttributesMutatorImpl(const CqAttributesPtr& impl);
+ CqAttributesMutatorImpl(const std::shared_ptr<CqAttributes>& impl);
/**
* Adds a CQ listener to the end of the list of CQ listeners on this CqQuery.
* @param aListener the user defined CQ listener to add to the CqQuery.
* @throws IllegalArgumentException if <code>aListener</code> is null
*/
- void addCqListener(const CqListenerPtr& aListener);
+ void addCqListener(const std::shared_ptr<CqListener>& aListener);
/**
* Removes given CQ listener from the list of CQ listeners on this CqQuery.
@@ -62,7 +61,7 @@ class CPPCACHE_EXPORT CqAttributesMutatorImpl : public CqAttributesMutator {
* @param aListener the CQ listener to remove from the CqQuery.
* @throws IllegalArgumentException if <code>aListener</code> is null
*/
- void removeCqListener(const CqListenerPtr& aListener);
+ void removeCqListener(const std::shared_ptr<CqListener>& aListener);
/**
* Adds the given set CqListner on this CQ. If the CQ already has CqListeners,
@@ -73,10 +72,10 @@ class CPPCACHE_EXPORT CqAttributesMutatorImpl : public CqAttributesMutator {
* @throws IllegalArgumentException if the <code>newListeners</code> array
* has a null element
*/
- void setCqListeners(const std::vector<CqListenerPtr>& newListeners);
+ void setCqListeners(const std::vector<std::shared_ptr<CqListener>>& newListeners);
private:
- CqAttributesPtr m_cqAttributes;
+ std::shared_ptr<CqAttributes> m_cqAttributes;
};
} // namespace client
} // namespace geode
diff --git a/cppcache/src/CqEventImpl.cpp b/cppcache/src/CqEventImpl.cpp
index 050c9cd..fe7d6e3 100644
--- a/cppcache/src/CqEventImpl.cpp
+++ b/cppcache/src/CqEventImpl.cpp
@@ -21,12 +21,14 @@
#include "TcrMessage.hpp"
using namespace apache::geode::client;
-CqEventImpl::CqEventImpl(CqQueryPtr& cQuery,
+CqEventImpl::CqEventImpl(std::shared_ptr<CqQuery>& cQuery,
CqOperation::CqOperationType baseOp,
CqOperation::CqOperationType cqOp,
- CacheableKeyPtr& key, CacheablePtr& value,
- ThinClientBaseDM* tcrdm, CacheableBytesPtr deltaBytes,
- EventIdPtr eventId)
+ std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<Cacheable>& value,
+ ThinClientBaseDM* tcrdm,
+ std::shared_ptr<CacheableBytes> deltaBytes,
+ std::shared_ptr<EventId> eventId)
: m_error(false) {
m_cQuery = cQuery;
m_queryOp = cqOp;
@@ -38,8 +40,7 @@ CqEventImpl::CqEventImpl(CqQueryPtr& cQuery,
m_deltaValue = deltaBytes;
m_eventId = eventId;
}
-
-CqQueryPtr CqEventImpl::getCq() const { return m_cQuery; }
+std::shared_ptr<CqQuery> CqEventImpl::getCq() const { return m_cQuery; }
CqOperation::CqOperationType CqEventImpl::getBaseOperation() const {
return m_baseOp;
@@ -56,14 +57,16 @@ CqOperation::CqOperationType CqEventImpl::getQueryOperation() const {
/**
* Get the key relating to the event.
* @return Object key.
- */
-CacheableKeyPtr CqEventImpl::getKey() const { return m_key; }
+ */ std::shared_ptr<CacheableKey>
+CqEventImpl::getKey() const {
+ return m_key;
+}
/**
* Get the new value of the modification.
* If there is no new value because this is a delete, then
* return null.
- */
-CacheablePtr CqEventImpl::getNewValue() const {
+ */ std::shared_ptr<Cacheable>
+CqEventImpl::getNewValue() const {
if (m_deltaValue == nullptr) {
return m_newValue;
} else {
@@ -82,7 +85,7 @@ CacheablePtr CqEventImpl::getNewValue() const {
err = static_cast<ThinClientCacheDistributionManager*>(m_tcrdm)
->sendRequestToPrimary(fullObjectMsg, reply);
}
- CacheablePtr fullObject = nullptr;
+ std::shared_ptr<Cacheable> fullObject = nullptr;
if (err == GF_NOERR) {
fullObject = reply.getValue();
}
@@ -101,5 +104,6 @@ std::string CqEventImpl::toString() {
m_newValue->toString()->asChar());
return buffer;
}
-
-CacheableBytesPtr CqEventImpl::getDeltaValue() const { return m_deltaValue; }
+std::shared_ptr<CacheableBytes> CqEventImpl::getDeltaValue() const {
+ return m_deltaValue;
+}
diff --git a/cppcache/src/CqEventImpl.hpp b/cppcache/src/CqEventImpl.hpp
index e742f1e..940fef4 100644
--- a/cppcache/src/CqEventImpl.hpp
+++ b/cppcache/src/CqEventImpl.hpp
@@ -49,15 +49,18 @@ namespace client {
*/
class ThinClientBaseDM;
-
+class EventId;
class CqEventImpl : public CqEvent {
public:
- CqEventImpl(CqQueryPtr& cQuery, CqOperation::CqOperationType baseOp,
- CqOperation::CqOperationType cqOp, CacheableKeyPtr& key,
- CacheablePtr& value, ThinClientBaseDM* tcrdm,
- CacheableBytesPtr deltaBytes, EventIdPtr eventId);
+ CqEventImpl(std::shared_ptr<CqQuery>& cQuery,
+ CqOperation::CqOperationType baseOp,
+ CqOperation::CqOperationType cqOp,
+ std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<Cacheable>& value, ThinClientBaseDM* tcrdm,
+ std::shared_ptr<CacheableBytes> deltaBytes,
+ std::shared_ptr<EventId> eventId);
- CqQueryPtr getCq() const;
+ std::shared_ptr<CqQuery> getCq() const;
/**
* Get the operation on the base region that triggered this event.
@@ -74,32 +77,32 @@ class CqEventImpl : public CqEvent {
* Get the key relating to the event.
* @return Object key.
*/
- CacheableKeyPtr getKey() const;
+ std::shared_ptr<CacheableKey> getKey() const;
/**
* Get the new value of the modification.
* If there is no new value because this is a delete, then
* return null.
*/
- CacheablePtr getNewValue() const;
+ std::shared_ptr<Cacheable> getNewValue() const;
bool getError();
std::string toString();
- CacheableBytesPtr getDeltaValue() const;
+ std::shared_ptr<CacheableBytes> getDeltaValue() const;
private:
CqEventImpl();
- CqQueryPtr m_cQuery;
+ std::shared_ptr<CqQuery> m_cQuery;
CqOperation::CqOperationType m_baseOp;
CqOperation::CqOperationType m_queryOp;
- CacheableKeyPtr m_key;
- CacheablePtr m_newValue;
+ std::shared_ptr<CacheableKey> m_key;
+ std::shared_ptr<Cacheable> m_newValue;
bool m_error;
ThinClientBaseDM* m_tcrdm;
- CacheableBytesPtr m_deltaValue;
- EventIdPtr m_eventId;
+ std::shared_ptr<CacheableBytes> m_deltaValue;
+ std::shared_ptr<EventId> m_eventId;
};
} // namespace client
} // namespace geode
diff --git a/cppcache/src/CqQueryImpl.cpp b/cppcache/src/CqQueryImpl.cpp
index 34887c1..fab6329 100644
--- a/cppcache/src/CqQueryImpl.cpp
+++ b/cppcache/src/CqQueryImpl.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-#include <geode/VectorT.hpp>
#include <geode/CqAttributesFactory.hpp>
#include <geode/ExceptionTypes.hpp>
@@ -31,12 +30,12 @@
using namespace apache::geode::client;
-CqQueryImpl::CqQueryImpl(const CqServicePtr& cqService,
- const std::string& cqName,
- const std::string& queryString,
- const CqAttributesPtr& cqAttributes,
- StatisticsFactory* factory, const bool isDurable,
- const UserAttributesPtr& userAttributesPtr)
+CqQueryImpl::CqQueryImpl(
+ const std::shared_ptr<CqService>& cqService, const std::string& cqName,
+ const std::string& queryString,
+ const std::shared_ptr<CqAttributes>& cqAttributes,
+ StatisticsFactory* factory, const bool isDurable,
+ const std::shared_ptr<UserAttributes>& userAttributesPtr)
: m_cqName(cqName),
m_queryString(queryString),
m_cqService(cqService),
@@ -181,7 +180,7 @@ void CqQueryImpl::addToCqMap() {
try {
LOGFINE("Adding to CQ Repository. CqName : %s Server CqName : %s",
m_cqName.c_str(), m_serverCqName.c_str());
- CqQueryPtr cq = shared_from_this();
+ std::shared_ptr<CqQuery> cq = shared_from_this();
m_cqService->addCq(m_cqName, cq);
} catch (Exception& ex) {
std::string errMsg =
@@ -221,14 +220,14 @@ const char* CqQueryImpl::getQueryString() const {
* Return the query
* @return the Query for the query string
*/
-QueryPtr CqQueryImpl::getQuery() const { return m_query; }
+ std::shared_ptr<Query> CqQueryImpl::getQuery() const { return m_query; }
/**
* @see org.apache.geode.cache.query.CqQuery#getStatistics()
*/
-const CqStatisticsPtr CqQueryImpl::getStatistics() const { return m_stats; }
+const std::shared_ptr<CqStatistics> CqQueryImpl::getStatistics() const { return m_stats; }
-const CqAttributesPtr CqQueryImpl::getCqAttributes() const {
+const std::shared_ptr<CqAttributes> CqQueryImpl::getCqAttributes() const {
return m_cqAttributes;
}
@@ -363,7 +362,7 @@ bool CqQueryImpl::executeCq(TcrMessage::MsgType requestType) {
}
// for EXECUTE_INITIAL_RESULTS_REQUEST :
-CqResultsPtr CqQueryImpl::executeWithInitialResults(
+std::shared_ptr<CqResults> CqQueryImpl::executeWithInitialResults(
std::chrono::milliseconds timeout) {
util::PROTOCOL_OPERATION_TIMEOUT_BOUNDS(timeout);
@@ -417,9 +416,9 @@ CqResultsPtr CqQueryImpl::executeWithInitialResults(
}
m_cqState = CqState::RUNNING;
updateStats();
- CqResultsPtr sr;
+ std::shared_ptr<CqResults> sr;
auto values = resultCollector->getQueryResults();
- const std::vector<CacheableStringPtr>& fieldNameVec =
+ const std::vector<std::shared_ptr<CacheableString>>& fieldNameVec =
resultCollector->getStructFieldNames();
int32_t sizeOfFieldNamesVec = static_cast<int32_t>(fieldNameVec.size());
if (sizeOfFieldNamesVec == 0) {
@@ -530,7 +529,7 @@ void CqQueryImpl::setCqState(CqState::StateType state) {
m_cqState = state;
}
-const CqAttributesMutatorPtr CqQueryImpl::getCqAttributesMutator() const {
+const std::shared_ptr<CqAttributesMutator> CqQueryImpl::getCqAttributesMutator() const {
return m_cqAttributesMutator;
}
/**
diff --git a/cppcache/src/CqQueryImpl.hpp b/cppcache/src/CqQueryImpl.hpp
index 3057204..cbf2047 100644
--- a/cppcache/src/CqQueryImpl.hpp
+++ b/cppcache/src/CqQueryImpl.hpp
@@ -59,18 +59,18 @@ class CqQueryImpl : public CqQuery,
protected:
std::string m_cqName;
std::string m_queryString;
- SelectResultsPtr m_cqResults;
+ std::shared_ptr<SelectResults> m_cqResults;
private:
- QueryPtr m_query;
- CqAttributesPtr m_cqAttributes;
- CqAttributesMutatorPtr m_cqAttributesMutator;
- CqServicePtr m_cqService;
+ std::shared_ptr<Query> m_query;
+ std::shared_ptr<CqAttributes> m_cqAttributes;
+ std::shared_ptr<CqAttributesMutator> m_cqAttributesMutator;
+ std::shared_ptr<CqService> m_cqService;
std::string m_serverCqName;
bool m_isDurable;
// Stats counters
- CqStatisticsPtr m_stats;
+ std::shared_ptr<CqStatistics> m_stats;
CqState::StateType m_cqState;
CqOperation::CqOperationType m_cqOperation;
@@ -92,12 +92,12 @@ class CqQueryImpl : public CqQuery,
* Constructor.
*/
public:
- CqQueryImpl(const CqServicePtr& cqService, const std::string& cqName,
- const std::string& queryString,
- const CqAttributesPtr& cqAttributes,
- statistics::StatisticsFactory* factory,
- const bool isDurable = false,
- const UserAttributesPtr& userAttributesPtr = nullptr);
+ CqQueryImpl(
+ const std::shared_ptr<CqService>& cqService, const std::string& cqName,
+ const std::string& queryString,
+ const std::shared_ptr<CqAttributes>& cqAttributes,
+ statistics::StatisticsFactory* factory, const bool isDurable = false,
+ const std::shared_ptr<UserAttributes>& userAttributesPtr = nullptr);
virtual ~CqQueryImpl();
@@ -155,20 +155,20 @@ class CqQueryImpl : public CqQuery,
* Return the query after replacing region names with parameters
* @return the Query for the query string
*/
- QueryPtr getQuery() const override;
+ std::shared_ptr<Query> getQuery() const override;
/**
* @see org.apache.geode.cache.query.CqQuery#getStatistics()
*/
- const CqStatisticsPtr getStatistics() const override;
+ const std::shared_ptr<CqStatistics> getStatistics() const override;
CqQueryVsdStats& getVsdStats() {
return *dynamic_cast<CqQueryVsdStats*>(m_stats.get());
}
- const CqAttributesPtr getCqAttributes() const override;
+ const std::shared_ptr<CqAttributes> getCqAttributes() const override;
- RegionPtr getCqBaseRegion();
+ std::shared_ptr<Region> getCqBaseRegion();
/**
* Clears the resource used by CQ.
@@ -179,7 +179,7 @@ class CqQueryImpl : public CqQuery,
/**
* @return Returns the cqListeners.
*/
- void getCqListeners(std::vector<CqListenerPtr>& cqListener);
+ void getCqListeners(std::vector<std::shared_ptr<CqListener>>& cqListener);
/**
* Start or resume executing the query.
@@ -197,7 +197,8 @@ class CqQueryImpl : public CqQuery,
* Start or resume executing the query.
* Gets or updates the CQ results and returns them.
*/
- CqResultsPtr executeWithInitialResults(std::chrono::milliseconds timeout) override;
+ std::shared_ptr<CqResults> executeWithInitialResults(
+ std::chrono::milliseconds timeout) override;
/**
* This is called when the new server comes-up.
@@ -223,7 +224,8 @@ class CqQueryImpl : public CqQuery,
*/
void setCqState(CqState::StateType state);
- const CqAttributesMutatorPtr getCqAttributesMutator() const override;
+ const std::shared_ptr<CqAttributesMutator> getCqAttributesMutator()
+ const override;
/**
* @return Returns the cqOperation.
@@ -272,7 +274,7 @@ class CqQueryImpl : public CqQuery,
ACE_Recursive_Thread_Mutex m_mutex;
void sendStopOrClose(TcrMessage::MsgType requestType);
ThinClientBaseDM* m_tccdm;
- ProxyCachePtr m_proxyCache;
+ std::shared_ptr<ProxyCache> m_proxyCache;
FRIEND_STD_SHARED_PTR(CqQueryImpl)
};
diff --git a/cppcache/src/CqService.cpp b/cppcache/src/CqService.cpp
index b47780d..ddfe2c5 100644
--- a/cppcache/src/CqService.cpp
+++ b/cppcache/src/CqService.cpp
@@ -81,11 +81,9 @@ bool CqService::checkAndAcquireLock() {
return false;
}
}
-
-CqQueryPtr CqService::newCq(const std::string& cqName,
- const std::string& queryString,
- const CqAttributesPtr& cqAttributes,
- bool isDurable) {
+std::shared_ptr<CqQuery> CqService::newCq(
+ const std::string& cqName, const std::string& queryString,
+ const std::shared_ptr<CqAttributes>& cqAttributes, bool isDurable) {
if (queryString.empty()) {
throw IllegalArgumentException("Null queryString is passed. ");
} else if (cqAttributes == nullptr) {
@@ -121,26 +119,25 @@ CqQueryPtr CqService::newCq(const std::string& cqName,
("CQ with the given name already exists. CqName : " + cqName).c_str());
}
- UserAttributesPtr ua = nullptr;
- if (m_tccdm != nullptr && m_tccdm->isMultiUserMode()) {
- ua =
- TSSUserAttributesWrapper::s_geodeTSSUserAttributes->getUserAttributes();
- }
+std::shared_ptr<UserAttributes> ua = nullptr;
+if (m_tccdm != nullptr && m_tccdm->isMultiUserMode()) {
+ ua = TSSUserAttributesWrapper::s_geodeTSSUserAttributes->getUserAttributes();
+}
- auto cQuery = std::make_shared<CqQueryImpl>(
- shared_from_this(), cqName, queryString, cqAttributes,
- m_statisticsFactory, isDurable, ua);
- cQuery->initCq();
- return cQuery;
+auto cQuery = std::make_shared<CqQueryImpl>(shared_from_this(), cqName,
+ queryString, cqAttributes,
+ m_statisticsFactory, isDurable, ua);
+cQuery->initCq();
+return cQuery;
}
/**
* Adds the given CQ and cqQuery object into the CQ map.
*/
-void CqService::addCq(const std::string& cqName, CqQueryPtr& cq) {
+void CqService::addCq(const std::string& cqName, std::shared_ptr<CqQuery>& cq) {
try {
MapOfRegionGuard guard(m_cqQueryMap->mutex());
- CqQueryPtr tmp;
+ std::shared_ptr<CqQuery> tmp;
if (0 == m_cqQueryMap->find(cqName, tmp)) {
throw CqExistsException("CQ with given name already exists. ");
}
@@ -165,10 +162,9 @@ void CqService::removeCq(const std::string& cqName) {
/**
* Retrieve a CqQuery by name.
* @return the CqQuery or null if not found
- */
-CqQueryPtr CqService::getCq(const std::string& cqName) {
+ */ std::shared_ptr<CqQuery> CqService::getCq(const std::string& cqName) {
MapOfRegionGuard guard(m_cqQueryMap->mutex());
- CqQueryPtr tmp;
+ std::shared_ptr<CqQuery> tmp;
if (0 != m_cqQueryMap->find(cqName, tmp)) {
LOGWARN("Failed to get the specified CQ: %s", cqName.c_str());
} else {
@@ -344,8 +340,7 @@ void CqService::closeCqs(query_container_type& cqs) {
/**
* Get statistics information for all CQs
* @return the CqServiceStatistics
- */
-CqServiceStatisticsPtr CqService::getCqServiceStatistics() { return m_stats; }
+ */ std::shared_ptr<CqServiceStatistics> CqService::getCqServiceStatistics() { return m_stats; }
/**
* Close the CQ Service after cleanup if any.
@@ -391,7 +386,7 @@ bool CqService::isCqExists(const std::string& cqName) {
bool status = false;
try {
MapOfRegionGuard guard(m_cqQueryMap->mutex());
- CqQueryPtr tmp;
+ std::shared_ptr<CqQuery> tmp;
status = (0 == m_cqQueryMap->find(cqName, tmp));
} catch (Exception& ex) {
LOGFINE("Exception (%s) in isCQExists, ignored ",
@@ -414,10 +409,11 @@ void CqService::receiveNotification(TcrMessage* msg) {
* @param value
*/
void CqService::invokeCqListeners(const std::map<std::string, int>* cqs,
- uint32_t messageType, CacheableKeyPtr key,
- CacheablePtr value,
- CacheableBytesPtr deltaValue,
- EventIdPtr eventId) {
+ uint32_t messageType,
+ std::shared_ptr<CacheableKey> key,
+ std::shared_ptr<Cacheable> value,
+ std::shared_ptr<CacheableBytes> deltaValue,
+ std::shared_ptr<EventId> eventId) {
LOGDEBUG("CqService::invokeCqListeners");
for (const auto& kv : *cqs) {
const auto cqName = kv.first;
@@ -560,8 +556,7 @@ CqOperation::CqOperationType CqService::getOperation(int eventType) {
*
* @return List of names of registered durable CQs, empty list if no durable
* cqs.
- */
-CacheableArrayListPtr CqService::getAllDurableCqsFromServer() {
+ */ std::shared_ptr<CacheableArrayList> CqService::getAllDurableCqsFromServer() {
TcrMessageGetDurableCqs msg(m_tccdm->getConnectionManager()
.getCacheImpl()
->getCache()
@@ -596,7 +591,7 @@ CacheableArrayListPtr CqService::getAllDurableCqsFromServer() {
}
}
- CacheableArrayListPtr tmpRes = resultCollector->getResults();
+ auto tmpRes = resultCollector->getResults();
delete resultCollector;
return tmpRes;
}
diff --git a/cppcache/src/CqService.hpp b/cppcache/src/CqService.hpp
index a502604..e811172 100644
--- a/cppcache/src/CqService.hpp
+++ b/cppcache/src/CqService.hpp
@@ -73,7 +73,7 @@ class CPPCACHE_EXPORT CqService
bool m_running;
MapOfCqQueryWithLock* m_cqQueryMap;
- CqServiceStatisticsPtr m_stats;
+ std::shared_ptr<CqServiceStatistics> m_stats;
inline bool noCq() const {
MapOfRegionGuard guard(m_cqQueryMap->mutex());
@@ -81,7 +81,7 @@ class CPPCACHE_EXPORT CqService
}
public:
- typedef std::vector<CqQueryPtr> query_container_type;
+ typedef std::vector<std::shared_ptr<CqQuery>> query_container_type;
/**
* Constructor.
@@ -133,14 +133,15 @@ class CPPCACHE_EXPORT CqService
* release.
*
*/
- CqQueryPtr newCq(const std::string& cqName, const std::string& queryString,
- const CqAttributesPtr& cqAttributes,
- const bool isDurable = false);
+ std::shared_ptr<CqQuery> newCq(
+ const std::string& cqName, const std::string& queryString,
+ const std::shared_ptr<CqAttributes>& cqAttributes,
+ const bool isDurable = false);
/**
* Adds the given CQ and cqQuery object into the CQ map.
*/
- void addCq(const std::string& cqName, CqQueryPtr& cq);
+ void addCq(const std::string& cqName, std::shared_ptr<CqQuery>& cq);
/**
* Removes given CQ from the cqMap..
@@ -150,7 +151,7 @@ class CPPCACHE_EXPORT CqService
* Retrieve a CqQuery by name.
* @return the CqQuery or null if not found
*/
- CqQueryPtr getCq(const std::string& cqName);
+ std::shared_ptr<CqQuery> getCq(const std::string& cqName);
/**
* Clears the CQ Query Map.
@@ -201,7 +202,7 @@ class CPPCACHE_EXPORT CqService
* Get statistics information for all CQs
* @return the CqServiceStatistics
*/
- CqServiceStatisticsPtr getCqServiceStatistics();
+ std::shared_ptr<CqServiceStatistics> getCqServiceStatistics();
/**
* Close the CQ Service after cleanup if any.
@@ -228,9 +229,11 @@ class CPPCACHE_EXPORT CqService
* @param value
*/
void invokeCqListeners(const std::map<std::string, int>* cqs,
- uint32_t messageType, CacheableKeyPtr key,
- CacheablePtr value, CacheableBytesPtr deltaValue,
- EventIdPtr eventId);
+ uint32_t messageType,
+ std::shared_ptr<CacheableKey> key,
+ std::shared_ptr<Cacheable> value,
+ std::shared_ptr<CacheableBytes> deltaValue,
+ std::shared_ptr<EventId> eventId);
/**
* Returns the Operation for the given EnumListenerEvent type.
* @param eventType
@@ -246,13 +249,12 @@ class CPPCACHE_EXPORT CqService
* @return List of names of registered durable CQs, empty list if no durable
* cqs.
*/
- CacheableArrayListPtr getAllDurableCqsFromServer();
+ std::shared_ptr<CacheableArrayList> getAllDurableCqsFromServer();
void invokeCqConnectedListeners(const std::string& poolName,
const bool connected);
};
-typedef std::shared_ptr<CqService> CqServicePtr;
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/DSMemberForVersionStamp.hpp b/cppcache/src/DSMemberForVersionStamp.hpp
index 4fbfb5e..99d64cc 100644
--- a/cppcache/src/DSMemberForVersionStamp.hpp
+++ b/cppcache/src/DSMemberForVersionStamp.hpp
@@ -28,7 +28,6 @@ namespace apache {
namespace geode {
namespace client {
class DSMemberForVersionStamp;
-typedef std::shared_ptr<DSMemberForVersionStamp> DSMemberForVersionStampPtr;
class DSMemberForVersionStamp : public CacheableKey {
public:
diff --git a/cppcache/src/DataInput.cpp b/cppcache/src/DataInput.cpp
index bf195ea..c3a308d 100644
--- a/cppcache/src/DataInput.cpp
+++ b/cppcache/src/DataInput.cpp
@@ -24,8 +24,7 @@
namespace apache {
namespace geode {
namespace client {
-
-SerializablePtr DataInput::readObjectInternal(int8_t typeId) {
+std::shared_ptr<Serializable> DataInput::readObjectInternal(int8_t typeId) {
return getSerializationRegistry().deserialize(*this, typeId);
}
diff --git a/cppcache/src/DefaultResultCollector.cpp b/cppcache/src/DefaultResultCollector.cpp
index 305e5c9..7d33593 100644
--- a/cppcache/src/DefaultResultCollector.cpp
+++ b/cppcache/src/DefaultResultCollector.cpp
@@ -23,8 +23,7 @@ DefaultResultCollector::DefaultResultCollector()
: resultList(CacheableVector::create()), ready(false) {}
DefaultResultCollector::~DefaultResultCollector() noexcept {}
-
-CacheableVectorPtr DefaultResultCollector::getResult(
+std::shared_ptr<CacheableVector> DefaultResultCollector::getResult(
std::chrono::milliseconds timeout) {
std::unique_lock<std::mutex> lk(readyMutex);
if (readyCondition.wait_for(lk, timeout, [this] { return ready; })) {
@@ -36,7 +35,7 @@ CacheableVectorPtr DefaultResultCollector::getResult(
"getResult() method");
}
-void DefaultResultCollector::addResult(const CacheablePtr& result) {
+void DefaultResultCollector::addResult(const std::shared_ptr<Cacheable>& result) {
resultList->push_back(result);
}
diff --git a/cppcache/src/Delta.cpp b/cppcache/src/Delta.cpp
index 98f28e0..db51be2 100644
--- a/cppcache/src/Delta.cpp
+++ b/cppcache/src/Delta.cpp
@@ -27,13 +27,12 @@
using namespace apache::geode::client;
Delta::Delta(Cache* cache) : m_cache(cache) {}
-
-DeltaPtr Delta::clone() {
+std::shared_ptr<Delta> Delta::clone() {
auto out = m_cache->createDataOutput();
auto ptr = dynamic_cast<Cacheable*>(this);
out->writeObject(ptr);
auto in = m_cache->createDataInput(out->getBuffer(), out->getBufferLength());
- CacheablePtr theClonePtr;
+ std::shared_ptr<Cacheable> theClonePtr;
in->readObject(theClonePtr);
return std::dynamic_pointer_cast<Delta>(theClonePtr);
}
diff --git a/cppcache/src/DiffieHellman.cpp b/cppcache/src/DiffieHellman.cpp
index a3532e8..7f0177d 100644
--- a/cppcache/src/DiffieHellman.cpp
+++ b/cppcache/src/DiffieHellman.cpp
@@ -81,7 +81,7 @@ void DiffieHellman::initOpenSSLFuncPtrs() {
inited = true;
}
-void DiffieHellman::initDhKeys(const PropertiesPtr& props) {
+void DiffieHellman::initDhKeys(const std::shared_ptr<Properties>& props) {
m_dhCtx = nullptr;
const auto& dhAlgo = props->find(SecurityClientDhAlgo);
@@ -124,46 +124,43 @@ void DiffieHellman::clearDhKeys(void) {
return;
}
-
-CacheableBytesPtr DiffieHellman::getPublicKey(void) {
+std::shared_ptr<CacheableBytes> DiffieHellman::getPublicKey(void) {
int keyLen = 0;
unsigned char* pubKeyPtr = gf_getPublicKey_Ptr(m_dhCtx, &keyLen);
return CacheableBytes::createNoCopy(pubKeyPtr, keyLen);
}
-void DiffieHellman::setPublicKeyOther(const CacheableBytesPtr& pubkey) {
+void DiffieHellman::setPublicKeyOther(const std::shared_ptr<CacheableBytes>& pubkey) {
return gf_setPublicKeyOther_Ptr(m_dhCtx, pubkey->value(), pubkey->length());
}
void DiffieHellman::computeSharedSecret(void) {
return gf_computeSharedSecret_Ptr(m_dhCtx);
}
-
-CacheableBytesPtr DiffieHellman::encrypt(const CacheableBytesPtr& cleartext) {
- return encrypt(cleartext->value(), cleartext->length());
+ std::shared_ptr<CacheableBytes> DiffieHellman::encrypt(const std::shared_ptr<CacheableBytes>& cleartext) {
+ return encrypt(cleartext->value(), cleartext->length());
+ }
+ std::shared_ptr<CacheableBytes> DiffieHellman::encrypt(
+ const uint8_t* cleartext, int len) {
+ int cipherLen = 0;
+ unsigned char* ciphertextPtr =
+ gf_encryptDH_Ptr(m_dhCtx, cleartext, len, &cipherLen);
+ return CacheableBytes::createNoCopy(ciphertextPtr, cipherLen);
}
-
-CacheableBytesPtr DiffieHellman::encrypt(const uint8_t* cleartext, int len) {
- int cipherLen = 0;
- unsigned char* ciphertextPtr =
- gf_encryptDH_Ptr(m_dhCtx, cleartext, len, &cipherLen);
- return CacheableBytes::createNoCopy(ciphertextPtr, cipherLen);
-}
-
-CacheableBytesPtr DiffieHellman::decrypt(const CacheableBytesPtr& cleartext) {
+ std::shared_ptr<CacheableBytes> DiffieHellman::decrypt(const std::shared_ptr<CacheableBytes>& cleartext) {
return decrypt(cleartext->value(), cleartext->length());
}
-
-CacheableBytesPtr DiffieHellman::decrypt(const uint8_t* cleartext, int len) {
+std::shared_ptr<CacheableBytes> DiffieHellman::decrypt(const uint8_t* cleartext,
+ int len) {
int cipherLen = 0;
unsigned char* ciphertextPtr =
gf_decryptDH_Ptr(m_dhCtx, cleartext, len, &cipherLen);
return CacheableBytes::createNoCopy(ciphertextPtr, cipherLen);
}
-bool DiffieHellman::verify(const CacheableStringPtr& subject,
- const CacheableBytesPtr& challenge,
- const CacheableBytesPtr& response) {
+bool DiffieHellman::verify(const std::shared_ptr<CacheableString>& subject,
+ const std::shared_ptr<CacheableBytes>& challenge,
+ const std::shared_ptr<CacheableBytes>& response) {
int errCode = DH_ERR_NO_ERROR;
LOGDEBUG("DiffieHellman::verify");
bool result = gf_verifyDH_Ptr(m_dhCtx, subject->asChar(), challenge->value(),
diff --git a/cppcache/src/DiffieHellman.hpp b/cppcache/src/DiffieHellman.hpp
index a97c0fe..9813c39 100644
--- a/cppcache/src/DiffieHellman.hpp
+++ b/cppcache/src/DiffieHellman.hpp
@@ -42,18 +42,20 @@ namespace client {
class DiffieHellman {
public:
- void initDhKeys(const PropertiesPtr& props);
+ void initDhKeys(const std::shared_ptr<Properties>& props);
void clearDhKeys(void);
- CacheableBytesPtr getPublicKey(void);
- void setPublicKeyOther(const CacheableBytesPtr& pubkey);
+ std::shared_ptr<CacheableBytes> getPublicKey(void);
+ void setPublicKeyOther(const std::shared_ptr<CacheableBytes>& pubkey);
void computeSharedSecret(void);
- CacheableBytesPtr encrypt(const CacheableBytesPtr& cleartext);
- CacheableBytesPtr encrypt(const uint8_t* cleartext, int len);
- CacheableBytesPtr decrypt(const CacheableBytesPtr& cleartext);
- CacheableBytesPtr decrypt(const uint8_t* cleartext, int len);
- bool verify(const CacheableStringPtr& subject,
- const CacheableBytesPtr& challenge,
- const CacheableBytesPtr& response);
+ std::shared_ptr<CacheableBytes> encrypt(
+ const std::shared_ptr<CacheableBytes>& cleartext);
+ std::shared_ptr<CacheableBytes> encrypt(const uint8_t* cleartext, int len);
+ std::shared_ptr<CacheableBytes> decrypt(
+ const std::shared_ptr<CacheableBytes>& cleartext);
+ std::shared_ptr<CacheableBytes> decrypt(const uint8_t* cleartext, int len);
+ bool verify(const std::shared_ptr<CacheableString>& subject,
+ const std::shared_ptr<CacheableBytes>& challenge,
+ const std::shared_ptr<CacheableBytes>& response);
static void initOpenSSLFuncPtrs();
@@ -63,9 +65,9 @@ class DiffieHellman {
void* m_dhCtx;
static void* getOpenSSLFuncPtr(const char* function_name);
- // OpenSSL Func Ptrs: Declare Func Ptr type and a static variable of FuncPtr
- // type.
- // Convention: <Orig Func Name>_Type and <Orig Func Name>_Ptr
+ // OpenSSL Func Ptrs: Declare Func Ptr type and a static variable of
+ // std::shared_ptr<Func> type. Convention: <Orig Func Name>_Type and <Orig
+ // Func Name>_Ptr
typedef int (*gf_initDhKeys_Type)(void** dhCtx, const char* dhAlgo,
const char* ksPath);
typedef void (*gf_clearDhKeys_Type)(void* dhCtx);
diff --git a/cppcache/src/DiskVersionTag.hpp b/cppcache/src/DiskVersionTag.hpp
index 850a7c1..b4431de 100644
--- a/cppcache/src/DiskVersionTag.hpp
+++ b/cppcache/src/DiskVersionTag.hpp
@@ -30,7 +30,6 @@ namespace client {
class RegionInternal;
class CacheImpl;
-_GF_PTR_DEF_(VersionTag, VersionTagPtr);
class DiskVersionTag : public VersionTag {
protected:
diff --git a/cppcache/src/DistributedSystem.cpp b/cppcache/src/DistributedSystem.cpp
index a398462..4c02dd4 100644
--- a/cppcache/src/DistributedSystem.cpp
+++ b/cppcache/src/DistributedSystem.cpp
@@ -150,7 +150,8 @@ void DistributedSystem::logSystemInformation() {
}
std::unique_ptr<DistributedSystem> DistributedSystem::create(
- const std::string& _name, Cache* cache, const PropertiesPtr& configPtr) {
+ const std::string& _name, Cache* cache,
+ const std::shared_ptr<Properties>& configPtr) {
// TODO global - Refactory out the static initialization
// Trigger other library initialization.
CppCacheLibrary::initLib();
diff --git a/cppcache/src/DistributedSystemImpl.hpp b/cppcache/src/DistributedSystemImpl.hpp
index eed215e..23d973f 100644
--- a/cppcache/src/DistributedSystemImpl.hpp
+++ b/cppcache/src/DistributedSystemImpl.hpp
@@ -51,7 +51,6 @@ class SystemProperties;
*/
class DistributedSystemImpl;
-typedef std::shared_ptr<DistributedSystemImpl> DistributedSystemImplPtr;
class CPPCACHE_EXPORT DistributedSystemImpl {
/**
diff --git a/cppcache/src/EntriesMap.hpp b/cppcache/src/EntriesMap.hpp
index bcdd5a1..69958c5 100644
--- a/cppcache/src/EntriesMap.hpp
+++ b/cppcache/src/EntriesMap.hpp
@@ -56,31 +56,38 @@ class CPPCACHE_EXPORT EntriesMap {
/**
* @brief put a value in the map, replacing if key already exists.
*/
- virtual GfErrType put(const CacheableKeyPtr& key,
- const CacheablePtr& newValue, MapEntryImplPtr& me,
- CacheablePtr& oldValue, int updateCount,
- int destroyTracker, VersionTagPtr versionTag,
+ virtual GfErrType put(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& newValue,
+ std::shared_ptr<MapEntryImpl>& me,
+ std::shared_ptr<Cacheable>& oldValue, int updateCount,
+ int destroyTracker,
+ std::shared_ptr<VersionTag> versionTag,
bool& isUpdate = EntriesMap::boolVal,
DataInput* delta = nullptr) = 0;
- virtual GfErrType invalidate(const CacheableKeyPtr& key, MapEntryImplPtr& me,
- CacheablePtr& oldValue,
- VersionTagPtr versionTag) = 0;
- virtual GfErrType create(const CacheableKeyPtr& key,
- const CacheablePtr& newValue, MapEntryImplPtr& me,
- CacheablePtr& oldValue, int updateCount,
- int destroyTracker, VersionTagPtr versionTag) = 0;
+ virtual GfErrType invalidate(const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& me,
+ std::shared_ptr<Cacheable>& oldValue,
+ std::shared_ptr<VersionTag> versionTag) = 0;
+ virtual GfErrType create(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& newValue,
+ std::shared_ptr<MapEntryImpl>& me,
+ std::shared_ptr<Cacheable>& oldValue,
+ int updateCount, int destroyTracker,
+ std::shared_ptr<VersionTag> versionTag) = 0;
/**
* @brief get a value out of the map; returns false if absent
*/
- virtual bool get(const CacheableKeyPtr& key, CacheablePtr& value,
- MapEntryImplPtr& me) = 0;
+ virtual bool get(const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<Cacheable>& value,
+ std::shared_ptr<MapEntryImpl>& me) = 0;
/**
* @brief get MapEntry for key; returns nullptr if absent
*/
- virtual void getEntry(const CacheableKeyPtr& key, MapEntryImplPtr& result,
- CacheablePtr& value) const = 0;
+ virtual void getEntry(const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& result,
+ std::shared_ptr<Cacheable>& value) const = 0;
/** @brief remove all entries in the map. */
virtual void clear() = 0;
@@ -88,29 +95,34 @@ class CPPCACHE_EXPORT EntriesMap {
* @brief remove the entry for key from the map;
* returns false and nullptr MapEntry if absent
*/
- virtual GfErrType remove(const CacheableKeyPtr& key, CacheablePtr& result,
- MapEntryImplPtr& me, int updateCount,
- VersionTagPtr versionTag, bool afterRemote) = 0;
+ virtual GfErrType remove(const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<Cacheable>& result,
+ std::shared_ptr<MapEntryImpl>& me, int updateCount,
+ std::shared_ptr<VersionTag> versionTag,
+ bool afterRemote) = 0;
/**
* @brief return true if there exists an entry for the key.
*/
- virtual bool containsKey(const CacheableKeyPtr& key) const = 0;
+ virtual bool containsKey(const std::shared_ptr<CacheableKey>& key) const = 0;
/**
* @brief return the all the keys in a vector.
*/
- virtual void getKeys(VectorOfCacheableKey& result) const = 0;
+ virtual void getKeys(
+ std::vector<std::shared_ptr<CacheableKey>>& result) const = 0;
/**
* @brief return all the entries in a vector.
*/
- virtual void getEntries(VectorOfRegionEntry& result) const = 0;
+ virtual void getEntries(
+ std::vector<std::shared_ptr<RegionEntry>>& result) const = 0;
/**
* @brief return all values in a vector.
*/
- virtual void getValues(VectorOfCacheable& result) const = 0;
+ virtual void getValues(
+ std::vector<std::shared_ptr<Cacheable>>& result) const = 0;
/** @brief return the number of entries in the map. */
virtual uint32_t size() const = 0;
@@ -125,11 +137,13 @@ class CPPCACHE_EXPORT EntriesMap {
* The parameter <incUpdateCount> should be set to true if this is a write
* operation and update counter sould be incremented for the entry.
*/
- virtual int addTrackerForEntry(const CacheableKeyPtr& key,
- CacheablePtr& oldValue, bool addIfAbsent,
- bool failIfPresent, bool incUpdateCount) = 0;
+ virtual int addTrackerForEntry(const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<Cacheable>& oldValue,
+ bool addIfAbsent, bool failIfPresent,
+ bool incUpdateCount) = 0;
- virtual void removeTrackerForEntry(const CacheableKeyPtr& key) = 0;
+ virtual void removeTrackerForEntry(
+ const std::shared_ptr<CacheableKey>& key) = 0;
/**
* Add trackers for all the entries and returns the map of keys to
@@ -150,21 +164,25 @@ class CPPCACHE_EXPORT EntriesMap {
* SYNCHRONIZE_SEGMENT_FOR_KEY( keyPtr ) creates a guard that locks
* and release the segment.
*/
- virtual MapSegment* segmentFor(const CacheableKeyPtr& key) const = 0;
+ virtual MapSegment* segmentFor(
+ const std::shared_ptr<CacheableKey>& key) const = 0;
- virtual CacheablePtr getFromDisk(const CacheableKeyPtr& key,
- MapEntryImplPtr& me) const {
+ virtual std::shared_ptr<Cacheable> getFromDisk(
+ const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& me) const {
return nullptr;
}
virtual void reapTombstones(std::map<uint16_t, int64_t>& gcVersions) = 0;
- virtual void reapTombstones(CacheableHashSetPtr removedKeys) = 0;
+ virtual void reapTombstones(
+ std::shared_ptr<CacheableHashSet> removedKeys) = 0;
/**
* for internal testing, returns if an entry is a tombstone
*/
- virtual GfErrType isTombstone(CacheableKeyPtr& key, MapEntryImplPtr& me,
+ virtual GfErrType isTombstone(std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& me,
bool& result) = 0;
static bool boolVal;
diff --git a/cppcache/src/EntriesMapFactory.cpp b/cppcache/src/EntriesMapFactory.cpp
index 1624b23..62754c0 100644
--- a/cppcache/src/EntriesMapFactory.cpp
+++ b/cppcache/src/EntriesMapFactory.cpp
@@ -32,8 +32,8 @@ using namespace apache::geode::client;
* In the future, a EntriesMap facade can be put over the SharedRegionData to
* support shared regions directly.
*/
-EntriesMap* EntriesMapFactory::createMap(RegionInternal* region,
- const RegionAttributesPtr& attrs) {
+EntriesMap* EntriesMapFactory::createMap(
+ RegionInternal* region, const std::shared_ptr<RegionAttributes>& attrs) {
EntriesMap* result = nullptr;
uint32_t initialCapacity = attrs->getInitialCapacity();
uint8_t concurrency = attrs->getConcurrencyLevel();
diff --git a/cppcache/src/EntriesMapFactory.hpp b/cppcache/src/EntriesMapFactory.hpp
index c74c6db..c6199d6 100644
--- a/cppcache/src/EntriesMapFactory.hpp
+++ b/cppcache/src/EntriesMapFactory.hpp
@@ -34,7 +34,7 @@ class CPPCACHE_EXPORT EntriesMapFactory {
* type of entries map.
*/
static EntriesMap* createMap(RegionInternal* region,
- const RegionAttributesPtr& attrs);
+ const std::shared_ptr<RegionAttributes>& attrs);
private:
/** @brief not to be instantiated. */
diff --git a/cppcache/src/EntryEvent.cpp b/cppcache/src/EntryEvent.cpp
index 6f0e54e..d60b52d 100644
--- a/cppcache/src/EntryEvent.cpp
+++ b/cppcache/src/EntryEvent.cpp
@@ -20,10 +20,11 @@
namespace apache {
namespace geode {
namespace client {
-EntryEvent::EntryEvent(const RegionPtr& region, const CacheableKeyPtr& key,
- const CacheablePtr& oldValue,
- const CacheablePtr& newValue,
- const SerializablePtr& aCallbackArgument,
+EntryEvent::EntryEvent(const std::shared_ptr<Region>& region,
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& oldValue,
+ const std::shared_ptr<Cacheable>& newValue,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
const bool remoteOrigin)
: m_region(region),
m_key(key),
diff --git a/cppcache/src/EntryExpiryHandler.cpp b/cppcache/src/EntryExpiryHandler.cpp
index cfd974c..a4a383d 100644
--- a/cppcache/src/EntryExpiryHandler.cpp
+++ b/cppcache/src/EntryExpiryHandler.cpp
@@ -30,8 +30,8 @@
using namespace apache::geode::client;
-EntryExpiryHandler::EntryExpiryHandler(RegionInternalPtr& rptr,
- MapEntryImplPtr& entryPtr,
+EntryExpiryHandler::EntryExpiryHandler(std::shared_ptr<RegionInternal>& rptr,
+ std::shared_ptr<MapEntryImpl>& entryPtr,
ExpirationAction::Action action,
uint32_t duration)
: m_regionPtr(rptr),
@@ -41,7 +41,7 @@ EntryExpiryHandler::EntryExpiryHandler(RegionInternalPtr& rptr,
int EntryExpiryHandler::handle_timeout(const ACE_Time_Value& current_time,
const void* arg) {
- CacheableKeyPtr key;
+ std::shared_ptr<CacheableKey> key;
m_entryPtr->getKeyI(key);
ExpEntryProperties& expProps = m_entryPtr->getExpProperties();
try {
@@ -94,9 +94,9 @@ int EntryExpiryHandler::handle_close(ACE_HANDLE, ACE_Reactor_Mask) {
}
inline void EntryExpiryHandler::DoTheExpirationAction(
- const CacheableKeyPtr& key) {
+ const std::shared_ptr<CacheableKey>& key) {
// Pass a blank version tag.
- VersionTagPtr versionTag;
+ std::shared_ptr<VersionTag> versionTag;
switch (m_action) {
case ExpirationAction::INVALIDATE: {
LOGDEBUG(
diff --git a/cppcache/src/EntryExpiryHandler.hpp b/cppcache/src/EntryExpiryHandler.hpp
index ca2abcb..ebc2d42 100644
--- a/cppcache/src/EntryExpiryHandler.hpp
+++ b/cppcache/src/EntryExpiryHandler.hpp
@@ -48,7 +48,8 @@ class CPPCACHE_EXPORT EntryExpiryHandler : public ACE_Event_Handler {
/**
* Constructor
*/
- EntryExpiryHandler(RegionInternalPtr& rptr, MapEntryImplPtr& entryPtr,
+ EntryExpiryHandler(std::shared_ptr<RegionInternal>& rptr,
+ std::shared_ptr<MapEntryImpl>& entryPtr,
ExpirationAction::Action action, uint32_t duration);
/** This task object will be registered with the Timer Queue.
@@ -62,16 +63,16 @@ class CPPCACHE_EXPORT EntryExpiryHandler : public ACE_Event_Handler {
private:
// The region which contains the entry
- RegionInternalPtr m_regionPtr;
+ std::shared_ptr<RegionInternal> m_regionPtr;
// The ExpMapEntry contained in the ConcurrentMap against the key.
- MapEntryImplPtr m_entryPtr;
+ std::shared_ptr<MapEntryImpl> m_entryPtr;
// Action to be taken on expiry
ExpirationAction::Action m_action;
// Duration after which the task should be reset in case of
// modification.
uint32_t m_duration;
// perform the actual expiration action
- void DoTheExpirationAction(const CacheableKeyPtr& key);
+ void DoTheExpirationAction(const std::shared_ptr<CacheableKey>& key);
};
} // namespace client
} // namespace geode
diff --git a/cppcache/src/EnumInfo.hpp b/cppcache/src/EnumInfo.hpp
index f993bb1..ffdc171 100644
--- a/cppcache/src/EnumInfo.hpp
+++ b/cppcache/src/EnumInfo.hpp
@@ -30,8 +30,8 @@ namespace client {
class CPPCACHE_EXPORT EnumInfo : public CacheableKey {
private:
- CacheableStringPtr m_enumClassName;
- CacheableStringPtr m_enumName;
+ std::shared_ptr<CacheableString> m_enumClassName;
+ std::shared_ptr<CacheableString> m_enumName;
int32_t m_ordinal;
public:
@@ -50,18 +50,19 @@ class CPPCACHE_EXPORT EnumInfo : public CacheableKey {
}
virtual int32_t classId() const { return 0; }
virtual int8_t typeId() const { return GeodeTypeIds::EnumInfo; }
- virtual CacheableStringPtr toString() const {
+ virtual std::shared_ptr<CacheableString> toString() const {
return CacheableString::create("EnumInfo");
}
virtual bool operator==(const CacheableKey& other) const;
virtual int32_t hashcode() const;
virtual int8_t DSFID() const;
- CacheableStringPtr getEnumClassName() const { return m_enumClassName; }
- CacheableStringPtr getEnumName() const { return m_enumName; }
+ std::shared_ptr<CacheableString> getEnumClassName() const {
+ return m_enumClassName;
+ }
+ std::shared_ptr<CacheableString> getEnumName() const { return m_enumName; }
int32_t getEnumOrdinal() const { return m_ordinal; }
};
-typedef std::shared_ptr<EnumInfo> EnumInfoPtr;
} // namespace client
} // namespace geode
diff --git a/cppcache/src/EventId.hpp b/cppcache/src/EventId.hpp
index 1f995a9..34aa1ff 100644
--- a/cppcache/src/EventId.hpp
+++ b/cppcache/src/EventId.hpp
@@ -103,9 +103,9 @@ class CPPCACHE_EXPORT EventId : public Cacheable {
virtual int8_t DSFID() const { return GeodeTypeIdsImpl::FixedIDByte; };
/** Returns a pointer to a new eventid value. */
- static EventIdPtr create(char* memId, uint32_t memIdLen, int64_t thr,
- int64_t seq) {
- return EventIdPtr(new EventId(memId, memIdLen, thr, seq));
+ static std::shared_ptr<EventId> create(char* memId, uint32_t memIdLen,
+ int64_t thr, int64_t seq) {
+ return std::shared_ptr<EventId>(new EventId(memId, memIdLen, thr, seq));
}
/** Destructor. */
diff --git a/cppcache/src/EventIdMap.cpp b/cppcache/src/EventIdMap.cpp
index 26df600..89db70e 100644
--- a/cppcache/src/EventIdMap.cpp
+++ b/cppcache/src/EventIdMap.cpp
@@ -29,14 +29,15 @@ void EventIdMap::clear() {
m_map.clear();
}
-EventIdMapEntry EventIdMap::make(EventIdPtr eventid) {
+EventIdMapEntry EventIdMap::make(std::shared_ptr<EventId> eventid) {
auto sid = std::make_shared<EventSource>(
eventid->getMemId(), eventid->getMemIdLen(), eventid->getThrId());
auto seq = std::make_shared<EventSequence>(eventid->getSeqNum());
return std::make_pair(sid, seq);
}
-bool EventIdMap::isDuplicate(EventSourcePtr key, EventSequencePtr value) {
+bool EventIdMap::isDuplicate(std::shared_ptr<EventSource> key,
+ std::shared_ptr<EventSequence> value) {
GUARD_MAP;
const auto& entry = m_map.find(key);
@@ -46,7 +47,8 @@ bool EventIdMap::isDuplicate(EventSourcePtr key, EventSequencePtr value) {
return false;
}
-bool EventIdMap::put(EventSourcePtr key, EventSequencePtr value, bool onlynew) {
+bool EventIdMap::put(std::shared_ptr<EventSource> key,
+ std::shared_ptr<EventSequence> value, bool onlynew) {
GUARD_MAP;
value->touch(m_expiry);
@@ -66,7 +68,7 @@ bool EventIdMap::put(EventSourcePtr key, EventSequencePtr value, bool onlynew) {
}
}
-bool EventIdMap::touch(EventSourcePtr key) {
+bool EventIdMap::touch(std::shared_ptr<EventSource> key) {
GUARD_MAP;
const auto& entry = m_map.find(key);
@@ -79,7 +81,7 @@ bool EventIdMap::touch(EventSourcePtr key) {
}
}
-bool EventIdMap::remove(EventSourcePtr key) {
+bool EventIdMap::remove(std::shared_ptr<EventSource> key) {
GUARD_MAP;
const auto& entry = m_map.find(key);
diff --git a/cppcache/src/EventIdMap.hpp b/cppcache/src/EventIdMap.hpp
index 911d83d..bd26ff3 100644
--- a/cppcache/src/EventIdMap.hpp
+++ b/cppcache/src/EventIdMap.hpp
@@ -42,10 +42,8 @@ namespace client {
class EventSequence;
class EventIdMap;
-typedef std::shared_ptr<EventSequence> EventSequencePtr;
-typedef std::shared_ptr<EventIdMap> EventIdMapPtr;
-
-typedef std::pair<EventSourcePtr, EventSequencePtr> EventIdMapEntry;
+typedef std::pair<std::shared_ptr<EventSource>, std::shared_ptr<EventSequence>>
+ EventIdMapEntry;
typedef std::vector<EventIdMapEntry> EventIdMapEntryList;
typedef ACE_Guard<ACE_Recursive_Thread_Mutex> MapGuard;
@@ -60,9 +58,10 @@ typedef ACE_Guard<ACE_Recursive_Thread_Mutex> MapGuard;
*/
class CPPCACHE_EXPORT EventIdMap {
private:
- typedef std::unordered_map<EventSourcePtr, EventSequencePtr,
- dereference_hash<EventSourcePtr>,
- dereference_equal_to<EventSourcePtr>>
+ typedef std::unordered_map<std::shared_ptr<EventSource>,
+ std::shared_ptr<EventSequence>,
+ dereference_hash<std::shared_ptr<EventSource>>,
+ dereference_equal_to<std::shared_ptr<EventSource>>>
map_type;
std::chrono::milliseconds m_expiry;
@@ -86,27 +85,27 @@ class CPPCACHE_EXPORT EventIdMap {
/** Find out if entry is duplicate
* @return true if the entry exists else false
*/
- bool isDuplicate(EventSourcePtr key, EventSequencePtr value);
+ bool isDuplicate(std::shared_ptr<EventSource> key, std::shared_ptr<EventSequence> value);
- /** Construct an EventIdMapEntry from an EventIdPtr */
- static EventIdMapEntry make(EventIdPtr eventid);
+ /** Construct an EventIdMapEntry from an std::shared_ptr<EventId> */
+ static EventIdMapEntry make(std::shared_ptr<EventId> eventid);
/** Put an item and return true if it is new or false if it existed and was
* updated
* @param onlynew Only put if the sequence id does not exist or is higher
* @return true if the entry was updated or inserted otherwise false
*/
- bool put(EventSourcePtr key, EventSequencePtr value, bool onlynew = false);
+ bool put(std::shared_ptr<EventSource> key, std::shared_ptr<EventSequence> value, bool onlynew = false);
/** Update the deadline for the entry
* @return true if the entry exists else false
*/
- bool touch(EventSourcePtr key);
+ bool touch(std::shared_ptr<EventSource> key);
/** Remove an item from the map
* @return true if the entry was found and removed else return false
*/
- bool remove(EventSourcePtr key);
+ bool remove(std::shared_ptr<EventSource> key);
/** Collect all map entries who acked flag is false and set their acked flags
* to true */
diff --git a/cppcache/src/EventSource.hpp b/cppcache/src/EventSource.hpp
index d932c63..1fdca79 100644
--- a/cppcache/src/EventSource.hpp
+++ b/cppcache/src/EventSource.hpp
@@ -95,8 +95,6 @@ class CPPCACHE_EXPORT EventSource {
};
};
-typedef std::shared_ptr<EventSource> EventSourcePtr;
-
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/EvictionController.cpp b/cppcache/src/EvictionController.cpp
index 64049a2..f0a9b3d 100644
--- a/cppcache/src/EvictionController.cpp
+++ b/cppcache/src/EvictionController.cpp
@@ -155,7 +155,7 @@ void EvictionController::evict(int32_t percentage) {
for (size_t i = 0; i < regionTmpVector.size(); i++) {
std::string str = regionTmpVector.at(i);
- RegionPtr rptr;
+ std::shared_ptr<Region> rptr;
m_cacheImpl->getRegion(str.c_str(), rptr);
if (rptr != nullptr) {
RegionInternal* rimpl = dynamic_cast<RegionInternal*>(rptr.get());
diff --git a/cppcache/src/EvictionController.hpp b/cppcache/src/EvictionController.hpp
index 917e699..e515a69 100644
--- a/cppcache/src/EvictionController.hpp
+++ b/cppcache/src/EvictionController.hpp
@@ -68,7 +68,6 @@ typedef std::vector<std::string> VectorOfString;
class EvictionController;
class EvictionThread;
class CacheImpl;
-typedef std::shared_ptr<EvictionController> EvictionControllerPtr;
class CPPCACHE_EXPORT EvictionController : public ACE_Task_Base {
public:
diff --git a/cppcache/src/Exception.cpp b/cppcache/src/Exception.cpp
index b873a2e..b40890b 100644
--- a/cppcache/src/Exception.cpp
+++ b/cppcache/src/Exception.cpp
@@ -37,7 +37,7 @@ void Exception::setStackTraces(bool stackTraceEnabled) {
}
Exception::Exception(const char* msg1, const char* msg2, bool forceTrace,
- const ExceptionPtr& cause)
+ const std::shared_ptr<Exception>& cause)
: m_stack(), m_cause(cause) {
size_t len1 = 0;
if (msg1) {
@@ -113,8 +113,9 @@ size_t Exception::getStackTrace(char* buffer, size_t maxLength) const {
#endif
-Exception::Exception(const CacheableStringPtr& message,
- const StackTracePtr& stack, const ExceptionPtr& cause)
+Exception::Exception(const std::shared_ptr<CacheableString>& message,
+ const std::shared_ptr<StackTrace>& stack,
+ const std::shared_ptr<Exception>& cause)
: m_message(message), m_stack(stack), m_cause(cause) {}
Exception* Exception::clone() const {
diff --git a/cppcache/src/ExecutionImpl.cpp b/cppcache/src/ExecutionImpl.cpp
index dc0fffb..aa3b7e8 100644
--- a/cppcache/src/ExecutionImpl.cpp
+++ b/cppcache/src/ExecutionImpl.cpp
@@ -28,7 +28,8 @@
FunctionToFunctionAttributes ExecutionImpl::m_func_attrs;
ACE_Recursive_Thread_Mutex ExecutionImpl::m_func_attrs_lock;
-ExecutionPtr ExecutionImpl::withFilter(CacheableVectorPtr routingObj) {
+std::shared_ptr<Execution> ExecutionImpl::withFilter(
+ std::shared_ptr<CacheableVector> routingObj) {
// ACE_Guard<ACE_Recursive_Thread_Mutex> _guard(m_lock);
if (routingObj == nullptr) {
throw IllegalArgumentException("Execution::withFilter: filter is null");
@@ -42,7 +43,8 @@ ExecutionPtr ExecutionImpl::withFilter(CacheableVectorPtr routingObj) {
return std::make_shared<ExecutionImpl>(routingObj, m_args, m_rc, m_region,
m_allServer, m_pool, m_proxyCache);
}
-ExecutionPtr ExecutionImpl::withArgs(CacheablePtr args) {
+std::shared_ptr<Execution> ExecutionImpl::withArgs(
+ std::shared_ptr<Cacheable> args) {
// ACE_Guard<ACE_Recursive_Thread_Mutex> _guard(m_lock);
if (args == nullptr) {
throw IllegalArgumentException("Execution::withArgs: args is null");
@@ -51,7 +53,8 @@ ExecutionPtr ExecutionImpl::withArgs(CacheablePtr args) {
return std::make_shared<ExecutionImpl>(m_routingObj, args, m_rc, m_region,
m_allServer, m_pool, m_proxyCache);
}
-ExecutionPtr ExecutionImpl::withCollector(ResultCollectorPtr rs) {
+std::shared_ptr<Execution> ExecutionImpl::withCollector(
+ std::shared_ptr<ResultCollector> rs) {
// ACE_Guard<ACE_Recursive_Thread_Mutex> _guard(m_lock);
if (rs == nullptr) {
throw IllegalArgumentException(
@@ -70,19 +73,18 @@ std::vector<int8_t>* ExecutionImpl::getFunctionAttributes(const char* func) {
}
return nullptr;
}
-
-ResultCollectorPtr ExecutionImpl::execute(const CacheableVectorPtr& routingObj,
- const CacheablePtr& args,
- const ResultCollectorPtr& rs,
- const char* func, std::chrono::milliseconds timeout) {
+std::shared_ptr<ResultCollector> ExecutionImpl::execute(
+ const std::shared_ptr<CacheableVector>& routingObj,
+ const std::shared_ptr<Cacheable>& args,
+ const std::shared_ptr<ResultCollector>& rs, const char* func,
+ std::chrono::milliseconds timeout) {
m_routingObj = routingObj;
m_args = args;
m_rc = rs;
return execute(func, timeout);
}
-
-ResultCollectorPtr ExecutionImpl::execute(const char* fn,
- std::chrono::milliseconds timeout) {
+std::shared_ptr<ResultCollector> ExecutionImpl::execute(
+ const char* fn, std::chrono::milliseconds timeout) {
std::string func = fn;
LOGDEBUG("ExecutionImpl::execute: ");
GuardUserAttribures gua;
@@ -211,7 +213,7 @@ ResultCollectorPtr ExecutionImpl::execute(const char* fn,
if (reExecute) { // Fallback to old FE onREgion
if (isHAHasResultOptimizeForWrite & 1) { // isHA = true
m_rc->clearResults();
- CacheableVectorPtr rs =
+ auto rs =
std::dynamic_pointer_cast<ThinClientRegion>(m_region)
->reExecuteFunction(fn, m_args, m_routingObj,
isHAHasResultOptimizeForWrite, m_rc,
@@ -266,7 +268,7 @@ ResultCollectorPtr ExecutionImpl::execute(const char* fn,
if (reExecute) { // Fallback to old FE onREgion
if (isHAHasResultOptimizeForWrite & 1) { // isHA = true
m_rc->clearResults();
- CacheableVectorPtr rs =
+ auto rs =
dynamic_cast<ThinClientRegion*>(m_region.get())
->reExecuteFunction(fn, m_args, m_routingObj,
isHAHasResultOptimizeForWrite, m_rc,
@@ -392,14 +394,14 @@ GfErrType ExecutionImpl::getFuncAttributes(const char* func,
return err;
}
-void ExecutionImpl::addResults(ResultCollectorPtr& collector,
- const CacheableVectorPtr& results) {
+void ExecutionImpl::addResults(std::shared_ptr<ResultCollector>& collector,
+ const std::shared_ptr<CacheableVector>& results) {
if (results == nullptr || collector == nullptr) {
return;
}
for (int32_t resultItem = 0; resultItem < results->size(); resultItem++) {
- CacheablePtr result(results->operator[](resultItem));
+ std::shared_ptr<Cacheable> result(results->operator[](resultItem));
collector->addResult(result);
}
}
@@ -410,19 +412,19 @@ void ExecutionImpl::executeOnAllServers(std::string& func, uint8_t getResult,
throw IllegalArgumentException(
"Execute: pool cast to ThinClientPoolDM failed");
}
- CacheableStringPtr exceptionPtr = nullptr;
- GfErrType err = tcrdm->sendRequestToAllServers(
- func.c_str(), getResult, timeout, m_args, m_rc, exceptionPtr);
- if (exceptionPtr != nullptr && err != GF_NOERR) {
- LOGDEBUG("Execute errorred: %d", err);
- // throw FunctionExecutionException( "Execute: failed to execute function
- // with server." );
- if (err == GF_CACHESERVER_EXCEPTION) {
- throw FunctionExecutionException(
- "Execute: failed to execute function with server.");
- } else {
- GfErrTypeToException("Execute", err);
- }
+std::shared_ptr<CacheableString> exceptionPtr = nullptr;
+GfErrType err = tcrdm->sendRequestToAllServers(func.c_str(), getResult, timeout,
+ m_args, m_rc, exceptionPtr);
+if (exceptionPtr != nullptr && err != GF_NOERR) {
+ LOGDEBUG("Execute errorred: %d", err);
+ // throw FunctionExecutionException( "Execute: failed to execute function
+ // with server." );
+ if (err == GF_CACHESERVER_EXCEPTION) {
+ throw FunctionExecutionException(
+ "Execute: failed to execute function with server.");
+ } else {
+ GfErrTypeToException("Execute", err);
+ }
}
if (err == GF_AUTHENTICATION_FAILED_EXCEPTION ||
@@ -444,7 +446,7 @@ void ExecutionImpl::executeOnAllServers(std::string& func, uint8_t getResult,
}
}
}
-CacheableVectorPtr ExecutionImpl::executeOnPool(
+std::shared_ptr<CacheableVector> ExecutionImpl::executeOnPool(
std::string& func, uint8_t getResult, int32_t retryAttempts,
std::chrono::milliseconds timeout) {
ThinClientPoolDM* tcrdm = dynamic_cast<ThinClientPoolDM*>(m_pool.get());
@@ -454,12 +456,12 @@ CacheableVectorPtr ExecutionImpl::executeOnPool(
}
int32_t attempt = 0;
- // CacheableStringArrayPtr csArray = tcrdm->getServers();
+ //auto csArray = tcrdm->getServers();
// if (csArray != nullptr && csArray->length() != 0) {
// for (int i = 0; i < csArray->length(); i++)
// {
- // CacheableStringPtr cs = csArray[i];
+ // auto cs = csArray[i];
// TcrEndpoint *ep = nullptr;
// /*
// std::string endpointStr = Utils::convertHostToCanonicalForm(cs->asChar()
@@ -514,7 +516,7 @@ CacheableVectorPtr ExecutionImpl::executeOnPool(
GfErrTypeToException("ExecuteOnPool:", err);
}
}
- // CacheableVectorPtr values =
+ //auto values =
// resultCollector->getFunctionExecutionResults();
/*
==25848== 1,610 (72 direct, 1,538 indirect) bytes in 2 blocks are definitely
diff --git a/cppcache/src/ExecutionImpl.hpp b/cppcache/src/ExecutionImpl.hpp
index 288e2ce..2fb6f85 100644
--- a/cppcache/src/ExecutionImpl.hpp
+++ b/cppcache/src/ExecutionImpl.hpp
@@ -38,8 +38,9 @@ typedef std::map<std::string, std::vector<int8_t>*> FunctionToFunctionAttributes
class ExecutionImpl : public Execution {
public:
- ExecutionImpl(RegionPtr rptr = nullptr, ProxyCachePtr proxyCache = nullptr,
- PoolPtr pp = nullptr)
+ ExecutionImpl(std::shared_ptr<Region> rptr = nullptr,
+ std::shared_ptr<ProxyCache> proxyCache = nullptr,
+ std::shared_ptr<Pool> pp = nullptr)
: m_routingObj(nullptr),
m_args(nullptr),
m_rc(nullptr),
@@ -47,8 +48,8 @@ class ExecutionImpl : public Execution {
m_allServer(false),
m_pool(pp),
m_proxyCache(proxyCache) {}
- ExecutionImpl(PoolPtr pool, bool allServer = false,
- ProxyCachePtr proxyCache = nullptr)
+ ExecutionImpl(std::shared_ptr<Pool> pool, bool allServer = false,
+ std::shared_ptr<ProxyCache> proxyCache = nullptr)
: m_routingObj(nullptr),
m_args(nullptr),
m_rc(nullptr),
@@ -56,23 +57,26 @@ class ExecutionImpl : public Execution {
m_allServer(allServer),
m_pool(pool),
m_proxyCache(proxyCache) {}
- virtual ExecutionPtr withFilter(CacheableVectorPtr routingObj) override;
- virtual ExecutionPtr withArgs(CacheablePtr args) override;
- virtual ExecutionPtr withCollector(ResultCollectorPtr rs) override;
+ virtual std::shared_ptr<Execution> withFilter(
+ std::shared_ptr<CacheableVector> routingObj) override;
+ virtual std::shared_ptr<Execution> withArgs(
+ std::shared_ptr<Cacheable> args) override;
+ virtual std::shared_ptr<Execution> withCollector(
+ std::shared_ptr<ResultCollector> rs) override;
// java function has hasResult property. we put the hasResult argument
// here as a kluge.
- virtual ResultCollectorPtr execute(const CacheableVectorPtr& routingObj,
- const CacheablePtr& args,
- const ResultCollectorPtr& rs,
- const char* func, std::chrono::milliseconds timeout) override;
+ virtual std::shared_ptr<ResultCollector> execute(
+ const std::shared_ptr<CacheableVector>& routingObj,
+ const std::shared_ptr<Cacheable>& args,
+ const std::shared_ptr<ResultCollector>& rs, const char* func,
+ std::chrono::milliseconds timeout) override;
- virtual ResultCollectorPtr execute(
- const char* func,
- std::chrono::milliseconds timeout =
- DEFAULT_QUERY_RESPONSE_TIMEOUT) override;
+ virtual std::shared_ptr<ResultCollector> execute(
+ const char* func, std::chrono::milliseconds timeout =
+ DEFAULT_QUERY_RESPONSE_TIMEOUT) override;
- static void addResults(ResultCollectorPtr& collector,
- const CacheableVectorPtr& results);
+ static void addResults(std::shared_ptr<ResultCollector>& collector,
+ const std::shared_ptr<CacheableVector>& results);
private:
ExecutionImpl(const ExecutionImpl& rhs)
@@ -83,10 +87,12 @@ class ExecutionImpl : public Execution {
m_allServer(rhs.m_allServer),
m_pool(rhs.m_pool),
m_proxyCache(rhs.m_proxyCache) {}
- ExecutionImpl(const CacheableVectorPtr& routingObj, const CacheablePtr& args,
- const ResultCollectorPtr& rc, const RegionPtr& region,
- const bool allServer, const PoolPtr& pool,
- ProxyCachePtr proxyCache = nullptr)
+ ExecutionImpl(const std::shared_ptr<CacheableVector>& routingObj,
+ const std::shared_ptr<Cacheable>& args,
+ const std::shared_ptr<ResultCollector>& rc,
+ const std::shared_ptr<Region>& region, const bool allServer,
+ const std::shared_ptr<Pool>& pool,
+ std::shared_ptr<ProxyCache> proxyCache = nullptr)
: m_routingObj(routingObj),
m_args(args),
m_rc(rc),
@@ -95,18 +101,18 @@ class ExecutionImpl : public Execution {
m_pool(pool),
m_proxyCache(proxyCache) {}
// ACE_Recursive_Thread_Mutex m_lock;
- CacheableVectorPtr m_routingObj;
- CacheablePtr m_args;
- ResultCollectorPtr m_rc;
- RegionPtr m_region;
+ std::shared_ptr<CacheableVector> m_routingObj;
+ std::shared_ptr<Cacheable> m_args;
+ std::shared_ptr<ResultCollector> m_rc;
+ std::shared_ptr<Region> m_region;
bool m_allServer;
- PoolPtr m_pool;
- ProxyCachePtr m_proxyCache;
+ std::shared_ptr<Pool> m_pool;
+ std::shared_ptr<ProxyCache> m_proxyCache;
static ACE_Recursive_Thread_Mutex m_func_attrs_lock;
static FunctionToFunctionAttributes m_func_attrs;
// std::vector<int8_t> m_attributes;
- CacheableVectorPtr executeOnPool(
+ std::shared_ptr<CacheableVector> executeOnPool(
std::string& func, uint8_t getResult, int32_t retryAttempts,
std::chrono::milliseconds timeout = DEFAULT_QUERY_RESPONSE_TIMEOUT);
diff --git a/cppcache/src/ExpMapEntry.cpp b/cppcache/src/ExpMapEntry.cpp
index f3db017..11adb9a 100644
--- a/cppcache/src/ExpMapEntry.cpp
+++ b/cppcache/src/ExpMapEntry.cpp
@@ -23,8 +23,8 @@ namespace geode {
namespace client {
void ExpEntryFactory::newMapEntry(ExpiryTaskManager* expiryTaskManager,
- const CacheableKeyPtr& key,
- MapEntryImplPtr& result) const {
+ const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& result) const {
if (m_concurrencyChecksEnabled) {
result =
MapEntryT<VersionedExpMapEntry, 0, 0>::create(expiryTaskManager, key);
diff --git a/cppcache/src/ExpMapEntry.hpp b/cppcache/src/ExpMapEntry.hpp
index a307222..82c6091 100644
--- a/cppcache/src/ExpMapEntry.hpp
+++ b/cppcache/src/ExpMapEntry.hpp
@@ -50,7 +50,7 @@ class CPPCACHE_EXPORT ExpMapEntry : public MapEntryImpl,
: MapEntryImpl(true), ExpEntryProperties(true) {}
inline ExpMapEntry(ExpiryTaskManager* expiryTaskManager,
- const CacheableKeyPtr& key)
+ const std::shared_ptr<CacheableKey>& key)
: MapEntryImpl(key), ExpEntryProperties(expiryTaskManager) {}
private:
@@ -59,8 +59,6 @@ class CPPCACHE_EXPORT ExpMapEntry : public MapEntryImpl,
ExpMapEntry& operator=(const ExpMapEntry&);
};
-typedef std::shared_ptr<ExpMapEntry> ExpMapEntryPtr;
-
class CPPCACHE_EXPORT VersionedExpMapEntry : public ExpMapEntry,
public VersionStamp {
public:
@@ -72,7 +70,7 @@ class CPPCACHE_EXPORT VersionedExpMapEntry : public ExpMapEntry,
inline explicit VersionedExpMapEntry(bool noInit) : ExpMapEntry(true) {}
inline VersionedExpMapEntry(ExpiryTaskManager* expiryTaskManager,
- const CacheableKeyPtr& key)
+ const std::shared_ptr<CacheableKey>& key)
: ExpMapEntry(expiryTaskManager, key) {}
private:
@@ -81,8 +79,6 @@ class CPPCACHE_EXPORT VersionedExpMapEntry : public ExpMapEntry,
VersionedExpMapEntry& operator=(const VersionedExpMapEntry&);
};
-typedef std::shared_ptr<VersionedExpMapEntry> VersionedExpMapEntryPtr;
-
class CPPCACHE_EXPORT ExpEntryFactory : public EntryFactory {
public:
using EntryFactory::EntryFactory;
@@ -90,8 +86,8 @@ class CPPCACHE_EXPORT ExpEntryFactory : public EntryFactory {
virtual ~ExpEntryFactory() {}
virtual void newMapEntry(ExpiryTaskManager* expiryTaskManager,
- const CacheableKeyPtr& key,
- MapEntryImplPtr& result) const;
+ const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& result) const;
};
} // namespace client
} // namespace geode
diff --git a/cppcache/src/FarSideEntryOp.cpp b/cppcache/src/FarSideEntryOp.cpp
index f991588..b5c1223 100644
--- a/cppcache/src/FarSideEntryOp.cpp
+++ b/cppcache/src/FarSideEntryOp.cpp
@@ -74,7 +74,7 @@ void FarSideEntryOp::fromData(DataInput& input, bool largeModCount,
skipFilterRoutingInfo(input);
m_versionTag =
TcrMessage::readVersionTagPart(input, memId, m_memberListForVersionStamp);
- // SerializablePtr sPtr;
+ // std::shared_ptr<Serializable> sPtr;
// input.readObject(sPtr);
m_eventOffset = input.readInt32();
if (!isDestroy(m_op)) {
@@ -111,11 +111,11 @@ void FarSideEntryOp::fromData(DataInput& input, bool largeModCount,
}
}
-void FarSideEntryOp::apply(RegionPtr& region) {
+void FarSideEntryOp::apply(std::shared_ptr<Region>& region) {
// LocalRegion* localRegion = static_cast<LocalRegion*>(region.get());
// localRegion->acquireReadLock();
- RegionInternalPtr ri = std::static_pointer_cast<RegionInternal>(region);
+ auto ri = std::static_pointer_cast<RegionInternal>(region);
if (isDestroy(m_op)) {
ri->txDestroy(m_key, m_callbackArg, m_versionTag);
} else if (isInvalidate(m_op)) {
@@ -126,7 +126,7 @@ void FarSideEntryOp::apply(RegionPtr& region) {
}
void FarSideEntryOp::skipFilterRoutingInfo(DataInput& input) {
- CacheablePtr tmp;
+ std::shared_ptr<Cacheable> tmp;
auto structType = input.read(); // this is DataSerializable (45)
if (structType == GeodeTypeIds::NullObj) {
@@ -187,10 +187,9 @@ void FarSideEntryOp::skipFilterRoutingInfo(DataInput& input) {
GF_CACHE_ILLEGAL_STATE_EXCEPTION);
}
}
-/*
-EntryEventPtr FarSideEntryOp::getEntryEvent(Cache* cache)
+/* std::shared_ptr<EntryEvent> FarSideEntryOp::getEntryEvent(Cache* cache)
{
- return EntryEventPtr(new EntryEvent(
+ return std::shared_ptr<EntryEvent>(new EntryEvent(
m_region->getRegion(cache),
m_key,
nullptr,
diff --git a/cppcache/src/FarSideEntryOp.hpp b/cppcache/src/FarSideEntryOp.hpp
index 7455833..49e11dc 100644
--- a/cppcache/src/FarSideEntryOp.hpp
+++ b/cppcache/src/FarSideEntryOp.hpp
@@ -89,8 +89,6 @@ enum OPERATION {
class RegionCommit;
-_GF_PTR_DEF_(FarSideEntryOp, FarSideEntryOpPtr);
-
class FarSideEntryOp {
public:
FarSideEntryOp(RegionCommit* region,
@@ -98,23 +96,24 @@ class FarSideEntryOp {
virtual ~FarSideEntryOp();
void fromData(DataInput& input, bool largeModCount, uint16_t memId);
- void apply(RegionPtr& region);
- static bool cmp(const FarSideEntryOpPtr& lhs, const FarSideEntryOpPtr& rhs) {
+ void apply(std::shared_ptr<Region>& region);
+ static bool cmp(const std::shared_ptr<FarSideEntryOp>& lhs,
+ const std::shared_ptr<FarSideEntryOp>& rhs) {
return lhs->m_modSerialNum > rhs->m_modSerialNum;
}
- // EntryEventPtr getEntryEvent(Cache* cache);
+ // std::shared_ptr<EntryEvent> getEntryEvent(Cache* cache);
private:
// UNUSED RegionCommit* m_region;
int8_t m_op;
int32_t m_modSerialNum;
int32_t m_eventOffset;
- CacheableKeyPtr m_key;
- CacheablePtr m_value;
+ std::shared_ptr<CacheableKey> m_key;
+ std::shared_ptr<Cacheable> m_value;
bool m_didDestroy;
- SerializablePtr m_callbackArg;
- VersionTagPtr m_versionTag;
+ std::shared_ptr<Serializable> m_callbackArg;
+ std::shared_ptr<VersionTag> m_versionTag;
MemberListForVersionStamp& m_memberListForVersionStamp;
// FilterRoutingInfo filterRoutingInfo;
bool isDestroy(int8_t op);
diff --git a/cppcache/src/FixedPartitionAttributesImpl.hpp b/cppcache/src/FixedPartitionAttributesImpl.hpp
index 0a48a05..c9fbccf 100644
--- a/cppcache/src/FixedPartitionAttributesImpl.hpp
+++ b/cppcache/src/FixedPartitionAttributesImpl.hpp
@@ -30,11 +30,9 @@ namespace apache {
namespace geode {
namespace client {
-_GF_PTR_DEF_(FixedPartitionAttributesImpl, FixedPartitionAttributesImplPtr)
-
class FixedPartitionAttributesImpl : public Serializable {
private:
- CacheableStringPtr m_partitionName;
+ std::shared_ptr<CacheableString> m_partitionName;
bool m_isPrimary;
int m_numBuckets;
int m_startingBucketId;
diff --git a/cppcache/src/FunctionService.cpp b/cppcache/src/FunctionService.cpp
index f20f0d7..fce4969 100644
--- a/cppcache/src/FunctionService.cpp
+++ b/cppcache/src/FunctionService.cpp
@@ -26,9 +26,9 @@
#include "CacheImpl.hpp"
using namespace apache::geode::client;
-
-ExecutionPtr FunctionService::onRegion(const RegionPtr& region) {
- LOGDEBUG("FunctionService::onRegion(RegionPtr region)");
+std::shared_ptr<Execution> FunctionService::onRegion(
+ const std::shared_ptr<Region>& region) {
+ LOGDEBUG("FunctionService::onRegion(std::shared_ptr<Region> region)");
if (region == nullptr) {
throw NullPointerException("FunctionService::onRegion: region is null");
}
@@ -39,11 +39,13 @@ ExecutionPtr FunctionService::onRegion(const RegionPtr& region) {
if (pool == nullptr) {
throw IllegalArgumentException("Pool attached with region is closed.");
}
- ProxyCachePtr proxyCache = nullptr;
+ std::shared_ptr<ProxyCache> proxyCache = nullptr;
if (pool->getMultiuserAuthentication()) {
if (auto pr = std::dynamic_pointer_cast<ProxyRegion>(realRegion)) {
- LOGDEBUG("FunctionService::onRegion(RegionPtr region) proxy cache");
+ LOGDEBUG(
+ "FunctionService::onRegion(std::shared_ptr<Region> region) proxy "
+ "cache");
// it is in multiuser mode
proxyCache = pr->m_proxyCache;
auto userAttachedPool = proxyCache->m_userAttributes->getPool();
@@ -73,8 +75,8 @@ ExecutionPtr FunctionService::onRegion(const RegionPtr& region) {
return std::make_shared<ExecutionImpl>(realRegion, proxyCache, pool);
}
-
-ExecutionPtr FunctionService::onServerWithPool(const PoolPtr& pool) {
+std::shared_ptr<Execution> FunctionService::onServerWithPool(
+ const std::shared_ptr<Pool>& pool) {
if (pool == nullptr) {
throw NullPointerException("FunctionService::onServer: pool is null");
}
@@ -85,10 +87,9 @@ ExecutionPtr FunctionService::onServerWithPool(const PoolPtr& pool) {
}
return std::make_shared<ExecutionImpl>(pool);
}
-
-ExecutionPtr FunctionService::onServersWithPool(const PoolPtr& pool) {
- if (pool == nullptr) {
- throw NullPointerException("FunctionService::onServers: pool is null");
+ std::shared_ptr<Execution> FunctionService::onServersWithPool(const std::shared_ptr<Pool>& pool) {
+ if (pool == nullptr) {
+ throw NullPointerException("FunctionService::onServers: pool is null");
}
if (pool->getMultiuserAuthentication()) {
throw UnsupportedOperationException(
@@ -98,8 +99,7 @@ ExecutionPtr FunctionService::onServersWithPool(const PoolPtr& pool) {
return std::make_shared<ExecutionImpl>(pool, true);
}
-
-ExecutionPtr FunctionService::onServerWithCache(const RegionServicePtr& cache) {
+ std::shared_ptr<Execution> FunctionService::onServerWithCache(const std::shared_ptr<RegionService>& cache) {
if (cache->isClosed()) {
throw IllegalStateException("Cache has been closed");
}
@@ -108,41 +108,40 @@ ExecutionPtr FunctionService::onServerWithCache(const RegionServicePtr& cache) {
LOGDEBUG("FunctionService::onServer:");
if (pc != nullptr) {
- PoolPtr userAttachedPool = pc->m_userAttributes->getPool();
- PoolPtr pool =
+ auto userAttachedPool = pc->m_userAttributes->getPool();
+ auto pool =
pc->m_cacheImpl->getPoolManager().find(userAttachedPool->getName());
- if (pool != nullptr && pool.get() == userAttachedPool.get() &&
- !pool->isDestroyed()) {
- return std::make_shared<ExecutionImpl>(pool, false, pc);
- }
- throw IllegalStateException(
- "Pool has been close to execute function on server");
+ if (pool != nullptr && pool.get() == userAttachedPool.get() &&
+ !pool->isDestroyed()) {
+ return std::make_shared<ExecutionImpl>(pool, false, pc);
+ }
+ throw IllegalStateException(
+ "Pool has been close to execute function on server");
} else {
- CachePtr realcache = std::static_pointer_cast<Cache>(cache);
+ auto realcache = std::static_pointer_cast<Cache>(cache);
return FunctionService::onServer(
realcache->m_cacheImpl->getPoolManager().getDefaultPool());
}
-}
-
-ExecutionPtr FunctionService::onServersWithCache(
- const RegionServicePtr& cache) {
- if (cache->isClosed()) {
- throw IllegalStateException("Cache has been closed");
- }
-
- auto pc = std::dynamic_pointer_cast<ProxyCache>(cache);
-
- LOGDEBUG("FunctionService::onServers:");
- if (pc != nullptr && !cache->isClosed()) {
- auto userAttachedPool = pc->m_userAttributes->getPool();
- auto pool = pc->m_cacheImpl->getCache()->getPoolManager().find(
- userAttachedPool->getName());
- if (pool != nullptr && pool.get() == userAttachedPool.get() &&
- !pool->isDestroyed()) {
- return std::make_shared<ExecutionImpl>(pool, true, pc);
- }
- throw IllegalStateException(
- "Pool has been close to execute function on server");
+ }
+ std::shared_ptr<Execution> FunctionService::onServersWithCache(
+ const std::shared_ptr<RegionService>& cache) {
+ if (cache->isClosed()) {
+ throw IllegalStateException("Cache has been closed");
+ }
+
+ auto pc = std::dynamic_pointer_cast<ProxyCache>(cache);
+
+ LOGDEBUG("FunctionService::onServers:");
+ if (pc != nullptr && !cache->isClosed()) {
+ auto userAttachedPool = pc->m_userAttributes->getPool();
+ auto pool = pc->m_cacheImpl->getCache()->getPoolManager().find(
+ userAttachedPool->getName());
+ if (pool != nullptr && pool.get() == userAttachedPool.get() &&
+ !pool->isDestroyed()) {
+ return std::make_shared<ExecutionImpl>(pool, true, pc);
+ }
+ throw IllegalStateException(
+ "Pool has been close to execute function on server");
} else {
auto realcache = std::static_pointer_cast<Cache>(cache);
return FunctionService::onServers(
diff --git a/cppcache/src/FunctionServiceImpl.cpp b/cppcache/src/FunctionServiceImpl.cpp
index 1b3adc8..2cb99ab 100644
--- a/cppcache/src/FunctionServiceImpl.cpp
+++ b/cppcache/src/FunctionServiceImpl.cpp
@@ -21,11 +21,11 @@
using namespace apache::geode::client;
-FunctionServiceImpl::FunctionServiceImpl(ProxyCachePtr proxyCache) {
+FunctionServiceImpl::FunctionServiceImpl(
+ std::shared_ptr<ProxyCache> proxyCache) {
m_proxyCache = proxyCache;
}
-
-FunctionServicePtr FunctionServiceImpl::getFunctionService(
- ProxyCachePtr proxyCache) {
+std::shared_ptr<FunctionService> FunctionServiceImpl::getFunctionService(
+ std::shared_ptr<ProxyCache> proxyCache) {
return std::make_shared<FunctionServiceImpl>(proxyCache);
}
diff --git a/cppcache/src/FunctionServiceImpl.hpp b/cppcache/src/FunctionServiceImpl.hpp
index 5f96381..d7fd804 100644
--- a/cppcache/src/FunctionServiceImpl.hpp
+++ b/cppcache/src/FunctionServiceImpl.hpp
@@ -42,12 +42,12 @@ class CPPCACHE_EXPORT FunctionServiceImpl : public FunctionService {
/**
* This function is used in multiuser mode to execute function on server.
*/
- // virtual ExecutionPtr onServer();
+ // virtual std::shared_ptr<Execution> onServer();
/**
* This function is used in multiuser mode to execute function on server.
*/
- // virtual ExecutionPtr onServers();
+ // virtual std::shared_ptr<Execution> onServers();
virtual ~FunctionServiceImpl() {}
@@ -55,11 +55,12 @@ class CPPCACHE_EXPORT FunctionServiceImpl : public FunctionService {
FunctionServiceImpl(const FunctionService &);
FunctionServiceImpl &operator=(const FunctionService &);
- FunctionServiceImpl(ProxyCachePtr proxyCache);
+ FunctionServiceImpl(std::shared_ptr<ProxyCache> proxyCache);
- static FunctionServicePtr getFunctionService(ProxyCachePtr proxyCache);
+ static std::shared_ptr<FunctionService> getFunctionService(
+ std::shared_ptr<ProxyCache> proxyCache);
- ProxyCachePtr m_proxyCache;
+ std::shared_ptr<ProxyCache> m_proxyCache;
friend class ProxyCache;
FRIEND_STD_SHARED_PTR(FunctionServiceImpl)
diff --git a/cppcache/src/GetAllServersRequest.hpp b/cppcache/src/GetAllServersRequest.hpp
index 77e4e02..38ee1c8 100644
--- a/cppcache/src/GetAllServersRequest.hpp
+++ b/cppcache/src/GetAllServersRequest.hpp
@@ -32,7 +32,7 @@ namespace geode {
namespace client {
class GetAllServersRequest : public Serializable {
- CacheableStringPtr m_serverGroup;
+ std::shared_ptr<CacheableString> m_serverGroup;
public:
GetAllServersRequest(const std::string& serverGroup) : Serializable() {
diff --git a/cppcache/src/GetAllServersResponse.hpp b/cppcache/src/GetAllServersResponse.hpp
index 707dbfb..faa2b33 100644
--- a/cppcache/src/GetAllServersResponse.hpp
+++ b/cppcache/src/GetAllServersResponse.hpp
@@ -51,7 +51,6 @@ class GetAllServersResponse : public Serializable {
std::vector<ServerLocation> getServers() { return m_servers; }
virtual ~GetAllServersResponse() {}
};
-typedef std::shared_ptr<GetAllServersResponse> GetAllServersResponsePtr;
} // namespace client
} // namespace geode
diff --git a/cppcache/src/InternalCacheTransactionManager2PCImpl.cpp b/cppcache/src/InternalCacheTransactionManager2PCImpl.cpp
index b24c898..dbe61d4 100644
--- a/cppcache/src/InternalCacheTransactionManager2PCImpl.cpp
+++ b/cppcache/src/InternalCacheTransactionManager2PCImpl.cpp
@@ -180,7 +180,7 @@ void InternalCacheTransactionManager2PCImpl::afterCompletion(int32_t status) {
} else {
switch (replyCommitAfter.getMessageType()) {
case TcrMessage::RESPONSE: {
- TXCommitMessagePtr commit = std::static_pointer_cast<TXCommitMessage>(
+ auto commit = std::static_pointer_cast<TXCommitMessage>(
replyCommitAfter.getValue());
if (commit.get() !=
nullptr) // e.g. when afterCompletion(STATUS_ROLLEDBACK) called
diff --git a/cppcache/src/LRUAction.cpp b/cppcache/src/LRUAction.cpp
index 8c3e74d..583dd4e 100644
--- a/cppcache/src/LRUAction.cpp
+++ b/cppcache/src/LRUAction.cpp
@@ -48,15 +48,16 @@ LRUAction* LRUAction::newLRUAction(const LRUAction::Action& actionType,
return result;
}
-bool LRUOverFlowToDiskAction::evict(const MapEntryImplPtr& mePtr) {
+bool LRUOverFlowToDiskAction::evict(
+ const std::shared_ptr<MapEntryImpl>& mePtr) {
if (m_regionPtr->isDestroyed()) {
LOGERROR(
"[internal error] :: OverflowAction: region is being destroyed, so not "
"evicting entries");
return false;
}
- CacheableKeyPtr keyPtr;
- CacheablePtr valuePtr;
+ std::shared_ptr<CacheableKey> keyPtr;
+ std::shared_ptr<Cacheable> valuePtr;
mePtr->getKeyI(keyPtr);
mePtr->getValueI(valuePtr);
if (valuePtr == nullptr) {
@@ -73,7 +74,7 @@ bool LRUOverFlowToDiskAction::evict(const MapEntryImplPtr& mePtr) {
if (persistenceInfo == nullptr) {
setInfo = true;
}
- PersistenceManagerPtr pmPtr = m_regionPtr->getPersistenceManager();
+ auto pmPtr = m_regionPtr->getPersistenceManager();
try {
pmPtr->write(keyPtr, valuePtr, persistenceInfo);
} catch (DiskFailureException& ex) {
@@ -99,9 +100,10 @@ bool LRUOverFlowToDiskAction::evict(const MapEntryImplPtr& mePtr) {
return true;
}
-bool LRULocalInvalidateAction::evict(const MapEntryImplPtr& mePtr) {
- VersionTagPtr versionTag;
- CacheableKeyPtr keyPtr;
+bool LRULocalInvalidateAction::evict(
+ const std::shared_ptr<MapEntryImpl>& mePtr) {
+ std::shared_ptr<VersionTag> versionTag;
+ std::shared_ptr<CacheableKey> keyPtr;
mePtr->getKeyI(keyPtr);
// we should invoke the invalidateNoThrow with appropriate
// flags to correctly invoke listeners
diff --git a/cppcache/src/LRUAction.hpp b/cppcache/src/LRUAction.hpp
index 711b1b3..21f76c2 100644
--- a/cppcache/src/LRUAction.hpp
+++ b/cppcache/src/LRUAction.hpp
@@ -78,7 +78,7 @@ class CPPCACHE_EXPORT LRUAction {
virtual ~LRUAction() {}
- virtual bool evict(const MapEntryImplPtr& mePtr) = 0;
+ virtual bool evict(const std::shared_ptr<MapEntryImpl>& mePtr) = 0;
virtual LRUAction::Action getType() = 0;
@@ -109,10 +109,10 @@ class CPPCACHE_EXPORT LRUDestroyAction : public virtual LRUAction {
public:
virtual ~LRUDestroyAction() {}
- virtual bool evict(const MapEntryImplPtr& mePtr) {
- CacheableKeyPtr keyPtr;
+ virtual bool evict(const std::shared_ptr<MapEntryImpl>& mePtr) {
+ std::shared_ptr<CacheableKey> keyPtr;
mePtr->getKeyI(keyPtr);
- VersionTagPtr versionTag;
+ std::shared_ptr<VersionTag> versionTag;
// we should invoke the destroyNoThrow with appropriate
// flags to correctly invoke listeners
LOGDEBUG("LRUDestroy: evicting entry with key [%s]",
@@ -148,7 +148,7 @@ class CPPCACHE_EXPORT LRULocalInvalidateAction : public virtual LRUAction {
public:
virtual ~LRULocalInvalidateAction() {}
- virtual bool evict(const MapEntryImplPtr& mePtr);
+ virtual bool evict(const std::shared_ptr<MapEntryImpl>& mePtr);
virtual LRUAction::Action getType() { return LRUAction::LOCAL_INVALIDATE; }
@@ -172,7 +172,7 @@ class CPPCACHE_EXPORT LRUOverFlowToDiskAction : public virtual LRUAction {
public:
virtual ~LRUOverFlowToDiskAction() {}
- virtual bool evict(const MapEntryImplPtr& mePtr);
+ virtual bool evict(const std::shared_ptr<MapEntryImpl>& mePtr);
virtual LRUAction::Action getType() { return LRUAction::OVERFLOW_TO_DISK; }
diff --git a/cppcache/src/LRUEntriesMap.cpp b/cppcache/src/LRUEntriesMap.cpp
index 34348db..bd4e0b7 100644
--- a/cppcache/src/LRUEntriesMap.cpp
+++ b/cppcache/src/LRUEntriesMap.cpp
@@ -38,13 +38,13 @@ class CPPCACHE_EXPORT TestMapAction : public virtual LRUAction {
virtual ~TestMapAction() {}
- virtual bool evict(const MapEntryImplPtr& mePtr) {
- CacheableKeyPtr keyPtr;
+ virtual bool evict(const std::shared_ptr<MapEntryImpl>& mePtr) {
+ std::shared_ptr<CacheableKey> keyPtr;
mePtr->getKeyI(keyPtr);
/** @TODO try catch.... return true or false. */
- CacheablePtr cPtr; // old value.
- MapEntryImplPtr me;
- VersionTagPtr versionTag;
+ std::shared_ptr<Cacheable> cPtr; // old value.
+ std::shared_ptr<MapEntryImpl> me;
+ std::shared_ptr<VersionTag> versionTag;
return (m_eMap->remove(keyPtr, cPtr, me, 0, versionTag, false) == GF_NOERR);
}
@@ -108,15 +108,16 @@ LRUEntriesMap::~LRUEntriesMap() { delete m_action; }
* If LRUAction is LRUInvalidateAction, then increment if old value was absent.
* If LRUAction is one of Destroys, then increment if old Entry was absent.
*/
-GfErrType LRUEntriesMap::create(const CacheableKeyPtr& key,
- const CacheablePtr& newValue,
- MapEntryImplPtr& me, CacheablePtr& oldValue,
+GfErrType LRUEntriesMap::create(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& newValue,
+ std::shared_ptr<MapEntryImpl>& me,
+ std::shared_ptr<Cacheable>& oldValue,
int updateCount, int destroyTracker,
- VersionTagPtr versionTag) {
+ std::shared_ptr<VersionTag> versionTag) {
MapSegment* segmentRPtr = segmentFor(key);
GfErrType err = GF_NOERR;
{ // SYNCHRONIZE_SEGMENT(segmentRPtr);
- MapEntryImplPtr mePtr;
+ std::shared_ptr<MapEntryImpl> mePtr;
if ((err = segmentRPtr->create(key, newValue, me, oldValue, updateCount,
destroyTracker, versionTag)) != GF_NOERR) {
return err;
@@ -129,7 +130,7 @@ GfErrType LRUEntriesMap::create(const CacheableKeyPtr& key,
if (!CacheableToken::isInvalid(oldValue)) {
m_size++;
}
- CacheablePtr tmpValue;
+ std::shared_ptr<Cacheable> tmpValue;
segmentRPtr->getEntry(key, mePtr, tmpValue);
if (mePtr == nullptr) {
return err;
@@ -163,7 +164,7 @@ GfErrType LRUEntriesMap::processLRU() {
GfErrType LRUEntriesMap::evictionHelper() {
GfErrType err = GF_NOERR;
// ACE_Guard< ACE_Recursive_Thread_Mutex > guard( m_mutex );
- MapEntryImplPtr lruEntryPtr;
+ std::shared_ptr<MapEntryImpl> lruEntryPtr;
m_lruList.getLRUEntry(lruEntryPtr);
if (lruEntryPtr == nullptr) {
err = GF_ENOENT;
@@ -194,9 +195,10 @@ void LRUEntriesMap::processLRU(int32_t numEntriesToEvict) {
}
}
-GfErrType LRUEntriesMap::invalidate(const CacheableKeyPtr& key,
- MapEntryImplPtr& me, CacheablePtr& oldValue,
- VersionTagPtr versionTag) {
+GfErrType LRUEntriesMap::invalidate(const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& me,
+ std::shared_ptr<Cacheable>& oldValue,
+ std::shared_ptr<VersionTag> versionTag) {
int64_t newSize = 0;
MapSegment* segmentRPtr = segmentFor(key);
bool isTokenAdded = false;
@@ -247,10 +249,12 @@ GfErrType LRUEntriesMap::invalidate(const CacheableKeyPtr& key,
return err;
}
-GfErrType LRUEntriesMap::put(const CacheableKeyPtr& key,
- const CacheablePtr& newValue, MapEntryImplPtr& me,
- CacheablePtr& oldValue, int updateCount,
- int destroyTracker, VersionTagPtr versionTag,
+GfErrType LRUEntriesMap::put(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& newValue,
+ std::shared_ptr<MapEntryImpl>& me,
+ std::shared_ptr<Cacheable>& oldValue,
+ int updateCount, int destroyTracker,
+ std::shared_ptr<VersionTag> versionTag,
bool& isUpdate, DataInput* delta) {
MapSegment* segmentRPtr = segmentFor(key);
GF_D_ASSERT(segmentRPtr != nullptr);
@@ -263,7 +267,7 @@ GfErrType LRUEntriesMap::put(const CacheableKeyPtr& key,
segmentRPtr->acquire();
segmentLocked = true;
}
- MapEntryImplPtr mePtr;
+ std::shared_ptr<MapEntryImpl> mePtr;
if ((err = segmentRPtr->put(key, newValue, me, oldValue, updateCount,
destroyTracker, isUpdate, versionTag, delta)) !=
GF_NOERR) {
@@ -311,19 +315,20 @@ GfErrType LRUEntriesMap::put(const CacheableKeyPtr& key,
if (isUpdate == false) {
++m_size;
++m_validEntries;
- CacheablePtr tmpValue;
+ std::shared_ptr<Cacheable> tmpValue;
segmentRPtr->getEntry(key, mePtr, tmpValue);
// mePtr cannot be null, we just put it...
- // must convert to an LRUMapEntryImplPtr...
+ // must convert to an std::shared_ptr<LRUMapEntryImpl>...
GF_D_ASSERT(mePtr != nullptr);
m_lruList.appendEntry(mePtr);
me = mePtr;
} else {
if (!CacheableToken::isToken(newValue) && isOldValueToken) {
- CacheablePtr tmpValue;
+ std::shared_ptr<Cacheable> tmpValue;
segmentRPtr->getEntry(key, mePtr, tmpValue);
mePtr->getLRUProperties().clearEvicted();
- m_lruList.appendEntry(MapEntryImplPtr(mePtr->getImplPtr()));
+ m_lruList.appendEntry(
+ std::shared_ptr<MapEntryImpl>(mePtr->getImplPtr()));
me = mePtr;
}
}
@@ -364,8 +369,9 @@ GfErrType LRUEntriesMap::put(const CacheableKeyPtr& key,
* as recently used. Note, getEntry, entries, and values do not mark entries
* as recently used.
*/
-bool LRUEntriesMap::get(const CacheableKeyPtr& key, CacheablePtr& returnPtr,
- MapEntryImplPtr& me) {
+bool LRUEntriesMap::get(const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<Cacheable>& returnPtr,
+ std::shared_ptr<MapEntryImpl>& me) {
char logkey[2048];
key->logString(logkey, 2040);
// LOGDEBUG("key = %s", logkey);
@@ -379,17 +385,17 @@ bool LRUEntriesMap::get(const CacheableKeyPtr& key, CacheablePtr& returnPtr,
}
{
returnPtr = nullptr;
- MapEntryImplPtr mePtr;
+ std::shared_ptr<MapEntryImpl> mePtr;
if (false == segmentRPtr->getEntry(key, mePtr, returnPtr)) {
if (segmentLocked == true) segmentRPtr->release();
return false;
}
// segmentRPtr->get(key, returnPtr, mePtr);
- MapEntryImplPtr nodeToMark = mePtr;
+ auto nodeToMark = mePtr;
LRUEntryProperties& lruProps = nodeToMark->getLRUProperties();
if (returnPtr != nullptr && CacheableToken::isOverflowed(returnPtr)) {
void* persistenceInfo = lruProps.getPersistenceInfo();
- CacheablePtr tmpObj;
+ std::shared_ptr<Cacheable> tmpObj;
try {
tmpObj = m_pmPtr->read(key, persistenceInfo);
} catch (Exception& ex) {
@@ -402,9 +408,9 @@ bool LRUEntriesMap::get(const CacheableKeyPtr& key, CacheablePtr& returnPtr,
returnPtr = tmpObj;
- CacheablePtr oldValue;
+ std::shared_ptr<Cacheable> oldValue;
bool isUpdate;
- VersionTagPtr versionTag;
+ std::shared_ptr<VersionTag> versionTag;
if (GF_NOERR == segmentRPtr->put(key, tmpObj, mePtr, oldValue, 0, 0,
isUpdate, versionTag, nullptr)) {
// m_entriesRetrieved++;
@@ -443,9 +449,11 @@ bool LRUEntriesMap::get(const CacheableKeyPtr& key, CacheablePtr& returnPtr,
}
}
-GfErrType LRUEntriesMap::remove(const CacheableKeyPtr& key,
- CacheablePtr& result, MapEntryImplPtr& me,
- int updateCount, VersionTagPtr versionTag,
+GfErrType LRUEntriesMap::remove(const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<Cacheable>& result,
+ std::shared_ptr<MapEntryImpl>& me,
+ int updateCount,
+ std::shared_ptr<VersionTag> versionTag,
bool afterRemote) {
MapSegment* segmentRPtr = segmentFor(key);
bool isEntryFound = true;
@@ -496,11 +504,11 @@ void LRUEntriesMap::updateMapSize(int64_t size) {
m_evictionControllerPtr->updateRegionHeapInfo(size);
}
}
-
-CacheablePtr LRUEntriesMap::getFromDisk(const CacheableKeyPtr& key,
- MapEntryImplPtr& me) const {
+std::shared_ptr<Cacheable> LRUEntriesMap::getFromDisk(
+ const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& me) const {
void* persistenceInfo = me->getLRUProperties().getPersistenceInfo();
- CacheablePtr tmpObj;
+ std::shared_ptr<Cacheable> tmpObj;
try {
LOGDEBUG("Reading value from persistence layer for key: %s",
key->toString()->asChar());
diff --git a/cppcache/src/LRUEntriesMap.hpp b/cppcache/src/LRUEntriesMap.hpp
index 0c86abe..d3452e2 100644
--- a/cppcache/src/LRUEntriesMap.hpp
+++ b/cppcache/src/LRUEntriesMap.hpp
@@ -64,7 +64,7 @@ class CPPCACHE_EXPORT LRUEntriesMap : public ConcurrentEntriesMap,
LRUAction* m_action;
LRUList<MapEntryImpl, MapEntryT<LRUMapEntry, 0, 0> > m_lruList;
uint32_t m_limit;
- PersistenceManagerPtr m_pmPtr;
+ std::shared_ptr<PersistenceManager> m_pmPtr;
EvictionController* m_evictionControllerPtr;
int64_t m_currentMapSize;
spinlock_mutex m_mapInfoLock;
@@ -81,37 +81,47 @@ class CPPCACHE_EXPORT LRUEntriesMap : public ConcurrentEntriesMap,
virtual ~LRUEntriesMap();
- virtual GfErrType put(const CacheableKeyPtr& key,
- const CacheablePtr& newValue, MapEntryImplPtr& me,
- CacheablePtr& oldValue, int updateCount,
- int destroyTracker, VersionTagPtr versionTag,
+ virtual GfErrType put(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& newValue,
+ std::shared_ptr<MapEntryImpl>& me,
+ std::shared_ptr<Cacheable>& oldValue, int updateCount,
+ int destroyTracker,
+ std::shared_ptr<VersionTag> versionTag,
bool& isUpdate = EntriesMap::boolVal,
DataInput* delta = nullptr);
- virtual GfErrType invalidate(const CacheableKeyPtr& key, MapEntryImplPtr& me,
- CacheablePtr& oldValue,
- VersionTagPtr versionTag);
- virtual GfErrType create(const CacheableKeyPtr& key,
- const CacheablePtr& newValue, MapEntryImplPtr& me,
- CacheablePtr& oldValue, int updateCount,
- int destroyTracker, VersionTagPtr versionTag);
- virtual bool get(const CacheableKeyPtr& key, CacheablePtr& returnPtr,
- MapEntryImplPtr& me);
- virtual CacheablePtr getFromDisk(const CacheableKeyPtr& key,
- MapEntryImplPtr& me) const;
+ virtual GfErrType invalidate(const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& me,
+ std::shared_ptr<Cacheable>& oldValue,
+ std::shared_ptr<VersionTag> versionTag);
+ virtual GfErrType create(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& newValue,
+ std::shared_ptr<MapEntryImpl>& me,
+ std::shared_ptr<Cacheable>& oldValue,
+ int updateCount, int destroyTracker,
+ std::shared_ptr<VersionTag> versionTag);
+ virtual bool get(const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<Cacheable>& returnPtr,
+ std::shared_ptr<MapEntryImpl>& me);
+ virtual std::shared_ptr<Cacheable> getFromDisk(
+ const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& me) const;
GfErrType processLRU();
void processLRU(int32_t numEntriesToEvict);
GfErrType evictionHelper();
void updateMapSize(int64_t size);
- inline void setPersistenceManager(PersistenceManagerPtr& pmPtr) {
+ inline void setPersistenceManager(
+ std::shared_ptr<PersistenceManager>& pmPtr) {
m_pmPtr = pmPtr;
}
/**
* @brief remove an entry, marking it evicted for LRUList maintainance.
*/
- virtual GfErrType remove(const CacheableKeyPtr& key, CacheablePtr& result,
- MapEntryImplPtr& me, int updateCount,
- VersionTagPtr versionTag, bool afterRemote);
+ virtual GfErrType remove(const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<Cacheable>& result,
+ std::shared_ptr<MapEntryImpl>& me, int updateCount,
+ std::shared_ptr<VersionTag> versionTag,
+ bool afterRemote);
virtual void close();
diff --git a/cppcache/src/LRUExpMapEntry.cpp b/cppcache/src/LRUExpMapEntry.cpp
index 66aface..3797c67 100644
--- a/cppcache/src/LRUExpMapEntry.cpp
+++ b/cppcache/src/LRUExpMapEntry.cpp
@@ -22,9 +22,10 @@ namespace apache {
namespace geode {
namespace client {
-void LRUExpEntryFactory::newMapEntry(ExpiryTaskManager* expiryTaskManager,
- const CacheableKeyPtr& key,
- MapEntryImplPtr& result) const {
+void LRUExpEntryFactory::newMapEntry(
+ ExpiryTaskManager* expiryTaskManager,
+ const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& result) const {
if (m_concurrencyChecksEnabled) {
result = MapEntryT<VersionedLRUExpMapEntry, 0, 0>::create(expiryTaskManager,
key);
diff --git a/cppcache/src/LRUExpMapEntry.hpp b/cppcache/src/LRUExpMapEntry.hpp
index 3617909..67a0f61 100644
--- a/cppcache/src/LRUExpMapEntry.hpp
+++ b/cppcache/src/LRUExpMapEntry.hpp
@@ -54,7 +54,7 @@ class CPPCACHE_EXPORT LRUExpMapEntry : public MapEntryImpl,
ExpEntryProperties(true) {}
inline LRUExpMapEntry(ExpiryTaskManager* expiryTaskManager,
- const CacheableKeyPtr& key)
+ const std::shared_ptr<CacheableKey>& key)
: MapEntryImpl(key), ExpEntryProperties(expiryTaskManager) {}
private:
@@ -63,8 +63,6 @@ class CPPCACHE_EXPORT LRUExpMapEntry : public MapEntryImpl,
LRUExpMapEntry& operator=(const LRUExpMapEntry&);
};
-typedef std::shared_ptr<LRUExpMapEntry> LRUExpMapEntryPtr;
-
class CPPCACHE_EXPORT VersionedLRUExpMapEntry : public LRUExpMapEntry,
public VersionStamp {
public:
@@ -76,7 +74,7 @@ class CPPCACHE_EXPORT VersionedLRUExpMapEntry : public LRUExpMapEntry,
inline explicit VersionedLRUExpMapEntry(bool noInit) : LRUExpMapEntry(true) {}
inline VersionedLRUExpMapEntry(ExpiryTaskManager* expiryTaskManager,
- const CacheableKeyPtr& key)
+ const std::shared_ptr<CacheableKey>& key)
: LRUExpMapEntry(expiryTaskManager, key) {}
private:
@@ -85,8 +83,6 @@ class CPPCACHE_EXPORT VersionedLRUExpMapEntry : public LRUExpMapEntry,
VersionedLRUExpMapEntry& operator=(const VersionedLRUExpMapEntry&);
};
-typedef std::shared_ptr<VersionedLRUExpMapEntry> VersionedLRUExpMapEntryPtr;
-
class CPPCACHE_EXPORT LRUExpEntryFactory : public EntryFactory {
public:
using EntryFactory::EntryFactory;
@@ -94,8 +90,8 @@ class CPPCACHE_EXPORT LRUExpEntryFactory : public EntryFactory {
virtual ~LRUExpEntryFactory() {}
virtual void newMapEntry(ExpiryTaskManager* expiryTaskManager,
- const CacheableKeyPtr& key,
- MapEntryImplPtr& result) const;
+ const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& result) const;
};
} // namespace client
} // namespace geode
diff --git a/cppcache/src/LRUList.cpp b/cppcache/src/LRUList.cpp
index 9a24286..5d9c24b 100644
--- a/cppcache/src/LRUList.cpp
+++ b/cppcache/src/LRUList.cpp
@@ -27,7 +27,7 @@ using util::concurrent::spinlock_mutex;
template <typename TEntry, typename TCreateEntry>
LRUList<TEntry, TCreateEntry>::LRUList() : m_headLock(), m_tailLock() {
- LRUListEntryPtr headEntry(TCreateEntry::create(nullptr));
+ std::shared_ptr<TEntry> headEntry(TCreateEntry::create(nullptr));
headEntry->getLRUProperties().setEvicted(); // create empty evicted entry.
m_headNode = new LRUListNode(headEntry);
m_tailNode = m_headNode;
@@ -45,7 +45,8 @@ LRUList<TEntry, TCreateEntry>::~LRUList() {
}
template <typename TEntry, typename TCreateEntry>
-void LRUList<TEntry, TCreateEntry>::appendEntry(const LRUListEntryPtr& entry) {
+void LRUList<TEntry, TCreateEntry>::appendEntry(
+ const std::shared_ptr<TEntry>& entry) {
std::lock_guard<spinlock_mutex> lk(m_tailLock);
LRUListNode* aNode = new LRUListNode(entry);
@@ -65,7 +66,8 @@ void LRUList<TEntry, TCreateEntry>::appendNode(LRUListNode* aNode) {
}
template <typename TEntry, typename TCreateEntry>
-void LRUList<TEntry, TCreateEntry>::getLRUEntry(LRUListEntryPtr& result) {
+void LRUList<TEntry, TCreateEntry>::getLRUEntry(
+ std::shared_ptr<TEntry>& result) {
bool isLast = false;
LRUListNode* aNode;
while (true) {
@@ -112,7 +114,7 @@ LRUList<TEntry, TCreateEntry>::getHeadNode(bool& isLast) {
if (nextNode == nullptr) {
// last one in the list...
isLast = true;
- LRUListEntryPtr entry;
+ std::shared_ptr<TEntry> entry;
result->getEntry(entry);
if (entry->getLRUProperties().testEvicted()) {
// list is empty.
diff --git a/cppcache/src/LRUList.hpp b/cppcache/src/LRUList.hpp
index 654ec06..ad1b364 100644
--- a/cppcache/src/LRUList.hpp
+++ b/cppcache/src/LRUList.hpp
@@ -85,20 +85,18 @@ using util::concurrent::spinlock_mutex;
template <typename TEntry, typename TCreateEntry>
class LRUList {
protected:
- typedef std::shared_ptr<TEntry> LRUListEntryPtr;
-
/**
* @brief The entries in the LRU List are instances of LRUListNode.
* This maintains the evicted and recently used state for each entry.
*/
class LRUListNode {
public:
- inline LRUListNode(const LRUListEntryPtr& entry)
+ inline LRUListNode(const std::shared_ptr<TEntry>& entry)
: m_entry(entry), m_nextLRUListNode(nullptr) {}
inline ~LRUListNode() {}
- inline void getEntry(LRUListEntryPtr& result) const { result = m_entry; }
+ inline void getEntry(std::shared_ptr<TEntry>& result) const { result = m_entry; }
inline LRUListNode* getNextLRUListNode() const { return m_nextLRUListNode; }
@@ -109,7 +107,7 @@ class LRUList {
inline void clearNextLRUListNode() { m_nextLRUListNode = nullptr; }
private:
- LRUListEntryPtr m_entry;
+ std::shared_ptr<TEntry> m_entry;
LRUListNode* m_nextLRUListNode;
// disabled
@@ -124,13 +122,13 @@ class LRUList {
/**
* @brief add an entry to the tail of the list.
*/
- void appendEntry(const LRUListEntryPtr& entry);
+ void appendEntry(const std::shared_ptr<TEntry>& entry);
/**
* @brief return the least recently used node from the list,
* and removing it from the list.
*/
- void getLRUEntry(LRUListEntryPtr& result);
+ void getLRUEntry(std::shared_ptr<TEntry>& result);
private:
/**
diff --git a/cppcache/src/LRULocalDestroyAction.cpp b/cppcache/src/LRULocalDestroyAction.cpp
index e0cc06d..bdd3f97 100644
--- a/cppcache/src/LRULocalDestroyAction.cpp
+++ b/cppcache/src/LRULocalDestroyAction.cpp
@@ -21,10 +21,10 @@
using namespace apache::geode::client;
-bool LRULocalDestroyAction::evict(const MapEntryImplPtr& mePtr) {
- CacheableKeyPtr keyPtr;
+bool LRULocalDestroyAction::evict(const std::shared_ptr<MapEntryImpl>& mePtr) {
+ std::shared_ptr<CacheableKey> keyPtr;
mePtr->getKeyI(keyPtr);
- VersionTagPtr versionTag;
+ std::shared_ptr<VersionTag> versionTag;
// we should invoke the destroyNoThrow with appropriate
// flags to correctly invoke listeners
LOGDEBUG("LRULocalDestroy: evicting entry with key [%s]",
diff --git a/cppcache/src/LRULocalDestroyAction.hpp b/cppcache/src/LRULocalDestroyAction.hpp
index a86bdf7..ee89040 100644
--- a/cppcache/src/LRULocalDestroyAction.hpp
+++ b/cppcache/src/LRULocalDestroyAction.hpp
@@ -46,7 +46,7 @@ class CPPCACHE_EXPORT LRULocalDestroyAction : public virtual LRUAction {
public:
virtual ~LRULocalDestroyAction() {}
- virtual bool evict(const MapEntryImplPtr& mePtr);
+ virtual bool evict(const std::shared_ptr<MapEntryImpl>& mePtr);
virtual LRUAction::Action getType() { return LRUAction::LOCAL_DESTROY; }
friend class LRUAction;
diff --git a/cppcache/src/LRUMapEntry.cpp b/cppcache/src/LRUMapEntry.cpp
index ed060e3..62f0cd0 100644
--- a/cppcache/src/LRUMapEntry.cpp
+++ b/cppcache/src/LRUMapEntry.cpp
@@ -23,8 +23,8 @@ namespace geode {
namespace client {
void LRUEntryFactory::newMapEntry(ExpiryTaskManager* expiryTaskManager,
- const CacheableKeyPtr& key,
- MapEntryImplPtr& result) const {
+ const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& result) const {
if (m_concurrencyChecksEnabled) {
result = MapEntryT<VersionedLRUMapEntry, 0, 0>::create(key);
} else {
diff --git a/cppcache/src/LRUMapEntry.hpp b/cppcache/src/LRUMapEntry.hpp
index 3520a4a..649e2d3 100644
--- a/cppcache/src/LRUMapEntry.hpp
+++ b/cppcache/src/LRUMapEntry.hpp
@@ -78,7 +78,8 @@ class CPPCACHE_EXPORT LRUMapEntry : public MapEntryImpl,
inline explicit LRUMapEntry(bool noInit)
: MapEntryImpl(true), LRUEntryProperties(true) {}
- inline LRUMapEntry(const CacheableKeyPtr& key) : MapEntryImpl(key) {}
+ inline LRUMapEntry(const std::shared_ptr<CacheableKey>& key)
+ : MapEntryImpl(key) {}
private:
// disabled
@@ -86,8 +87,6 @@ class CPPCACHE_EXPORT LRUMapEntry : public MapEntryImpl,
LRUMapEntry& operator=(const LRUMapEntry&);
};
-typedef std::shared_ptr<LRUMapEntry> LRUMapEntryPtr;
-
class CPPCACHE_EXPORT VersionedLRUMapEntry : public LRUMapEntry,
public VersionStamp {
public:
@@ -98,7 +97,7 @@ class CPPCACHE_EXPORT VersionedLRUMapEntry : public LRUMapEntry,
protected:
inline explicit VersionedLRUMapEntry(bool noInit) : LRUMapEntry(true) {}
- inline VersionedLRUMapEntry(const CacheableKeyPtr& key) : LRUMapEntry(key) {}
+ inline VersionedLRUMapEntry(const std::shared_ptr<CacheableKey>& key) : LRUMapEntry(key) {}
private:
// disabled
@@ -106,8 +105,6 @@ class CPPCACHE_EXPORT VersionedLRUMapEntry : public LRUMapEntry,
VersionedLRUMapEntry& operator=(const VersionedLRUMapEntry&);
};
-typedef std::shared_ptr<VersionedLRUMapEntry> VersionedLRUMapEntryPtr;
-
class CPPCACHE_EXPORT LRUEntryFactory : public EntryFactory {
public:
using EntryFactory::EntryFactory;
@@ -115,8 +112,8 @@ class CPPCACHE_EXPORT LRUEntryFactory : public EntryFactory {
virtual ~LRUEntryFactory() {}
virtual void newMapEntry(ExpiryTaskManager* expiryTaskManager,
- const CacheableKeyPtr& key,
- MapEntryImplPtr& result) const;
+ const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& result) const;
};
} // namespace client
} // namespace geode
diff --git a/cppcache/src/LocalRegion.cpp b/cppcache/src/LocalRegion.cpp
index eb36733..a96f830 100644
--- a/cppcache/src/LocalRegion.cpp
+++ b/cppcache/src/LocalRegion.cpp
@@ -40,10 +40,10 @@ namespace geode {
namespace client {
LocalRegion::LocalRegion(const std::string& name, CacheImpl* cache,
- const RegionInternalPtr& rPtr,
- const RegionAttributesPtr& attributes,
- const CacheStatisticsPtr& stats, bool shared,
- bool enableTimeStatistics)
+ const std::shared_ptr<RegionInternal>& rPtr,
+ const std::shared_ptr<RegionAttributes>& attributes,
+ const std::shared_ptr<CacheStatistics>& stats,
+ bool shared, bool enableTimeStatistics)
: RegionInternal(cache->getCache()->shared_from_this(), attributes),
m_name(name),
m_parentRegion(rPtr),
@@ -71,13 +71,13 @@ LocalRegion::LocalRegion(const std::string& name, CacheImpl* cache,
}
// Initialize callbacks
- CacheListenerPtr clptr;
- CacheWriterPtr cwptr;
+ std::shared_ptr<CacheListener> clptr;
+ std::shared_ptr<CacheWriter> cwptr;
clptr = m_regionAttributes->getCacheListener();
m_listener = clptr;
cwptr = m_regionAttributes->getCacheWriter();
m_writer = cwptr;
- CacheLoaderPtr cldptr;
+ std::shared_ptr<CacheLoader> cldptr;
cldptr = m_regionAttributes->getCacheLoader();
m_loader = cldptr;
@@ -91,7 +91,7 @@ LocalRegion::LocalRegion(const std::string& name, CacheImpl* cache,
.getStatisticsManager()
->getStatisticsFactory(),
m_fullPath);
- PoolPtr p =
+ auto p =
cache->getCache()->getPoolManager().find(getAttributes()->getPoolName());
// m_attachedPool = p;
setPool(p);
@@ -100,8 +100,7 @@ LocalRegion::LocalRegion(const std::string& name, CacheImpl* cache,
const char* LocalRegion::getName() const { return m_name.c_str(); }
const char* LocalRegion::getFullPath() const { return m_fullPath.c_str(); }
-
-RegionPtr LocalRegion::getParentRegion() const {
+std::shared_ptr<Region> LocalRegion::getParentRegion() const {
CHECK_DESTROY_PENDING(TryReadGuard, LocalRegion::getParentRegion);
return m_parentRegion;
}
@@ -125,48 +124,47 @@ void LocalRegion::updateAccessAndModifiedTime(bool modified) {
}
}
}
+ std::shared_ptr<CacheStatistics> LocalRegion::getStatistics() const {
+ CHECK_DESTROY_PENDING(TryReadGuard, LocalRegion::getStatistics);
+ bool m_statisticsEnabled = true;
+ auto& props = m_cacheImpl->getDistributedSystem().getSystemProperties();
+ m_statisticsEnabled = props.statisticsEnabled();
+ if (!m_statisticsEnabled) {
+ throw StatisticsDisabledException(
+ "LocalRegion::getStatistics statistics disabled for this region");
+ }
-CacheStatisticsPtr LocalRegion::getStatistics() const {
- CHECK_DESTROY_PENDING(TryReadGuard, LocalRegion::getStatistics);
- bool m_statisticsEnabled = true;
- auto& props = m_cacheImpl->getDistributedSystem().getSystemProperties();
- m_statisticsEnabled = props.statisticsEnabled();
- if (!m_statisticsEnabled) {
- throw StatisticsDisabledException(
- "LocalRegion::getStatistics statistics disabled for this region");
- }
-
- return m_cacheStatistics;
+ return m_cacheStatistics;
}
-void LocalRegion::invalidateRegion(const SerializablePtr& aCallbackArgument) {
+void LocalRegion::invalidateRegion(const std::shared_ptr<Serializable>& aCallbackArgument) {
GfErrType err =
invalidateRegionNoThrow(aCallbackArgument, CacheEventFlags::NORMAL);
GfErrTypeToException("Region::invalidateRegion", err);
}
void LocalRegion::localInvalidateRegion(
- const SerializablePtr& aCallbackArgument) {
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
GfErrType err =
invalidateRegionNoThrow(aCallbackArgument, CacheEventFlags::LOCAL);
GfErrTypeToException("Region::localInvalidateRegion", err);
}
-void LocalRegion::destroyRegion(const SerializablePtr& aCallbackArgument) {
+void LocalRegion::destroyRegion(const std::shared_ptr<Serializable>& aCallbackArgument) {
GfErrType err =
destroyRegionNoThrow(aCallbackArgument, true, CacheEventFlags::NORMAL);
GfErrTypeToException("Region::destroyRegion", err);
}
-void LocalRegion::localDestroyRegion(const SerializablePtr& aCallbackArgument) {
+void LocalRegion::localDestroyRegion(const std::shared_ptr<Serializable>& aCallbackArgument) {
GfErrType err =
destroyRegionNoThrow(aCallbackArgument, true, CacheEventFlags::LOCAL);
GfErrTypeToException("Region::localDestroyRegion", err);
}
void LocalRegion::tombstoneOperationNoThrow(
- const CacheableHashMapPtr& tombstoneVersions,
- const CacheableHashSetPtr& tombstoneKeys) {
+ const std::shared_ptr<CacheableHashMap>& tombstoneVersions,
+ const std::shared_ptr<CacheableHashSet>& tombstoneKeys) {
bool cachingEnabled = m_regionAttributes->getCachingEnabled();
if (!cachingEnabled) return;
@@ -193,8 +191,7 @@ void LocalRegion::tombstoneOperationNoThrow(
} else {
m_entries->reapTombstones(tombstoneKeys);
}
-}
-RegionPtr LocalRegion::getSubregion(const char* path) {
+} std::shared_ptr<Region> LocalRegion::getSubregion(const char* path) {
if (path == nullptr) {
throw IllegalArgumentException("LocalRegion::getSubregion: path is null");
}
@@ -214,7 +211,7 @@ RegionPtr LocalRegion::getSubregion(const char* path) {
size_t idx = fullname.find('/');
std::string stepname = fullname.substr(0, idx);
- RegionPtr region, rptr;
+ std::shared_ptr<Region> region, rptr;
if (0 == m_subRegions.find(stepname, region)) {
if (stepname == fullname) {
// done...
@@ -226,9 +223,8 @@ RegionPtr LocalRegion::getSubregion(const char* path) {
}
return rptr;
}
-
-RegionPtr LocalRegion::createSubregion(
- const char* subregionName, const RegionAttributesPtr& aRegionAttributes) {
+ std::shared_ptr<Region> LocalRegion::createSubregion(
+ const char* subregionName, const std::shared_ptr<RegionAttributes>& aRegionAttributes) {
CHECK_DESTROY_PENDING(TryWriteGuard, LocalRegion::createSubregion);
{
std::string namestr = subregionName;
@@ -239,36 +235,36 @@ RegionPtr LocalRegion::createSubregion(
}
MapOfRegionGuard guard1(m_subRegions.mutex());
- RegionPtr region_ptr;
+ std::shared_ptr<Region> region_ptr;
if (0 == m_subRegions.find(subregionName, region_ptr)) {
throw RegionExistsException(
"LocalRegion::createSubregion: named region exists in the region");
}
auto csptr = std::make_shared<CacheStatistics>();
- RegionInternalPtr rPtr = m_cacheImpl->createRegion_internal(
+ auto rPtr = m_cacheImpl->createRegion_internal(
subregionName,
std::static_pointer_cast<RegionInternal>(shared_from_this()),
aRegionAttributes, csptr, false);
- region_ptr = rPtr;
- if (!rPtr) {
- throw OutOfMemoryException("createSubregion: failed to create region");
+ region_ptr = rPtr;
+ if (!rPtr) {
+ throw OutOfMemoryException("createSubregion: failed to create region");
}
// Instantiate a PersistenceManager object if DiskPolicy is overflow
if (aRegionAttributes->getDiskPolicy() == DiskPolicyType::OVERFLOWS) {
- PersistenceManagerPtr pmPtr = aRegionAttributes->getPersistenceManager();
+ auto pmPtr = aRegionAttributes->getPersistenceManager();
if (pmPtr == nullptr) {
throw NullPointerException(
"PersistenceManager could not be instantiated");
}
- PropertiesPtr props = aRegionAttributes->getPersistenceProperties();
- pmPtr->init(RegionPtr(rPtr), props);
+ auto props = aRegionAttributes->getPersistenceProperties();
+ pmPtr->init(std::shared_ptr<Region>(rPtr), props);
rPtr->setPersistenceManager(pmPtr);
}
rPtr->acquireReadLock();
- m_subRegions.bind(rPtr->getName(), RegionPtr(rPtr));
+ m_subRegions.bind(rPtr->getName(), std::shared_ptr<Region>(rPtr));
// schedule the sub region expiry if regionExpiry enabled.
rPtr->setRegionExpiryTask();
@@ -276,20 +272,20 @@ RegionPtr LocalRegion::createSubregion(
return region_ptr;
}
-VectorOfRegion LocalRegion::subregions(const bool recursive) {
+std::vector<std::shared_ptr<Region>> LocalRegion::subregions(const bool recursive) {
CHECK_DESTROY_PENDING(TryReadGuard, LocalRegion::subregions);
- if (m_subRegions.current_size() == 0) return VectorOfRegion();
+ if (m_subRegions.current_size() == 0) return std::vector<std::shared_ptr<Region>>();
return subregions_internal(recursive);
}
-
-RegionEntryPtr LocalRegion::getEntry(const CacheableKeyPtr& key) {
+std::shared_ptr<RegionEntry> LocalRegion::getEntry(
+ const std::shared_ptr<CacheableKey>& key) {
if (getTXState() != nullptr) {
GfErrTypeThrowException("GetEntry is not supported in transaction",
GF_NOTSUP);
}
- RegionEntryPtr rptr;
- CacheablePtr valuePtr;
+ std::shared_ptr<RegionEntry> rptr;
+ std::shared_ptr<Cacheable> valuePtr;
getEntry(key, valuePtr);
if (valuePtr != nullptr) {
rptr = createRegionEntry(key, valuePtr);
@@ -297,21 +293,21 @@ RegionEntryPtr LocalRegion::getEntry(const CacheableKeyPtr& key) {
return rptr;
}
-void LocalRegion::getEntry(const CacheableKeyPtr& key, CacheablePtr& valuePtr) {
+void LocalRegion::getEntry(const std::shared_ptr<CacheableKey>& key, std::shared_ptr<Cacheable>& valuePtr) {
if (key == nullptr) {
throw IllegalArgumentException("LocalRegion::getEntry: null key");
}
- MapEntryImplPtr mePtr;
+ std::shared_ptr<MapEntryImpl> mePtr;
CHECK_DESTROY_PENDING(TryReadGuard, LocalRegion::getEntry);
if (m_regionAttributes->getCachingEnabled()) {
m_entries->getEntry(key, mePtr, valuePtr);
}
}
-
-CacheablePtr LocalRegion::get(const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument) {
- CacheablePtr rptr;
+std::shared_ptr<Cacheable> LocalRegion::get(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
+ std::shared_ptr<Cacheable> rptr;
int64_t sampleStartNanos = startStatOpTime();
GfErrType err = getNoThrow(key, rptr, aCallbackArgument);
updateStatOpTime(m_regionStats->getStat(), m_regionStats->getGetTimeId(),
@@ -324,11 +320,11 @@ CacheablePtr LocalRegion::get(const CacheableKeyPtr& key,
return rptr;
}
-void LocalRegion::put(const CacheableKeyPtr& key, const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument) {
- CacheablePtr oldValue;
+void LocalRegion::put(const std::shared_ptr<CacheableKey>& key, const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
+ std::shared_ptr<Cacheable> oldValue;
int64_t sampleStartNanos = startStatOpTime();
- VersionTagPtr versionTag;
+ std::shared_ptr<VersionTag> versionTag;
GfErrType err = putNoThrow(key, value, aCallbackArgument, oldValue, -1,
CacheEventFlags::NORMAL, versionTag);
updateStatOpTime(m_regionStats->getStat(), m_regionStats->getPutTimeId(),
@@ -337,19 +333,19 @@ void LocalRegion::put(const CacheableKeyPtr& key, const CacheablePtr& value,
GfErrTypeToException("Region::put", err);
}
-void LocalRegion::localPut(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument) {
- CacheablePtr oldValue;
- VersionTagPtr versionTag;
+void LocalRegion::localPut(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
+ std::shared_ptr<Cacheable> oldValue;
+ std::shared_ptr<VersionTag> versionTag;
GfErrType err = putNoThrow(key, value, aCallbackArgument, oldValue, -1,
CacheEventFlags::LOCAL, versionTag);
GfErrTypeToException("Region::localPut", err);
}
-void LocalRegion::putAll(const HashMapOfCacheable& map,
- std::chrono::milliseconds timeout,
- const SerializablePtr& aCallbackArgument) {
+void LocalRegion::putAll(
+ const HashMapOfCacheable& map, std::chrono::milliseconds timeout,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
util::PROTOCOL_OPERATION_TIMEOUT_BOUNDS(timeout);
auto sampleStartNanos = startStatOpTime();
@@ -360,8 +356,8 @@ void LocalRegion::putAll(const HashMapOfCacheable& map,
GfErrTypeToException("Region::putAll", err);
}
-void LocalRegion::removeAll(const VectorOfCacheableKey& keys,
- const SerializablePtr& aCallbackArgument) {
+void LocalRegion::removeAll(const std::vector<std::shared_ptr<CacheableKey>> & keys,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
if (keys.size() == 0) {
throw IllegalArgumentException("Region::removeAll: zero keys provided");
}
@@ -372,44 +368,46 @@ void LocalRegion::removeAll(const VectorOfCacheableKey& keys,
GfErrTypeToException("Region::removeAll", err);
}
-void LocalRegion::create(const CacheableKeyPtr& key, const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument) {
- VersionTagPtr versionTag;
+void LocalRegion::create(const std::shared_ptr<CacheableKey>& key, const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
+ std::shared_ptr<VersionTag> versionTag;
GfErrType err = createNoThrow(key, value, aCallbackArgument, -1,
CacheEventFlags::NORMAL, versionTag);
// handleReplay(err, nullptr);
GfErrTypeToException("Region::create", err);
}
-void LocalRegion::localCreate(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument) {
- VersionTagPtr versionTag;
+void LocalRegion::localCreate(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
+ std::shared_ptr<VersionTag> versionTag;
GfErrType err = createNoThrow(key, value, aCallbackArgument, -1,
CacheEventFlags::LOCAL, versionTag);
GfErrTypeToException("Region::localCreate", err);
}
-void LocalRegion::invalidate(const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument) {
- VersionTagPtr versionTag;
+void LocalRegion::invalidate(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
+ std::shared_ptr<VersionTag> versionTag;
GfErrType err = invalidateNoThrow(key, aCallbackArgument, -1,
CacheEventFlags::NORMAL, versionTag);
// handleReplay(err, nullptr);
GfErrTypeToException("Region::invalidate", err);
}
-void LocalRegion::localInvalidate(const CacheableKeyPtr& keyPtr,
- const SerializablePtr& aCallbackArgument) {
- VersionTagPtr versionTag;
+void LocalRegion::localInvalidate(const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
+ std::shared_ptr<VersionTag> versionTag;
GfErrType err = invalidateNoThrow(keyPtr, aCallbackArgument, -1,
CacheEventFlags::LOCAL, versionTag);
GfErrTypeToException("Region::localInvalidate", err);
}
-void LocalRegion::destroy(const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument) {
- VersionTagPtr versionTag;
+void LocalRegion::destroy(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
+ std::shared_ptr<VersionTag> versionTag;
GfErrType err = destroyNoThrow(key, aCallbackArgument, -1,
CacheEventFlags::NORMAL, versionTag);
@@ -417,17 +415,19 @@ void LocalRegion::destroy(const CacheableKeyPtr& key,
GfErrTypeToException("Region::destroy", err);
}
-void LocalRegion::localDestroy(const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument) {
- VersionTagPtr versionTag;
+void LocalRegion::localDestroy(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
+ std::shared_ptr<VersionTag> versionTag;
GfErrType err = destroyNoThrow(key, aCallbackArgument, -1,
CacheEventFlags::LOCAL, versionTag);
GfErrTypeToException("Region::localDestroy", err);
}
-bool LocalRegion::remove(const CacheableKeyPtr& key, const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument) {
- VersionTagPtr versionTag;
+bool LocalRegion::remove(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
+ std::shared_ptr<VersionTag> versionTag;
GfErrType err = removeNoThrow(key, value, aCallbackArgument, -1,
CacheEventFlags::NORMAL, versionTag);
@@ -442,9 +442,10 @@ bool LocalRegion::remove(const CacheableKeyPtr& key, const CacheablePtr& value,
return result;
}
-bool LocalRegion::removeEx(const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument) {
- VersionTagPtr versionTag;
+bool LocalRegion::removeEx(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
+ std::shared_ptr<VersionTag> versionTag;
GfErrType err = removeNoThrowEx(key, aCallbackArgument, -1,
CacheEventFlags::NORMAL, versionTag);
bool result = false;
@@ -458,10 +459,11 @@ bool LocalRegion::removeEx(const CacheableKeyPtr& key,
return result;
}
-bool LocalRegion::localRemove(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument) {
- VersionTagPtr versionTag;
+bool LocalRegion::localRemove(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
+ std::shared_ptr<VersionTag> versionTag;
GfErrType err = removeNoThrow(key, value, aCallbackArgument, -1,
CacheEventFlags::LOCAL, versionTag);
@@ -476,9 +478,10 @@ bool LocalRegion::localRemove(const CacheableKeyPtr& key,
return result;
}
-bool LocalRegion::localRemoveEx(const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument) {
- VersionTagPtr versionTag;
+bool LocalRegion::localRemoveEx(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
+ std::shared_ptr<VersionTag> versionTag;
GfErrType err = removeNoThrowEx(key, aCallbackArgument, -1,
CacheEventFlags::LOCAL, versionTag);
@@ -493,20 +496,20 @@ bool LocalRegion::localRemoveEx(const CacheableKeyPtr& key,
return result;
}
-VectorOfCacheableKey LocalRegion::keys() {
+std::vector<std::shared_ptr<CacheableKey>> LocalRegion::keys() {
CHECK_DESTROY_PENDING(TryReadGuard, LocalRegion::keys);
return keys_internal();
}
-VectorOfCacheableKey LocalRegion::serverKeys() {
+std::vector<std::shared_ptr<CacheableKey>> LocalRegion::serverKeys() {
throw UnsupportedOperationException(
"serverKeys is not supported for local regions.");
}
-VectorOfCacheable LocalRegion::values() {
+std::vector<std::shared_ptr<Cacheable>> LocalRegion::values() {
CHECK_DESTROY_PENDING(TryReadGuard, LocalRegion::values);
- VectorOfCacheable values;
+ std::vector<std::shared_ptr<Cacheable>> values;
if (m_regionAttributes->getCachingEnabled()) {
// invalidToken should not be added by the MapSegments.
@@ -516,10 +519,10 @@ VectorOfCacheable LocalRegion::values() {
return values;
}
-VectorOfRegionEntry LocalRegion::entries(bool recursive) {
+std::vector<std::shared_ptr<RegionEntry>> LocalRegion::entries(bool recursive) {
CHECK_DESTROY_PENDING(TryReadGuard, LocalRegion::entries);
- VectorOfRegionEntry entries;
+ std::vector<std::shared_ptr<RegionEntry>> entries;
if (m_regionAttributes->getCachingEnabled()) {
entries_internal(entries, recursive);
@@ -529,13 +532,14 @@ VectorOfRegionEntry LocalRegion::entries(bool recursive) {
}
HashMapOfCacheable LocalRegion::getAll(
- const VectorOfCacheableKey& keys,
- const SerializablePtr& aCallbackArgument) {
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
return getAll_internal(keys, aCallbackArgument, true);
}
HashMapOfCacheable LocalRegion::getAll_internal(
- const VectorOfCacheableKey& keys, const SerializablePtr& aCallbackArgument,
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
bool addToLocalCache) {
if (keys.empty()) {
throw IllegalArgumentException("Region::getAll: zero keys provided");
@@ -575,8 +579,7 @@ uint32_t LocalRegion::size() {
return LocalRegion::size_remote();
}
-
-RegionServicePtr LocalRegion::getRegionService() const {
+std::shared_ptr<RegionService> LocalRegion::getRegionService() const {
CHECK_DESTROY_PENDING(TryReadGuard, LocalRegion::getRegionService);
return m_cacheImpl->getCache()->shared_from_this();
}
@@ -587,13 +590,13 @@ CacheImpl* LocalRegion::getCacheImpl() const {
}
bool LocalRegion::containsValueForKey_remote(
- const CacheableKeyPtr& keyPtr) const {
+ const std::shared_ptr<CacheableKey>& keyPtr) const {
CHECK_DESTROY_PENDING(TryReadGuard, LocalRegion::containsValueForKey);
if (!m_regionAttributes->getCachingEnabled()) {
return false;
}
- CacheablePtr valuePtr;
- MapEntryImplPtr mePtr;
+ std::shared_ptr<Cacheable> valuePtr;
+ std::shared_ptr<MapEntryImpl> mePtr;
m_entries->getEntry(keyPtr, mePtr, valuePtr);
if (mePtr == nullptr) {
return false;
@@ -601,7 +604,8 @@ bool LocalRegion::containsValueForKey_remote(
return (valuePtr != nullptr && !CacheableToken::isInvalid(valuePtr));
}
-bool LocalRegion::containsValueForKey(const CacheableKeyPtr& keyPtr) const {
+bool LocalRegion::containsValueForKey(
+ const std::shared_ptr<CacheableKey>& keyPtr) const {
if (keyPtr == nullptr) {
throw IllegalArgumentException(
"LocalRegion::containsValueForKey: "
@@ -616,20 +620,24 @@ bool LocalRegion::containsValueForKey(const CacheableKeyPtr& keyPtr) const {
return containsValueForKey_remote(keyPtr);
}
-bool LocalRegion::containsKeyOnServer(const CacheableKeyPtr& keyPtr) const {
+bool LocalRegion::containsKeyOnServer(
+ const std::shared_ptr<CacheableKey>& keyPtr) const {
throw UnsupportedOperationException(
"LocalRegion::containsKeyOnServer: is not supported.");
}
-VectorOfCacheableKey LocalRegion::getInterestList() const {
+std::vector<std::shared_ptr<CacheableKey>> LocalRegion::getInterestList()
+ const {
throw UnsupportedOperationException(
"LocalRegion::getInterestList: is not supported.");
}
-VectorOfCacheableString LocalRegion::getInterestListRegex() const {
+std::vector<std::shared_ptr<CacheableString>>
+LocalRegion::getInterestListRegex() const {
throw UnsupportedOperationException(
"LocalRegion::getInterestListRegex: is not supported.");
}
-bool LocalRegion::containsKey(const CacheableKeyPtr& keyPtr) const {
+bool LocalRegion::containsKey(
+ const std::shared_ptr<CacheableKey>& keyPtr) const {
if (keyPtr == nullptr) {
throw IllegalArgumentException(
"LocalRegion::containsKey: "
@@ -639,7 +647,8 @@ bool LocalRegion::containsKey(const CacheableKeyPtr& keyPtr) const {
return containsKey_internal(keyPtr);
}
-void LocalRegion::setPersistenceManager(PersistenceManagerPtr& pmPtr) {
+void LocalRegion::setPersistenceManager(
+ std::shared_ptr<PersistenceManager>& pmPtr) {
m_persistenceManager = pmPtr;
// set the memberVariable of LRUEntriesMap too.
LRUEntriesMap* lruMap = dynamic_cast<LRUEntriesMap*>(m_entries);
@@ -665,7 +674,8 @@ void LocalRegion::setRegionExpiryTask() {
}
}
-void LocalRegion::registerEntryExpiryTask(MapEntryImplPtr& entry) {
+void LocalRegion::registerEntryExpiryTask(
+ std::shared_ptr<MapEntryImpl>& entry) {
// locking is not required here since only the thread that creates
// the entry will register the expiry task for that entry
ExpEntryProperties& expProps = entry->getExpProperties();
@@ -677,7 +687,7 @@ void LocalRegion::registerEntryExpiryTask(MapEntryImplPtr& entry) {
int64_t id = rptr->getCacheImpl()->getExpiryTaskManager().scheduleExpiryTask(
handler, duration.count(), 0);
if (Log::finestEnabled()) {
- CacheableKeyPtr key;
+ std::shared_ptr<CacheableKey> key;
entry->getKeyI(key);
LOGFINEST(
"entry expiry in region [%s], key [%s], task id = %d, "
@@ -752,7 +762,8 @@ void LocalRegion::release(bool invokeCallbacks) {
*@throw IllegalArgumentException, if the key is 'null'.
*@throw NotConnectedException, if not connected to geode system.
*/
-bool LocalRegion::containsKey_internal(const CacheableKeyPtr& keyPtr) const {
+bool LocalRegion::containsKey_internal(
+ const std::shared_ptr<CacheableKey>& keyPtr) const {
if (keyPtr == nullptr) {
throw IllegalArgumentException("Region::containsKey: key is null");
}
@@ -762,13 +773,15 @@ bool LocalRegion::containsKey_internal(const CacheableKeyPtr& keyPtr) const {
return m_entries->containsKey(keyPtr);
}
-VectorOfRegion LocalRegion::subregions_internal(const bool recursive) {
+std::vector<std::shared_ptr<Region>> LocalRegion::subregions_internal(
+ const bool recursive) {
MapOfRegionGuard guard(m_subRegions.mutex());
- if (m_subRegions.current_size() == 0) return VectorOfRegion();
+ if (m_subRegions.current_size() == 0)
+ return std::vector<std::shared_ptr<Region>>();
- VectorOfRegion regions;
- VectorOfRegion subRegions;
+ std::vector<std::shared_ptr<Region>> regions;
+ std::vector<std::shared_ptr<Region>> subRegions;
for (MapOfRegionWithLock::iterator p = m_subRegions.begin();
p != m_subRegions.end(); ++p) {
@@ -790,9 +803,10 @@ VectorOfRegion LocalRegion::subregions_internal(const bool recursive) {
return regions;
}
-GfErrType LocalRegion::getNoThrow(const CacheableKeyPtr& keyPtr,
- CacheablePtr& value,
- const SerializablePtr& aCallbackArgument) {
+GfErrType LocalRegion::getNoThrow(
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
CHECK_DESTROY_PENDING_NOTHROW(TryReadGuard);
GfErrType err = GF_NOERR;
@@ -804,7 +818,7 @@ GfErrType LocalRegion::getNoThrow(const CacheableKeyPtr& keyPtr,
if (isLocalOp()) {
return GF_NOTSUP;
}
- VersionTagPtr versionTag;
+ std::shared_ptr<VersionTag> versionTag;
err = getNoThrow_remote(keyPtr, value, aCallbackArgument, versionTag);
if (err == GF_NOERR) {
txState->setDirty();
@@ -823,12 +837,12 @@ GfErrType LocalRegion::getNoThrow(const CacheableKeyPtr& keyPtr,
// TODO: CacheableToken::isInvalid should be completely hidden
// inside MapSegment; this should be done both for the value obtained
// from local cache as well as oldValue in every instance
- MapEntryImplPtr me;
+ std::shared_ptr<MapEntryImpl> me;
int updateCount = -1;
bool isLoaderInvoked = false;
bool isLocal = false;
bool cachingEnabled = m_regionAttributes->getCachingEnabled();
- CacheablePtr localValue = nullptr;
+ std::shared_ptr<Cacheable> localValue = nullptr;
if (cachingEnabled) {
isLocal = m_entries->get(keyPtr, value, me);
if (isLocal && (value != nullptr && !CacheableToken::isInvalid(value))) {
@@ -855,13 +869,13 @@ GfErrType LocalRegion::getNoThrow(const CacheableKeyPtr& keyPtr,
// remove tracking for the entry before exiting the function
struct RemoveTracking {
private:
- const CacheableKeyPtr& m_key;
+ const std::shared_ptr<CacheableKey>& m_key;
const int& m_updateCount;
LocalRegion& m_region;
public:
- RemoveTracking(const CacheableKeyPtr& key, const int& updateCount,
- LocalRegion& region)
+ RemoveTracking(const std::shared_ptr<CacheableKey>& key,
+ const int& updateCount, LocalRegion& region)
: m_key(key), m_updateCount(updateCount), m_region(region) {}
~RemoveTracking() {
if (m_updateCount >= 0 &&
@@ -878,7 +892,7 @@ GfErrType LocalRegion::getNoThrow(const CacheableKeyPtr& keyPtr,
m_regionStats->incMisses();
cachePerfStats.incMisses();
- VersionTagPtr versionTag;
+ std::shared_ptr<VersionTag> versionTag;
// Get from some remote source (e.g. external java server) if required.
err = getNoThrow_remote(keyPtr, value, aCallbackArgument, versionTag);
@@ -908,7 +922,7 @@ GfErrType LocalRegion::getNoThrow(const CacheableKeyPtr& keyPtr,
}
}
- CacheablePtr oldValue;
+ std::shared_ptr<Cacheable> oldValue;
// Found it somehow, so store it.
if (value != nullptr /*&& value != CacheableToken::invalid( )*/ &&
cachingEnabled &&
@@ -968,14 +982,15 @@ GfErrType LocalRegion::getNoThrow(const CacheableKeyPtr& keyPtr,
return err;
}
-GfErrType LocalRegion::getAllNoThrow(const VectorOfCacheableKey& keys,
- const HashMapOfCacheablePtr& values,
- const HashMapOfExceptionPtr& exceptions,
- const bool addToLocalCache,
- const SerializablePtr& aCallbackArgument) {
+GfErrType LocalRegion::getAllNoThrow(
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ const std::shared_ptr<HashMapOfCacheable>& values,
+ const std::shared_ptr<HashMapOfException>& exceptions,
+ const bool addToLocalCache,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
CHECK_DESTROY_PENDING_NOTHROW(TryReadGuard);
GfErrType err = GF_NOERR;
- CacheablePtr value;
+ std::shared_ptr<Cacheable> value;
TXState* txState = getTXState();
if (txState != nullptr) {
@@ -992,14 +1007,14 @@ GfErrType LocalRegion::getAllNoThrow(const VectorOfCacheableKey& keys,
}
// keys not in cache with their tracking numbers to be gotten using
// a remote call
- VectorOfCacheableKey serverKeys;
+ std::vector<std::shared_ptr<CacheableKey>> serverKeys;
bool cachingEnabled = m_regionAttributes->getCachingEnabled();
bool regionAccessed = false;
auto& cachePerfStats = m_cacheImpl->getCachePerfStats();
for (int32_t index = 0; index < keys.size(); ++index) {
- const CacheableKeyPtr& key = keys[index];
- MapEntryImplPtr me;
+ const std::shared_ptr<CacheableKey>& key = keys[index];
+ std::shared_ptr<MapEntryImpl> me;
value = nullptr;
m_regionStats->incGets();
cachePerfStats.incGets();
@@ -1050,8 +1065,8 @@ class PutActions {
inline static const char* name() { return "Region::put"; }
- inline static GfErrType checkArgs(const CacheableKeyPtr& key,
- const CacheablePtr& value,
+ inline static GfErrType checkArgs(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
DataInput* delta = nullptr) {
if (key == nullptr || (value == nullptr && delta == nullptr)) {
return GF_CACHE_ILLEGAL_ARGUMENT_EXCEPTION;
@@ -1060,39 +1075,40 @@ class PutActions {
}
inline void getCallbackOldValue(bool cachingEnabled,
- const CacheableKeyPtr& key,
- MapEntryImplPtr& entry,
- CacheablePtr& oldValue) const {
+ const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& entry,
+ std::shared_ptr<Cacheable>& oldValue) const {
if (cachingEnabled) {
m_region.m_entries->getEntry(key, entry, oldValue);
}
}
- inline static void logCacheWriterFailure(const CacheableKeyPtr& key,
- const CacheablePtr& oldValue) {
+ inline static void logCacheWriterFailure(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& oldValue) {
bool isUpdate = (oldValue != nullptr);
LOGFINER("Cache writer vetoed %s for key %s",
(isUpdate ? "update" : "create"),
Utils::getCacheableKeyString(key)->asChar());
}
- inline GfErrType remoteUpdate(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument,
- VersionTagPtr& versionTag) {
+ inline GfErrType remoteUpdate(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag) {
// propagate the put to remote server, if any
return m_region.putNoThrow_remote(key, value, aCallbackArgument,
versionTag);
}
- inline GfErrType localUpdate(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- CacheablePtr& oldValue, bool cachingEnabled,
- const CacheEventFlags eventFlags,
- int updateCount, VersionTagPtr versionTag,
- DataInput* delta = nullptr,
- EventIdPtr eventId = nullptr,
- bool afterRemote = false) {
+ inline GfErrType localUpdate(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ std::shared_ptr<Cacheable>& oldValue, bool cachingEnabled,
+ const CacheEventFlags eventFlags, int updateCount,
+ std::shared_ptr<VersionTag> versionTag, DataInput* delta = nullptr,
+ std::shared_ptr<EventId> eventId = nullptr, bool afterRemote = false) {
return m_region.putLocal(name(), false, key, value, oldValue,
cachingEnabled, updateCount, 0, versionTag, delta,
eventId);
@@ -1108,8 +1124,8 @@ class PutActions {
class PutActionsTx : public PutActions {
public:
inline explicit PutActionsTx(LocalRegion& region) : PutActions(region) {}
- inline static GfErrType checkArgs(const CacheableKeyPtr& key,
- const CacheablePtr& value,
+ inline static GfErrType checkArgs(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
DataInput* delta = nullptr) {
if (key == nullptr) {
return GF_CACHE_ILLEGAL_ARGUMENT_EXCEPTION;
@@ -1133,8 +1149,8 @@ class CreateActions {
inline static const char* name() { return "Region::create"; }
- inline static GfErrType checkArgs(const CacheableKeyPtr& key,
- const CacheablePtr& value,
+ inline static GfErrType checkArgs(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
DataInput* delta) {
if (key == nullptr) {
return GF_CACHE_ILLEGAL_ARGUMENT_EXCEPTION;
@@ -1143,32 +1159,33 @@ class CreateActions {
}
inline void getCallbackOldValue(bool cachingEnabled,
- const CacheableKeyPtr& key,
- MapEntryImplPtr& entry,
- CacheablePtr& oldValue) const {}
+ const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& entry,
+ std::shared_ptr<Cacheable>& oldValue) const {}
- inline static void logCacheWriterFailure(const CacheableKeyPtr& key,
- const CacheablePtr& oldValue) {
+ inline static void logCacheWriterFailure(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& oldValue) {
LOGFINER("Cache writer vetoed create for key %s",
Utils::getCacheableKeyString(key)->asChar());
}
- inline GfErrType remoteUpdate(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument,
- VersionTagPtr& versionTag) {
+ inline GfErrType remoteUpdate(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag) {
return m_region.createNoThrow_remote(key, value, aCallbackArgument,
versionTag);
}
- inline GfErrType localUpdate(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- CacheablePtr& oldValue, bool cachingEnabled,
- const CacheEventFlags eventFlags,
- int updateCount, VersionTagPtr versionTag,
- DataInput* delta = nullptr,
- EventIdPtr eventId = nullptr,
- bool afterRemote = false) {
+ inline GfErrType localUpdate(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ std::shared_ptr<Cacheable>& oldValue, bool cachingEnabled,
+ const CacheEventFlags eventFlags, int updateCount,
+ std::shared_ptr<VersionTag> versionTag, DataInput* delta = nullptr,
+ std::shared_ptr<EventId> eventId = nullptr, bool afterRemote = false) {
return m_region.putLocal(name(), true, key, value, oldValue, cachingEnabled,
updateCount, 0, versionTag);
}
@@ -1192,8 +1209,8 @@ class DestroyActions {
inline static const char* name() { return "Region::destroy"; }
- inline static GfErrType checkArgs(const CacheableKeyPtr& key,
- const CacheablePtr& value,
+ inline static GfErrType checkArgs(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
DataInput* delta) {
if (key == nullptr) {
return GF_CACHE_ILLEGAL_ARGUMENT_EXCEPTION;
@@ -1202,39 +1219,40 @@ class DestroyActions {
}
inline void getCallbackOldValue(bool cachingEnabled,
- const CacheableKeyPtr& key,
- MapEntryImplPtr& entry,
- CacheablePtr& oldValue) const {
+ const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& entry,
+ std::shared_ptr<Cacheable>& oldValue) const {
if (cachingEnabled) {
m_region.m_entries->getEntry(key, entry, oldValue);
}
}
- inline static void logCacheWriterFailure(const CacheableKeyPtr& key,
- const CacheablePtr& oldValue) {
+ inline static void logCacheWriterFailure(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& oldValue) {
LOGFINER("Cache writer vetoed destroy for key %s",
Utils::getCacheableKeyString(key)->asChar());
}
- inline GfErrType remoteUpdate(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument,
- VersionTagPtr& versionTag) {
+ inline GfErrType remoteUpdate(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag) {
return m_region.destroyNoThrow_remote(key, aCallbackArgument, versionTag);
}
- inline GfErrType localUpdate(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- CacheablePtr& oldValue, bool cachingEnabled,
- const CacheEventFlags eventFlags,
- int updateCount, VersionTagPtr versionTag,
- DataInput* delta = nullptr,
- EventIdPtr eventId = nullptr,
- bool afterRemote = false) {
+ inline GfErrType localUpdate(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ std::shared_ptr<Cacheable>& oldValue, bool cachingEnabled,
+ const CacheEventFlags eventFlags, int updateCount,
+ std::shared_ptr<VersionTag> versionTag, DataInput* delta = nullptr,
+ std::shared_ptr<EventId> eventId = nullptr, bool afterRemote = false) {
auto& cachePerfStats = m_region.m_cacheImpl->getCachePerfStats();
if (cachingEnabled) {
- MapEntryImplPtr entry;
+ std::shared_ptr<MapEntryImpl> entry;
// for notification invoke the listener even if the key does
// not exist locally
GfErrType err;
@@ -1303,8 +1321,8 @@ class RemoveActions {
inline static const char* name() { return "Region::remove"; }
- inline static GfErrType checkArgs(const CacheableKeyPtr& key,
- const CacheablePtr& value,
+ inline static GfErrType checkArgs(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
DataInput* delta) {
if (key == nullptr) {
return GF_CACHE_ILLEGAL_ARGUMENT_EXCEPTION;
@@ -1313,26 +1331,28 @@ class RemoveActions {
}
inline void getCallbackOldValue(bool cachingEnabled,
- const CacheableKeyPtr& key,
- MapEntryImplPtr& entry,
- CacheablePtr& oldValue) const {
+ const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& entry,
+ std::shared_ptr<Cacheable>& oldValue) const {
if (cachingEnabled) {
m_region.m_entries->getEntry(key, entry, oldValue);
}
}
- inline static void logCacheWriterFailure(const CacheableKeyPtr& key,
- const CacheablePtr& oldValue) {
+ inline static void logCacheWriterFailure(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& oldValue) {
LOGFINER("Cache writer vetoed remove for key %s",
Utils::getCacheableKeyString(key)->asChar());
}
- inline GfErrType remoteUpdate(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument,
- VersionTagPtr& versionTag) {
+ inline GfErrType remoteUpdate(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag) {
// propagate the remove to remote server, if any
- CacheablePtr valuePtr;
+ std::shared_ptr<Cacheable> valuePtr;
GfErrType err = GF_NOERR;
if (!allowNULLValue && m_region.getAttributes()->getCachingEnabled()) {
m_region.getEntry(key, valuePtr);
@@ -1379,15 +1399,14 @@ class RemoveActions {
return m_ServerResponse;
}
- inline GfErrType localUpdate(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- CacheablePtr& oldValue, bool cachingEnabled,
- const CacheEventFlags eventFlags,
- int updateCount, VersionTagPtr versionTag,
- DataInput* delta = nullptr,
- EventIdPtr eventId = nullptr,
- bool afterRemote = false) {
- CacheablePtr valuePtr;
+ inline GfErrType localUpdate(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ std::shared_ptr<Cacheable>& oldValue, bool cachingEnabled,
+ const CacheEventFlags eventFlags, int updateCount,
+ std::shared_ptr<VersionTag> versionTag, DataInput* delta = nullptr,
+ std::shared_ptr<EventId> eventId = nullptr, bool afterRemote = false) {
+ std::shared_ptr<Cacheable> valuePtr;
GfErrType err = GF_NOERR;
if (!allowNULLValue && cachingEnabled) {
m_region.getEntry(key, valuePtr);
@@ -1436,7 +1455,7 @@ class RemoveActions {
auto& cachePerfStats = m_region.m_cacheImpl->getCachePerfStats();
if (cachingEnabled) {
- MapEntryImplPtr entry;
+ std::shared_ptr<MapEntryImpl> entry;
// for notification invoke the listener even if the key does
// not exist locally
GfErrType err;
@@ -1509,8 +1528,8 @@ class InvalidateActions {
inline static const char* name() { return "Region::invalidate"; }
- inline static GfErrType checkArgs(const CacheableKeyPtr& key,
- const CacheablePtr& value,
+ inline static GfErrType checkArgs(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
DataInput* delta = nullptr) {
if (key == nullptr) {
return GF_CACHE_ILLEGAL_ARGUMENT_EXCEPTION;
@@ -1519,39 +1538,40 @@ class InvalidateActions {
}
inline void getCallbackOldValue(bool cachingEnabled,
- const CacheableKeyPtr& key,
- MapEntryImplPtr& entry,
- CacheablePtr& oldValue) const {
+ const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& entry,
+ std::shared_ptr<Cacheable>& oldValue) const {
if (cachingEnabled) {
m_region.m_entries->getEntry(key, entry, oldValue);
}
}
- inline static void logCacheWriterFailure(const CacheableKeyPtr& key,
- const CacheablePtr& oldValue) {
+ inline static void logCacheWriterFailure(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& oldValue) {
bool isUpdate = (oldValue != nullptr);
LOGFINER("Cache writer vetoed %s for key %s",
(isUpdate ? "update" : "invalidate"),
Utils::getCacheableKeyString(key)->asChar());
}
- inline GfErrType remoteUpdate(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument,
- VersionTagPtr& versionTag) {
+ inline GfErrType remoteUpdate(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag) {
// propagate the invalidate to remote server, if any
return m_region.invalidateNoThrow_remote(key, aCallbackArgument,
versionTag);
}
- inline GfErrType localUpdate(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- CacheablePtr& oldValue, bool cachingEnabled,
- const CacheEventFlags eventFlags,
- int updateCount, VersionTagPtr versionTag,
- DataInput* delta = nullptr,
- EventIdPtr eventId = nullptr,
- bool afterRemote = false) {
+ inline GfErrType localUpdate(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ std::shared_ptr<Cacheable>& oldValue, bool cachingEnabled,
+ const CacheEventFlags eventFlags, int updateCount,
+ std::shared_ptr<VersionTag> versionTag, DataInput* delta = nullptr,
+ std::shared_ptr<EventId> eventId = nullptr, bool afterRemote = false) {
return m_region.invalidateLocal(name(), key, value, eventFlags, versionTag);
}
@@ -1560,13 +1580,13 @@ class InvalidateActions {
};
template <typename TAction>
-GfErrType LocalRegion::updateNoThrow(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument,
- CacheablePtr& oldValue, int updateCount,
- const CacheEventFlags eventFlags,
- VersionTagPtr versionTag, DataInput* delta,
- EventIdPtr eventId) {
+GfErrType LocalRegion::updateNoThrow(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<Cacheable>& oldValue, int updateCount,
+ const CacheEventFlags eventFlags, std::shared_ptr<VersionTag> versionTag,
+ DataInput* delta, std::shared_ptr<EventId> eventId) {
GfErrType err = GF_NOERR;
if ((err = TAction::checkArgs(key, value, delta)) != GF_NOERR) {
return err;
@@ -1583,7 +1603,7 @@ GfErrType LocalRegion::updateNoThrow(const CacheableKeyPtr& key,
/* adongre - Coverity II
* CID 29194 (6): Parse warning (PW.PARAMETER_HIDDEN)
*/
- // VersionTagPtr versionTag;
+ // std::shared_ptr<VersionTag> versionTag;
err = action.remoteUpdate(key, value, aCallbackArgument, versionTag);
if (err == GF_NOERR) {
txState->setDirty();
@@ -1593,7 +1613,7 @@ GfErrType LocalRegion::updateNoThrow(const CacheableKeyPtr& key,
}
bool cachingEnabled = m_regionAttributes->getCachingEnabled();
- MapEntryImplPtr entry;
+ std::shared_ptr<MapEntryImpl> entry;
// do not invoke the writer in case of notification/eviction
// or expiration
@@ -1665,8 +1685,8 @@ GfErrType LocalRegion::updateNoThrow(const CacheableKeyPtr& key,
TAction::name(), Utils::getCacheableKeyString(key)->asChar());
m_cacheImpl->getCachePerfStats().incFailureOnDeltaReceived();
// Get full object from server.
- CacheablePtr& newValue1 = const_cast<CacheablePtr&>(value);
- VersionTagPtr versionTag1;
+ std::shared_ptr<Cacheable>& newValue1 = const_cast<std::shared_ptr<Cacheable>&>(value);
+ std::shared_ptr<VersionTag> versionTag1;
err = getNoThrow_FullObject(eventId, newValue1, versionTag1);
if (err == GF_NOERR && newValue1 != nullptr) {
err = m_entries->put(key, newValue1, entry, oldValue, updateCount, 0,
@@ -1702,13 +1722,13 @@ GfErrType LocalRegion::updateNoThrow(const CacheableKeyPtr& key,
}
template <typename TAction>
-GfErrType LocalRegion::updateNoThrowTX(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument,
- CacheablePtr& oldValue, int updateCount,
- const CacheEventFlags eventFlags,
- VersionTagPtr versionTag,
- DataInput* delta, EventIdPtr eventId) {
+GfErrType LocalRegion::updateNoThrowTX(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<Cacheable>& oldValue, int updateCount,
+ const CacheEventFlags eventFlags, std::shared_ptr<VersionTag> versionTag,
+ DataInput* delta, std::shared_ptr<EventId> eventId) {
GfErrType err = GF_NOERR;
if ((err = TAction::checkArgs(key, value, delta)) != GF_NOERR) {
return err;
@@ -1718,7 +1738,7 @@ GfErrType LocalRegion::updateNoThrowTX(const CacheableKeyPtr& key,
TAction action(*this);
bool cachingEnabled = m_regionAttributes->getCachingEnabled();
- MapEntryImplPtr entry;
+ std::shared_ptr<MapEntryImpl> entry;
if (!eventFlags.isNotification() || getProcessedMarker()) {
if ((err = action.localUpdate(key, value, oldValue, cachingEnabled,
@@ -1758,111 +1778,107 @@ GfErrType LocalRegion::updateNoThrowTX(const CacheableKeyPtr& key,
return err;
}
-GfErrType LocalRegion::putNoThrow(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument,
- CacheablePtr& oldValue, int updateCount,
- const CacheEventFlags eventFlags,
- VersionTagPtr versionTag, DataInput* delta,
- EventIdPtr eventId) {
+GfErrType LocalRegion::putNoThrow(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<Cacheable>& oldValue, int updateCount,
+ const CacheEventFlags eventFlags, std::shared_ptr<VersionTag> versionTag,
+ DataInput* delta, std::shared_ptr<EventId> eventId) {
return updateNoThrow<PutActions>(key, value, aCallbackArgument, oldValue,
updateCount, eventFlags, versionTag, delta,
eventId);
}
-GfErrType LocalRegion::putNoThrowTX(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument,
- CacheablePtr& oldValue, int updateCount,
- const CacheEventFlags eventFlags,
- VersionTagPtr versionTag, DataInput* delta,
- EventIdPtr eventId) {
+GfErrType LocalRegion::putNoThrowTX(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<Cacheable>& oldValue, int updateCount,
+ const CacheEventFlags eventFlags, std::shared_ptr<VersionTag> versionTag,
+ DataInput* delta, std::shared_ptr<EventId> eventId) {
return updateNoThrowTX<PutActionsTx>(key, value, aCallbackArgument, oldValue,
updateCount, eventFlags, versionTag,
delta, eventId);
}
-GfErrType LocalRegion::createNoThrow(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument,
- int updateCount,
- const CacheEventFlags eventFlags,
- VersionTagPtr versionTag) {
- CacheablePtr oldValue;
+GfErrType LocalRegion::createNoThrow(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument, int updateCount,
+ const CacheEventFlags eventFlags, std::shared_ptr<VersionTag> versionTag) {
+ std::shared_ptr<Cacheable> oldValue;
return updateNoThrow<CreateActions>(key, value, aCallbackArgument, oldValue,
updateCount, eventFlags, versionTag);
}
-GfErrType LocalRegion::destroyNoThrow(const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument,
- int updateCount,
- const CacheEventFlags eventFlags,
- VersionTagPtr versionTag) {
- CacheablePtr oldValue;
+GfErrType LocalRegion::destroyNoThrow(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument, int updateCount,
+ const CacheEventFlags eventFlags, std::shared_ptr<VersionTag> versionTag) {
+ std::shared_ptr<Cacheable> oldValue;
return updateNoThrow<DestroyActions>(key, nullptr, aCallbackArgument,
oldValue, updateCount, eventFlags,
versionTag);
}
GfErrType LocalRegion::destroyNoThrowTX(
- const CacheableKeyPtr& key, const SerializablePtr& aCallbackArgument,
- int updateCount, const CacheEventFlags eventFlags,
- VersionTagPtr versionTag) {
- CacheablePtr oldValue;
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument, int updateCount,
+ const CacheEventFlags eventFlags, std::shared_ptr<VersionTag> versionTag) {
+ std::shared_ptr<Cacheable> oldValue;
return updateNoThrowTX<DestroyActions>(key, nullptr, aCallbackArgument,
oldValue, updateCount, eventFlags,
versionTag);
}
-GfErrType LocalRegion::removeNoThrow(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument,
- int updateCount,
- const CacheEventFlags eventFlags,
- VersionTagPtr versionTag) {
- CacheablePtr oldValue;
+GfErrType LocalRegion::removeNoThrow(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument, int updateCount,
+ const CacheEventFlags eventFlags, std::shared_ptr<VersionTag> versionTag) {
+ std::shared_ptr<Cacheable> oldValue;
return updateNoThrow<RemoveActions>(key, value, aCallbackArgument, oldValue,
updateCount, eventFlags, versionTag);
}
-GfErrType LocalRegion::removeNoThrowEx(const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument,
- int updateCount,
- const CacheEventFlags eventFlags,
- VersionTagPtr versionTag) {
- CacheablePtr oldValue;
+GfErrType LocalRegion::removeNoThrowEx(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument, int updateCount,
+ const CacheEventFlags eventFlags, std::shared_ptr<VersionTag> versionTag) {
+ std::shared_ptr<Cacheable> oldValue;
return updateNoThrow<RemoveActionsEx>(key, nullptr, aCallbackArgument,
oldValue, updateCount, eventFlags,
versionTag);
}
GfErrType LocalRegion::invalidateNoThrow(
- const CacheableKeyPtr& key, const SerializablePtr& aCallbackArgument,
- int updateCount, const CacheEventFlags eventFlags,
- VersionTagPtr versionTag) {
- CacheablePtr oldValue;
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument, int updateCount,
+ const CacheEventFlags eventFlags, std::shared_ptr<VersionTag> versionTag) {
+ std::shared_ptr<Cacheable> oldValue;
return updateNoThrow<InvalidateActions>(key, nullptr, aCallbackArgument,
oldValue, updateCount, eventFlags,
versionTag);
}
GfErrType LocalRegion::invalidateNoThrowTX(
- const CacheableKeyPtr& key, const SerializablePtr& aCallbackArgument,
- int updateCount, const CacheEventFlags eventFlags,
- VersionTagPtr versionTag) {
- CacheablePtr oldValue;
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument, int updateCount,
+ const CacheEventFlags eventFlags, std::shared_ptr<VersionTag> versionTag) {
+ std::shared_ptr<Cacheable> oldValue;
return updateNoThrowTX<InvalidateActions>(key, nullptr, aCallbackArgument,
oldValue, updateCount, eventFlags,
versionTag);
}
-GfErrType LocalRegion::putAllNoThrow(const HashMapOfCacheable& map,
- std::chrono::milliseconds timeout,
- const SerializablePtr& aCallbackArgument) {
+GfErrType LocalRegion::putAllNoThrow(
+ const HashMapOfCacheable& map, std::chrono::milliseconds timeout,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
CHECK_DESTROY_PENDING_NOTHROW(TryReadGuard);
GfErrType err = GF_NOERR;
- // VersionTagPtr versionTag;
- VersionedCacheableObjectPartListPtr
+ // std::shared_ptr<VersionTag> versionTag;
+ std::shared_ptr<VersionedCacheableObjectPartList>
versionedObjPartListPtr; //= new VersionedCacheableObjectPartList();
TXState* txState = getTXState();
if (txState != nullptr) {
@@ -1905,7 +1921,7 @@ GfErrType LocalRegion::putAllNoThrow(const HashMapOfCacheable& map,
} _removeTracking(oldValueMap, *this);
if (cachingEnabled || m_writer != nullptr) {
- CacheablePtr oldValue;
+ std::shared_ptr<Cacheable> oldValue;
for (const auto& iter : map) {
const auto& key = iter.first;
if (cachingEnabled &&
@@ -1936,7 +1952,7 @@ GfErrType LocalRegion::putAllNoThrow(const HashMapOfCacheable& map,
}
// next the local puts
GfErrType localErr;
- VersionTagPtr versionTag;
+ std::shared_ptr<VersionTag> versionTag;
if (cachingEnabled) {
if (m_isPRSingleHopEnabled) { /*New PRSingleHop Case:: PR Singlehop
@@ -1944,11 +1960,11 @@ GfErrType LocalRegion::putAllNoThrow(const HashMapOfCacheable& map,
for (int keyIndex = 0;
keyIndex < versionedObjPartListPtr->getSucceededKeys()->size();
keyIndex++) {
- const CacheableKeyPtr valPtr =
+ const auto valPtr =
versionedObjPartListPtr->getSucceededKeys()->at(keyIndex);
const auto& mapIter = map.find(valPtr);
- CacheableKeyPtr key = nullptr;
- CacheablePtr value = nullptr;
+ std::shared_ptr<CacheableKey> key = nullptr;
+ std::shared_ptr<Cacheable> value = nullptr;
if (mapIter != map.end()) {
key = mapIter->first;
@@ -1970,7 +1986,7 @@ GfErrType LocalRegion::putAllNoThrow(const HashMapOfCacheable& map,
versionedObjPartListPtr->getVersionedTagptr()[keyIndex];
}
}
- std::pair<CacheablePtr, int>& p = oldValueMap[key];
+ std::pair<std::shared_ptr<Cacheable>, int>& p = oldValueMap[key];
if ((localErr = LocalRegion::putNoThrow(
key, value, aCallbackArgument, p.first, p.second,
CacheEventFlags::LOCAL | CacheEventFlags::NOCACHEWRITER,
@@ -2034,12 +2050,12 @@ GfErrType LocalRegion::putAllNoThrow(const HashMapOfCacheable& map,
}
GfErrType LocalRegion::removeAllNoThrow(
- const VectorOfCacheableKey& keys,
- const SerializablePtr& aCallbackArgument) {
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
// 1. check destroy pending
CHECK_DESTROY_PENDING_NOTHROW(TryReadGuard);
GfErrType err = GF_NOERR;
- VersionedCacheableObjectPartListPtr versionedObjPartListPtr;
+ std::shared_ptr<VersionedCacheableObjectPartList> versionedObjPartListPtr;
// 2.check transaction state and do remote op
TXState* txState = getTXState();
@@ -2063,17 +2079,17 @@ GfErrType LocalRegion::removeAllNoThrow(
// 5. update local cache
GfErrType localErr;
- VersionTagPtr versionTag;
+ std::shared_ptr<VersionTag> versionTag;
if (cachingEnabled) {
- VectorOfCacheableKey* keysPtr;
+ std::vector<std::shared_ptr<CacheableKey>>* keysPtr;
if (m_isPRSingleHopEnabled) {
keysPtr = versionedObjPartListPtr->getSucceededKeys().get();
} else {
- keysPtr = const_cast<VectorOfCacheableKey*>(&keys);
+ keysPtr = const_cast<std::vector<std::shared_ptr<CacheableKey>>*>(&keys);
}
for (int keyIndex = 0; keyIndex < keysPtr->size(); keyIndex++) {
- CacheableKeyPtr key = keysPtr->at(keyIndex);
+ auto key = keysPtr->at(keyIndex);
if (versionedObjPartListPtr != nullptr &&
versionedObjPartListPtr.get() != nullptr) {
LOGDEBUG("versionedObjPartListPtr->getVersionedTagptr().size() = %d ",
@@ -2117,19 +2133,21 @@ GfErrType LocalRegion::removeAllNoThrow(
return err;
}
-void LocalRegion::clear(const SerializablePtr& aCallbackArgument) {
+void LocalRegion::clear(
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
/*update the stats */
int64_t sampleStartNanos = startStatOpTime();
localClear(aCallbackArgument);
updateStatOpTime(m_regionStats->getStat(), m_regionStats->getClearsId(),
sampleStartNanos);
}
-void LocalRegion::localClear(const SerializablePtr& aCallbackArgument) {
+void LocalRegion::localClear(
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
GfErrType err = localClearNoThrow(aCallbackArgument, CacheEventFlags::LOCAL);
if (err != GF_NOERR) GfErrTypeToException("LocalRegion::localClear", err);
}
GfErrType LocalRegion::localClearNoThrow(
- const SerializablePtr& aCallbackArgument,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
const CacheEventFlags eventFlags) {
bool cachingEnabled = m_regionAttributes->getCachingEnabled();
/*Update the stats for clear*/
@@ -2150,11 +2168,10 @@ GfErrType LocalRegion::localClearNoThrow(
return err;
}
-GfErrType LocalRegion::invalidateLocal(const char* name,
- const CacheableKeyPtr& keyPtr,
- const CacheablePtr& value,
- const CacheEventFlags eventFlags,
- VersionTagPtr versionTag) {
+GfErrType LocalRegion::invalidateLocal(
+ const char* name, const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Cacheable>& value, const CacheEventFlags eventFlags,
+ std::shared_ptr<VersionTag> versionTag) {
if (keyPtr == nullptr) {
return GF_CACHE_ILLEGAL_ARGUMENT_EXCEPTION;
}
@@ -2163,8 +2180,8 @@ GfErrType LocalRegion::invalidateLocal(const char* name,
GfErrType err = GF_NOERR;
bool cachingEnabled = m_regionAttributes->getCachingEnabled();
- CacheablePtr oldValue;
- MapEntryImplPtr me;
+ std::shared_ptr<Cacheable> oldValue;
+ std::shared_ptr<MapEntryImpl> me;
if (!eventFlags.isNotification() || getProcessedMarker()) {
if (cachingEnabled) {
@@ -2174,7 +2191,7 @@ GfErrType LocalRegion::invalidateLocal(const char* name,
/* adongre - Coverity II
* CID 29193: Parse warning (PW.PARAMETER_HIDDEN)
*/
- // VersionTagPtr versionTag;
+ // std::shared_ptr<VersionTag> versionTag;
if ((err = m_entries->invalidate(keyPtr, me, oldValue, versionTag)) !=
GF_NOERR) {
if (eventFlags.isNotification()) {
@@ -2217,20 +2234,20 @@ GfErrType LocalRegion::invalidateLocal(const char* name,
}
GfErrType LocalRegion::invalidateRegionNoThrow(
- const SerializablePtr& aCallbackArgument,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
const CacheEventFlags eventFlags) {
CHECK_DESTROY_PENDING_NOTHROW(TryReadGuard);
GfErrType err = GF_NOERR;
if (m_regionAttributes->getCachingEnabled()) {
- VectorOfCacheableKey v = keys_internal();
+ std::vector<std::shared_ptr<CacheableKey>> v = keys_internal();
const auto size = v.size();
- MapEntryImplPtr me;
+ std::shared_ptr<MapEntryImpl> me;
for (size_t i = 0; i < size; i++) {
{
- CacheablePtr oldValue;
+ std::shared_ptr<Cacheable> oldValue;
// invalidate all the entries with a nullptr versionTag
- VersionTagPtr versionTag;
+ std::shared_ptr<VersionTag> versionTag;
m_entries->invalidate(v.at(i), me, oldValue, versionTag);
if (!eventFlags.isEvictOrExpire()) {
updateAccessAndModifiedTimeForEntry(me, true);
@@ -2269,8 +2286,8 @@ GfErrType LocalRegion::invalidateRegionNoThrow(
}
GfErrType LocalRegion::destroyRegionNoThrow(
- const SerializablePtr& aCallbackArgument, bool removeFromParent,
- const CacheEventFlags eventFlags) {
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ bool removeFromParent, const CacheEventFlags eventFlags) {
// Get global locks to synchronize with failover thread.
// TODO: This should go into RegionGlobalLocks
// The distMngrsLock is required before RegionGlobalLocks since failover
@@ -2386,19 +2403,18 @@ GfErrType LocalRegion::destroyRegionNoThrow(
return err;
}
-GfErrType LocalRegion::putLocal(const char* name, bool isCreate,
- const CacheableKeyPtr& key,
- const CacheablePtr& value,
- CacheablePtr& oldValue, bool cachingEnabled,
- int updateCount, int destroyTracker,
- VersionTagPtr versionTag, DataInput* delta,
- EventIdPtr eventId) {
+GfErrType LocalRegion::putLocal(
+ const char* name, bool isCreate, const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ std::shared_ptr<Cacheable>& oldValue, bool cachingEnabled, int updateCount,
+ int destroyTracker, std::shared_ptr<VersionTag> versionTag,
+ DataInput* delta, std::shared_ptr<EventId> eventId) {
GfErrType err = GF_NOERR;
bool isUpdate = !isCreate;
auto& cachePerfStats = m_cacheImpl->getCachePerfStats();
if (cachingEnabled) {
- MapEntryImplPtr entry;
+ std::shared_ptr<MapEntryImpl> entry;
LOGDEBUG("%s: region [%s] putting key [%s], value [%s]", name,
getFullPath(), Utils::getCacheableKeyString(key)->asChar(),
Utils::getCacheableString(value)->asChar());
@@ -2411,8 +2427,9 @@ GfErrType LocalRegion::putLocal(const char* name, bool isCreate,
if (err == GF_INVALID_DELTA) {
cachePerfStats.incFailureOnDeltaReceived();
// PXR: Get full object from server.
- CacheablePtr& newValue1 = const_cast<CacheablePtr&>(value);
- VersionTagPtr versionTag1;
+ std::shared_ptr<Cacheable>& newValue1 =
+ const_cast<std::shared_ptr<Cacheable>&>(value);
+ std::shared_ptr<VersionTag> versionTag1;
err = getNoThrow_FullObject(eventId, newValue1, versionTag1);
if (err == GF_NOERR && newValue1 != nullptr) {
err = m_entries->put(
@@ -2457,8 +2474,8 @@ GfErrType LocalRegion::putLocal(const char* name, bool isCreate,
return err;
}
-VectorOfCacheableKey LocalRegion::keys_internal() {
- VectorOfCacheableKey keys;
+std::vector<std::shared_ptr<CacheableKey>> LocalRegion::keys_internal() {
+ std::vector<std::shared_ptr<CacheableKey>> keys;
if (m_regionAttributes->getCachingEnabled()) {
m_entries->getKeys(keys);
@@ -2467,7 +2484,7 @@ VectorOfCacheableKey LocalRegion::keys_internal() {
return keys;
}
-void LocalRegion::entries_internal(VectorOfRegionEntry& me,
+void LocalRegion::entries_internal(std::vector<std::shared_ptr<RegionEntry>>& me,
const bool recursive) {
m_entries->getEntries(me);
@@ -2489,8 +2506,10 @@ int LocalRegion::removeRegion(const std::string& name) {
}
bool LocalRegion::invokeCacheWriterForEntryEvent(
- const CacheableKeyPtr& key, CacheablePtr& oldValue,
- const CacheablePtr& newValue, const SerializablePtr& aCallbackArgument,
+ const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<Cacheable>& oldValue,
+ const std::shared_ptr<Cacheable>& newValue,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
CacheEventFlags eventFlags, EntryEventType type) {
// Check if we have a local cache writer. If so, invoke and return.
bool bCacheWriterReturn = true;
@@ -2550,8 +2569,8 @@ bool LocalRegion::invokeCacheWriterForEntryEvent(
}
bool LocalRegion::invokeCacheWriterForRegionEvent(
- const SerializablePtr& aCallbackArgument, CacheEventFlags eventFlags,
- RegionEventType type) {
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ CacheEventFlags eventFlags, RegionEventType type) {
// Check if we have a local cache writer. If so, invoke and return.
bool bCacheWriterReturn = true;
if (m_writer != nullptr) {
@@ -2597,8 +2616,10 @@ bool LocalRegion::invokeCacheWriterForRegionEvent(
}
GfErrType LocalRegion::invokeCacheListenerForEntryEvent(
- const CacheableKeyPtr& key, CacheablePtr& oldValue,
- const CacheablePtr& newValue, const SerializablePtr& aCallbackArgument,
+ const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<Cacheable>& oldValue,
+ const std::shared_ptr<Cacheable>& newValue,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
CacheEventFlags eventFlags, EntryEventType type, bool isLocal) {
GfErrType err = GF_NOERR;
@@ -2668,8 +2689,8 @@ GfErrType LocalRegion::invokeCacheListenerForEntryEvent(
}
GfErrType LocalRegion::invokeCacheListenerForRegionEvent(
- const SerializablePtr& aCallbackArgument, CacheEventFlags eventFlags,
- RegionEventType type) {
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ CacheEventFlags eventFlags, RegionEventType type) {
GfErrType err = GF_NOERR;
// Check if we have a local cache listener. If so, invoke and return.
@@ -2729,15 +2750,15 @@ GfErrType LocalRegion::invokeCacheListenerForRegionEvent(
// TODO: pass current time instead of evaluating it twice, here
// and in region
-void LocalRegion::updateAccessAndModifiedTimeForEntry(MapEntryImplPtr& ptr,
+void LocalRegion::updateAccessAndModifiedTimeForEntry(std::shared_ptr<MapEntryImpl>& ptr,
bool modified) {
// locking is not required since setters use atomic operations
if (ptr != nullptr && entryExpiryEnabled()) {
ExpEntryProperties& expProps = ptr->getExpProperties();
uint32_t currTime = static_cast<uint32_t>(ACE_OS::gettimeofday().sec());
- CacheableStringPtr keyStr;
+ std::shared_ptr<CacheableString> keyStr;
if (Log::debugEnabled()) {
- CacheableKeyPtr key;
+ std::shared_ptr<CacheableKey> key;
ptr->getKeyI(key);
keyStr = Utils::getCacheableKeyString(key);
}
@@ -2755,7 +2776,7 @@ void LocalRegion::updateAccessAndModifiedTimeForEntry(MapEntryImplPtr& ptr,
uint32_t LocalRegion::adjustLruEntriesLimit(uint32_t limit) {
CHECK_DESTROY_PENDING(TryReadGuard, LocalRegion::adjustLruEntriesLimit);
- RegionAttributesPtr attrs = m_regionAttributes;
+ auto attrs = m_regionAttributes;
if (!attrs->getCachingEnabled()) return 0;
bool hadlru = (attrs->getLruEntriesLimit() != 0);
bool needslru = (limit != 0);
@@ -2778,7 +2799,7 @@ ExpirationAction::Action LocalRegion::adjustRegionExpiryAction(
ExpirationAction::Action action) {
CHECK_DESTROY_PENDING(TryReadGuard, LocalRegion::adjustRegionExpiryAction);
- RegionAttributesPtr attrs = m_regionAttributes;
+ auto attrs = m_regionAttributes;
bool hadExpiry = (getRegionExpiryDuration().count() != 0);
if (!hadExpiry) {
throw IllegalStateException(
@@ -2798,7 +2819,7 @@ ExpirationAction::Action LocalRegion::adjustEntryExpiryAction(
ExpirationAction::Action action) {
CHECK_DESTROY_PENDING(TryReadGuard, LocalRegion::adjustEntryExpiryAction);
- RegionAttributesPtr attrs = m_regionAttributes;
+ auto attrs = m_regionAttributes;
bool hadExpiry = (getEntryExpiryDuration().count() != 0);
if (!hadExpiry) {
throw IllegalStateException(
@@ -2930,82 +2951,96 @@ std::chrono::seconds LocalRegion::getEntryExpiryDuration() const {
GfErrType LocalRegion::unregisterKeysBeforeDestroyRegion() { return GF_NOERR; }
GfErrType LocalRegion::getNoThrow_remote(
- const CacheableKeyPtr& keyPtr, CacheablePtr& valPtr,
- const SerializablePtr& aCallbackArgument, VersionTagPtr& versionTag) {
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ std::shared_ptr<Cacheable>& valPtr,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag) {
return GF_NOERR;
}
GfErrType LocalRegion::putNoThrow_remote(
- const CacheableKeyPtr& keyPtr, const CacheablePtr& cvalue,
- const SerializablePtr& aCallbackArgument, VersionTagPtr& versionTag,
- bool checkDelta) {
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Cacheable>& cvalue,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag, bool checkDelta) {
return GF_NOERR;
}
GfErrType LocalRegion::putAllNoThrow_remote(
const HashMapOfCacheable& map,
- VersionedCacheableObjectPartListPtr& putAllResponse,
+ std::shared_ptr<VersionedCacheableObjectPartList>& putAllResponse,
std::chrono::milliseconds timeout,
- const SerializablePtr& aCallbackArgument) {
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
return GF_NOERR;
}
GfErrType LocalRegion::removeAllNoThrow_remote(
- const VectorOfCacheableKey& keys,
- VersionedCacheableObjectPartListPtr& versionedObjPartList,
- const SerializablePtr& aCallbackArgument) {
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ std::shared_ptr<VersionedCacheableObjectPartList>& versionedObjPartList,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
return GF_NOERR;
}
GfErrType LocalRegion::createNoThrow_remote(
- const CacheableKeyPtr& keyPtr, const CacheablePtr& cvalue,
- const SerializablePtr& aCallbackArgument, VersionTagPtr& versionTag) {
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Cacheable>& cvalue,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag) {
return GF_NOERR;
}
GfErrType LocalRegion::destroyNoThrow_remote(
- const CacheableKeyPtr& keyPtr, const SerializablePtr& aCallbackArgument,
- VersionTagPtr& versionTag) {
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag) {
return GF_NOERR;
}
GfErrType LocalRegion::removeNoThrow_remote(
- const CacheableKeyPtr& keyPtr, const CacheablePtr& cvalue,
- const SerializablePtr& aCallbackArgument, VersionTagPtr& versionTag) {
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Cacheable>& cvalue,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag) {
return GF_NOERR;
}
GfErrType LocalRegion::removeNoThrowEX_remote(
- const CacheableKeyPtr& keyPtr, const SerializablePtr& aCallbackArgument,
- VersionTagPtr& versionTag) {
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag) {
return GF_NOERR;
}
GfErrType LocalRegion::invalidateNoThrow_remote(
- const CacheableKeyPtr& keyPtr, const SerializablePtr& aCallbackArgument,
- VersionTagPtr& versionTag) {
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag) {
return GF_NOERR;
}
GfErrType LocalRegion::getAllNoThrow_remote(
- const VectorOfCacheableKey* keys, const HashMapOfCacheablePtr& values,
- const HashMapOfExceptionPtr& exceptions,
- const VectorOfCacheableKeyPtr& resultKeys, bool addToLocalCache,
- const SerializablePtr& aCallbackArgument) {
+ const std::vector<std::shared_ptr<CacheableKey>>* keys,
+ const std::shared_ptr<HashMapOfCacheable>& values,
+ const std::shared_ptr<HashMapOfException>& exceptions,
+ const std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>>&
+ resultKeys,
+ bool addToLocalCache,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
return GF_NOERR;
}
GfErrType LocalRegion::invalidateRegionNoThrow_remote(
- const SerializablePtr& aCallbackArgument) {
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
return GF_NOERR;
}
GfErrType LocalRegion::destroyRegionNoThrow_remote(
- const SerializablePtr& aCallbackArgument) {
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
return GF_NOERR;
}
-void LocalRegion::adjustCacheListener(const CacheListenerPtr& aListener) {
+void LocalRegion::adjustCacheListener(
+ const std::shared_ptr<CacheListener>& aListener) {
WriteGuard guard(m_rwLock);
setCacheListener(aListener);
m_listener = aListener;
@@ -3017,7 +3052,8 @@ void LocalRegion::adjustCacheListener(const char* lib, const char* func) {
m_listener = m_regionAttributes->getCacheListener();
}
-void LocalRegion::adjustCacheLoader(const CacheLoaderPtr& aLoader) {
+void LocalRegion::adjustCacheLoader(
+ const std::shared_ptr<CacheLoader>& aLoader) {
WriteGuard guard(m_rwLock);
setCacheLoader(aLoader);
m_loader = aLoader;
@@ -3029,7 +3065,7 @@ void LocalRegion::adjustCacheLoader(const char* lib, const char* func) {
m_loader = m_regionAttributes->getCacheLoader();
}
-void LocalRegion::adjustCacheWriter(const CacheWriterPtr& aWriter) {
+void LocalRegion::adjustCacheWriter(const std::shared_ptr<CacheWriter>& aWriter) {
WriteGuard guard(m_rwLock);
setCacheWriter(aWriter);
m_writer = aWriter;
@@ -3071,14 +3107,13 @@ void LocalRegion::invokeAfterAllEndPointDisconnected() {
}
}
-GfErrType LocalRegion::getNoThrow_FullObject(EventIdPtr eventId,
- CacheablePtr& fullObject,
- VersionTagPtr& versionTag) {
+GfErrType LocalRegion::getNoThrow_FullObject(
+ std::shared_ptr<EventId> eventId, std::shared_ptr<Cacheable>& fullObject,
+ std::shared_ptr<VersionTag>& versionTag) {
return GF_NOERR;
}
-
-CacheablePtr LocalRegion::handleReplay(GfErrType& err,
- CacheablePtr value) const {
+std::shared_ptr<Cacheable> LocalRegion::handleReplay(
+ GfErrType& err, std::shared_ptr<Cacheable> value) const {
if (err == GF_TRANSACTION_DATA_REBALANCED_EXCEPTION ||
err == GF_TRANSACTION_DATA_NODE_HAS_DEPARTED_EXCEPTION) {
bool isRollBack = (err == GF_TRANSACTION_DATA_REBALANCED_EXCEPTION);
@@ -3088,15 +3123,14 @@ CacheablePtr LocalRegion::handleReplay(GfErrType& err,
GF_CACHE_ILLEGAL_STATE_EXCEPTION);
}
- CacheablePtr ret = txState->replay(isRollBack);
+ auto ret = txState->replay(isRollBack);
err = GF_NOERR;
return ret;
}
return value;
}
-
-TombstoneListPtr LocalRegion::getTombstoneList() { return m_tombstoneList; }
+ std::shared_ptr<TombstoneList> LocalRegion::getTombstoneList() { return m_tombstoneList; }
int64_t LocalRegion::startStatOpTime() {
return m_enableTimeStatistics ? Utils::startStatOpTime() : 0;
diff --git a/cppcache/src/LocalRegion.hpp b/cppcache/src/LocalRegion.hpp
index e22657a..006a78b 100644
--- a/cppcache/src/LocalRegion.hpp
+++ b/cppcache/src/LocalRegion.hpp
@@ -86,7 +86,8 @@ class DestroyActions;
class RemoveActions;
class InvalidateActions;
-typedef std::unordered_map<CacheableKeyPtr, std::pair<CacheablePtr, int> >
+typedef std::unordered_map<std::shared_ptr<CacheableKey>,
+ std::pair<std::shared_ptr<Cacheable>, int>>
MapOfOldValue;
/**
@@ -117,7 +118,6 @@ typedef std::unordered_map<CacheableKeyPtr, std::pair<CacheablePtr, int> >
* separator is used to concatenate all the region names together from the root,
* starting with the root's subregions.
*/
-typedef std::shared_ptr<LocalRegion> LocalRegionPtr;
class CPPCACHE_EXPORT LocalRegion : public RegionInternal {
/**
@@ -128,198 +128,234 @@ class CPPCACHE_EXPORT LocalRegion : public RegionInternal {
* @brief constructor/destructor
*/
LocalRegion(const std::string& name, CacheImpl* cache,
- const RegionInternalPtr& rPtr,
- const RegionAttributesPtr& attributes,
- const CacheStatisticsPtr& stats, bool shared = false,
- bool enableTimeStatistics = true);
+ const std::shared_ptr<RegionInternal>& rPtr,
+ const std::shared_ptr<RegionAttributes>& attributes,
+ const std::shared_ptr<CacheStatistics>& stats,
+ bool shared = false, bool enableTimeStatistics = true);
virtual ~LocalRegion();
const char* getName() const override;
const char* getFullPath() const override;
- RegionPtr getParentRegion() const override;
- RegionAttributesPtr getAttributes() const override {
+ std::shared_ptr<Region> getParentRegion() const override;
+ std::shared_ptr<RegionAttributes> getAttributes() const override {
return m_regionAttributes;
}
- AttributesMutatorPtr getAttributesMutator() const override {
+ std::shared_ptr<AttributesMutator> getAttributesMutator() const override {
return std::make_shared<AttributesMutator>(
std::const_pointer_cast<LocalRegion>(
std::static_pointer_cast<const LocalRegion>(shared_from_this())));
}
void updateAccessAndModifiedTime(bool modified) override;
- CacheStatisticsPtr getStatistics() const override;
- virtual void clear(
- const SerializablePtr& aCallbackArgument = nullptr) override;
- virtual void localClear(
- const SerializablePtr& aCallbackArgument = nullptr) override;
+ std::shared_ptr<CacheStatistics> getStatistics() const override;
+ virtual void clear(const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override;
+ virtual void localClear(const std::shared_ptr<Serializable>&
+ aCallbackArgument = nullptr) override;
GfErrType localClearNoThrow(
- const SerializablePtr& aCallbackArgument = nullptr,
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr,
const CacheEventFlags eventFlags = CacheEventFlags::NORMAL);
- void invalidateRegion(
- const SerializablePtr& aCallbackArgument = nullptr) override;
- void localInvalidateRegion(
- const SerializablePtr& aCallbackArgument = nullptr) override;
- void destroyRegion(
- const SerializablePtr& aCallbackArgument = nullptr) override;
- void localDestroyRegion(
- const SerializablePtr& aCallbackArgument = nullptr) override;
- RegionPtr getSubregion(const char* path) override;
- RegionPtr createSubregion(
+ void invalidateRegion(const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override;
+ void localInvalidateRegion(const std::shared_ptr<Serializable>&
+ aCallbackArgument = nullptr) override;
+ void destroyRegion(const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override;
+ void localDestroyRegion(const std::shared_ptr<Serializable>&
+ aCallbackArgument = nullptr) override;
+ std::shared_ptr<Region> getSubregion(const char* path) override;
+ std::shared_ptr<Region> createSubregion(
const char* subregionName,
- const RegionAttributesPtr& aRegionAttributes) override;
- VectorOfRegion subregions(const bool recursive) override;
- RegionEntryPtr getEntry(const CacheableKeyPtr& key) override;
- void getEntry(const CacheableKeyPtr& key, CacheablePtr& valuePtr);
- CacheablePtr get(const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument) override;
- void put(const CacheableKeyPtr& key, const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument = nullptr) override;
- void localPut(const CacheableKeyPtr& key, const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument = nullptr) override;
- void create(const CacheableKeyPtr& key, const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument = nullptr) override;
- void localCreate(const CacheableKeyPtr& key, const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument = nullptr) override;
- void invalidate(const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument = nullptr) override;
- void localInvalidate(
- const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument = nullptr) override;
- void destroy(const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument = nullptr) override;
- void localDestroy(
- const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument = nullptr) override;
- bool remove(const CacheableKeyPtr& key, const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument = nullptr) override;
- bool removeEx(const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument = nullptr) override;
- bool localRemove(const CacheableKeyPtr& key, const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument = nullptr) override;
- bool localRemoveEx(const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument = nullptr) override;
- VectorOfCacheableKey keys() override;
- VectorOfCacheableKey serverKeys() override;
- VectorOfCacheable values() override;
- VectorOfRegionEntry entries(bool recursive) override;
-
- HashMapOfCacheable getAll(const VectorOfCacheableKey& keys,
- const SerializablePtr& aCallbackArgument = nullptr) override;
-
- HashMapOfCacheable getAll_internal(const VectorOfCacheableKey& keys,
- const SerializablePtr& aCallbackArgument,
- bool addToLocalCache) override;
+ const std::shared_ptr<RegionAttributes>& aRegionAttributes) override;
+ std::vector<std::shared_ptr<Region>> subregions(
+ const bool recursive) override;
+ std::shared_ptr<RegionEntry> getEntry(
+ const std::shared_ptr<CacheableKey>& key) override;
+ void getEntry(const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<Cacheable>& valuePtr);
+ std::shared_ptr<Cacheable> get(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument) override;
+ void put(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override;
+ void localPut(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override;
+ void create(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override;
+ void localCreate(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override;
+ void invalidate(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override;
+ void localInvalidate(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override;
+ void destroy(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override;
+ void localDestroy(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override;
+ bool remove(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override;
+ bool removeEx(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override;
+ bool localRemove(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override;
+ bool localRemoveEx(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override;
+ std::vector<std::shared_ptr<CacheableKey>> keys() override;
+ std::vector<std::shared_ptr<CacheableKey>> serverKeys() override;
+ std::vector<std::shared_ptr<Cacheable>> values() override;
+ std::vector<std::shared_ptr<RegionEntry>> entries(bool recursive) override;
+
+ HashMapOfCacheable getAll(
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override;
+
+ HashMapOfCacheable getAll_internal(
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ bool addToLocalCache) override;
void putAll(const HashMapOfCacheable& map,
std::chrono::milliseconds timeout = DEFAULT_RESPONSE_TIMEOUT,
- const SerializablePtr& aCallbackArgument = nullptr) override;
- void removeAll(const VectorOfCacheableKey& keys,
- const SerializablePtr& aCallbackArgument = nullptr) override;
+ const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override;
+ void removeAll(const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override;
uint32_t size() override;
virtual uint32_t size_remote();
- RegionServicePtr getRegionService() const override;
- virtual bool containsValueForKey_remote(const CacheableKeyPtr& keyPtr) const;
- bool containsValueForKey(const CacheableKeyPtr& keyPtr) const override;
- bool containsKey(const CacheableKeyPtr& keyPtr) const override;
- virtual bool containsKeyOnServer(const CacheableKeyPtr& keyPtr) const override;
- virtual VectorOfCacheableKey getInterestList() const override;
- virtual VectorOfCacheableString getInterestListRegex() const override;
+ std::shared_ptr<RegionService> getRegionService() const override;
+ virtual bool containsValueForKey_remote(
+ const std::shared_ptr<CacheableKey>& keyPtr) const;
+ bool containsValueForKey(
+ const std::shared_ptr<CacheableKey>& keyPtr) const override;
+ bool containsKey(const std::shared_ptr<CacheableKey>& keyPtr) const override;
+ virtual bool containsKeyOnServer(
+ const std::shared_ptr<CacheableKey>& keyPtr) const override;
+ virtual std::vector<std::shared_ptr<CacheableKey>> getInterestList()
+ const override;
+ virtual std::vector<std::shared_ptr<CacheableString>> getInterestListRegex()
+ const override;
/** @brief Public Methods from RegionInternal
* There are all virtual methods
*/
- PersistenceManagerPtr getPersistenceManager() override {
+ std::shared_ptr<PersistenceManager> getPersistenceManager() override {
return m_persistenceManager;
}
- void setPersistenceManager(PersistenceManagerPtr& pmPtr) override;
+ void setPersistenceManager(
+ std::shared_ptr<PersistenceManager>& pmPtr) override;
virtual GfErrType getNoThrow(
- const CacheableKeyPtr& key, CacheablePtr& value,
- const SerializablePtr& aCallbackArgument) override;
+ const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument) override;
virtual GfErrType getAllNoThrow(
- const VectorOfCacheableKey& keys, const HashMapOfCacheablePtr& values,
- const HashMapOfExceptionPtr& exceptions, const bool addToLocalCache,
- const SerializablePtr& aCallbackArgument = nullptr) override;
- virtual GfErrType putNoThrow(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument,
- CacheablePtr& oldValue, int updateCount,
- const CacheEventFlags eventFlags,
- VersionTagPtr versionTag,
- DataInput* delta = nullptr,
- EventIdPtr eventId = nullptr) override;
- virtual GfErrType putNoThrowTX(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument,
- CacheablePtr& oldValue, int updateCount,
- const CacheEventFlags eventFlags,
- VersionTagPtr versionTag,
- DataInput* delta = nullptr,
- EventIdPtr eventId = nullptr);
- virtual GfErrType createNoThrow(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument,
- int updateCount,
- const CacheEventFlags eventFlags,
- VersionTagPtr versionTag) override;
- virtual GfErrType destroyNoThrow(const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument,
- int updateCount,
- const CacheEventFlags eventFlags,
- VersionTagPtr versionTag) override;
- virtual GfErrType destroyNoThrowTX(const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument,
- int updateCount,
- const CacheEventFlags eventFlags,
- VersionTagPtr versionTag);
- virtual GfErrType removeNoThrow(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument,
- int updateCount,
- const CacheEventFlags eventFlags,
- VersionTagPtr versionTag) override;
- virtual GfErrType removeNoThrowEx(const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument,
- int updateCount,
- const CacheEventFlags eventFlags,
- VersionTagPtr versionTag);
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ const std::shared_ptr<HashMapOfCacheable>& values,
+ const std::shared_ptr<HashMapOfException>& exceptions,
+ const bool addToLocalCache,
+ const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override;
+ virtual GfErrType putNoThrow(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<Cacheable>& oldValue, int updateCount,
+ const CacheEventFlags eventFlags, std::shared_ptr<VersionTag> versionTag,
+ DataInput* delta = nullptr,
+ std::shared_ptr<EventId> eventId = nullptr) override;
+ virtual GfErrType putNoThrowTX(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<Cacheable>& oldValue, int updateCount,
+ const CacheEventFlags eventFlags, std::shared_ptr<VersionTag> versionTag,
+ DataInput* delta = nullptr, std::shared_ptr<EventId> eventId = nullptr);
+ virtual GfErrType createNoThrow(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument, int updateCount,
+ const CacheEventFlags eventFlags,
+ std::shared_ptr<VersionTag> versionTag) override;
+ virtual GfErrType destroyNoThrow(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument, int updateCount,
+ const CacheEventFlags eventFlags,
+ std::shared_ptr<VersionTag> versionTag) override;
+ virtual GfErrType destroyNoThrowTX(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument, int updateCount,
+ const CacheEventFlags eventFlags, std::shared_ptr<VersionTag> versionTag);
+ virtual GfErrType removeNoThrow(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument, int updateCount,
+ const CacheEventFlags eventFlags,
+ std::shared_ptr<VersionTag> versionTag) override;
+ virtual GfErrType removeNoThrowEx(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument, int updateCount,
+ const CacheEventFlags eventFlags, std::shared_ptr<VersionTag> versionTag);
virtual GfErrType putAllNoThrow(
const HashMapOfCacheable& map,
std::chrono::milliseconds timeout = DEFAULT_RESPONSE_TIMEOUT,
- const SerializablePtr& aCallbackArgument = nullptr);
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr);
virtual GfErrType removeAllNoThrow(
- const VectorOfCacheableKey& keys,
- const SerializablePtr& aCallbackArgument = nullptr);
- virtual GfErrType invalidateNoThrow(const CacheableKeyPtr& keyPtr,
- const SerializablePtr& aCallbackArgument,
- int updateCount,
- const CacheEventFlags eventFlags,
- VersionTagPtr versionTag) override;
- virtual GfErrType invalidateNoThrowTX(const CacheableKeyPtr& keyPtr,
- const SerializablePtr& aCallbackArgument,
- int updateCount,
- const CacheEventFlags eventFlags,
- VersionTagPtr versionTag);
- GfErrType invalidateRegionNoThrow(const SerializablePtr& aCallbackArgument,
- const CacheEventFlags eventFlags) override;
- GfErrType destroyRegionNoThrow(const SerializablePtr& aCallbackArgument,
- bool removeFromParent,
- const CacheEventFlags eventFlags) override;
- void tombstoneOperationNoThrow(const CacheableHashMapPtr& tombstoneVersions,
- const CacheableHashSetPtr& tombstoneKeys);
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr);
+ virtual GfErrType invalidateNoThrow(
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Serializable>& aCallbackArgument, int updateCount,
+ const CacheEventFlags eventFlags,
+ std::shared_ptr<VersionTag> versionTag) override;
+ virtual GfErrType invalidateNoThrowTX(
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Serializable>& aCallbackArgument, int updateCount,
+ const CacheEventFlags eventFlags, std::shared_ptr<VersionTag> versionTag);
+ GfErrType invalidateRegionNoThrow(
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ const CacheEventFlags eventFlags) override;
+ GfErrType destroyRegionNoThrow(
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ bool removeFromParent, const CacheEventFlags eventFlags) override;
+ void tombstoneOperationNoThrow(
+ const std::shared_ptr<CacheableHashMap>& tombstoneVersions,
+ const std::shared_ptr<CacheableHashSet>& tombstoneKeys);
// moved putLocal to public since this is used by a few other
// classes like CacheableObjectPartList now
/** put an entry in local cache without invoking any callbacks */
GfErrType putLocal(const char* name, bool isCreate,
- const CacheableKeyPtr& keyPtr,
- const CacheablePtr& valuePtr, CacheablePtr& oldValue,
- bool cachingEnabled, int updateCount, int destroyTracker,
- VersionTagPtr versionTag, DataInput* delta = nullptr,
- EventIdPtr eventId = nullptr);
- GfErrType invalidateLocal(const char* name, const CacheableKeyPtr& keyPtr,
- const CacheablePtr& value,
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Cacheable>& valuePtr,
+ std::shared_ptr<Cacheable>& oldValue, bool cachingEnabled,
+ int updateCount, int destroyTracker,
+ std::shared_ptr<VersionTag> versionTag,
+ DataInput* delta = nullptr,
+ std::shared_ptr<EventId> eventId = nullptr);
+ GfErrType invalidateLocal(const char* name,
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Cacheable>& value,
const CacheEventFlags eventFlags,
- VersionTagPtr versionTag);
+ std::shared_ptr<VersionTag> versionTag);
void setRegionExpiryTask() override;
void acquireReadLock() override { m_rwLock.acquire_read(); }
@@ -347,13 +383,15 @@ class CPPCACHE_EXPORT LocalRegion : public RegionInternal {
virtual bool isDestroyed() const override { return m_destroyPending; }
/* above public methods are inherited from RegionInternal */
- virtual void adjustCacheListener(const CacheListenerPtr& aListener) override;
+ virtual void adjustCacheListener(const std::shared_ptr<CacheListener>& aListener) override;
virtual void adjustCacheListener(const char* libpath,
const char* factoryFuncName) override;
- virtual void adjustCacheLoader(const CacheLoaderPtr& aLoader) override;
+ virtual void adjustCacheLoader(
+ const std::shared_ptr<CacheLoader>& aLoader) override;
virtual void adjustCacheLoader(const char* libpath,
const char* factoryFuncName) override;
- virtual void adjustCacheWriter(const CacheWriterPtr& aWriter) override;
+ virtual void adjustCacheWriter(
+ const std::shared_ptr<CacheWriter>& aWriter) override;
virtual void adjustCacheWriter(const char* libpath,
const char* factoryFuncName) override;
virtual CacheImpl* getCacheImpl() const override;
@@ -364,65 +402,75 @@ class CPPCACHE_EXPORT LocalRegion : public RegionInternal {
virtual bool getProcessedMarker() { return true; }
EntriesMap* getEntryMap() { return m_entries; }
- virtual TombstoneListPtr getTombstoneList() override;
+ virtual std::shared_ptr<TombstoneList> getTombstoneList() override;
protected:
/* virtual protected methods */
virtual void release(bool invokeCallbacks = true);
- virtual GfErrType getNoThrow_remote(const CacheableKeyPtr& keyPtr,
- CacheablePtr& valPtr,
- const SerializablePtr& aCallbackArgument,
- VersionTagPtr& versionTag);
- virtual GfErrType putNoThrow_remote(const CacheableKeyPtr& keyPtr,
- const CacheablePtr& cvalue,
- const SerializablePtr& aCallbackArgument,
- VersionTagPtr& versionTag,
- bool checkDelta = true);
+ virtual GfErrType getNoThrow_remote(
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ std::shared_ptr<Cacheable>& valPtr,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag);
+ virtual GfErrType putNoThrow_remote(
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Cacheable>& cvalue,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag, bool checkDelta = true);
virtual GfErrType putAllNoThrow_remote(
const HashMapOfCacheable& map,
- VersionedCacheableObjectPartListPtr& versionedObjPartList,
+ std::shared_ptr<VersionedCacheableObjectPartList>& versionedObjPartList,
std::chrono::milliseconds timeout,
- const SerializablePtr& aCallbackArgument);
+ const std::shared_ptr<Serializable>& aCallbackArgument);
virtual GfErrType removeAllNoThrow_remote(
- const VectorOfCacheableKey& keys,
- VersionedCacheableObjectPartListPtr& versionedObjPartList,
- const SerializablePtr& aCallbackArgument);
- virtual GfErrType createNoThrow_remote(const CacheableKeyPtr& keyPtr,
- const CacheablePtr& cvalue,
- const SerializablePtr& aCallbackArgument,
- VersionTagPtr& versionTag);
- virtual GfErrType destroyNoThrow_remote(const CacheableKeyPtr& keyPtr,
- const SerializablePtr& aCallbackArgument,
- VersionTagPtr& versionTag);
- virtual GfErrType removeNoThrow_remote(const CacheableKeyPtr& keyPtr,
- const CacheablePtr& cvalue,
- const SerializablePtr& aCallbackArgument,
- VersionTagPtr& versionTag);
- virtual GfErrType removeNoThrowEX_remote(const CacheableKeyPtr& keyPtr,
- const SerializablePtr& aCallbackArgument,
- VersionTagPtr& versionTag);
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ std::shared_ptr<VersionedCacheableObjectPartList>& versionedObjPartList,
+ const std::shared_ptr<Serializable>& aCallbackArgument);
+ virtual GfErrType createNoThrow_remote(
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Cacheable>& cvalue,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag);
+ virtual GfErrType destroyNoThrow_remote(
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag);
+ virtual GfErrType removeNoThrow_remote(
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Cacheable>& cvalue,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag);
+ virtual GfErrType removeNoThrowEX_remote(
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag);
virtual GfErrType invalidateNoThrow_remote(
- const CacheableKeyPtr& keyPtr, const SerializablePtr& aCallbackArgument,
- VersionTagPtr& versionTag);
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag);
virtual GfErrType getAllNoThrow_remote(
- const VectorOfCacheableKey* keys, const HashMapOfCacheablePtr& values,
- const HashMapOfExceptionPtr& exceptions,
- const VectorOfCacheableKeyPtr& resultKeys, bool addToLocalCache,
- const SerializablePtr& aCallbackArgument);
+ const std::vector<std::shared_ptr<CacheableKey>>* keys,
+ const std::shared_ptr<HashMapOfCacheable>& values,
+ const std::shared_ptr<HashMapOfException>& exceptions,
+ const std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>>&
+ resultKeys,
+ bool addToLocalCache,
+ const std::shared_ptr<Serializable>& aCallbackArgument);
virtual GfErrType invalidateRegionNoThrow_remote(
- const SerializablePtr& aCallbackArgument);
+ const std::shared_ptr<Serializable>& aCallbackArgument);
virtual GfErrType destroyRegionNoThrow_remote(
- const SerializablePtr& aCallbackArgument);
+ const std::shared_ptr<Serializable>& aCallbackArgument);
virtual GfErrType unregisterKeysBeforeDestroyRegion();
- virtual const PoolPtr& getPool() override { return m_attachedPool; }
+ virtual const std::shared_ptr<Pool>& getPool() override { return m_attachedPool; }
- void setPool(const PoolPtr& p) { m_attachedPool = p; }
+ void setPool(const std::shared_ptr<Pool>& p) { m_attachedPool = p; }
TXState* getTXState() const {
return TSSTXStateWrapper::s_geodeTSSTXState->getTXState();
}
- CacheablePtr handleReplay(GfErrType& err, CacheablePtr value) const;
+ std::shared_ptr<Cacheable> handleReplay(
+ GfErrType& err, std::shared_ptr<Cacheable> value) const;
bool isLocalOp(const CacheEventFlags* eventFlags = nullptr) {
return typeid(*this) == typeid(LocalRegion) ||
@@ -431,22 +479,22 @@ class CPPCACHE_EXPORT LocalRegion : public RegionInternal {
// template method for put and create
template <typename TAction>
- GfErrType updateNoThrow(const CacheableKeyPtr& key, const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument,
- CacheablePtr& oldValue, int updateCount,
- const CacheEventFlags eventFlags,
- VersionTagPtr versionTag, DataInput* delta = nullptr,
- EventIdPtr eventId = nullptr);
+ GfErrType updateNoThrow(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<Cacheable>& oldValue, int updateCount,
+ const CacheEventFlags eventFlags, std::shared_ptr<VersionTag> versionTag,
+ DataInput* delta = nullptr, std::shared_ptr<EventId> eventId = nullptr);
template <typename TAction>
- GfErrType updateNoThrowTX(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument,
- CacheablePtr& oldValue, int updateCount,
- const CacheEventFlags eventFlags,
- VersionTagPtr versionTag,
- DataInput* delta = nullptr,
- EventIdPtr eventId = nullptr);
+ GfErrType updateNoThrowTX(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<Cacheable>& oldValue, int updateCount,
+ const CacheEventFlags eventFlags, std::shared_ptr<VersionTag> versionTag,
+ DataInput* delta = nullptr, std::shared_ptr<EventId> eventId = nullptr);
int64_t startStatOpTime();
void updateStatOpTime(Statistics* m_regionStats, int32_t statId,
@@ -454,53 +502,57 @@ class CPPCACHE_EXPORT LocalRegion : public RegionInternal {
/* protected attributes */
std::string m_name;
- RegionPtr m_parentRegion;
+ std::shared_ptr<Region> m_parentRegion;
MapOfRegionWithLock m_subRegions;
std::string m_fullPath;
CacheImpl* m_cacheImpl;
volatile bool m_destroyPending;
- CacheListenerPtr m_listener;
- CacheWriterPtr m_writer;
- CacheLoaderPtr m_loader;
+ std::shared_ptr<CacheListener> m_listener;
+ std::shared_ptr<CacheWriter> m_writer;
+ std::shared_ptr<CacheLoader> m_loader;
volatile bool m_released;
EntriesMap* m_entries; // map containing cache entries...
RegionStats* m_regionStats;
- CacheStatisticsPtr m_cacheStatistics;
+ std::shared_ptr<CacheStatistics> m_cacheStatistics;
bool m_transactionEnabled;
- TombstoneListPtr m_tombstoneList;
+ std::shared_ptr<TombstoneList> m_tombstoneList;
bool m_isPRSingleHopEnabled;
- PoolPtr m_attachedPool;
+ std::shared_ptr<Pool> m_attachedPool;
bool m_enableTimeStatistics;
mutable ACE_RW_Thread_Mutex m_rwLock;
- VectorOfCacheableKey keys_internal();
- bool containsKey_internal(const CacheableKeyPtr& keyPtr) const;
+ std::vector<std::shared_ptr<CacheableKey>> keys_internal();
+ bool containsKey_internal(const std::shared_ptr<CacheableKey>& keyPtr) const;
int removeRegion(const std::string& name);
- bool invokeCacheWriterForEntryEvent(const CacheableKeyPtr& key,
- CacheablePtr& oldValue,
- const CacheablePtr& newValue,
- const SerializablePtr& aCallbackArgument,
- CacheEventFlags eventFlags,
- EntryEventType type);
- bool invokeCacheWriterForRegionEvent(const SerializablePtr& aCallbackArgument,
- CacheEventFlags eventFlags,
- RegionEventType type);
+ bool invokeCacheWriterForEntryEvent(
+ const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<Cacheable>& oldValue,
+ const std::shared_ptr<Cacheable>& newValue,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ CacheEventFlags eventFlags, EntryEventType type);
+ bool invokeCacheWriterForRegionEvent(
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ CacheEventFlags eventFlags, RegionEventType type);
GfErrType invokeCacheListenerForEntryEvent(
- const CacheableKeyPtr& key, CacheablePtr& oldValue,
- const CacheablePtr& newValue, const SerializablePtr& aCallbackArgument,
+ const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<Cacheable>& oldValue,
+ const std::shared_ptr<Cacheable>& newValue,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
CacheEventFlags eventFlags, EntryEventType type, bool isLocal = false);
GfErrType invokeCacheListenerForRegionEvent(
- const SerializablePtr& aCallbackArgument, CacheEventFlags eventFlags,
- RegionEventType type);
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ CacheEventFlags eventFlags, RegionEventType type);
// functions related to expirations.
- void updateAccessAndModifiedTimeForEntry(MapEntryImplPtr& ptr,
+ void updateAccessAndModifiedTimeForEntry(std::shared_ptr<MapEntryImpl>& ptr,
bool modified) override;
- void registerEntryExpiryTask(MapEntryImplPtr& entry);
- VectorOfRegion subregions_internal(const bool recursive);
- void entries_internal(VectorOfRegionEntry& me, const bool recursive);
+ void registerEntryExpiryTask(std::shared_ptr<MapEntryImpl>& entry);
+ std::vector<std::shared_ptr<Region>> subregions_internal(
+ const bool recursive);
+ void entries_internal(std::vector<std::shared_ptr<RegionEntry>>& me,
+ const bool recursive);
- PersistenceManagerPtr m_persistenceManager;
+ std::shared_ptr<PersistenceManager> m_persistenceManager;
bool isStatisticsEnabled();
bool useModifiedTimeForRegionExpiry();
@@ -515,9 +567,9 @@ class CPPCACHE_EXPORT LocalRegion : public RegionInternal {
LocalRegion(const LocalRegion&);
LocalRegion& operator=(const LocalRegion&);
- virtual GfErrType getNoThrow_FullObject(EventIdPtr eventId,
- CacheablePtr& fullObject,
- VersionTagPtr& versionTag);
+ virtual GfErrType getNoThrow_FullObject(
+ std::shared_ptr<EventId> eventId, std::shared_ptr<Cacheable>& fullObject,
+ std::shared_ptr<VersionTag>& versionTag);
// these classes encapsulate actions specific to update operations
// used by the template <code>updateNoThrow</code> class
diff --git a/cppcache/src/LocatorListResponse.hpp b/cppcache/src/LocatorListResponse.hpp
index eeab3c6..7c4fca8 100644
--- a/cppcache/src/LocatorListResponse.hpp
+++ b/cppcache/src/LocatorListResponse.hpp
@@ -50,7 +50,6 @@ class LocatorListResponse : public ServerLocationResponse {
virtual ~LocatorListResponse() {} // Virtual destructor
static Serializable* create();
};
-typedef std::shared_ptr<LocatorListResponse> LocatorListResponsePtr;
} // namespace client
} // namespace geode
diff --git a/cppcache/src/MapEntry.cpp b/cppcache/src/MapEntry.cpp
index 13a4ff3..8e9927e 100644
--- a/cppcache/src/MapEntry.cpp
+++ b/cppcache/src/MapEntry.cpp
@@ -21,12 +21,11 @@
namespace apache {
namespace geode {
namespace client {
-
-MapEntryPtr MapEntry::MapEntry_NullPointer(nullptr);
+std::shared_ptr<MapEntry> MapEntry::MapEntry_NullPointer(nullptr);
void EntryFactory::newMapEntry(ExpiryTaskManager* expiryTaskManager,
- const CacheableKeyPtr& key,
- MapEntryImplPtr& result) const {
+ const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& result) const {
if (m_concurrencyChecksEnabled) {
result = MapEntryT<VersionedMapEntryImpl, 0, 0>::create(key);
} else {
diff --git a/cppcache/src/MapEntry.hpp b/cppcache/src/MapEntry.hpp
index 270a8b8..4037af9 100644
--- a/cppcache/src/MapEntry.hpp
+++ b/cppcache/src/MapEntry.hpp
@@ -38,9 +38,7 @@ namespace apache {
namespace geode {
namespace client {
class CPPCACHE_EXPORT MapEntry;
-typedef std::shared_ptr<MapEntry> MapEntryPtr;
class CPPCACHE_EXPORT MapEntryImpl;
-typedef std::shared_ptr<MapEntryImpl> MapEntryImplPtr;
class CPPCACHE_EXPORT LRUEntryProperties;
class CacheImpl;
@@ -85,7 +83,7 @@ class CPPCACHE_EXPORT ExpEntryProperties {
inline long getExpiryTaskId() const { return m_expiryTaskId; }
- inline void cancelExpiryTaskId(const CacheableKeyPtr& key) const {
+ inline void cancelExpiryTaskId(const std::shared_ptr<CacheableKey>& key) const {
LOGDEBUG("Cancelling expiration task for key [%s] with id [%d]",
Utils::getCacheableKeyString(key)->asChar(), m_expiryTaskId);
m_expiryTaskManager->cancelTask(m_expiryTaskId);
@@ -110,14 +108,14 @@ class CPPCACHE_EXPORT ExpEntryProperties {
*/
class CPPCACHE_EXPORT MapEntry {
public:
- static MapEntryPtr MapEntry_NullPointer;
+ static std::shared_ptr<MapEntry> MapEntry_NullPointer;
virtual ~MapEntry() {}
- virtual void getKey(CacheableKeyPtr& result) const = 0;
- virtual void getValue(CacheablePtr& result) const = 0;
- virtual void setValue(const CacheablePtr& value) = 0;
- virtual MapEntryImplPtr getImplPtr() = 0;
+ virtual void getKey(std::shared_ptr<CacheableKey>& result) const = 0;
+ virtual void getValue(std::shared_ptr<Cacheable>& result) const = 0;
+ virtual void setValue(const std::shared_ptr<Cacheable>& value) = 0;
+ virtual std::shared_ptr<MapEntryImpl> getImplPtr() = 0;
virtual LRUEntryProperties& getLRUProperties() = 0;
virtual ExpEntryProperties& getExpProperties() = 0;
@@ -142,7 +140,7 @@ class CPPCACHE_EXPORT MapEntry {
* tracking an entry goes down to zero, then the update sequence number
* is also reset to zero.
*/
- virtual int addTracker(MapEntryPtr& newEntry) = 0;
+ virtual int addTracker(std::shared_ptr<MapEntry>& newEntry) = 0;
/**
* Removes a tracker for this MapEntry and returns a pair:
@@ -161,7 +159,7 @@ class CPPCACHE_EXPORT MapEntry {
* Note that the contract says that the return value should not be
* touched if this MapEntry is to be continued with.
*/
- virtual int incrementUpdateCount(MapEntryPtr& newEntry) = 0;
+ virtual int incrementUpdateCount(std::shared_ptr<MapEntry>& newEntry) = 0;
/**
* Get the current tracking number of this entry. A return value of zero
@@ -195,9 +193,9 @@ class MapEntryImpl : public MapEntry,
public:
virtual ~MapEntryImpl() {}
- inline void getKeyI(CacheableKeyPtr& result) const { result = m_key; }
+ inline void getKeyI(std::shared_ptr<CacheableKey>& result) const { result = m_key; }
- inline void getValueI(CacheablePtr& result) const {
+ inline void getValueI(std::shared_ptr<Cacheable>& result) const {
// If value is destroyed, then this returns nullptr
if (CacheableToken::isDestroyed(m_value)) {
result = nullptr;
@@ -206,15 +204,23 @@ class MapEntryImpl : public MapEntry,
}
}
- inline void setValueI(const CacheablePtr& value) { m_value = value; }
+ inline void setValueI(const std::shared_ptr<Cacheable>& value) { m_value = value; }
- virtual void getKey(CacheableKeyPtr& result) const { getKeyI(result); }
+ virtual void getKey(std::shared_ptr<CacheableKey>& result) const {
+ getKeyI(result);
+ }
- virtual void getValue(CacheablePtr& result) const { getValueI(result); }
+ virtual void getValue(std::shared_ptr<Cacheable>& result) const {
+ getValueI(result);
+ }
- virtual void setValue(const CacheablePtr& value) { setValueI(value); }
+ virtual void setValue(const std::shared_ptr<Cacheable>& value) {
+ setValueI(value);
+ }
- virtual MapEntryImplPtr getImplPtr() { return shared_from_this(); }
+ virtual std::shared_ptr<MapEntryImpl> getImplPtr() {
+ return shared_from_this();
+ }
virtual LRUEntryProperties& getLRUProperties() {
throw FatalInternalException(
@@ -239,10 +245,10 @@ class MapEntryImpl : public MapEntry,
inline explicit MapEntryImpl(bool noInit)
: MapEntry(true), m_value(nullptr), m_key(nullptr) {}
- inline MapEntryImpl(const CacheableKeyPtr& key) : MapEntry(), m_key(key) {}
+ inline MapEntryImpl(const std::shared_ptr<CacheableKey>& key) : MapEntry(), m_key(key) {}
- CacheablePtr m_value;
- CacheableKeyPtr m_key;
+ std::shared_ptr<Cacheable> m_value;
+ std::shared_ptr<CacheableKey> m_key;
private:
// disabled
@@ -260,7 +266,7 @@ class CPPCACHE_EXPORT VersionedMapEntryImpl : public MapEntryImpl,
protected:
inline explicit VersionedMapEntryImpl(bool noInit) : MapEntryImpl(true) {}
- inline VersionedMapEntryImpl(const CacheableKeyPtr& key)
+ inline VersionedMapEntryImpl(const std::shared_ptr<CacheableKey>& key)
: MapEntryImpl(key) {}
private:
@@ -269,7 +275,6 @@ class CPPCACHE_EXPORT VersionedMapEntryImpl : public MapEntryImpl,
VersionedMapEntryImpl& operator=(const VersionedMapEntryImpl&);
};
-typedef std::shared_ptr<VersionedMapEntryImpl> VersionedMapEntryImplPtr;
class CPPCACHE_EXPORT EntryFactory {
public:
@@ -279,8 +284,8 @@ class CPPCACHE_EXPORT EntryFactory {
virtual ~EntryFactory() {}
virtual void newMapEntry(ExpiryTaskManager* expiryTaskManager,
- const CacheableKeyPtr& key,
- MapEntryImplPtr& result) const;
+ const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& result) const;
protected:
bool m_concurrencyChecksEnabled;
diff --git a/cppcache/src/MapEntryT.hpp b/cppcache/src/MapEntryT.hpp
index 4bd354e..27bf2e5 100644
--- a/cppcache/src/MapEntryT.hpp
+++ b/cppcache/src/MapEntryT.hpp
@@ -94,7 +94,7 @@ class MapEntryT : public TBase {
virtual ~MapEntryT() {}
- virtual int addTracker(MapEntryPtr& newEntry) {
+ virtual int addTracker(std::shared_ptr<MapEntry>& newEntry) {
return MapEntryST<TBase, NUM_TRACKERS, UPDATE_COUNT>::addTracker(this);
}
@@ -104,7 +104,7 @@ class MapEntryT : public TBase {
MapEntryST<TBase, NUM_TRACKERS, UPDATE_COUNT>::removeTracker(this));
}
- virtual int incrementUpdateCount(MapEntryPtr& newEntry) {
+ virtual int incrementUpdateCount(std::shared_ptr<MapEntry>& newEntry) {
return MapEntryST<TBase, NUM_TRACKERS, UPDATE_COUNT>::incUpdateCount(this);
}
@@ -112,19 +112,21 @@ class MapEntryT : public TBase {
virtual int getUpdateCount() const { return UPDATE_COUNT; }
- inline static std::shared_ptr<MapEntryT> create(const CacheableKeyPtr& key) {
+ inline static std::shared_ptr<MapEntryT> create(
+ const std::shared_ptr<CacheableKey>& key) {
return std::make_shared<MapEntryT>(key);
}
inline static std::shared_ptr<MapEntryT> create(
- ExpiryTaskManager* expiryTaskManager, const CacheableKeyPtr& key) {
+ ExpiryTaskManager* expiryTaskManager,
+ const std::shared_ptr<CacheableKey>& key) {
return std::make_shared<MapEntryT>(expiryTaskManager, key);
}
protected:
- inline MapEntryT(const CacheableKeyPtr& key) : TBase(key) {}
+ inline MapEntryT(const std::shared_ptr<CacheableKey>& key) : TBase(key) {}
inline MapEntryT(ExpiryTaskManager* expiryTaskManager,
- const CacheableKeyPtr& key)
+ const std::shared_ptr<CacheableKey>& key)
: TBase(expiryTaskManager, key) {}
private:
@@ -144,7 +146,7 @@ class MapEntryT<TBase, NUM_TRACKERS, GF_UPDATE_MAX> : public TBase {
virtual ~MapEntryT() {}
- virtual int addTracker(MapEntryPtr& newEntry) {
+ virtual int addTracker(std::shared_ptr<MapEntry>& newEntry) {
return MapEntryST<TBase, NUM_TRACKERS, GF_UPDATE_MAX>::addTracker(this);
}
@@ -154,7 +156,7 @@ class MapEntryT<TBase, NUM_TRACKERS, GF_UPDATE_MAX> : public TBase {
MapEntryST<TBase, NUM_TRACKERS, GF_UPDATE_MAX>::removeTracker(this));
}
- virtual int incrementUpdateCount(MapEntryPtr& newEntry) {
+ virtual int incrementUpdateCount(std::shared_ptr<MapEntry>& newEntry) {
// fallback to TrackedMapEntry
newEntry = std::make_shared<TrackedMapEntry>(
this->shared_from_this(), NUM_TRACKERS, GF_UPDATE_MAX + 1);
@@ -180,7 +182,7 @@ class MapEntryT<TBase, GF_TRACK_MAX, UPDATE_COUNT> : public TBase {
virtual ~MapEntryT() {}
- virtual int addTracker(MapEntryPtr& newEntry) {
+ virtual int addTracker(std::shared_ptr<MapEntry>& newEntry) {
// fallback to TrackedMapEntry
newEntry = std::make_shared<TrackedMapEntry>(
this->shared_from_this(), GF_TRACK_MAX + 1, UPDATE_COUNT);
@@ -193,7 +195,7 @@ class MapEntryT<TBase, GF_TRACK_MAX, UPDATE_COUNT> : public TBase {
MapEntryST<TBase, GF_TRACK_MAX, UPDATE_COUNT>::removeTracker(this));
}
- virtual int incrementUpdateCount(MapEntryPtr& newEntry) {
+ virtual int incrementUpdateCount(std::shared_ptr<MapEntry>& newEntry) {
return MapEntryST<TBase, GF_TRACK_MAX, UPDATE_COUNT>::incUpdateCount(this);
}
@@ -216,7 +218,7 @@ class MapEntryT<TBase, GF_TRACK_MAX, GF_UPDATE_MAX> : public TBase {
virtual ~MapEntryT() {}
- virtual int addTracker(MapEntryPtr& newEntry) {
+ virtual int addTracker(std::shared_ptr<MapEntry>& newEntry) {
// fallback to TrackedMapEntry
newEntry = std::make_shared<TrackedMapEntry>(
this->shared_from_this(), GF_TRACK_MAX + 1, GF_UPDATE_MAX);
@@ -229,7 +231,7 @@ class MapEntryT<TBase, GF_TRACK_MAX, GF_UPDATE_MAX> : public TBase {
MapEntryST<TBase, GF_TRACK_MAX, GF_UPDATE_MAX>::removeTracker(this));
}
- virtual int incrementUpdateCount(MapEntryPtr& newEntry) {
+ virtual int incrementUpdateCount(std::shared_ptr<MapEntry>& newEntry) {
// fallback to TrackedMapEntry
newEntry = std::make_shared<TrackedMapEntry>(
this->shared_from_this(), GF_TRACK_MAX, GF_UPDATE_MAX + 1);
diff --git a/cppcache/src/MapSegment.cpp b/cppcache/src/MapSegment.cpp
index 04617c4..b4ecb73 100644
--- a/cppcache/src/MapSegment.cpp
+++ b/cppcache/src/MapSegment.cpp
@@ -71,10 +71,12 @@ int MapSegment::acquire() { return m_segmentMutex.acquire(); }
int MapSegment::release() { return m_segmentMutex.release(); }
-GfErrType MapSegment::create(const CacheableKeyPtr& key,
- const CacheablePtr& newValue, MapEntryImplPtr& me,
- CacheablePtr& oldValue, int updateCount,
- int destroyTracker, VersionTagPtr versionTag) {
+GfErrType MapSegment::create(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& newValue,
+ std::shared_ptr<MapEntryImpl>& me,
+ std::shared_ptr<Cacheable>& oldValue,
+ int updateCount, int destroyTracker,
+ std::shared_ptr<VersionTag> versionTag) {
int64_t taskid = -1;
TombstoneExpiryHandler* handler = nullptr;
GfErrType err = GF_NOERR;
@@ -85,7 +87,7 @@ GfErrType MapSegment::create(const CacheableKeyPtr& key,
if (((m_map->current_size() * 75) / 100) > mapSize) {
rehash();
}
- MapEntryPtr entry;
+ std::shared_ptr<MapEntry> entry;
int status;
if ((status = m_map->find(key, entry)) == -1) {
if ((err = putNoEntry(key, newValue, me, updateCount, destroyTracker,
@@ -93,7 +95,7 @@ GfErrType MapSegment::create(const CacheableKeyPtr& key,
return err;
}
} else {
- MapEntryImplPtr entryImpl = entry->getImplPtr();
+ auto entryImpl = entry->getImplPtr();
entryImpl->getValueI(oldValue);
if (oldValue == nullptr || CacheableToken::isTombstone(oldValue)) {
// pass the version stamp
@@ -137,11 +139,13 @@ GfErrType MapSegment::create(const CacheableKeyPtr& key,
/**
* @brief put a value in the map, replacing if key already exists.
*/
-GfErrType MapSegment::put(const CacheableKeyPtr& key,
- const CacheablePtr& newValue, MapEntryImplPtr& me,
- CacheablePtr& oldValue, int updateCount,
+GfErrType MapSegment::put(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& newValue,
+ std::shared_ptr<MapEntryImpl>& me,
+ std::shared_ptr<Cacheable>& oldValue, int updateCount,
int destroyTracker, bool& isUpdate,
- VersionTagPtr versionTag, DataInput* delta) {
+ std::shared_ptr<VersionTag> versionTag,
+ DataInput* delta) {
int64_t taskid = -1;
TombstoneExpiryHandler* handler = nullptr;
GfErrType err = GF_NOERR;
@@ -152,7 +156,7 @@ GfErrType MapSegment::put(const CacheableKeyPtr& key,
if (((m_map->current_size() * 75) / 100) > mapSize) {
rehash();
}
- MapEntryPtr entry;
+ std::shared_ptr<MapEntry> entry;
int status;
if ((status = m_map->find(key, entry)) == -1) {
if (delta != nullptr) {
@@ -163,8 +167,8 @@ GfErrType MapSegment::put(const CacheableKeyPtr& key,
err = putNoEntry(key, newValue, me, updateCount, destroyTracker,
versionTag);
} else {
- MapEntryImplPtr entryImpl = entry->getImplPtr();
- CacheablePtr meOldValue;
+ auto entryImpl = entry->getImplPtr();
+ std::shared_ptr<Cacheable> meOldValue;
entryImpl->getValueI(meOldValue);
// pass the version stamp
VersionStamp versionStamp;
@@ -205,14 +209,16 @@ GfErrType MapSegment::put(const CacheableKeyPtr& key,
return err;
}
-GfErrType MapSegment::invalidate(const CacheableKeyPtr& key,
- MapEntryImplPtr& me, CacheablePtr& oldValue,
- VersionTagPtr versionTag, bool& isTokenAdded) {
+GfErrType MapSegment::invalidate(const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& me,
+ std::shared_ptr<Cacheable>& oldValue,
+ std::shared_ptr<VersionTag> versionTag,
+ bool& isTokenAdded) {
std::lock_guard<spinlock_mutex> lk(m_spinlock);
int status;
isTokenAdded = false;
GfErrType err = GF_NOERR;
- MapEntryPtr entry;
+ std::shared_ptr<MapEntry> entry;
if ((status = m_map->find(key, entry)) != -1) {
VersionStamp versionStamp;
if (m_concurrencyChecksEnabled) {
@@ -223,7 +229,7 @@ GfErrType MapSegment::invalidate(const CacheableKeyPtr& key,
versionStamp.setVersions(versionTag);
}
}
- MapEntryImplPtr entryImpl = entry->getImplPtr();
+ auto entryImpl = entry->getImplPtr();
entryImpl->getValueI(oldValue);
if (CacheableToken::isTombstone(oldValue)) {
oldValue = nullptr;
@@ -252,13 +258,14 @@ GfErrType MapSegment::invalidate(const CacheableKeyPtr& key,
}
GfErrType MapSegment::removeWhenConcurrencyEnabled(
- const CacheableKeyPtr& key, CacheablePtr& oldValue, MapEntryImplPtr& me,
- int updateCount, VersionTagPtr versionTag, bool afterRemote,
+ const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<Cacheable>& oldValue, std::shared_ptr<MapEntryImpl>& me,
+ int updateCount, std::shared_ptr<VersionTag> versionTag, bool afterRemote,
bool& isEntryFound, int64_t expiryTaskID, TombstoneExpiryHandler* handler,
bool& expTaskSet) {
GfErrType err = GF_NOERR;
int status;
- MapEntryPtr entry;
+ std::shared_ptr<MapEntry> entry;
VersionStamp versionStamp;
// If entry found, else return no entry
if ((status = m_map->find(key, entry)) != -1) {
@@ -267,7 +274,7 @@ GfErrType MapSegment::removeWhenConcurrencyEnabled(
// the existing entry
versionStamp = entry->getVersionStamp();
if (_VERSION_TAG_NULL_CHK) {
- CacheableKeyPtr keyPtr;
+ std::shared_ptr<CacheableKey> keyPtr;
entry->getImplPtr()->getKeyI(keyPtr);
if ((err = entry->getVersionStamp().processVersionTag(
m_region, keyPtr, versionTag, false)) != GF_NOERR) {
@@ -276,7 +283,7 @@ GfErrType MapSegment::removeWhenConcurrencyEnabled(
versionStamp.setVersions(versionTag);
}
// Get the old value for returning
- MapEntryImplPtr entryImpl = entry->getImplPtr();
+ auto entryImpl = entry->getImplPtr();
entryImpl->getValueI(oldValue);
if (oldValue) me = entryImpl;
@@ -301,7 +308,7 @@ GfErrType MapSegment::removeWhenConcurrencyEnabled(
// so that any future updates for this entry are checked for version
// no entry
if (_VERSION_TAG_NULL_CHK) {
- MapEntryImplPtr mapEntry;
+ std::shared_ptr<MapEntryImpl> mapEntry;
putNoEntry(key, CacheableToken::tombstone(), mapEntry, -1, 0, versionTag);
m_tombstoneList->add(mapEntry->getImplPtr(), handler, expiryTaskID);
expTaskSet = true;
@@ -320,12 +327,13 @@ GfErrType MapSegment::removeWhenConcurrencyEnabled(
/**
* @brief remove entry, setting oldValue.
*/
-GfErrType MapSegment::remove(const CacheableKeyPtr& key, CacheablePtr& oldValue,
- MapEntryImplPtr& me, int updateCount,
- VersionTagPtr versionTag, bool afterRemote,
- bool& isEntryFound) {
+GfErrType MapSegment::remove(const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<Cacheable>& oldValue,
+ std::shared_ptr<MapEntryImpl>& me, int updateCount,
+ std::shared_ptr<VersionTag> versionTag,
+ bool afterRemote, bool& isEntryFound) {
int status;
- MapEntryPtr entry;
+ std::shared_ptr<MapEntry> entry;
if (m_concurrencyChecksEnabled) {
TombstoneExpiryHandler* handler;
int64_t id = m_tombstoneList->getExpiryTask(&handler);
@@ -346,7 +354,7 @@ GfErrType MapSegment::remove(const CacheableKeyPtr& key, CacheablePtr& oldValue,
}
std::lock_guard<spinlock_mutex> lk(m_spinlock);
- CacheablePtr value;
+ std::shared_ptr<Cacheable> value;
if ((status = m_map->unbind(key, entry)) == -1) {
// didn't unbind, probably no entry...
oldValue = nullptr;
@@ -361,7 +369,7 @@ GfErrType MapSegment::remove(const CacheableKeyPtr& key, CacheablePtr& oldValue,
// this is the case when entry has been updated while being tracked
return GF_CACHE_ENTRY_UPDATED;
}
- MapEntryImplPtr entryImpl = entry->getImplPtr();
+ auto entryImpl = entry->getImplPtr();
entryImpl->getValueI(oldValue);
if (CacheableToken::isTombstone(oldValue)) oldValue = nullptr;
if (oldValue) {
@@ -370,9 +378,9 @@ GfErrType MapSegment::remove(const CacheableKeyPtr& key, CacheablePtr& oldValue,
return GF_NOERR;
}
-bool MapSegment::unguardedRemoveActualEntry(const CacheableKeyPtr& key,
+bool MapSegment::unguardedRemoveActualEntry(const std::shared_ptr<CacheableKey>& key,
bool cancelTask) {
- MapEntryPtr entry;
+ std::shared_ptr<MapEntry> entry;
m_tombstoneList->eraseEntryFromTombstoneList(key, cancelTask);
if (m_map->unbind(key, entry) == -1) {
return false;
@@ -381,9 +389,9 @@ bool MapSegment::unguardedRemoveActualEntry(const CacheableKeyPtr& key,
}
bool MapSegment::unguardedRemoveActualEntryWithoutCancelTask(
- const CacheableKeyPtr& key, TombstoneExpiryHandler*& handler,
+ const std::shared_ptr<CacheableKey>& key, TombstoneExpiryHandler*& handler,
int64_t& taskid) {
- MapEntryPtr entry;
+ std::shared_ptr<MapEntry> entry;
taskid = m_tombstoneList->eraseEntryFromTombstoneListWithoutCancelTask(
key, handler);
if (m_map->unbind(key, entry) == -1) {
@@ -392,7 +400,7 @@ bool MapSegment::unguardedRemoveActualEntryWithoutCancelTask(
return true;
}
-bool MapSegment::removeActualEntry(const CacheableKeyPtr& key,
+bool MapSegment::removeActualEntry(const std::shared_ptr<CacheableKey>& key,
bool cancelTask) {
std::lock_guard<spinlock_mutex> lk(m_spinlock);
return unguardedRemoveActualEntry(key, cancelTask);
@@ -400,11 +408,11 @@ bool MapSegment::removeActualEntry(const CacheableKeyPtr& key,
/**
* @brief get MapEntry for key. throws NoEntryException if absent.
*/
-bool MapSegment::getEntry(const CacheableKeyPtr& key, MapEntryImplPtr& result,
- CacheablePtr& value) {
+bool MapSegment::getEntry(const std::shared_ptr<CacheableKey>& key, std::shared_ptr<MapEntryImpl>& result,
+ std::shared_ptr<Cacheable>& value) {
std::lock_guard<spinlock_mutex> lk(m_spinlock);
int status;
- MapEntryPtr entry;
+ std::shared_ptr<MapEntry> entry;
if ((status = m_map->find(key, entry)) == -1) {
result = nullptr;
value = nullptr;
@@ -412,7 +420,7 @@ bool MapSegment::getEntry(const CacheableKeyPtr& key, MapEntryImplPtr& result,
}
// If the value is a tombstone return not found
- MapEntryImplPtr mePtr = entry->getImplPtr();
+ auto mePtr = entry->getImplPtr();
mePtr->getValueI(value);
if (value == nullptr || CacheableToken::isTombstone(value)) {
result = nullptr;
@@ -426,16 +434,16 @@ bool MapSegment::getEntry(const CacheableKeyPtr& key, MapEntryImplPtr& result,
/**
* @brief return true if there exists an entry for the key.
*/
-bool MapSegment::containsKey(const CacheableKeyPtr& key) {
+bool MapSegment::containsKey(const std::shared_ptr<CacheableKey>& key) {
std::lock_guard<spinlock_mutex> lk(m_spinlock);
- MapEntryPtr mePtr;
+ std::shared_ptr<MapEntry> mePtr;
int status;
if ((status = m_map->find(key, mePtr)) == -1) {
return false;
}
// If the value is a tombstone return not found
- CacheablePtr value;
- MapEntryImplPtr mePtr1 = mePtr->getImplPtr();
+ std::shared_ptr<Cacheable> value;
+ auto mePtr1 = mePtr->getImplPtr();
mePtr1->getValueI(value);
if (value != nullptr && CacheableToken::isTombstone(value)) return false;
@@ -445,11 +453,11 @@ bool MapSegment::containsKey(const CacheableKeyPtr& key) {
/**
* @brief return the all the keys in the provided list.
*/
-void MapSegment::getKeys(VectorOfCacheableKey& result) {
+void MapSegment::getKeys(std::vector<std::shared_ptr<CacheableKey>> & result) {
std::lock_guard<spinlock_mutex> lk(m_spinlock);
for (CacheableKeyHashMap::iterator iter = m_map->begin();
iter != m_map->end(); iter++) {
- CacheablePtr valuePtr;
+ std::shared_ptr<Cacheable> valuePtr;
(*iter).int_id_->getImplPtr()->getValueI(valuePtr);
if (!CacheableToken::isTombstone(valuePtr)) {
result.push_back((*iter).ext_id_);
@@ -460,21 +468,21 @@ void MapSegment::getKeys(VectorOfCacheableKey& result) {
/**
* @brief return all the entries in the provided list.
*/
-void MapSegment::getEntries(VectorOfRegionEntry& result) {
+void MapSegment::getEntries(std::vector<std::shared_ptr<RegionEntry>>& result) {
std::lock_guard<spinlock_mutex> lk(m_spinlock);
for (CacheableKeyHashMap::iterator iter = m_map->begin();
iter != m_map->end(); iter++) {
- CacheableKeyPtr keyPtr;
- CacheablePtr valuePtr;
- MapEntryImplPtr me = ((*iter).int_id_)->getImplPtr();
+ std::shared_ptr<CacheableKey> keyPtr;
+ std::shared_ptr<Cacheable> valuePtr;
+ auto me = ((*iter).int_id_)->getImplPtr();
me->getValueI(valuePtr);
if (valuePtr != nullptr && !CacheableToken::isTombstone(valuePtr)) {
if (CacheableToken::isInvalid(valuePtr)) {
valuePtr = nullptr;
}
me->getKeyI(keyPtr);
- RegionEntryPtr rePtr = m_region->createRegionEntry(keyPtr, valuePtr);
- result.push_back(rePtr);
+ auto rePtr = m_region->createRegionEntry(keyPtr, valuePtr);
+ result.push_back(rePtr);
}
}
}
@@ -482,13 +490,13 @@ void MapSegment::getEntries(VectorOfRegionEntry& result) {
/**
* @brief return all values in the provided list.
*/
-void MapSegment::getValues(VectorOfCacheable& result) {
+void MapSegment::getValues(std::vector<std::shared_ptr<Cacheable>> & result) {
std::lock_guard<spinlock_mutex> lk(m_spinlock);
for (CacheableKeyHashMap::iterator iter = m_map->begin();
iter != m_map->end(); iter++) {
- CacheablePtr valuePtr;
- CacheableKeyPtr keyPtr;
- MapEntryPtr entry;
+ std::shared_ptr<Cacheable> valuePtr;
+ std::shared_ptr<CacheableKey> keyPtr;
+ std::shared_ptr<MapEntry> entry;
int status;
keyPtr = (*iter).ext_id_;
@@ -496,7 +504,7 @@ void MapSegment::getValues(VectorOfCacheable& result) {
status = m_map->find(keyPtr, entry);
if (status != -1) {
- MapEntryImplPtr entryImpl = entry->getImplPtr();
+ auto entryImpl = entry->getImplPtr();
if (valuePtr != nullptr && !CacheableToken::isInvalid(valuePtr) &&
!CacheableToken::isDestroyed(valuePtr) &&
!CacheableToken::isTombstone(valuePtr)) {
@@ -513,18 +521,18 @@ void MapSegment::getValues(VectorOfCacheable& result) {
// This function will not get called if concurrency checks are enabled. The
// versioning
// changes takes care of the version and no need for tracking the entry
-int MapSegment::addTrackerForEntry(const CacheableKeyPtr& key,
- CacheablePtr& oldValue, bool addIfAbsent,
+int MapSegment::addTrackerForEntry(const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<Cacheable>& oldValue, bool addIfAbsent,
bool failIfPresent, bool incUpdateCount) {
if (m_concurrencyChecksEnabled) return -1;
std::lock_guard<spinlock_mutex> lk(m_spinlock);
- MapEntryPtr entry;
- MapEntryPtr newEntry;
+ std::shared_ptr<MapEntry> entry;
+ std::shared_ptr<MapEntry> newEntry;
int status;
if ((status = m_map->find(key, entry)) == -1) {
oldValue = nullptr;
if (addIfAbsent) {
- MapEntryImplPtr entryImpl;
+ std::shared_ptr<MapEntryImpl> entryImpl;
// add a new entry with value as destroyed
m_entryFactory->newMapEntry(m_expiryTaskManager, key, entryImpl);
entryImpl->setValueI(CacheableToken::destroyed());
@@ -562,10 +570,10 @@ int MapSegment::addTrackerForEntry(const CacheableKeyPtr& key,
// This function will not get called if concurrency checks are enabled. The
// versioning
// changes takes care of the version and no need for tracking the entry
-void MapSegment::removeTrackerForEntry(const CacheableKeyPtr& key) {
+void MapSegment::removeTrackerForEntry(const std::shared_ptr<CacheableKey>& key) {
if (m_concurrencyChecksEnabled) return;
std::lock_guard<spinlock_mutex> lk(m_spinlock);
- MapEntryPtr entry;
+ std::shared_ptr<MapEntry> entry;
int status;
if ((status = m_map->find(key, entry)) != -1) {
auto impl = entry->getImplPtr();
@@ -580,8 +588,8 @@ void MapSegment::addTrackerForAllEntries(
MapOfUpdateCounters& updateCounterMap) {
if (m_concurrencyChecksEnabled) return;
std::lock_guard<spinlock_mutex> lk(m_spinlock);
- MapEntryPtr newEntry;
- CacheableKeyPtr key;
+ std::shared_ptr<MapEntry> newEntry;
+ std::shared_ptr<CacheableKey> key;
for (CacheableKeyHashMap::iterator iter = m_map->begin();
iter != m_map->end(); ++iter) {
(*iter).int_id_->getKey(key);
@@ -627,17 +635,17 @@ void MapSegment::rehash() { // Only called from put, segment must already be
delete oldMap;
m_rehashCount++;
}
-
-CacheablePtr MapSegment::getFromDisc(CacheableKeyPtr key,
- MapEntryImplPtr& entryImpl) {
+std::shared_ptr<Cacheable> MapSegment::getFromDisc(
+ std::shared_ptr<CacheableKey> key,
+ std::shared_ptr<MapEntryImpl>& entryImpl) {
LocalRegion* lregion = static_cast<LocalRegion*>(m_region);
EntriesMap* em = lregion->getEntryMap();
return em->getFromDisk(key, entryImpl);
}
GfErrType MapSegment::putForTrackedEntry(
- const CacheableKeyPtr& key, const CacheablePtr& newValue,
- MapEntryPtr& entry, MapEntryImplPtr& entryImpl, int updateCount,
+ const std::shared_ptr<CacheableKey>& key, const std::shared_ptr<Cacheable>& newValue,
+ std::shared_ptr<MapEntry>& entry, std::shared_ptr<MapEntryImpl>& entryImpl, int updateCount,
VersionStamp& versionStamp, DataInput* delta) {
if (updateCount < 0 || m_concurrencyChecksEnabled) {
// for a non-tracked put (e.g. from notification) go ahead with the
@@ -648,7 +656,7 @@ GfErrType MapSegment::putForTrackedEntry(
m_poolDM = dynamic_cast<ThinClientPoolDM*>(tcRegion->getDistMgr());
}
if (delta != nullptr) {
- CacheablePtr oldValue;
+ std::shared_ptr<Cacheable> oldValue;
entryImpl->getValueI(oldValue);
if (oldValue == nullptr || CacheableToken::isDestroyed(oldValue) ||
CacheableToken::isInvalid(oldValue) ||
@@ -664,10 +672,10 @@ GfErrType MapSegment::putForTrackedEntry(
}
}
auto valueWithDelta = std::dynamic_pointer_cast<Delta>(oldValue);
- CacheablePtr& newValue1 = const_cast<CacheablePtr&>(newValue);
+ std::shared_ptr<Cacheable>& newValue1 = const_cast<std::shared_ptr<Cacheable>&>(newValue);
try {
if (m_region->getAttributes()->getCloningEnabled()) {
- DeltaPtr tempVal = valueWithDelta->clone();
+ auto tempVal = valueWithDelta->clone();
ACE_Time_Value currTimeBefore = ACE_OS::gettimeofday();
tempVal->fromDelta(*delta);
if (m_poolDM) {
@@ -718,16 +726,16 @@ void MapSegment::reapTombstones(std::map<uint16_t, int64_t>& gcVersions) {
std::lock_guard<spinlock_mutex> lk(m_spinlock);
m_tombstoneList->reapTombstones(gcVersions);
}
-void MapSegment::reapTombstones(CacheableHashSetPtr removedKeys) {
+void MapSegment::reapTombstones(std::shared_ptr<CacheableHashSet> removedKeys) {
std::lock_guard<spinlock_mutex> lk(m_spinlock);
m_tombstoneList->reapTombstones(removedKeys);
}
-GfErrType MapSegment::isTombstone(CacheableKeyPtr key, MapEntryImplPtr& me,
+GfErrType MapSegment::isTombstone(std::shared_ptr<CacheableKey> key, std::shared_ptr<MapEntryImpl>& me,
bool& result) {
- CacheablePtr value;
- MapEntryPtr entry;
- MapEntryImplPtr mePtr;
+ std::shared_ptr<Cacheable> value;
+ std::shared_ptr<MapEntry> entry;
+ std::shared_ptr<MapEntryImpl> mePtr;
if (m_map->find(key, entry) == -1) {
result = false;
return GF_NOERR;
@@ -747,7 +755,7 @@ GfErrType MapSegment::isTombstone(CacheableKeyPtr key, MapEntryImplPtr& me,
if (CacheableToken::isTombstone(value)) {
if (m_tombstoneList->exists(key)) {
- MapEntryPtr entry;
+ std::shared_ptr<MapEntry> entry;
if (m_map->find(key, entry) != -1) {
auto mePtr = entry->getImplPtr();
me = mePtr;
diff --git a/cppcache/src/MapSegment.hpp b/cppcache/src/MapSegment.hpp
index 69e7848..af582e3 100644
--- a/cppcache/src/MapSegment.hpp
+++ b/cppcache/src/MapSegment.hpp
@@ -20,12 +20,14 @@
#ifndef GEODE_MAPSEGMENT_H_
#define GEODE_MAPSEGMENT_H_
+#include <vector>
+#include <memory>
+
#include <geode/geode_globals.hpp>
#include <geode/CacheableKey.hpp>
#include "MapEntry.hpp"
#include <geode/RegionEntry.hpp>
-#include <geode/VectorT.hpp>
#include "MapWithLock.hpp"
#include "CacheableToken.hpp"
#include <geode/Delta.hpp>
@@ -46,18 +48,18 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
template <>
-class ACE_Hash<apache::geode::client::CacheableKeyPtr> {
+class ACE_Hash<std::shared_ptr<apache::geode::client::CacheableKey>> {
public:
- u_long operator()(const apache::geode::client::CacheableKeyPtr& key) {
+ u_long operator()(const std::shared_ptr<apache::geode::client::CacheableKey>& key) {
return key->hashcode();
}
};
template <>
-class ACE_Equal_To<apache::geode::client::CacheableKeyPtr> {
+class ACE_Equal_To<std::shared_ptr<apache::geode::client::CacheableKey>> {
public:
- bool operator()(const apache::geode::client::CacheableKeyPtr& key1,
- const apache::geode::client::CacheableKeyPtr& key2) {
+ bool operator()(const std::shared_ptr<apache::geode::client::CacheableKey>& key1,
+ const std::shared_ptr<apache::geode::client::CacheableKey>& key2) {
return key1->operator==(*key2);
}
};
@@ -69,8 +71,9 @@ namespace client {
class RegionInternal;
typedef ::ACE_Hash_Map_Manager_Ex<
- CacheableKeyPtr, MapEntryPtr, ::ACE_Hash<CacheableKeyPtr>,
- ::ACE_Equal_To<CacheableKeyPtr>, ::ACE_Null_Mutex>
+ std::shared_ptr<CacheableKey>, std::shared_ptr<MapEntry>,
+ ::ACE_Hash<std::shared_ptr<CacheableKey>>,
+ ::ACE_Equal_To<std::shared_ptr<CacheableKey>>, ::ACE_Null_Mutex>
CacheableKeyHashMap;
/** @brief type wrapper around the ACE map implementation. */
@@ -98,17 +101,17 @@ class CPPCACHE_EXPORT MapSegment {
uint32_t m_rehashCount;
void rehash();
- TombstoneListPtr m_tombstoneList;
+ std::shared_ptr<TombstoneList> m_tombstoneList;
// increment update counter of the given entry and return true if entry
// was rebound
- inline bool incrementUpdateCount(const CacheableKeyPtr& key,
- MapEntryPtr& entry) {
+ inline bool incrementUpdateCount(const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntry>& entry) {
// This function is disabled if concurrency checks are enabled. The
// versioning
// changes takes care of the version and no need for tracking the entry
if (m_concurrencyChecksEnabled) return false;
- MapEntryPtr newEntry;
+ std::shared_ptr<MapEntry> newEntry;
entry->incrementUpdateCount(newEntry);
if (newEntry != nullptr) {
m_map->rebind(key, newEntry);
@@ -119,16 +122,16 @@ class CPPCACHE_EXPORT MapSegment {
}
// remove a tracker for the given entry
- inline void removeTrackerForEntry(const CacheableKeyPtr& key,
- MapEntryPtr& entry,
- MapEntryImplPtr& entryImpl) {
+ inline void removeTrackerForEntry(const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntry>& entry,
+ std::shared_ptr<MapEntryImpl>& entryImpl) {
// This function is disabled if concurrency checks are enabled. The
// versioning
// changes takes care of the version and no need for tracking the entry
if (m_concurrencyChecksEnabled) return;
std::pair<bool, int> trackerPair = entry->removeTracker();
if (trackerPair.second <= 0) {
- CacheablePtr value;
+ std::shared_ptr<Cacheable> value;
if (entryImpl == nullptr) {
entryImpl = entry->getImplPtr();
}
@@ -145,10 +148,11 @@ class CPPCACHE_EXPORT MapSegment {
}
}
- inline GfErrType putNoEntry(const CacheableKeyPtr& key,
- const CacheablePtr& newValue,
- MapEntryImplPtr& newEntry, int updateCount,
- int destroyTracker, VersionTagPtr versionTag,
+ inline GfErrType putNoEntry(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& newValue,
+ std::shared_ptr<MapEntryImpl>& newEntry,
+ int updateCount, int destroyTracker,
+ std::shared_ptr<VersionTag> versionTag,
VersionStamp* versionStamp = nullptr) {
if (!m_concurrencyChecksEnabled) {
if (updateCount >= 0) {
@@ -177,17 +181,19 @@ class CPPCACHE_EXPORT MapSegment {
return GF_NOERR;
}
- GfErrType putForTrackedEntry(const CacheableKeyPtr& key,
- const CacheablePtr& newValue, MapEntryPtr& entry,
- MapEntryImplPtr& entryImpl, int updateCount,
- VersionStamp& versionStamp,
+ GfErrType putForTrackedEntry(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& newValue,
+ std::shared_ptr<MapEntry>& entry,
+ std::shared_ptr<MapEntryImpl>& entryImpl,
+ int updateCount, VersionStamp& versionStamp,
DataInput* delta = nullptr);
- CacheablePtr getFromDisc(CacheableKeyPtr key, MapEntryImplPtr& entryImpl);
+ std::shared_ptr<Cacheable> getFromDisc(std::shared_ptr<CacheableKey> key, std::shared_ptr<MapEntryImpl>& entryImpl);
GfErrType removeWhenConcurrencyEnabled(
- const CacheableKeyPtr& key, CacheablePtr& oldValue, MapEntryImplPtr& me,
- int updateCount, VersionTagPtr versionTag, bool afterRemote,
+ const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<Cacheable>& oldValue, std::shared_ptr<MapEntryImpl>& me,
+ int updateCount, std::shared_ptr<VersionTag> versionTag, bool afterRemote,
bool& isEntryFound, int64_t expiryTaskID, TombstoneExpiryHandler* handler,
bool& expTaskSet);
@@ -227,65 +233,71 @@ class CPPCACHE_EXPORT MapSegment {
* @brief put a new value in the map, failing if key already exists.
* return error code if key already existing or something goes wrong.
*/
- GfErrType create(const CacheableKeyPtr& key, const CacheablePtr& newValue,
- MapEntryImplPtr& me, CacheablePtr& oldValue, int updateCount,
- int destroyTracker, VersionTagPtr versionTag);
+ GfErrType create(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& newValue,
+ std::shared_ptr<MapEntryImpl>& me,
+ std::shared_ptr<Cacheable>& oldValue, int updateCount,
+ int destroyTracker, std::shared_ptr<VersionTag> versionTag);
/**
* @brief put a value in the map, replacing if key already exists.
* return error code is something goes wrong.
*/
- GfErrType put(const CacheableKeyPtr& key, const CacheablePtr& newValue,
- MapEntryImplPtr& me, CacheablePtr& oldValue, int updateCount,
- int destroyTracker, bool& isUpdate, VersionTagPtr versionTag,
+ GfErrType put(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& newValue,
+ std::shared_ptr<MapEntryImpl>& me,
+ std::shared_ptr<Cacheable>& oldValue, int updateCount,
+ int destroyTracker, bool& isUpdate,
+ std::shared_ptr<VersionTag> versionTag,
DataInput* delta = nullptr);
- GfErrType invalidate(const CacheableKeyPtr& key, MapEntryImplPtr& me,
- CacheablePtr& oldValue, VersionTagPtr versionTag,
+ GfErrType invalidate(const std::shared_ptr<CacheableKey>& key, std::shared_ptr<MapEntryImpl>& me,
+ std::shared_ptr<Cacheable>& oldValue, std::shared_ptr<VersionTag> versionTag,
bool& isTokenAdded);
/**
* @brief remove an entry from the map, setting oldValue.
*/
- GfErrType remove(const CacheableKeyPtr& key, CacheablePtr& oldValue,
- MapEntryImplPtr& me, int updateCount,
- VersionTagPtr versionTag, bool afterRemote,
+ GfErrType remove(const std::shared_ptr<CacheableKey>& key, std::shared_ptr<Cacheable>& oldValue,
+ std::shared_ptr<MapEntryImpl>& me, int updateCount,
+ std::shared_ptr<VersionTag> versionTag, bool afterRemote,
bool& isEntryFound);
/**
* @brief get a value and MapEntry out of the map.
* return true if the key is present, false otherwise.
*/
- bool getEntry(const CacheableKeyPtr& key, MapEntryImplPtr& result,
- CacheablePtr& value);
+ bool getEntry(const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<MapEntryImpl>& result,
+ std::shared_ptr<Cacheable>& value);
/**
* @brief return true if there exists an entry for the key.
*/
- bool containsKey(const CacheableKeyPtr& key);
+ bool containsKey(const std::shared_ptr<CacheableKey>& key);
/**
* @brief return the all the keys in the provided list.
*/
- void getKeys(VectorOfCacheableKey& result);
+ void getKeys(std::vector<std::shared_ptr<CacheableKey>> & result);
/**
* @brief return all the entries in the provided list.
*/
- void getEntries(VectorOfRegionEntry& result);
+ void getEntries(std::vector<std::shared_ptr<RegionEntry>>& result);
/**
* @brief return all values in the provided list.
*/
- void getValues(VectorOfCacheable& result);
+ void getValues(std::vector<std::shared_ptr<Cacheable>> & result);
inline uint32_t rehashCount() { return m_rehashCount; }
- int addTrackerForEntry(const CacheableKeyPtr& key, CacheablePtr& oldValue,
- bool addIfAbsent, bool failIfPresent,
- bool incUpdateCount);
+ int addTrackerForEntry(const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<Cacheable>& oldValue, bool addIfAbsent,
+ bool failIfPresent, bool incUpdateCount);
- void removeTrackerForEntry(const CacheableKeyPtr& key);
+ void removeTrackerForEntry(const std::shared_ptr<CacheableKey>& key);
void addTrackerForAllEntries(MapOfUpdateCounters& updateCounterMap);
@@ -293,18 +305,18 @@ class CPPCACHE_EXPORT MapSegment {
void reapTombstones(std::map<uint16_t, int64_t>& gcVersions);
- void reapTombstones(CacheableHashSetPtr removedKeys);
+ void reapTombstones(std::shared_ptr<CacheableHashSet> removedKeys);
- bool removeActualEntry(const CacheableKeyPtr& key, bool cancelTask = true);
+ bool removeActualEntry(const std::shared_ptr<CacheableKey>& key, bool cancelTask = true);
bool unguardedRemoveActualEntryWithoutCancelTask(
- const CacheableKeyPtr& key, TombstoneExpiryHandler*& handler,
+ const std::shared_ptr<CacheableKey>& key, TombstoneExpiryHandler*& handler,
int64_t& taskid);
- bool unguardedRemoveActualEntry(const CacheableKeyPtr& key,
+ bool unguardedRemoveActualEntry(const std::shared_ptr<CacheableKey>& key,
bool cancelTask = true);
- GfErrType isTombstone(CacheableKeyPtr key, MapEntryImplPtr& me, bool& result);
+ GfErrType isTombstone(std::shared_ptr<CacheableKey> key, std::shared_ptr<MapEntryImpl>& me, bool& result);
static bool boolVal;
};
diff --git a/cppcache/src/MapWithLock.hpp b/cppcache/src/MapWithLock.hpp
index ee53037..92217eb 100644
--- a/cppcache/src/MapWithLock.hpp
+++ b/cppcache/src/MapWithLock.hpp
@@ -35,21 +35,21 @@ namespace apache {
namespace geode {
namespace client {
-typedef std::unordered_map<CacheableKeyPtr, int, CacheableKey::hash,
- CacheableKey::equal_to>
+typedef std::unordered_map<std::shared_ptr<CacheableKey>, int,
+ CacheableKey::hash, CacheableKey::equal_to>
MapOfUpdateCounters;
class Region;
-typedef std::shared_ptr<Region> RegionPtr;
-
/** Map type used to hold root regions in the Cache, and subRegions. */
-typedef ACE_Hash_Map_Manager_Ex<std::string, RegionPtr, ACE_Hash<std::string>,
- ACE_Equal_To<std::string>,
- ACE_Recursive_Thread_Mutex>
+typedef ACE_Hash_Map_Manager_Ex<
+ std::string, std::shared_ptr<Region>, ACE_Hash<std::string>,
+ ACE_Equal_To<std::string>, ACE_Recursive_Thread_Mutex>
MapOfRegionWithLock;
-typedef ACE_Hash_Map_Manager_Ex<std::string, CqQueryPtr, ACE_Hash<std::string>,
- ACE_Equal_To<std::string>,
- ACE_Recursive_Thread_Mutex>
+
+class CqQuery;
+typedef ACE_Hash_Map_Manager_Ex<
+ std::string, std::shared_ptr<CqQuery>, ACE_Hash<std::string>,
+ ACE_Equal_To<std::string>, ACE_Recursive_Thread_Mutex>
MapOfCqQueryWithLock;
/** Guard type for locking a MapOfRegionWithLock while iterating or performing
diff --git a/cppcache/src/MemberListForVersionStamp.cpp b/cppcache/src/MemberListForVersionStamp.cpp
index d351bda..c8f10ad 100644
--- a/cppcache/src/MemberListForVersionStamp.cpp
+++ b/cppcache/src/MemberListForVersionStamp.cpp
@@ -28,7 +28,8 @@ MemberListForVersionStamp::~MemberListForVersionStamp() {}
// Add function searches whether the member is already added to the hash maps.
// If yes, return the integer counter. If not, add it to both the hash maps.
// This function is protected using readers/writer lock
-uint16_t MemberListForVersionStamp::add(DSMemberForVersionStampPtr member) {
+uint16_t MemberListForVersionStamp::add(
+ std::shared_ptr<DSMemberForVersionStamp> member) {
WriteGuard guard(m_mapLock);
std::unordered_map<std::string, DistributedMemberWithIntIdentifier>::iterator
it = m_members2.find(member->getHashKey());
@@ -44,10 +45,11 @@ uint16_t MemberListForVersionStamp::add(DSMemberForVersionStampPtr member) {
}
// This function is protected using readers/writer lock
-DSMemberForVersionStampPtr MemberListForVersionStamp::getDSMember(
+std::shared_ptr<DSMemberForVersionStamp> MemberListForVersionStamp::getDSMember(
uint16_t memberId) {
ReadGuard guard(m_mapLock);
- std::unordered_map<uint32_t, DSMemberForVersionStampPtr>::iterator it =
+ std::unordered_map<uint32_t,
+ std::shared_ptr<DSMemberForVersionStamp>>::iterator it =
m_members1.find(memberId);
if (it != m_members1.end()) return (*it).second;
return nullptr;
diff --git a/cppcache/src/MemberListForVersionStamp.hpp b/cppcache/src/MemberListForVersionStamp.hpp
index d3b07c2..23c6544 100644
--- a/cppcache/src/MemberListForVersionStamp.hpp
+++ b/cppcache/src/MemberListForVersionStamp.hpp
@@ -33,11 +33,12 @@ namespace client {
struct DistributedMemberWithIntIdentifier {
public:
DistributedMemberWithIntIdentifier(
- DSMemberForVersionStampPtr dsmember = nullptr, uint16_t id = 0) {
+ std::shared_ptr<DSMemberForVersionStamp> dsmember = nullptr,
+ uint16_t id = 0) {
this->m_member = dsmember;
this->m_identifier = id;
}
- DSMemberForVersionStampPtr m_member;
+ std::shared_ptr<DSMemberForVersionStamp> m_member;
uint16_t m_identifier;
};
@@ -45,11 +46,12 @@ class MemberListForVersionStamp {
public:
MemberListForVersionStamp();
virtual ~MemberListForVersionStamp();
- uint16_t add(DSMemberForVersionStampPtr member);
- DSMemberForVersionStampPtr getDSMember(uint16_t memberId);
+ uint16_t add(std::shared_ptr<DSMemberForVersionStamp> member);
+ std::shared_ptr<DSMemberForVersionStamp> getDSMember(uint16_t memberId);
private:
- std::unordered_map<uint32_t, DSMemberForVersionStampPtr> m_members1;
+ std::unordered_map<uint32_t, std::shared_ptr<DSMemberForVersionStamp>>
+ m_members1;
std::unordered_map<std::string, DistributedMemberWithIntIdentifier>
m_members2;
@@ -57,7 +59,6 @@ class MemberListForVersionStamp {
uint32_t m_memberCounter;
};
-typedef std::shared_ptr<MemberListForVersionStamp> MemberListForVersionStampPtr;
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/NoResult.hpp b/cppcache/src/NoResult.hpp
index 879b931..9116d82 100644
--- a/cppcache/src/NoResult.hpp
+++ b/cppcache/src/NoResult.hpp
@@ -46,7 +46,8 @@ class CPPCACHE_EXPORT NoResult : public ResultCollector {
NoResult() = default;
virtual ~NoResult() override = default;
- inline void addResult(const CacheablePtr& resultOfSingleExecution) override {
+ inline void addResult(
+ const std::shared_ptr<Cacheable>& resultOfSingleExecution) override {
throw UnsupportedOperationException("can not add to NoResult");
}
@@ -54,7 +55,7 @@ class CPPCACHE_EXPORT NoResult : public ResultCollector {
throw UnsupportedOperationException("can not close on NoResult");
}
- inline CacheableVectorPtr getResult(
+ inline std::shared_ptr<CacheableVector> getResult(
std::chrono::milliseconds timeout =
DEFAULT_QUERY_RESPONSE_TIMEOUT) override {
throw FunctionExecutionException(
diff --git a/cppcache/src/PdxFieldType.cpp b/cppcache/src/PdxFieldType.cpp
index 767f1af..668a823 100644
--- a/cppcache/src/PdxFieldType.cpp
+++ b/cppcache/src/PdxFieldType.cpp
@@ -99,7 +99,7 @@ void PdxFieldType::fromData(DataInput& input) {
}
}
-bool PdxFieldType::equals(PdxFieldTypePtr otherObj) {
+bool PdxFieldType::equals(std::shared_ptr<PdxFieldType> otherObj) {
if (otherObj == nullptr) return false;
PdxFieldType* otherFieldType = dynamic_cast<PdxFieldType*>(otherObj.get());
@@ -142,8 +142,7 @@ int32_t PdxFieldType::getFixedTypeSize() const {
}
return -1;
}
-
-CacheableStringPtr PdxFieldType::toString() const {
+std::shared_ptr<CacheableString> PdxFieldType::toString() const {
char stringBuf[1024];
/* adongre - Coverity II
* CID 29208: Calling risky function (SECURE_CODING)[VERY RISKY]. Using
diff --git a/cppcache/src/PdxFieldType.hpp b/cppcache/src/PdxFieldType.hpp
index 3c52c64..a843f8b 100644
--- a/cppcache/src/PdxFieldType.hpp
+++ b/cppcache/src/PdxFieldType.hpp
@@ -32,7 +32,6 @@ namespace geode {
namespace client {
class PdxFieldType;
-typedef std::shared_ptr<PdxFieldType> PdxFieldTypePtr;
class CPPCACHE_EXPORT PdxFieldType : public Serializable {
private:
@@ -96,11 +95,11 @@ class CPPCACHE_EXPORT PdxFieldType : public Serializable {
return size;
}
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
virtual ~PdxFieldType();
- bool equals(PdxFieldTypePtr otherObj);
+ bool equals(std::shared_ptr<PdxFieldType> otherObj);
int32_t getVarLenOffsetIndex() const { return m_vlOffsetIndex; }
diff --git a/cppcache/src/PdxHelper.cpp b/cppcache/src/PdxHelper.cpp
index e3e1634..5ee0613 100644
--- a/cppcache/src/PdxHelper.cpp
+++ b/cppcache/src/PdxHelper.cpp
@@ -55,8 +55,8 @@ void PdxHelper::serializePdx(DataOutput& output,
std::const_pointer_cast<Serializable>(pdxObject.shared_from_this())));
}
-void PdxHelper::serializePdx(DataOutput& output,
- const PdxSerializablePtr& pdxObject) {
+void PdxHelper::serializePdx(
+ DataOutput& output, const std::shared_ptr<PdxSerializable>& pdxObject) {
const char* pdxClassname = nullptr;
auto pdxII = std::dynamic_pointer_cast<PdxInstanceImpl>(pdxObject);
@@ -65,7 +65,7 @@ void PdxHelper::serializePdx(DataOutput& output,
auto& cachePerfStats = cacheImpl->getCachePerfStats();
if (pdxII != nullptr) {
- PdxTypePtr piPt = pdxII->getPdxType();
+ auto piPt = pdxII->getPdxType();
if (piPt != nullptr &&
piPt->getTypeId() ==
0) // from pdxInstance factory need to get typeid from server
@@ -87,16 +87,15 @@ void PdxHelper::serializePdx(DataOutput& output,
const char* pdxType = pdxObject->getClassName();
pdxClassname = pdxType;
- PdxTypePtr localPdxType = pdxTypeRegistry->getLocalPdxType(pdxType);
+ auto localPdxType = pdxTypeRegistry->getLocalPdxType(pdxType);
if (localPdxType == nullptr) {
// need to grab type info, as fromdata is not called yet
- PdxWriterWithTypeCollectorPtr ptc =
- std::make_shared<PdxWriterWithTypeCollector>(output, pdxType,
- pdxTypeRegistry);
+ auto ptc = std::make_shared<PdxWriterWithTypeCollector>(output, pdxType,
+ pdxTypeRegistry);
pdxObject->toData(std::dynamic_pointer_cast<PdxWriter>(ptc));
- PdxTypePtr nType = ptc->getPdxLocalType();
+ auto nType = ptc->getPdxLocalType();
nType->InitializeType();
int32_t nTypeId = pdxTypeRegistry->getPDXIdForType(
@@ -120,16 +119,15 @@ void PdxHelper::serializePdx(DataOutput& output,
// if object got from server than create instance of RemoteWriter otherwise
// local writer.
- PdxRemotePreservedDataPtr pd = pdxTypeRegistry->getPreserveData(pdxObject);
+ auto pd = pdxTypeRegistry->getPreserveData(pdxObject);
// now always remotewriter as we have API Read/WriteUnreadFields
// so we don't know whether user has used those or not;; Can we do some
// trick here?
- PdxRemoteWriterPtr prw = nullptr;
+ std::shared_ptr<PdxRemoteWriter> prw = nullptr;
if (pd != nullptr) {
- PdxTypePtr mergedPdxType =
- pdxTypeRegistry->getPdxType(pd->getMergedTypeId());
+ auto mergedPdxType = pdxTypeRegistry->getPdxType(pd->getMergedTypeId());
prw = std::make_shared<PdxRemoteWriter>(output, mergedPdxType, pd,
pdxTypeRegistry);
} else {
@@ -149,19 +147,18 @@ void PdxHelper::serializePdx(DataOutput& output,
}
}
}
-
-PdxSerializablePtr PdxHelper::deserializePdx(DataInput& dataInput,
- bool forceDeserialize,
- int32_t typeId, int32_t length) {
+std::shared_ptr<PdxSerializable> PdxHelper::deserializePdx(
+ DataInput& dataInput, bool forceDeserialize, int32_t typeId,
+ int32_t length) {
char* pdxClassname = nullptr;
- PdxSerializablePtr pdxObjectptr = nullptr;
- PdxTypePtr pdxLocalType = nullptr;
+ std::shared_ptr<PdxSerializable> pdxObjectptr = nullptr;
+ std::shared_ptr<PdxType> pdxLocalType = nullptr;
auto cacheImpl = CacheRegionHelper::getCacheImpl(dataInput.getCache());
auto pdxTypeRegistry = cacheImpl->getPdxTypeRegistry();
auto serializationRegistry = cacheImpl->getSerializationRegistry();
- PdxTypePtr pType = pdxTypeRegistry->getPdxType(typeId);
+ auto pType = pdxTypeRegistry->getPdxType(typeId);
if (pType != nullptr) { // this may happen with PdxInstanceFactory {
pdxLocalType = pdxTypeRegistry->getLocalPdxType(
pType->getPdxClassName()); // this should be fine for IPdxTypeMapper
@@ -175,19 +172,17 @@ PdxSerializablePtr PdxHelper::deserializePdx(DataInput& dataInput,
pdxObjectptr = serializationRegistry->getPdxType(pdxClassname);
if (pType->isLocal()) // local type no need to read Unread data
{
- PdxLocalReaderPtr plr = std::make_shared<PdxLocalReader>(
- dataInput, pType, length, pdxTypeRegistry);
+ auto plr = std::make_shared<PdxLocalReader>(dataInput, pType, length,
+ pdxTypeRegistry);
pdxObjectptr->fromData(std::dynamic_pointer_cast<PdxReader>(plr));
plr->MoveStream();
} else {
- PdxRemoteReaderPtr prr = std::make_shared<PdxRemoteReader>(
- dataInput, pType, length, pdxTypeRegistry);
+ auto prr = std::make_shared<PdxRemoteReader>(dataInput, pType, length,
+ pdxTypeRegistry);
pdxObjectptr->fromData(std::dynamic_pointer_cast<PdxReader>(prr));
- PdxTypePtr mergedVersion =
- pdxTypeRegistry->getMergedType(pType->getTypeId());
+ auto mergedVersion = pdxTypeRegistry->getMergedType(pType->getTypeId());
- PdxRemotePreservedDataPtr preserveData =
- prr->getPreservedData(mergedVersion, pdxObjectptr);
+ auto preserveData = prr->getPreservedData(mergedVersion, pdxObjectptr);
if (preserveData != nullptr) {
pdxTypeRegistry->setPreserveData(
pdxObjectptr, preserveData,
@@ -214,81 +209,75 @@ PdxSerializablePtr PdxHelper::deserializePdx(DataInput& dataInput,
*/
// pdxClassname = pType->getPdxClassName();
pdxObjectptr = serializationRegistry->getPdxType(pType->getPdxClassName());
- PdxSerializablePtr pdxRealObject = pdxObjectptr;
- if (pdxLocalType == nullptr) // need to know local type
- {
- PdxReaderWithTypeCollectorPtr prtc =
- std::make_shared<PdxReaderWithTypeCollector>(dataInput, pType, length,
- pdxTypeRegistry);
- pdxObjectptr->fromData(std::dynamic_pointer_cast<PdxReader>(prtc));
-
- // Check for the PdxWrapper
-
- pdxLocalType = prtc->getLocalType();
-
- if (pType->Equals(pdxLocalType)) {
- pdxTypeRegistry->addLocalPdxType(pdxRealObject->getClassName(), pType);
- pdxTypeRegistry->addPdxType(pType->getTypeId(), pType);
- pType->setLocal(true);
- } else {
- // Need to know local type and then merge type
- pdxLocalType->InitializeType();
- pdxLocalType->setTypeId(pdxTypeRegistry->getPDXIdForType(
- pdxObjectptr->getClassName(), dataInput.getPoolName(), pdxLocalType,
- true));
- pdxLocalType->setLocal(true);
- pdxTypeRegistry->addLocalPdxType(pdxRealObject->getClassName(),
- pdxLocalType); // added local type
- pdxTypeRegistry->addPdxType(pdxLocalType->getTypeId(), pdxLocalType);
-
- pType->InitializeType();
- pdxTypeRegistry->addPdxType(pType->getTypeId(),
- pType); // adding remote type
-
- // create merge type
- createMergedType(pdxLocalType, pType, dataInput);
-
- PdxTypePtr mergedVersion =
- pdxTypeRegistry->getMergedType(pType->getTypeId());
-
- PdxRemotePreservedDataPtr preserveData =
- prtc->getPreservedData(mergedVersion, pdxObjectptr);
- if (preserveData != nullptr) {
- pdxTypeRegistry->setPreserveData(pdxObjectptr, preserveData,
- cacheImpl->getExpiryTaskManager());
- }
- }
- prtc->MoveStream();
- } else { // remote reader will come here as local type is there
- pType->InitializeType();
- LOGDEBUG("Adding type %d ", pType->getTypeId());
- pdxTypeRegistry->addPdxType(pType->getTypeId(),
- pType); // adding remote type
- PdxRemoteReaderPtr prr = std::make_shared<PdxRemoteReader>(
- dataInput, pType, length, pdxTypeRegistry);
- pdxObjectptr->fromData(std::dynamic_pointer_cast<PdxReader>(prr));
-
- // Check for PdxWrapper to getObject.
-
- createMergedType(pdxLocalType, pType, dataInput);
-
- PdxTypePtr mergedVersion =
- pdxTypeRegistry->getMergedType(pType->getTypeId());
-
- PdxRemotePreservedDataPtr preserveData =
- prr->getPreservedData(mergedVersion, pdxObjectptr);
- if (preserveData != nullptr) {
- pdxTypeRegistry->setPreserveData(pdxObjectptr, preserveData,
- cacheImpl->getExpiryTaskManager());
- }
- prr->MoveStream();
- }
+ auto pdxRealObject = pdxObjectptr;
+ if (pdxLocalType == nullptr) // need to know local type
+ {
+ auto prtc = std::make_shared<PdxReaderWithTypeCollector>(
+ dataInput, pType, length, pdxTypeRegistry);
+ pdxObjectptr->fromData(std::dynamic_pointer_cast<PdxReader>(prtc));
+
+ // Check for the PdxWrapper
+
+ pdxLocalType = prtc->getLocalType();
+
+ if (pType->Equals(pdxLocalType)) {
+ pdxTypeRegistry->addLocalPdxType(pdxRealObject->getClassName(), pType);
+ pdxTypeRegistry->addPdxType(pType->getTypeId(), pType);
+ pType->setLocal(true);
+ } else {
+ // Need to know local type and then merge type
+ pdxLocalType->InitializeType();
+ pdxLocalType->setTypeId(pdxTypeRegistry->getPDXIdForType(
+ pdxObjectptr->getClassName(), dataInput.getPoolName(), pdxLocalType,
+ true));
+ pdxLocalType->setLocal(true);
+ pdxTypeRegistry->addLocalPdxType(pdxRealObject->getClassName(),
+ pdxLocalType); // added local type
+ pdxTypeRegistry->addPdxType(pdxLocalType->getTypeId(), pdxLocalType);
+
+ pType->InitializeType();
+ pdxTypeRegistry->addPdxType(pType->getTypeId(),
+ pType); // adding remote type
+
+ // create merge type
+ createMergedType(pdxLocalType, pType, dataInput);
+
+ auto mergedVersion = pdxTypeRegistry->getMergedType(pType->getTypeId());
+
+ auto preserveData = prtc->getPreservedData(mergedVersion, pdxObjectptr);
+ if (preserveData != nullptr) {
+ pdxTypeRegistry->setPreserveData(pdxObjectptr, preserveData,
+ cacheImpl->getExpiryTaskManager());
+ }
+ }
+ prtc->MoveStream();
+ } else { // remote reader will come here as local type is there
+ pType->InitializeType();
+ LOGDEBUG("Adding type %d ", pType->getTypeId());
+ pdxTypeRegistry->addPdxType(pType->getTypeId(),
+ pType); // adding remote type
+ auto prr = std::make_shared<PdxRemoteReader>(dataInput, pType, length,
+ pdxTypeRegistry);
+ pdxObjectptr->fromData(std::dynamic_pointer_cast<PdxReader>(prr));
+
+ // Check for PdxWrapper to getObject.
+
+ createMergedType(pdxLocalType, pType, dataInput);
+
+ auto mergedVersion = pdxTypeRegistry->getMergedType(pType->getTypeId());
+
+ auto preserveData = prr->getPreservedData(mergedVersion, pdxObjectptr);
+ if (preserveData != nullptr) {
+ pdxTypeRegistry->setPreserveData(pdxObjectptr, preserveData,
+ cacheImpl->getExpiryTaskManager());
+ }
+ prr->MoveStream();
+ }
}
return pdxObjectptr;
}
-
-PdxSerializablePtr PdxHelper::deserializePdx(DataInput& dataInput,
- bool forceDeserialize) {
+std::shared_ptr<PdxSerializable> PdxHelper::deserializePdx(
+ DataInput& dataInput, bool forceDeserialize) {
auto cacheImpl = CacheRegionHelper::getCacheImpl(dataInput.getCache());
auto pdxTypeRegistry = cacheImpl->getPdxTypeRegistry();
auto serializationRegistry = cacheImpl->getSerializationRegistry();
@@ -339,9 +328,9 @@ PdxSerializablePtr PdxHelper::deserializePdx(DataInput& dataInput,
}
}
-void PdxHelper::createMergedType(PdxTypePtr localType, PdxTypePtr remoteType,
+void PdxHelper::createMergedType(std::shared_ptr<PdxType> localType, std::shared_ptr<PdxType> remoteType,
DataInput& dataInput) {
- PdxTypePtr mergedVersion = localType->mergeVersion(remoteType);
+ auto mergedVersion = localType->mergeVersion(remoteType);
auto cacheImpl = CacheRegionHelper::getCacheImpl(dataInput.getCache());
auto pdxTypeRegistry = cacheImpl->getPdxTypeRegistry();
auto serializaionRegistry = cacheImpl->getSerializationRegistry();
@@ -421,16 +410,15 @@ int32_t PdxHelper::readInt(uint8_t* offsetPosition, int size) {
int32_t PdxHelper::getEnumValue(const char* enumClassName, const char* enumName,
int hashcode,
- PdxTypeRegistryPtr pdxTypeRegistry) {
+ std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry) {
const auto& ei =
std::make_shared<EnumInfo>(enumClassName, enumName, hashcode);
return pdxTypeRegistry->getEnumValue(ei);
}
-
-EnumInfoPtr PdxHelper::getEnum(int enumId, PdxTypeRegistryPtr pdxTypeRegistry) {
+ std::shared_ptr<EnumInfo> PdxHelper::getEnum(int enumId, std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry) {
const auto& ei = pdxTypeRegistry->getEnum(enumId);
return ei;
-}
+ }
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/PdxHelper.hpp b/cppcache/src/PdxHelper.hpp
index d83d6b1..4d9b049 100644
--- a/cppcache/src/PdxHelper.hpp
+++ b/cppcache/src/PdxHelper.hpp
@@ -37,7 +37,8 @@ namespace client {
class PdxHelper {
private:
- static void createMergedType(PdxTypePtr localType, PdxTypePtr remoteType,
+ static void createMergedType(std::shared_ptr<PdxType> localType,
+ std::shared_ptr<PdxType> remoteType,
DataInput& dataInput);
public:
@@ -51,14 +52,15 @@ class PdxHelper {
const PdxSerializable& pdxObject);
static void serializePdx(DataOutput& output,
- const PdxSerializablePtr& pdxObject);
+ const std::shared_ptr<PdxSerializable>& pdxObject);
- static PdxSerializablePtr deserializePdx(DataInput& dataInput,
- bool forceDeserialize);
+ static std::shared_ptr<PdxSerializable> deserializePdx(DataInput& dataInput,
+ bool forceDeserialize);
- static PdxSerializablePtr deserializePdx(DataInput& dataInput,
- bool forceDeserialize,
- int32_t typeId, int32_t length);
+ static std::shared_ptr<PdxSerializable> deserializePdx(DataInput& dataInput,
+ bool forceDeserialize,
+ int32_t typeId,
+ int32_t length);
static int32_t readInt16(uint8_t* offsetPosition);
@@ -77,9 +79,11 @@ class PdxHelper {
static int32_t readInt(uint8_t* offsetPosition, int size);
static int32_t getEnumValue(const char* enumClassName, const char* enumName,
- int hashcode, PdxTypeRegistryPtr pdxTypeRegistry);
+ int hashcode,
+ std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry);
- static EnumInfoPtr getEnum(int enumId, PdxTypeRegistryPtr pdxTypeRegistry);
+ static std::shared_ptr<EnumInfo> getEnum(
+ int enumId, std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry);
static CacheImpl* getCacheImpl();
};
diff --git a/cppcache/src/PdxInstanceFactoryImpl.cpp b/cppcache/src/PdxInstanceFactoryImpl.cpp
index 2c8aa04..006d853 100644
--- a/cppcache/src/PdxInstanceFactoryImpl.cpp
+++ b/cppcache/src/PdxInstanceFactoryImpl.cpp
@@ -28,7 +28,7 @@ PdxInstanceFactoryImpl::~PdxInstanceFactoryImpl() {}
PdxInstanceFactoryImpl::PdxInstanceFactoryImpl(
const char* className, CachePerfStats* cachePerfStats,
- PdxTypeRegistryPtr pdxTypeRegistry, const Cache* cache,
+ std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry, const Cache* cache,
bool enableTimeStatistics)
: m_pdxType(std::make_shared<PdxType>(pdxTypeRegistry, className, false)),
m_created(false),
@@ -53,169 +53,153 @@ std::unique_ptr<PdxInstance> PdxInstanceFactoryImpl::create() {
m_created = true;
return pi;
}
-
-PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeChar(const char* fieldName,
- char16_t value) {
+std::shared_ptr<PdxInstanceFactory> PdxInstanceFactoryImpl::writeChar(
+ const char* fieldName, char16_t value) {
isFieldAdded(fieldName);
m_pdxType->addFixedLengthTypeField(fieldName, "char", PdxFieldTypes::CHAR,
PdxTypes::CHAR_SIZE);
- CacheablePtr cacheableObject = CacheableCharacter::create(value);
- m_FieldVsValues.emplace(fieldName, cacheableObject);
- return shared_from_this();
+ auto cacheableObject = CacheableCharacter::create(value);
+ m_FieldVsValues.emplace(fieldName, cacheableObject);
+ return shared_from_this();
}
-
-PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeChar(const char* fieldName,
- char value) {
+std::shared_ptr<PdxInstanceFactory> PdxInstanceFactoryImpl::writeChar(
+ const char* fieldName, char value) {
isFieldAdded(fieldName);
m_pdxType->addFixedLengthTypeField(fieldName, "char", PdxFieldTypes::CHAR,
PdxTypes::CHAR_SIZE);
- CacheablePtr cacheableObject = CacheableCharacter::create(value);
+ auto cacheableObject = CacheableCharacter::create(value);
m_FieldVsValues.emplace(fieldName, cacheableObject);
return shared_from_this();
}
-
-PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeBoolean(
+ std::shared_ptr<PdxInstanceFactory> PdxInstanceFactoryImpl::writeBoolean(
const char* fieldName, bool value) {
- isFieldAdded(fieldName);
- m_pdxType->addFixedLengthTypeField(fieldName, "bool", PdxFieldTypes::BOOLEAN,
- PdxTypes::BOOLEAN_SIZE);
- CacheablePtr cacheableObject = CacheableBoolean::create(value);
- m_FieldVsValues.insert(
- std::pair<const char*, CacheablePtr>(fieldName, cacheableObject));
- return shared_from_this();
-}
-
-PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeByte(const char* fieldName,
- int8_t value) {
- isFieldAdded(fieldName);
- m_pdxType->addFixedLengthTypeField(fieldName, "byte", PdxFieldTypes::BYTE,
- PdxTypes::BYTE_SIZE);
- CacheablePtr cacheableObject = CacheableByte::create(value);
- m_FieldVsValues.insert(
- std::pair<const char*, CacheablePtr>(fieldName, cacheableObject));
- return shared_from_this();
+ isFieldAdded(fieldName);
+ m_pdxType->addFixedLengthTypeField(fieldName, "bool", PdxFieldTypes::BOOLEAN,
+ PdxTypes::BOOLEAN_SIZE);
+ auto cacheableObject = CacheableBoolean::create(value);
+ m_FieldVsValues.insert(std::pair<const char*, std::shared_ptr<Cacheable>>(
+ fieldName, cacheableObject));
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxInstanceFactory> PdxInstanceFactoryImpl::writeByte(
+ const char* fieldName, int8_t value) {
+ isFieldAdded(fieldName);
+ m_pdxType->addFixedLengthTypeField(fieldName, "byte", PdxFieldTypes::BYTE,
+ PdxTypes::BYTE_SIZE);
+ auto cacheableObject = CacheableByte::create(value);
+ m_FieldVsValues.insert(std::pair<const char*, std::shared_ptr<Cacheable>>(
+ fieldName, cacheableObject));
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxInstanceFactory> PdxInstanceFactoryImpl::writeShort(
+ const char* fieldName, int16_t value) {
+ isFieldAdded(fieldName);
+ m_pdxType->addFixedLengthTypeField(fieldName, "short", PdxFieldTypes::SHORT,
+ PdxTypes::SHORT_SIZE);
+ auto cacheableObject = CacheableInt16::create(value);
+ m_FieldVsValues.insert(std::pair<const char*, std::shared_ptr<Cacheable>>(
+ fieldName, cacheableObject));
+ return shared_from_this();
}
-
-PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeShort(const char* fieldName,
- int16_t value) {
- isFieldAdded(fieldName);
- m_pdxType->addFixedLengthTypeField(fieldName, "short", PdxFieldTypes::SHORT,
- PdxTypes::SHORT_SIZE);
- CacheablePtr cacheableObject = CacheableInt16::create(value);
- m_FieldVsValues.insert(
- std::pair<const char*, CacheablePtr>(fieldName, cacheableObject));
- return shared_from_this();
-}
-
-PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeInt(const char* fieldName,
- int32_t value) {
+std::shared_ptr<PdxInstanceFactory> PdxInstanceFactoryImpl::writeInt(
+ const char* fieldName, int32_t value) {
isFieldAdded(fieldName);
m_pdxType->addFixedLengthTypeField(fieldName, "int", PdxFieldTypes::INT,
PdxTypes::INTEGER_SIZE);
- CacheablePtr cacheableObject = CacheableInt32::create(value);
- m_FieldVsValues.insert(
- std::pair<const char*, CacheablePtr>(fieldName, cacheableObject));
+ auto cacheableObject = CacheableInt32::create(value);
+ m_FieldVsValues.insert(std::pair<const char*, std::shared_ptr<Cacheable>>(
+ fieldName, cacheableObject));
return shared_from_this();
}
-
-PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeLong(const char* fieldName,
- int64_t value) {
+std::shared_ptr<PdxInstanceFactory> PdxInstanceFactoryImpl::writeLong(
+ const char* fieldName, int64_t value) {
isFieldAdded(fieldName);
m_pdxType->addFixedLengthTypeField(fieldName, "long", PdxFieldTypes::LONG,
PdxTypes::LONG_SIZE);
- CacheablePtr cacheableObject = CacheableInt64::create(value);
- m_FieldVsValues.insert(
- std::pair<const char*, CacheablePtr>(fieldName, cacheableObject));
+ auto cacheableObject = CacheableInt64::create(value);
+ m_FieldVsValues.insert(std::pair<const char*, std::shared_ptr<Cacheable>>(
+ fieldName, cacheableObject));
return shared_from_this();
}
-
-PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeFloat(const char* fieldName,
+ std::shared_ptr<PdxInstanceFactory> PdxInstanceFactoryImpl::writeFloat(const char* fieldName,
float value) {
- isFieldAdded(fieldName);
- m_pdxType->addFixedLengthTypeField(fieldName, "float", PdxFieldTypes::FLOAT,
- PdxTypes::FLOAT_SIZE);
- CacheablePtr cacheableObject = CacheableFloat::create(value);
- m_FieldVsValues.insert(
- std::pair<const char*, CacheablePtr>(fieldName, cacheableObject));
- return shared_from_this();
+ isFieldAdded(fieldName);
+ m_pdxType->addFixedLengthTypeField(fieldName, "float", PdxFieldTypes::FLOAT,
+ PdxTypes::FLOAT_SIZE);
+ auto cacheableObject = CacheableFloat::create(value);
+ m_FieldVsValues.insert(std::pair<const char*, std::shared_ptr<Cacheable>>(
+ fieldName, cacheableObject));
+ return shared_from_this();
}
-
-PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeDouble(const char* fieldName,
- double value) {
+std::shared_ptr<PdxInstanceFactory> PdxInstanceFactoryImpl::writeDouble(
+ const char* fieldName, double value) {
isFieldAdded(fieldName);
m_pdxType->addFixedLengthTypeField(fieldName, "double", PdxFieldTypes::DOUBLE,
PdxTypes::DOUBLE_SIZE);
- CacheablePtr cacheableObject = CacheableDouble::create(value);
- m_FieldVsValues.insert(
- std::pair<const char*, CacheablePtr>(fieldName, cacheableObject));
+ auto cacheableObject = CacheableDouble::create(value);
+ m_FieldVsValues.insert(std::pair<const char*, std::shared_ptr<Cacheable>>(
+ fieldName, cacheableObject));
return shared_from_this();
}
-
-PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeWideString(
+std::shared_ptr<PdxInstanceFactory> PdxInstanceFactoryImpl::writeWideString(
const char* fieldName, const wchar_t* value) {
isFieldAdded(fieldName);
m_pdxType->addVariableLengthTypeField(fieldName, "string",
PdxFieldTypes::STRING);
- CacheablePtr cacheableObject = CacheableString::create(value);
- m_FieldVsValues.insert(
- std::pair<const char*, CacheablePtr>(fieldName, cacheableObject));
+ auto cacheableObject = CacheableString::create(value);
+ m_FieldVsValues.insert(std::pair<const char*, std::shared_ptr<Cacheable>>(
+ fieldName, cacheableObject));
return shared_from_this();
}
-
-PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeString(const char* fieldName,
- const char* value) {
+std::shared_ptr<PdxInstanceFactory> PdxInstanceFactoryImpl::writeString(
+ const char* fieldName, const char* value) {
isFieldAdded(fieldName);
m_pdxType->addVariableLengthTypeField(fieldName, "string",
PdxFieldTypes::STRING);
- CacheablePtr cacheableObject = CacheableString::create(value);
- m_FieldVsValues.insert(
- std::pair<const char*, CacheablePtr>(fieldName, cacheableObject));
+ auto cacheableObject = CacheableString::create(value);
+ m_FieldVsValues.insert(std::pair<const char*, std::shared_ptr<Cacheable>>(
+ fieldName, cacheableObject));
return shared_from_this();
}
-
-PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeObject(const char* fieldName,
- CacheablePtr value) {
+std::shared_ptr<PdxInstanceFactory> PdxInstanceFactoryImpl::writeObject(
+ const char* fieldName, std::shared_ptr<Cacheable> value) {
isFieldAdded(fieldName);
m_pdxType->addVariableLengthTypeField(fieldName, "Object",
PdxFieldTypes::OBJECT);
m_FieldVsValues.insert(
- std::pair<const char*, CacheablePtr>(fieldName, value));
+ std::pair<const char*, std::shared_ptr<Cacheable>>(fieldName, value));
return shared_from_this();
}
-
-PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeObjectArray(
- const char* fieldName, CacheableObjectArrayPtr value) {
+std::shared_ptr<PdxInstanceFactory> PdxInstanceFactoryImpl::writeObjectArray(
+ const char* fieldName, std::shared_ptr<CacheableObjectArray> value) {
isFieldAdded(fieldName);
m_pdxType->addVariableLengthTypeField(fieldName, "Object[]",
PdxFieldTypes::OBJECT_ARRAY);
m_FieldVsValues.insert(
- std::pair<const char*, CacheablePtr>(fieldName, value));
+ std::pair<const char*, std::shared_ptr<Cacheable>>(fieldName, value));
return shared_from_this();
}
-
-PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeBooleanArray(
+std::shared_ptr<PdxInstanceFactory> PdxInstanceFactoryImpl::writeBooleanArray(
const char* fieldName, bool* value, int32_t length) {
isFieldAdded(fieldName);
m_pdxType->addVariableLengthTypeField(fieldName, "bool[]",
PdxFieldTypes::BOOLEAN_ARRAY);
- CacheablePtr cacheableObject = BooleanArray::create(value, length);
+ auto cacheableObject = BooleanArray::create(value, length);
m_FieldVsValues.insert(
- std::pair<std::string, CacheablePtr>(fieldName, cacheableObject));
+ std::pair<std::string, std::shared_ptr<Cacheable>>(fieldName, cacheableObject));
return shared_from_this();
}
-
-PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeWideCharArray(
+std::shared_ptr<PdxInstanceFactory> PdxInstanceFactoryImpl::writeWideCharArray(
const char* fieldName, wchar_t* value, int32_t length) {
isFieldAdded(fieldName);
m_pdxType->addVariableLengthTypeField(fieldName, "char[]",
PdxFieldTypes::CHAR_ARRAY);
- CacheablePtr cacheableObject = CharArray::create(value, length);
+ auto cacheableObject = CharArray::create(value, length);
m_FieldVsValues.insert(
- std::pair<const char*, CacheablePtr>(fieldName, cacheableObject));
+ std::pair<const char*, std::shared_ptr<Cacheable>>(fieldName, cacheableObject));
return shared_from_this();
}
-
-PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeCharArray(
+std::shared_ptr<PdxInstanceFactory> PdxInstanceFactoryImpl::writeCharArray(
const char* fieldName, char* value, int32_t length) {
isFieldAdded(fieldName);
size_t size = strlen(value) + 1;
@@ -223,122 +207,114 @@ PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeCharArray(
mbstowcs(tempWideCharArray, value, size);
m_pdxType->addVariableLengthTypeField(fieldName, "char[]",
PdxFieldTypes::CHAR_ARRAY);
- CacheablePtr cacheableObject = CharArray::create(tempWideCharArray, length);
- m_FieldVsValues.insert(
- std::pair<const char*, CacheablePtr>(fieldName, cacheableObject));
- delete[] tempWideCharArray;
- return shared_from_this();
+ auto cacheableObject = CharArray::create(tempWideCharArray, length);
+ m_FieldVsValues.insert(std::pair<const char*, std::shared_ptr<Cacheable>>(
+ fieldName, cacheableObject));
+ delete[] tempWideCharArray;
+ return shared_from_this();
}
-
-PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeByteArray(
+std::shared_ptr<PdxInstanceFactory> PdxInstanceFactoryImpl::writeByteArray(
const char* fieldName, int8_t* value, int32_t length) {
isFieldAdded(fieldName);
m_pdxType->addVariableLengthTypeField(fieldName, "byte[]",
PdxFieldTypes::BYTE_ARRAY);
- CacheablePtr cacheableObject =
+ auto cacheableObject =
CacheableBytes::create(reinterpret_cast<uint8_t*>(value), length);
m_FieldVsValues.insert(
- std::pair<const char*, CacheablePtr>(fieldName, cacheableObject));
+ std::pair<const char*, std::shared_ptr<Cacheable>>(fieldName, cacheableObject));
return shared_from_this();
}
-
-PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeShortArray(
+std::shared_ptr<PdxInstanceFactory> PdxInstanceFactoryImpl::writeShortArray(
const char* fieldName, int16_t* value, int32_t length) {
isFieldAdded(fieldName);
m_pdxType->addVariableLengthTypeField(fieldName, "short[]",
PdxFieldTypes::SHORT_ARRAY);
- CacheablePtr cacheableObject = CacheableInt16Array::create(value, length);
- m_FieldVsValues.insert(
- std::pair<const char*, CacheablePtr>(fieldName, cacheableObject));
+ auto cacheableObject = CacheableInt16Array::create(value, length);
+ m_FieldVsValues.insert(std::pair<const char*, std::shared_ptr<Cacheable>>(
+ fieldName, cacheableObject));
return shared_from_this();
}
-
-PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeIntArray(
+std::shared_ptr<PdxInstanceFactory> PdxInstanceFactoryImpl::writeIntArray(
const char* fieldName, int32_t* value, int32_t length) {
isFieldAdded(fieldName);
m_pdxType->addVariableLengthTypeField(fieldName, "int32[]",
PdxFieldTypes::INT_ARRAY);
- CacheablePtr cacheableObject = CacheableInt32Array::create(value, length);
- m_FieldVsValues.insert(
- std::pair<const char*, CacheablePtr>(fieldName, cacheableObject));
+ auto cacheableObject = CacheableInt32Array::create(value, length);
+ m_FieldVsValues.insert(std::pair<const char*, std::shared_ptr<Cacheable>>(
+ fieldName, cacheableObject));
return shared_from_this();
}
-
-PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeLongArray(
+ std::shared_ptr<PdxInstanceFactory> PdxInstanceFactoryImpl::writeLongArray(
const char* fieldName, int64_t* value, int32_t length) {
isFieldAdded(fieldName);
m_pdxType->addVariableLengthTypeField(fieldName, "int64[]",
PdxFieldTypes::LONG_ARRAY);
- CacheablePtr cacheableObject = CacheableInt64Array::create(value, length);
+ auto cacheableObject = CacheableInt64Array::create(value, length);
m_FieldVsValues.insert(
- std::pair<const char*, CacheablePtr>(fieldName, cacheableObject));
+ std::pair<const char*, std::shared_ptr<Cacheable>>(fieldName, cacheableObject));
return shared_from_this();
-}
-
-PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeFloatArray(
+ }
+ std::shared_ptr<PdxInstanceFactory> PdxInstanceFactoryImpl::writeFloatArray(
const char* fieldName, float* value, int32_t length) {
isFieldAdded(fieldName);
m_pdxType->addVariableLengthTypeField(fieldName, "float[]",
PdxFieldTypes::FLOAT_ARRAY);
- CacheablePtr cacheableObject = CacheableFloatArray::create(value, length);
- m_FieldVsValues.insert(
- std::pair<const char*, CacheablePtr>(fieldName, cacheableObject));
- return shared_from_this();
-}
-
-PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeDoubleArray(
- const char* fieldName, double* value, int32_t length) {
- isFieldAdded(fieldName);
- m_pdxType->addVariableLengthTypeField(fieldName, "double[]",
- PdxFieldTypes::DOUBLE_ARRAY);
- CacheablePtr cacheableObject = CacheableDoubleArray::create(value, length);
- m_FieldVsValues.insert(
- std::pair<const char*, CacheablePtr>(fieldName, cacheableObject));
- return shared_from_this();
-}
-
-PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeStringArray(
- const char* fieldName, char** value, int32_t length) {
- isFieldAdded(fieldName);
- m_pdxType->addVariableLengthTypeField(fieldName, "string[]",
- PdxFieldTypes::STRING_ARRAY);
- CacheableStringPtr* ptrArr = nullptr;
- if (length > 0) {
- ptrArr = new CacheableStringPtr[length];
- for (int32_t i = 0; i < length; i++) {
- ptrArr[i] = CacheableString::create(value[i]);
- }
- }
- if (length > 0) {
- CacheablePtr cacheableObject = CacheableStringArray::create(ptrArr, length);
- m_FieldVsValues.insert(
- std::pair<const char*, CacheablePtr>(fieldName, cacheableObject));
- }
- /* adongre - Coverity II
- * CID 29199: Resource leak (RESOURCE_LEAK)
- */
- if (ptrArr) {
- delete[] ptrArr;
- }
+ auto cacheableObject = CacheableFloatArray::create(value, length);
+ m_FieldVsValues.insert(std::pair<const char*, std::shared_ptr<Cacheable>>(
+ fieldName, cacheableObject));
return shared_from_this();
+ }
+ std::shared_ptr<PdxInstanceFactory> PdxInstanceFactoryImpl::writeDoubleArray(
+ const char* fieldName, double* value, int32_t length) {
+ isFieldAdded(fieldName);
+ m_pdxType->addVariableLengthTypeField(fieldName, "double[]",
+ PdxFieldTypes::DOUBLE_ARRAY);
+ auto cacheableObject = CacheableDoubleArray::create(value, length);
+ m_FieldVsValues.insert(std::pair<const char*, std::shared_ptr<Cacheable>>(
+ fieldName, cacheableObject));
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxInstanceFactory> PdxInstanceFactoryImpl::writeStringArray(
+ const char* fieldName, char** value, int32_t length) {
+ isFieldAdded(fieldName);
+ m_pdxType->addVariableLengthTypeField(fieldName, "string[]",
+ PdxFieldTypes::STRING_ARRAY);
+ std::shared_ptr<CacheableString>* ptrArr = nullptr;
+ if (length > 0) {
+ ptrArr = new std::shared_ptr<CacheableString>[length];
+ for (int32_t i = 0; i < length; i++) {
+ ptrArr[i] = CacheableString::create(value[i]);
+ }
+ }
+ if (length > 0) {
+ auto cacheableObject = CacheableStringArray::create(ptrArr, length);
+ m_FieldVsValues.insert(std::pair<const char*, std::shared_ptr<Cacheable>>(
+ fieldName, cacheableObject));
+ }
+ /* adongre - Coverity II
+ * CID 29199: Resource leak (RESOURCE_LEAK)
+ */
+ if (ptrArr) {
+ delete[] ptrArr;
+ }
+ return shared_from_this();
}
-
-PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeWideStringArray(
+ std::shared_ptr<PdxInstanceFactory> PdxInstanceFactoryImpl::writeWideStringArray(
const char* fieldName, wchar_t** value, int32_t length) {
isFieldAdded(fieldName);
m_pdxType->addVariableLengthTypeField(fieldName, "string[]",
PdxFieldTypes::STRING_ARRAY);
- CacheableStringPtr* ptrArr = nullptr;
+ std::shared_ptr<CacheableString>* ptrArr = nullptr;
if (length > 0) {
- ptrArr = new CacheableStringPtr[length];
+ ptrArr = new std::shared_ptr<CacheableString>[length];
for (int32_t i = 0; i < length; i++) {
ptrArr[i] = CacheableString::create(value[i]);
}
}
if (length > 0) {
- CacheablePtr cacheableObject = CacheableStringArray::create(ptrArr, length);
+ auto cacheableObject = CacheableStringArray::create(ptrArr, length);
m_FieldVsValues.insert(
- std::pair<const char*, CacheablePtr>(fieldName, cacheableObject));
+ std::pair<const char*, std::shared_ptr<Cacheable>>(fieldName, cacheableObject));
}
/* adongre - Coverity II
* CID 29200: Resource leak (RESOURCE_LEAK)
@@ -347,68 +323,65 @@ PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeWideStringArray(
delete[] ptrArr;
}
return shared_from_this();
-}
-
-PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeDate(
- const char* fieldName, CacheableDatePtr value) {
+ }
+ std::shared_ptr<PdxInstanceFactory> PdxInstanceFactoryImpl::writeDate(
+ const char* fieldName, std::shared_ptr<CacheableDate> value) {
isFieldAdded(fieldName);
m_pdxType->addFixedLengthTypeField(fieldName, "Date", PdxFieldTypes::DATE,
PdxTypes::DATE_SIZE /*+ 1*/);
m_FieldVsValues.insert(
- std::pair<const char*, CacheablePtr>(fieldName, value));
+ std::pair<const char*, std::shared_ptr<Cacheable>>(fieldName, value));
return shared_from_this();
}
-
-PdxInstanceFactoryPtr PdxInstanceFactoryImpl::writeArrayOfByteArrays(
+ std::shared_ptr<PdxInstanceFactory> PdxInstanceFactoryImpl::writeArrayOfByteArrays(
const char* fieldName, int8_t** value, int32_t arrayLength,
int32_t* elementLength) {
- isFieldAdded(fieldName);
- m_pdxType->addVariableLengthTypeField(fieldName, "byte[][]",
- PdxFieldTypes::ARRAY_OF_BYTE_ARRAYS);
- CacheableVectorPtr cacheableObject = CacheableVector::create();
- for (int i = 0; i < arrayLength; i++) {
- CacheableBytesPtr ptr = CacheableBytes::create(
- reinterpret_cast<uint8_t*>(value[i]), elementLength[i]);
- cacheableObject->push_back(ptr);
+ isFieldAdded(fieldName);
+ m_pdxType->addVariableLengthTypeField(fieldName, "byte[][]",
+ PdxFieldTypes::ARRAY_OF_BYTE_ARRAYS);
+ auto cacheableObject = CacheableVector::create();
+ for (int i = 0; i < arrayLength; i++) {
+ auto ptr = CacheableBytes::create(reinterpret_cast<uint8_t*>(value[i]),
+ elementLength[i]);
+ cacheableObject->push_back(ptr);
}
m_FieldVsValues.insert(
- std::pair<const char*, CacheablePtr>(fieldName, cacheableObject));
- return shared_from_this();
-}
-
-PdxInstanceFactoryPtr PdxInstanceFactoryImpl::markIdentityField(
- const char* fieldName) {
- PdxFieldTypePtr pfType = m_pdxType->getPdxField(fieldName);
- if (pfType == nullptr) {
- throw IllegalStateException(
- "Field must be added before calling MarkIdentityField ");
- }
- pfType->setIdentityField(true);
+ std::pair<const char*, std::shared_ptr<Cacheable>>(fieldName, cacheableObject));
return shared_from_this();
-}
-
-void PdxInstanceFactoryImpl::isFieldAdded(const char* fieldName) {
- if (fieldName == nullptr ||
- /**fieldName == '\0' ||*/ m_FieldVsValues.find(fieldName) !=
- m_FieldVsValues.end()) {
- char excpStr[256] = {0};
- /* adongre - Coverity II
- * CID 29209: Calling risky function (SECURE_CODING)[VERY RISKY]. Using
- * "sprintf" can cause a
- * buffer overflow when done incorrectly. Because sprintf() assumes an
- * arbitrarily long string,
- * callers must be careful not to overflow the actual space of the
- * destination.
- * Use snprintf() instead, or correct precision specifiers.
- * Fix : using ACE_OS::snprintf
- */
- ACE_OS::snprintf(excpStr, 256,
- "Field: %s is either already added into "
- "PdxInstanceFactory or it is null ",
- fieldName);
- throw IllegalStateException(excpStr);
- }
-}
-} // namespace client
-} // namespace geode
-} // namespace apache
+ }
+ std::shared_ptr<PdxInstanceFactory> PdxInstanceFactoryImpl::markIdentityField(
+ const char* fieldName) {
+ auto pfType = m_pdxType->getPdxField(fieldName);
+ if (pfType == nullptr) {
+ throw IllegalStateException(
+ "Field must be added before calling MarkIdentityField ");
+ }
+ pfType->setIdentityField(true);
+ return shared_from_this();
+ }
+
+ void PdxInstanceFactoryImpl::isFieldAdded(const char* fieldName) {
+ if (fieldName == nullptr ||
+ /**fieldName == '\0' ||*/ m_FieldVsValues.find(fieldName) !=
+ m_FieldVsValues.end()) {
+ char excpStr[256] = {0};
+ /* adongre - Coverity II
+ * CID 29209: Calling risky function (SECURE_CODING)[VERY RISKY]. Using
+ * "sprintf" can cause a
+ * buffer overflow when done incorrectly. Because sprintf() assumes an
+ * arbitrarily long string,
+ * callers must be careful not to overflow the actual space of the
+ * destination.
+ * Use snprintf() instead, or correct precision specifiers.
+ * Fix : using ACE_OS::snprintf
+ */
+ ACE_OS::snprintf(excpStr, 256,
+ "Field: %s is either already added into "
+ "PdxInstanceFactory or it is null ",
+ fieldName);
+ throw IllegalStateException(excpStr);
+ }
+ }
+ } // namespace client
+ } // namespace geode
+ } // namespace apache
diff --git a/cppcache/src/PdxInstanceFactoryImpl.hpp b/cppcache/src/PdxInstanceFactoryImpl.hpp
index 368562d..24537be 100644
--- a/cppcache/src/PdxInstanceFactoryImpl.hpp
+++ b/cppcache/src/PdxInstanceFactoryImpl.hpp
@@ -31,7 +31,7 @@ namespace apache {
namespace geode {
namespace client {
-typedef std::map<std::string, CacheablePtr> FieldVsValues;
+typedef std::map<std::string, std::shared_ptr<Cacheable>> FieldVsValues;
/**
* PdxInstanceFactory gives you a way to create PdxInstances.
@@ -72,8 +72,8 @@ class CPPCACHE_EXPORT PdxInstanceFactoryImpl
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeChar(const char* fieldName,
- char16_t value);
+ virtual std::shared_ptr<PdxInstanceFactory> writeChar(const char* fieldName,
+ char16_t value);
/**
* Writes the named field with the given value to the serialized form.
@@ -85,7 +85,8 @@ class CPPCACHE_EXPORT PdxInstanceFactoryImpl
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeChar(const char* fieldName, char value);
+ virtual std::shared_ptr<PdxInstanceFactory> writeChar(const char* fieldName,
+ char value);
/**
* Writes the named field with the given value to the serialized form.
@@ -97,7 +98,8 @@ class CPPCACHE_EXPORT PdxInstanceFactoryImpl
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeBoolean(const char* fieldName, bool value);
+ virtual std::shared_ptr<PdxInstanceFactory> writeBoolean(
+ const char* fieldName, bool value);
/**
* Writes the named field with the given value to the serialized form.
@@ -109,7 +111,8 @@ class CPPCACHE_EXPORT PdxInstanceFactoryImpl
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeByte(const char* fieldName, int8_t value);
+ virtual std::shared_ptr<PdxInstanceFactory> writeByte(const char* fieldName,
+ int8_t value);
/**
* Writes the named field with the given value to the serialized form.
@@ -121,8 +124,8 @@ class CPPCACHE_EXPORT PdxInstanceFactoryImpl
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeShort(const char* fieldName,
- int16_t value);
+ virtual std::shared_ptr<PdxInstanceFactory> writeShort(const char* fieldName,
+ int16_t value);
/**
* Writes the named field with the given value to the serialized form.
@@ -134,7 +137,8 @@ class CPPCACHE_EXPORT PdxInstanceFactoryImpl
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeInt(const char* fieldName, int32_t value);
+ virtual std::shared_ptr<PdxInstanceFactory> writeInt(const char* fieldName,
+ int32_t value);
/**
* Writes the named field with the given value to the serialized form.
@@ -146,7 +150,8 @@ class CPPCACHE_EXPORT PdxInstanceFactoryImpl
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeLong(const char* fieldName, int64_t value);
+ virtual std::shared_ptr<PdxInstanceFactory> writeLong(const char* fieldName,
+ int64_t value);
/**
* Writes the named field with the given value to the serialized form.
@@ -158,7 +163,8 @@ class CPPCACHE_EXPORT PdxInstanceFactoryImpl
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeFloat(const char* fieldName, float value);
+ virtual std::shared_ptr<PdxInstanceFactory> writeFloat(const char* fieldName,
+ float value);
/**
* Writes the named field with the given value to the serialized form.
@@ -170,21 +176,21 @@ class CPPCACHE_EXPORT PdxInstanceFactoryImpl
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeDouble(const char* fieldName,
- double value);
+ virtual std::shared_ptr<PdxInstanceFactory> writeDouble(const char* fieldName,
+ double value);
/**
* Writes the named field with the given value to the serialized form.
* The fields type is <code>CacheableDatePtr</code>.
- * <p>Java Date is mapped to C++ CacheableDatePtr.</p>
+ * <p>Java Date is mapped to C++ std::shared_ptr<CacheableDate>.</p>
* @param fieldName the name of the field to write
* @param value the value of the field to write
* @return this PdxInstanceFactory
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeDate(const char* fieldName,
- CacheableDatePtr value);
+ virtual std::shared_ptr<PdxInstanceFactory> writeDate(
+ const char* fieldName, std::shared_ptr<CacheableDate> value);
/**
* Writes the named field with the given value to the serialized form.
@@ -196,8 +202,8 @@ class CPPCACHE_EXPORT PdxInstanceFactoryImpl
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeWideString(const char* fieldName,
- const wchar_t* value);
+ virtual std::shared_ptr<PdxInstanceFactory> writeWideString(
+ const char* fieldName, const wchar_t* value);
/**
* Writes the named field with the given value to the serialized form.
@@ -209,13 +215,13 @@ class CPPCACHE_EXPORT PdxInstanceFactoryImpl
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeString(const char* fieldName,
- const char* value);
+ virtual std::shared_ptr<PdxInstanceFactory> writeString(const char* fieldName,
+ const char* value);
/**
* Writes the named field with the given value to the serialized form.
* The fields type is <code>CacheablePtr</code>.
- * <p>Java object is mapped to C++ CacheablePtr.</p>
+ * <p>Java object is mapped to C++ std::shared_ptr<Cacheable>.</p>
* It is best to use one of the other writeXXX methods if your field type
* will always be XXX. This method allows the field value to be anything
* that is an instance of Object. This gives you more flexibility but more
@@ -229,8 +235,8 @@ class CPPCACHE_EXPORT PdxInstanceFactoryImpl
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeObject(const char* fieldName,
- CacheablePtr value);
+ virtual std::shared_ptr<PdxInstanceFactory> writeObject(
+ const char* fieldName, std::shared_ptr<Cacheable> value);
/**
* Writes the named field with the given value to the serialized form.
@@ -243,8 +249,8 @@ class CPPCACHE_EXPORT PdxInstanceFactoryImpl
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeBooleanArray(const char* fieldName,
- bool* value, int32_t length);
+ virtual std::shared_ptr<PdxInstanceFactory> writeBooleanArray(
+ const char* fieldName, bool* value, int32_t length);
/**
* Writes the named field with the given value to the serialized form.
@@ -257,9 +263,8 @@ class CPPCACHE_EXPORT PdxInstanceFactoryImpl
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeWideCharArray(const char* fieldName,
- wchar_t* value,
- int32_t length);
+ virtual std::shared_ptr<PdxInstanceFactory> writeWideCharArray(
+ const char* fieldName, wchar_t* value, int32_t length);
/**
* Writes the named field with the given value to the serialized form.
@@ -272,8 +277,8 @@ class CPPCACHE_EXPORT PdxInstanceFactoryImpl
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeCharArray(const char* fieldName,
- char* value, int32_t length);
+ virtual std::shared_ptr<PdxInstanceFactory> writeCharArray(
+ const char* fieldName, char* value, int32_t length);
/**
* Writes the named field with the given value to the serialized form.
@@ -286,8 +291,8 @@ class CPPCACHE_EXPORT PdxInstanceFactoryImpl
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeByteArray(const char* fieldName,
- int8_t* value, int32_t length);
+ virtual std::shared_ptr<PdxInstanceFactory> writeByteArray(
+ const char* fieldName, int8_t* value, int32_t length);
/**
* Writes the named field with the given value to the serialized form.
@@ -300,8 +305,8 @@ class CPPCACHE_EXPORT PdxInstanceFactoryImpl
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeShortArray(const char* fieldName,
- int16_t* value, int32_t length);
+ virtual std::shared_ptr<PdxInstanceFactory> writeShortArray(
+ const char* fieldName, int16_t* value, int32_t length);
/**
* Writes the named field with the given value to the serialized form.
@@ -314,8 +319,8 @@ class CPPCACHE_EXPORT PdxInstanceFactoryImpl
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeIntArray(const char* fieldName,
- int32_t* value, int32_t length);
+ virtual std::shared_ptr<PdxInstanceFactory> writeIntArray(
+ const char* fieldName, int32_t* value, int32_t length);
/**
* Writes the named field with the given value to the serialized form.
@@ -328,8 +333,8 @@ class CPPCACHE_EXPORT PdxInstanceFactoryImpl
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeLongArray(const char* fieldName,
- int64_t* value, int32_t length);
+ virtual std::shared_ptr<PdxInstanceFactory> writeLongArray(
+ const char* fieldName, int64_t* value, int32_t length);
/**
* Writes the named field with the given value to the serialized form.
@@ -342,8 +347,8 @@ class CPPCACHE_EXPORT PdxInstanceFactoryImpl
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeFloatArray(const char* fieldName,
- float* value, int32_t length);
+ virtual std::shared_ptr<PdxInstanceFactory> writeFloatArray(
+ const char* fieldName, float* value, int32_t length);
/**
* Writes the named field with the given value to the serialized form.
@@ -356,8 +361,8 @@ class CPPCACHE_EXPORT PdxInstanceFactoryImpl
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeDoubleArray(const char* fieldName,
- double* value, int32_t length);
+ virtual std::shared_ptr<PdxInstanceFactory> writeDoubleArray(
+ const char* fieldName, double* value, int32_t length);
/**
* Writes the named field with the given value to the serialized form.
@@ -370,8 +375,8 @@ class CPPCACHE_EXPORT PdxInstanceFactoryImpl
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeStringArray(const char* fieldName,
- char** value, int32_t length);
+ virtual std::shared_ptr<PdxInstanceFactory> writeStringArray(
+ const char* fieldName, char** value, int32_t length);
/**
* Writes the named field with the given value to the serialized form.
@@ -384,14 +389,13 @@ class CPPCACHE_EXPORT PdxInstanceFactoryImpl
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeWideStringArray(const char* fieldName,
- wchar_t** value,
- int32_t length);
+ virtual std::shared_ptr<PdxInstanceFactory> writeWideStringArray(
+ const char* fieldName, wchar_t** value, int32_t length);
/**
* Writes the named field with the given value to the serialized form.
* The fields type is <code>CacheableObjectArrayPtr</code>.
- * Java Object[] is mapped to C++ CacheableObjectArrayPtr.
+ * Java Object[] is mapped to C++ std::shared_ptr<CacheableObjectArray>.
* For how each element of the array is a mapped to C++ see {@link
* #writeObject}.
* Note that this call may serialize elements that are not compatible with
@@ -402,8 +406,8 @@ class CPPCACHE_EXPORT PdxInstanceFactoryImpl
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeObjectArray(const char* fieldName,
- CacheableObjectArrayPtr value);
+ virtual std::shared_ptr<PdxInstanceFactory> writeObjectArray(
+ const char* fieldName, std::shared_ptr<CacheableObjectArray> value);
/**
* Writes the named field with the given value to the serialized form.
@@ -418,10 +422,9 @@ class CPPCACHE_EXPORT PdxInstanceFactoryImpl
* @throws IllegalStateException if the named field has already been written
* or fieldName is nullptr or empty.
*/
- virtual PdxInstanceFactoryPtr writeArrayOfByteArrays(const char* fieldName,
- int8_t** value,
- int32_t arrayLength,
- int32_t* elementLength);
+ virtual std::shared_ptr<PdxInstanceFactory> writeArrayOfByteArrays(
+ const char* fieldName, int8_t** value, int32_t arrayLength,
+ int32_t* elementLength);
/**
* Indicate that the named field should be included in hashCode and equals
@@ -446,18 +449,19 @@ class CPPCACHE_EXPORT PdxInstanceFactoryImpl
* @return this PdxInstanceFactory
* @throws IllegalStateException if the named field does not exist.
*/
- virtual PdxInstanceFactoryPtr markIdentityField(const char* fieldName);
+ virtual std::shared_ptr<PdxInstanceFactory> markIdentityField(
+ const char* fieldName);
PdxInstanceFactoryImpl(const char* className, CachePerfStats* cachePerfStats,
- PdxTypeRegistryPtr m_pdxTypeRegistry,
+ std::shared_ptr<PdxTypeRegistry> m_pdxTypeRegistry,
const Cache* cache, bool enableTimeStatistics);
private:
bool m_created;
- PdxTypePtr m_pdxType;
+ std::shared_ptr<PdxType> m_pdxType;
FieldVsValues m_FieldVsValues;
CachePerfStats* m_cachePerfStats;
- PdxTypeRegistryPtr m_pdxTypeRegistry;
+ std::shared_ptr<PdxTypeRegistry> m_pdxTypeRegistry;
const Cache* m_cache;
bool m_enableTimeStatistics;
void isFieldAdded(const char* fieldName);
diff --git a/cppcache/src/PdxInstanceImpl.cpp b/cppcache/src/PdxInstanceImpl.cpp
index 7c6a19e..68cb5fc 100644
--- a/cppcache/src/PdxInstanceImpl.cpp
+++ b/cppcache/src/PdxInstanceImpl.cpp
@@ -60,11 +60,12 @@ int8_t PdxInstanceImpl::m_StringDefaultBytes[] = {
int8_t PdxInstanceImpl::m_ObjectDefaultBytes[] = {
apache::geode::client::GeodeTypeIds::NullObj};
int8_t PdxInstanceImpl::m_NULLARRAYDefaultBytes[] = {-1};
-PdxFieldTypePtr PdxInstanceImpl::m_DefaultPdxFieldType(
+std::shared_ptr<PdxFieldType> PdxInstanceImpl::m_DefaultPdxFieldType(
new PdxFieldType("default", "default", static_cast<uint8_t>(-1),
-1 /*field index*/, false, 1, -1 /*var len field idx*/));
-bool sortFunc(PdxFieldTypePtr field1, PdxFieldTypePtr field2) {
+bool sortFunc(std::shared_ptr<PdxFieldType> field1,
+ std::shared_ptr<PdxFieldType> field2) {
int diff = ACE_OS::strcmp(field1->getFieldName(), field2->getFieldName());
if (diff < 0) {
return true;
@@ -77,8 +78,9 @@ PdxInstanceImpl::~PdxInstanceImpl() { GF_SAFE_DELETE_ARRAY(m_buffer); }
PdxInstanceImpl::PdxInstanceImpl(
apache::geode::client::FieldVsValues fieldVsValue,
- apache::geode::client::PdxTypePtr pdxType, CachePerfStats* cacheStats,
- PdxTypeRegistryPtr pdxTypeRegistry, const Cache* cache,
+ std::shared_ptr<apache::geode::client::PdxType> pdxType,
+ CachePerfStats* cacheStats,
+ std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry, const Cache* cache,
bool enableTimeStatistics)
: m_pdxType(pdxType),
m_updatedFields(fieldVsValue),
@@ -92,8 +94,9 @@ PdxInstanceImpl::PdxInstanceImpl(
m_pdxType->InitializeType(); // to generate static position map
}
-void PdxInstanceImpl::writeField(PdxWriterPtr writer, const char* fieldName,
- int typeId, CacheablePtr value) {
+void PdxInstanceImpl::writeField(std::shared_ptr<PdxWriter> writer,
+ const char* fieldName, int typeId,
+ std::shared_ptr<Cacheable> value) {
switch (typeId) {
case PdxFieldTypes::INT: {
CacheableInt32* val = dynamic_cast<CacheableInt32*>(value.get());
@@ -254,15 +257,14 @@ void PdxInstanceImpl::writeField(PdxWriterPtr writer, const char* fieldName,
break;
}
case PdxFieldTypes::DATE: {
- CacheableDatePtr date = std::dynamic_pointer_cast<CacheableDate>(value);
+ auto date = std::dynamic_pointer_cast<CacheableDate>(value);
if (date != nullptr) {
writer->writeDate(fieldName, date);
}
break;
}
case PdxFieldTypes::ARRAY_OF_BYTE_ARRAYS: {
- CacheableVectorPtr vector =
- std::dynamic_pointer_cast<CacheableVector>(value);
+ auto vector = std::dynamic_pointer_cast<CacheableVector>(value);
if (vector != nullptr) {
auto size = vector->size();
@@ -292,8 +294,7 @@ void PdxInstanceImpl::writeField(PdxWriterPtr writer, const char* fieldName,
default: { writer->writeObject(fieldName, value); }
}
}
-
-WritablePdxInstancePtr PdxInstanceImpl::createWriter() {
+std::shared_ptr<WritablePdxInstance> PdxInstanceImpl::createWriter() {
LOGDEBUG("PdxInstanceImpl::createWriter m_bufferLength = %d m_typeId = %d ",
m_bufferLength, m_typeId);
return std::make_shared<PdxInstanceImpl>(
@@ -303,7 +304,8 @@ WritablePdxInstancePtr PdxInstanceImpl::createWriter() {
}
bool PdxInstanceImpl::enumerateObjectArrayEquals(
- CacheableObjectArrayPtr Obj, CacheableObjectArrayPtr OtherObj) {
+ std::shared_ptr<CacheableObjectArray> Obj,
+ std::shared_ptr<CacheableObjectArray> OtherObj) {
if (Obj == nullptr && OtherObj == nullptr) {
return true;
} else if (Obj == nullptr && OtherObj != nullptr) {
@@ -324,8 +326,9 @@ bool PdxInstanceImpl::enumerateObjectArrayEquals(
return true;
}
-bool PdxInstanceImpl::enumerateVectorEquals(CacheableVectorPtr Obj,
- CacheableVectorPtr OtherObj) {
+bool PdxInstanceImpl::enumerateVectorEquals(
+ std::shared_ptr<CacheableVector> Obj,
+ std::shared_ptr<CacheableVector> OtherObj) {
if (Obj == nullptr && OtherObj == nullptr) {
return true;
} else if (Obj == nullptr && OtherObj != nullptr) {
@@ -346,8 +349,9 @@ bool PdxInstanceImpl::enumerateVectorEquals(CacheableVectorPtr Obj,
return true;
}
-bool PdxInstanceImpl::enumerateArrayListEquals(CacheableArrayListPtr Obj,
- CacheableArrayListPtr OtherObj) {
+bool PdxInstanceImpl::enumerateArrayListEquals(
+ std::shared_ptr<CacheableArrayList> Obj,
+ std::shared_ptr<CacheableArrayList> OtherObj) {
if (Obj == nullptr && OtherObj == nullptr) {
return true;
} else if (Obj == nullptr && OtherObj != nullptr) {
@@ -368,8 +372,9 @@ bool PdxInstanceImpl::enumerateArrayListEquals(CacheableArrayListPtr Obj,
return true;
}
-bool PdxInstanceImpl::enumerateMapEquals(CacheableHashMapPtr Obj,
- CacheableHashMapPtr OtherObj) {
+bool PdxInstanceImpl::enumerateMapEquals(
+ std::shared_ptr<CacheableHashMap> Obj,
+ std::shared_ptr<CacheableHashMap> OtherObj) {
if (Obj == nullptr && OtherObj == nullptr) {
return true;
} else if (Obj == nullptr && OtherObj != nullptr) {
@@ -395,8 +400,9 @@ bool PdxInstanceImpl::enumerateMapEquals(CacheableHashMapPtr Obj,
return true;
}
-bool PdxInstanceImpl::enumerateHashTableEquals(CacheableHashTablePtr Obj,
- CacheableHashTablePtr OtherObj) {
+bool PdxInstanceImpl::enumerateHashTableEquals(
+ std::shared_ptr<CacheableHashTable> Obj,
+ std::shared_ptr<CacheableHashTable> OtherObj) {
if (Obj == nullptr && OtherObj == nullptr) {
return true;
} else if (Obj == nullptr && OtherObj != nullptr) {
@@ -422,8 +428,9 @@ bool PdxInstanceImpl::enumerateHashTableEquals(CacheableHashTablePtr Obj,
return true;
}
-bool PdxInstanceImpl::enumerateSetEquals(CacheableHashSetPtr Obj,
- CacheableHashSetPtr OtherObj) {
+bool PdxInstanceImpl::enumerateSetEquals(
+ std::shared_ptr<CacheableHashSet> Obj,
+ std::shared_ptr<CacheableHashSet> OtherObj) {
if (Obj == nullptr && OtherObj == nullptr) {
return true;
} else if (Obj == nullptr && OtherObj != nullptr) {
@@ -444,7 +451,8 @@ bool PdxInstanceImpl::enumerateSetEquals(CacheableHashSetPtr Obj,
}
bool PdxInstanceImpl::enumerateLinkedSetEquals(
- CacheableLinkedHashSetPtr Obj, CacheableLinkedHashSetPtr OtherObj) {
+ std::shared_ptr<CacheableLinkedHashSet> Obj,
+ std::shared_ptr<CacheableLinkedHashSet> OtherObj) {
if (Obj == nullptr && OtherObj == nullptr) {
return true;
} else if (Obj == nullptr && OtherObj != nullptr) {
@@ -464,7 +472,8 @@ bool PdxInstanceImpl::enumerateLinkedSetEquals(
return true;
}
-bool PdxInstanceImpl::deepArrayEquals(CacheablePtr obj, CacheablePtr otherObj) {
+bool PdxInstanceImpl::deepArrayEquals(std::shared_ptr<Cacheable> obj,
+ std::shared_ptr<Cacheable> otherObj) {
if (obj == nullptr && otherObj == nullptr) {
return true;
} else if (obj == nullptr && otherObj != nullptr) {
@@ -521,7 +530,7 @@ bool PdxInstanceImpl::deepArrayEquals(CacheablePtr obj, CacheablePtr otherObj) {
if (pdxInstPtr != nullptr && otherPdxInstPtr != nullptr) {
return (*pdxInstPtr.get() == *otherPdxInstPtr.get());
}
- // Chk if it is of CacheableKeyPtr type, eg: CacheableInt32
+ // Chk if it is of std::shared_ptr<CacheableKey> type, eg: CacheableInt32
else {
auto keyType = std::dynamic_pointer_cast<CacheableKey>(obj);
auto otherKeyType = std::dynamic_pointer_cast<CacheableKey>(otherObj);
@@ -550,7 +559,8 @@ bool PdxInstanceImpl::deepArrayEquals(CacheablePtr obj, CacheablePtr otherObj) {
}
}
-int PdxInstanceImpl::enumerateMapHashCode(CacheableHashMapPtr map) {
+int PdxInstanceImpl::enumerateMapHashCode(
+ std::shared_ptr<CacheableHashMap> map) {
int h = 0;
for (const auto& itr : *map) {
h = h + ((deepArrayHashCode(itr.first)) ^
@@ -559,7 +569,8 @@ int PdxInstanceImpl::enumerateMapHashCode(CacheableHashMapPtr map) {
return h;
}
-int PdxInstanceImpl::enumerateSetHashCode(CacheableHashSetPtr set) {
+int PdxInstanceImpl::enumerateSetHashCode(
+ std::shared_ptr<CacheableHashSet> set) {
int h = 0;
for (const auto& itr : *set) {
h = h + deepArrayHashCode(itr);
@@ -567,7 +578,8 @@ int PdxInstanceImpl::enumerateSetHashCode(CacheableHashSetPtr set) {
return h;
}
-int PdxInstanceImpl::enumerateLinkedSetHashCode(CacheableLinkedHashSetPtr set) {
+int PdxInstanceImpl::enumerateLinkedSetHashCode(
+ std::shared_ptr<CacheableLinkedHashSet> set) {
int h = 0;
for (const auto& itr : *set) {
h = h + deepArrayHashCode(itr);
@@ -575,7 +587,8 @@ int PdxInstanceImpl::enumerateLinkedSetHashCode(CacheableLinkedHashSetPtr set) {
return h;
}
-int PdxInstanceImpl::enumerateHashTableCode(CacheableHashTablePtr hashTable) {
+int PdxInstanceImpl::enumerateHashTableCode(
+ std::shared_ptr<CacheableHashTable> hashTable) {
int h = 0;
for (const auto& itr : *hashTable) {
h = h + ((deepArrayHashCode(itr.first)) ^
@@ -585,7 +598,7 @@ int PdxInstanceImpl::enumerateHashTableCode(CacheableHashTablePtr hashTable) {
}
int PdxInstanceImpl::enumerateObjectArrayHashCode(
- CacheableObjectArrayPtr objArray) {
+ std::shared_ptr<CacheableObjectArray> objArray) {
int h = 1;
for (int i = 0; i < objArray->size(); i++) {
h = h * 31 + deepArrayHashCode(objArray->at(i));
@@ -593,7 +606,8 @@ int PdxInstanceImpl::enumerateObjectArrayHashCode(
return h;
}
-int PdxInstanceImpl::enumerateVectorHashCode(CacheableVectorPtr vec) {
+int PdxInstanceImpl::enumerateVectorHashCode(
+ std::shared_ptr<CacheableVector> vec) {
int h = 1;
for (int i = 0; i < vec->size(); i++) {
h = h * 31 + deepArrayHashCode(vec->at(i));
@@ -601,7 +615,8 @@ int PdxInstanceImpl::enumerateVectorHashCode(CacheableVectorPtr vec) {
return h;
}
-int PdxInstanceImpl::enumerateArrayListHashCode(CacheableArrayListPtr arrList) {
+int PdxInstanceImpl::enumerateArrayListHashCode(
+ std::shared_ptr<CacheableArrayList> arrList) {
int h = 1;
for (int i = 0; i < arrList->size(); i++) {
h = h * 31 + deepArrayHashCode(arrList->at(i));
@@ -610,7 +625,7 @@ int PdxInstanceImpl::enumerateArrayListHashCode(CacheableArrayListPtr arrList) {
}
int PdxInstanceImpl::enumerateLinkedListHashCode(
- CacheableLinkedListPtr linkedList) {
+ std::shared_ptr<CacheableLinkedList> linkedList) {
int h = 1;
for (int i = 0; i < linkedList->size(); i++) {
h = h * 31 + deepArrayHashCode(linkedList->at(i));
@@ -618,7 +633,7 @@ int PdxInstanceImpl::enumerateLinkedListHashCode(
return h;
}
-int PdxInstanceImpl::deepArrayHashCode(CacheablePtr obj) {
+int PdxInstanceImpl::deepArrayHashCode(std::shared_ptr<Cacheable> obj) {
if (obj == nullptr) {
return 0;
}
@@ -650,7 +665,7 @@ int PdxInstanceImpl::deepArrayHashCode(CacheablePtr obj) {
std::dynamic_pointer_cast<CacheableHashSet>(obj));
}
case GeodeTypeIds::CacheableLinkedHashSet: {
- CacheableLinkedHashSetPtr linkedHashSet =
+ auto linkedHashSet =
std::dynamic_pointer_cast<CacheableLinkedHashSet>(obj);
return enumerateLinkedSetHashCode(linkedHashSet);
}
@@ -663,7 +678,8 @@ int PdxInstanceImpl::deepArrayHashCode(CacheablePtr obj) {
if (pdxInstPtr != nullptr) {
return pdxInstPtr->hashcode();
} else {
- // Chk if it is of CacheableKeyPtr type, eg: CacheableInt32
+ // Chk if it is of std::shared_ptr<CacheableKey> type, eg:
+ // CacheableInt32
auto keyType = std::dynamic_pointer_cast<CacheableKey>(obj);
if (keyType != nullptr) {
return keyType->hashcode();
@@ -694,14 +710,14 @@ int PdxInstanceImpl::deepArrayHashCode(CacheablePtr obj) {
int32_t PdxInstanceImpl::hashcode() const {
int hashCode = 1;
- PdxTypePtr pt = getPdxType();
+ auto pt = getPdxType();
- std::vector<PdxFieldTypePtr> pdxIdentityFieldList = getIdentityPdxFields(pt);
+ auto pdxIdentityFieldList = getIdentityPdxFields(pt);
auto dataInput = m_cache->createDataInput(m_buffer, m_bufferLength);
for (uint32_t i = 0; i < pdxIdentityFieldList.size(); i++) {
- PdxFieldTypePtr pField = pdxIdentityFieldList.at(i);
+ auto pField = pdxIdentityFieldList.at(i);
LOGDEBUG("hashcode for pdxfield %s hashcode is %d ",
pField->getFieldName(), hashCode);
@@ -732,7 +748,7 @@ int32_t PdxInstanceImpl::hashcode() const {
}
case PdxFieldTypes::OBJECT: {
setOffsetForObject(*dataInput, pt, pField->getSequenceId());
- CacheablePtr object = nullptr;
+ std::shared_ptr<Cacheable> object = nullptr;
dataInput->readObject(object);
if (object != nullptr) {
hashCode = 31 * hashCode + deepArrayHashCode(object);
@@ -741,7 +757,7 @@ int32_t PdxInstanceImpl::hashcode() const {
}
case PdxFieldTypes::OBJECT_ARRAY: {
setOffsetForObject(*dataInput, pt, pField->getSequenceId());
- CacheableObjectArrayPtr objectArray = CacheableObjectArray::create();
+ auto objectArray = CacheableObjectArray::create();
objectArray->fromData(*dataInput);
hashCode =
31 * hashCode +
@@ -773,8 +789,7 @@ void PdxInstanceImpl::updatePdxStream(uint8_t* newPdxStream, int len) {
m_buffer = DataInput::getBufferCopy(newPdxStream, len);
m_bufferLength = len;
}
-
-PdxTypePtr PdxInstanceImpl::getPdxType() const {
+std::shared_ptr<PdxType> PdxInstanceImpl::getPdxType() const {
if (m_typeId == 0) {
if (m_pdxType == nullptr) {
throw IllegalStateException("PdxType should not be null..");
@@ -786,18 +801,18 @@ PdxTypePtr PdxInstanceImpl::getPdxType() const {
}
bool PdxInstanceImpl::isIdentityField(const char* fieldname) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldname);
- if (pft != nullptr) {
- return pft->getIdentityField();
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldname);
+ if (pft != nullptr) {
+ return pft->getIdentityField();
}
return false;
}
bool PdxInstanceImpl::hasField(const char* fieldname) {
- PdxTypePtr pf = getPdxType();
- PdxFieldTypePtr pft = pf->getPdxField(fieldname);
- return (pft != nullptr);
+ auto pf = getPdxType();
+ auto pft = pf->getPdxField(fieldname);
+ return (pft != nullptr);
}
bool PdxInstanceImpl::getBooleanField(const char* fieldname) const {
@@ -929,339 +944,333 @@ void PdxInstanceImpl::getField(const char* fieldname, char*** value,
auto dataInput = getDataInputForField(fieldname);
dataInput->readStringArray(value, length);
}
-
-CacheableDatePtr PdxInstanceImpl::getCacheableDateField(
+std::shared_ptr<CacheableDate> PdxInstanceImpl::getCacheableDateField(
const char* fieldname) const {
auto dataInput = getDataInputForField(fieldname);
auto value = CacheableDate::create();
value->fromData(*dataInput);
return value;
}
-
-CacheablePtr PdxInstanceImpl::getCacheableField(const char* fieldname) const {
+ std::shared_ptr<Cacheable> PdxInstanceImpl::getCacheableField(const char* fieldname) const {
auto dataInput = getDataInputForField(fieldname);
- CacheablePtr value;
+ std::shared_ptr<Cacheable> value;
dataInput->readObject(value);
return value;
-}
-
-CacheableObjectArrayPtr PdxInstanceImpl::getCacheableObjectArrayField(
- const char* fieldname) const {
- auto dataInput = getDataInputForField(fieldname);
- auto value = CacheableObjectArray::create();
- value->fromData(*dataInput);
- return value;
-}
-
-void PdxInstanceImpl::getField(const char* fieldname, int8_t*** value,
- int32_t& arrayLength,
- int32_t*& elementLength) const {
- auto dataInput = getDataInputForField(fieldname);
- dataInput->readArrayOfByteArrays(value, arrayLength, &elementLength);
-}
-
-CacheableStringPtr PdxInstanceImpl::toString() const {
- /* adongre - Coverity II
- * CID 29265: Calling risky function (SECURE_CODING)[VERY RISKY]. Using
- * "sprintf" can cause a
- * buffer overflow when done incorrectly. Because sprintf() assumes an
- * arbitrarily long string,
- * callers must be careful not to overflow the actual space of the
- * destination. Use snprintf() instead, or correct precision specifiers. Fix :
- * using ACE_OS::snprintf
- */
- PdxTypePtr pt = getPdxType();
- std::string toString = "PDX[";
- char buf[2048];
- ACE_OS::snprintf(buf, 2048, "%d", pt->getTypeId());
- toString += buf;
- toString += ",";
- ACE_OS::snprintf(buf, 2048, "%s", pt->getPdxClassName());
- toString += buf;
- toString += "]{";
- bool firstElement = true;
- std::vector<PdxFieldTypePtr> identityFields = getIdentityPdxFields(pt);
- for (size_t i = 0; i < static_cast<int>(identityFields.size()); i++) {
- if (firstElement) {
- firstElement = false;
- } else {
- toString += ",";
- }
- ACE_OS::snprintf(buf, 2048, "%s", identityFields.at(i)->getFieldName());
- toString += buf;
- toString += "=";
-
- switch (identityFields.at(i)->getTypeId()) {
- case PdxFieldTypes::BOOLEAN: {
- bool value = getBooleanField(identityFields.at(i)->getFieldName());
- ACE_OS::snprintf(buf, 2048, "%s", value ? "true" : "false");
- toString += buf;
- break;
- }
- case PdxFieldTypes::BYTE: {
- signed char value = getByteField(identityFields.at(i)->getFieldName());
- ACE_OS::snprintf(buf, 2048, "%d", value);
- toString += buf;
- break;
- }
- case PdxFieldTypes::SHORT: {
- int16_t value = getShortField(identityFields.at(i)->getFieldName());
- ACE_OS::snprintf(buf, 2048, "%d", value);
- toString += buf;
- break;
- }
- case PdxFieldTypes::INT: {
- int32_t value = getIntField(identityFields.at(i)->getFieldName());
- ACE_OS::snprintf(buf, 2048, "%d", value);
- toString += buf;
- break;
- }
- case PdxFieldTypes::LONG: {
- int64_t value = getLongField(identityFields.at(i)->getFieldName());
- ACE_OS::snprintf(buf, 2048, "%lld", value);
- toString += buf;
- break;
- }
- case PdxFieldTypes::FLOAT: {
- float value = getFloatField(identityFields.at(i)->getFieldName());
- ACE_OS::snprintf(buf, 2048, "%f", value);
- toString += buf;
- break;
- }
- case PdxFieldTypes::DOUBLE: {
- double value = getDoubleField(identityFields.at(i)->getFieldName());
- ACE_OS::snprintf(buf, 2048, "%f", value);
- toString += buf;
- break;
- }
- case PdxFieldTypes::CHAR: {
- auto value = getCharField(identityFields.at(i)->getFieldName());
- ACE_OS::snprintf(buf, 2048, "%c", value);
- toString += buf;
- break;
- }
- case PdxFieldTypes::STRING: {
- wchar_t* value = 0;
- getField(identityFields.at(i)->getFieldName(), &value);
- ACE_OS::snprintf(buf, 2048, "%ls", value);
- toString += buf;
- break;
- }
- case PdxFieldTypes::CHAR_ARRAY: {
- wchar_t* value = 0;
- int32_t length;
- getField(identityFields.at(i)->getFieldName(), &value, length);
- if (length > 0) {
- for (int i = 0; i < length; i++) {
- ACE_OS::snprintf(buf, 2048, "%c\t", value[i]);
- toString += buf;
- }
- GF_SAFE_DELETE_ARRAY(value);
- }
- break;
- }
- case PdxFieldTypes::STRING_ARRAY: {
- wchar_t** value = 0;
- int32_t length;
- getField(identityFields.at(i)->getFieldName(), &value, length);
- if (length > 0) {
- for (int i = 0; i < length; i++) {
- ACE_OS::snprintf(buf, 2048, "%ls\t", value[i]);
- toString += buf;
- }
- }
- break;
- }
- case PdxFieldTypes::BYTE_ARRAY: {
- signed char* value = 0;
- int32_t length;
- getField(identityFields.at(i)->getFieldName(), &value, length);
- if (length > 0) {
- for (int i = 0; i < length; i++) {
- ACE_OS::snprintf(buf, 2048, "%d\t", value[i]);
- toString += buf;
- }
- GF_SAFE_DELETE_ARRAY(value);
- }
- break;
- }
- case PdxFieldTypes::SHORT_ARRAY: {
- int16_t* value = 0;
- int32_t length;
- getField(identityFields.at(i)->getFieldName(), &value, length);
- if (length > 0) {
- for (int i = 0; i < length; i++) {
- ACE_OS::snprintf(buf, 2048, "%d\t", value[i]);
- toString += buf;
- }
- GF_SAFE_DELETE_ARRAY(value);
- }
- break;
- }
- case PdxFieldTypes::INT_ARRAY: {
- int32_t* value = 0;
- int32_t length;
- getField(identityFields.at(i)->getFieldName(), &value, length);
- if (length > 0) {
- for (int i = 0; i < length; i++) {
- ACE_OS::snprintf(buf, 2048, "%d\t", value[i]);
- toString += buf;
- }
- GF_SAFE_DELETE_ARRAY(value);
- }
- break;
- }
- case PdxFieldTypes::LONG_ARRAY: {
- int64_t* value = 0;
- int32_t length;
- getField(identityFields.at(i)->getFieldName(), &value, length);
- if (length > 0) {
- for (int i = 0; i < length; i++) {
- ACE_OS::snprintf(buf, 2048, "%lld\t", value[i]);
- toString += buf;
- }
- }
- break;
- }
- case PdxFieldTypes::FLOAT_ARRAY: {
- float* value = 0;
- int32_t length;
- getField(identityFields.at(i)->getFieldName(), &value, length);
- if (length > 0) {
- for (int i = 0; i < length; i++) {
- ACE_OS::snprintf(buf, 2048, "%f\t", value[i]);
- toString += buf;
- }
- GF_SAFE_DELETE_ARRAY(value);
- }
- break;
- }
- case PdxFieldTypes::DOUBLE_ARRAY: {
- double* value = 0;
- int32_t length;
- getField(identityFields.at(i)->getFieldName(), &value, length);
- if (length > 0) {
- for (int i = 0; i < length; i++) {
- ACE_OS::snprintf(buf, 2048, "%f\t", value[i]);
- toString += buf;
- }
- }
- break;
- }
- case PdxFieldTypes::DATE: {
- CacheableDatePtr value =
- getCacheableDateField(identityFields.at(i)->getFieldName());
- if (value != nullptr) {
- ACE_OS::snprintf(buf, 2048, "%s", value->toString()->asChar());
- toString += buf;
- }
- break;
- }
- case PdxFieldTypes::BOOLEAN_ARRAY: {
- bool* value = 0;
- int32_t length;
- getField(identityFields.at(i)->getFieldName(), &value, length);
- if (length > 0) {
- for (int i = 0; i < length; i++) {
- ACE_OS::snprintf(buf, 2048, "%s\t", value[i] ? "true" : "false");
- toString += buf;
- }
- GF_SAFE_DELETE_ARRAY(value);
- }
- break;
- }
- case PdxFieldTypes::ARRAY_OF_BYTE_ARRAYS: {
- int8_t** value = 0;
- int32_t arrayLength;
- int32_t* elementLength;
- getField(identityFields.at(i)->getFieldName(), &value, arrayLength,
- elementLength);
- if (arrayLength > 0) {
- for (int j = 0; j < arrayLength; j++) {
- for (int k = 0; k < elementLength[j]; k++) {
- ACE_OS::snprintf(buf, 2048, "%d\t", value[j][k]);
- toString += buf;
- }
- }
- }
- break;
- }
- case PdxFieldTypes::OBJECT_ARRAY: {
- CacheableObjectArrayPtr value =
- getCacheableObjectArrayField(identityFields.at(i)->getFieldName());
- if (value != nullptr) {
- ACE_OS::snprintf(buf, 2048, "%s\t", value->toString()->asChar());
- toString += buf;
- }
- break;
- }
- default: {
- CacheablePtr value =
- getCacheableField(identityFields.at(i)->getFieldName());
- if (value != nullptr) {
- ACE_OS::snprintf(buf, 2048, "%s\t", value->toString()->asChar());
- toString += buf;
- }
- }
- }
- }
- toString += "}";
-
- return CacheableString::create(toString.c_str());
-}
-
-PdxSerializablePtr PdxInstanceImpl::getObject() {
- auto dataInput = m_cache->createDataInput(m_buffer, m_bufferLength);
- int64_t sampleStartNanos =
- m_enableTimeStatistics ? Utils::startStatOpTime() : 0;
- //[ToDo] do we have to call incPdxDeSerialization here?
- PdxSerializablePtr ret =
- PdxHelper::deserializePdx(*dataInput, true, m_typeId, m_bufferLength);
-
- if (m_cacheStats != nullptr) {
- if (m_enableTimeStatistics) {
- Utils::updateStatOpTime(
- m_cacheStats->getStat(),
- m_cacheStats->getPdxInstanceDeserializationTimeId(),
- sampleStartNanos);
- }
- m_cacheStats->incPdxInstanceDeserializations();
- }
- return ret;
-}
-
-void PdxInstanceImpl::equatePdxFields(
- std::vector<PdxFieldTypePtr>& my,
- std::vector<PdxFieldTypePtr>& other) const {
- int otherIdx = -1;
- for (int32_t i = 0; i < static_cast<int32_t>(my.size()); i++) {
- PdxFieldTypePtr myF = my.at(i);
- if (!myF->equals(m_DefaultPdxFieldType)) {
- for (int32_t j = 0; j < static_cast<int32_t>(other.size()); j++) {
- if (myF->equals(other[j])) {
- otherIdx = j;
- break;
- } else {
- otherIdx = -1;
- }
- }
-
- if (otherIdx == -1) // field not there
- {
- if (i < static_cast<int32_t>(other.size())) {
- PdxFieldTypePtr tmp = other.at(i);
- other.at(i) = m_DefaultPdxFieldType;
- other.push_back(tmp);
- } else {
- other.push_back(m_DefaultPdxFieldType);
- }
- } else if (otherIdx != i) {
- PdxFieldTypePtr tmp = other.at(i);
- other.at(i) = other.at(otherIdx);
- other.at(otherIdx) = tmp;
- }
- }
- }
+ }
+ std::shared_ptr<CacheableObjectArray>
+ PdxInstanceImpl::getCacheableObjectArrayField(const char* fieldname) const {
+ auto dataInput = getDataInputForField(fieldname);
+ auto value = CacheableObjectArray::create();
+ value->fromData(*dataInput);
+ return value;
+ }
+
+ void PdxInstanceImpl::getField(const char* fieldname, int8_t*** value,
+ int32_t& arrayLength,
+ int32_t*& elementLength) const {
+ auto dataInput = getDataInputForField(fieldname);
+ dataInput->readArrayOfByteArrays(value, arrayLength, &elementLength);
+ }
+ std::shared_ptr<CacheableString> PdxInstanceImpl::toString() const {
+ /* adongre - Coverity II
+ * CID 29265: Calling risky function (SECURE_CODING)[VERY RISKY]. Using
+ * "sprintf" can cause a
+ * buffer overflow when done incorrectly. Because sprintf() assumes an
+ * arbitrarily long string,
+ * callers must be careful not to overflow the actual space of the
+ * destination. Use snprintf() instead, or correct precision specifiers. Fix
+ * : using ACE_OS::snprintf
+ */
+ auto pt = getPdxType();
+ std::string toString = "PDX[";
+ char buf[2048];
+ ACE_OS::snprintf(buf, 2048, "%d", pt->getTypeId());
+ toString += buf;
+ toString += ",";
+ ACE_OS::snprintf(buf, 2048, "%s", pt->getPdxClassName());
+ toString += buf;
+ toString += "]{";
+ bool firstElement = true;
+ auto identityFields = getIdentityPdxFields(pt);
+ for (size_t i = 0; i < static_cast<int>(identityFields.size()); i++) {
+ if (firstElement) {
+ firstElement = false;
+ } else {
+ toString += ",";
+ }
+ ACE_OS::snprintf(buf, 2048, "%s", identityFields.at(i)->getFieldName());
+ toString += buf;
+ toString += "=";
+
+ switch (identityFields.at(i)->getTypeId()) {
+ case PdxFieldTypes::BOOLEAN: {
+ bool value = getBooleanField(identityFields.at(i)->getFieldName());
+ ACE_OS::snprintf(buf, 2048, "%s", value ? "true" : "false");
+ toString += buf;
+ break;
+ }
+ case PdxFieldTypes::BYTE: {
+ signed char value = getByteField(identityFields.at(i)->getFieldName());
+ ACE_OS::snprintf(buf, 2048, "%d", value);
+ toString += buf;
+ break;
+ }
+ case PdxFieldTypes::SHORT: {
+ int16_t value = getShortField(identityFields.at(i)->getFieldName());
+ ACE_OS::snprintf(buf, 2048, "%d", value);
+ toString += buf;
+ break;
+ }
+ case PdxFieldTypes::INT: {
+ int32_t value = getIntField(identityFields.at(i)->getFieldName());
+ ACE_OS::snprintf(buf, 2048, "%d", value);
+ toString += buf;
+ break;
+ }
+ case PdxFieldTypes::LONG: {
+ int64_t value = getLongField(identityFields.at(i)->getFieldName());
+ ACE_OS::snprintf(buf, 2048, "%lld", value);
+ toString += buf;
+ break;
+ }
+ case PdxFieldTypes::FLOAT: {
+ float value = getFloatField(identityFields.at(i)->getFieldName());
+ ACE_OS::snprintf(buf, 2048, "%f", value);
+ toString += buf;
+ break;
+ }
+ case PdxFieldTypes::DOUBLE: {
+ double value = getDoubleField(identityFields.at(i)->getFieldName());
+ ACE_OS::snprintf(buf, 2048, "%f", value);
+ toString += buf;
+ break;
+ }
+ case PdxFieldTypes::CHAR: {
+ auto value = getCharField(identityFields.at(i)->getFieldName());
+ ACE_OS::snprintf(buf, 2048, "%c", value);
+ toString += buf;
+ break;
+ }
+ case PdxFieldTypes::STRING: {
+ wchar_t* value = 0;
+ getField(identityFields.at(i)->getFieldName(), &value);
+ ACE_OS::snprintf(buf, 2048, "%ls", value);
+ toString += buf;
+ break;
+ }
+ case PdxFieldTypes::CHAR_ARRAY: {
+ wchar_t* value = 0;
+ int32_t length;
+ getField(identityFields.at(i)->getFieldName(), &value, length);
+ if (length > 0) {
+ for (int i = 0; i < length; i++) {
+ ACE_OS::snprintf(buf, 2048, "%c\t", value[i]);
+ toString += buf;
+ }
+ GF_SAFE_DELETE_ARRAY(value);
+ }
+ break;
+ }
+ case PdxFieldTypes::STRING_ARRAY: {
+ wchar_t** value = 0;
+ int32_t length;
+ getField(identityFields.at(i)->getFieldName(), &value, length);
+ if (length > 0) {
+ for (int i = 0; i < length; i++) {
+ ACE_OS::snprintf(buf, 2048, "%ls\t", value[i]);
+ toString += buf;
+ }
+ }
+ break;
+ }
+ case PdxFieldTypes::BYTE_ARRAY: {
+ signed char* value = 0;
+ int32_t length;
+ getField(identityFields.at(i)->getFieldName(), &value, length);
+ if (length > 0) {
+ for (int i = 0; i < length; i++) {
+ ACE_OS::snprintf(buf, 2048, "%d\t", value[i]);
+ toString += buf;
+ }
+ GF_SAFE_DELETE_ARRAY(value);
+ }
+ break;
+ }
+ case PdxFieldTypes::SHORT_ARRAY: {
+ int16_t* value = 0;
+ int32_t length;
+ getField(identityFields.at(i)->getFieldName(), &value, length);
+ if (length > 0) {
+ for (int i = 0; i < length; i++) {
+ ACE_OS::snprintf(buf, 2048, "%d\t", value[i]);
+ toString += buf;
+ }
+ GF_SAFE_DELETE_ARRAY(value);
+ }
+ break;
+ }
+ case PdxFieldTypes::INT_ARRAY: {
+ int32_t* value = 0;
+ int32_t length;
+ getField(identityFields.at(i)->getFieldName(), &value, length);
+ if (length > 0) {
+ for (int i = 0; i < length; i++) {
+ ACE_OS::snprintf(buf, 2048, "%d\t", value[i]);
+ toString += buf;
+ }
+ GF_SAFE_DELETE_ARRAY(value);
+ }
+ break;
+ }
+ case PdxFieldTypes::LONG_ARRAY: {
+ int64_t* value = 0;
+ int32_t length;
+ getField(identityFields.at(i)->getFieldName(), &value, length);
+ if (length > 0) {
+ for (int i = 0; i < length; i++) {
+ ACE_OS::snprintf(buf, 2048, "%lld\t", value[i]);
+ toString += buf;
+ }
+ }
+ break;
+ }
+ case PdxFieldTypes::FLOAT_ARRAY: {
+ float* value = 0;
+ int32_t length;
+ getField(identityFields.at(i)->getFieldName(), &value, length);
+ if (length > 0) {
+ for (int i = 0; i < length; i++) {
+ ACE_OS::snprintf(buf, 2048, "%f\t", value[i]);
+ toString += buf;
+ }
+ GF_SAFE_DELETE_ARRAY(value);
+ }
+ break;
+ }
+ case PdxFieldTypes::DOUBLE_ARRAY: {
+ double* value = 0;
+ int32_t length;
+ getField(identityFields.at(i)->getFieldName(), &value, length);
+ if (length > 0) {
+ for (int i = 0; i < length; i++) {
+ ACE_OS::snprintf(buf, 2048, "%f\t", value[i]);
+ toString += buf;
+ }
+ }
+ break;
+ }
+ case PdxFieldTypes::DATE: {
+ auto value =
+ getCacheableDateField(identityFields.at(i)->getFieldName());
+ if (value != nullptr) {
+ ACE_OS::snprintf(buf, 2048, "%s", value->toString()->asChar());
+ toString += buf;
+ }
+ break;
+ }
+ case PdxFieldTypes::BOOLEAN_ARRAY: {
+ bool* value = 0;
+ int32_t length;
+ getField(identityFields.at(i)->getFieldName(), &value, length);
+ if (length > 0) {
+ for (int i = 0; i < length; i++) {
+ ACE_OS::snprintf(buf, 2048, "%s\t", value[i] ? "true" : "false");
+ toString += buf;
+ }
+ GF_SAFE_DELETE_ARRAY(value);
+ }
+ break;
+ }
+ case PdxFieldTypes::ARRAY_OF_BYTE_ARRAYS: {
+ int8_t** value = 0;
+ int32_t arrayLength;
+ int32_t* elementLength;
+ getField(identityFields.at(i)->getFieldName(), &value, arrayLength,
+ elementLength);
+ if (arrayLength > 0) {
+ for (int j = 0; j < arrayLength; j++) {
+ for (int k = 0; k < elementLength[j]; k++) {
+ ACE_OS::snprintf(buf, 2048, "%d\t", value[j][k]);
+ toString += buf;
+ }
+ }
+ }
+ break;
+ }
+ case PdxFieldTypes::OBJECT_ARRAY: {
+ auto value =
+ getCacheableObjectArrayField(identityFields.at(i)->getFieldName());
+ if (value != nullptr) {
+ ACE_OS::snprintf(buf, 2048, "%s\t", value->toString()->asChar());
+ toString += buf;
+ }
+ break;
+ }
+ default: {
+ auto value = getCacheableField(identityFields.at(i)->getFieldName());
+ if (value != nullptr) {
+ ACE_OS::snprintf(buf, 2048, "%s\t", value->toString()->asChar());
+ toString += buf;
+ }
+ }
+ }
+ }
+ toString += "}";
+
+ return CacheableString::create(toString.c_str());
+ }
+ std::shared_ptr<PdxSerializable> PdxInstanceImpl::getObject() {
+ auto dataInput = m_cache->createDataInput(m_buffer, m_bufferLength);
+ int64_t sampleStartNanos =
+ m_enableTimeStatistics ? Utils::startStatOpTime() : 0;
+ //[ToDo] do we have to call incPdxDeSerialization here?
+ auto ret =
+ PdxHelper::deserializePdx(*dataInput, true, m_typeId, m_bufferLength);
+
+ if (m_cacheStats != nullptr) {
+ if (m_enableTimeStatistics) {
+ Utils::updateStatOpTime(
+ m_cacheStats->getStat(),
+ m_cacheStats->getPdxInstanceDeserializationTimeId(),
+ sampleStartNanos);
+ }
+ m_cacheStats->incPdxInstanceDeserializations();
+ }
+ return ret;
+ }
+
+ void PdxInstanceImpl::equatePdxFields(
+ std::vector<std::shared_ptr<PdxFieldType>>& my,
+ std::vector<std::shared_ptr<PdxFieldType>>& other) const {
+ int otherIdx = -1;
+ for (int32_t i = 0; i < static_cast<int32_t>(my.size()); i++) {
+ auto myF = my.at(i);
+ if (!myF->equals(m_DefaultPdxFieldType)) {
+ for (int32_t j = 0; j < static_cast<int32_t>(other.size()); j++) {
+ if (myF->equals(other[j])) {
+ otherIdx = j;
+ break;
+ } else {
+ otherIdx = -1;
+ }
+ }
+
+ if (otherIdx == -1) // field not there
+ {
+ if (i < static_cast<int32_t>(other.size())) {
+ auto tmp = other.at(i);
+ other.at(i) = m_DefaultPdxFieldType;
+ other.push_back(tmp);
+ } else {
+ other.push_back(m_DefaultPdxFieldType);
+ }
+ } else if (otherIdx != i) {
+ auto tmp = other.at(i);
+ other.at(i) = other.at(otherIdx);
+ other.at(otherIdx) = tmp;
+ }
+ }
+ }
}
bool PdxInstanceImpl::operator==(const CacheableKey& other) const {
@@ -1272,8 +1281,8 @@ bool PdxInstanceImpl::operator==(const CacheableKey& other) const {
return false;
}
- PdxTypePtr myPdxType = getPdxType();
- PdxTypePtr otherPdxType = otherPdx->getPdxType();
+ auto myPdxType = getPdxType();
+ auto otherPdxType = otherPdx->getPdxType();
char* myPdxClassName = myPdxType->getPdxClassName();
char* otherPdxClassName = otherPdxType->getPdxClassName();
@@ -1282,9 +1291,9 @@ bool PdxInstanceImpl::operator==(const CacheableKey& other) const {
return false;
}
- std::vector<PdxFieldTypePtr> myPdxIdentityFieldList =
+ auto myPdxIdentityFieldList =
getIdentityPdxFields(myPdxType);
- std::vector<PdxFieldTypePtr> otherPdxIdentityFieldList =
+ auto otherPdxIdentityFieldList =
otherPdx->getIdentityPdxFields(otherPdxType);
equatePdxFields(myPdxIdentityFieldList, otherPdxIdentityFieldList);
@@ -1295,8 +1304,8 @@ bool PdxInstanceImpl::operator==(const CacheableKey& other) const {
int fieldTypeId = -1;
for (size_t i = 0; i < myPdxIdentityFieldList.size(); i++) {
- PdxFieldTypePtr myPFT = myPdxIdentityFieldList.at(i);
- PdxFieldTypePtr otherPFT = otherPdxIdentityFieldList.at(i);
+ auto myPFT = myPdxIdentityFieldList.at(i);
+ auto otherPFT = otherPdxIdentityFieldList.at(i);
LOGDEBUG("pdxfield %s ",
((myPFT != m_DefaultPdxFieldType) ? myPFT->getFieldName()
@@ -1337,8 +1346,8 @@ bool PdxInstanceImpl::operator==(const CacheableKey& other) const {
break;
}
case PdxFieldTypes::OBJECT: {
- CacheablePtr object = nullptr;
- CacheablePtr otherObject = nullptr;
+ std::shared_ptr<Cacheable> object = nullptr;
+ std::shared_ptr<Cacheable> otherObject = nullptr;
if (!myPFT->equals(m_DefaultPdxFieldType)) {
setOffsetForObject(*myDataInput, myPdxType, myPFT->getSequenceId());
myDataInput->readObject(object);
@@ -1360,9 +1369,9 @@ bool PdxInstanceImpl::operator==(const CacheableKey& other) const {
break;
}
case PdxFieldTypes::OBJECT_ARRAY: {
- CacheableObjectArrayPtr otherObjectArray =
+ auto otherObjectArray =
CacheableObjectArray::create();
- CacheableObjectArrayPtr objectArray = CacheableObjectArray::create();
+ auto objectArray = CacheableObjectArray::create();
if (!myPFT->equals(m_DefaultPdxFieldType)) {
setOffsetForObject(*myDataInput, myPdxType, myPFT->getSequenceId());
@@ -1400,11 +1409,11 @@ bool PdxInstanceImpl::operator==(const CacheableKey& other) const {
return true;
}
-bool PdxInstanceImpl::compareRawBytes(PdxInstanceImpl& other, PdxTypePtr myPT,
- PdxFieldTypePtr myF,
+bool PdxInstanceImpl::compareRawBytes(PdxInstanceImpl& other, std::shared_ptr<PdxType> myPT,
+ std::shared_ptr<PdxFieldType> myF,
DataInput& myDataInput,
- PdxTypePtr otherPT,
- PdxFieldTypePtr otherF,
+ std::shared_ptr<PdxType> otherPT,
+ std::shared_ptr<PdxFieldType> otherF,
DataInput& otherDataInput) const {
if (!myF->equals(m_DefaultPdxFieldType) &&
!otherF->equals(m_DefaultPdxFieldType)) {
@@ -1447,14 +1456,13 @@ bool PdxInstanceImpl::compareRawBytes(PdxInstanceImpl& other, PdxTypePtr myPT,
}
}
}
-
-CacheableStringArrayPtr PdxInstanceImpl::getFieldNames() {
- PdxTypePtr pt = getPdxType();
- std::vector<PdxFieldTypePtr>* vectorOfFieldTypes = pt->getPdxFieldTypes();
+ std::shared_ptr<CacheableStringArray> PdxInstanceImpl::getFieldNames() {
+ auto pt = getPdxType();
+ std::vector<std::shared_ptr<PdxFieldType>>* vectorOfFieldTypes = pt->getPdxFieldTypes();
int size = static_cast<int>(vectorOfFieldTypes->size());
- CacheableStringPtr* ptrArr = nullptr;
+ std::shared_ptr<CacheableString>* ptrArr = nullptr;
if (size > 0) {
- ptrArr = new CacheableStringPtr[size];
+ ptrArr = new std::shared_ptr<CacheableString>[size];
for (int i = 0; i < size; i++) {
ptrArr[i] =
CacheableString::create((vectorOfFieldTypes->at(i))->getFieldName());
@@ -1469,26 +1477,27 @@ CacheableStringArrayPtr PdxInstanceImpl::getFieldNames() {
PdxFieldTypes::PdxFieldType PdxInstanceImpl::getFieldType(
const char* fieldname) const {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldname);
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldname);
VERIFY_PDX_INSTANCE_FIELD_THROW;
return static_cast<PdxFieldTypes::PdxFieldType>(pft->getTypeId());
}
-void PdxInstanceImpl::writeUnmodifieldField(DataInput& dataInput, int startPos,
- int endPos,
- PdxLocalWriterPtr localWriter) {
+void PdxInstanceImpl::writeUnmodifieldField(
+ DataInput& dataInput, int startPos, int endPos,
+ std::shared_ptr<PdxLocalWriter> localWriter) {
dataInput.reset(startPos);
for (; startPos < endPos; startPos++) {
localWriter->writeByte(dataInput.read());
}
}
-void PdxInstanceImpl::toData(PdxWriterPtr writer) /*const*/ {
- PdxTypePtr pt = getPdxType();
- std::vector<PdxFieldTypePtr>* pdxFieldList = pt->getPdxFieldTypes();
+void PdxInstanceImpl::toData(std::shared_ptr<PdxWriter> writer) /*const*/ {
+ auto pt = getPdxType();
+ std::vector<std::shared_ptr<PdxFieldType>>* pdxFieldList =
+ pt->getPdxFieldTypes();
int position = 0; // ignore typeid and length
int nextFieldPosition = 0;
if (m_buffer != nullptr) {
@@ -1496,10 +1505,10 @@ void PdxInstanceImpl::toData(PdxWriterPtr writer) /*const*/ {
m_buffer, m_bufferLength);
auto dataInput = m_cache->createDataInput(copy, m_bufferLength);
for (size_t i = 0; i < pdxFieldList->size(); i++) {
- PdxFieldTypePtr currPf = pdxFieldList->at(i);
+ auto currPf = pdxFieldList->at(i);
LOGDEBUG("toData filedname = %s , isVarLengthType = %d ",
currPf->getFieldName(), currPf->IsVariableLengthType());
- CacheablePtr value = nullptr;
+ std::shared_ptr<Cacheable> value = nullptr;
FieldVsValues::iterator iter =
m_updatedFields.find(currPf->getFieldName());
@@ -1510,7 +1519,8 @@ void PdxInstanceImpl::toData(PdxWriterPtr writer) /*const*/ {
}
if (value != nullptr) {
writeField(writer, currPf->getFieldName(), currPf->getTypeId(), value);
- position = getNextFieldPosition(*dataInput, static_cast<int>(i) + 1, pt);
+ position =
+ getNextFieldPosition(*dataInput, static_cast<int>(i) + 1, pt);
} else {
if (currPf->IsVariableLengthType()) {
// need to add offset
@@ -1527,17 +1537,17 @@ void PdxInstanceImpl::toData(PdxWriterPtr writer) /*const*/ {
GF_SAFE_DELETE_ARRAY(copy);
} else {
for (size_t i = 0; i < pdxFieldList->size(); i++) {
- PdxFieldTypePtr currPf = pdxFieldList->at(i);
+ auto currPf = pdxFieldList->at(i);
LOGDEBUG("toData1 filedname = %s , isVarLengthType = %d ",
currPf->getFieldName(), currPf->IsVariableLengthType());
- CacheablePtr value = m_updatedFields[currPf->getFieldName()];
+ auto value = m_updatedFields[currPf->getFieldName()];
writeField(writer, currPf->getFieldName(), currPf->getTypeId(), value);
}
}
m_updatedFields.clear();
}
-void PdxInstanceImpl::fromData(PdxReaderPtr input) {
+void PdxInstanceImpl::fromData(std::shared_ptr<PdxReader> input) {
throw IllegalStateException(
"PdxInstance::FromData( .. ) shouldn't have called");
}
@@ -1566,13 +1576,13 @@ void PdxInstanceImpl::setPdxId(int32_t typeId) {
}
}
-std::vector<PdxFieldTypePtr> PdxInstanceImpl::getIdentityPdxFields(
- PdxTypePtr pt) const {
- std::vector<PdxFieldTypePtr>* pdxFieldList = pt->getPdxFieldTypes();
- std::vector<PdxFieldTypePtr> retList;
+std::vector<std::shared_ptr<PdxFieldType>> PdxInstanceImpl::getIdentityPdxFields(
+ std::shared_ptr<PdxType> pt) const {
+ std::vector<std::shared_ptr<PdxFieldType>>* pdxFieldList = pt->getPdxFieldTypes();
+ std::vector<std::shared_ptr<PdxFieldType>> retList;
int size = static_cast<int>(pdxFieldList->size());
for (int i = 0; i < size; i++) {
- PdxFieldTypePtr pft = pdxFieldList->at(i);
+ auto pft = pdxFieldList->at(i);
if (pft->getIdentityField()) retList.push_back(pft);
}
@@ -1582,7 +1592,7 @@ std::vector<PdxFieldTypePtr> PdxInstanceImpl::getIdentityPdxFields(
}
for (int i = 0; i < size; i++) {
- PdxFieldTypePtr pft = pdxFieldList->at(i);
+ auto pft = pdxFieldList->at(i);
retList.push_back(pft);
}
@@ -1591,7 +1601,8 @@ std::vector<PdxFieldTypePtr> PdxInstanceImpl::getIdentityPdxFields(
return retList;
}
-int PdxInstanceImpl::getOffset(DataInput& dataInput, PdxTypePtr pt,
+int PdxInstanceImpl::getOffset(DataInput& dataInput,
+ std::shared_ptr<PdxType> pt,
int sequenceId) const {
dataInput.resetPdx(0);
@@ -1622,7 +1633,7 @@ int PdxInstanceImpl::getOffset(DataInput& dataInput, PdxTypePtr pt,
serializedLength);
}
-int PdxInstanceImpl::getRawHashCode(PdxTypePtr pt, PdxFieldTypePtr pField,
+int PdxInstanceImpl::getRawHashCode(std::shared_ptr<PdxType> pt, std::shared_ptr<PdxFieldType> pField,
DataInput& dataInput) const {
int pos = getOffset(dataInput, pt, pField->getSequenceId());
int nextpos =
@@ -1649,7 +1660,7 @@ int PdxInstanceImpl::getRawHashCode(PdxTypePtr pt, PdxFieldTypePtr pField,
}
int PdxInstanceImpl::getNextFieldPosition(DataInput& dataInput, int fieldId,
- PdxTypePtr pt) const {
+ std::shared_ptr<PdxType> pt) const {
LOGDEBUG("fieldId = %d pt->getTotalFields() = %d ", fieldId,
pt->getTotalFields());
if (fieldId == pt->getTotalFields()) {
@@ -1661,7 +1672,7 @@ int PdxInstanceImpl::getNextFieldPosition(DataInput& dataInput, int fieldId,
}
int PdxInstanceImpl::getSerializedLength(DataInput& dataInput,
- PdxTypePtr pt) const {
+ std::shared_ptr<PdxType> pt) const {
dataInput.resetPdx(0);
int offsetSize = 0;
@@ -1702,7 +1713,7 @@ bool PdxInstanceImpl::compareDefaultBytes(DataInput& dataInput, int start,
return true;
}
-bool PdxInstanceImpl::hasDefaultBytes(PdxFieldTypePtr pField,
+bool PdxInstanceImpl::hasDefaultBytes(std::shared_ptr<PdxFieldType> pField,
DataInput& dataInput, int start,
int end) const {
switch (pField->getTypeId()) {
@@ -1759,8 +1770,8 @@ bool PdxInstanceImpl::hasDefaultBytes(PdxFieldTypePtr pField,
}
void PdxInstanceImpl::setField(const char* fieldName, bool value) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldName);
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldName);
if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::BOOLEAN) {
char excpStr[256] = {0};
@@ -1780,13 +1791,13 @@ void PdxInstanceImpl::setField(const char* fieldName, bool value) {
fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
throw IllegalStateException(excpStr);
}
- CacheablePtr cacheableObject = CacheableBoolean::create(value);
+ auto cacheableObject = CacheableBoolean::create(value);
m_updatedFields[fieldName] = cacheableObject;
}
void PdxInstanceImpl::setField(const char* fieldName, signed char value) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldName);
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldName);
if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::BYTE) {
char excpStr[256] = {0};
@@ -1806,13 +1817,13 @@ void PdxInstanceImpl::setField(const char* fieldName, signed char value) {
fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
throw IllegalStateException(excpStr);
}
- CacheablePtr cacheableObject = CacheableByte::create(value);
+ auto cacheableObject = CacheableByte::create(value);
m_updatedFields[fieldName] = cacheableObject;
}
void PdxInstanceImpl::setField(const char* fieldName, unsigned char value) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldName);
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldName);
if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::BYTE) {
char excpStr[256] = {0};
@@ -1832,13 +1843,13 @@ void PdxInstanceImpl::setField(const char* fieldName, unsigned char value) {
fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
throw IllegalStateException(excpStr);
}
- CacheablePtr cacheableObject = CacheableByte::create(value);
+ auto cacheableObject = CacheableByte::create(value);
m_updatedFields[fieldName] = cacheableObject;
}
void PdxInstanceImpl::setField(const char* fieldName, int16_t value) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldName);
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldName);
if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::SHORT) {
char excpStr[256] = {0};
@@ -1848,13 +1859,13 @@ void PdxInstanceImpl::setField(const char* fieldName, int16_t value) {
fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
throw IllegalStateException(excpStr);
}
- CacheablePtr cacheableObject = CacheableInt16::create(value);
+ auto cacheableObject = CacheableInt16::create(value);
m_updatedFields[fieldName] = cacheableObject;
}
void PdxInstanceImpl::setField(const char* fieldName, int32_t value) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldName);
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldName);
if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::INT) {
char excpStr[256] = {0};
@@ -1874,13 +1885,13 @@ void PdxInstanceImpl::setField(const char* fieldName, int32_t value) {
fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
throw IllegalStateException(excpStr);
}
- CacheablePtr cacheableObject = CacheableInt32::create(value);
+ auto cacheableObject = CacheableInt32::create(value);
m_updatedFields[fieldName] = cacheableObject;
}
void PdxInstanceImpl::setField(const char* fieldName, int64_t value) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldName);
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldName);
if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::LONG) {
char excpStr[256] = {0};
@@ -1900,13 +1911,13 @@ void PdxInstanceImpl::setField(const char* fieldName, int64_t value) {
fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
throw IllegalStateException(excpStr);
}
- CacheablePtr cacheableObject = CacheableInt64::create(value);
+ auto cacheableObject = CacheableInt64::create(value);
m_updatedFields[fieldName] = cacheableObject;
}
void PdxInstanceImpl::setField(const char* fieldName, float value) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldName);
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldName);
if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::FLOAT) {
char excpStr[256] = {0};
@@ -1926,13 +1937,13 @@ void PdxInstanceImpl::setField(const char* fieldName, float value) {
fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
throw IllegalStateException(excpStr);
}
- CacheablePtr cacheableObject = CacheableFloat::create(value);
+ auto cacheableObject = CacheableFloat::create(value);
m_updatedFields[fieldName] = cacheableObject;
}
void PdxInstanceImpl::setField(const char* fieldName, double value) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldName);
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldName);
if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::DOUBLE) {
char excpStr[256] = {0};
@@ -1952,13 +1963,13 @@ void PdxInstanceImpl::setField(const char* fieldName, double value) {
fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
throw IllegalStateException(excpStr);
}
- CacheablePtr cacheableObject = CacheableDouble::create(value);
+ auto cacheableObject = CacheableDouble::create(value);
m_updatedFields[fieldName] = cacheableObject;
}
void PdxInstanceImpl::setField(const char* fieldName, char16_t value) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldName);
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldName);
if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::CHAR) {
char excpStr[256] = {0};
@@ -1968,13 +1979,13 @@ void PdxInstanceImpl::setField(const char* fieldName, char16_t value) {
fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
throw IllegalStateException(excpStr);
}
- CacheablePtr cacheableObject = CacheableCharacter::create(value);
+ auto cacheableObject = CacheableCharacter::create(value);
m_updatedFields[fieldName] = cacheableObject;
}
-void PdxInstanceImpl::setField(const char* fieldName, CacheableDatePtr value) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldName);
+void PdxInstanceImpl::setField(const char* fieldName, std::shared_ptr<CacheableDate> value) {
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldName);
if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::DATE) {
char excpStr[256] = {0};
@@ -1984,13 +1995,13 @@ void PdxInstanceImpl::setField(const char* fieldName, CacheableDatePtr value) {
fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
throw IllegalStateException(excpStr);
}
- CacheablePtr cacheableObject = value;
+ auto cacheableObject = value;
m_updatedFields[fieldName] = cacheableObject;
}
-void PdxInstanceImpl::setField(const char* fieldName, CacheablePtr value) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldName);
+void PdxInstanceImpl::setField(const char* fieldName, std::shared_ptr<Cacheable> value) {
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldName);
if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::OBJECT) {
char excpStr[256] = {0};
@@ -2014,9 +2025,9 @@ void PdxInstanceImpl::setField(const char* fieldName, CacheablePtr value) {
}
void PdxInstanceImpl::setField(const char* fieldName,
- CacheableObjectArrayPtr value) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldName);
+ std::shared_ptr<CacheableObjectArray> value) {
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldName);
if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::OBJECT_ARRAY) {
char excpStr[256] = {0};
@@ -2031,8 +2042,8 @@ void PdxInstanceImpl::setField(const char* fieldName,
void PdxInstanceImpl::setField(const char* fieldName, bool* value,
int32_t length) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldName);
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldName);
if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::BOOLEAN_ARRAY) {
char excpStr[256] = {0};
@@ -2052,42 +2063,42 @@ void PdxInstanceImpl::setField(const char* fieldName, bool* value,
fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
throw IllegalStateException(excpStr);
}
- CacheablePtr cacheableObject = BooleanArray::create(value, length);
+ auto cacheableObject = BooleanArray::create(value, length);
m_updatedFields[fieldName] = cacheableObject;
}
void PdxInstanceImpl::setField(const char* fieldName, signed char* value,
int32_t length) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldName);
-
- if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::BYTE_ARRAY) {
- char excpStr[256] = {0};
- /* adongre - Coverity II
- * CID 29217: Calling risky function (SECURE_CODING)[VERY RISKY]. Using
- * "sprintf" can cause a
- * buffer overflow when done incorrectly. Because sprintf() assumes an
- * arbitrarily long string,
- * callers must be careful not to overflow the actual space of the
- * destination.
- * Use snprintf() instead, or correct precision specifiers.
- * Fix : using ACE_OS::snprintf
- */
- ACE_OS::snprintf(
- excpStr, 256,
- "PdxInstance doesn't has field %s or type of field not matched %s ",
- fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
- throw IllegalStateException(excpStr);
- }
- CacheablePtr cacheableObject =
- CacheableBytes::create(reinterpret_cast<uint8_t*>(value), length);
- m_updatedFields[fieldName] = cacheableObject;
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldName);
+
+ if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::BYTE_ARRAY) {
+ char excpStr[256] = {0};
+ /* adongre - Coverity II
+ * CID 29217: Calling risky function (SECURE_CODING)[VERY RISKY]. Using
+ * "sprintf" can cause a
+ * buffer overflow when done incorrectly. Because sprintf() assumes an
+ * arbitrarily long string,
+ * callers must be careful not to overflow the actual space of the
+ * destination.
+ * Use snprintf() instead, or correct precision specifiers.
+ * Fix : using ACE_OS::snprintf
+ */
+ ACE_OS::snprintf(
+ excpStr, 256,
+ "PdxInstance doesn't has field %s or type of field not matched %s ",
+ fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
+ throw IllegalStateException(excpStr);
+ }
+ auto cacheableObject =
+ CacheableBytes::create(reinterpret_cast<uint8_t*>(value), length);
+ m_updatedFields[fieldName] = cacheableObject;
}
void PdxInstanceImpl::setField(const char* fieldName, unsigned char* value,
int32_t length) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldName);
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldName);
if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::BYTE_ARRAY) {
char excpStr[256] = {0};
@@ -2107,15 +2118,15 @@ void PdxInstanceImpl::setField(const char* fieldName, unsigned char* value,
fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
throw IllegalStateException(excpStr);
}
- CacheablePtr cacheableObject =
+ auto cacheableObject =
CacheableBytes::create((uint8_t*)value, length);
m_updatedFields[fieldName] = cacheableObject;
}
void PdxInstanceImpl::setField(const char* fieldName, int16_t* value,
int32_t length) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldName);
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldName);
if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::SHORT_ARRAY) {
char excpStr[256] = {0};
@@ -2135,41 +2146,41 @@ void PdxInstanceImpl::setField(const char* fieldName, int16_t* value,
fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
throw IllegalStateException(excpStr);
}
- CacheablePtr cacheableObject = CacheableInt16Array::create(value, length);
+ auto cacheableObject = CacheableInt16Array::create(value, length);
m_updatedFields[fieldName] = cacheableObject;
}
void PdxInstanceImpl::setField(const char* fieldName, int32_t* value,
int32_t length) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldName);
-
- if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::INT_ARRAY) {
- char excpStr[256] = {0};
- /* adongre - Coverity II
- * CID 29223: Calling risky function (SECURE_CODING)[VERY RISKY]. Using
- * "sprintf" can cause a
- * buffer overflow when done incorrectly. Because sprintf() assumes an
- * arbitrarily long string,
- * callers must be careful not to overflow the actual space of the
- * destination.
- * Use snprintf() instead, or correct precision specifiers.
- * Fix : using ACE_OS::snprintf
- */
- ACE_OS::snprintf(
- excpStr, 256,
- "PdxInstance doesn't has field %s or type of field not matched %s ",
- fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
- throw IllegalStateException(excpStr);
- }
- CacheablePtr cacheableObject = CacheableInt32Array::create(value, length);
- m_updatedFields[fieldName] = cacheableObject;
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldName);
+
+ if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::INT_ARRAY) {
+ char excpStr[256] = {0};
+ /* adongre - Coverity II
+ * CID 29223: Calling risky function (SECURE_CODING)[VERY RISKY]. Using
+ * "sprintf" can cause a
+ * buffer overflow when done incorrectly. Because sprintf() assumes an
+ * arbitrarily long string,
+ * callers must be careful not to overflow the actual space of the
+ * destination.
+ * Use snprintf() instead, or correct precision specifiers.
+ * Fix : using ACE_OS::snprintf
+ */
+ ACE_OS::snprintf(
+ excpStr, 256,
+ "PdxInstance doesn't has field %s or type of field not matched %s ",
+ fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
+ throw IllegalStateException(excpStr);
+ }
+ auto cacheableObject = CacheableInt32Array::create(value, length);
+ m_updatedFields[fieldName] = cacheableObject;
}
void PdxInstanceImpl::setField(const char* fieldName, int64_t* value,
int32_t length) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldName);
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldName);
if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::LONG_ARRAY) {
char excpStr[256] = {0};
@@ -2189,14 +2200,14 @@ void PdxInstanceImpl::setField(const char* fieldName, int64_t* value,
fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
throw IllegalStateException(excpStr);
}
- CacheablePtr cacheableObject = CacheableInt64Array::create(value, length);
+ auto cacheableObject = CacheableInt64Array::create(value, length);
m_updatedFields[fieldName] = cacheableObject;
}
void PdxInstanceImpl::setField(const char* fieldName, float* value,
int32_t length) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldName);
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldName);
if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::FLOAT_ARRAY) {
char excpStr[256] = {0};
@@ -2216,14 +2227,14 @@ void PdxInstanceImpl::setField(const char* fieldName, float* value,
fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
throw IllegalStateException(excpStr);
}
- CacheablePtr cacheableObject = CacheableFloatArray::create(value, length);
+ auto cacheableObject = CacheableFloatArray::create(value, length);
m_updatedFields[fieldName] = cacheableObject;
}
void PdxInstanceImpl::setField(const char* fieldName, double* value,
int32_t length) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldName);
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldName);
if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::DOUBLE_ARRAY) {
char excpStr[256] = {0};
@@ -2243,14 +2254,14 @@ void PdxInstanceImpl::setField(const char* fieldName, double* value,
fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
throw IllegalStateException(excpStr);
}
- CacheablePtr cacheableObject = CacheableDoubleArray::create(value, length);
+ auto cacheableObject = CacheableDoubleArray::create(value, length);
m_updatedFields[fieldName] = cacheableObject;
}
void PdxInstanceImpl::setField(const char* fieldName, wchar_t* value,
int32_t length) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldName);
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldName);
if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::CHAR_ARRAY) {
char excpStr[256] = {0};
@@ -2270,14 +2281,14 @@ void PdxInstanceImpl::setField(const char* fieldName, wchar_t* value,
fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
throw IllegalStateException(excpStr);
}
- CacheablePtr ptr = CharArray::create(value, length);
+ auto ptr = CharArray::create(value, length);
m_updatedFields[fieldName] = ptr;
}
void PdxInstanceImpl::setField(const char* fieldName, char* value,
int32_t length) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldName);
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldName);
if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::CHAR_ARRAY) {
char excpStr[256] = {0};
@@ -2300,40 +2311,40 @@ void PdxInstanceImpl::setField(const char* fieldName, char* value,
size_t size = strlen(value) + 1;
wchar_t* tempWideCharArray = new wchar_t[size];
mbstowcs(tempWideCharArray, value, size);
- CacheablePtr ptr = CharArray::create(tempWideCharArray, length);
+ auto ptr = CharArray::create(tempWideCharArray, length);
m_updatedFields[fieldName] = ptr;
delete[] tempWideCharArray;
}
void PdxInstanceImpl::setField(const char* fieldName, const wchar_t* value) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldName);
-
- if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::STRING) {
- char excpStr[256] = {0};
- /* adongre - Coverity II
- * CID 29213: Calling risky function (SECURE_CODING)[VERY RISKY]. Using
- * "sprintf" can cause a
- * buffer overflow when done incorrectly. Because sprintf() assumes an
- * arbitrarily long string,
- * callers must be careful not to overflow the actual space of the
- * destination.
- * Use snprintf() instead, or correct precision specifiers.
- * Fix : using ACE_OS::snprintf
- */
- ACE_OS::snprintf(
- excpStr, 256,
- "PdxInstance doesn't has field %s or type of field not matched %s ",
- fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
- throw IllegalStateException(excpStr);
- }
- CacheablePtr ptr = CacheableString::create(value);
- m_updatedFields[fieldName] = ptr;
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldName);
+
+ if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::STRING) {
+ char excpStr[256] = {0};
+ /* adongre - Coverity II
+ * CID 29213: Calling risky function (SECURE_CODING)[VERY RISKY]. Using
+ * "sprintf" can cause a
+ * buffer overflow when done incorrectly. Because sprintf() assumes an
+ * arbitrarily long string,
+ * callers must be careful not to overflow the actual space of the
+ * destination.
+ * Use snprintf() instead, or correct precision specifiers.
+ * Fix : using ACE_OS::snprintf
+ */
+ ACE_OS::snprintf(
+ excpStr, 256,
+ "PdxInstance doesn't has field %s or type of field not matched %s ",
+ fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
+ throw IllegalStateException(excpStr);
+ }
+ auto ptr = CacheableString::create(value);
+ m_updatedFields[fieldName] = ptr;
}
void PdxInstanceImpl::setField(const char* fieldName, const char* value) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldName);
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldName);
if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::STRING) {
char excpStr[256] = {0};
@@ -2353,47 +2364,47 @@ void PdxInstanceImpl::setField(const char* fieldName, const char* value) {
fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
throw IllegalStateException(excpStr);
}
- CacheablePtr ptr = CacheableString::create(value);
+ auto ptr = CacheableString::create(value);
m_updatedFields[fieldName] = ptr;
}
void PdxInstanceImpl::setField(const char* fieldName, int8_t** value,
int32_t arrayLength, int32_t* elementLength) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldName);
-
- if (pft != nullptr &&
- pft->getTypeId() != PdxFieldTypes::ARRAY_OF_BYTE_ARRAYS) {
- char excpStr[256] = {0};
- /* adongre - Coverity II
- * CID 29214: Calling risky function (SECURE_CODING)[VERY RISKY]. Using
- * "sprintf" can cause a
- * buffer overflow when done incorrectly. Because sprintf() assumes an
- * arbitrarily long string,
- * callers must be careful not to overflow the actual space of the
- * destination.
- * Use snprintf() instead, or correct precision specifiers.
- * Fix : using ACE_OS::snprintf
- */
- ACE_OS::snprintf(
- excpStr, 256,
- "PdxInstance doesn't has field %s or type of field not matched %s ",
- fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
- throw IllegalStateException(excpStr);
- }
- CacheableVectorPtr cacheableObject = CacheableVector::create();
- for (int i = 0; i < arrayLength; i++) {
- CacheableBytesPtr ptr = CacheableBytes::create(
- reinterpret_cast<uint8_t*>(value[i]), elementLength[i]);
- cacheableObject->push_back(ptr);
- }
- m_updatedFields[fieldName] = cacheableObject;
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldName);
+
+ if (pft != nullptr &&
+ pft->getTypeId() != PdxFieldTypes::ARRAY_OF_BYTE_ARRAYS) {
+ char excpStr[256] = {0};
+ /* adongre - Coverity II
+ * CID 29214: Calling risky function (SECURE_CODING)[VERY RISKY]. Using
+ * "sprintf" can cause a
+ * buffer overflow when done incorrectly. Because sprintf() assumes an
+ * arbitrarily long string,
+ * callers must be careful not to overflow the actual space of the
+ * destination.
+ * Use snprintf() instead, or correct precision specifiers.
+ * Fix : using ACE_OS::snprintf
+ */
+ ACE_OS::snprintf(
+ excpStr, 256,
+ "PdxInstance doesn't has field %s or type of field not matched %s ",
+ fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
+ throw IllegalStateException(excpStr);
+ }
+ auto cacheableObject = CacheableVector::create();
+ for (int i = 0; i < arrayLength; i++) {
+ auto ptr = CacheableBytes::create(reinterpret_cast<uint8_t*>(value[i]),
+ elementLength[i]);
+ cacheableObject->push_back(ptr);
+ }
+ m_updatedFields[fieldName] = cacheableObject;
}
void PdxInstanceImpl::setField(const char* fieldName, wchar_t** value,
int32_t length) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldName);
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldName);
if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::STRING_ARRAY) {
char excpStr[256] = {0};
@@ -2413,15 +2424,15 @@ void PdxInstanceImpl::setField(const char* fieldName, wchar_t** value,
fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
throw IllegalStateException(excpStr);
}
- CacheableStringPtr* ptrArr = nullptr;
+ std::shared_ptr<CacheableString>* ptrArr = nullptr;
if (length > 0) {
- ptrArr = new CacheableStringPtr[length];
+ ptrArr = new std::shared_ptr<CacheableString>[length];
for (int32_t i = 0; i < length; ++i) {
ptrArr[i] = CacheableString::create(value[i]);
}
}
if (length > 0) {
- CacheablePtr cacheableObject = CacheableStringArray::create(ptrArr, length);
+ auto cacheableObject = CacheableStringArray::create(ptrArr, length);
m_updatedFields[fieldName] = cacheableObject;
}
@@ -2435,8 +2446,8 @@ void PdxInstanceImpl::setField(const char* fieldName, wchar_t** value,
void PdxInstanceImpl::setField(const char* fieldName, char** value,
int32_t length) {
- PdxTypePtr pt = getPdxType();
- PdxFieldTypePtr pft = pt->getPdxField(fieldName);
+ auto pt = getPdxType();
+ auto pft = pt->getPdxField(fieldName);
if (pft != nullptr && pft->getTypeId() != PdxFieldTypes::STRING_ARRAY) {
char excpStr[256] = {0};
@@ -2456,15 +2467,15 @@ void PdxInstanceImpl::setField(const char* fieldName, char** value,
fieldName, (pft != nullptr ? pft->toString()->asChar() : ""));
throw IllegalStateException(excpStr);
}
- CacheableStringPtr* ptrArr = nullptr;
+ std::shared_ptr<CacheableString>* ptrArr = nullptr;
if (length > 0) {
- ptrArr = new CacheableStringPtr[length];
+ ptrArr = new std::shared_ptr<CacheableString>[length];
for (int32_t i = 0; i < length; ++i) {
ptrArr[i] = CacheableString::create(value[i]);
}
}
if (length > 0) {
- CacheablePtr cacheableObject = CacheableStringArray::create(ptrArr, length);
+ auto cacheableObject = CacheableStringArray::create(ptrArr, length);
m_updatedFields[fieldName] = cacheableObject;
}
/* adongre - Coverity II
@@ -2475,7 +2486,7 @@ void PdxInstanceImpl::setField(const char* fieldName, char** value,
}*/
}
-void PdxInstanceImpl::setOffsetForObject(DataInput& dataInput, PdxTypePtr pt,
+void PdxInstanceImpl::setOffsetForObject(DataInput& dataInput, std::shared_ptr<PdxType> pt,
int sequenceId) const {
int pos = getOffset(dataInput, pt, sequenceId);
dataInput.reset();
@@ -2493,8 +2504,7 @@ uint32_t PdxInstanceImpl::objectSize() const {
}
return size;
}
-
-PdxTypeRegistryPtr PdxInstanceImpl::getPdxTypeRegistry() const {
+ std::shared_ptr<PdxTypeRegistry> PdxInstanceImpl::getPdxTypeRegistry() const {
return m_pdxTypeRegistry;
}
diff --git a/cppcache/src/PdxInstanceImpl.hpp b/cppcache/src/PdxInstanceImpl.hpp
index 049e96f..cad8084 100644
--- a/cppcache/src/PdxInstanceImpl.hpp
+++ b/cppcache/src/PdxInstanceImpl.hpp
@@ -36,7 +36,7 @@ namespace apache {
namespace geode {
namespace client {
-typedef std::map<std::string, CacheablePtr> FieldVsValues;
+typedef std::map<std::string, std::shared_ptr<Cacheable>> FieldVsValues;
class CPPCACHE_EXPORT PdxInstanceImpl : public WritablePdxInstance {
public:
@@ -53,7 +53,7 @@ class CPPCACHE_EXPORT PdxInstanceImpl : public WritablePdxInstance {
*
* @see serializationRegistry->addPdxType
*/
- virtual PdxSerializablePtr getObject();
+ virtual std::shared_ptr<PdxSerializable> getObject();
/**
* Checks if the named field exists and returns the result.
@@ -345,15 +345,18 @@ class CPPCACHE_EXPORT PdxInstanceImpl : public WritablePdxInstance {
int32_t& length) const;
/**
- * Reads the named field and set its value in CacheableDatePtr type out param.
- * CacheableDatePtr type is corresponding to java Java.util.date type.
+ * Reads the named field and set its value in std::shared_ptr<CacheableDate>
+ * type out param. std::shared_ptr<CacheableDate> type is corresponding to
+ * java Java.util.date type.
* @param fieldname name of the field to read
- * @param value value of the field to be set with CacheableDatePtr type.
+ * @param value value of the field to be set with
+ * std::shared_ptr<CacheableDate> type.
* @throws IllegalStateException if PdxInstance doesn't has the named field.
*
* @see PdxInstance#hasField
*/
- virtual CacheableDatePtr getCacheableDateField(const char* fieldname) const;
+ virtual std::shared_ptr<CacheableDate> getCacheableDateField(
+ const char* fieldname) const;
/**
* Reads the named field and set its value in array of byte arrays type out
@@ -371,10 +374,12 @@ class CPPCACHE_EXPORT PdxInstanceImpl : public WritablePdxInstance {
int32_t& arrayLength, int32_t*& elementLength) const;
/**
- * Reads the named field and set its value in CacheablePtr type out param.
- * CacheablePtr type is corresponding to java object type.
+ * Reads the named field and set its value in std::shared_ptr<Cacheable> type
+ * out param. std::shared_ptr<Cacheable> type is corresponding to java object
+ * type.
* @param fieldname name of the field to read
- * @param value value of the field to be set with CacheablePtr type.
+ * @param value value of the field to be set with std::shared_ptr<Cacheable>
+ * type.
* @throws IllegalStateException if PdxInstance doesn't has the named field.
* For deserialization C++ Native Client requires the domain class to be
* registered.
@@ -382,23 +387,24 @@ class CPPCACHE_EXPORT PdxInstanceImpl : public WritablePdxInstance {
* @see serializationRegistry->addPdxType
* @see PdxInstance#hasField
*/
- virtual CacheablePtr getCacheableField(const char* fieldname) const;
+ virtual std::shared_ptr<Cacheable> getCacheableField(
+ const char* fieldname) const;
/**
- * Reads the named field and set its value in CacheableObjectArrayPtr type out
- * param.
- * For deserialization C++ Native Client requires the domain class to be
- * registered.
- * CacheableObjectArrayPtr type is corresponding to java Object[] type.
+ * Reads the named field and set its value in
+ * std::shared_ptr<CacheableObjectArray> type out param. For deserialization
+ * C++ Native Client requires the domain class to be registered.
+ * std::shared_ptr<CacheableObjectArray> type is corresponding to java
+ * Object[] type.
* @param fieldname name of the field to read.
- * @param value value of the field to be set with CacheableObjectArrayPtr
- * type.
+ * @param value value of the field to be set with
+ * std::shared_ptr<CacheableObjectArray> type.
* @throws IllegalStateException if PdxInstance doesn't has the named field.
*
* @see serializationRegistry->addPdxType
* @see PdxInstance#hasField
*/
- virtual CacheableObjectArrayPtr getCacheableObjectArrayField(
+ virtual std::shared_ptr<CacheableObjectArray> getCacheableObjectArrayField(
const char* fieldname) const;
/**
@@ -549,15 +555,18 @@ class CPPCACHE_EXPORT PdxInstanceImpl : public WritablePdxInstance {
* The setField method has copy-on-write semantics.
* So for the modifications to be stored in the cache the WritablePdxInstance
* must be put into a region after setField has been called one or more times.
- * CacheableDatePtr type is corresponding to java Java.util.date type.
+ * std::shared_ptr<CacheableDate> type is corresponding to java Java.util.date
+ * type.
* @param fieldName
* name of the field whose value will be set
* @param value
- * value that will be set to the field of type CacheableDatePtr
+ * value that will be set to the field of type
+ * std::shared_ptr<CacheableDate>
* @throws IllegalStateException if the named field does not exist
* or if the type of the value is not compatible with the field.
*/
- virtual void setField(const char* fieldName, CacheableDatePtr value);
+ virtual void setField(const char* fieldName,
+ std::shared_ptr<CacheableDate> value);
/**
* Set the existing named field to the given value.
@@ -832,27 +841,31 @@ class CPPCACHE_EXPORT PdxInstanceImpl : public WritablePdxInstance {
* @param fieldName
* name of the field whose value will be set
* @param value
- * value that will be assigned to the field of type CacheablePtr
+ * value that will be assigned to the field of type
+ * std::shared_ptr<Cacheable>
* @throws IllegalStateException if the named field does not exist
* or if the type of the value is not compatible with the field.
*/
- virtual void setField(const char* fieldName, CacheablePtr value);
+ virtual void setField(const char* fieldName,
+ std::shared_ptr<Cacheable> value);
/**
* Set the existing named field to the given value.
* The setField method has copy-on-write semantics.
* So for the modifications to be stored in the cache the WritablePdxInstance
* must be put into a region after setField has been called one or more times.
- * CacheableObjectArrayPtr type is corresponding to java Object[] type.
+ * std::shared_ptr<CacheableObjectArray> type is corresponding to java
+ * Object[] type.
* @param fieldName
* name of the field whose value will be set
* @param value
* value that will be set to the field of type
- * CacheableObjectArrayPtr
+ * std::shared_ptr<CacheableObjectArray>
* @throws IllegalStateException if the named field does not exist
* or if the type of the value is not compatible with the field.
*/
- virtual void setField(const char* fieldName, CacheableObjectArrayPtr value);
+ virtual void setField(const char* fieldName,
+ std::shared_ptr<CacheableObjectArray> value);
/**
* Checks if the named field was {@link PdxWriter#markIdentityField}marked as
@@ -874,7 +887,7 @@ class CPPCACHE_EXPORT PdxInstanceImpl : public WritablePdxInstance {
* made to the returned value will not modify this PdxInstance.
* @return a {@link WritablePdxInstance}
*/
- virtual WritablePdxInstancePtr createWriter();
+ virtual std::shared_ptr<WritablePdxInstance> createWriter();
/**
* Generates a hashcode based on the identity fields of
@@ -907,7 +920,7 @@ class CPPCACHE_EXPORT PdxInstanceImpl : public WritablePdxInstance {
*
* @see serializationRegistry->addPdxType
*/
- virtual CacheableStringPtr toString() const;
+ virtual std::shared_ptr<CacheableString> toString() const;
/**
* @brief serialize this object. This is an internal method.
@@ -974,7 +987,7 @@ class CPPCACHE_EXPORT PdxInstanceImpl : public WritablePdxInstance {
* Return an unmodifiable list of the field names on this PdxInstance.
* @return an unmodifiable list of the field names on this PdxInstance
*/
- virtual CacheableStringArrayPtr getFieldNames();
+ virtual std::shared_ptr<CacheableStringArray> getFieldNames();
// From PdxSerializable
/**
@@ -982,13 +995,13 @@ class CPPCACHE_EXPORT PdxInstanceImpl : public WritablePdxInstance {
* method.
* @param PdxWriter to serialize the PDX object
*/
- virtual void toData(PdxWriterPtr output) /*const*/;
+ virtual void toData(std::shared_ptr<PdxWriter> output) /*const*/;
/**
* @brief Deserialize this object. This is an internal method.
* @param PdxReader to Deserialize the PDX object
*/
- virtual void fromData(PdxReaderPtr input);
+ virtual void fromData(std::shared_ptr<PdxReader> input);
/**
* Return the full name of the class that this pdx instance represents.
@@ -1010,8 +1023,8 @@ class CPPCACHE_EXPORT PdxInstanceImpl : public WritablePdxInstance {
PdxInstanceImpl(uint8_t* buffer, int length, int typeId,
CachePerfStats* cacheStats,
- PdxTypeRegistryPtr pdxTypeRegistry, const Cache* cache,
- bool enableTimeStatistics)
+ std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry,
+ const Cache* cache, bool enableTimeStatistics)
: m_buffer(DataInput::getBufferCopy(buffer, length)),
m_bufferLength(length),
m_typeId(typeId),
@@ -1023,16 +1036,16 @@ class CPPCACHE_EXPORT PdxInstanceImpl : public WritablePdxInstance {
LOGDEBUG("PdxInstanceImpl::m_bufferLength = %d ", m_bufferLength);
}
- PdxInstanceImpl(FieldVsValues fieldVsValue, PdxTypePtr pdxType,
+ PdxInstanceImpl(FieldVsValues fieldVsValue, std::shared_ptr<PdxType> pdxType,
CachePerfStats* cacheStats,
- PdxTypeRegistryPtr pdxTypeRegistry, const Cache* cache,
- bool enableTimeStatistics);
+ std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry,
+ const Cache* cache, bool enableTimeStatistics);
PdxInstanceImpl(const PdxInstanceImpl& other) = delete;
void operator=(const PdxInstanceImpl& other) = delete;
- PdxTypePtr getPdxType() const;
+ std::shared_ptr<PdxType> getPdxType() const;
void updatePdxStream(uint8_t* newPdxStream, int len);
@@ -1040,91 +1053,106 @@ class CPPCACHE_EXPORT PdxInstanceImpl : public WritablePdxInstance {
uint8_t* m_buffer;
int m_bufferLength;
int m_typeId;
- PdxTypePtr m_pdxType;
+ std::shared_ptr<PdxType> m_pdxType;
FieldVsValues m_updatedFields;
CachePerfStats* m_cacheStats;
- PdxTypeRegistryPtr m_pdxTypeRegistry;
+ std::shared_ptr<PdxTypeRegistry> m_pdxTypeRegistry;
const Cache* m_cache;
bool m_enableTimeStatistics;
- std::vector<PdxFieldTypePtr> getIdentityPdxFields(PdxTypePtr pt) const;
+ std::vector<std::shared_ptr<PdxFieldType>> getIdentityPdxFields(
+ std::shared_ptr<PdxType> pt) const;
- int getOffset(DataInput& dataInput, PdxTypePtr pt, int sequenceId) const;
+ int getOffset(DataInput& dataInput, std::shared_ptr<PdxType> pt,
+ int sequenceId) const;
- int getRawHashCode(PdxTypePtr pt, PdxFieldTypePtr pField,
+ int getRawHashCode(std::shared_ptr<PdxType> pt,
+ std::shared_ptr<PdxFieldType> pField,
DataInput& dataInput) const;
int getNextFieldPosition(DataInput& dataInput, int fieldId,
- PdxTypePtr pt) const;
+ std::shared_ptr<PdxType> pt) const;
- int getSerializedLength(DataInput& dataInput, PdxTypePtr pt) const;
+ int getSerializedLength(DataInput& dataInput,
+ std::shared_ptr<PdxType> pt) const;
- bool hasDefaultBytes(PdxFieldTypePtr pField, DataInput& dataInput, int start,
- int end) const;
+ bool hasDefaultBytes(std::shared_ptr<PdxFieldType> pField,
+ DataInput& dataInput, int start, int end) const;
bool compareDefaultBytes(DataInput& dataInput, int start, int end,
int8_t* defaultBytes, int32_t length) const;
- void writeField(PdxWriterPtr writer, const char* fieldName, int typeId,
- CacheablePtr value);
+ void writeField(std::shared_ptr<PdxWriter> writer, const char* fieldName,
+ int typeId, std::shared_ptr<Cacheable> value);
void writeUnmodifieldField(DataInput& dataInput, int startPos, int endPos,
- PdxLocalWriterPtr localWriter);
+ std::shared_ptr<PdxLocalWriter> localWriter);
- void setOffsetForObject(DataInput& dataInput, PdxTypePtr pt,
+ void setOffsetForObject(DataInput& dataInput, std::shared_ptr<PdxType> pt,
int sequenceId) const;
- bool compareRawBytes(PdxInstanceImpl& other, PdxTypePtr myPT,
- PdxFieldTypePtr myF, DataInput& myDataInput,
- PdxTypePtr otherPT, PdxFieldTypePtr otherF,
+ bool compareRawBytes(PdxInstanceImpl& other, std::shared_ptr<PdxType> myPT,
+ std::shared_ptr<PdxFieldType> myF,
+ DataInput& myDataInput, std::shared_ptr<PdxType> otherPT,
+ std::shared_ptr<PdxFieldType> otherF,
DataInput& otherDataInput) const;
- void equatePdxFields(std::vector<PdxFieldTypePtr>& my,
- std::vector<PdxFieldTypePtr>& other) const;
+ void equatePdxFields(std::vector<std::shared_ptr<PdxFieldType>>& my,
+ std::vector<std::shared_ptr<PdxFieldType>>& other) const;
- PdxTypeRegistryPtr getPdxTypeRegistry() const;
+ std::shared_ptr<PdxTypeRegistry> getPdxTypeRegistry() const;
- static int deepArrayHashCode(CacheablePtr obj);
+ static int deepArrayHashCode(std::shared_ptr<Cacheable> obj);
- static int enumerateMapHashCode(CacheableHashMapPtr map);
+ static int enumerateMapHashCode(std::shared_ptr<CacheableHashMap> map);
- static int enumerateVectorHashCode(CacheableVectorPtr vec);
+ static int enumerateVectorHashCode(std::shared_ptr<CacheableVector> vec);
- static int enumerateArrayListHashCode(CacheableArrayListPtr arrList);
+ static int enumerateArrayListHashCode(
+ std::shared_ptr<CacheableArrayList> arrList);
- static int enumerateLinkedListHashCode(CacheableLinkedListPtr linkedList);
+ static int enumerateLinkedListHashCode(
+ std::shared_ptr<CacheableLinkedList> linkedList);
- static int enumerateObjectArrayHashCode(CacheableObjectArrayPtr objArray);
+ static int enumerateObjectArrayHashCode(
+ std::shared_ptr<CacheableObjectArray> objArray);
- static int enumerateSetHashCode(CacheableHashSetPtr set);
+ static int enumerateSetHashCode(std::shared_ptr<CacheableHashSet> set);
- static int enumerateLinkedSetHashCode(CacheableLinkedHashSetPtr linkedset);
+ static int enumerateLinkedSetHashCode(
+ std::shared_ptr<CacheableLinkedHashSet> linkedset);
- static int enumerateHashTableCode(CacheableHashTablePtr hashTable);
+ static int enumerateHashTableCode(
+ std::shared_ptr<CacheableHashTable> hashTable);
- static bool deepArrayEquals(CacheablePtr obj, CacheablePtr otherObj);
+ static bool deepArrayEquals(std::shared_ptr<Cacheable> obj,
+ std::shared_ptr<Cacheable> otherObj);
- static bool enumerateObjectArrayEquals(CacheableObjectArrayPtr Obj,
- CacheableObjectArrayPtr OtherObj);
+ static bool enumerateObjectArrayEquals(
+ std::shared_ptr<CacheableObjectArray> Obj,
+ std::shared_ptr<CacheableObjectArray> OtherObj);
- static bool enumerateVectorEquals(CacheableVectorPtr Obj,
- CacheableVectorPtr OtherObj);
+ static bool enumerateVectorEquals(std::shared_ptr<CacheableVector> Obj,
+ std::shared_ptr<CacheableVector> OtherObj);
- static bool enumerateArrayListEquals(CacheableArrayListPtr Obj,
- CacheableArrayListPtr OtherObj);
+ static bool enumerateArrayListEquals(
+ std::shared_ptr<CacheableArrayList> Obj,
+ std::shared_ptr<CacheableArrayList> OtherObj);
- static bool enumerateMapEquals(CacheableHashMapPtr Obj,
- CacheableHashMapPtr OtherObj);
+ static bool enumerateMapEquals(std::shared_ptr<CacheableHashMap> Obj,
+ std::shared_ptr<CacheableHashMap> OtherObj);
- static bool enumerateSetEquals(CacheableHashSetPtr Obj,
- CacheableHashSetPtr OtherObj);
+ static bool enumerateSetEquals(std::shared_ptr<CacheableHashSet> Obj,
+ std::shared_ptr<CacheableHashSet> OtherObj);
- static bool enumerateLinkedSetEquals(CacheableLinkedHashSetPtr Obj,
- CacheableLinkedHashSetPtr OtherObj);
+ static bool enumerateLinkedSetEquals(
+ std::shared_ptr<CacheableLinkedHashSet> Obj,
+ std::shared_ptr<CacheableLinkedHashSet> OtherObj);
- static bool enumerateHashTableEquals(CacheableHashTablePtr Obj,
- CacheableHashTablePtr OtherObj);
+ static bool enumerateHashTableEquals(
+ std::shared_ptr<CacheableHashTable> Obj,
+ std::shared_ptr<CacheableHashTable> OtherObj);
std::unique_ptr<DataInput> getDataInputForField(const char* fieldname) const;
@@ -1140,9 +1168,8 @@ class CPPCACHE_EXPORT PdxInstanceImpl : public WritablePdxInstance {
static int8_t m_StringDefaultBytes[];
static int8_t m_ObjectDefaultBytes[];
static int8_t m_NULLARRAYDefaultBytes[];
- static PdxFieldTypePtr m_DefaultPdxFieldType;
+ static std::shared_ptr<PdxFieldType> m_DefaultPdxFieldType;
};
-typedef std::shared_ptr<PdxInstanceImpl> PdxInstanceImplPtr;
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/PdxLocalReader.cpp b/cppcache/src/PdxLocalReader.cpp
index bf2de51..e48a32f 100644
--- a/cppcache/src/PdxLocalReader.cpp
+++ b/cppcache/src/PdxLocalReader.cpp
@@ -27,7 +27,7 @@ namespace apache {
namespace geode {
namespace client {
-PdxLocalReader::PdxLocalReader(PdxTypeRegistryPtr pdxTypeRegistry)
+PdxLocalReader::PdxLocalReader(std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry)
: m_dataInput(nullptr),
m_startBuffer(nullptr),
m_startPosition(0),
@@ -41,9 +41,10 @@ PdxLocalReader::PdxLocalReader(PdxTypeRegistryPtr pdxTypeRegistry)
m_remoteToLocalMapSize(0),
m_pdxTypeRegistry(pdxTypeRegistry) {}
-PdxLocalReader::PdxLocalReader(DataInput& input, PdxTypePtr remoteType,
+PdxLocalReader::PdxLocalReader(DataInput& input,
+ std::shared_ptr<PdxType> remoteType,
int32_t pdxLen,
- PdxTypeRegistryPtr pdxTypeRegistry)
+ std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry)
: m_dataInput(&input),
m_pdxType(remoteType),
m_serializedLengthWithOffsets(pdxLen),
@@ -158,10 +159,10 @@ wchar_t* PdxLocalReader::readWideString(const char* fieldName) {
m_dataInput->readWideString(&str);
return str;
}
-
-SerializablePtr PdxLocalReader::readObject(const char* fieldName) {
+std::shared_ptr<Serializable> PdxLocalReader::readObject(
+ const char* fieldName) {
checkEmptyFieldName(fieldName);
- SerializablePtr ptr;
+ std::shared_ptr<Serializable> ptr;
m_dataInput->readObject(ptr);
if (ptr != nullptr) {
return ptr;
@@ -254,10 +255,10 @@ wchar_t** PdxLocalReader::readWideStringArray(const char* fieldName,
m_dataInput->readWideStringArray(&stringArray, length);
return stringArray;
}
-
-CacheableObjectArrayPtr PdxLocalReader::readObjectArray(const char* fieldName) {
+std::shared_ptr<CacheableObjectArray> PdxLocalReader::readObjectArray(
+ const char* fieldName) {
checkEmptyFieldName(fieldName);
- CacheableObjectArrayPtr coa = CacheableObjectArray::create();
+ auto coa = CacheableObjectArray::create();
coa->fromData(*m_dataInput);
LOGDEBUG("PdxLocalReader::readObjectArray coa->size() = %d", coa->size());
if (coa->size() <= 0) {
@@ -274,72 +275,71 @@ int8_t** PdxLocalReader::readArrayOfByteArrays(const char* fieldName,
m_dataInput->readArrayOfByteArrays(&arrofBytearr, arrayLength, elementLength);
return arrofBytearr;
}
-
-CacheableDatePtr PdxLocalReader::readDate(const char* fieldName) {
+std::shared_ptr<CacheableDate> PdxLocalReader::readDate(const char* fieldName) {
checkEmptyFieldName(fieldName);
- CacheableDatePtr cd = CacheableDate::create();
+ auto cd = CacheableDate::create();
cd->fromData(*m_dataInput);
return cd;
-}
-
-PdxRemotePreservedDataPtr PdxLocalReader::getPreservedData(
- PdxTypePtr mergedVersion, PdxSerializablePtr pdxObject) {
- int nFieldExtra = m_pdxType->getNumberOfExtraFields();
- LOGDEBUG(
- "PdxLocalReader::getPreservedData::nFieldExtra = %d AND "
- "PdxTypeRegistry::getPdxIgnoreUnreadFields = %d ",
- nFieldExtra, m_pdxTypeRegistry->getPdxIgnoreUnreadFields());
- if (nFieldExtra > 0 &&
- m_pdxTypeRegistry->getPdxIgnoreUnreadFields() == false) {
- m_pdxRemotePreserveData->initialize(
- m_pdxType != nullptr ? m_pdxType->getTypeId() : 0,
- mergedVersion->getTypeId(), nFieldExtra, pdxObject);
- LOGDEBUG("PdxLocalReader::getPreservedData - 1");
-
- m_localToRemoteMap = m_pdxType->getLocalToRemoteMap();
- m_remoteToLocalMap = m_pdxType->getRemoteToLocalMap();
-
- int currentIdx = 0;
- std::vector<int8_t> pdVector;
- for (int i = 0; i < m_remoteToLocalMapSize; i++) {
- if (m_remoteToLocalMap[i] == -1 ||
- m_remoteToLocalMap[i] == -2) // this field needs to preserve
- {
- int pos = m_pdxType->getFieldPosition(i, m_offsetsBuffer, m_offsetSize,
- m_serializedLength);
- int nFieldPos = 0;
-
- if (i == m_remoteToLocalMapSize - 1) {
- nFieldPos = m_serializedLength;
- } else {
- nFieldPos = m_pdxType->getFieldPosition(
- i + 1, m_offsetsBuffer, m_offsetSize, m_serializedLength);
- }
-
- resettoPdxHead();
- m_dataInput->advanceCursor(pos);
-
- for (int i = 0; i < (nFieldPos - pos); i++) {
- pdVector.push_back(m_dataInput->read());
- }
- resettoPdxHead();
-
- m_pdxRemotePreserveData->setPreservedData(pdVector);
- currentIdx++;
- pdVector.erase(pdVector.begin(), pdVector.end());
- } else {
- LOGDEBUG("PdxLocalReader::getPreservedData No need to preserve");
- }
- }
-
- if (m_isDataNeedToPreserve) {
- return m_pdxRemotePreserveData;
- } else {
- LOGDEBUG(
- "PdxLocalReader::GetPreservedData m_isDataNeedToPreserve is false");
- }
- }
- return nullptr;
+ }
+ std::shared_ptr<PdxRemotePreservedData> PdxLocalReader::getPreservedData(
+ std::shared_ptr<PdxType> mergedVersion,
+ std::shared_ptr<PdxSerializable> pdxObject) {
+ int nFieldExtra = m_pdxType->getNumberOfExtraFields();
+ LOGDEBUG(
+ "PdxLocalReader::getPreservedData::nFieldExtra = %d AND "
+ "PdxTypeRegistry::getPdxIgnoreUnreadFields = %d ",
+ nFieldExtra, m_pdxTypeRegistry->getPdxIgnoreUnreadFields());
+ if (nFieldExtra > 0 &&
+ m_pdxTypeRegistry->getPdxIgnoreUnreadFields() == false) {
+ m_pdxRemotePreserveData->initialize(
+ m_pdxType != nullptr ? m_pdxType->getTypeId() : 0,
+ mergedVersion->getTypeId(), nFieldExtra, pdxObject);
+ LOGDEBUG("PdxLocalReader::getPreservedData - 1");
+
+ m_localToRemoteMap = m_pdxType->getLocalToRemoteMap();
+ m_remoteToLocalMap = m_pdxType->getRemoteToLocalMap();
+
+ int currentIdx = 0;
+ std::vector<int8_t> pdVector;
+ for (int i = 0; i < m_remoteToLocalMapSize; i++) {
+ if (m_remoteToLocalMap[i] == -1 ||
+ m_remoteToLocalMap[i] == -2) // this field needs to preserve
+ {
+ int pos = m_pdxType->getFieldPosition(i, m_offsetsBuffer, m_offsetSize,
+ m_serializedLength);
+ int nFieldPos = 0;
+
+ if (i == m_remoteToLocalMapSize - 1) {
+ nFieldPos = m_serializedLength;
+ } else {
+ nFieldPos = m_pdxType->getFieldPosition(
+ i + 1, m_offsetsBuffer, m_offsetSize, m_serializedLength);
+ }
+
+ resettoPdxHead();
+ m_dataInput->advanceCursor(pos);
+
+ for (int i = 0; i < (nFieldPos - pos); i++) {
+ pdVector.push_back(m_dataInput->read());
+ }
+ resettoPdxHead();
+
+ m_pdxRemotePreserveData->setPreservedData(pdVector);
+ currentIdx++;
+ pdVector.erase(pdVector.begin(), pdVector.end());
+ } else {
+ LOGDEBUG("PdxLocalReader::getPreservedData No need to preserve");
+ }
+ }
+
+ if (m_isDataNeedToPreserve) {
+ return m_pdxRemotePreserveData;
+ } else {
+ LOGDEBUG(
+ "PdxLocalReader::GetPreservedData m_isDataNeedToPreserve is false");
+ }
+ }
+ return nullptr;
}
bool PdxLocalReader::hasField(const char* fieldName) {
@@ -347,16 +347,15 @@ bool PdxLocalReader::hasField(const char* fieldName) {
}
bool PdxLocalReader::isIdentityField(const char* fieldName) {
- PdxFieldTypePtr pft = m_pdxType->getPdxField(fieldName);
+ auto pft = m_pdxType->getPdxField(fieldName);
return (pft != nullptr) && (pft->getIdentityField());
}
-void PdxLocalReader::readCollection(const char* fieldName,
- CacheableArrayListPtr& collection) {
+void PdxLocalReader::readCollection(
+ const char* fieldName, std::shared_ptr<CacheableArrayList>& collection) {
collection = m_dataInput->readObject<CacheableArrayList>();
}
-
-PdxUnreadFieldsPtr PdxLocalReader::readUnreadFields() {
+std::shared_ptr<PdxUnreadFields> PdxLocalReader::readUnreadFields() {
LOGDEBUG("readUnreadFields:: %d ignore property %d", m_isDataNeedToPreserve,
m_pdxTypeRegistry->getPdxIgnoreUnreadFields());
if (m_pdxTypeRegistry->getPdxIgnoreUnreadFields() == true) return nullptr;
diff --git a/cppcache/src/PdxLocalReader.hpp b/cppcache/src/PdxLocalReader.hpp
index 439626f..654f1f1 100644
--- a/cppcache/src/PdxLocalReader.hpp
+++ b/cppcache/src/PdxLocalReader.hpp
@@ -33,7 +33,7 @@ namespace client {
class PdxLocalReader : public PdxReader {
protected:
DataInput* m_dataInput;
- PdxTypePtr m_pdxType;
+ std::shared_ptr<PdxType> m_pdxType;
uint8_t* m_startBuffer;
int32_t m_startPosition;
int32_t m_serializedLength;
@@ -41,7 +41,7 @@ class PdxLocalReader : public PdxReader {
int32_t m_offsetSize;
uint8_t* m_offsetsBuffer;
bool m_isDataNeedToPreserve;
- PdxRemotePreservedDataPtr m_pdxRemotePreserveData;
+ std::shared_ptr<PdxRemotePreservedData> m_pdxRemotePreserveData;
int32_t* m_localToRemoteMap;
int32_t* m_remoteToLocalMap;
int32_t m_remoteToLocalMapSize;
@@ -51,17 +51,19 @@ class PdxLocalReader : public PdxReader {
void checkEmptyFieldName(const char* fieldName);
public:
- PdxLocalReader(PdxTypeRegistryPtr pdxTypeRegistry);
+ PdxLocalReader(std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry);
- PdxLocalReader(DataInput& input, PdxTypePtr remoteType, int32_t pdxLen,
- PdxTypeRegistryPtr pdxTypeRegistry);
+ PdxLocalReader(DataInput& input, std::shared_ptr<PdxType> remoteType,
+ int32_t pdxLen,
+ std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry);
virtual ~PdxLocalReader();
void MoveStream();
- virtual PdxRemotePreservedDataPtr getPreservedData(
- PdxTypePtr mergedVersion, PdxSerializablePtr pdxObject);
+ virtual std::shared_ptr<PdxRemotePreservedData> getPreservedData(
+ std::shared_ptr<PdxType> mergedVersion,
+ std::shared_ptr<PdxSerializable> pdxObject);
/**
* Read a char value from the <code>PdxReader</code>.
@@ -137,9 +139,9 @@ class PdxLocalReader : public PdxReader {
/**
* Read a object from the <code>PdxReader</code>.
* @param fieldName name of the field which needs to serialize
- * Returns SerializablePtr
+ * Returns std::shared_ptr<Serializable>
*/
- virtual SerializablePtr readObject(const char* fieldName);
+ virtual std::shared_ptr<Serializable> readObject(const char* fieldName);
virtual char* readCharArray(const char* fieldName, int32_t& length);
@@ -198,28 +200,27 @@ class PdxLocalReader : public PdxReader {
virtual wchar_t** readWideStringArray(const char* fieldName, int32_t& length);
- virtual CacheableObjectArrayPtr readObjectArray(const char* fieldName);
+ virtual std::shared_ptr<CacheableObjectArray> readObjectArray(
+ const char* fieldName);
virtual int8_t** readArrayOfByteArrays(const char* fieldName,
int32_t& arrayLength,
int32_t** elementLength);
- virtual CacheableDatePtr readDate(const char* fieldName);
+ virtual std::shared_ptr<CacheableDate> readDate(const char* fieldName);
virtual bool hasField(const char* fieldName);
virtual bool isIdentityField(const char* fieldName);
virtual void readCollection(const char* fieldName,
- CacheableArrayListPtr& collection);
+ std::shared_ptr<CacheableArrayList>& collection);
- virtual PdxUnreadFieldsPtr readUnreadFields();
+ virtual std::shared_ptr<PdxUnreadFields> readUnreadFields();
protected:
-
- PdxTypeRegistryPtr m_pdxTypeRegistry;
+ std::shared_ptr<PdxTypeRegistry> m_pdxTypeRegistry;
};
-typedef std::shared_ptr<PdxLocalReader> PdxLocalReaderPtr;
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/PdxLocalWriter.cpp b/cppcache/src/PdxLocalWriter.cpp
index 0c81f12..92649b6 100644
--- a/cppcache/src/PdxLocalWriter.cpp
+++ b/cppcache/src/PdxLocalWriter.cpp
@@ -31,17 +31,19 @@ namespace apache {
namespace geode {
namespace client {
-PdxLocalWriter::PdxLocalWriter(DataOutput& output, PdxTypePtr pdxType,
- PdxTypeRegistryPtr pdxTypeRegistry)
+PdxLocalWriter::PdxLocalWriter(DataOutput& output,
+ std::shared_ptr<PdxType> pdxType,
+ std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry)
: PdxLocalWriter(output, pdxType,
pdxType ? pdxType->getPdxClassName() : nullptr,
pdxTypeRegistry)
{}
-PdxLocalWriter::PdxLocalWriter(DataOutput& dataOutput, PdxTypePtr pdxType,
+PdxLocalWriter::PdxLocalWriter(DataOutput& dataOutput,
+ std::shared_ptr<PdxType> pdxType,
const char* pdxClassName,
- PdxTypeRegistryPtr pdxTypeRegistry)
+ std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry)
: m_dataOutput(&dataOutput),
m_pdxType(pdxType),
m_pdxClassName(pdxClassName),
@@ -112,8 +114,8 @@ void PdxLocalWriter::writeOffsets(int32_t len) {
}
}
}
-
-PdxWriterPtr PdxLocalWriter::writeUnreadFields(PdxUnreadFieldsPtr unread) {
+std::shared_ptr<PdxWriter> PdxLocalWriter::writeUnreadFields(
+ std::shared_ptr<PdxUnreadFields> unread) {
if (isFieldWritingStarted()) {
throw IllegalStateException(
"WriteUnreadFields must be called before any other fields are "
@@ -158,65 +160,61 @@ int32_t PdxLocalWriter::calculateLenWithOffsets() {
}
bool PdxLocalWriter::isFieldWritingStarted() { return true; }
-
-PdxWriterPtr PdxLocalWriter::writeChar(const char* fieldName, char value) {
+std::shared_ptr<PdxWriter> PdxLocalWriter::writeChar(const char* fieldName,
+ char value) {
m_dataOutput->writeChar(static_cast<uint16_t>(value));
return shared_from_this();
}
-
-PdxWriterPtr PdxLocalWriter::writeChar(const char* fieldName, char16_t value) {
+std::shared_ptr<PdxWriter> PdxLocalWriter::writeChar(const char* fieldName,
+ char16_t value) {
m_dataOutput->writeChar(value);
return shared_from_this();
}
-
-PdxWriterPtr PdxLocalWriter::writeBoolean(const char* fieldName, bool value) {
+std::shared_ptr<PdxWriter> PdxLocalWriter::writeBoolean(const char* fieldName,
+ bool value) {
m_dataOutput->writeBoolean(value);
return shared_from_this();
-}
-
-PdxWriterPtr PdxLocalWriter::writeByte(const char* fieldName, int8_t value) {
- m_dataOutput->write(value);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxLocalWriter::writeShort(const char* fieldName, int16_t value) {
- m_dataOutput->writeInt(value);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxLocalWriter::writeInt(const char* fieldName, int32_t value) {
- m_dataOutput->writeInt(value);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxLocalWriter::writeLong(const char* fieldName, int64_t value) {
- m_dataOutput->writeInt(value);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxLocalWriter::writeFloat(const char* fieldName, float value) {
+ }
+ std::shared_ptr<PdxWriter> PdxLocalWriter::writeByte(const char* fieldName,
+ int8_t value) {
+ m_dataOutput->write(value);
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxWriter> PdxLocalWriter::writeShort(const char* fieldName,
+ int16_t value) {
+ m_dataOutput->writeInt(value);
+ return shared_from_this();
+}
+ std::shared_ptr<PdxWriter> PdxLocalWriter::writeInt(const char* fieldName, int32_t value) {
+ m_dataOutput->writeInt(value);
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxWriter> PdxLocalWriter::writeLong(const char* fieldName,
+ int64_t value) {
+ m_dataOutput->writeInt(value);
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxWriter> PdxLocalWriter::writeFloat(const char* fieldName, float value) {
m_dataOutput->writeFloat(value);
return shared_from_this();
-}
-
-PdxWriterPtr PdxLocalWriter::writeDouble(const char* fieldName, double value) {
- m_dataOutput->writeDouble(value);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxLocalWriter::writeDate(const char* fieldName,
- CacheableDatePtr date) {
- // m_dataOutput->writeObject(date.get());
- if (date != nullptr) {
- date->toData(*m_dataOutput);
- } else {
- m_dataOutput->writeInt(static_cast<uint64_t>(-1L));
- }
- return shared_from_this();
-}
-
-PdxWriterPtr PdxLocalWriter::writeString(const char* fieldName,
- const char* value) {
+ }
+ std::shared_ptr<PdxWriter> PdxLocalWriter::writeDouble(const char* fieldName,
+ double value) {
+ m_dataOutput->writeDouble(value);
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxWriter> PdxLocalWriter::writeDate(
+ const char* fieldName, std::shared_ptr<CacheableDate> date) {
+ // m_dataOutput->writeObject(date.get());
+ if (date != nullptr) {
+ date->toData(*m_dataOutput);
+ } else {
+ m_dataOutput->writeInt(static_cast<uint64_t>(-1L));
+ }
+ return shared_from_this();
+}
+std::shared_ptr<PdxWriter> PdxLocalWriter::writeString(const char* fieldName,
+ const char* value) {
addOffset();
if (value == nullptr) {
m_dataOutput->write(static_cast<int8_t>(GeodeTypeIds::CacheableNullString));
@@ -235,8 +233,7 @@ PdxWriterPtr PdxLocalWriter::writeString(const char* fieldName,
}
return shared_from_this();
}
-
-PdxWriterPtr PdxLocalWriter::writeWideString(const char* fieldName,
+ std::shared_ptr<PdxWriter> PdxLocalWriter::writeWideString(const char* fieldName,
const wchar_t* value) {
addOffset();
if (value == nullptr) {
@@ -256,8 +253,7 @@ PdxWriterPtr PdxLocalWriter::writeWideString(const char* fieldName,
}
return shared_from_this();
}
-
-PdxWriterPtr PdxLocalWriter::writeStringwithoutOffset(const char* value) {
+ std::shared_ptr<PdxWriter> PdxLocalWriter::writeStringwithoutOffset(const char* value) {
if (value == nullptr) {
m_dataOutput->write(static_cast<int8_t>(GeodeTypeIds::CacheableNullString));
} else {
@@ -275,8 +271,7 @@ PdxWriterPtr PdxLocalWriter::writeStringwithoutOffset(const char* value) {
}
return shared_from_this();
}
-
-PdxWriterPtr PdxLocalWriter::writeWideStringwithoutOffset(
+ std::shared_ptr<PdxWriter> PdxLocalWriter::writeWideStringwithoutOffset(
const wchar_t* value) {
if (value == nullptr) {
m_dataOutput->write(static_cast<int8_t>(GeodeTypeIds::CacheableNullString));
@@ -295,8 +290,7 @@ PdxWriterPtr PdxLocalWriter::writeWideStringwithoutOffset(
}
return shared_from_this();
}
-
-PdxWriterPtr PdxLocalWriter::writeStringArray(const char* fieldName,
+ std::shared_ptr<PdxWriter> PdxLocalWriter::writeStringArray(const char* fieldName,
char** array, int length) {
addOffset();
if (array == nullptr) {
@@ -310,9 +304,8 @@ PdxWriterPtr PdxLocalWriter::writeStringArray(const char* fieldName,
}
return shared_from_this();
}
-
-PdxWriterPtr PdxLocalWriter::writeWideStringArray(const char* fieldName,
- wchar_t** array, int length) {
+std::shared_ptr<PdxWriter> PdxLocalWriter::writeWideStringArray(
+ const char* fieldName, wchar_t** array, int length) {
addOffset();
if (array == nullptr) {
m_dataOutput->write(static_cast<int8_t>(-1));
@@ -324,12 +317,11 @@ PdxWriterPtr PdxLocalWriter::writeWideStringArray(const char* fieldName,
}
return shared_from_this();
}
-
-PdxWriterPtr PdxLocalWriter::writeObject(const char* fieldName,
- SerializablePtr value) {
+std::shared_ptr<PdxWriter> PdxLocalWriter::writeObject(
+ const char* fieldName, std::shared_ptr<Serializable> value) {
addOffset();
- CacheableEnumPtr enumValPtr = nullptr;
- CacheableObjectArrayPtr objArrPtr = nullptr;
+ std::shared_ptr<CacheableEnum> enumValPtr = nullptr;
+ std::shared_ptr<CacheableObjectArray> objArrPtr = nullptr;
/*if (value != nullptr) {
try {
enumValPtr = std::dynamic_pointer_cast<CacheableEnum>(value);
@@ -372,85 +364,74 @@ PdxWriterPtr PdxLocalWriter::writeObject(const char* fieldName,
}
return shared_from_this();
}
-
-PdxWriterPtr PdxLocalWriter::writeBooleanArray(const char* fieldName,
+ std::shared_ptr<PdxWriter> PdxLocalWriter::writeBooleanArray(const char* fieldName,
bool* array, int length) {
addOffset();
writeObject(array, length);
return shared_from_this();
}
-
-PdxWriterPtr PdxLocalWriter::writeCharArray(const char* fieldName, char* array,
+ std::shared_ptr<PdxWriter> PdxLocalWriter::writeCharArray(const char* fieldName, char* array,
int length) {
addOffset();
writePdxCharArray(array, length);
return shared_from_this();
}
-
-PdxWriterPtr PdxLocalWriter::writeWideCharArray(const char* fieldName,
- wchar_t* array, int length) {
+std::shared_ptr<PdxWriter> PdxLocalWriter::writeWideCharArray(
+ const char* fieldName, wchar_t* array, int length) {
addOffset();
writeObject(array, length);
return shared_from_this();
}
-
-PdxWriterPtr PdxLocalWriter::writeByteArray(const char* fieldName,
- int8_t* array, int length) {
+std::shared_ptr<PdxWriter> PdxLocalWriter::writeByteArray(const char* fieldName,
+ int8_t* array,
+ int length) {
addOffset();
writeObject(array, length);
return shared_from_this();
}
-
-PdxWriterPtr PdxLocalWriter::writeShortArray(const char* fieldName,
- int16_t* array, int length) {
+std::shared_ptr<PdxWriter> PdxLocalWriter::writeShortArray(
+ const char* fieldName, int16_t* array, int length) {
addOffset();
writeObject(array, length);
return shared_from_this();
}
-
-PdxWriterPtr PdxLocalWriter::writeIntArray(const char* fieldName,
+ std::shared_ptr<PdxWriter> PdxLocalWriter::writeIntArray(const char* fieldName,
int32_t* array, int length) {
- addOffset();
- writeObject(array, length);
- return shared_from_this();
+ addOffset();
+ writeObject(array, length);
+ return shared_from_this();
}
-
-PdxWriterPtr PdxLocalWriter::writeLongArray(const char* fieldName,
+ std::shared_ptr<PdxWriter> PdxLocalWriter::writeLongArray(const char* fieldName,
int64_t* array, int length) {
addOffset();
writeObject(array, length);
return shared_from_this();
-}
-
-PdxWriterPtr PdxLocalWriter::writeFloatArray(const char* fieldName,
+ }
+ std::shared_ptr<PdxWriter> PdxLocalWriter::writeFloatArray(const char* fieldName,
float* array, int length) {
addOffset();
writeObject(array, length);
return shared_from_this();
-}
-
-PdxWriterPtr PdxLocalWriter::writeDoubleArray(const char* fieldName,
- double* array, int length) {
- addOffset();
- writeObject(array, length);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxLocalWriter::writeObjectArray(const char* fieldName,
- CacheableObjectArrayPtr array) {
- addOffset();
- if (array != nullptr) {
- array->toData(*m_dataOutput);
- } else {
- m_dataOutput->write(static_cast<int8_t>(-1));
- }
- return shared_from_this();
-}
-
-PdxWriterPtr PdxLocalWriter::writeArrayOfByteArrays(const char* fieldName,
- int8_t** byteArrays,
- int arrayLength,
- int* elementLength) {
+ }
+ std::shared_ptr<PdxWriter> PdxLocalWriter::writeDoubleArray(
+ const char* fieldName, double* array, int length) {
+ addOffset();
+ writeObject(array, length);
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxWriter> PdxLocalWriter::writeObjectArray(
+ const char* fieldName, std::shared_ptr<CacheableObjectArray> array) {
+ addOffset();
+ if (array != nullptr) {
+ array->toData(*m_dataOutput);
+ } else {
+ m_dataOutput->write(static_cast<int8_t>(-1));
+ }
+ return shared_from_this();
+}
+std::shared_ptr<PdxWriter> PdxLocalWriter::writeArrayOfByteArrays(
+ const char* fieldName, int8_t** byteArrays, int arrayLength,
+ int* elementLength) {
addOffset();
if (byteArrays != nullptr) {
m_dataOutput->writeArrayLen(arrayLength);
@@ -463,8 +444,8 @@ PdxWriterPtr PdxLocalWriter::writeArrayOfByteArrays(const char* fieldName,
return shared_from_this();
}
-
-PdxWriterPtr PdxLocalWriter::markIdentityField(const char* fieldName) {
+std::shared_ptr<PdxWriter> PdxLocalWriter::markIdentityField(
+ const char* fieldName) {
return shared_from_this();
}
@@ -478,8 +459,7 @@ uint8_t* PdxLocalWriter::getPdxStream(int& pdxLen) {
}
void PdxLocalWriter::writeByte(int8_t byte) { m_dataOutput->write(byte); }
-
-PdxTypeRegistryPtr PdxLocalWriter::getPdxTypeRegistry() const {
+std::shared_ptr<PdxTypeRegistry> PdxLocalWriter::getPdxTypeRegistry() const {
return m_pdxTypeRegistry;
}
diff --git a/cppcache/src/PdxLocalWriter.hpp b/cppcache/src/PdxLocalWriter.hpp
index 78de0aa..8f48725 100644
--- a/cppcache/src/PdxLocalWriter.hpp
+++ b/cppcache/src/PdxLocalWriter.hpp
@@ -38,27 +38,28 @@ class PdxLocalWriter : public PdxWriter,
public std::enable_shared_from_this<PdxLocalWriter> {
protected:
DataOutput* m_dataOutput;
- PdxTypePtr m_pdxType;
+ std::shared_ptr<PdxType> m_pdxType;
const uint8_t* m_startPosition;
int32_t m_startPositionOffset;
const char* m_domainClassName;
std::vector<int32_t> m_offsets;
int32_t m_currentOffsetIndex;
- PdxRemotePreservedDataPtr m_preserveData;
- PdxTypeRegistryPtr m_pdxTypeRegistry;
+ std::shared_ptr<PdxRemotePreservedData> m_preserveData;
+ std::shared_ptr<PdxTypeRegistry> m_pdxTypeRegistry;
const char* m_pdxClassName;
- PdxWriterPtr writeStringwithoutOffset(const char* value);
+ std::shared_ptr<PdxWriter> writeStringwithoutOffset(const char* value);
- PdxWriterPtr writeWideStringwithoutOffset(const wchar_t* value);
+ std::shared_ptr<PdxWriter> writeWideStringwithoutOffset(const wchar_t* value);
public:
- PdxLocalWriter(DataOutput& output, PdxTypePtr pdxType,
- PdxTypeRegistryPtr pdxTypeRegistry);
+ PdxLocalWriter(DataOutput& output, std::shared_ptr<PdxType> pdxType,
+ std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry);
- PdxLocalWriter(DataOutput& output, PdxTypePtr pdxType,
- const char* pdxDomainType, PdxTypeRegistryPtr pdxTypeRegistry);
+ PdxLocalWriter(DataOutput& output, std::shared_ptr<PdxType> pdxType,
+ const char* pdxDomainType,
+ std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry);
virtual ~PdxLocalWriter();
@@ -134,175 +135,190 @@ class PdxLocalWriter : public PdxWriter,
*@param fieldName The name of the field associated with the value.
*@param value The wide char value to write
*/
- virtual PdxWriterPtr writeChar(const char* fieldName, char value);
+ virtual std::shared_ptr<PdxWriter> writeChar(const char* fieldName,
+ char value);
- virtual PdxWriterPtr writeChar(const char* fieldName, char16_t value);
+ virtual std::shared_ptr<PdxWriter> writeChar(const char* fieldName,
+ char16_t value);
/**
*Write a boolean value to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The boolean value to write
*/
- virtual PdxWriterPtr writeBoolean(const char* fieldName, bool value);
+ virtual std::shared_ptr<PdxWriter> writeBoolean(const char* fieldName,
+ bool value);
/**
*Write a 8-bit integer or byte to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The 8-bit integer or byte to write
*/
- virtual PdxWriterPtr writeByte(const char* fieldName, int8_t value);
+ virtual std::shared_ptr<PdxWriter> writeByte(const char* fieldName,
+ int8_t value);
/**
*Write a 16-bit integer to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The 16-bit integer to write
*/
- virtual PdxWriterPtr writeShort(const char* fieldName, int16_t value);
+ virtual std::shared_ptr<PdxWriter> writeShort(const char* fieldName,
+ int16_t value);
/**
*Write a 32-bit integer to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The 32-bit integer to write
*/
- virtual PdxWriterPtr writeInt(const char* fieldName, int32_t value);
+ virtual std::shared_ptr<PdxWriter> writeInt(const char* fieldName,
+ int32_t value);
/**
*Write a long integer to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The long integer to write
*/
- virtual PdxWriterPtr writeLong(const char* fieldName, int64_t value);
+ virtual std::shared_ptr<PdxWriter> writeLong(const char* fieldName,
+ int64_t value);
/**
*Write a Float to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The float value to write
*/
- virtual PdxWriterPtr writeFloat(const char* fieldName, float value);
+ virtual std::shared_ptr<PdxWriter> writeFloat(const char* fieldName,
+ float value);
/**
*Write a Double to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The double value to write
*/
- virtual PdxWriterPtr writeDouble(const char* fieldName, double value);
+ virtual std::shared_ptr<PdxWriter> writeDouble(const char* fieldName,
+ double value);
/**
*Write a Date to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The date value to write
*/
- virtual PdxWriterPtr writeDate(const char* fieldName, CacheableDatePtr date);
+ virtual std::shared_ptr<PdxWriter> writeDate(
+ const char* fieldName, std::shared_ptr<CacheableDate> date);
/**
*Write a string to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The string to write
*/
- virtual PdxWriterPtr writeString(const char* fieldName, const char* value);
+ virtual std::shared_ptr<PdxWriter> writeString(const char* fieldName,
+ const char* value);
- virtual PdxWriterPtr writeWideString(const char* fieldName,
- const wchar_t* value);
+ virtual std::shared_ptr<PdxWriter> writeWideString(const char* fieldName,
+ const wchar_t* value);
/**
*Write a object to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The object to write
*/
- virtual PdxWriterPtr writeObject(const char* fieldName,
- SerializablePtr value);
+ virtual std::shared_ptr<PdxWriter> writeObject(
+ const char* fieldName, std::shared_ptr<Serializable> value);
/**
*Write a boolean array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The boolean array value to write
*/
- virtual PdxWriterPtr writeBooleanArray(const char* fieldName, bool* array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeBooleanArray(const char* fieldName,
+ bool* array, int length);
/**
*Write a Char array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The char array value to write
*/
- virtual PdxWriterPtr writeCharArray(const char* fieldName, char* array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeCharArray(const char* fieldName,
+ char* array, int length);
- virtual PdxWriterPtr writeWideCharArray(const char* fieldName, wchar_t* array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeWideCharArray(const char* fieldName,
+ wchar_t* array,
+ int length);
/**
*Write a Byte array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The byte array value to write
*/
- virtual PdxWriterPtr writeByteArray(const char* fieldName, int8_t* array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeByteArray(const char* fieldName,
+ int8_t* array, int length);
/**
*Write a 16-bit integer array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The array value to write
*/
- virtual PdxWriterPtr writeShortArray(const char* fieldName, int16_t* array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeShortArray(const char* fieldName,
+ int16_t* array,
+ int length);
/**
*Write a 32-bit integer array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The integer array value to write
*/
- virtual PdxWriterPtr writeIntArray(const char* fieldName, int32_t* array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeIntArray(const char* fieldName,
+ int32_t* array, int length);
/**
*Write a long integer array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The long integer array value to write
*/
- virtual PdxWriterPtr writeLongArray(const char* fieldName, int64_t* array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeLongArray(const char* fieldName,
+ int64_t* array, int length);
/**
*Write a Float array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The float array value to write
*/
- virtual PdxWriterPtr writeFloatArray(const char* fieldName, float* array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeFloatArray(const char* fieldName,
+ float* array, int length);
/**
*Write a double array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The double array value to write
*/
- virtual PdxWriterPtr writeDoubleArray(const char* fieldName, double* array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeDoubleArray(const char* fieldName,
+ double* array,
+ int length);
/**
*Write a string array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The string array value to write
*/
- virtual PdxWriterPtr writeStringArray(const char* fieldName, char** array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeStringArray(const char* fieldName,
+ char** array, int length);
- virtual PdxWriterPtr writeWideStringArray(const char* fieldName,
- wchar_t** array, int length);
+ virtual std::shared_ptr<PdxWriter> writeWideStringArray(const char* fieldName,
+ wchar_t** array,
+ int length);
/**
*Write a object array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The object array value to write
*/
- virtual PdxWriterPtr writeObjectArray(const char* fieldName,
- CacheableObjectArrayPtr array);
+ virtual std::shared_ptr<PdxWriter> writeObjectArray(
+ const char* fieldName, std::shared_ptr<CacheableObjectArray> array);
/**
*Write a array of byte arrays to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param array The arrayOfbytearray value to write
*/
- virtual PdxWriterPtr writeArrayOfByteArrays(const char* fieldName,
- int8_t** array, int arrayLength,
- int* elementLength);
+ virtual std::shared_ptr<PdxWriter> writeArrayOfByteArrays(
+ const char* fieldName, int8_t** array, int arrayLength,
+ int* elementLength);
/**
*Indicate that the given field name should be included in hashCode and equals
@@ -324,11 +340,12 @@ class PdxLocalWriter : public PdxWriter,
*
*@param fieldName The name of the field that should be used in the as part of
*the identity.
- *@eturns this PdxWriterPtr
+ *@eturns this std::shared_ptr<PdxWriter>
*/
- virtual PdxWriterPtr markIdentityField(const char* fieldName);
+ virtual std::shared_ptr<PdxWriter> markIdentityField(const char* fieldName);
- virtual PdxWriterPtr writeUnreadFields(PdxUnreadFieldsPtr unread);
+ virtual std::shared_ptr<PdxWriter> writeUnreadFields(
+ std::shared_ptr<PdxUnreadFields> unread);
// this is used to get pdx stream when WriteablePdxStream udpadates the field
// It should be called after pdx stream has been written to output
@@ -339,9 +356,8 @@ class PdxLocalWriter : public PdxWriter,
inline int32_t getStartPositionOffset() { return m_startPositionOffset; }
private:
- PdxTypeRegistryPtr getPdxTypeRegistry() const;
+ std::shared_ptr<PdxTypeRegistry> getPdxTypeRegistry() const;
};
-typedef std::shared_ptr<PdxLocalWriter> PdxLocalWriterPtr;
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/PdxReaderWithTypeCollector.cpp b/cppcache/src/PdxReaderWithTypeCollector.cpp
index 32d4f01..3962cec 100644
--- a/cppcache/src/PdxReaderWithTypeCollector.cpp
+++ b/cppcache/src/PdxReaderWithTypeCollector.cpp
@@ -32,8 +32,8 @@ namespace geode {
namespace client {
PdxReaderWithTypeCollector::PdxReaderWithTypeCollector(
- DataInput& dataInput, PdxTypePtr pdxType, int32_t pdxlen,
- PdxTypeRegistryPtr pdxTypeRegistry)
+ DataInput& dataInput, std::shared_ptr<PdxType> pdxType, int32_t pdxlen,
+ std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry)
: PdxLocalReader(dataInput, pdxType, pdxlen, pdxTypeRegistry) {
m_newPdxType = std::make_shared<PdxType>(m_pdxTypeRegistry ,pdxType->getPdxClassName(), true);
}
@@ -47,7 +47,7 @@ void PdxReaderWithTypeCollector::checkType(const char* fieldName, int8_t typeId,
throw IllegalStateException("Field name is null");
}
- PdxFieldTypePtr pft = m_pdxType->getPdxField(fieldName);
+ auto pft = m_pdxType->getPdxField(fieldName);
if (pft != nullptr) {
if (typeId != pft->getTypeId()) {
char excpStr[128] = {0};
@@ -267,15 +267,15 @@ wchar_t* PdxReaderWithTypeCollector::readWideString(const char* fieldName) {
return emptyString;
}
}
-
-SerializablePtr PdxReaderWithTypeCollector::readObject(const char* fieldName) {
+std::shared_ptr<Serializable> PdxReaderWithTypeCollector::readObject(
+ const char* fieldName) {
// field is collected after reading
checkType(fieldName, PdxFieldTypes::OBJECT, "Serializable");
int position = m_pdxType->getFieldPosition(fieldName, m_offsetsBuffer,
m_offsetSize, m_serializedLength);
LOGDEBUG("PdxReaderWithTypeCollector::readObject():position = %d", position);
if (position != -1) {
- SerializablePtr ptr;
+ std::shared_ptr<Serializable> ptr;
m_dataInput->advanceCursor(position);
const uint8_t* startLoc = m_dataInput->currentBufferPosition();
ptr = PdxLocalReader::readObject(fieldName);
@@ -553,9 +553,8 @@ wchar_t** PdxReaderWithTypeCollector::readWideStringArray(const char* fieldName,
return nullptr;
}
}
-
-CacheableObjectArrayPtr PdxReaderWithTypeCollector::readObjectArray(
- const char* fieldName) {
+std::shared_ptr<CacheableObjectArray>
+PdxReaderWithTypeCollector::readObjectArray(const char* fieldName) {
checkType(fieldName, PdxFieldTypes::OBJECT_ARRAY, "Object[]");
m_newPdxType->addVariableLengthTypeField(fieldName, "Object[]",
PdxFieldTypes::OBJECT_ARRAY);
@@ -566,12 +565,12 @@ CacheableObjectArrayPtr PdxReaderWithTypeCollector::readObjectArray(
if (position != -1) {
m_dataInput->advanceCursor(position);
const uint8_t* startLoc = m_dataInput->currentBufferPosition();
- CacheableObjectArrayPtr retVal = PdxLocalReader::readObjectArray(fieldName);
- int32_t strSize =
- static_cast<int32_t>(m_dataInput->currentBufferPosition() - startLoc);
- m_dataInput->rewindCursor(strSize + position);
- startLoc = nullptr;
- return retVal;
+ auto retVal = PdxLocalReader::readObjectArray(fieldName);
+ int32_t strSize =
+ static_cast<int32_t>(m_dataInput->currentBufferPosition() - startLoc);
+ m_dataInput->rewindCursor(strSize + position);
+ startLoc = nullptr;
+ return retVal;
} else {
return nullptr;
}
@@ -600,26 +599,25 @@ int8_t** PdxReaderWithTypeCollector::readArrayOfByteArrays(
return nullptr;
}
}
-
-CacheableDatePtr PdxReaderWithTypeCollector::readDate(const char* fieldName) {
- checkType(fieldName, PdxFieldTypes::DATE, "Date");
- m_newPdxType->addFixedLengthTypeField(fieldName, "Date", PdxFieldTypes::DATE,
- PdxTypes::DATE_SIZE);
- int position = m_pdxType->getFieldPosition(fieldName, m_offsetsBuffer,
- m_offsetSize, m_serializedLength);
- LOGDEBUG("PdxReaderWithTypeCollector::readDate() position = %d", position);
- if (position != -1) {
- m_dataInput->advanceCursor(position);
- CacheableDatePtr retVal = PdxLocalReader::readDate(fieldName);
- m_dataInput->rewindCursor(position + PdxTypes::DATE_SIZE);
- return retVal;
+ std::shared_ptr<CacheableDate> PdxReaderWithTypeCollector::readDate(const char* fieldName) {
+ checkType(fieldName, PdxFieldTypes::DATE, "Date");
+ m_newPdxType->addFixedLengthTypeField(fieldName, "Date", PdxFieldTypes::DATE,
+ PdxTypes::DATE_SIZE);
+ int position = m_pdxType->getFieldPosition(fieldName, m_offsetsBuffer,
+ m_offsetSize, m_serializedLength);
+ LOGDEBUG("PdxReaderWithTypeCollector::readDate() position = %d", position);
+ if (position != -1) {
+ m_dataInput->advanceCursor(position);
+ auto retVal = PdxLocalReader::readDate(fieldName);
+ m_dataInput->rewindCursor(position + PdxTypes::DATE_SIZE);
+ return retVal;
} else {
return nullptr;
}
}
void PdxReaderWithTypeCollector::readCollection(
- const char* fieldName, CacheableArrayListPtr& collection) {
+ const char* fieldName, std::shared_ptr<CacheableArrayList>& collection) {
checkType(fieldName, apache::geode::client::GeodeTypeIds::CacheableArrayList,
"Collection");
m_newPdxType->addVariableLengthTypeField(
diff --git a/cppcache/src/PdxReaderWithTypeCollector.hpp b/cppcache/src/PdxReaderWithTypeCollector.hpp
index fff07a0..1bf310b 100644
--- a/cppcache/src/PdxReaderWithTypeCollector.hpp
+++ b/cppcache/src/PdxReaderWithTypeCollector.hpp
@@ -29,17 +29,18 @@ namespace client {
class PdxReaderWithTypeCollector : public PdxLocalReader {
private:
- PdxTypePtr m_newPdxType;
+ std::shared_ptr<PdxType> m_newPdxType;
void checkType(const char* fieldName, int8_t typeId, const char* fieldType);
public:
- PdxReaderWithTypeCollector(DataInput& dataInput, PdxTypePtr pdxType,
- int pdxlen, PdxTypeRegistryPtr pdxTypeRegistry);
+ PdxReaderWithTypeCollector(DataInput& dataInput,
+ std::shared_ptr<PdxType> pdxType, int pdxlen,
+ std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry);
virtual ~PdxReaderWithTypeCollector();
- PdxTypePtr getLocalType() const { return m_newPdxType; }
+ std::shared_ptr<PdxType> getLocalType() const { return m_newPdxType; }
virtual char readChar(const char* fieldName);
@@ -103,7 +104,7 @@ class PdxReaderWithTypeCollector : public PdxLocalReader {
* @param fieldName name of the field which needs to serialize
* Returns String value
*/
- virtual SerializablePtr readObject(const char* fieldName);
+ virtual std::shared_ptr<Serializable> readObject(const char* fieldName);
virtual char* readCharArray(const char* fieldName, int32_t& length);
@@ -162,19 +163,19 @@ class PdxReaderWithTypeCollector : public PdxLocalReader {
virtual wchar_t** readWideStringArray(const char* fieldName, int32_t& length);
- virtual CacheableObjectArrayPtr readObjectArray(const char* fieldName);
+ virtual std::shared_ptr<CacheableObjectArray> readObjectArray(
+ const char* fieldName);
virtual int8_t** readArrayOfByteArrays(const char* fieldName,
int32_t& arrayLength,
int32_t** elementLength);
- virtual CacheableDatePtr readDate(const char* fieldName);
+ virtual std::shared_ptr<CacheableDate> readDate(const char* fieldName);
virtual void readCollection(const char* fieldName,
- CacheableArrayListPtr& collection);
+ std::shared_ptr<CacheableArrayList>& collection);
};
-typedef std::shared_ptr<PdxReaderWithTypeCollector>
- PdxReaderWithTypeCollectorPtr;
+
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/PdxRemotePreservedData.hpp b/cppcache/src/PdxRemotePreservedData.hpp
index 07d6ac3..8833163 100644
--- a/cppcache/src/PdxRemotePreservedData.hpp
+++ b/cppcache/src/PdxRemotePreservedData.hpp
@@ -27,7 +27,6 @@ namespace apache {
namespace geode {
namespace client {
class PdxRemotePreservedData;
-typedef std::shared_ptr<PdxRemotePreservedData> PdxRemotePreservedDataPtr;
class PdxRemotePreservedData : public PdxUnreadFields {
private:
@@ -35,7 +34,7 @@ class PdxRemotePreservedData : public PdxUnreadFields {
int32_t m_typeId;
int32_t m_mergedTypeId;
int32_t m_currentIndex;
- SerializablePtr /*Object^*/ m_owner;
+ std::shared_ptr<Serializable> /*Object^*/ m_owner;
long m_expiryTakId;
public:
@@ -56,7 +55,7 @@ class PdxRemotePreservedData : public PdxUnreadFields {
}
PdxRemotePreservedData(int32_t typeId, int32_t mergedTypeId,
int32_t numberOfFields, /*Object^*/
- SerializablePtr owner) {
+ std::shared_ptr<Serializable> owner) {
m_typeId = typeId;
m_mergedTypeId = mergedTypeId;
m_currentIndex = 0;
@@ -66,7 +65,7 @@ class PdxRemotePreservedData : public PdxUnreadFields {
void initialize(int32_t typeId, int32_t mergedTypeId,
int32_t numberOfFields, /*Object^*/
- SerializablePtr owner) {
+ std::shared_ptr<Serializable> owner) {
m_typeId = typeId;
m_mergedTypeId = mergedTypeId;
m_currentIndex = 0;
@@ -82,9 +81,9 @@ class PdxRemotePreservedData : public PdxUnreadFields {
inline long getPreservedDataExpiryTaskId() { return m_expiryTakId; }
- SerializablePtr getOwner() { return m_owner; }
+ std::shared_ptr<Serializable> getOwner() { return m_owner; }
- void setOwner(SerializablePtr val) { m_owner = val; }
+ void setOwner(std::shared_ptr<Serializable> val) { m_owner = val; }
inline std::vector<int8_t> getPreservedData(int32_t idx) {
return m_preservedData[idx];
@@ -94,7 +93,7 @@ class PdxRemotePreservedData : public PdxUnreadFields {
m_preservedData.push_back(inputVector);
}
- virtual bool equals(SerializablePtr otherObject) {
+ virtual bool equals(std::shared_ptr<Serializable> otherObject) {
if (otherObject == nullptr) return false;
if (m_owner == nullptr) return false;
diff --git a/cppcache/src/PdxRemoteReader.cpp b/cppcache/src/PdxRemoteReader.cpp
index f838806..e789bb3 100644
--- a/cppcache/src/PdxRemoteReader.cpp
+++ b/cppcache/src/PdxRemoteReader.cpp
@@ -329,8 +329,8 @@ wchar_t* PdxRemoteReader::readWideString(const char* fieldName) {
}
}
}
-
-SerializablePtr PdxRemoteReader::readObject(const char* fieldName) {
+std::shared_ptr<Serializable> PdxRemoteReader::readObject(
+ const char* fieldName) {
int choice = m_localToRemoteMap[m_currentIndex++];
switch (choice) {
@@ -345,7 +345,7 @@ SerializablePtr PdxRemoteReader::readObject(const char* fieldName) {
int position = m_pdxType->getFieldPosition(
choice, m_offsetsBuffer, m_offsetSize, m_serializedLength);
if (position != -1) {
- SerializablePtr ptr;
+ std::shared_ptr<Serializable> ptr;
PdxLocalReader::resettoPdxHead();
m_dataInput->advanceCursor(position);
ptr = PdxLocalReader::readObject(fieldName);
@@ -663,8 +663,7 @@ wchar_t** PdxRemoteReader::readWideStringArray(const char* fieldName,
}
}
}
-
-CacheableObjectArrayPtr PdxRemoteReader::readObjectArray(
+std::shared_ptr<CacheableObjectArray> PdxRemoteReader::readObjectArray(
const char* fieldName) {
int choice = m_localToRemoteMap[m_currentIndex++];
@@ -680,8 +679,7 @@ CacheableObjectArrayPtr PdxRemoteReader::readObjectArray(
choice, m_offsetsBuffer, m_offsetSize, m_serializedLength);
PdxLocalReader::resettoPdxHead();
m_dataInput->advanceCursor(position);
- CacheableObjectArrayPtr retVal =
- PdxLocalReader::readObjectArray(fieldName);
+ auto retVal = PdxLocalReader::readObjectArray(fieldName);
PdxLocalReader::resettoPdxHead();
return retVal;
}
@@ -712,30 +710,29 @@ int8_t** PdxRemoteReader::readArrayOfByteArrays(const char* fieldName,
}
}
}
-
-CacheableDatePtr PdxRemoteReader::readDate(const char* fieldName) {
- int choice = m_localToRemoteMap[m_currentIndex++];
-
- switch (choice) {
- case -2:
- return PdxLocalReader::readDate(fieldName); // in same order
- case -1:
- return nullptr;
- default: {
- // sequence id read field and then update
- int position = m_pdxType->getFieldPosition(
- choice, m_offsetsBuffer, m_offsetSize, m_serializedLength);
- PdxLocalReader::resettoPdxHead();
- m_dataInput->advanceCursor(position);
- CacheableDatePtr retVal = PdxLocalReader::readDate(fieldName);
- PdxLocalReader::resettoPdxHead();
- return retVal;
- }
+ std::shared_ptr<CacheableDate> PdxRemoteReader::readDate(const char* fieldName) {
+ int choice = m_localToRemoteMap[m_currentIndex++];
+
+ switch (choice) {
+ case -2:
+ return PdxLocalReader::readDate(fieldName); // in same order
+ case -1:
+ return nullptr;
+ default: {
+ // sequence id read field and then update
+ int position = m_pdxType->getFieldPosition(
+ choice, m_offsetsBuffer, m_offsetSize, m_serializedLength);
+ PdxLocalReader::resettoPdxHead();
+ m_dataInput->advanceCursor(position);
+ auto retVal = PdxLocalReader::readDate(fieldName);
+ PdxLocalReader::resettoPdxHead();
+ return retVal;
+ }
}
}
void PdxRemoteReader::readCollection(const char* fieldName,
- CacheableArrayListPtr& collection) {
+ std::shared_ptr<CacheableArrayList>& collection) {
int choice = m_localToRemoteMap[m_currentIndex++];
switch (choice) {
diff --git a/cppcache/src/PdxRemoteReader.hpp b/cppcache/src/PdxRemoteReader.hpp
index 8459832..c8eb414 100644
--- a/cppcache/src/PdxRemoteReader.hpp
+++ b/cppcache/src/PdxRemoteReader.hpp
@@ -31,8 +31,9 @@ class PdxRemoteReader : public PdxLocalReader {
int32_t m_currentIndex;
public:
- PdxRemoteReader(DataInput& dataInput, PdxTypePtr remoteType, int32_t pdxLen,
- PdxTypeRegistryPtr pdxTypeRegistry)
+ PdxRemoteReader(DataInput& dataInput, std::shared_ptr<PdxType> remoteType,
+ int32_t pdxLen,
+ std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry)
: PdxLocalReader(dataInput, remoteType, pdxLen, pdxTypeRegistry) {
m_currentIndex = 0;
}
@@ -132,7 +133,7 @@ class PdxRemoteReader : public PdxLocalReader {
* @param fieldName name of the field which needs to serialize
* @param value value of the field which needs to serialize
*/
- virtual SerializablePtr readObject(const char* fieldName);
+ virtual std::shared_ptr<Serializable> readObject(const char* fieldName);
virtual char* readCharArray(const char* fieldName, int32_t& length);
@@ -191,13 +192,14 @@ class PdxRemoteReader : public PdxLocalReader {
virtual wchar_t** readWideStringArray(const char* fieldName, int32_t& length);
- virtual CacheableObjectArrayPtr readObjectArray(const char* fieldName);
+ virtual std::shared_ptr<CacheableObjectArray> readObjectArray(
+ const char* fieldName);
virtual int8_t** readArrayOfByteArrays(const char* fieldName,
int32_t& arrayLength,
int32_t** elementLength);
- virtual CacheableDatePtr readDate(const char* fieldName);
+ virtual std::shared_ptr<CacheableDate> readDate(const char* fieldName);
/*virtual void readBytes(const char* fieldName, uint8_t*& bytes,
int32_t& len);
@@ -208,9 +210,8 @@ class PdxRemoteReader : public PdxLocalReader {
virtual void readASCIIChar(const char* fieldName, wchar_t& value);*/
virtual void readCollection(const char* fieldName,
- CacheableArrayListPtr& collection);
+ std::shared_ptr<CacheableArrayList>& collection);
};
-typedef std::shared_ptr<PdxRemoteReader> PdxRemoteReaderPtr;
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/PdxRemoteWriter.cpp b/cppcache/src/PdxRemoteWriter.cpp
index 0780461..16c3b47 100644
--- a/cppcache/src/PdxRemoteWriter.cpp
+++ b/cppcache/src/PdxRemoteWriter.cpp
@@ -28,9 +28,10 @@ namespace apache {
namespace geode {
namespace client {
-PdxRemoteWriter::PdxRemoteWriter(DataOutput& output, PdxTypePtr pdxType,
- PdxRemotePreservedDataPtr preservedData,
- PdxTypeRegistryPtr pdxTypeRegistry)
+PdxRemoteWriter::PdxRemoteWriter(
+ DataOutput& output, std::shared_ptr<PdxType> pdxType,
+ std::shared_ptr<PdxRemotePreservedData> preservedData,
+ std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry)
: PdxLocalWriter(output, pdxType, pdxTypeRegistry),
m_preserveDataIdx(0),
m_currentDataIdx(-1),
@@ -46,8 +47,9 @@ PdxRemoteWriter::PdxRemoteWriter(DataOutput& output, PdxTypePtr pdxType,
initialize();
}
-PdxRemoteWriter::PdxRemoteWriter(DataOutput& output, const char* pdxClassName,
- PdxTypeRegistryPtr pdxTypeRegistry)
+PdxRemoteWriter::PdxRemoteWriter(
+ DataOutput& output, const char* pdxClassName,
+ std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry)
: PdxLocalWriter(output, nullptr, pdxClassName, pdxTypeRegistry),
m_preserveDataIdx(0),
m_currentDataIdx(-1),
@@ -123,192 +125,171 @@ bool PdxRemoteWriter::isFieldWritingStarted() {
return m_currentDataIdx != -1; // field writing NOT started. do we need
// this??
}
-
-PdxWriterPtr PdxRemoteWriter::writeUnreadFields(PdxUnreadFieldsPtr unread) {
+std::shared_ptr<PdxWriter> PdxRemoteWriter::writeUnreadFields(
+ std::shared_ptr<PdxUnreadFields> unread) {
PdxLocalWriter::writeUnreadFields(unread);
m_remoteTolocalMap = m_pdxType->getRemoteToLocalMap();
m_remoteTolocalMapLength = m_pdxType->getTotalFields();
return shared_from_this();
}
-
-PdxWriterPtr PdxRemoteWriter::writeChar(const char* fieldName, char value) {
+std::shared_ptr<PdxWriter> PdxRemoteWriter::writeChar(const char* fieldName,
+ char value) {
writePreserveData();
PdxLocalWriter::writeChar(fieldName, value);
return shared_from_this();
}
-
-PdxWriterPtr PdxRemoteWriter::writeChar(const char* fieldName, char16_t value) {
+std::shared_ptr<PdxWriter> PdxRemoteWriter::writeChar(const char* fieldName,
+ char16_t value) {
writePreserveData();
PdxLocalWriter::writeChar(fieldName, value);
return shared_from_this();
}
-
-PdxWriterPtr PdxRemoteWriter::writeBoolean(const char* fieldName, bool value) {
+std::shared_ptr<PdxWriter> PdxRemoteWriter::writeBoolean(const char* fieldName,
+ bool value) {
writePreserveData();
PdxLocalWriter::writeBoolean(fieldName, value);
return shared_from_this();
-}
-
-PdxWriterPtr PdxRemoteWriter::writeByte(const char* fieldName, int8_t value) {
- writePreserveData();
- PdxLocalWriter::writeByte(fieldName, value);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxRemoteWriter::writeShort(const char* fieldName, int16_t value) {
- writePreserveData();
- PdxLocalWriter::writeShort(fieldName, value);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxRemoteWriter::writeInt(const char* fieldName, int32_t value) {
- writePreserveData();
- PdxLocalWriter::writeInt(fieldName, value);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxRemoteWriter::writeLong(const char* fieldName, int64_t value) {
- writePreserveData();
- PdxLocalWriter::writeLong(fieldName, value);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxRemoteWriter::writeFloat(const char* fieldName, float value) {
- writePreserveData();
- PdxLocalWriter::writeFloat(fieldName, value);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxRemoteWriter::writeDouble(const char* fieldName, double value) {
+ }
+ std::shared_ptr<PdxWriter> PdxRemoteWriter::writeByte(const char* fieldName,
+ int8_t value) {
+ writePreserveData();
+ PdxLocalWriter::writeByte(fieldName, value);
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxWriter> PdxRemoteWriter::writeShort(const char* fieldName,
+ int16_t value) {
+ writePreserveData();
+ PdxLocalWriter::writeShort(fieldName, value);
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxWriter> PdxRemoteWriter::writeInt(const char* fieldName,
+ int32_t value) {
+ writePreserveData();
+ PdxLocalWriter::writeInt(fieldName, value);
+ return shared_from_this();
+}
+ std::shared_ptr<PdxWriter> PdxRemoteWriter::writeLong(const char* fieldName, int64_t value) {
+ writePreserveData();
+ PdxLocalWriter::writeLong(fieldName, value);
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxWriter> PdxRemoteWriter::writeFloat(const char* fieldName,
+ float value) {
+ writePreserveData();
+ PdxLocalWriter::writeFloat(fieldName, value);
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxWriter> PdxRemoteWriter::writeDouble(const char* fieldName, double value) {
writePreserveData();
PdxLocalWriter::writeDouble(fieldName, value);
return shared_from_this();
-}
-
-PdxWriterPtr PdxRemoteWriter::writeDate(const char* fieldName,
- CacheableDatePtr date) {
- writePreserveData();
- PdxLocalWriter::writeDate(fieldName, date);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxRemoteWriter::writeString(const char* fieldName,
- const char* value) {
- writePreserveData();
- PdxLocalWriter::writeString(fieldName, value);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxRemoteWriter::writeWideString(const char* fieldName,
- const wchar_t* value) {
- writePreserveData();
- PdxLocalWriter::writeWideString(fieldName, value);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxRemoteWriter::writeStringArray(const char* fieldName,
- char** array, int length) {
- writePreserveData();
- PdxLocalWriter::writeStringArray(fieldName, array, length);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxRemoteWriter::writeWideStringArray(const char* fieldName,
- wchar_t** array,
- int length) {
- writePreserveData();
- PdxLocalWriter::writeWideStringArray(fieldName, array, length);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxRemoteWriter::writeObject(const char* fieldName,
- SerializablePtr value) {
- writePreserveData();
- PdxLocalWriter::writeObject(fieldName, value);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxRemoteWriter::writeBooleanArray(const char* fieldName,
- bool* array, int length) {
- writePreserveData();
- PdxLocalWriter::writeBooleanArray(fieldName, array, length);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxRemoteWriter::writeCharArray(const char* fieldName, char* array,
- int length) {
- writePreserveData();
- PdxLocalWriter::writeCharArray(fieldName, array, length);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxRemoteWriter::writeWideCharArray(const char* fieldName,
- wchar_t* array, int length) {
- writePreserveData();
- PdxLocalWriter::writeWideCharArray(fieldName, array, length);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxRemoteWriter::writeByteArray(const char* fieldName,
- int8_t* array, int length) {
- writePreserveData();
- PdxLocalWriter::writeByteArray(fieldName, array, length);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxRemoteWriter::writeShortArray(const char* fieldName,
- int16_t* array, int length) {
- writePreserveData();
- PdxLocalWriter::writeShortArray(fieldName, array, length);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxRemoteWriter::writeIntArray(const char* fieldName,
- int32_t* array, int length) {
+ }
+ std::shared_ptr<PdxWriter> PdxRemoteWriter::writeDate(
+ const char* fieldName, std::shared_ptr<CacheableDate> date) {
+ writePreserveData();
+ PdxLocalWriter::writeDate(fieldName, date);
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxWriter> PdxRemoteWriter::writeString(const char* fieldName,
+ const char* value) {
+ writePreserveData();
+ PdxLocalWriter::writeString(fieldName, value);
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxWriter> PdxRemoteWriter::writeWideString(
+ const char* fieldName, const wchar_t* value) {
+ writePreserveData();
+ PdxLocalWriter::writeWideString(fieldName, value);
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxWriter> PdxRemoteWriter::writeStringArray(
+ const char* fieldName, char** array, int length) {
+ writePreserveData();
+ PdxLocalWriter::writeStringArray(fieldName, array, length);
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxWriter> PdxRemoteWriter::writeWideStringArray(
+ const char* fieldName, wchar_t** array, int length) {
+ writePreserveData();
+ PdxLocalWriter::writeWideStringArray(fieldName, array, length);
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxWriter> PdxRemoteWriter::writeObject(
+ const char* fieldName, std::shared_ptr<Serializable> value) {
+ writePreserveData();
+ PdxLocalWriter::writeObject(fieldName, value);
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxWriter> PdxRemoteWriter::writeBooleanArray(
+ const char* fieldName, bool* array, int length) {
+ writePreserveData();
+ PdxLocalWriter::writeBooleanArray(fieldName, array, length);
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxWriter> PdxRemoteWriter::writeCharArray(
+ const char* fieldName, char* array, int length) {
+ writePreserveData();
+ PdxLocalWriter::writeCharArray(fieldName, array, length);
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxWriter> PdxRemoteWriter::writeWideCharArray(
+ const char* fieldName, wchar_t* array, int length) {
+ writePreserveData();
+ PdxLocalWriter::writeWideCharArray(fieldName, array, length);
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxWriter> PdxRemoteWriter::writeByteArray(
+ const char* fieldName, int8_t* array, int length) {
+ writePreserveData();
+ PdxLocalWriter::writeByteArray(fieldName, array, length);
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxWriter> PdxRemoteWriter::writeShortArray(
+ const char* fieldName, int16_t* array, int length) {
+ writePreserveData();
+ PdxLocalWriter::writeShortArray(fieldName, array, length);
+ return shared_from_this();
+}
+std::shared_ptr<PdxWriter> PdxRemoteWriter::writeIntArray(const char* fieldName,
+ int32_t* array,
+ int length) {
writePreserveData();
PdxLocalWriter::writeIntArray(fieldName, array, length);
return shared_from_this();
}
-
-PdxWriterPtr PdxRemoteWriter::writeLongArray(const char* fieldName,
- int64_t* array, int length) {
+std::shared_ptr<PdxWriter> PdxRemoteWriter::writeLongArray(
+ const char* fieldName, int64_t* array, int length) {
writePreserveData();
PdxLocalWriter::writeLongArray(fieldName, array, length);
return shared_from_this();
}
-
-PdxWriterPtr PdxRemoteWriter::writeFloatArray(const char* fieldName,
- float* array, int length) {
+std::shared_ptr<PdxWriter> PdxRemoteWriter::writeFloatArray(
+ const char* fieldName, float* array, int length) {
writePreserveData();
PdxLocalWriter::writeFloatArray(fieldName, array, length);
return shared_from_this();
}
-
-PdxWriterPtr PdxRemoteWriter::writeDoubleArray(const char* fieldName,
- double* array, int length) {
+std::shared_ptr<PdxWriter> PdxRemoteWriter::writeDoubleArray(
+ const char* fieldName, double* array, int length) {
writePreserveData();
PdxLocalWriter::writeDoubleArray(fieldName, array, length);
return shared_from_this();
}
-
-PdxWriterPtr PdxRemoteWriter::writeObjectArray(const char* fieldName,
- CacheableObjectArrayPtr array) {
+std::shared_ptr<PdxWriter> PdxRemoteWriter::writeObjectArray(
+ const char* fieldName, std::shared_ptr<CacheableObjectArray> array) {
writePreserveData();
PdxLocalWriter::writeObjectArray(fieldName, array);
return shared_from_this();
-}
-
-PdxWriterPtr PdxRemoteWriter::writeArrayOfByteArrays(const char* fieldName,
- int8_t** byteArrays,
- int arrayLength,
- int* elementLength) {
- writePreserveData();
- PdxLocalWriter::writeArrayOfByteArrays(fieldName, byteArrays, arrayLength,
- elementLength);
- return shared_from_this();
-}
-
-PdxTypeRegistryPtr PdxRemoteWriter::getPdxTypeRegistry() const {
+ }
+ std::shared_ptr<PdxWriter> PdxRemoteWriter::writeArrayOfByteArrays(
+ const char* fieldName, int8_t** byteArrays, int arrayLength,
+ int* elementLength) {
+ writePreserveData();
+ PdxLocalWriter::writeArrayOfByteArrays(fieldName, byteArrays, arrayLength,
+ elementLength);
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxTypeRegistry> PdxRemoteWriter::getPdxTypeRegistry() const {
return m_pdxTypeRegistry;
}
diff --git a/cppcache/src/PdxRemoteWriter.hpp b/cppcache/src/PdxRemoteWriter.hpp
index 261b000..887ce8f 100644
--- a/cppcache/src/PdxRemoteWriter.hpp
+++ b/cppcache/src/PdxRemoteWriter.hpp
@@ -34,207 +34,222 @@ class PdxRemoteWriter : public PdxLocalWriter {
int32_t m_remoteTolocalMapLength;
- PdxTypeRegistryPtr m_pdxTypeRegistry;
+ std::shared_ptr<PdxTypeRegistry> m_pdxTypeRegistry;
void initialize();
void writePreserveData();
- PdxTypeRegistryPtr getPdxTypeRegistry() const;
+ std::shared_ptr<PdxTypeRegistry> getPdxTypeRegistry() const;
public:
virtual ~PdxRemoteWriter();
- PdxRemoteWriter(DataOutput& output, PdxTypePtr pdxType,
- PdxRemotePreservedDataPtr preservedData,
- PdxTypeRegistryPtr pdxTypeRegistry);
+ PdxRemoteWriter(DataOutput& output, std::shared_ptr<PdxType> pdxType,
+ std::shared_ptr<PdxRemotePreservedData> preservedData,
+ std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry);
PdxRemoteWriter(DataOutput& output, const char* pdxClassName,
- PdxTypeRegistryPtr pdxTypeRegistry);
+ std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry);
virtual void endObjectWriting();
virtual bool isFieldWritingStarted();
- virtual PdxWriterPtr writeUnreadFields(PdxUnreadFieldsPtr unread);
+ virtual std::shared_ptr<PdxWriter> writeUnreadFields(
+ std::shared_ptr<PdxUnreadFields> unread);
/**
*Write a wide char to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The wide char value to write
*/
- virtual PdxWriterPtr writeChar(const char* fieldName, char value);
+ virtual std::shared_ptr<PdxWriter> writeChar(const char* fieldName,
+ char value);
- virtual PdxWriterPtr writeChar(const char* fieldName, char16_t value);
+ virtual std::shared_ptr<PdxWriter> writeChar(const char* fieldName,
+ char16_t value);
/**
*Write a boolean value to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The boolean value to write
*/
- virtual PdxWriterPtr writeBoolean(const char* fieldName, bool value);
+ virtual std::shared_ptr<PdxWriter> writeBoolean(const char* fieldName,
+ bool value);
/**
*Write a 8-bit integer or byte to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The 8-bit integer or byte to write
*/
- virtual PdxWriterPtr writeByte(const char* fieldName, int8_t value);
+ virtual std::shared_ptr<PdxWriter> writeByte(const char* fieldName,
+ int8_t value);
/**
*Write a 16-bit integer to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The 16-bit integer to write
*/
- virtual PdxWriterPtr writeShort(const char* fieldName, int16_t value);
+ virtual std::shared_ptr<PdxWriter> writeShort(const char* fieldName,
+ int16_t value);
/**
*Write a 32-bit integer to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The 32-bit integer to write
*/
- virtual PdxWriterPtr writeInt(const char* fieldName, int32_t value);
+ virtual std::shared_ptr<PdxWriter> writeInt(const char* fieldName,
+ int32_t value);
/**
*Write a long integer to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The long integer to write
*/
- virtual PdxWriterPtr writeLong(const char* fieldName, int64_t value);
+ virtual std::shared_ptr<PdxWriter> writeLong(const char* fieldName,
+ int64_t value);
/**
*Write a Float to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The float value to write
*/
- virtual PdxWriterPtr writeFloat(const char* fieldName, float value);
+ virtual std::shared_ptr<PdxWriter> writeFloat(const char* fieldName,
+ float value);
/**
*Write a Double to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The double value to write
*/
- virtual PdxWriterPtr writeDouble(const char* fieldName, double value);
+ virtual std::shared_ptr<PdxWriter> writeDouble(const char* fieldName,
+ double value);
/**
*Write a Date to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The date value to write
*/
- virtual PdxWriterPtr writeDate(const char* fieldName, CacheableDatePtr date);
+ virtual std::shared_ptr<PdxWriter> writeDate(
+ const char* fieldName, std::shared_ptr<CacheableDate> date);
/**
*Write a string to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The string to write
*/
- virtual PdxWriterPtr writeString(const char* fieldName, const char* value);
+ virtual std::shared_ptr<PdxWriter> writeString(const char* fieldName,
+ const char* value);
- virtual PdxWriterPtr writeWideString(const char* fieldName,
- const wchar_t* value);
+ virtual std::shared_ptr<PdxWriter> writeWideString(const char* fieldName,
+ const wchar_t* value);
/**
*Write a object to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The object to write
*/
- virtual PdxWriterPtr writeObject(const char* fieldName,
- SerializablePtr value);
+ virtual std::shared_ptr<PdxWriter> writeObject(
+ const char* fieldName, std::shared_ptr<Serializable> value);
/**
*Write a boolean array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The boolean array value to write
*/
- virtual PdxWriterPtr writeBooleanArray(const char* fieldName, bool* array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeBooleanArray(const char* fieldName,
+ bool* array, int length);
/**
*Write a Char array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The char array value to write
*/
- virtual PdxWriterPtr writeCharArray(const char* fieldName, char* array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeCharArray(const char* fieldName,
+ char* array, int length);
- virtual PdxWriterPtr writeWideCharArray(const char* fieldName, wchar_t* array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeWideCharArray(const char* fieldName,
+ wchar_t* array,
+ int length);
/**
*Write a Byte array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The byte array value to write
*/
- virtual PdxWriterPtr writeByteArray(const char* fieldName, int8_t* array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeByteArray(const char* fieldName,
+ int8_t* array, int length);
/**
*Write a 16-bit integer array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The array value to write
*/
- virtual PdxWriterPtr writeShortArray(const char* fieldName, int16_t* array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeShortArray(const char* fieldName,
+ int16_t* array,
+ int length);
/**
*Write a 32-bit integer array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The integer array value to write
*/
- virtual PdxWriterPtr writeIntArray(const char* fieldName, int32_t* array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeIntArray(const char* fieldName,
+ int32_t* array, int length);
/**
*Write a long integer array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The long integer array value to write
*/
- virtual PdxWriterPtr writeLongArray(const char* fieldName, int64_t* array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeLongArray(const char* fieldName,
+ int64_t* array, int length);
/**
*Write a Float array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The float array value to write
*/
- virtual PdxWriterPtr writeFloatArray(const char* fieldName, float* array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeFloatArray(const char* fieldName,
+ float* array, int length);
/**
*Write a double array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The double array value to write
*/
- virtual PdxWriterPtr writeDoubleArray(const char* fieldName, double* array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeDoubleArray(const char* fieldName,
+ double* array,
+ int length);
/**
*Write a string array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The string array value to write
*/
- virtual PdxWriterPtr writeStringArray(const char* fieldName, char** array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeStringArray(const char* fieldName,
+ char** array, int length);
- virtual PdxWriterPtr writeWideStringArray(const char* fieldName,
- wchar_t** array, int length);
+ virtual std::shared_ptr<PdxWriter> writeWideStringArray(const char* fieldName,
+ wchar_t** array,
+ int length);
/**
*Write a object array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The object array value to write
*/
- virtual PdxWriterPtr writeObjectArray(const char* fieldName,
- CacheableObjectArrayPtr array);
+ virtual std::shared_ptr<PdxWriter> writeObjectArray(
+ const char* fieldName, std::shared_ptr<CacheableObjectArray> array);
/**
*Write a array of byte arrays to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param array The arrayOfbytearray value to write
*/
- virtual PdxWriterPtr writeArrayOfByteArrays(const char* fieldName,
- int8_t** array, int arrayLength,
- int* elementLength);
+ virtual std::shared_ptr<PdxWriter> writeArrayOfByteArrays(
+ const char* fieldName, int8_t** array, int arrayLength,
+ int* elementLength);
};
-typedef std::shared_ptr<PdxRemoteWriter> PdxRemoteWriterPtr;
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/PdxSerializable.cpp b/cppcache/src/PdxSerializable.cpp
index 0efba08..5a1f752 100644
--- a/cppcache/src/PdxSerializable.cpp
+++ b/cppcache/src/PdxSerializable.cpp
@@ -48,8 +48,7 @@ void PdxSerializable::fromData(DataInput& input) {
throw UnsupportedOperationException(
"operation PdxSerializable::fromData() is not supported ");
}
-
-CacheableStringPtr PdxSerializable::toString() const {
+std::shared_ptr<CacheableString> PdxSerializable::toString() const {
return CacheableString::create("PdxSerializable");
}
diff --git a/cppcache/src/PdxType.cpp b/cppcache/src/PdxType.cpp
index b67a18a..697f729 100644
--- a/cppcache/src/PdxType.cpp
+++ b/cppcache/src/PdxType.cpp
@@ -45,7 +45,7 @@ PdxType::~PdxType() {
// PdxType::PdxType() : PdxType(nullptr, false) {}
-PdxType::PdxType(PdxTypeRegistryPtr pdxTypeRegistryPtr,
+PdxType::PdxType(std::shared_ptr<PdxTypeRegistry> pdxTypeRegistryPtr,
const char* pdxDomainClassName, bool isLocal)
: Serializable(),
m_className(Utils::copyString(pdxDomainClassName)),
@@ -54,7 +54,7 @@ PdxType::PdxType(PdxTypeRegistryPtr pdxTypeRegistryPtr,
m_varLenFieldIdx(0),
m_isVarLenFieldAdded(false),
m_noJavaClass(false),
- m_pdxFieldTypes(new std::vector<PdxFieldTypePtr>()),
+ m_pdxFieldTypes(new std::vector<std::shared_ptr<PdxFieldType>>()),
m_localToRemoteFieldMap(nullptr),
m_remoteToLocalFieldMap(nullptr),
m_geodeTypeId(0),
@@ -82,9 +82,10 @@ void PdxType::toData(DataOutput& output) const {
output.writeArrayLen(static_cast<int32_t>(m_pdxFieldTypes->size()));
- for (std::vector<PdxFieldTypePtr>::iterator it = m_pdxFieldTypes->begin();
+ for (std::vector<std::shared_ptr<PdxFieldType>>::iterator it =
+ m_pdxFieldTypes->begin();
it != m_pdxFieldTypes->end(); ++it) {
- PdxFieldTypePtr pdxPtr = *it;
+ auto pdxPtr = *it;
pdxPtr->toData(output);
}
}
@@ -204,13 +205,13 @@ void PdxType::initRemoteToLocal() {
// -1 = local type don't have this VariableLengthType field
// -2 = local type don't have this FixedLengthType field
- PdxTypePtr localPdxType = nullptr;
+ std::shared_ptr<PdxType> localPdxType = nullptr;
//[TODO - open this up once PdxTypeRegistry is done]
localPdxType = m_pdxTypeRegistryPtr->getLocalPdxType(m_className);
m_numberOfFieldsExtra = 0;
if (localPdxType != nullptr) {
- std::vector<PdxFieldTypePtr>* localPdxFields =
+ std::vector<std::shared_ptr<PdxFieldType>>* localPdxFields =
localPdxType->getPdxFieldTypes();
int32_t fieldIdx = 0;
@@ -219,12 +220,12 @@ void PdxType::initRemoteToLocal() {
"PdxType::initRemoteToLocal m_pdxFieldTypes->size() =%d AND "
"localPdxFields->size()=%d",
m_pdxFieldTypes->size(), localPdxFields->size());
- for (std::vector<PdxFieldTypePtr>::iterator remotePdxField =
+ for (std::vector<std::shared_ptr<PdxFieldType>>::iterator remotePdxField =
m_pdxFieldTypes->begin();
remotePdxField != m_pdxFieldTypes->end(); ++remotePdxField) {
bool found = false;
- for (std::vector<PdxFieldTypePtr>::iterator localPdxfield =
+ for (std::vector<std::shared_ptr<PdxFieldType>>::iterator localPdxfield =
localPdxFields->begin();
localPdxfield != localPdxFields->end(); ++localPdxfield) {
// PdxFieldType* remotePdx = (*(remotePdxField)).get();
@@ -265,11 +266,11 @@ void PdxType::initLocalToRemote() {
// then mark m_localToRemoteFieldMap with remotePdxField sequenceId
// 5. else if local field is not in remote type then -1
- PdxTypePtr localPdxType = nullptr;
+ std::shared_ptr<PdxType> localPdxType = nullptr;
localPdxType = m_pdxTypeRegistryPtr->getLocalPdxType(m_className);
if (localPdxType != nullptr) {
- std::vector<PdxFieldTypePtr>* localPdxFields =
+ std::vector<std::shared_ptr<PdxFieldType>>* localPdxFields =
localPdxType->getPdxFieldTypes();
int32_t fieldIdx = 0;
@@ -292,11 +293,10 @@ void PdxType::initLocalToRemote() {
}
for (; fieldIdx < localToRemoteFieldMapSize;) {
- PdxFieldTypePtr localPdxField =
- localPdxType->m_pdxFieldTypes->at(fieldIdx);
+ auto localPdxField = localPdxType->m_pdxFieldTypes->at(fieldIdx);
bool found = false;
- for (std::vector<PdxFieldTypePtr>::iterator remotePdxfield =
+ for (std::vector<std::shared_ptr<PdxFieldType>>::iterator remotePdxfield =
m_pdxFieldTypes->begin();
remotePdxfield != m_pdxFieldTypes->end(); ++remotePdxfield)
// for each(PdxFieldType^ remotePdxfield in m_pdxFieldTypes)
@@ -328,7 +328,7 @@ void PdxType::InitializeType() {
int32_t PdxType::getFieldPosition(const char* fieldName,
uint8_t* offsetPosition, int32_t offsetSize,
int32_t pdxStreamlen) {
- PdxFieldTypePtr pft = this->getPdxField(fieldName);
+ auto pft = this->getPdxField(fieldName);
if (pft != nullptr) {
if (pft->IsVariableLengthType()) {
return variableLengthFieldPosition(pft, offsetPosition, offsetSize,
@@ -343,7 +343,7 @@ int32_t PdxType::getFieldPosition(const char* fieldName,
int32_t PdxType::getFieldPosition(int32_t fieldIdx, uint8_t* offsetPosition,
int32_t offsetSize, int32_t pdxStreamlen) {
- PdxFieldTypePtr pft = m_pdxFieldTypes->at(fieldIdx);
+ auto pft = m_pdxFieldTypes->at(fieldIdx);
if (pft != nullptr) {
if (pft->IsVariableLengthType()) {
return variableLengthFieldPosition(pft, offsetPosition, offsetSize,
@@ -356,10 +356,9 @@ int32_t PdxType::getFieldPosition(int32_t fieldIdx, uint8_t* offsetPosition,
return -1;
}
-int32_t PdxType::fixedLengthFieldPosition(PdxFieldTypePtr fixLenField,
- uint8_t* offsetPosition,
- int32_t offsetSize,
- int32_t pdxStreamlen) {
+int32_t PdxType::fixedLengthFieldPosition(
+ std::shared_ptr<PdxFieldType> fixLenField, uint8_t* offsetPosition,
+ int32_t offsetSize, int32_t pdxStreamlen) {
int32_t offset = fixLenField->getVarLenOffsetIndex();
if (fixLenField->getRelativeOffset() >= 0) {
// starting fields
@@ -379,10 +378,9 @@ int32_t PdxType::fixedLengthFieldPosition(PdxFieldTypePtr fixLenField,
}
}
-int32_t PdxType::variableLengthFieldPosition(PdxFieldTypePtr varLenField,
- uint8_t* offsetPosition,
- int32_t offsetSize,
- int32_t pdxStreamlen) {
+int32_t PdxType::variableLengthFieldPosition(
+ std::shared_ptr<PdxFieldType> varLenField, uint8_t* offsetPosition,
+ int32_t offsetSize, int32_t pdxStreamlen) {
int32_t offset = varLenField->getVarLenOffsetIndex();
if (offset == -1) {
return /*first var len field*/ varLenField->getRelativeOffset();
@@ -421,14 +419,14 @@ int32_t* PdxType::getRemoteToLocalMap() {
return m_remoteToLocalFieldMap;
}
-
-PdxTypePtr PdxType::isContains(PdxTypePtr first, PdxTypePtr second) {
+std::shared_ptr<PdxType> PdxType::isContains(std::shared_ptr<PdxType> first,
+ std::shared_ptr<PdxType> second) {
int j = 0;
for (int i = 0; i < static_cast<int>(second->m_pdxFieldTypes->size()); i++) {
- PdxFieldTypePtr secondPdt = second->m_pdxFieldTypes->at(i);
+ auto secondPdt = second->m_pdxFieldTypes->at(i);
bool matched = false;
for (; j < static_cast<int>(first->m_pdxFieldTypes->size()); j++) {
- PdxFieldTypePtr firstPdt = first->m_pdxFieldTypes->at(j);
+ auto firstPdt = first->m_pdxFieldTypes->at(j);
// PdxFieldType* firstType = firstPdt.get();
// PdxFieldType* secondType = secondPdt.get();
if (firstPdt->equals(secondPdt)) {
@@ -440,79 +438,77 @@ PdxTypePtr PdxType::isContains(PdxTypePtr first, PdxTypePtr second) {
}
return first;
}
-
-PdxTypePtr PdxType::clone() {
- auto clone =
- std::make_shared<PdxType>(m_pdxTypeRegistryPtr, m_className, false);
- clone->m_geodeTypeId = 0;
- clone->m_numberOfVarLenFields = m_numberOfVarLenFields;
-
- for (std::vector<PdxFieldTypePtr>::iterator it = m_pdxFieldTypes->begin();
- it != m_pdxFieldTypes->end(); ++it) {
- PdxFieldTypePtr pdxPtr = *it;
- clone->m_pdxFieldTypes->push_back(pdxPtr);
- }
- return clone;
-}
-
-PdxTypePtr PdxType::isLocalTypeContains(PdxTypePtr otherType) {
- if (m_pdxFieldTypes->size() >= otherType->m_pdxFieldTypes->size()) {
- return isContains(shared_from_this(), otherType);
- }
- return nullptr;
+ std::shared_ptr<PdxType> PdxType::clone() {
+ auto clone =
+ std::make_shared<PdxType>(m_pdxTypeRegistryPtr, m_className, false);
+ clone->m_geodeTypeId = 0;
+ clone->m_numberOfVarLenFields = m_numberOfVarLenFields;
+
+ for (std::vector<std::shared_ptr<PdxFieldType>>::iterator it =
+ m_pdxFieldTypes->begin();
+ it != m_pdxFieldTypes->end(); ++it) {
+ auto pdxPtr = *it;
+ clone->m_pdxFieldTypes->push_back(pdxPtr);
+ }
+ return clone;
+ }
+ std::shared_ptr<PdxType> PdxType::isLocalTypeContains(
+ std::shared_ptr<PdxType> otherType) {
+ if (m_pdxFieldTypes->size() >= otherType->m_pdxFieldTypes->size()) {
+ return isContains(shared_from_this(), otherType);
+ }
+ return nullptr;
}
-
-PdxTypePtr PdxType::isRemoteTypeContains(PdxTypePtr remoteType) {
+ std::shared_ptr<PdxType> PdxType::isRemoteTypeContains(std::shared_ptr<PdxType> remoteType) {
if (m_pdxFieldTypes->size() <= remoteType->m_pdxFieldTypes->size()) {
return isContains(remoteType, shared_from_this());
}
return nullptr;
}
-
-PdxTypePtr PdxType::mergeVersion(PdxTypePtr otherVersion) {
+ std::shared_ptr<PdxType> PdxType::mergeVersion(std::shared_ptr<PdxType> otherVersion) {
// int nTotalFields = otherVersion->m_pdxFieldTypes->size();
- PdxTypePtr contains = nullptr;
-
- if (isLocalTypeContains(otherVersion) != nullptr) return shared_from_this();
-
- if (isRemoteTypeContains(otherVersion) != nullptr) return otherVersion;
-
- // need to create new one, clone of local
- PdxTypePtr newone = clone();
- int varLenFields = newone->getNumberOfVarLenFields();
-
- for (std::vector<PdxFieldTypePtr>::iterator it =
- otherVersion->m_pdxFieldTypes->begin();
- it != otherVersion->m_pdxFieldTypes->end(); ++it) {
- bool found = false;
- // for each(PdxFieldType^ tmpNew in newone->m_pdxFieldTypes)
- for (std::vector<PdxFieldTypePtr>::iterator it2 =
- newone->m_pdxFieldTypes->begin();
- it2 != newone->m_pdxFieldTypes->end(); ++it2) {
- if ((*it2)->equals(*it)) {
- found = true;
- break;
- }
- }
- if (!found) {
- auto newFt = std::make_shared<PdxFieldType>(
- (*it)->getFieldName(), (*it)->getClassName(), (*it)->getTypeId(),
- static_cast<int32_t>(newone->m_pdxFieldTypes->size()), // sequence id
- (*it)->IsVariableLengthType(), (*it)->getFixedSize(),
- ((*it)->IsVariableLengthType()
- ? varLenFields++ /*it increase after that*/
- : 0));
- newone->m_pdxFieldTypes->push_back(
- newFt); // fieldnameVsPFT will happen after that
+std::shared_ptr<PdxType> contains = nullptr;
+
+if (isLocalTypeContains(otherVersion) != nullptr) return shared_from_this();
+
+if (isRemoteTypeContains(otherVersion) != nullptr) return otherVersion;
+
+// need to create new one, clone of local
+auto newone = clone();
+int varLenFields = newone->getNumberOfVarLenFields();
+
+for (std::vector<std::shared_ptr<PdxFieldType>>::iterator it =
+ otherVersion->m_pdxFieldTypes->begin();
+ it != otherVersion->m_pdxFieldTypes->end(); ++it) {
+ bool found = false;
+ // for each(PdxFieldType^ tmpNew in newone->m_pdxFieldTypes)
+ for (std::vector<std::shared_ptr<PdxFieldType>>::iterator it2 =
+ newone->m_pdxFieldTypes->begin();
+ it2 != newone->m_pdxFieldTypes->end(); ++it2) {
+ if ((*it2)->equals(*it)) {
+ found = true;
+ break;
}
}
+ if (!found) {
+ auto newFt = std::make_shared<PdxFieldType>(
+ (*it)->getFieldName(), (*it)->getClassName(), (*it)->getTypeId(),
+ static_cast<int32_t>(newone->m_pdxFieldTypes->size()), // sequence id
+ (*it)->IsVariableLengthType(), (*it)->getFixedSize(),
+ ((*it)->IsVariableLengthType()
+ ? varLenFields++ /*it increase after that*/
+ : 0));
+ newone->m_pdxFieldTypes->push_back(
+ newFt); // fieldnameVsPFT will happen after that
+ }
+}
- newone->setNumberOfVarLenFields(varLenFields);
- if (varLenFields > 0) newone->setVarLenFieldIdx(varLenFields);
+newone->setNumberOfVarLenFields(varLenFields);
+if (varLenFields > 0) newone->setVarLenFieldIdx(varLenFields);
- // need to keep all versions in local version
- // m_otherVersions->Add(newone);
- return newone;
+// need to keep all versions in local version
+// m_otherVersions->Add(newone);
+return newone;
}
void PdxType::generatePositionMap() {
@@ -520,12 +516,12 @@ void PdxType::generatePositionMap() {
int lastVarLenSeqId = 0;
int prevFixedSizeOffsets = 0;
// set offsets from back first
- PdxFieldTypePtr previousField = nullptr;
+std::shared_ptr<PdxFieldType> previousField = nullptr;
for (int i = static_cast<int>(m_pdxFieldTypes->size()) - 1; i >= 0; i--) {
- PdxFieldTypePtr tmpft = m_pdxFieldTypes->at(i);
+ auto tmpft = m_pdxFieldTypes->at(i);
std::string temp = tmpft->getFieldName();
- std::pair<std::string, PdxFieldTypePtr> pc(temp, tmpft);
+ std::pair<std::string, std::shared_ptr<PdxFieldType>> pc(temp, tmpft);
m_fieldNameVsPdxType.insert(pc);
if (tmpft->IsVariableLengthType()) {
@@ -557,7 +553,7 @@ void PdxType::generatePositionMap() {
prevFixedSizeOffsets = 0;
// now do optimization till you don't fine var len
for (uint32_t i = 0; (i < m_pdxFieldTypes->size()) && !foundVarLen; i++) {
- PdxFieldTypePtr tmpft = m_pdxFieldTypes->at(i);
+ auto tmpft = m_pdxFieldTypes->at(i);
if (tmpft->IsVariableLengthType()) {
tmpft->setVarLenOffsetIndex(-1); // first var len field
@@ -571,7 +567,7 @@ void PdxType::generatePositionMap() {
}
}
-bool PdxType::Equals(PdxTypePtr otherObj) {
+bool PdxType::Equals(std::shared_ptr<PdxType> otherObj) {
if (otherObj == nullptr) return false;
PdxType* ot = dynamic_cast<PdxType*>(otherObj.get());
diff --git a/cppcache/src/PdxType.hpp b/cppcache/src/PdxType.hpp
index 99e056f..199c7ad 100644
--- a/cppcache/src/PdxType.hpp
+++ b/cppcache/src/PdxType.hpp
@@ -37,11 +37,9 @@ namespace apache {
namespace geode {
namespace client {
-typedef std::map<std::string, PdxFieldTypePtr> NameVsPdxType;
+typedef std::map<std::string, std::shared_ptr<PdxFieldType>> NameVsPdxType;
class PdxType;
-typedef std::shared_ptr<PdxType> PdxTypePtr;
class PdxTypeRegistry;
-typedef std::shared_ptr<PdxTypeRegistry> PdxTypeRegistryPtr;
class PdxType : public Serializable,
private NonCopyable,
@@ -51,9 +49,9 @@ class PdxType : public Serializable,
static const char* m_javaPdxClass;
- std::vector<PdxFieldTypePtr>* m_pdxFieldTypes;
+ std::vector<std::shared_ptr<PdxFieldType>>* m_pdxFieldTypes;
- std::list<PdxTypePtr> m_otherVersions;
+ std::list<std::shared_ptr<PdxType>> m_otherVersions;
char* m_className;
@@ -77,30 +75,30 @@ class PdxType : public Serializable,
bool m_noJavaClass;
- PdxTypeRegistryPtr m_pdxTypeRegistryPtr;
+ std::shared_ptr<PdxTypeRegistry> m_pdxTypeRegistryPtr;
void initRemoteToLocal();
void initLocalToRemote();
- int32_t fixedLengthFieldPosition(PdxFieldTypePtr fixLenField,
+ int32_t fixedLengthFieldPosition(std::shared_ptr<PdxFieldType> fixLenField,
uint8_t* offsetPosition, int32_t offsetSize,
int32_t pdxStreamlen);
- int32_t variableLengthFieldPosition(PdxFieldTypePtr varLenField,
+ int32_t variableLengthFieldPosition(std::shared_ptr<PdxFieldType> varLenField,
uint8_t* offsetPosition,
int32_t offsetSize, int32_t pdxStreamlen);
- PdxTypePtr isContains(PdxTypePtr first, PdxTypePtr second);
- PdxTypePtr clone();
+ std::shared_ptr<PdxType> isContains(std::shared_ptr<PdxType> first, std::shared_ptr<PdxType> second);
+ std::shared_ptr<PdxType> clone();
void generatePositionMap();
- PdxTypePtr isLocalTypeContains(PdxTypePtr otherType);
- PdxTypePtr isRemoteTypeContains(PdxTypePtr localType);
+ std::shared_ptr<PdxType> isLocalTypeContains(std::shared_ptr<PdxType> otherType);
+ std::shared_ptr<PdxType> isRemoteTypeContains(std::shared_ptr<PdxType> localType);
- PdxTypePtr shared_from_this() {
+ std::shared_ptr<PdxType> shared_from_this() {
return std::static_pointer_cast<PdxType>(Serializable::shared_from_this());
}
public:
- PdxType(PdxTypeRegistryPtr pdxTypeRegistryPtr, const char* pdxDomainClassName,
+ PdxType(std::shared_ptr<PdxTypeRegistry> pdxTypeRegistryPtr, const char* pdxDomainClassName,
bool isLocal);
virtual ~PdxType();
@@ -112,7 +110,7 @@ class PdxType : public Serializable,
virtual int32_t classId() const { return GeodeTypeIds::PdxType; }
static Serializable* CreateDeserializable(
- PdxTypeRegistryPtr pdxTypeRegistryPtr) {
+ std::shared_ptr<PdxTypeRegistry> pdxTypeRegistryPtr) {
return new PdxType(pdxTypeRegistryPtr, nullptr, false);
}
@@ -168,7 +166,7 @@ class PdxType : public Serializable,
int32_t getVarLenFieldIdx() const { return m_varLenFieldIdx; }
- PdxFieldTypePtr getPdxField(const char* fieldName) {
+ std::shared_ptr<PdxFieldType> getPdxField(const char* fieldName) {
NameVsPdxType::iterator iter = m_fieldNameVsPdxType.find(fieldName);
if (iter != m_fieldNameVsPdxType.end()) {
return (*iter).second;
@@ -180,7 +178,7 @@ class PdxType : public Serializable,
void setLocal(bool local) { m_isLocal = local; }
- std::vector<PdxFieldTypePtr>* getPdxFieldTypes() const {
+ std::vector<std::shared_ptr<PdxFieldType>>* getPdxFieldTypes() const {
return m_pdxFieldTypes;
}
@@ -189,14 +187,14 @@ class PdxType : public Serializable,
void addVariableLengthTypeField(const char* fieldName, const char* className,
int8_t typeId);
void InitializeType();
- PdxTypePtr mergeVersion(PdxTypePtr otherVersion);
+ std::shared_ptr<PdxType> mergeVersion(std::shared_ptr<PdxType> otherVersion);
int32_t getFieldPosition(const char* fieldName, uint8_t* offsetPosition,
int32_t offsetSize, int32_t pdxStreamlen);
int32_t getFieldPosition(int32_t fieldIdx, uint8_t* offsetPosition,
int32_t offsetSize, int32_t pdxStreamlen);
int32_t* getLocalToRemoteMap();
int32_t* getRemoteToLocalMap();
- bool Equals(PdxTypePtr otherObj);
+ bool Equals(std::shared_ptr<PdxType> otherObj);
// This is for PdxType as key in std map.
bool operator<(const PdxType& other) const;
};
diff --git a/cppcache/src/PdxTypeRegistry.cpp b/cppcache/src/PdxTypeRegistry.cpp
index fc9e45d..9ce60b4 100644
--- a/cppcache/src/PdxTypeRegistry.cpp
+++ b/cppcache/src/PdxTypeRegistry.cpp
@@ -41,10 +41,11 @@ size_t PdxTypeRegistry::testNumberOfPreservedData() const {
}
int32_t PdxTypeRegistry::getPDXIdForType(const char* type, const char* poolname,
- PdxTypePtr nType, bool checkIfThere) {
+ std::shared_ptr<PdxType> nType,
+ bool checkIfThere) {
// WriteGuard guard(g_readerWriterLock);
if (checkIfThere) {
- PdxTypePtr lpdx = getLocalPdxType(type);
+ auto lpdx = getLocalPdxType(type);
if (lpdx != nullptr) {
int id = lpdx->getTypeId();
if (id != 0) {
@@ -63,7 +64,7 @@ int32_t PdxTypeRegistry::getPDXIdForType(const char* type, const char* poolname,
return typeId;
}
-int32_t PdxTypeRegistry::getPDXIdForType(PdxTypePtr nType,
+int32_t PdxTypeRegistry::getPDXIdForType(std::shared_ptr<PdxType> nType,
const char* poolname) {
int32_t typeId = 0;
{
@@ -117,15 +118,15 @@ void PdxTypeRegistry::clear() {
}
}
-void PdxTypeRegistry::addPdxType(int32_t typeId, PdxTypePtr pdxType) {
+void PdxTypeRegistry::addPdxType(int32_t typeId,
+ std::shared_ptr<PdxType> pdxType) {
WriteGuard guard(g_readerWriterLock);
- std::pair<int32_t, PdxTypePtr> pc(typeId, pdxType);
+ std::pair<int32_t, std::shared_ptr<PdxType>> pc(typeId, pdxType);
typeIdToPdxType.insert(pc);
}
-
-PdxTypePtr PdxTypeRegistry::getPdxType(int32_t typeId) {
+std::shared_ptr<PdxType> PdxTypeRegistry::getPdxType(int32_t typeId) {
ReadGuard guard(g_readerWriterLock);
- PdxTypePtr retValue = nullptr;
+ std::shared_ptr<PdxType> retValue = nullptr;
TypeIdVsPdxType::iterator iter;
iter = typeIdToPdxType.find(typeId);
if (iter != typeIdToPdxType.end()) {
@@ -136,15 +137,15 @@ PdxTypePtr PdxTypeRegistry::getPdxType(int32_t typeId) {
}
void PdxTypeRegistry::addLocalPdxType(const char* localType,
- PdxTypePtr pdxType) {
+ std::shared_ptr<PdxType> pdxType) {
WriteGuard guard(g_readerWriterLock);
localTypeToPdxType.insert(
- std::pair<std::string, PdxTypePtr>(localType, pdxType));
+ std::pair<std::string, std::shared_ptr<PdxType>>(localType, pdxType));
}
-
-PdxTypePtr PdxTypeRegistry::getLocalPdxType(const char* localType) {
+std::shared_ptr<PdxType> PdxTypeRegistry::getLocalPdxType(
+ const char* localType) {
ReadGuard guard(g_readerWriterLock);
- PdxTypePtr localTypePtr = nullptr;
+ std::shared_ptr<PdxType> localTypePtr = nullptr;
TypeNameVsPdxType::iterator it;
it = localTypeToPdxType.find(localType);
if (it != localTypeToPdxType.end()) {
@@ -155,14 +156,14 @@ PdxTypePtr PdxTypeRegistry::getLocalPdxType(const char* localType) {
}
void PdxTypeRegistry::setMergedType(int32_t remoteTypeId,
- PdxTypePtr mergedType) {
+ std::shared_ptr<PdxType> mergedType) {
WriteGuard guard(g_readerWriterLock);
- std::pair<int32_t, PdxTypePtr> mergedTypePair(remoteTypeId, mergedType);
+ std::pair<int32_t, std::shared_ptr<PdxType>> mergedTypePair(remoteTypeId,
+ mergedType);
remoteTypeIdToMergedPdxType.insert(mergedTypePair);
}
-
-PdxTypePtr PdxTypeRegistry::getMergedType(int32_t remoteTypeId) {
- PdxTypePtr retVal = nullptr;
+std::shared_ptr<PdxType> PdxTypeRegistry::getMergedType(int32_t remoteTypeId) {
+ std::shared_ptr<PdxType> retVal = nullptr;
TypeIdVsPdxType::iterator it;
it = remoteTypeIdToMergedPdxType.find(remoteTypeId);
if (it != remoteTypeIdToMergedPdxType.end()) {
@@ -172,9 +173,10 @@ PdxTypePtr PdxTypeRegistry::getMergedType(int32_t remoteTypeId) {
return retVal;
}
-void PdxTypeRegistry::setPreserveData(PdxSerializablePtr obj,
- PdxRemotePreservedDataPtr pData,
- ExpiryTaskManager& expiryTaskManager) {
+void PdxTypeRegistry::setPreserveData(
+ std::shared_ptr<PdxSerializable> obj,
+ std::shared_ptr<PdxRemotePreservedData> pData,
+ ExpiryTaskManager& expiryTaskManager) {
WriteGuard guard(getPreservedDataLock());
pData->setOwner(obj);
if (preserveData.find(obj) != preserveData.end()) {
@@ -200,9 +202,8 @@ void PdxTypeRegistry::setPreserveData(PdxSerializablePtr obj,
"PdxTypeRegistry::setPreserveData Successfully inserted new entry in "
"preservedData");
}
-
-PdxRemotePreservedDataPtr PdxTypeRegistry::getPreserveData(
- PdxSerializablePtr pdxobj) {
+std::shared_ptr<PdxRemotePreservedData> PdxTypeRegistry::getPreserveData(
+ std::shared_ptr<PdxSerializable> pdxobj) {
ReadGuard guard(getPreservedDataLock());
const auto& iter = preserveData.find((pdxobj));
if (iter != preserveData.end()) {
@@ -211,9 +212,9 @@ PdxRemotePreservedDataPtr PdxTypeRegistry::getPreserveData(
return nullptr;
}
-int32_t PdxTypeRegistry::getEnumValue(EnumInfoPtr ei) {
+int32_t PdxTypeRegistry::getEnumValue(std::shared_ptr<EnumInfo> ei) {
// TODO locking - naive concurrent optimization?
- CacheableHashMapPtr tmp;
+ std::shared_ptr<CacheableHashMap> tmp;
tmp = enumToInt;
const auto& entry = tmp->find(ei);
if (entry != tmp->end()) {
@@ -238,11 +239,10 @@ int32_t PdxTypeRegistry::getEnumValue(EnumInfoPtr ei) {
enumToInt = tmp;
return val;
}
-
-EnumInfoPtr PdxTypeRegistry::getEnum(int32_t enumVal) {
+std::shared_ptr<EnumInfo> PdxTypeRegistry::getEnum(int32_t enumVal) {
// TODO locking - naive concurrent optimization?
- EnumInfoPtr ret;
- CacheableHashMapPtr tmp;
+ std::shared_ptr<EnumInfo> ret;
+ std::shared_ptr<CacheableHashMap> tmp;
auto enumValPtr = CacheableInt32::create(enumVal);
tmp = intToEnum;
diff --git a/cppcache/src/PdxTypeRegistry.hpp b/cppcache/src/PdxTypeRegistry.hpp
index 6ec7a2a..9854991 100644
--- a/cppcache/src/PdxTypeRegistry.hpp
+++ b/cppcache/src/PdxTypeRegistry.hpp
@@ -42,19 +42,23 @@ namespace geode {
namespace client {
struct PdxTypeLessThan {
- bool operator()(PdxTypePtr const& n1, PdxTypePtr const& n2) const {
+ bool operator()(std::shared_ptr<PdxType> const& n1,
+ std::shared_ptr<PdxType> const& n2) const {
// call to PdxType::operator <()
return *n1 < *n2;
}
};
-typedef std::map<int32_t, PdxTypePtr> TypeIdVsPdxType;
-typedef std::map</*char**/ std::string, PdxTypePtr> TypeNameVsPdxType;
-typedef std::unordered_map<PdxSerializablePtr, PdxRemotePreservedDataPtr,
- dereference_hash<CacheableKeyPtr>,
- dereference_equal_to<CacheableKeyPtr>>
+typedef std::map<int32_t, std::shared_ptr<PdxType>> TypeIdVsPdxType;
+typedef std::map</*char**/ std::string, std::shared_ptr<PdxType>>
+ TypeNameVsPdxType;
+typedef std::unordered_map<std::shared_ptr<PdxSerializable>,
+ std::shared_ptr<PdxRemotePreservedData>,
+ dereference_hash<std::shared_ptr<CacheableKey>>,
+ dereference_equal_to<std::shared_ptr<CacheableKey>>>
PreservedHashMap;
-typedef std::map<PdxTypePtr, int32_t, PdxTypeLessThan> PdxTypeToTypeIdMap;
+typedef std::map<std::shared_ptr<PdxType>, int32_t, PdxTypeLessThan>
+ PdxTypeToTypeIdMap;
class CPPCACHE_EXPORT PdxTypeRegistry
: public std::enable_shared_from_this<PdxTypeRegistry> {
@@ -80,9 +84,9 @@ class CPPCACHE_EXPORT PdxTypeRegistry
bool pdxReadSerialized;
- CacheableHashMapPtr enumToInt;
+ std::shared_ptr<CacheableHashMap> enumToInt;
- CacheableHashMapPtr intToEnum;
+ std::shared_ptr<CacheableHashMap> intToEnum;
public:
PdxTypeRegistry(Cache* cache);
@@ -93,29 +97,30 @@ class CPPCACHE_EXPORT PdxTypeRegistry
// test hook
size_t testNumberOfPreservedData() const;
- void addPdxType(int32_t typeId, PdxTypePtr pdxType);
+ void addPdxType(int32_t typeId, std::shared_ptr<PdxType> pdxType);
- PdxTypePtr getPdxType(int32_t typeId);
+ std::shared_ptr<PdxType> getPdxType(int32_t typeId);
- void addLocalPdxType(const char* localType, PdxTypePtr pdxType);
+ void addLocalPdxType(const char* localType, std::shared_ptr<PdxType> pdxType);
// newly added
- PdxTypePtr getLocalPdxType(const char* localType);
+ std::shared_ptr<PdxType> getLocalPdxType(const char* localType);
- void setMergedType(int32_t remoteTypeId, PdxTypePtr mergedType);
+ void setMergedType(int32_t remoteTypeId, std::shared_ptr<PdxType> mergedType);
- PdxTypePtr getMergedType(int32_t remoteTypeId);
+ std::shared_ptr<PdxType> getMergedType(int32_t remoteTypeId);
- void setPreserveData(PdxSerializablePtr obj,
- PdxRemotePreservedDataPtr preserveDataPtr,
+ void setPreserveData(std::shared_ptr<PdxSerializable> obj,
+ std::shared_ptr<PdxRemotePreservedData> preserveDataPtr,
ExpiryTaskManager& expiryTaskManager);
- PdxRemotePreservedDataPtr getPreserveData(PdxSerializablePtr obj);
+ std::shared_ptr<PdxRemotePreservedData> getPreserveData(
+ std::shared_ptr<PdxSerializable> obj);
void clear();
int32_t getPDXIdForType(const char* type, const char* poolname,
- PdxTypePtr nType, bool checkIfThere);
+ std::shared_ptr<PdxType> nType, bool checkIfThere);
bool getPdxIgnoreUnreadFields() const { return pdxIgnoreUnreadFields; }
@@ -127,17 +132,15 @@ class CPPCACHE_EXPORT PdxTypeRegistry
inline PreservedHashMap& getPreserveDataMap() { return preserveData; };
- int32_t getEnumValue(EnumInfoPtr ei);
+ int32_t getEnumValue(std::shared_ptr<EnumInfo> ei);
- EnumInfoPtr getEnum(int32_t enumVal);
+ std::shared_ptr<EnumInfo> getEnum(int32_t enumVal);
- int32_t getPDXIdForType(PdxTypePtr nType, const char* poolname);
+ int32_t getPDXIdForType(std::shared_ptr<PdxType> nType, const char* poolname);
ACE_RW_Thread_Mutex& getPreservedDataLock() { return g_preservedDataLock; }
};
-typedef std::shared_ptr<PdxTypeRegistry> PdxTypeRegistryPtr;
-
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/PdxWrapper.cpp b/cppcache/src/PdxWrapper.cpp
index a27b28b..5b5af79 100644
--- a/cppcache/src/PdxWrapper.cpp
+++ b/cppcache/src/PdxWrapper.cpp
@@ -31,7 +31,7 @@ namespace geode {
namespace client {
PdxWrapper::PdxWrapper(void *userObject, const char *className,
- PdxSerializerPtr pdxSerializerPtr)
+ std::shared_ptr<PdxSerializer> pdxSerializerPtr)
: m_userObject(userObject), m_serializer(pdxSerializerPtr) {
if (className != nullptr) {
m_className = Utils::copyString(className);
@@ -62,7 +62,8 @@ PdxWrapper::PdxWrapper(void *userObject, const char *className,
m_sizer = m_serializer->getObjectSizer(className);
}
-PdxWrapper::PdxWrapper(const char *className, PdxSerializerPtr pdxSerializerPtr)
+PdxWrapper::PdxWrapper(const char *className,
+ std::shared_ptr<PdxSerializer> pdxSerializerPtr)
: m_serializer(pdxSerializerPtr) {
if (className != nullptr) {
m_className = Utils::copyString(className);
@@ -126,7 +127,7 @@ int32_t PdxWrapper::hashcode() const {
return apache::geode::client::serializer::hashcode(hash);
}
-void PdxWrapper::toData(PdxWriterPtr output) {
+void PdxWrapper::toData(std::shared_ptr<PdxWriter> output) {
if (m_userObject != nullptr) {
m_serializer->toData(m_userObject, (const char *)m_className, output);
} else {
@@ -136,7 +137,7 @@ void PdxWrapper::toData(PdxWriterPtr output) {
}
}
-void PdxWrapper::fromData(PdxReaderPtr input) {
+void PdxWrapper::fromData(std::shared_ptr<PdxReader> input) {
m_userObject = m_serializer->fromData((const char *)m_className, input);
}
@@ -157,8 +158,7 @@ uint32_t PdxWrapper::objectSize() const {
return m_sizer(m_userObject, (const char *)m_className);
}
}
-
-CacheableStringPtr PdxWrapper::toString() const {
+std::shared_ptr<CacheableString> PdxWrapper::toString() const {
std::string message = "PdxWrapper for ";
message += m_className;
return CacheableString::create(message.c_str());
diff --git a/cppcache/src/PdxWriterWithTypeCollector.cpp b/cppcache/src/PdxWriterWithTypeCollector.cpp
index 6f47c6e..e9b5448 100644
--- a/cppcache/src/PdxWriterWithTypeCollector.cpp
+++ b/cppcache/src/PdxWriterWithTypeCollector.cpp
@@ -33,7 +33,7 @@ namespace client {
PdxWriterWithTypeCollector::PdxWriterWithTypeCollector(
DataOutput& output, const char* domainClassName,
- PdxTypeRegistryPtr pdxTypeRegistry)
+ std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry)
: PdxLocalWriter(output, nullptr, pdxTypeRegistry) {
m_domainClassName = domainClassName;
initialize();
@@ -94,222 +94,187 @@ void PdxWriterWithTypeCollector::addOffset() {
bool PdxWriterWithTypeCollector::isFieldWritingStarted() {
return m_pdxType->getTotalFields() > 0;
}
-
-PdxWriterPtr PdxWriterWithTypeCollector::writeUnreadFields(
- PdxUnreadFieldsPtr unread) {
+std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeUnreadFields(
+ std::shared_ptr<PdxUnreadFields> unread) {
PdxLocalWriter::writeUnreadFields(unread);
return shared_from_this();
}
-
-PdxWriterPtr PdxWriterWithTypeCollector::writeChar(const char* fieldName,
- char value) {
+std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeChar(
+ const char* fieldName, char value) {
m_pdxType->addFixedLengthTypeField(fieldName, "char", PdxFieldTypes::CHAR,
PdxTypes::CHAR_SIZE);
PdxLocalWriter::writeChar(fieldName, value);
return shared_from_this();
}
-
-PdxWriterPtr PdxWriterWithTypeCollector::writeChar(const char* fieldName,
+ std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeChar(const char* fieldName,
char16_t value) {
- m_pdxType->addFixedLengthTypeField(fieldName, "char", PdxFieldTypes::CHAR,
- PdxTypes::CHAR_SIZE);
- PdxLocalWriter::writeChar(fieldName, value);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxWriterWithTypeCollector::writeBoolean(const char* fieldName,
- bool value) {
- m_pdxType->addFixedLengthTypeField(
- fieldName, "boolean", PdxFieldTypes::BOOLEAN, PdxTypes::BOOLEAN_SIZE);
- PdxLocalWriter::writeBoolean(fieldName, value);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxWriterWithTypeCollector::writeByte(const char* fieldName,
- int8_t value) {
- m_pdxType->addFixedLengthTypeField(fieldName, "byte", PdxFieldTypes::BYTE,
- PdxTypes::BYTE_SIZE);
- PdxLocalWriter::writeByte(fieldName, value);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxWriterWithTypeCollector::writeShort(const char* fieldName,
+ m_pdxType->addFixedLengthTypeField(fieldName, "char", PdxFieldTypes::CHAR,
+ PdxTypes::CHAR_SIZE);
+ PdxLocalWriter::writeChar(fieldName, value);
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeBoolean(
+ const char* fieldName, bool value) {
+ m_pdxType->addFixedLengthTypeField(
+ fieldName, "boolean", PdxFieldTypes::BOOLEAN, PdxTypes::BOOLEAN_SIZE);
+ PdxLocalWriter::writeBoolean(fieldName, value);
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeByte(
+ const char* fieldName, int8_t value) {
+ m_pdxType->addFixedLengthTypeField(fieldName, "byte", PdxFieldTypes::BYTE,
+ PdxTypes::BYTE_SIZE);
+ PdxLocalWriter::writeByte(fieldName, value);
+ return shared_from_this();
+}
+ std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeShort(const char* fieldName,
int16_t value) {
m_pdxType->addFixedLengthTypeField(fieldName, "short", PdxFieldTypes::SHORT,
PdxTypes::SHORT_SIZE);
PdxLocalWriter::writeShort(fieldName, value);
return shared_from_this();
-}
-
-PdxWriterPtr PdxWriterWithTypeCollector::writeInt(const char* fieldName,
+ }
+ std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeInt(const char* fieldName,
int32_t value) {
m_pdxType->addFixedLengthTypeField(fieldName, "int", PdxFieldTypes::INT,
PdxTypes::INTEGER_SIZE);
PdxLocalWriter::writeInt(fieldName, value);
return shared_from_this();
-}
-
-PdxWriterPtr PdxWriterWithTypeCollector::writeLong(const char* fieldName,
- int64_t value) {
- m_pdxType->addFixedLengthTypeField(fieldName, "long", PdxFieldTypes::LONG,
- PdxTypes::LONG_SIZE);
- PdxLocalWriter::writeLong(fieldName, value);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxWriterWithTypeCollector::writeFloat(const char* fieldName,
- float value) {
- m_pdxType->addFixedLengthTypeField(fieldName, "float", PdxFieldTypes::FLOAT,
- PdxTypes::FLOAT_SIZE);
- PdxLocalWriter::writeFloat(fieldName, value);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxWriterWithTypeCollector::writeDouble(const char* fieldName,
- double value) {
- m_pdxType->addFixedLengthTypeField(fieldName, "double", PdxFieldTypes::DOUBLE,
- PdxTypes::DOUBLE_SIZE);
- PdxLocalWriter::writeDouble(fieldName, value);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxWriterWithTypeCollector::writeDate(const char* fieldName,
- CacheableDatePtr date) {
- m_pdxType->addFixedLengthTypeField(fieldName, "Date", PdxFieldTypes::DATE,
- PdxTypes::DATE_SIZE);
- PdxLocalWriter::writeDate(fieldName, date);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxWriterWithTypeCollector::writeString(const char* fieldName,
+ }
+ std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeLong(
+ const char* fieldName, int64_t value) {
+ m_pdxType->addFixedLengthTypeField(fieldName, "long", PdxFieldTypes::LONG,
+ PdxTypes::LONG_SIZE);
+ PdxLocalWriter::writeLong(fieldName, value);
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeFloat(
+ const char* fieldName, float value) {
+ m_pdxType->addFixedLengthTypeField(fieldName, "float", PdxFieldTypes::FLOAT,
+ PdxTypes::FLOAT_SIZE);
+ PdxLocalWriter::writeFloat(fieldName, value);
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeDouble(
+ const char* fieldName, double value) {
+ m_pdxType->addFixedLengthTypeField(
+ fieldName, "double", PdxFieldTypes::DOUBLE, PdxTypes::DOUBLE_SIZE);
+ PdxLocalWriter::writeDouble(fieldName, value);
+ return shared_from_this();
+}
+ std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeDate(const char* fieldName,
+ std::shared_ptr<CacheableDate> date) {
+ m_pdxType->addFixedLengthTypeField(fieldName, "Date", PdxFieldTypes::DATE,
+ PdxTypes::DATE_SIZE);
+ PdxLocalWriter::writeDate(fieldName, date);
+ return shared_from_this();
+}
+ std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeString(const char* fieldName,
const char* value) {
- m_pdxType->addVariableLengthTypeField(fieldName, "String",
- PdxFieldTypes::STRING);
- PdxLocalWriter::writeString(fieldName, value);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxWriterWithTypeCollector::writeWideString(const char* fieldName,
- const wchar_t* value) {
- m_pdxType->addVariableLengthTypeField(fieldName, "String",
- PdxFieldTypes::STRING);
- PdxLocalWriter::writeWideString(fieldName, value);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxWriterWithTypeCollector::writeObject(const char* fieldName,
- SerializablePtr value) {
+ m_pdxType->addVariableLengthTypeField(fieldName, "String",
+ PdxFieldTypes::STRING);
+ PdxLocalWriter::writeString(fieldName, value);
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeWideString(
+ const char* fieldName, const wchar_t* value) {
+ m_pdxType->addVariableLengthTypeField(fieldName, "String",
+ PdxFieldTypes::STRING);
+ PdxLocalWriter::writeWideString(fieldName, value);
+ return shared_from_this();
+}
+std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeObject(
+ const char* fieldName, std::shared_ptr<Serializable> value) {
m_pdxType->addVariableLengthTypeField(fieldName, "Serializable",
PdxFieldTypes::OBJECT);
PdxLocalWriter::writeObject(fieldName, value);
return shared_from_this();
}
-
-PdxWriterPtr PdxWriterWithTypeCollector::writeBooleanArray(
+std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeBooleanArray(
const char* fieldName, bool* array, int length) {
m_pdxType->addVariableLengthTypeField(fieldName, "bool[]",
PdxFieldTypes::BOOLEAN_ARRAY);
PdxLocalWriter::writeBooleanArray(fieldName, array, length);
return shared_from_this();
}
-
-PdxWriterPtr PdxWriterWithTypeCollector::writeCharArray(const char* fieldName,
- char* array,
- int length) {
+std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeCharArray(
+ const char* fieldName, char* array, int length) {
m_pdxType->addVariableLengthTypeField(fieldName, "char[]",
PdxFieldTypes::CHAR_ARRAY);
PdxLocalWriter::writeCharArray(fieldName, array, length);
return shared_from_this();
}
-
-PdxWriterPtr PdxWriterWithTypeCollector::writeWideCharArray(
+std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeWideCharArray(
const char* fieldName, wchar_t* array, int length) {
m_pdxType->addVariableLengthTypeField(fieldName, "char[]",
PdxFieldTypes::CHAR_ARRAY);
PdxLocalWriter::writeWideCharArray(fieldName, array, length);
return shared_from_this();
}
-
-PdxWriterPtr PdxWriterWithTypeCollector::writeByteArray(const char* fieldName,
- int8_t* array,
- int length) {
+std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeByteArray(
+ const char* fieldName, int8_t* array, int length) {
m_pdxType->addVariableLengthTypeField(fieldName, "byte[]",
PdxFieldTypes::BYTE_ARRAY);
PdxLocalWriter::writeByteArray(fieldName, array, length);
return shared_from_this();
}
-
-PdxWriterPtr PdxWriterWithTypeCollector::writeShortArray(const char* fieldName,
- int16_t* array,
- int length) {
+std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeShortArray(
+ const char* fieldName, int16_t* array, int length) {
m_pdxType->addVariableLengthTypeField(fieldName, "short[]",
PdxFieldTypes::SHORT_ARRAY);
PdxLocalWriter::writeShortArray(fieldName, array, length);
return shared_from_this();
}
-
-PdxWriterPtr PdxWriterWithTypeCollector::writeIntArray(const char* fieldName,
- int32_t* array,
- int length) {
+std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeIntArray(
+ const char* fieldName, int32_t* array, int length) {
m_pdxType->addVariableLengthTypeField(fieldName, "int[]",
PdxFieldTypes::INT_ARRAY);
PdxLocalWriter::writeIntArray(fieldName, array, length);
return shared_from_this();
}
-
-PdxWriterPtr PdxWriterWithTypeCollector::writeLongArray(const char* fieldName,
- int64_t* array,
- int length) {
+std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeLongArray(
+ const char* fieldName, int64_t* array, int length) {
m_pdxType->addVariableLengthTypeField(fieldName, "long[]",
PdxFieldTypes::LONG_ARRAY);
PdxLocalWriter::writeLongArray(fieldName, array, length);
return shared_from_this();
}
-
-PdxWriterPtr PdxWriterWithTypeCollector::writeFloatArray(const char* fieldName,
- float* array,
- int length) {
+std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeFloatArray(
+ const char* fieldName, float* array, int length) {
m_pdxType->addVariableLengthTypeField(fieldName, "float[]",
PdxFieldTypes::FLOAT_ARRAY);
PdxLocalWriter::writeFloatArray(fieldName, array, length);
return shared_from_this();
}
-
-PdxWriterPtr PdxWriterWithTypeCollector::writeDoubleArray(const char* fieldName,
- double* array,
- int length) {
+std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeDoubleArray(
+ const char* fieldName, double* array, int length) {
m_pdxType->addVariableLengthTypeField(fieldName, "double[]",
PdxFieldTypes::DOUBLE_ARRAY);
PdxLocalWriter::writeDoubleArray(fieldName, array, length);
return shared_from_this();
}
-
-PdxWriterPtr PdxWriterWithTypeCollector::writeStringArray(const char* fieldName,
- char** array,
- int length) {
+std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeStringArray(
+ const char* fieldName, char** array, int length) {
m_pdxType->addVariableLengthTypeField(fieldName, "String[]",
PdxFieldTypes::STRING_ARRAY);
PdxLocalWriter::writeStringArray(fieldName, array, length);
return shared_from_this();
}
-
-PdxWriterPtr PdxWriterWithTypeCollector::writeWideStringArray(
+ std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeWideStringArray(
const char* fieldName, wchar_t** array, int length) {
- m_pdxType->addVariableLengthTypeField(fieldName, "String[]",
- PdxFieldTypes::STRING_ARRAY);
- PdxLocalWriter::writeWideStringArray(fieldName, array, length);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxWriterWithTypeCollector::writeObjectArray(
- const char* fieldName, CacheableObjectArrayPtr array) {
- m_pdxType->addVariableLengthTypeField(fieldName, "Object[]",
- PdxFieldTypes::OBJECT_ARRAY);
- PdxLocalWriter::writeObjectArray(fieldName, array);
- return shared_from_this();
-}
-
-PdxWriterPtr PdxWriterWithTypeCollector::writeArrayOfByteArrays(
+ m_pdxType->addVariableLengthTypeField(fieldName, "String[]",
+ PdxFieldTypes::STRING_ARRAY);
+ PdxLocalWriter::writeWideStringArray(fieldName, array, length);
+ return shared_from_this();
+ }
+ std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeObjectArray(
+ const char* fieldName, std::shared_ptr<CacheableObjectArray> array) {
+ m_pdxType->addVariableLengthTypeField(fieldName, "Object[]",
+ PdxFieldTypes::OBJECT_ARRAY);
+ PdxLocalWriter::writeObjectArray(fieldName, array);
+ return shared_from_this();
+}
+std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::writeArrayOfByteArrays(
const char* fieldName, int8_t** byteArrays, int arrayLength,
int* elementLength) {
m_pdxType->addVariableLengthTypeField(fieldName, "byte[][]",
@@ -318,10 +283,9 @@ PdxWriterPtr PdxWriterWithTypeCollector::writeArrayOfByteArrays(
elementLength);
return shared_from_this();
}
-
-PdxWriterPtr PdxWriterWithTypeCollector::markIdentityField(
+std::shared_ptr<PdxWriter> PdxWriterWithTypeCollector::markIdentityField(
const char* fieldName) {
- PdxFieldTypePtr pft = m_pdxType->getPdxField(fieldName);
+ auto pft = m_pdxType->getPdxField(fieldName);
if (pft == nullptr) {
throw IllegalStateException(
"Field, must be written to PdxWriter before calling "
diff --git a/cppcache/src/PdxWriterWithTypeCollector.hpp b/cppcache/src/PdxWriterWithTypeCollector.hpp
index 499a4fa..50c841a 100644
--- a/cppcache/src/PdxWriterWithTypeCollector.hpp
+++ b/cppcache/src/PdxWriterWithTypeCollector.hpp
@@ -34,11 +34,11 @@ class PdxWriterWithTypeCollector : public PdxLocalWriter {
public:
PdxWriterWithTypeCollector(DataOutput& output, const char* pdxType,
- PdxTypeRegistryPtr pdxTypeRegistry);
+ std::shared_ptr<PdxTypeRegistry> pdxTypeRegistry);
virtual ~PdxWriterWithTypeCollector();
- PdxTypePtr getPdxLocalType() { return m_pdxType; }
+ std::shared_ptr<PdxType> getPdxLocalType() { return m_pdxType; }
virtual void endObjectWriting();
virtual void addOffset();
@@ -54,176 +54,190 @@ class PdxWriterWithTypeCollector : public PdxLocalWriter {
*@param fieldName The name of the field associated with the value.
*@param value The 8-bit integer or byte to write
*/
- virtual PdxWriterPtr writeChar(const char* fieldName, char value);
+ virtual std::shared_ptr<PdxWriter> writeChar(const char* fieldName,
+ char value);
- virtual PdxWriterPtr writeChar(const char* fieldName, char16_t value);
+ virtual std::shared_ptr<PdxWriter> writeChar(const char* fieldName,
+ char16_t value);
/**
*Write a boolean value to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The boolean value to write
*/
- virtual PdxWriterPtr writeBoolean(const char* fieldName, bool value);
+ virtual std::shared_ptr<PdxWriter> writeBoolean(const char* fieldName,
+ bool value);
/**
*Write a Byte value to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The Byte value to write
*/
- virtual PdxWriterPtr writeByte(const char* fieldName, int8_t value);
+ virtual std::shared_ptr<PdxWriter> writeByte(const char* fieldName,
+ int8_t value);
/**
*Write a 16-bit integer or Short value to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The 16-bit integer or short to write
*/
- virtual PdxWriterPtr writeShort(const char* fieldName, int16_t value);
+ virtual std::shared_ptr<PdxWriter> writeShort(const char* fieldName,
+ int16_t value);
/**
*Write a 32-bit integer to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The 32-bit integer to write
*/
- virtual PdxWriterPtr writeInt(const char* fieldName, int32_t value);
+ virtual std::shared_ptr<PdxWriter> writeInt(const char* fieldName,
+ int32_t value);
/**
*Write a long integer to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The long integer to write
*/
- virtual PdxWriterPtr writeLong(const char* fieldName, int64_t value);
+ virtual std::shared_ptr<PdxWriter> writeLong(const char* fieldName,
+ int64_t value);
/**
*Write a Float to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The float value to write
*/
- virtual PdxWriterPtr writeFloat(const char* fieldName, float value);
+ virtual std::shared_ptr<PdxWriter> writeFloat(const char* fieldName,
+ float value);
/**
*Write a Double to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The double value to write
*/
- virtual PdxWriterPtr writeDouble(const char* fieldName, double value);
+ virtual std::shared_ptr<PdxWriter> writeDouble(const char* fieldName,
+ double value);
/**
*Write a Date to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The date value to write
*/
- virtual PdxWriterPtr writeDate(const char* fieldName, CacheableDatePtr date);
+ virtual std::shared_ptr<PdxWriter> writeDate(
+ const char* fieldName, std::shared_ptr<CacheableDate> date);
/**
*Write a string to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The string to write
*/
- virtual PdxWriterPtr writeString(const char* fieldName, const char* value);
+ virtual std::shared_ptr<PdxWriter> writeString(const char* fieldName,
+ const char* value);
- virtual PdxWriterPtr writeWideString(const char* fieldName,
- const wchar_t* value);
+ virtual std::shared_ptr<PdxWriter> writeWideString(const char* fieldName,
+ const wchar_t* value);
/**
*Write a object to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The object to write
*/
- virtual PdxWriterPtr writeObject(const char* fieldName,
- SerializablePtr value);
+ virtual std::shared_ptr<PdxWriter> writeObject(
+ const char* fieldName, std::shared_ptr<Serializable> value);
/**
*Write a boolean array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The boolean array value to write
*/
- virtual PdxWriterPtr writeBooleanArray(const char* fieldName, bool* array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeBooleanArray(const char* fieldName,
+ bool* array, int length);
/**
*Write a Char array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The char array value to write
*/
- virtual PdxWriterPtr writeCharArray(const char* fieldName, char* array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeCharArray(const char* fieldName,
+ char* array, int length);
- virtual PdxWriterPtr writeWideCharArray(const char* fieldName, wchar_t* array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeWideCharArray(const char* fieldName,
+ wchar_t* array,
+ int length);
/**
*Write a Byte array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The byte array value to write
*/
- virtual PdxWriterPtr writeByteArray(const char* fieldName, int8_t* array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeByteArray(const char* fieldName,
+ int8_t* array, int length);
/**
*Write a 16-bit integer array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The array value to write
*/
- virtual PdxWriterPtr writeShortArray(const char* fieldName, int16_t* array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeShortArray(const char* fieldName,
+ int16_t* array,
+ int length);
/**
*Write a 32-bit integer array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The integer array value to write
*/
- virtual PdxWriterPtr writeIntArray(const char* fieldName, int32_t* array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeIntArray(const char* fieldName,
+ int32_t* array, int length);
/**
*Write a long integer array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The long integer array value to write
*/
- virtual PdxWriterPtr writeLongArray(const char* fieldName, int64_t* array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeLongArray(const char* fieldName,
+ int64_t* array, int length);
/**
*Write a Float array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The float array value to write
*/
- virtual PdxWriterPtr writeFloatArray(const char* fieldName, float* array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeFloatArray(const char* fieldName,
+ float* array, int length);
/**
*Write a double array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The double array value to write
*/
- virtual PdxWriterPtr writeDoubleArray(const char* fieldName, double* array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeDoubleArray(const char* fieldName,
+ double* array,
+ int length);
/**
*Write a string array to the PdxWriter.
*@param fieldName The name of the field associated with the value.
*@param value The string array value to write
*/
- virtual PdxWriterPtr writeStringArray(const char* fieldName, char** array,
- int length);
+ virtual std::shared_ptr<PdxWriter> writeStringArray(const char* fieldName,
+ char** array, int length);
- virtual PdxWriterPtr writeWideStringArray(const char* fieldName,
- wchar_t** array, int length);
+ virtual std::shared_ptr<PdxWriter> writeWideStringArray(const char* fieldName,
+ wchar_t** array,
+ int length);
- virtual PdxWriterPtr writeObjectArray(const char* fieldName,
- CacheableObjectArrayPtr array);
+ virtual std::shared_ptr<PdxWriter> writeObjectArray(
+ const char* fieldName, std::shared_ptr<CacheableObjectArray> array);
- virtual PdxWriterPtr writeArrayOfByteArrays(const char* fieldName,
- int8_t** byteArrays,
- int arrayLength,
- int* elementLength);
+ virtual std::shared_ptr<PdxWriter> writeArrayOfByteArrays(
+ const char* fieldName, int8_t** byteArrays, int arrayLength,
+ int* elementLength);
- virtual PdxWriterPtr markIdentityField(const char* fieldName);
+ virtual std::shared_ptr<PdxWriter> markIdentityField(const char* fieldName);
- virtual PdxWriterPtr writeUnreadFields(PdxUnreadFieldsPtr unread);
+ virtual std::shared_ptr<PdxWriter> writeUnreadFields(
+ std::shared_ptr<PdxUnreadFields> unread);
};
-typedef std::shared_ptr<PdxWriterWithTypeCollector>
- PdxWriterWithTypeCollectorPtr;
+
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/PersistenceManager.cpp b/cppcache/src/PersistenceManager.cpp
index 123f7b4..9823ddc 100644
--- a/cppcache/src/PersistenceManager.cpp
+++ b/cppcache/src/PersistenceManager.cpp
@@ -20,7 +20,7 @@
using namespace apache::geode::client;
-PersistenceManager::PersistenceManager(const RegionPtr& regionPtr)
+PersistenceManager::PersistenceManager(const std::shared_ptr<Region>& regionPtr)
: m_regionPtr(regionPtr) {
// printf("Base constructor PersistenceManager \n");
}
diff --git a/cppcache/src/Pool.cpp b/cppcache/src/Pool.cpp
index d131b09..11402a1 100644
--- a/cppcache/src/Pool.cpp
+++ b/cppcache/src/Pool.cpp
@@ -27,7 +27,7 @@
using namespace apache::geode::client;
-Pool::Pool(PoolAttributesPtr attr) : m_attrs(attr) {}
+Pool::Pool(std::shared_ptr<PoolAttributes> attr) : m_attrs(attr) {}
Pool::~Pool() {}
std::chrono::milliseconds Pool::getFreeConnectionTimeout() const {
@@ -91,9 +91,8 @@ bool Pool::getThreadLocalConnections() const {
bool Pool::getMultiuserAuthentication() const {
return m_attrs->getMultiuserSecureModeEnabled();
}
-
-RegionServicePtr Pool::createSecureUserCache(PropertiesPtr credentials,
- CacheImpl* cacheImpl) {
+std::shared_ptr<RegionService> Pool::createSecureUserCache(
+ std::shared_ptr<Properties> credentials, CacheImpl* cacheImpl) {
if (this->getMultiuserAuthentication()) {
if (cacheImpl == nullptr) {
throw IllegalStateException("cache has not been created yet.");
diff --git a/cppcache/src/PoolAttributes.cpp b/cppcache/src/PoolAttributes.cpp
index fda231a..c6dea41 100644
--- a/cppcache/src/PoolAttributes.cpp
+++ b/cppcache/src/PoolAttributes.cpp
@@ -42,8 +42,7 @@ PoolAttributes::PoolAttributes()
m_multiuserSecurityMode(PoolFactory::DEFAULT_MULTIUSER_SECURE_MODE),
m_isPRSingleHopEnabled(PoolFactory::DEFAULT_PR_SINGLE_HOP_ENABLED),
m_serverGrp(PoolFactory::DEFAULT_SERVER_GROUP) {}
-
-PoolAttributesPtr PoolAttributes::clone() {
+std::shared_ptr<PoolAttributes> PoolAttributes::clone() {
return std::make_shared<PoolAttributes>(*this);
}
diff --git a/cppcache/src/PoolAttributes.hpp b/cppcache/src/PoolAttributes.hpp
index c9f288e..53192f9 100644
--- a/cppcache/src/PoolAttributes.hpp
+++ b/cppcache/src/PoolAttributes.hpp
@@ -169,7 +169,7 @@ class PoolAttributes {
void addServer(const char* host, int port);
- PoolAttributesPtr clone();
+ std::shared_ptr<PoolAttributes> clone();
/** Return true if all the attributes are equal to those of other. */
bool operator==(const PoolAttributes& other) const;
diff --git a/cppcache/src/PoolFactory.cpp b/cppcache/src/PoolFactory.cpp
index 22f1cbd..e21a366 100644
--- a/cppcache/src/PoolFactory.cpp
+++ b/cppcache/src/PoolFactory.cpp
@@ -203,20 +203,21 @@ void PoolFactory::setMultiuserAuthentication(bool multiuserAuthentication) {
m_attrs->setMultiuserSecureModeEnabled(multiuserAuthentication);
}
-void PoolFactory::reset() { m_attrs = PoolAttributesPtr(new PoolAttributes); }
+void PoolFactory::reset() {
+ m_attrs = std::shared_ptr<PoolAttributes>(new PoolAttributes);
+}
void PoolFactory::setPRSingleHopEnabled(bool enabled) {
m_attrs->setPRSingleHopEnabled(enabled);
}
-
-PoolPtr PoolFactory::create(const char* name) {
- ThinClientPoolDMPtr poolDM;
+std::shared_ptr<Pool> PoolFactory::create(const char* name) {
+ std::shared_ptr<ThinClientPoolDM> poolDM;
{
if (m_cache.getPoolManager().find(name) != nullptr) {
throw IllegalStateException("Pool with the same name already exists");
}
// Create a clone of Attr;
- PoolAttributesPtr copyAttrs = m_attrs->clone();
+ auto copyAttrs = m_attrs->clone();
CacheImpl* cacheImpl = CacheRegionHelper::getCacheImpl(&m_cache);
diff --git a/cppcache/src/PoolManager.cpp b/cppcache/src/PoolManager.cpp
index 7ad036b..f456be3 100644
--- a/cppcache/src/PoolManager.cpp
+++ b/cppcache/src/PoolManager.cpp
@@ -25,24 +25,24 @@ class PoolManager::Impl {
Impl(const Cache& cache) : m_cache(cache) {}
void removePool(const char* name);
- PoolFactoryPtr createFactory();
+ std::shared_ptr<PoolFactory> createFactory();
void close(bool keepAlive);
- PoolPtr find(const char* name);
+ std::shared_ptr<Pool> find(const char* name);
- PoolPtr find(RegionPtr region);
+ std::shared_ptr<Pool> find(std::shared_ptr<Region> region);
const HashMapOfPools& getAll();
- void addPool(const char* name, const PoolPtr& pool);
+ void addPool(const char* name, const std::shared_ptr<Pool>& pool);
- PoolPtr getDefaultPool();
+ std::shared_ptr<Pool> getDefaultPool();
private:
HashMapOfPools m_connectionPools;
std::recursive_mutex m_connectionPoolsLock;
- PoolPtr m_defaultPool;
+ std::shared_ptr<Pool> m_defaultPool;
const Cache& m_cache;
};
@@ -50,15 +50,14 @@ void PoolManager::Impl::removePool(const char* name) {
std::lock_guard<std::recursive_mutex> guard(m_connectionPoolsLock);
m_connectionPools.erase(name);
}
-
-PoolFactoryPtr PoolManager::Impl::createFactory() {
+std::shared_ptr<PoolFactory> PoolManager::Impl::createFactory() {
return std::shared_ptr<PoolFactory>(new PoolFactory(m_cache));
}
void PoolManager::Impl::close(bool keepAlive) {
std::lock_guard<std::recursive_mutex> guard(m_connectionPoolsLock);
- std::vector<PoolPtr> poolsList;
+ std::vector<std::shared_ptr<Pool>> poolsList;
for (const auto& c : m_connectionPools) {
poolsList.push_back(c.second);
@@ -68,62 +67,67 @@ void PoolManager::Impl::close(bool keepAlive) {
iter->destroy(keepAlive);
}
}
+ std::shared_ptr<Pool> PoolManager::Impl::find(const char* name) {
+ std::lock_guard<std::recursive_mutex> guard(m_connectionPoolsLock);
-PoolPtr PoolManager::Impl::find(const char* name) {
- std::lock_guard<std::recursive_mutex> guard(m_connectionPoolsLock);
-
- if (name) {
- const auto& iter = m_connectionPools.find(name);
+ if (name) {
+ const auto& iter = m_connectionPools.find(name);
- PoolPtr poolPtr = nullptr;
+ std::shared_ptr<Pool> poolPtr = nullptr;
- if (iter != m_connectionPools.end()) {
- poolPtr = iter->second;
- GF_DEV_ASSERT(poolPtr != nullptr);
- }
+ if (iter != m_connectionPools.end()) {
+ poolPtr = iter->second;
+ GF_DEV_ASSERT(poolPtr != nullptr);
+ }
- return poolPtr;
+ return poolPtr;
} else {
return m_connectionPools.empty() ? nullptr
: m_connectionPools.begin()->second;
}
}
-
-PoolPtr PoolManager::Impl::find(RegionPtr region) {
+ std::shared_ptr<Pool> PoolManager::Impl::find(std::shared_ptr<Region> region) {
return find(region->getAttributes()->getPoolName());
-}
+ }
-const HashMapOfPools& PoolManager::Impl::getAll() { return m_connectionPools; }
+ const HashMapOfPools& PoolManager::Impl::getAll() { return m_connectionPools; }
-void PoolManager::Impl::addPool(const char* name, const PoolPtr& pool) {
- std::lock_guard<std::recursive_mutex> guard(m_connectionPoolsLock);
+ void PoolManager::Impl::addPool(const char* name,
+ const std::shared_ptr<Pool>& pool) {
+ std::lock_guard<std::recursive_mutex> guard(m_connectionPoolsLock);
- if (!m_defaultPool) {
- m_defaultPool = pool;
- }
+ if (!m_defaultPool) {
+ m_defaultPool = pool;
+ }
- m_connectionPools.emplace(name, pool);
+ m_connectionPools.emplace(name, pool);
+}
+std::shared_ptr<Pool> PoolManager::Impl::getDefaultPool() {
+ return m_defaultPool;
}
-
-PoolPtr PoolManager::Impl::getDefaultPool() { return m_defaultPool; }
PoolManager::PoolManager(const Cache& cache)
: m_pimpl(new Impl(cache), [](Impl* impl) { delete impl; }) {}
void PoolManager::removePool(const char* name) { m_pimpl->removePool(name); }
-
-PoolFactoryPtr PoolManager::createFactory() { return m_pimpl->createFactory(); }
+std::shared_ptr<PoolFactory> PoolManager::createFactory() {
+ return m_pimpl->createFactory();
+}
void PoolManager::close(bool keepAlive) { m_pimpl->close(keepAlive); }
-
-PoolPtr PoolManager::find(const char* name) { return m_pimpl->find(name); }
-
-PoolPtr PoolManager::find(RegionPtr region) { return m_pimpl->find(region); }
-
-const HashMapOfPools& PoolManager::getAll() { return m_pimpl->getAll(); }
-
-void PoolManager::addPool(const char* name, const PoolPtr& pool) {
- m_pimpl->addPool(name, pool);
+std::shared_ptr<Pool> PoolManager::find(const char* name) {
+ return m_pimpl->find(name);
}
-
-PoolPtr PoolManager::getDefaultPool() { return m_pimpl->getDefaultPool(); }
+std::shared_ptr<Pool> PoolManager::find(std::shared_ptr<Region> region) {
+ return m_pimpl->find(region);
+ }
+
+ const HashMapOfPools& PoolManager::getAll() { return m_pimpl->getAll(); }
+
+ void PoolManager::addPool(const char* name,
+ const std::shared_ptr<Pool>& pool) {
+ m_pimpl->addPool(name, pool);
+ }
+ std::shared_ptr<Pool> PoolManager::getDefaultPool() {
+ return m_pimpl->getDefaultPool();
+ }
diff --git a/cppcache/src/PoolXmlCreation.cpp b/cppcache/src/PoolXmlCreation.cpp
index 45216c0..169dc04 100644
--- a/cppcache/src/PoolXmlCreation.cpp
+++ b/cppcache/src/PoolXmlCreation.cpp
@@ -35,12 +35,11 @@ void PoolXmlCreation::addServer(const char * host, const char * port)
serverports.push_back(port);
}
*/
-
-PoolPtr PoolXmlCreation::create(Cache& cache) {
+std::shared_ptr<Pool> PoolXmlCreation::create(Cache& cache) {
return poolFactory->create(poolName.c_str());
}
-PoolXmlCreation::PoolXmlCreation(const char* name, PoolFactoryPtr factory) {
+PoolXmlCreation::PoolXmlCreation(const char* name, std::shared_ptr<PoolFactory> factory) {
poolName = name;
poolFactory = factory;
}
diff --git a/cppcache/src/PoolXmlCreation.hpp b/cppcache/src/PoolXmlCreation.hpp
index d3cb455..1e42a34 100644
--- a/cppcache/src/PoolXmlCreation.hpp
+++ b/cppcache/src/PoolXmlCreation.hpp
@@ -42,7 +42,7 @@ class CPPCACHE_EXPORT PoolXmlCreation {
private:
/** An <code>AttributesFactory</code> for creating default
* <code>PoolAttribute</code>s */
- PoolFactoryPtr poolFactory;
+ std::shared_ptr<PoolFactory> poolFactory;
/** The name of this pool */
std::string poolName;
@@ -59,7 +59,7 @@ class CPPCACHE_EXPORT PoolXmlCreation {
/**
* Creates a new <code>PoolXmlCreation</code> with the given pool name.
*/
- PoolXmlCreation(const char* name, PoolFactoryPtr factory);
+ PoolXmlCreation(const char* name, std::shared_ptr<PoolFactory> factory);
/** Add a locator */
// void addLocator(const char * host, const char * port);
@@ -82,7 +82,7 @@ class CPPCACHE_EXPORT PoolXmlCreation {
* @throws UnknownException otherwise
*
*/
- PoolPtr create(Cache &cache);
+ std::shared_ptr<Pool> create(Cache& cache);
};
} // namespace client
} // namespace geode
diff --git a/cppcache/src/PreservedDataExpiryHandler.cpp b/cppcache/src/PreservedDataExpiryHandler.cpp
index 5126020..137f1b9 100644
--- a/cppcache/src/PreservedDataExpiryHandler.cpp
+++ b/cppcache/src/PreservedDataExpiryHandler.cpp
@@ -33,11 +33,11 @@
using namespace apache::geode::client;
PreservedDataExpiryHandler::PreservedDataExpiryHandler(
- const std::shared_ptr<PdxTypeRegistry>& pdxTypeRegistry,
- const PdxSerializablePtr& pdxObjectPtr, uint32_t duration)
+ const std::shared_ptr<PdxTypeRegistry>& pdxTypeRegistry,
+ const std::shared_ptr<PdxSerializable>& pdxObjectPtr, uint32_t duration)
: // UNUSED m_duration(duration),
m_pdxObjectPtr(pdxObjectPtr),
- m_pdxTypeRegistry(pdxTypeRegistry) {}
+ m_pdxTypeRegistry(pdxTypeRegistry) {}
int PreservedDataExpiryHandler::handle_timeout(
const ACE_Time_Value& current_time, const void* arg) {
diff --git a/cppcache/src/PreservedDataExpiryHandler.hpp b/cppcache/src/PreservedDataExpiryHandler.hpp
index e8aafc9..5e59cbf 100644
--- a/cppcache/src/PreservedDataExpiryHandler.hpp
+++ b/cppcache/src/PreservedDataExpiryHandler.hpp
@@ -53,9 +53,9 @@ class CPPCACHE_EXPORT PreservedDataExpiryHandler : public ACE_Event_Handler {
/**
* Constructor
*/
- PreservedDataExpiryHandler(const std::shared_ptr<PdxTypeRegistry>& pdxTypeRegistry,
- const PdxSerializablePtr& pdxObjectPtr,
- uint32_t duration);
+ PreservedDataExpiryHandler(
+ const std::shared_ptr<PdxTypeRegistry>& pdxTypeRegistry,
+ const std::shared_ptr<PdxSerializable>& pdxObjectPtr, uint32_t duration);
/** This task object will be registered with the Timer Queue.
* When the timer expires the handle_timeout is invoked.
@@ -71,7 +71,7 @@ class CPPCACHE_EXPORT PreservedDataExpiryHandler : public ACE_Event_Handler {
// modification.
// UNUSED uint32_t m_duration;
std::shared_ptr<PdxTypeRegistry> m_pdxTypeRegistry;
- PdxSerializablePtr m_pdxObjectPtr;
+ std::shared_ptr<PdxSerializable> m_pdxObjectPtr;
};
} // namespace client
} // namespace geode
diff --git a/cppcache/src/Properties.cpp b/cppcache/src/Properties.cpp
index 3b532c7..34aebec 100644
--- a/cppcache/src/Properties.cpp
+++ b/cppcache/src/Properties.cpp
@@ -29,18 +29,20 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
template <>
-class ACE_Hash<apache::geode::client::CacheableKeyPtr> {
+class ACE_Hash<std::shared_ptr<apache::geode::client::CacheableKey>> {
public:
- u_long operator()(const apache::geode::client::CacheableKeyPtr& key) {
+ u_long operator()(
+ const std::shared_ptr<apache::geode::client::CacheableKey>& key) {
return key->hashcode();
}
};
template <>
-class ACE_Equal_To<apache::geode::client::CacheableKeyPtr> {
+class ACE_Equal_To<std::shared_ptr<apache::geode::client::CacheableKey>> {
public:
- int operator()(const apache::geode::client::CacheableKeyPtr& lhs,
- const apache::geode::client::CacheableKeyPtr& rhs) const {
+ int operator()(
+ const std::shared_ptr<apache::geode::client::CacheableKey>& lhs,
+ const std::shared_ptr<apache::geode::client::CacheableKey>& rhs) const {
return (*lhs.get() == *rhs.get());
}
};
@@ -51,8 +53,9 @@ namespace geode {
namespace client {
typedef ACE_Hash_Map_Manager_Ex<
- CacheableKeyPtr, CacheablePtr, ACE_Hash<CacheableKeyPtr>,
- ACE_Equal_To<CacheableKeyPtr>, ACE_Recursive_Thread_Mutex>
+ std::shared_ptr<CacheableKey>, std::shared_ptr<Cacheable>,
+ ACE_Hash<std::shared_ptr<CacheableKey>>,
+ ACE_Equal_To<std::shared_ptr<CacheableKey>>, ACE_Recursive_Thread_Mutex>
CacheableKeyCacheableMap;
typedef ACE_Guard<ACE_Recursive_Thread_Mutex> CacheableKeyCacheableMapGuard;
@@ -70,8 +73,9 @@ class PropertiesFile {
void readFile(const std::string& fileName);
char* nextBufferLine(char** cursor, char* bufbegin, size_t totalLen);
};
-
-PropertiesPtr Properties::create() { return PropertiesPtr(new Properties()); }
+std::shared_ptr<Properties> Properties::create() {
+ return std::shared_ptr<Properties>(new Properties());
+}
Properties::Properties() : Serializable() {
m_map = (void*)new CacheableKeyCacheableMap();
@@ -84,14 +88,14 @@ Properties::~Properties() {
}
}
-/** this return value must be stored in a CacheableStringPtr. */
-CacheableStringPtr Properties::find(const char* key) {
+/** this return value must be stored in a std::shared_ptr<CacheableString>. */
+std::shared_ptr<CacheableString> Properties::find(const char* key) {
if (key == nullptr) {
throw NullPointerException("Properties::find: Null key given.");
}
- CacheableStringPtr keyptr = CacheableString::create(key);
+ auto keyptr = CacheableString::create(key);
CacheableKeyCacheableMapGuard guard(MAP->mutex());
- CacheablePtr value;
+ std::shared_ptr<Cacheable> value;
int status = MAP->find(keyptr, value);
if (status != 0) {
return nullptr;
@@ -101,13 +105,13 @@ CacheableStringPtr Properties::find(const char* key) {
}
return value->toString();
}
-
-CacheablePtr Properties::find(const CacheableKeyPtr& key) {
+std::shared_ptr<Cacheable> Properties::find(
+ const std::shared_ptr<CacheableKey>& key) {
if (key == nullptr) {
throw NullPointerException("Properties::find: Null key given.");
}
CacheableKeyCacheableMapGuard guard(MAP->mutex());
- CacheablePtr value;
+ std::shared_ptr<Cacheable> value;
int status = MAP->find(key, value);
if (status != 0) {
return nullptr;
@@ -119,10 +123,9 @@ void Properties::insert(const char* key, const char* value) {
if (key == nullptr) {
throw NullPointerException("Properties::insert: Null key given.");
}
- CacheableStringPtr keyptr = CacheableString::create(key);
- CacheableStringPtr valptr =
- (value == nullptr ? CacheableString::create("")
- : CacheableString::create(value));
+ auto keyptr = CacheableString::create(key);
+ auto valptr = (value == nullptr ? CacheableString::create("")
+ : CacheableString::create(value));
MAP->rebind(keyptr, valptr);
}
@@ -130,13 +133,12 @@ void Properties::insert(const char* key, const int value) {
if (key == nullptr) {
throw NullPointerException("Properties::insert: Null key given.");
}
- CacheableStringPtr keyptr = CacheableString::create(key);
- CacheableStringPtr valptr =
- CacheableString::create(std::to_string(value).c_str());
+ auto keyptr = CacheableString::create(key);
+ auto valptr = CacheableString::create(std::to_string(value).c_str());
MAP->rebind(keyptr, valptr);
}
-void Properties::insert(const CacheableKeyPtr& key, const CacheablePtr& value) {
+void Properties::insert(const std::shared_ptr<CacheableKey>& key, const std::shared_ptr<Cacheable>& value) {
if (key == nullptr) {
throw NullPointerException("Properties::insert: Null key given.");
}
@@ -147,11 +149,11 @@ void Properties::remove(const char* key) {
if (key == nullptr) {
throw NullPointerException("Properties::remove: Null key given.");
}
- CacheableStringPtr keyptr = CacheableString::create(key);
+ auto keyptr = CacheableString::create(key);
MAP->unbind(keyptr);
}
-void Properties::remove(const CacheableKeyPtr& key) {
+void Properties::remove(const std::shared_ptr<CacheableKey>& key) {
if (key == nullptr) {
throw NullPointerException("Properties::remove: Null key given.");
}
@@ -166,14 +168,14 @@ void Properties::foreach (Visitor& visitor) const {
CacheableKeyCacheableMapGuard guard(MAP->mutex());
CacheableKeyCacheableMap::iterator iter = MAP->begin();
while (iter != MAP->end()) {
- CacheableKeyPtr key = (*iter).ext_id_;
- CacheablePtr val = (*iter).int_id_;
+ auto key = (*iter).ext_id_;
+ auto val = (*iter).int_id_;
visitor.visit(key, val);
++iter;
}
}
-void Properties::addAll(const PropertiesPtr& other) {
+void Properties::addAll(const std::shared_ptr<Properties>& other) {
if (other == nullptr) return;
class Copier : public Visitor {
@@ -181,7 +183,7 @@ void Properties::addAll(const PropertiesPtr& other) {
public:
explicit Copier(Properties& lhs) : m_lhs(lhs) {}
- void visit(const CacheableKeyPtr& key, const CacheablePtr& value) {
+ void visit(const std::shared_ptr<CacheableKey>& key, const std::shared_ptr<Cacheable>& value) {
m_lhs.insert(key, value);
}
} aCopier(*this);
@@ -309,20 +311,20 @@ void Properties::toData(DataOutput& output) const {
void Properties::fromData(DataInput& input) {
int32_t mapSize = input.readArrayLen();
for (int i = 0; i < mapSize; i++) {
- CacheableStringPtr key;
- CacheableStringPtr val;
+ std::shared_ptr<CacheableString> key;
+ std::shared_ptr<CacheableString> val;
// TODO: need to look just look typeid if string then convert otherwise
// continue with readobject
if (!(key = input.readNativeString())) {
- CacheableKeyPtr keyPtr;
- CacheablePtr valPtr;
+ std::shared_ptr<CacheableKey> keyPtr;
+ std::shared_ptr<Cacheable> valPtr;
keyPtr = input.readObject<CacheableKey>(true);
input.readObject(valPtr);
MAP->rebind(keyPtr, valPtr);
} else {
if (!(val = input.readNativeString())) {
- CacheablePtr valPtr;
+ std::shared_ptr<Cacheable> valPtr;
input.readObject(valPtr);
MAP->rebind(key, valPtr);
} else {
diff --git a/cppcache/src/ProxyCache.cpp b/cppcache/src/ProxyCache.cpp
index 7b58501..d4fb752 100644
--- a/cppcache/src/ProxyCache.cpp
+++ b/cppcache/src/ProxyCache.cpp
@@ -67,8 +67,8 @@ void ProxyCache::close() {
m_isProxyCacheClosed = true;
m_userAttributes->unSetCredentials();
// send message to server
- PoolPtr userAttachedPool = m_userAttributes->getPool();
- PoolPtr pool = m_cacheImpl->getCache()->getPoolManager().find(
+ auto userAttachedPool = m_userAttributes->getPool();
+ auto pool = m_cacheImpl->getCache()->getPoolManager().find(
userAttachedPool->getName());
if (pool != nullptr && pool.get() == userAttachedPool.get()) {
auto poolDM = std::static_pointer_cast<ThinClientPoolDM>(pool);
@@ -80,30 +80,29 @@ void ProxyCache::close() {
}
throw IllegalStateException("User cache has been closed.");
}
-
-RegionPtr ProxyCache::getRegion(const char* path) {
+std::shared_ptr<Region> ProxyCache::getRegion(const char* path) {
LOGDEBUG("ProxyCache::getRegion:");
if (!m_isProxyCacheClosed) {
- RegionPtr result;
+ std::shared_ptr<Region> result;
if (m_cacheImpl != nullptr && !m_cacheImpl->isClosed()) {
m_cacheImpl->getRegion(path, result);
}
if (result != nullptr) {
- PoolPtr userAttachedPool = m_userAttributes->getPool();
- PoolPtr pool = m_cacheImpl->getCache()->getPoolManager().find(
- result->getAttributes()->getPoolName());
- if (pool != nullptr && pool.get() == userAttachedPool.get() &&
- !pool->isDestroyed()) {
- return std::make_shared<ProxyRegion>(
- shared_from_this(),
- std::static_pointer_cast<RegionInternal>(result));
- }
- throw IllegalArgumentException(
- "The Region argument is not attached with the pool, which used to "
- "create this user cache.");
+ auto userAttachedPool = m_userAttributes->getPool();
+ auto pool = m_cacheImpl->getCache()->getPoolManager().find(
+ result->getAttributes()->getPoolName());
+ if (pool != nullptr && pool.get() == userAttachedPool.get() &&
+ !pool->isDestroyed()) {
+ return std::make_shared<ProxyRegion>(
+ shared_from_this(),
+ std::static_pointer_cast<RegionInternal>(result));
+ }
+ throw IllegalArgumentException(
+ "The Region argument is not attached with the pool, which used to "
+ "create this user cache.");
}
return result;
@@ -119,25 +118,24 @@ RegionPtr ProxyCache::getRegion(const char* path) {
* @param regions the region collection object containing the returned set of
* regions when the function returns
*/
-
-QueryServicePtr ProxyCache::getQueryService() {
- if (!m_isProxyCacheClosed) {
- if (m_remoteQueryService != nullptr) return m_remoteQueryService;
- auto prqsPtr =
- std::make_shared<ProxyRemoteQueryService>(this->shared_from_this());
- m_remoteQueryService = prqsPtr;
- return prqsPtr;
- }
- throw IllegalStateException("User cache has been closed.");
+ std::shared_ptr<QueryService> ProxyCache::getQueryService() {
+ if (!m_isProxyCacheClosed) {
+ if (m_remoteQueryService != nullptr) return m_remoteQueryService;
+ auto prqsPtr =
+ std::make_shared<ProxyRemoteQueryService>(this->shared_from_this());
+ m_remoteQueryService = prqsPtr;
+ return prqsPtr;
+ }
+ throw IllegalStateException("User cache has been closed.");
}
-VectorOfRegion ProxyCache::rootRegions() {
+std::vector<std::shared_ptr<Region>> ProxyCache::rootRegions() {
LOGDEBUG("ProxyCache::rootRegions:");
- VectorOfRegion regions;
+ std::vector<std::shared_ptr<Region>> regions;
if (!m_isProxyCacheClosed && m_cacheImpl && !m_cacheImpl->isClosed()) {
- VectorOfRegion tmp;
+ std::vector<std::shared_ptr<Region>> tmp;
// this can cause issue when pool attached with region in multiuserSecure
// mode
@@ -157,8 +155,8 @@ VectorOfRegion ProxyCache::rootRegions() {
return regions;
}
-ProxyCache::ProxyCache(PropertiesPtr credentials, PoolPtr pool,
- CacheImpl* cacheImpl)
+ProxyCache::ProxyCache(std::shared_ptr<Properties> credentials,
+ std::shared_ptr<Pool> pool, CacheImpl* cacheImpl)
: m_remoteQueryService(nullptr),
m_isProxyCacheClosed(false),
m_userAttributes(
@@ -166,13 +164,12 @@ ProxyCache::ProxyCache(PropertiesPtr credentials, PoolPtr pool,
m_cacheImpl(cacheImpl) {}
ProxyCache::~ProxyCache() {}
-
-PdxInstanceFactoryPtr ProxyCache::createPdxInstanceFactory(
+ std::shared_ptr<PdxInstanceFactory> ProxyCache::createPdxInstanceFactory(
const char* className) {
- return std::make_shared<PdxInstanceFactoryImpl>(
- className, &(m_cacheImpl->getCachePerfStats()),
- m_cacheImpl->getPdxTypeRegistry(), m_cacheImpl->getCache(),
- m_cacheImpl->getDistributedSystem()
- .getSystemProperties()
- .getEnableTimeStatistics());
-}
+ return std::make_shared<PdxInstanceFactoryImpl>(
+ className, &(m_cacheImpl->getCachePerfStats()),
+ m_cacheImpl->getPdxTypeRegistry(), m_cacheImpl->getCache(),
+ m_cacheImpl->getDistributedSystem()
+ .getSystemProperties()
+ .getEnableTimeStatistics());
+ }
diff --git a/cppcache/src/ProxyCache.hpp b/cppcache/src/ProxyCache.hpp
index 9cbbe8c..15da095 100644
--- a/cppcache/src/ProxyCache.hpp
+++ b/cppcache/src/ProxyCache.hpp
@@ -83,14 +83,14 @@ class CPPCACHE_EXPORT ProxyCache
* @param path the region's path, such as <code>RootA/Sub1/Sub1A</code>.
* @returns region, or nullptr if no such region exists.
*/
- virtual RegionPtr getRegion(const char* path) override;
+ virtual std::shared_ptr<Region> getRegion(const char* path) override;
/**
* Gets the QueryService from which a new Query can be obtained.
*
* @returns A smart pointer to the QueryService.
*/
- virtual QueryServicePtr getQueryService() override;
+ virtual std::shared_ptr<QueryService> getQueryService() override;
/**
* Returns a set of root regions in the cache. This set is a snapshot and
@@ -100,14 +100,15 @@ class CPPCACHE_EXPORT ProxyCache
* @param regions the returned set of
* regions
*/
- virtual VectorOfRegion rootRegions() override;
+ virtual std::vector<std::shared_ptr<Region>> rootRegions() override;
/**
* @brief destructor
*/
virtual ~ProxyCache();
- ProxyCache(PropertiesPtr credentials, PoolPtr pool, CacheImpl* cacheImpl);
+ ProxyCache(std::shared_ptr<Properties> credentials,
+ std::shared_ptr<Pool> pool, CacheImpl* cacheImpl);
/**
* Returns a factory that can create a {@link PdxInstance}.
@@ -116,7 +117,7 @@ class CPPCACHE_EXPORT ProxyCache
* when it is fully deserialized.
* @return the factory
*/
- virtual PdxInstanceFactoryPtr createPdxInstanceFactory(
+ virtual std::shared_ptr<PdxInstanceFactory> createPdxInstanceFactory(
const char* className) override;
private:
@@ -124,9 +125,9 @@ class CPPCACHE_EXPORT ProxyCache
* @brief constructors
*/
- UserAttributesPtr m_userAttributes;
+ std::shared_ptr<UserAttributes> m_userAttributes;
bool m_isProxyCacheClosed;
- QueryServicePtr m_remoteQueryService;
+ std::shared_ptr<QueryService> m_remoteQueryService;
CacheImpl* m_cacheImpl;
friend class Pool;
friend class ProxyRegion;
diff --git a/cppcache/src/ProxyRegion.hpp b/cppcache/src/ProxyRegion.hpp
index a568d61..fe71cb0 100644
--- a/cppcache/src/ProxyRegion.hpp
+++ b/cppcache/src/ProxyRegion.hpp
@@ -61,55 +61,56 @@ class CPPCACHE_EXPORT ProxyRegion : public Region {
return m_realRegion->getFullPath();
}
- virtual RegionPtr getParentRegion() const override {
+ virtual std::shared_ptr<Region> getParentRegion() const override {
return m_realRegion->getParentRegion();
}
- virtual RegionAttributesPtr getAttributes() const override {
+ virtual std::shared_ptr<RegionAttributes> getAttributes() const override {
return m_realRegion->getAttributes();
}
- virtual AttributesMutatorPtr getAttributesMutator() const override {
+ virtual std::shared_ptr<AttributesMutator> getAttributesMutator()
+ const override {
throw UnsupportedOperationException("Region.getAttributesMutator()");
}
- virtual CacheStatisticsPtr getStatistics() const override {
+ virtual std::shared_ptr<CacheStatistics> getStatistics() const override {
return m_realRegion->getStatistics();
}
- virtual void invalidateRegion(
- const SerializablePtr& aCallbackArgument = nullptr) override {
+ virtual void invalidateRegion(const std::shared_ptr<Serializable>&
+ aCallbackArgument = nullptr) override {
throw UnsupportedOperationException("Region.invalidateRegion()");
}
- virtual void localInvalidateRegion(
- const SerializablePtr& aCallbackArgument = nullptr) override {
+ virtual void localInvalidateRegion(const std::shared_ptr<Serializable>&
+ aCallbackArgument = nullptr) override {
throw UnsupportedOperationException("Region.localInvalidateRegion()");
}
- virtual void destroyRegion(
- const SerializablePtr& aCallbackArgument = nullptr) override {
+ virtual void destroyRegion(const std::shared_ptr<Serializable>&
+ aCallbackArgument = nullptr) override {
GuardUserAttribures gua(m_proxyCache);
m_realRegion->destroyRegion(aCallbackArgument);
}
- virtual void clear(
- const SerializablePtr& aCallbackArgument = nullptr) override {
+ virtual void clear(const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override {
GuardUserAttribures gua(m_proxyCache);
m_realRegion->clear(aCallbackArgument);
}
- virtual void localClear(
- const SerializablePtr& aCallbackArgument = nullptr) override {
+ virtual void localClear(const std::shared_ptr<Serializable>&
+ aCallbackArgument = nullptr) override {
throw UnsupportedOperationException("localClear()");
}
- virtual void localDestroyRegion(
- const SerializablePtr& aCallbackArgument = nullptr) override {
+ virtual void localDestroyRegion(const std::shared_ptr<Serializable>&
+ aCallbackArgument = nullptr) override {
throw UnsupportedOperationException("Region.localDestroyRegion()");
}
- virtual RegionPtr getSubregion(const char* path) override {
+ virtual std::shared_ptr<Region> getSubregion(const char* path) override {
LOGDEBUG("ProxyRegion getSubregion");
auto rPtr = std::static_pointer_cast<RegionInternal>(
m_realRegion->getSubregion(path));
@@ -119,21 +120,24 @@ class CPPCACHE_EXPORT ProxyRegion : public Region {
return std::make_shared<ProxyRegion>(m_proxyCache, rPtr);
}
- virtual RegionPtr createSubregion(
+ virtual std::shared_ptr<Region> createSubregion(
const char* subregionName,
- const RegionAttributesPtr& aRegionAttributes) override {
+ const std::shared_ptr<RegionAttributes>& aRegionAttributes) override {
throw UnsupportedOperationException("createSubregion()");
return nullptr;
}
- VectorOfRegion subregions(const bool recursive) override {
- VectorOfRegion realVectorRegion = m_realRegion->subregions(recursive);
- VectorOfRegion proxyRegions(realVectorRegion.size());
+ std::vector<std::shared_ptr<Region>> subregions(
+ const bool recursive) override {
+ std::vector<std::shared_ptr<Region>> realVectorRegion =
+ m_realRegion->subregions(recursive);
+ std::vector<std::shared_ptr<Region>> proxyRegions(realVectorRegion.size());
std::transform(
realVectorRegion.begin(), realVectorRegion.end(),
std::back_inserter(proxyRegions),
- [this](const RegionPtr& realRegion) -> std::shared_ptr<ProxyRegion> {
+ [this](const std::shared_ptr<Region>& realRegion)
+ -> std::shared_ptr<ProxyRegion> {
return std::make_shared<ProxyRegion>(
m_proxyCache,
std::static_pointer_cast<RegionInternal>(realRegion));
@@ -142,33 +146,37 @@ class CPPCACHE_EXPORT ProxyRegion : public Region {
return proxyRegions;
}
- virtual RegionEntryPtr getEntry(const CacheableKeyPtr& key) override {
+ virtual std::shared_ptr<RegionEntry> getEntry(
+ const std::shared_ptr<CacheableKey>& key) override {
return m_realRegion->getEntry(key);
}
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
- inline RegionEntryPtr getEntry(const KEYTYPE& key) {
+ inline std::shared_ptr<RegionEntry> getEntry(const KEYTYPE& key) {
return getEntry(createKey(key));
}
- virtual CacheablePtr get(
- const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument = nullptr) override {
+ virtual std::shared_ptr<Cacheable> get(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override {
GuardUserAttribures gua(m_proxyCache);
return m_realRegion->get(key, aCallbackArgument);
}
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
- inline CacheablePtr get(const KEYTYPE& key,
- const SerializablePtr& callbackArg = nullptr) {
+ inline std::shared_ptr<Cacheable> get(
+ const KEYTYPE& key,
+ const std::shared_ptr<Serializable>& callbackArg = nullptr) {
return get(createKey(key), callbackArg);
}
- virtual void put(
- const CacheableKeyPtr& key, const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument = nullptr) override {
+ virtual void put(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override {
GuardUserAttribures gua(m_proxyCache);
return m_realRegion->put(key, value, aCallbackArgument);
}
@@ -176,61 +184,68 @@ class CPPCACHE_EXPORT ProxyRegion : public Region {
/** Convenience method allowing both key and value to be a const char* */
template <class KEYTYPE, class VALUETYPE>
inline void put(const KEYTYPE& key, const VALUETYPE& value,
- const SerializablePtr& arg = nullptr) {
+ const std::shared_ptr<Serializable>& arg = nullptr) {
put(createKey(key), createValue(value), arg);
}
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
- inline void put(const KEYTYPE& key, const CacheablePtr& value,
- const SerializablePtr& arg = nullptr) {
+ inline void put(const KEYTYPE& key, const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
put(createKey(key), value, arg);
}
/** Convenience method allowing value to be a const char* */
template <class VALUETYPE>
- inline void put(const CacheableKeyPtr& key, const VALUETYPE& value,
- const SerializablePtr& arg = nullptr) {
+ inline void put(const std::shared_ptr<CacheableKey>& key,
+ const VALUETYPE& value,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
put(key, createValue(value), arg);
}
virtual void putAll(
const HashMapOfCacheable& map,
std::chrono::milliseconds timeout = DEFAULT_RESPONSE_TIMEOUT,
- const SerializablePtr& aCallbackArgument = nullptr) override {
+ const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override {
GuardUserAttribures gua(m_proxyCache);
return m_realRegion->putAll(map, timeout, aCallbackArgument);
}
- virtual void localPut(const CacheableKeyPtr& key, const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument = nullptr) override {
+ virtual void localPut(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override {
throw UnsupportedOperationException("Region.localPut()");
}
/** Convenience method allowing both key and value to be a const char* */
template <class KEYTYPE, class VALUETYPE>
inline void localPut(const KEYTYPE& key, const VALUETYPE& value,
- const SerializablePtr& arg = nullptr) {
+ const std::shared_ptr<Serializable>& arg = nullptr) {
localPut(createKey(key), createValue(value), arg);
}
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
- inline void localPut(const KEYTYPE& key, const CacheablePtr& value,
- const SerializablePtr& arg = nullptr) {
+ inline void localPut(const KEYTYPE& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
localPut(createKey(key), value, arg);
}
/** Convenience method allowing value to be a const char* */
template <class VALUETYPE>
- inline void localPut(const CacheableKeyPtr& key, const VALUETYPE& value,
- const SerializablePtr& arg = nullptr) {
+ inline void localPut(const std::shared_ptr<CacheableKey>& key,
+ const VALUETYPE& value,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
localPut(key, createValue(value), arg);
}
- virtual void create(
- const CacheableKeyPtr& key, const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument = nullptr) override {
+ virtual void create(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override {
GuardUserAttribures gua(m_proxyCache);
m_realRegion->create(key, value, aCallbackArgument);
}
@@ -238,105 +253,114 @@ class CPPCACHE_EXPORT ProxyRegion : public Region {
/** Convenience method allowing both key and value to be a const char* */
template <class KEYTYPE, class VALUETYPE>
inline void create(const KEYTYPE& key, const VALUETYPE& value,
- const SerializablePtr& arg = nullptr) {
+ const std::shared_ptr<Serializable>& arg = nullptr) {
create(createKey(key), createValue(value), arg);
}
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
- inline void create(const KEYTYPE& key, const CacheablePtr& value,
- const SerializablePtr& arg = nullptr) {
+ inline void create(const KEYTYPE& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
create(createKey(key), value, arg);
}
/** Convenience method allowing value to be a const char* */
template <class VALUETYPE>
- inline void create(const CacheableKeyPtr& key, const VALUETYPE& value,
- const SerializablePtr& arg = nullptr) {
+ inline void create(const std::shared_ptr<CacheableKey>& key,
+ const VALUETYPE& value,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
create(key, createValue(value), arg);
}
- virtual void localCreate(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument = nullptr) override {
+ virtual void localCreate(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>&
+ aCallbackArgument = nullptr) override {
throw UnsupportedOperationException("Region.localCreate()");
}
/** Convenience method allowing both key and value to be a const char* */
template <class KEYTYPE, class VALUETYPE>
inline void localCreate(const KEYTYPE& key, const VALUETYPE& value,
- const SerializablePtr& arg = nullptr) {
+ const std::shared_ptr<Serializable>& arg = nullptr) {
localCreate(createKey(key), createValue(value), arg);
}
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
- inline void localCreate(const KEYTYPE& key, const CacheablePtr& value,
- const SerializablePtr& arg = nullptr) {
+ inline void localCreate(const KEYTYPE& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
localCreate(createKey(key), value, arg);
}
/** Convenience method allowing value to be a const char* */
template <class VALUETYPE>
- inline void localCreate(const CacheableKeyPtr& key, const VALUETYPE& value,
- const SerializablePtr& arg = nullptr) {
+ inline void localCreate(const std::shared_ptr<CacheableKey>& key,
+ const VALUETYPE& value,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
localCreate(key, createValue(value), arg);
}
- virtual void invalidate(
- const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument = nullptr) override {
+ virtual void invalidate(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>&
+ aCallbackArgument = nullptr) override {
GuardUserAttribures gua(m_proxyCache);
m_realRegion->invalidate(key, aCallbackArgument);
}
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
- inline void invalidate(const KEYTYPE& key, const SerializablePtr& arg = nullptr) {
+ inline void invalidate(const KEYTYPE& key,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
invalidate(createKey(key), arg);
}
- virtual void localInvalidate(const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument = nullptr) override {
+ virtual void localInvalidate(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>&
+ aCallbackArgument = nullptr) override {
throw UnsupportedOperationException("Region.localInvalidate()");
}
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
- inline void localInvalidate(const KEYTYPE& key,
- const SerializablePtr& arg = nullptr) {
+ inline void localInvalidate(
+ const KEYTYPE& key, const std::shared_ptr<Serializable>& arg = nullptr) {
localInvalidate(createKey(key), arg);
}
- virtual void destroy(
- const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument = nullptr) override {
+ virtual void destroy(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override {
GuardUserAttribures gua(m_proxyCache);
m_realRegion->destroy(key, aCallbackArgument);
}
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
- inline void destroy(const KEYTYPE& key, const SerializablePtr& arg = nullptr) {
+ inline void destroy(const KEYTYPE& key,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
destroy(createKey(key), arg);
}
- virtual void localDestroy(
- const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument = nullptr) override {
+ virtual void localDestroy(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>&
+ aCallbackArgument = nullptr) override {
throw UnsupportedOperationException("Region.localDestroy()");
}
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
inline void localDestroy(const KEYTYPE& key,
- const SerializablePtr& arg = nullptr) {
+ const std::shared_ptr<Serializable>& arg = nullptr) {
localDestroy(createKey(key), arg);
}
- virtual bool remove(
- const CacheableKeyPtr& key, const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument = nullptr) override {
+ virtual bool remove(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override {
GuardUserAttribures gua(m_proxyCache);
return m_realRegion->remove(key, value, aCallbackArgument);
}
@@ -344,40 +368,44 @@ class CPPCACHE_EXPORT ProxyRegion : public Region {
/** Convenience method allowing both key and value to be a const char* */
template <class KEYTYPE, class VALUETYPE>
inline bool remove(const KEYTYPE& key, const VALUETYPE& value,
- const SerializablePtr& arg = nullptr) {
+ const std::shared_ptr<Serializable>& arg = nullptr) {
return remove(createKey(key), createValue(value), arg);
}
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
- inline bool remove(const KEYTYPE& key, const CacheablePtr& value,
- const SerializablePtr& arg = nullptr) {
+ inline bool remove(const KEYTYPE& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
return remove(createKey(key), value, arg);
}
/** Convenience method allowing value to be a const char* */
template <class VALUETYPE>
- inline bool remove(const CacheableKeyPtr& key, const VALUETYPE& value,
- const SerializablePtr& arg = nullptr) {
+ inline bool remove(const std::shared_ptr<CacheableKey>& key,
+ const VALUETYPE& value,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
return remove(key, createValue(value), arg);
}
- virtual bool removeEx(
- const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument = nullptr) override {
+ virtual bool removeEx(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override {
GuardUserAttribures gua(m_proxyCache);
return m_realRegion->removeEx(key, aCallbackArgument);
}
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
- inline bool removeEx(const KEYTYPE& key, const SerializablePtr& arg = nullptr) {
+ inline bool removeEx(const KEYTYPE& key,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
return removeEx(createKey(key), arg);
}
- virtual bool localRemove(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument = nullptr) override {
+ virtual bool localRemove(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>&
+ aCallbackArgument = nullptr) override {
throw UnsupportedOperationException("Region.localRemove()");
return false;
}
@@ -385,34 +413,37 @@ class CPPCACHE_EXPORT ProxyRegion : public Region {
/** Convenience method allowing both key and value to be a const char* */
template <class KEYTYPE, class VALUETYPE>
inline bool localRemove(const KEYTYPE& key, const VALUETYPE& value,
- const SerializablePtr& arg = nullptr) {
+ const std::shared_ptr<Serializable>& arg = nullptr) {
return localRemove(createKey(key), createValue(value), arg);
}
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
- inline bool localRemove(const KEYTYPE& key, const CacheablePtr& value,
- const SerializablePtr& arg = nullptr) {
+ inline bool localRemove(const KEYTYPE& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
return localRemove(createKey(key), value, arg);
}
/** Convenience method allowing value to be a const char* */
template <class VALUETYPE>
- inline bool localRemove(const CacheableKeyPtr& key, const VALUETYPE& value,
- const SerializablePtr& arg = nullptr) {
+ inline bool localRemove(const std::shared_ptr<CacheableKey>& key,
+ const VALUETYPE& value,
+ const std::shared_ptr<Serializable>& arg = nullptr) {
return localRemove(key, createValue(value), arg);
}
- virtual bool localRemoveEx(const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument = nullptr) override {
+ virtual bool localRemoveEx(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>&
+ aCallbackArgument = nullptr) override {
throw UnsupportedOperationException("Region.localRemoveEx()");
return false;
}
/** Convenience method allowing key to be a const char* */
template <class KEYTYPE>
- inline bool localRemoveEx(const KEYTYPE& key,
- const SerializablePtr& arg = nullptr) {
+ inline bool localRemoveEx(
+ const KEYTYPE& key, const std::shared_ptr<Serializable>& arg = nullptr) {
return localRemoveEx(createKey(key), arg);
}
@@ -420,26 +451,27 @@ class CPPCACHE_EXPORT ProxyRegion : public Region {
* Return all the keys in the local process for this region. This includes
* keys for which the entry is invalid.
*/
- virtual VectorOfCacheableKey keys() override {
+ virtual std::vector<std::shared_ptr<CacheableKey>> keys() override {
throw UnsupportedOperationException("Region.keys()");
- return VectorOfCacheableKey();
+ return std::vector<std::shared_ptr<CacheableKey>>();
}
- virtual VectorOfCacheableKey serverKeys() override {
+ virtual std::vector<std::shared_ptr<CacheableKey>> serverKeys() override {
GuardUserAttribures gua(m_proxyCache);
return m_realRegion->serverKeys();
}
- virtual VectorOfCacheable values() override {
+ virtual std::vector<std::shared_ptr<Cacheable>> values() override {
throw UnsupportedOperationException("Region.values()");
}
- virtual VectorOfRegionEntry entries(bool recursive) override {
+ virtual std::vector<std::shared_ptr<RegionEntry>> entries(
+ bool recursive) override {
throw UnsupportedOperationException("Region.entries()");
}
- virtual RegionServicePtr getRegionService() const override {
- return RegionServicePtr(m_proxyCache);
+ virtual std::shared_ptr<RegionService> getRegionService() const override {
+ return std::shared_ptr<RegionService>(m_proxyCache);
}
virtual bool isDestroyed() const override {
@@ -447,7 +479,7 @@ class CPPCACHE_EXPORT ProxyRegion : public Region {
}
virtual bool containsValueForKey(
- const CacheableKeyPtr& keyPtr) const override {
+ const std::shared_ptr<CacheableKey>& keyPtr) const override {
throw UnsupportedOperationException("Region.containsValueForKey()");
return false;
}
@@ -463,22 +495,25 @@ class CPPCACHE_EXPORT ProxyRegion : public Region {
return containsValueForKey(createKey(key));
}
- virtual bool containsKey(const CacheableKeyPtr& keyPtr) const override {
+ virtual bool containsKey(
+ const std::shared_ptr<CacheableKey>& keyPtr) const override {
throw UnsupportedOperationException("Region.containsKey()");
return false;
}
virtual bool containsKeyOnServer(
- const CacheableKeyPtr& keyPtr) const override {
+ const std::shared_ptr<CacheableKey>& keyPtr) const override {
GuardUserAttribures gua(m_proxyCache);
return m_realRegion->containsKeyOnServer(keyPtr);
}
- virtual VectorOfCacheableKey getInterestList() const override {
+ virtual std::vector<std::shared_ptr<CacheableKey>> getInterestList()
+ const override {
throw UnsupportedOperationException("Region.getInterestList()");
}
- virtual VectorOfCacheableString getInterestListRegex() const override {
+ virtual std::vector<std::shared_ptr<CacheableString>> getInterestListRegex()
+ const override {
throw UnsupportedOperationException("Region.getInterestListRegex()");
}
@@ -493,14 +528,15 @@ class CPPCACHE_EXPORT ProxyRegion : public Region {
return containsKey(createKey(key));
}
- virtual void registerKeys(const VectorOfCacheableKey& keys,
- bool isDurable = false,
- bool getInitialValues = false,
- bool receiveValues = true) override {
+ virtual void registerKeys(
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ bool isDurable = false, bool getInitialValues = false,
+ bool receiveValues = true) override {
throw UnsupportedOperationException("Region.registerKeys()");
}
- virtual void unregisterKeys(const VectorOfCacheableKey& keys) override {
+ virtual void unregisterKeys(
+ const std::vector<std::shared_ptr<CacheableKey>>& keys) override {
throw UnsupportedOperationException("Region.unregisterKeys()");
}
@@ -525,15 +561,16 @@ class CPPCACHE_EXPORT ProxyRegion : public Region {
}
virtual HashMapOfCacheable getAll(
- const VectorOfCacheableKey& keys,
- const SerializablePtr& aCallbackArgument = nullptr) override {
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override {
GuardUserAttribures gua(m_proxyCache);
return m_realRegion->getAll_internal(keys, aCallbackArgument, false);
}
- virtual SelectResultsPtr query(const char* predicate,
- std::chrono::milliseconds timeout =
- DEFAULT_QUERY_RESPONSE_TIMEOUT) override {
+ virtual std::shared_ptr<SelectResults> query(
+ const char* predicate, std::chrono::milliseconds timeout =
+ DEFAULT_QUERY_RESPONSE_TIMEOUT) override {
GuardUserAttribures gua(m_proxyCache);
return m_realRegion->query(predicate, timeout);
}
@@ -545,26 +582,27 @@ class CPPCACHE_EXPORT ProxyRegion : public Region {
return m_realRegion->existsValue(predicate, timeout);
}
- virtual SerializablePtr selectValue(
- const char* predicate,
- std::chrono::milliseconds timeout =
- DEFAULT_QUERY_RESPONSE_TIMEOUT) override {
+ virtual std::shared_ptr<Serializable> selectValue(
+ const char* predicate, std::chrono::milliseconds timeout =
+ DEFAULT_QUERY_RESPONSE_TIMEOUT) override {
GuardUserAttribures gua(m_proxyCache);
return m_realRegion->selectValue(predicate, timeout);
}
- virtual void removeAll(
- const VectorOfCacheableKey& keys,
- const SerializablePtr& aCallbackArgument = nullptr) override {
+ virtual void removeAll(const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ const std::shared_ptr<Serializable>&
+ aCallbackArgument = nullptr) override {
GuardUserAttribures gua(m_proxyCache);
m_realRegion->removeAll(keys, aCallbackArgument);
}
virtual uint32_t size() override { return m_realRegion->size(); }
- virtual const PoolPtr& getPool() override { return m_realRegion->getPool(); }
+ virtual const std::shared_ptr<Pool>& getPool() override {
+ return m_realRegion->getPool();
+ }
- ProxyRegion(const ProxyCachePtr& proxyCache,
+ ProxyRegion(const std::shared_ptr<ProxyCache>& proxyCache,
const std::shared_ptr<RegionInternal>& realRegion)
: Region(realRegion->getCache()) {
m_proxyCache = proxyCache;
@@ -577,16 +615,13 @@ class CPPCACHE_EXPORT ProxyRegion : public Region {
ProxyRegion& operator=(const ProxyRegion&) = delete;
private:
-
- ProxyCachePtr m_proxyCache;
+ std::shared_ptr<ProxyCache> m_proxyCache;
std::shared_ptr<RegionInternal> m_realRegion;
friend class FunctionService;
FRIEND_STD_SHARED_PTR(ProxyRegion)
};
-typedef std::shared_ptr<ProxyRegion> ProxyRegionPtr;
-
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/ProxyRemoteQueryService.cpp b/cppcache/src/ProxyRemoteQueryService.cpp
index 0dbe909..245106e 100644
--- a/cppcache/src/ProxyRemoteQueryService.cpp
+++ b/cppcache/src/ProxyRemoteQueryService.cpp
@@ -19,10 +19,11 @@
#include <geode/PoolManager.hpp>
#include "CqQueryImpl.hpp"
-ProxyRemoteQueryService::ProxyRemoteQueryService(ProxyCachePtr cptr)
+ProxyRemoteQueryService::ProxyRemoteQueryService(
+ std::shared_ptr<ProxyCache> cptr)
: m_proxyCache(cptr) {}
-
-QueryPtr ProxyRemoteQueryService::newQuery(const char* querystring) {
+std::shared_ptr<Query> ProxyRemoteQueryService::newQuery(
+ const char* querystring) {
if (!m_proxyCache->isClosed()) {
auto userAttachedPool = m_proxyCache->m_userAttributes->getPool();
auto pool = m_proxyCache->m_cacheImpl->getCache()->getPoolManager().find(
@@ -48,10 +49,9 @@ void ProxyRemoteQueryService::unSupportedException(const char* operationName) {
operationName);
throw UnsupportedOperationException(msg);
}
-
-CqQueryPtr ProxyRemoteQueryService::newCq(const char* querystr,
- const CqAttributesPtr& cqAttr,
- bool isDurable) {
+std::shared_ptr<CqQuery> ProxyRemoteQueryService::newCq(
+ const char* querystr, const std::shared_ptr<CqAttributes>& cqAttr,
+ bool isDurable) {
if (!m_proxyCache->isClosed()) {
auto userAttachedPool = m_proxyCache->m_userAttributes->getPool();
auto pool = m_proxyCache->m_cacheImpl->getCache()->getPoolManager().find(
@@ -72,15 +72,14 @@ CqQueryPtr ProxyRemoteQueryService::newCq(const char* querystr,
throw IllegalStateException("Logical Cache has been closed.");
}
-void ProxyRemoteQueryService::addCqQuery(const CqQueryPtr& cqQuery) {
+void ProxyRemoteQueryService::addCqQuery(
+ const std::shared_ptr<CqQuery>& cqQuery) {
ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_cqQueryListLock);
m_cqQueries.push_back(cqQuery);
}
-
-CqQueryPtr ProxyRemoteQueryService::newCq(const char* name,
- const char* querystr,
- const CqAttributesPtr& cqAttr,
- bool isDurable) {
+std::shared_ptr<CqQuery> ProxyRemoteQueryService::newCq(
+ const char* name, const char* querystr,
+ const std::shared_ptr<CqAttributes>& cqAttr, bool isDurable) {
if (!m_proxyCache->isClosed()) {
auto userAttachedPool = m_proxyCache->m_userAttributes->getPool();
auto pool = m_proxyCache->m_cacheImpl->getCache()->getPoolManager().find(
@@ -132,8 +131,7 @@ QueryService::query_container_type ProxyRemoteQueryService::getCqs() {
ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_cqQueryListLock);
return m_cqQueries;
}
-
-CqQueryPtr ProxyRemoteQueryService::getCq(const char* name) {
+ std::shared_ptr<CqQuery> ProxyRemoteQueryService::getCq(const char* name) {
if (!m_proxyCache->isClosed()) {
auto userAttachedPool = m_proxyCache->m_userAttributes->getPool();
auto pool = m_proxyCache->m_cacheImpl->getCache()->getPoolManager().find(
@@ -188,13 +186,12 @@ void ProxyRemoteQueryService::stopCqs() {
}
}
}
-
-CqServiceStatisticsPtr ProxyRemoteQueryService::getCqServiceStatistics() {
+ std::shared_ptr<CqServiceStatistics> ProxyRemoteQueryService::getCqServiceStatistics() {
unSupportedException("getCqServiceStatistics()");
return nullptr;
-}
-
-CacheableArrayListPtr ProxyRemoteQueryService::getAllDurableCqsFromServer() {
- unSupportedException("getAllDurableCqsFromServer()");
- return nullptr;
-}
+ }
+ std::shared_ptr<CacheableArrayList>
+ ProxyRemoteQueryService::getAllDurableCqsFromServer() {
+ unSupportedException("getAllDurableCqsFromServer()");
+ return nullptr;
+ }
diff --git a/cppcache/src/ProxyRemoteQueryService.hpp b/cppcache/src/ProxyRemoteQueryService.hpp
index 7f98b22..9c5248f 100644
--- a/cppcache/src/ProxyRemoteQueryService.hpp
+++ b/cppcache/src/ProxyRemoteQueryService.hpp
@@ -38,38 +38,38 @@ class ThinClientPoolDM;
class CPPCACHE_EXPORT ProxyRemoteQueryService : public QueryService {
public:
- ProxyRemoteQueryService(ProxyCachePtr cptr);
+ ProxyRemoteQueryService(std::shared_ptr<ProxyCache> cptr);
- QueryPtr newQuery(const char* querystring);
+ std::shared_ptr<Query> newQuery(const char* querystring);
~ProxyRemoteQueryService() {}
- virtual CqQueryPtr newCq(const char* querystr, const CqAttributesPtr& cqAttr,
- bool isDurable = false);
- virtual CqQueryPtr newCq(const char* name, const char* querystr,
- const CqAttributesPtr& cqAttr,
- bool isDurable = false);
+ virtual std::shared_ptr<CqQuery> newCq(
+ const char* querystr, const std::shared_ptr<CqAttributes>& cqAttr,
+ bool isDurable = false);
+ virtual std::shared_ptr<CqQuery> newCq(
+ const char* name, const char* querystr,
+ const std::shared_ptr<CqAttributes>& cqAttr, bool isDurable = false);
virtual void closeCqs();
virtual QueryService::query_container_type getCqs();
- virtual CqQueryPtr getCq(const char* name);
+ virtual std::shared_ptr<CqQuery> getCq(const char* name);
virtual void executeCqs();
virtual void stopCqs();
- virtual CqServiceStatisticsPtr getCqServiceStatistics();
- virtual CacheableArrayListPtr getAllDurableCqsFromServer();
+ virtual std::shared_ptr<CqServiceStatistics> getCqServiceStatistics();
+ virtual std::shared_ptr<CacheableArrayList> getAllDurableCqsFromServer();
private:
void unSupportedException(const char* operationName);
- void addCqQuery(const CqQueryPtr& cqQuery);
+ void addCqQuery(const std::shared_ptr<CqQuery>& cqQuery);
void closeCqs(bool keepAlive);
- QueryServicePtr m_realQueryService;
- ProxyCachePtr m_proxyCache;
+ std::shared_ptr<QueryService> m_realQueryService;
+ std::shared_ptr<ProxyCache> m_proxyCache;
query_container_type m_cqQueries;
// lock for cqQuery list;
ACE_Recursive_Thread_Mutex m_cqQueryListLock;
friend class ProxyCache;
};
-typedef std::shared_ptr<ProxyRemoteQueryService> ProxyRemoteQueryServicePtr;
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/PutAllPartialResult.cpp b/cppcache/src/PutAllPartialResult.cpp
index 24929b6..7cbf1c1 100644
--- a/cppcache/src/PutAllPartialResult.cpp
+++ b/cppcache/src/PutAllPartialResult.cpp
@@ -23,14 +23,15 @@ namespace client {
PutAllPartialResult::PutAllPartialResult(
int totalMapSize, ACE_Recursive_Thread_Mutex& responseLock) {
m_succeededKeys = std::make_shared<VersionedCacheableObjectPartList>(
- new VectorOfCacheableKey(), responseLock);
+ new std::vector<std::shared_ptr<CacheableKey>>(), responseLock);
m_totalMapSize = totalMapSize;
}
// Add all succeededKeys and firstfailedKey.
// Before calling this, we must read PutAllPartialResultServerException and
// formulate obj of type PutAllPartialResult.
-void PutAllPartialResult::consolidate(PutAllPartialResultPtr other) {
+void PutAllPartialResult::consolidate(
+ std::shared_ptr<PutAllPartialResult> other) {
{
WriteGuard guard(g_readerWriterLock);
m_succeededKeys->addAll(other->getSucceededKeysAndVersions());
@@ -39,11 +40,12 @@ void PutAllPartialResult::consolidate(PutAllPartialResultPtr other) {
}
void PutAllPartialResult::addKeysAndVersions(
- VersionedCacheableObjectPartListPtr keysAndVersion) {
+ std::shared_ptr<VersionedCacheableObjectPartList> keysAndVersion) {
this->m_succeededKeys->addAll(keysAndVersion);
}
-void PutAllPartialResult::addKeys(VectorOfCacheableKeyPtr m_keys) {
+void PutAllPartialResult::addKeys(
+ std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>> m_keys) {
{
WriteGuard guard(g_readerWriterLock);
if (m_succeededKeys->getVersionedTagsize() > 0) {
@@ -54,8 +56,7 @@ void PutAllPartialResult::addKeys(VectorOfCacheableKeyPtr m_keys) {
this->m_succeededKeys->addAllKeys(m_keys);
}
}
-
-VersionedCacheableObjectPartListPtr
+std::shared_ptr<VersionedCacheableObjectPartList>
PutAllPartialResult::getSucceededKeysAndVersions() {
return m_succeededKeys;
}
diff --git a/cppcache/src/PutAllPartialResult.hpp b/cppcache/src/PutAllPartialResult.hpp
index 1bdf4e8..8bf9f61 100644
--- a/cppcache/src/PutAllPartialResult.hpp
+++ b/cppcache/src/PutAllPartialResult.hpp
@@ -30,13 +30,12 @@ namespace geode {
namespace client {
class PutAllPartialResult;
-typedef std::shared_ptr<PutAllPartialResult> PutAllPartialResultPtr;
class PutAllPartialResult : public Serializable {
private:
- VersionedCacheableObjectPartListPtr m_succeededKeys;
- CacheableKeyPtr m_firstFailedKey;
- ExceptionPtr m_firstCauseOfFailure;
+ std::shared_ptr<VersionedCacheableObjectPartList> m_succeededKeys;
+ std::shared_ptr<CacheableKey> m_firstFailedKey;
+ std::shared_ptr<Exception> m_firstCauseOfFailure;
int32_t m_totalMapSize;
ACE_RW_Thread_Mutex g_readerWriterLock;
@@ -49,15 +48,15 @@ class PutAllPartialResult : public Serializable {
// Add all succeededKeys and firstfailedKey.
// Before calling this, we must read PutAllPartialResultServerException and
// formulate obj of type PutAllPartialResult.
- void consolidate(PutAllPartialResultPtr other);
+ void consolidate(std::shared_ptr<PutAllPartialResult> other);
- ExceptionPtr getFailure() { return m_firstCauseOfFailure; }
+ std::shared_ptr<Exception> getFailure() { return m_firstCauseOfFailure; }
- void addKeysAndVersions(VersionedCacheableObjectPartListPtr keysAndVersion);
+ void addKeysAndVersions(std::shared_ptr<VersionedCacheableObjectPartList> keysAndVersion);
- void addKeys(VectorOfCacheableKeyPtr m_keys);
+ void addKeys(std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>> > m_keys);
- void saveFailedKey(CacheableKeyPtr key, ExceptionPtr cause) {
+ void saveFailedKey(std::shared_ptr<CacheableKey> key, std::shared_ptr<Exception> cause) {
if (key == nullptr) {
return;
}
@@ -68,10 +67,10 @@ class PutAllPartialResult : public Serializable {
}
}
- VersionedCacheableObjectPartListPtr getSucceededKeysAndVersions();
+ std::shared_ptr<VersionedCacheableObjectPartList> getSucceededKeysAndVersions();
// Returns the first key that failed
- CacheableKeyPtr getFirstFailedKey() { return m_firstFailedKey; }
+ std::shared_ptr<CacheableKey> getFirstFailedKey() { return m_firstFailedKey; }
// Returns there's failedKeys
bool hasFailure() { return m_firstFailedKey != nullptr; }
@@ -79,7 +78,7 @@ class PutAllPartialResult : public Serializable {
// Returns there's saved succeed keys
bool hasSucceededKeys();
- virtual CacheableStringPtr toString() const {
+ virtual std::shared_ptr<CacheableString> toString() const {
char msgStr1[1024];
if (m_firstFailedKey != nullptr) {
ACE_OS::snprintf(msgStr1, 1024, "[ Key =%s ]",
diff --git a/cppcache/src/PutAllPartialResultServerException.cpp b/cppcache/src/PutAllPartialResultServerException.cpp
index d9858d9..d345785 100644
--- a/cppcache/src/PutAllPartialResultServerException.cpp
+++ b/cppcache/src/PutAllPartialResultServerException.cpp
@@ -22,7 +22,7 @@ namespace geode {
namespace client {
PutAllPartialResultServerException::PutAllPartialResultServerException(
- PutAllPartialResultPtr result) {
+ std::shared_ptr<PutAllPartialResult> result) {
LOGDEBUG("Partial keys are processed in putAll");
m_result = result;
}
@@ -34,43 +34,41 @@ PutAllPartialResultServerException::PutAllPartialResultServerException() {
}
void PutAllPartialResultServerException::consolidate(
- PutAllPartialResultServerExceptionPtr pre) {
+ std::shared_ptr<PutAllPartialResultServerException> pre) {
m_result->consolidate(pre->getResult());
}
void PutAllPartialResultServerException::consolidate(
- PutAllPartialResultPtr otherResult) {
+ std::shared_ptr<PutAllPartialResult> otherResult) {
m_result->consolidate(otherResult);
}
-
-PutAllPartialResultPtr PutAllPartialResultServerException::getResult() {
+std::shared_ptr<PutAllPartialResult>
+PutAllPartialResultServerException::getResult() {
return m_result;
}
-
-VersionedCacheableObjectPartListPtr
+std::shared_ptr<VersionedCacheableObjectPartList>
PutAllPartialResultServerException::getSucceededKeysAndVersions() {
return m_result->getSucceededKeysAndVersions();
}
-
-ExceptionPtr PutAllPartialResultServerException::getFailure() {
- return m_result->getFailure();
-}
-
-bool PutAllPartialResultServerException::hasFailure() {
- return m_result->hasFailure();
-}
-
-CacheableKeyPtr PutAllPartialResultServerException::getFirstFailedKey() {
- return m_result->getFirstFailedKey();
-}
-
-CacheableStringPtr PutAllPartialResultServerException::getMessage() {
- return m_result->toString();
-}
-
-void PutAllPartialResultServerException::toData(DataOutput& output) const {
- throw IllegalStateException(
- "PutAllPartialResultServerException::toData is not intended for use.");
+ std::shared_ptr<Exception> PutAllPartialResultServerException::getFailure() {
+ return m_result->getFailure();
+ }
+
+ bool PutAllPartialResultServerException::hasFailure() {
+ return m_result->hasFailure();
+ }
+ std::shared_ptr<CacheableKey>
+ PutAllPartialResultServerException::getFirstFailedKey() {
+ return m_result->getFirstFailedKey();
+ }
+ std::shared_ptr<CacheableString>
+ PutAllPartialResultServerException::getMessage() {
+ return m_result->toString();
+ }
+
+ void PutAllPartialResultServerException::toData(DataOutput& output) const {
+ throw IllegalStateException(
+ "PutAllPartialResultServerException::toData is not intended for use.");
}
void PutAllPartialResultServerException::fromData(DataInput& input) {
@@ -96,7 +94,7 @@ int8_t PutAllPartialResultServerException::typeId() const {
}
PutAllPartialResultServerException::PutAllPartialResultServerException(
- CacheableStringPtr msg)
+ std::shared_ptr<CacheableString> msg)
: m_message(msg) {}
} // namespace client
diff --git a/cppcache/src/PutAllPartialResultServerException.hpp b/cppcache/src/PutAllPartialResultServerException.hpp
index 793881a..c225d74 100644
--- a/cppcache/src/PutAllPartialResultServerException.hpp
+++ b/cppcache/src/PutAllPartialResultServerException.hpp
@@ -30,8 +30,6 @@ namespace geode {
namespace client {
class PutAllPartialResultServerException;
-typedef std::shared_ptr<PutAllPartialResultServerException>
- PutAllPartialResultServerExceptionPtr;
/**
* @brief PutAllPartialResultServerException class is used to encapsulate
@@ -42,30 +40,30 @@ class CPPCACHE_EXPORT PutAllPartialResultServerException : public Serializable {
* @brief public methods
*/
public:
- PutAllPartialResultServerException(PutAllPartialResultPtr result);
+ PutAllPartialResultServerException(std::shared_ptr<PutAllPartialResult> result);
PutAllPartialResultServerException();
// Consolidate exceptions
- void consolidate(PutAllPartialResultServerExceptionPtr pre);
+ void consolidate(std::shared_ptr<PutAllPartialResultServerException> pre);
- void consolidate(PutAllPartialResultPtr otherResult);
+ void consolidate(std::shared_ptr<PutAllPartialResult> otherResult);
- PutAllPartialResultPtr getResult();
+ std::shared_ptr<PutAllPartialResult> getResult();
/**
* Returns the key set in exception
*/
- VersionedCacheableObjectPartListPtr getSucceededKeysAndVersions();
+ std::shared_ptr<VersionedCacheableObjectPartList> getSucceededKeysAndVersions();
- ExceptionPtr getFailure();
+ std::shared_ptr<Exception> getFailure();
// Returns there's failedKeys
bool hasFailure();
- CacheableKeyPtr getFirstFailedKey();
+ std::shared_ptr<CacheableKey> getFirstFailedKey();
- CacheableStringPtr getMessage();
+ std::shared_ptr<CacheableString> getMessage();
/**
* @brief destructor
@@ -75,7 +73,7 @@ class CPPCACHE_EXPORT PutAllPartialResultServerException : public Serializable {
/**
* @brief constructors
*/
- PutAllPartialResultServerException(CacheableStringPtr msg);
+ PutAllPartialResultServerException(std::shared_ptr<CacheableString> msg);
/**
*@brief serialize this object
@@ -123,12 +121,12 @@ class CPPCACHE_EXPORT PutAllPartialResultServerException : public Serializable {
virtual int8_t typeId() const;
/**
- *@brief return as CacheableStringPtr the Exception name returned from geode
- *sendException api.
+ *@brief return as std::shared_ptr<CacheableString> the Exception name
+ *returned from geode sendException api.
**/
- CacheableStringPtr getName() {
+ std::shared_ptr<CacheableString> getName() {
const char* msg = "PutAllPartialResultServerException";
- CacheableStringPtr str = CacheableString::create(msg);
+ auto str = CacheableString::create(msg);
return str;
}
@@ -138,8 +136,8 @@ class CPPCACHE_EXPORT PutAllPartialResultServerException : public Serializable {
const PutAllPartialResultServerException& other);
void operator=(const PutAllPartialResultServerException& other);
- CacheableStringPtr m_message; // error message
- PutAllPartialResultPtr m_result;
+ std::shared_ptr<CacheableString> m_message; // error message
+ std::shared_ptr<PutAllPartialResult> m_result;
};
} // namespace client
diff --git a/cppcache/src/QueueConnectionRequest.cpp b/cppcache/src/QueueConnectionRequest.cpp
index 0b8c28e..e2185bb 100644
--- a/cppcache/src/QueueConnectionRequest.cpp
+++ b/cppcache/src/QueueConnectionRequest.cpp
@@ -23,7 +23,7 @@
using namespace apache::geode::client;
void QueueConnectionRequest::toData(DataOutput& output) const {
- // CacheableStringPtr abe = CacheableString::create(m_serverGp.c_str());
+ // auto abe = CacheableString::create(m_serverGp.c_str());
// output.writeObject(abe);// changed
output.writeNativeString(m_serverGp.c_str());
output.write(static_cast<int8_t>(GeodeTypeIdsImpl::FixedIDByte));
diff --git a/cppcache/src/QueueConnectionResponse.hpp b/cppcache/src/QueueConnectionResponse.hpp
index cf04e4f..54c0c05 100644
--- a/cppcache/src/QueueConnectionResponse.hpp
+++ b/cppcache/src/QueueConnectionResponse.hpp
@@ -46,7 +46,6 @@ class QueueConnectionResponse : public ServerLocationResponse {
std::list<ServerLocation> m_list;
bool m_durableQueueFound;
};
-typedef std::shared_ptr<QueueConnectionResponse> QueueConnectionResponsePtr;
} // namespace client
} // namespace geode
diff --git a/cppcache/src/Region.cpp b/cppcache/src/Region.cpp
index fa1ce3e..0bf97dd 100644
--- a/cppcache/src/Region.cpp
+++ b/cppcache/src/Region.cpp
@@ -20,7 +20,7 @@
namespace apache {
namespace geode {
namespace client {
-Region::Region(const CachePtr& cache) : m_cache(cache) {}
+Region::Region(const std::shared_ptr<Cache>& cache) : m_cache(cache) {}
Region::~Region() {}
} // namespace client
} // namespace geode
diff --git a/cppcache/src/RegionAttributes.cpp b/cppcache/src/RegionAttributes.cpp
index 040e2b5..32ad5b4 100644
--- a/cppcache/src/RegionAttributes.cpp
+++ b/cppcache/src/RegionAttributes.cpp
@@ -238,8 +238,7 @@ void* getFactoryFunc(const char* lib, const char* funcName) {
} // namespace client
} // namespace geode
} // namespace apache
-
-CacheLoaderPtr RegionAttributes::getCacheLoader() {
+std::shared_ptr<CacheLoader> RegionAttributes::getCacheLoader() {
if ((m_cacheLoader == nullptr) && (m_cacheLoaderLibrary != nullptr)) {
if (CacheXmlParser::managedCacheLoaderFn != nullptr &&
strchr(m_cacheLoaderFactory, '.') != nullptr) {
@@ -256,26 +255,24 @@ CacheLoaderPtr RegionAttributes::getCacheLoader() {
}
return m_cacheLoader;
}
-
-CacheWriterPtr RegionAttributes::getCacheWriter() {
- if ((m_cacheWriter == nullptr) && (m_cacheWriterLibrary != nullptr)) {
- if (CacheXmlParser::managedCacheWriterFn != nullptr &&
- strchr(m_cacheWriterFactory, '.') != nullptr) {
- // this is a managed library
- m_cacheWriter.reset((*CacheXmlParser::managedCacheWriterFn)(
- m_cacheWriterLibrary, m_cacheWriterFactory));
- } else {
- CacheWriter* (*funcptr)();
- funcptr = reinterpret_cast<CacheWriter* (*)()>(
- apache::geode::client::impl::getFactoryFunc(m_cacheWriterLibrary,
- m_cacheWriterFactory));
- m_cacheWriter.reset(funcptr());
- }
- }
- return m_cacheWriter;
-}
-
-CacheListenerPtr RegionAttributes::getCacheListener() {
+ std::shared_ptr<CacheWriter> RegionAttributes::getCacheWriter() {
+ if ((m_cacheWriter == nullptr) && (m_cacheWriterLibrary != nullptr)) {
+ if (CacheXmlParser::managedCacheWriterFn != nullptr &&
+ strchr(m_cacheWriterFactory, '.') != nullptr) {
+ // this is a managed library
+ m_cacheWriter.reset((*CacheXmlParser::managedCacheWriterFn)(
+ m_cacheWriterLibrary, m_cacheWriterFactory));
+ } else {
+ CacheWriter* (*funcptr)();
+ funcptr = reinterpret_cast<CacheWriter* (*)()>(
+ apache::geode::client::impl::getFactoryFunc(m_cacheWriterLibrary,
+ m_cacheWriterFactory));
+ m_cacheWriter.reset(funcptr());
+ }
+ }
+ return m_cacheWriter;
+}
+ std::shared_ptr<CacheListener> RegionAttributes::getCacheListener() {
if ((m_cacheListener == nullptr) && (m_cacheListenerLibrary != nullptr)) {
if (CacheXmlParser::managedCacheListenerFn != nullptr &&
strchr(m_cacheListenerFactory, '.') != nullptr) {
@@ -294,8 +291,7 @@ CacheListenerPtr RegionAttributes::getCacheListener() {
}
return m_cacheListener;
}
-
-PartitionResolverPtr RegionAttributes::getPartitionResolver() {
+ std::shared_ptr<PartitionResolver> RegionAttributes::getPartitionResolver() {
if ((m_partitionResolver == nullptr) &&
(m_partitionResolverLibrary != nullptr)) {
if (CacheXmlParser::managedPartitionResolverFn != nullptr &&
@@ -315,8 +311,7 @@ PartitionResolverPtr RegionAttributes::getPartitionResolver() {
}
return m_partitionResolver;
}
-
-PersistenceManagerPtr RegionAttributes::getPersistenceManager() {
+ std::shared_ptr<PersistenceManager> RegionAttributes::getPersistenceManager() {
if ((m_persistenceManager == nullptr) && (m_persistenceLibrary != nullptr)) {
if (CacheXmlParser::managedPartitionResolverFn != nullptr &&
strchr(m_persistenceFactory, '.') != nullptr) {
@@ -378,8 +373,7 @@ bool RegionAttributes::getClientNotificationEnabled() const {
const char* RegionAttributes::getPersistenceLibrary() {
return m_persistenceLibrary;
}
-
-PropertiesPtr RegionAttributes::getPersistenceProperties() {
+ std::shared_ptr<Properties> RegionAttributes::getPersistenceProperties() {
return m_persistenceProperties;
}
@@ -714,7 +708,7 @@ void RegionAttributes::setCacheWriter(const char* lib, const char* func) {
}
void RegionAttributes::setPersistenceManager(const char* lib, const char* func,
- const PropertiesPtr& config) {
+ const std::shared_ptr<Properties>& config) {
GF_R_ASSERT(lib != nullptr);
GF_R_ASSERT(func != nullptr);
copyStringAttribute(m_persistenceLibrary, lib);
diff --git a/cppcache/src/RegionCommit.cpp b/cppcache/src/RegionCommit.cpp
index d25a8a6..f856bfe 100644
--- a/cppcache/src/RegionCommit.cpp
+++ b/cppcache/src/RegionCommit.cpp
@@ -33,7 +33,7 @@ void RegionCommit::fromData(DataInput& input) {
int32_t size = input.readInt32();
if (size > 0) {
const auto largeModCount = input.readBoolean();
- DSMemberForVersionStampPtr dsMember;
+ std::shared_ptr<DSMemberForVersionStamp> dsMember;
dsMember = input.readObject<DSMemberForVersionStamp>();
auto memId = m_memberListForVersionStamp.add(dsMember);
@@ -56,8 +56,8 @@ void RegionCommit::apply(Cache* cache) {
}
}
-void RegionCommit::fillEvents(Cache* cache,
- std::vector<FarSideEntryOpPtr>& ops) {
+void RegionCommit::fillEvents(
+ Cache* cache, std::vector<std::shared_ptr<FarSideEntryOp>>& ops) {
for (auto& entryOp : m_farSideEntryOps) {
ops.push_back(std::static_pointer_cast<FarSideEntryOp>(entryOp));
}
diff --git a/cppcache/src/RegionCommit.hpp b/cppcache/src/RegionCommit.hpp
index 0d24dfb..36455d1 100644
--- a/cppcache/src/RegionCommit.hpp
+++ b/cppcache/src/RegionCommit.hpp
@@ -37,26 +37,23 @@ namespace apache {
namespace geode {
namespace client {
-_GF_PTR_DEF_(RegionCommit, RegionCommitPtr);
-_GF_PTR_DEF_(FarSideEntryOp, FarSideEntryOpPtr);
-
class RegionCommit {
public:
- RegionCommit(MemberListForVersionStamp& memberListForVersionStamp): m_memberListForVersionStamp(memberListForVersionStamp)
- {};
+ RegionCommit(MemberListForVersionStamp& memberListForVersionStamp)
+ : m_memberListForVersionStamp(memberListForVersionStamp){};
virtual ~RegionCommit(){};
void fromData(DataInput& input);
void apply(Cache* cache);
- void fillEvents(Cache* cache, std::vector<FarSideEntryOpPtr>& ops);
- RegionPtr getRegion(Cache* cache) {
+ void fillEvents(Cache* cache, std::vector<std::shared_ptr<FarSideEntryOp>>& ops);
+ std::shared_ptr<Region> getRegion(Cache* cache) {
return cache->getRegion(m_regionPath->asChar());
}
private:
- CacheableStringPtr m_regionPath;
- CacheableStringPtr m_parentRegionPath;
- std::vector< std::shared_ptr<FarSideEntryOp> > m_farSideEntryOps;
+ std::shared_ptr<CacheableString> m_regionPath;
+ std::shared_ptr<CacheableString> m_parentRegionPath;
+ std::vector<std::shared_ptr<FarSideEntryOp>> m_farSideEntryOps;
MemberListForVersionStamp& m_memberListForVersionStamp;
};
} // namespace client
diff --git a/cppcache/src/RegionConfig.hpp b/cppcache/src/RegionConfig.hpp
index bbf6fb5..2c08c79 100644
--- a/cppcache/src/RegionConfig.hpp
+++ b/cppcache/src/RegionConfig.hpp
@@ -38,7 +38,6 @@ namespace geode {
namespace client {
class RegionConfig;
-typedef std::shared_ptr<RegionConfig> RegionConfigPtr;
class CPPCACHE_EXPORT RegionConfig {
public:
diff --git a/cppcache/src/RegionEntry.cpp b/cppcache/src/RegionEntry.cpp
index 430e8fb..383abe7 100644
--- a/cppcache/src/RegionEntry.cpp
+++ b/cppcache/src/RegionEntry.cpp
@@ -23,21 +23,20 @@ namespace apache {
namespace geode {
namespace client {
-RegionEntry::RegionEntry(const RegionPtr& region, const CacheableKeyPtr& key,
- const CacheablePtr& value)
+RegionEntry::RegionEntry(const std::shared_ptr<Region>& region,
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value)
: m_region(region), m_key(key), m_value(value), m_destroyed(false) {}
RegionEntry::~RegionEntry() {}
-
-CacheableKeyPtr RegionEntry::getKey() { return m_key; }
-
-CacheablePtr RegionEntry::getValue() {
+std::shared_ptr<CacheableKey> RegionEntry::getKey() { return m_key; }
+std::shared_ptr<Cacheable> RegionEntry::getValue() {
return CacheableToken::isInvalid(m_value) ? nullptr : m_value;
}
-
-RegionPtr RegionEntry::getRegion() { return m_region; }
-
-CacheStatisticsPtr RegionEntry::getStatistics() { return m_statistics; }
+std::shared_ptr<Region> RegionEntry::getRegion() { return m_region; }
+std::shared_ptr<CacheStatistics> RegionEntry::getStatistics() {
+ return m_statistics;
+}
bool RegionEntry::isDestroyed() const { return m_destroyed; }
diff --git a/cppcache/src/RegionEvent.cpp b/cppcache/src/RegionEvent.cpp
index e872728..4d5a7dc 100644
--- a/cppcache/src/RegionEvent.cpp
+++ b/cppcache/src/RegionEvent.cpp
@@ -20,8 +20,8 @@ namespace apache {
namespace geode {
namespace client {
-RegionEvent::RegionEvent(const RegionPtr& region,
- const SerializablePtr& aCallbackArgument,
+RegionEvent::RegionEvent(const std::shared_ptr<Region>& region,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
const bool remoteOrigin)
: m_region(region),
m_callbackArgument(aCallbackArgument),
diff --git a/cppcache/src/RegionExpiryHandler.cpp b/cppcache/src/RegionExpiryHandler.cpp
index 61a100e..cd0aae8 100644
--- a/cppcache/src/RegionExpiryHandler.cpp
+++ b/cppcache/src/RegionExpiryHandler.cpp
@@ -30,7 +30,7 @@
using namespace apache::geode::client;
-RegionExpiryHandler::RegionExpiryHandler(RegionInternalPtr& rptr,
+RegionExpiryHandler::RegionExpiryHandler(std::shared_ptr<RegionInternal>& rptr,
ExpirationAction::Action action,
uint32_t duration)
: m_regionPtr(rptr),
@@ -45,7 +45,7 @@ int RegionExpiryHandler::handle_timeout(const ACE_Time_Value& current_time,
const void* arg) {
time_t curr_time = current_time.sec();
try {
- CacheStatisticsPtr ptr = m_regionPtr->getStatistics();
+ auto ptr = m_regionPtr->getStatistics();
uint32_t lastTimeForExp = ptr->getLastAccessedTime();
if (m_regionPtr->getAttributes()->getRegionTimeToLive().count() > 0) {
lastTimeForExp = ptr->getLastModifiedTime();
diff --git a/cppcache/src/RegionExpiryHandler.hpp b/cppcache/src/RegionExpiryHandler.hpp
index e8cf0fe..00f3426 100644
--- a/cppcache/src/RegionExpiryHandler.hpp
+++ b/cppcache/src/RegionExpiryHandler.hpp
@@ -47,8 +47,8 @@ class CPPCACHE_EXPORT RegionExpiryHandler : public ACE_Event_Handler {
/**
* Constructor
*/
- RegionExpiryHandler(RegionInternalPtr& rptr, ExpirationAction::Action action,
- uint32_t duration);
+ RegionExpiryHandler(std::shared_ptr<RegionInternal>& rptr,
+ ExpirationAction::Action action, uint32_t duration);
/** This handler object will be registered with the Timer Queue.
* When the timer expires the handle_timeout is invoked.
@@ -61,7 +61,7 @@ class CPPCACHE_EXPORT RegionExpiryHandler : public ACE_Event_Handler {
void setExpiryTaskId(long expiryTaskId) { m_expiryTaskId = expiryTaskId; }
private:
- RegionInternalPtr m_regionPtr;
+ std::shared_ptr<RegionInternal> m_regionPtr;
ExpirationAction::Action m_action;
uint32_t m_duration;
long m_expiryTaskId;
diff --git a/cppcache/src/RegionFactory.cpp b/cppcache/src/RegionFactory.cpp
index b768695..c0b51b1 100644
--- a/cppcache/src/RegionFactory.cpp
+++ b/cppcache/src/RegionFactory.cpp
@@ -42,10 +42,10 @@ RegionFactory::RegionFactory(RegionShortcut preDefinedRegion,
m_cacheImpl(cacheImpl) {
setRegionShortcut();
}
-
-RegionPtr RegionFactory::create(const char* name) {
- RegionPtr retRegionPtr = nullptr;
- RegionAttributesPtr regAttr = m_attributeFactory->createRegionAttributes();
+std::shared_ptr<Region> RegionFactory::create(const char* name) {
+ std::shared_ptr<Region> retRegionPtr = nullptr;
+ std::shared_ptr<RegionAttributes> regAttr =
+ m_attributeFactory->createRegionAttributes();
if (m_preDefinedRegion != LOCAL && (regAttr->getPoolName() == nullptr ||
strlen(regAttr->getPoolName()) == 0)) {
auto pool = m_cacheImpl->getPoolManager().getDefaultPool();
@@ -81,23 +81,23 @@ void RegionFactory::setRegionShortcut() {
}
RegionFactory& RegionFactory::setCacheLoader(
- const CacheLoaderPtr& cacheLoader) {
+ const std::shared_ptr<CacheLoader>& cacheLoader) {
m_attributeFactory->setCacheLoader(cacheLoader);
return *this;
}
RegionFactory& RegionFactory::setCacheWriter(
- const CacheWriterPtr& cacheWriter) {
+ const std::shared_ptr<CacheWriter>& cacheWriter) {
m_attributeFactory->setCacheWriter(cacheWriter);
return *this;
}
RegionFactory& RegionFactory::setCacheListener(
- const CacheListenerPtr& aListener) {
+ const std::shared_ptr<CacheListener>& aListener) {
m_attributeFactory->setCacheListener(aListener);
return *this;
}
RegionFactory& RegionFactory::setPartitionResolver(
- const PartitionResolverPtr& aResolver) {
+ const std::shared_ptr<PartitionResolver>& aResolver) {
m_attributeFactory->setPartitionResolver(aResolver);
return *this;
}
@@ -190,14 +190,15 @@ RegionFactory& RegionFactory::setCachingEnabled(bool cachingEnabled) {
}
RegionFactory& RegionFactory::setPersistenceManager(
- const PersistenceManagerPtr& persistenceManager,
- const PropertiesPtr& config) {
+ const std::shared_ptr<PersistenceManager>& persistenceManager,
+ const std::shared_ptr<Properties>& config) {
m_attributeFactory->setPersistenceManager(persistenceManager, config);
return *this;
}
RegionFactory& RegionFactory::setPersistenceManager(
- const char* lib, const char* func, const PropertiesPtr& config) {
+ const char* lib, const char* func,
+ const std::shared_ptr<Properties>& config) {
m_attributeFactory->setPersistenceManager(lib, func, config);
return *this;
}
diff --git a/cppcache/src/RegionInternal.cpp b/cppcache/src/RegionInternal.cpp
index 5f8c569..5775a6a 100644
--- a/cppcache/src/RegionInternal.cpp
+++ b/cppcache/src/RegionInternal.cpp
@@ -38,21 +38,23 @@ const CacheEventFlags CacheEventFlags::CACHE_CLOSE(
const CacheEventFlags CacheEventFlags::NOCACHEWRITER(
CacheEventFlags::GF_NOCACHEWRITER);
-RegionInternal::RegionInternal(const CachePtr& cache,
- const RegionAttributesPtr& attributes)
+RegionInternal::RegionInternal(
+ const std::shared_ptr<Cache>& cache,
+ const std::shared_ptr<RegionAttributes>& attributes)
: Region(cache), m_regionAttributes(attributes) {}
RegionInternal::~RegionInternal() {}
-void RegionInternal::registerKeys(const VectorOfCacheableKey& keys,
- bool isDurable, bool getInitialValues,
- bool receiveValues) {
+void RegionInternal::registerKeys(
+ const std::vector<std::shared_ptr<CacheableKey>>& keys, bool isDurable,
+ bool getInitialValues, bool receiveValues) {
throw UnsupportedOperationException(
"registerKeys only supported by "
"Thin Client Region.");
}
-void RegionInternal::unregisterKeys(const VectorOfCacheableKey& keys) {
+void RegionInternal::unregisterKeys(
+ const std::vector<std::shared_ptr<CacheableKey>>& keys) {
throw UnsupportedOperationException(
"unregisterKeys only supported by "
"Thin Client Region.");
@@ -80,9 +82,8 @@ void RegionInternal::unregisterRegex(const char* regex) {
throw UnsupportedOperationException(
"unregisterRegex only supported by Thin Client Region.");
}
-
-SelectResultsPtr RegionInternal::query(const char* predicate,
- std::chrono::milliseconds timeout) {
+std::shared_ptr<SelectResults> RegionInternal::query(
+ const char* predicate, std::chrono::milliseconds timeout) {
throw UnsupportedOperationException(
"query only supported by Thin Client Region.");
}
@@ -92,20 +93,18 @@ bool RegionInternal::existsValue(const char* predicate,
throw UnsupportedOperationException(
"existsValue only supported by Thin Client Region.");
}
-
-SerializablePtr RegionInternal::selectValue(const char* predicate,
- std::chrono::milliseconds timeout) {
+std::shared_ptr<Serializable> RegionInternal::selectValue(
+ const char* predicate, std::chrono::milliseconds timeout) {
throw UnsupportedOperationException(
"selectValue only supported by Thin Client Region.");
}
-
-TombstoneListPtr RegionInternal::getTombstoneList() {
+std::shared_ptr<TombstoneList> RegionInternal::getTombstoneList() {
throw UnsupportedOperationException(
"getTombstoneList only supported by LocalRegion.");
}
-
-RegionEntryPtr RegionInternal::createRegionEntry(const CacheableKeyPtr& key,
- const CacheablePtr& value) {
+std::shared_ptr<RegionEntry> RegionInternal::createRegionEntry(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value) {
return std::make_shared<RegionEntry>(shared_from_this(), key, value);
}
@@ -168,7 +167,7 @@ void RegionInternal::setEntryIdleTimeout(const std::chrono::seconds& duration) {
}
}
-void RegionInternal::setCacheListener(const CacheListenerPtr& aListener) {
+void RegionInternal::setCacheListener(const std::shared_ptr<CacheListener>& aListener) {
if (m_regionAttributes != nullptr) {
m_regionAttributes->m_cacheListener = aListener;
}
@@ -182,7 +181,7 @@ void RegionInternal::setCacheListener(const char* libpath,
}
void RegionInternal::setPartitionResolver(
- const PartitionResolverPtr& aResolver) {
+ const std::shared_ptr<PartitionResolver>& aResolver) {
if (m_regionAttributes != nullptr) {
m_regionAttributes->m_partitionResolver = aResolver;
}
@@ -195,7 +194,7 @@ void RegionInternal::setPartitionResolver(const char* libpath,
}
}
-void RegionInternal::setCacheLoader(const CacheLoaderPtr& aLoader) {
+void RegionInternal::setCacheLoader(const std::shared_ptr<CacheLoader>& aLoader) {
if (m_regionAttributes != nullptr) {
m_regionAttributes->m_cacheLoader = aLoader;
}
@@ -208,7 +207,7 @@ void RegionInternal::setCacheLoader(const char* libpath,
}
}
-void RegionInternal::setCacheWriter(const CacheWriterPtr& aWriter) {
+void RegionInternal::setCacheWriter(const std::shared_ptr<CacheWriter>& aWriter) {
if (m_regionAttributes != nullptr) {
m_regionAttributes->m_cacheWriter = aWriter;
}
@@ -234,24 +233,24 @@ void RegionInternal::setClientNotificationEnabled(
}
}
-void RegionInternal::txDestroy(const CacheableKeyPtr& key,
- const SerializablePtr& callBack,
- VersionTagPtr versionTag) {
+void RegionInternal::txDestroy(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& callBack,
+ std::shared_ptr<VersionTag> versionTag) {
throw UnsupportedOperationException(
"txDestroy only supported by Thin Client Region.");
}
-void RegionInternal::txInvalidate(const CacheableKeyPtr& key,
- const SerializablePtr& callBack,
- VersionTagPtr versionTag) {
+void RegionInternal::txInvalidate(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& callBack,
+ std::shared_ptr<VersionTag> versionTag) {
throw UnsupportedOperationException(
"txInvalidate only supported by Thin Client Region.");
}
-void RegionInternal::txPut(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& callBack,
- VersionTagPtr versionTag) {
+void RegionInternal::txPut(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& callBack,
+ std::shared_ptr<VersionTag> versionTag) {
throw UnsupportedOperationException(
"txPut only supported by Thin Client Region.");
}
diff --git a/cppcache/src/RegionInternal.hpp b/cppcache/src/RegionInternal.hpp
index 3fe6313..1edf9e8 100644
--- a/cppcache/src/RegionInternal.hpp
+++ b/cppcache/src/RegionInternal.hpp
@@ -129,10 +129,8 @@ class CacheEventFlags {
};
class TombstoneList;
-typedef std::shared_ptr<TombstoneList> TombstoneListPtr;
class VersionTag;
-typedef std::shared_ptr<VersionTag> VersionTagPtr;
-_GF_PTR_DEF_(MapEntryImpl, MapEntryImplPtr);
+class MapEntryImpl;
/**
* @class RegionInternal RegionInternal.hpp
*
@@ -146,11 +144,12 @@ class RegionInternal : public Region {
virtual ~RegionInternal();
/** @brief Default implementation of Public Methods from Region
*/
- virtual void registerKeys(const VectorOfCacheableKey& keys,
- bool isDurable = false,
- bool getInitialValues = false,
- bool receiveValues = true) override;
- virtual void unregisterKeys(const VectorOfCacheableKey& keys) override;
+ virtual void registerKeys(
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ bool isDurable = false, bool getInitialValues = false,
+ bool receiveValues = true) override;
+ virtual void unregisterKeys(
+ const std::vector<std::shared_ptr<CacheableKey>>& keys) override;
virtual void registerAllKeys(bool isDurable = false,
bool getInitialValues = false,
bool receiveValues = true) override;
@@ -161,72 +160,75 @@ class RegionInternal : public Region {
bool receiveValues = true) override;
virtual void unregisterRegex(const char* regex) override;
- virtual SelectResultsPtr query(const char* predicate,
- std::chrono::milliseconds timeout =
- DEFAULT_QUERY_RESPONSE_TIMEOUT) override;
+ virtual std::shared_ptr<SelectResults> query(
+ const char* predicate, std::chrono::milliseconds timeout =
+ DEFAULT_QUERY_RESPONSE_TIMEOUT) override;
virtual bool existsValue(const char* predicate,
std::chrono::milliseconds timeout =
DEFAULT_QUERY_RESPONSE_TIMEOUT) override;
- virtual SerializablePtr selectValue(
- const char* predicate,
- std::chrono::milliseconds timeout =
- DEFAULT_QUERY_RESPONSE_TIMEOUT) override;
+ virtual std::shared_ptr<Serializable> selectValue(
+ const char* predicate, std::chrono::milliseconds timeout =
+ DEFAULT_QUERY_RESPONSE_TIMEOUT) override;
/** @brief Public Methods
*/
- virtual PersistenceManagerPtr getPersistenceManager() = 0;
- virtual void setPersistenceManager(PersistenceManagerPtr& pmPtr) = 0;
+ virtual std::shared_ptr<PersistenceManager> getPersistenceManager() = 0;
+ virtual void setPersistenceManager(std::shared_ptr<PersistenceManager>& pmPtr) = 0;
- virtual GfErrType getNoThrow(const CacheableKeyPtr& key, CacheablePtr& value,
- const SerializablePtr& aCallbackArgument) = 0;
+ virtual GfErrType getNoThrow(
+ const std::shared_ptr<CacheableKey>& key,
+ std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument) = 0;
virtual HashMapOfCacheable getAll_internal(
- const VectorOfCacheableKey& keys,
- const SerializablePtr& aCallbackArgument, bool addToLocalCache) = 0;
-
- virtual GfErrType getAllNoThrow(const VectorOfCacheableKey& keys,
- const HashMapOfCacheablePtr& values,
- const HashMapOfExceptionPtr& exceptions,
- const bool addToLocalCache,
- const SerializablePtr& aCallbackArgument) = 0;
- virtual GfErrType putNoThrow(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument,
- CacheablePtr& oldValue, int updateCount,
- const CacheEventFlags eventFlags,
- VersionTagPtr versionTag,
- DataInput* delta = nullptr,
- EventIdPtr eventId = nullptr) = 0;
- virtual GfErrType createNoThrow(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument,
- int updateCount,
- const CacheEventFlags eventFlags,
- VersionTagPtr versionTag) = 0;
- virtual GfErrType destroyNoThrow(const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument,
- int updateCount,
- const CacheEventFlags eventFlags,
- VersionTagPtr versionTag) = 0;
- virtual GfErrType removeNoThrow(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument,
- int updateCount,
- const CacheEventFlags eventFlags,
- VersionTagPtr versionTag) = 0;
- virtual GfErrType invalidateNoThrow(const CacheableKeyPtr& keyPtr,
- const SerializablePtr& aCallbackArgument,
- int updateCount,
- const CacheEventFlags eventFlags,
- VersionTagPtr versionTag) = 0;
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ bool addToLocalCache) = 0;
+
+ virtual GfErrType getAllNoThrow(
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ const std::shared_ptr<HashMapOfCacheable>& values,
+ const std::shared_ptr<HashMapOfException>& exceptions,
+ const bool addToLocalCache,
+ const std::shared_ptr<Serializable>& aCallbackArgument) = 0;
+ virtual GfErrType putNoThrow(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<Cacheable>& oldValue, int updateCount,
+ const CacheEventFlags eventFlags, std::shared_ptr<VersionTag> versionTag,
+ DataInput* delta = nullptr,
+ std::shared_ptr<EventId> eventId = nullptr) = 0;
+ virtual GfErrType createNoThrow(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument, int updateCount,
+ const CacheEventFlags eventFlags,
+ std::shared_ptr<VersionTag> versionTag) = 0;
+ virtual GfErrType destroyNoThrow(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument, int updateCount,
+ const CacheEventFlags eventFlags,
+ std::shared_ptr<VersionTag> versionTag) = 0;
+ virtual GfErrType removeNoThrow(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument, int updateCount,
+ const CacheEventFlags eventFlags,
+ std::shared_ptr<VersionTag> versionTag) = 0;
+ virtual GfErrType invalidateNoThrow(
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Serializable>& aCallbackArgument, int updateCount,
+ const CacheEventFlags eventFlags,
+ std::shared_ptr<VersionTag> versionTag) = 0;
virtual GfErrType invalidateRegionNoThrow(
- const SerializablePtr& aCallbackArgument,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
const CacheEventFlags eventFlags) = 0;
virtual GfErrType destroyRegionNoThrow(
- const SerializablePtr& aCallbackArgument, bool removeFromParent,
- const CacheEventFlags eventFlags) = 0;
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ bool removeFromParent, const CacheEventFlags eventFlags) = 0;
virtual void setRegionExpiryTask() = 0;
virtual void acquireReadLock() = 0;
@@ -241,13 +243,13 @@ class RegionInternal : public Region {
const std::chrono::seconds& duration) = 0;
virtual std::chrono::seconds adjustEntryExpiryDuration(
const std::chrono::seconds& duration) = 0;
- virtual void adjustCacheListener(const CacheListenerPtr& aListener) = 0;
+ virtual void adjustCacheListener(const std::shared_ptr<CacheListener>& aListener) = 0;
virtual void adjustCacheListener(const char* libpath,
const char* factoryFuncName) = 0;
- virtual void adjustCacheLoader(const CacheLoaderPtr& aLoader) = 0;
+ virtual void adjustCacheLoader(const std::shared_ptr<CacheLoader>& aLoader) = 0;
virtual void adjustCacheLoader(const char* libpath,
const char* factoryFuncName) = 0;
- virtual void adjustCacheWriter(const CacheWriterPtr& aWriter) = 0;
+ virtual void adjustCacheWriter(const std::shared_ptr<CacheWriter>& aWriter) = 0;
virtual void adjustCacheWriter(const char* libpath,
const char* factoryFuncName) = 0;
@@ -256,33 +258,37 @@ class RegionInternal : public Region {
virtual bool isDestroyed() const override = 0;
virtual void evict(int32_t percentage) = 0;
virtual CacheImpl* getCacheImpl() const = 0;
- virtual TombstoneListPtr getTombstoneList();
+ virtual std::shared_ptr<TombstoneList> getTombstoneList();
// KN: added now.
virtual void updateAccessAndModifiedTime(bool modified) = 0;
- virtual void updateAccessAndModifiedTimeForEntry(MapEntryImplPtr& ptr,
- bool modified) = 0;
- RegionEntryPtr createRegionEntry(const CacheableKeyPtr& key,
- const CacheablePtr& value);
+ virtual void updateAccessAndModifiedTimeForEntry(
+ std::shared_ptr<MapEntryImpl>& ptr, bool modified) = 0;
+ std::shared_ptr<RegionEntry> createRegionEntry(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value);
virtual void addDisMessToQueue(){};
- virtual void txDestroy(const CacheableKeyPtr& key,
- const SerializablePtr& callBack, VersionTagPtr versionTag);
- virtual void txInvalidate(const CacheableKeyPtr& key,
- const SerializablePtr& callBack,
- VersionTagPtr versionTag);
- virtual void txPut(const CacheableKeyPtr& key, const CacheablePtr& value,
- const SerializablePtr& callBack, VersionTagPtr versionTag);
+ virtual void txDestroy(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& callBack,
+ std::shared_ptr<VersionTag> versionTag);
+ virtual void txInvalidate(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& callBack,
+ std::shared_ptr<VersionTag> versionTag);
+ virtual void txPut(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& callBack,
+ std::shared_ptr<VersionTag> versionTag);
inline bool isConcurrencyCheckEnabled() const {
return m_regionAttributes->getConcurrencyChecksEnabled();
}
- virtual const PoolPtr& getPool() override = 0;
+ virtual const std::shared_ptr<Pool>& getPool() override = 0;
protected:
/**
* @brief constructor
*/
- RegionInternal(const CachePtr& cache, const RegionAttributesPtr& attributes);
+ RegionInternal(const std::shared_ptr<Cache>& cache, const std::shared_ptr<RegionAttributes>& attributes);
void setLruEntriesLimit(uint32_t limit);
void setRegionTimeToLiveExpirationAction(ExpirationAction::Action action);
@@ -293,18 +299,19 @@ class RegionInternal : public Region {
void setRegionIdleTimeout(const std::chrono::seconds& duration);
void setEntryTimeToLive(const std::chrono::seconds& duration);
void setEntryIdleTimeout(const std::chrono::seconds& duration);
- void setCacheListener(const CacheListenerPtr& aListener);
+ void setCacheListener(const std::shared_ptr<CacheListener>& aListener);
void setCacheListener(const char* libpath, const char* factoryFuncName);
- void setPartitionResolver(const PartitionResolverPtr& aListener);
+ void setPartitionResolver(
+ const std::shared_ptr<PartitionResolver>& aListener);
void setPartitionResolver(const char* libpath, const char* factoryFuncName);
- void setCacheLoader(const CacheLoaderPtr& aLoader);
+ void setCacheLoader(const std::shared_ptr<CacheLoader>& aLoader);
void setCacheLoader(const char* libpath, const char* factoryFuncName);
- void setCacheWriter(const CacheWriterPtr& aWriter);
+ void setCacheWriter(const std::shared_ptr<CacheWriter>& aWriter);
void setCacheWriter(const char* libpath, const char* factoryFuncName);
void setEndpoints(const char* endpoints);
void setClientNotificationEnabled(bool clientNotificationEnabled);
- RegionAttributesPtr m_regionAttributes;
+ std::shared_ptr<RegionAttributes> m_regionAttributes;
inline bool entryExpiryEnabled() const {
return m_regionAttributes->getEntryExpiryEnabled();
@@ -318,7 +325,6 @@ class RegionInternal : public Region {
RegionInternal& operator=(const RegionInternal&) = delete;
};
-typedef std::shared_ptr<RegionInternal> RegionInternalPtr;
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/RegionXmlCreation.cpp b/cppcache/src/RegionXmlCreation.cpp
index 8b234d0..4376884 100644
--- a/cppcache/src/RegionXmlCreation.cpp
+++ b/cppcache/src/RegionXmlCreation.cpp
@@ -26,13 +26,15 @@ void RegionXmlCreation::addSubregion(
subRegions.push_back(regionPtr);
}
-void RegionXmlCreation::setAttributes(RegionAttributesPtr attrsPtr) {
+void RegionXmlCreation::setAttributes(
+ std::shared_ptr<RegionAttributes> attrsPtr) {
regAttrs = attrsPtr;
}
+std::shared_ptr<RegionAttributes> RegionXmlCreation::getAttributes() {
+ return regAttrs;
+}
-RegionAttributesPtr RegionXmlCreation::getAttributes() { return regAttrs; }
-
-void RegionXmlCreation::fillIn(RegionPtr regionPtr) {
+void RegionXmlCreation::fillIn(std::shared_ptr<Region> regionPtr) {
for (const auto& regXmlCreation : subRegions) {
regXmlCreation->create(regionPtr);
}
@@ -40,16 +42,16 @@ void RegionXmlCreation::fillIn(RegionPtr regionPtr) {
void RegionXmlCreation::createRoot(Cache* cache) {
GF_D_ASSERT(this->isRoot);
- RegionPtr rootRegPtr = nullptr;
+ std::shared_ptr<Region> rootRegPtr = nullptr;
CacheImpl* cacheImpl = CacheRegionHelper::getCacheImpl(cache);
cacheImpl->createRegion(regionName.c_str(), regAttrs, rootRegPtr);
fillIn(rootRegPtr);
}
-void RegionXmlCreation::create(RegionPtr parent) {
+void RegionXmlCreation::create(std::shared_ptr<Region> parent) {
GF_D_ASSERT(!(this->isRoot));
- RegionPtr subRegPtr = nullptr;
+ std::shared_ptr<Region> subRegPtr = nullptr;
subRegPtr = parent->createSubregion(regionName.c_str(), regAttrs);
fillIn(subRegPtr);
diff --git a/cppcache/src/RegionXmlCreation.hpp b/cppcache/src/RegionXmlCreation.hpp
index a0bd853..deb1ee4 100644
--- a/cppcache/src/RegionXmlCreation.hpp
+++ b/cppcache/src/RegionXmlCreation.hpp
@@ -54,7 +54,7 @@ class CPPCACHE_EXPORT RegionXmlCreation {
bool isRoot;
/** The attributes of this region */
- RegionAttributesPtr regAttrs;
+ std::shared_ptr<RegionAttributes> regAttrs;
/** This region's subregions */
std::vector<std::shared_ptr<RegionXmlCreation>> subRegions;
@@ -66,7 +66,7 @@ class CPPCACHE_EXPORT RegionXmlCreation {
* by this <code>RegionXmlCreation</code>.
*
*/
- void fillIn(RegionPtr region);
+ void fillIn(std::shared_ptr<Region> region);
public:
~RegionXmlCreation() = default;
@@ -83,12 +83,12 @@ class CPPCACHE_EXPORT RegionXmlCreation {
/**
* Sets the attributes of this region
*/
- void setAttributes(RegionAttributesPtr attrsPtr);
+ void setAttributes(std::shared_ptr<RegionAttributes> attrsPtr);
/**
* Gets the attributes of this region
*/
- RegionAttributesPtr getAttributes();
+ std::shared_ptr<RegionAttributes> getAttributes();
/**
* Creates a root {@link Region} in a given <code>Cache</code>
@@ -122,7 +122,7 @@ class CPPCACHE_EXPORT RegionXmlCreation {
* @throws UnknownException otherwise
*
*/
- void create(RegionPtr parent);
+ void create(std::shared_ptr<Region> parent);
std::string getAttrId() const;
void setAttrId(const std::string& attrId);
diff --git a/cppcache/src/RemoteQuery.cpp b/cppcache/src/RemoteQuery.cpp
index d7ed0b0..20d74dd 100644
--- a/cppcache/src/RemoteQuery.cpp
+++ b/cppcache/src/RemoteQuery.cpp
@@ -30,17 +30,18 @@
using namespace apache::geode::client;
-RemoteQuery::RemoteQuery(const char* querystr,
- const RemoteQueryServicePtr& queryService,
- ThinClientBaseDM* tccdmptr, ProxyCachePtr proxyCache) {
+RemoteQuery::RemoteQuery(
+ const char* querystr,
+ const std::shared_ptr<RemoteQueryService>& queryService,
+ ThinClientBaseDM* tccdmptr, std::shared_ptr<ProxyCache> proxyCache) {
m_queryString = querystr;
m_queryService = queryService;
m_tccdm = tccdmptr;
m_proxyCache = proxyCache;
LOGFINEST("RemoteQuery: created a new query: %s", querystr);
}
-
-SelectResultsPtr RemoteQuery::execute(std::chrono::milliseconds timeout) {
+std::shared_ptr<SelectResults> RemoteQuery::execute(
+ std::chrono::milliseconds timeout) {
util::PROTOCOL_OPERATION_TIMEOUT_BOUNDS(timeout);
GuardUserAttribures gua;
if (m_proxyCache != nullptr) {
@@ -48,9 +49,9 @@ SelectResultsPtr RemoteQuery::execute(std::chrono::milliseconds timeout) {
}
return execute(timeout, "Query::execute", m_tccdm, nullptr);
}
-
-SelectResultsPtr RemoteQuery::execute(CacheableVectorPtr paramList,
- std::chrono::milliseconds timeout) {
+std::shared_ptr<SelectResults> RemoteQuery::execute(
+ std::shared_ptr<CacheableVector> paramList,
+ std::chrono::milliseconds timeout) {
util::PROTOCOL_OPERATION_TIMEOUT_BOUNDS(timeout);
GuardUserAttribures gua;
if (m_proxyCache != nullptr) {
@@ -58,10 +59,9 @@ SelectResultsPtr RemoteQuery::execute(CacheableVectorPtr paramList,
}
return execute(timeout, "Query::execute", m_tccdm, paramList);
}
-
-SelectResultsPtr RemoteQuery::execute(std::chrono::milliseconds timeout,
- const char* func, ThinClientBaseDM* tcdm,
- CacheableVectorPtr paramList) {
+std::shared_ptr<SelectResults> RemoteQuery::execute(
+ std::chrono::milliseconds timeout, const char* func, ThinClientBaseDM* tcdm,
+ std::shared_ptr<CacheableVector> paramList) {
ThinClientPoolDM* pool = dynamic_cast<ThinClientPoolDM*>(tcdm);
if (pool != nullptr) {
pool->getStats().incQueryExecutionId();
@@ -81,11 +81,11 @@ SelectResultsPtr RemoteQuery::execute(std::chrono::milliseconds timeout,
GfErrType err = executeNoThrow(timeout, reply, func, tcdm, paramList);
GfErrTypeToException(func, err);
- SelectResultsPtr sr;
+ std::shared_ptr<SelectResults> sr;
LOGFINEST("%s: reading reply for query: %s", func, m_queryString.c_str());
- CacheableVectorPtr values = resultCollector->getQueryResults();
- const std::vector<CacheableStringPtr>& fieldNameVec =
+ auto values = resultCollector->getQueryResults();
+ const std::vector<std::shared_ptr<CacheableString>>& fieldNameVec =
resultCollector->getStructFieldNames();
size_t sizeOfFieldNamesVec = fieldNameVec.size();
if (sizeOfFieldNamesVec == 0) {
@@ -117,10 +117,9 @@ SelectResultsPtr RemoteQuery::execute(std::chrono::milliseconds timeout,
return sr;
}
-GfErrType RemoteQuery::executeNoThrow(std::chrono::milliseconds timeout,
- TcrMessageReply& reply, const char* func,
- ThinClientBaseDM* tcdm,
- CacheableVectorPtr paramList) {
+GfErrType RemoteQuery::executeNoThrow(
+ std::chrono::milliseconds timeout, TcrMessageReply& reply, const char* func,
+ ThinClientBaseDM* tcdm, std::shared_ptr<CacheableVector> paramList) {
LOGFINEST("%s: executing query: %s", func, m_queryString.c_str());
TryReadGuard guard(m_queryService->getLock(), m_queryService->invalid());
diff --git a/cppcache/src/RemoteQuery.hpp b/cppcache/src/RemoteQuery.hpp
index e61e5fb..2ab3ccd 100644
--- a/cppcache/src/RemoteQuery.hpp
+++ b/cppcache/src/RemoteQuery.hpp
@@ -45,36 +45,40 @@ namespace client {
class CPPCACHE_EXPORT RemoteQuery : public Query {
std::string m_queryString;
- RemoteQueryServicePtr m_queryService;
+ std::shared_ptr<RemoteQueryService> m_queryService;
ThinClientBaseDM* m_tccdm;
- ProxyCachePtr m_proxyCache;
+ std::shared_ptr<ProxyCache> m_proxyCache;
public:
- RemoteQuery(const char* querystr, const RemoteQueryServicePtr& queryService,
- ThinClientBaseDM* tccdmptr, ProxyCachePtr proxyCache = nullptr);
+ RemoteQuery(const char* querystr,
+ const std::shared_ptr<RemoteQueryService>& queryService,
+ ThinClientBaseDM* tccdmptr,
+ std::shared_ptr<ProxyCache> proxyCache = nullptr);
//@TODO check the return type, is it ok. second option could be to pass
// SelectResults by reference as a parameter.
- SelectResultsPtr execute(std::chrono::milliseconds timeout =
- DEFAULT_QUERY_RESPONSE_TIMEOUT) override;
+ std::shared_ptr<SelectResults> execute(
+ std::chrono::milliseconds timeout =
+ DEFAULT_QUERY_RESPONSE_TIMEOUT) override;
//@TODO check the return type, is it ok. second option could be to pass
// SelectResults by reference as a parameter.
- SelectResultsPtr execute(CacheableVectorPtr paramList = nullptr,
- std::chrono::milliseconds timeout =
- DEFAULT_QUERY_RESPONSE_TIMEOUT) override;
+ std::shared_ptr<SelectResults> execute(
+ std::shared_ptr<CacheableVector> paramList = nullptr,
+ std::chrono::milliseconds timeout =
+ DEFAULT_QUERY_RESPONSE_TIMEOUT) override;
// executes a query using a given distribution manager
// used by Region.query() and Region.getAll()
- SelectResultsPtr execute(std::chrono::milliseconds timeout, const char* func,
- ThinClientBaseDM* tcdm,
- CacheableVectorPtr paramList);
+ std::shared_ptr<SelectResults> execute(
+ std::chrono::milliseconds timeout, const char* func,
+ ThinClientBaseDM* tcdm, std::shared_ptr<CacheableVector> paramList);
// nothrow version of execute()
GfErrType executeNoThrow(std::chrono::milliseconds timeout,
TcrMessageReply& reply, const char* func,
ThinClientBaseDM* tcdm,
- CacheableVectorPtr paramList);
+ std::shared_ptr<CacheableVector> paramList);
const char* getQueryString() const override;
@@ -83,7 +87,6 @@ class CPPCACHE_EXPORT RemoteQuery : public Query {
bool isCompiled() override;
};
-typedef std::shared_ptr<RemoteQuery> RemoteQueryPtr;
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/RemoteQueryService.cpp b/cppcache/src/RemoteQueryService.cpp
index 67e37f8..e029172 100644
--- a/cppcache/src/RemoteQueryService.cpp
+++ b/cppcache/src/RemoteQueryService.cpp
@@ -53,8 +53,7 @@ void RemoteQueryService::init() {
LOGFINEST("RemoteQueryService::init: done initialization");
}
}
-
-QueryPtr RemoteQueryService::newQuery(const char* querystring) {
+std::shared_ptr<Query> RemoteQueryService::newQuery(const char* querystring) {
LOGDEBUG("RemoteQueryService::newQuery: multiuserMode = %d ",
m_tccdm->isMultiUserMode());
if (!m_tccdm->isMultiUserMode()) {
@@ -65,9 +64,9 @@ QueryPtr RemoteQueryService::newQuery(const char* querystring) {
"QueryService::newQuery: Cache has been closed.");
}
LOGDEBUG("RemoteQueryService: creating a new query: %s", querystring);
- return QueryPtr(new RemoteQuery(querystring, shared_from_this(), m_tccdm));
+ return std::shared_ptr<Query>(new RemoteQuery(querystring, shared_from_this(), m_tccdm));
} else {
- UserAttributesPtr ua =
+ auto ua =
TSSUserAttributesWrapper::s_geodeTSSUserAttributes->getUserAttributes();
TryReadGuard guard(m_rwLock, m_invalid);
@@ -76,8 +75,8 @@ QueryPtr RemoteQueryService::newQuery(const char* querystring) {
"QueryService::newQuery: Cache has been closed.");
}
LOGDEBUG("RemoteQueryService: creating a new query: %s", querystring);
- return QueryPtr(new RemoteQuery(querystring, shared_from_this(), m_tccdm,
- ua->getProxyCache()));
+ return std::shared_ptr<Query>(new RemoteQuery(
+ querystring, shared_from_this(), m_tccdm, ua->getProxyCache()));
}
}
@@ -143,10 +142,9 @@ void RemoteQueryService::executeAllCqs(bool failover) {
LOGFINE("RemoteQueryService: no cq to execute after failover");
}
}
-
-CqQueryPtr RemoteQueryService::newCq(const char* querystr,
- const CqAttributesPtr& cqAttr,
- bool isDurable) {
+std::shared_ptr<CqQuery> RemoteQueryService::newCq(
+ const char* querystr, const std::shared_ptr<CqAttributes>& cqAttr,
+ bool isDurable) {
TryReadGuard guard(m_rwLock, m_invalid);
if (m_invalid) {
@@ -159,10 +157,9 @@ CqQueryPtr RemoteQueryService::newCq(const char* querystr,
name += querystr;
return m_cqService->newCq(name, qs, cqAttr, isDurable);
}
-
-CqQueryPtr RemoteQueryService::newCq(const char* name, const char* querystr,
- const CqAttributesPtr& cqAttr,
- bool isDurable) {
+std::shared_ptr<CqQuery> RemoteQueryService::newCq(
+ const char* name, const char* querystr,
+ const std::shared_ptr<CqAttributes>& cqAttr, bool isDurable) {
TryReadGuard guard(m_rwLock, m_invalid);
if (m_invalid) {
@@ -200,8 +197,7 @@ CqService::query_container_type RemoteQueryService::getCqs() {
}
return vec;
}
-
-CqQueryPtr RemoteQueryService::getCq(const char* name) {
+ std::shared_ptr<CqQuery> RemoteQueryService::getCq(const char* name) {
TryReadGuard guard(m_rwLock, m_invalid);
if (m_invalid) {
@@ -240,8 +236,7 @@ void RemoteQueryService::stopCqs() {
m_cqService->stopAllClientCqs();
}
}
-
-CqServiceStatisticsPtr RemoteQueryService::getCqServiceStatistics() {
+ std::shared_ptr<CqServiceStatistics> RemoteQueryService::getCqServiceStatistics() {
TryReadGuard guard(m_rwLock, m_invalid);
if (m_invalid) {
@@ -273,8 +268,7 @@ void RemoteQueryService::receiveNotification(TcrMessage* msg) {
m_cqService->receiveNotification(msg);
}
-
-CacheableArrayListPtr RemoteQueryService::getAllDurableCqsFromServer() {
+ std::shared_ptr<CacheableArrayList> RemoteQueryService::getAllDurableCqsFromServer() {
TryReadGuard guard(m_rwLock, m_invalid);
if (m_invalid) {
throw CacheClosedException(
diff --git a/cppcache/src/RemoteQueryService.hpp b/cppcache/src/RemoteQueryService.hpp
index 6d24f3c..693f847 100644
--- a/cppcache/src/RemoteQueryService.hpp
+++ b/cppcache/src/RemoteQueryService.hpp
@@ -44,7 +44,7 @@ class CPPCACHE_EXPORT RemoteQueryService
void init();
- QueryPtr newQuery(const char* querystring);
+ std::shared_ptr<Query> newQuery(const char* querystring);
inline ACE_RW_Thread_Mutex& getLock() { return m_rwLock; }
inline const volatile bool& invalid() { return m_invalid; }
@@ -52,19 +52,20 @@ class CPPCACHE_EXPORT RemoteQueryService
void close();
~RemoteQueryService() {}
- virtual CqQueryPtr newCq(const char* querystr, const CqAttributesPtr& cqAttr,
- bool isDurable = false);
- virtual CqQueryPtr newCq(const char* name, const char* querystr,
- const CqAttributesPtr& cqAttr,
- bool isDurable = false);
+ virtual std::shared_ptr<CqQuery> newCq(
+ const char* querystr, const std::shared_ptr<CqAttributes>& cqAttr,
+ bool isDurable = false);
+ virtual std::shared_ptr<CqQuery> newCq(
+ const char* name, const char* querystr,
+ const std::shared_ptr<CqAttributes>& cqAttr, bool isDurable = false);
virtual void closeCqs();
virtual QueryService::query_container_type getCqs();
- virtual CqQueryPtr getCq(const char* name);
+ virtual std::shared_ptr<CqQuery> getCq(const char* name);
virtual void executeCqs();
virtual void stopCqs();
- virtual CqServiceStatisticsPtr getCqServiceStatistics();
+ virtual std::shared_ptr<CqServiceStatistics> getCqServiceStatistics();
void executeAllCqs(bool failover);
- virtual CacheableArrayListPtr getAllDurableCqsFromServer();
+ virtual std::shared_ptr<CacheableArrayList> getAllDurableCqsFromServer();
/**
* execute all cqs on the endpoint after failover
*/
@@ -85,12 +86,11 @@ class CPPCACHE_EXPORT RemoteQueryService
mutable ACE_RW_Thread_Mutex m_rwLock;
ThinClientBaseDM* m_tccdm;
- CqServicePtr m_cqService;
+ std::shared_ptr<CqService> m_cqService;
CqPoolsConnected m_CqPoolsConnected;
statistics::StatisticsFactory* m_statisticsFactory;
};
-typedef std::shared_ptr<RemoteQueryService> RemoteQueryServicePtr;
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/ResultSetImpl.cpp b/cppcache/src/ResultSetImpl.cpp
index 2e8df44..145343b 100644
--- a/cppcache/src/ResultSetImpl.cpp
+++ b/cppcache/src/ResultSetImpl.cpp
@@ -23,7 +23,7 @@
using namespace apache::geode::client;
-ResultSetImpl::ResultSetImpl(const CacheableVectorPtr& response)
+ResultSetImpl::ResultSetImpl(const std::shared_ptr<CacheableVector>& response)
: m_resultSetVector(response)
// UNUSED , m_nextIndex(0)
{}
@@ -34,7 +34,8 @@ int32_t ResultSetImpl::size() const {
return static_cast<int32_t>(m_resultSetVector->size());
}
-const SerializablePtr ResultSetImpl::operator[](int32_t index) const {
+const std::shared_ptr<Serializable> ResultSetImpl::operator[](
+ int32_t index) const {
if (index >= m_resultSetVector->size()) {
throw IllegalArgumentException("index out of bounds");
}
diff --git a/cppcache/src/ResultSetImpl.hpp b/cppcache/src/ResultSetImpl.hpp
index 5eba661..b791b86 100644
--- a/cppcache/src/ResultSetImpl.hpp
+++ b/cppcache/src/ResultSetImpl.hpp
@@ -40,13 +40,13 @@ class CPPCACHE_EXPORT ResultSetImpl
: public ResultSet,
public std::enable_shared_from_this<ResultSetImpl> {
public:
- ResultSetImpl(const CacheableVectorPtr& response);
+ ResultSetImpl(const std::shared_ptr<CacheableVector>& response);
bool isModifiable() const;
int32_t size() const;
- const SerializablePtr operator[](int32_t index) const;
+ const std::shared_ptr<Serializable> operator[](int32_t index) const;
SelectResultsIterator getIterator();
@@ -59,7 +59,7 @@ class CPPCACHE_EXPORT ResultSetImpl
~ResultSetImpl();
private:
- CacheableVectorPtr m_resultSetVector;
+ std::shared_ptr<CacheableVector> m_resultSetVector;
// UNUSED int32_t m_nextIndex;
};
} // namespace client
diff --git a/cppcache/src/SelectResultsIterator.cpp b/cppcache/src/SelectResultsIterator.cpp
index 12c9cce..841bf79 100644
--- a/cppcache/src/SelectResultsIterator.cpp
+++ b/cppcache/src/SelectResultsIterator.cpp
@@ -25,15 +25,16 @@ namespace apache {
namespace geode {
namespace client {
-SelectResultsIterator::SelectResultsIterator(const CacheableVectorPtr& vectorSR,
- SelectResultsPtr srp)
+SelectResultsIterator::SelectResultsIterator(
+ const std::shared_ptr<CacheableVector>& vectorSR,
+ std::shared_ptr<SelectResults> srp)
: m_vectorSR(vectorSR), m_nextIndex(0), m_srp(srp) {}
bool SelectResultsIterator::hasNext() const {
return m_nextIndex < m_vectorSR->size();
}
-const SerializablePtr SelectResultsIterator::next() {
+const std::shared_ptr<Serializable> SelectResultsIterator::next() {
if (!hasNext()) return nullptr;
return m_vectorSR->operator[](m_nextIndex++);
@@ -48,7 +49,7 @@ bool SelectResultsIterator::moveNext() {
}
}
-const SerializablePtr SelectResultsIterator::current() const {
+const std::shared_ptr<Serializable> SelectResultsIterator::current() const {
if (m_nextIndex == 0 || m_nextIndex > m_vectorSR->size()) return nullptr;
return m_vectorSR->operator[](m_nextIndex - 1);
diff --git a/cppcache/src/Serializable.cpp b/cppcache/src/Serializable.cpp
index 143385d..2fef388 100644
--- a/cppcache/src/Serializable.cpp
+++ b/cppcache/src/Serializable.cpp
@@ -42,8 +42,7 @@ int8_t Serializable::DSFID() const {
}
uint32_t Serializable::objectSize() const { return 0; }
-
-CacheableStringPtr Serializable::toString() const {
+std::shared_ptr<CacheableString> Serializable::toString() const {
return Utils::demangleTypeName(typeid(*this).name());
}
} // namespace client
diff --git a/cppcache/src/SerializationRegistry.cpp b/cppcache/src/SerializationRegistry.cpp
index 80f8c84..af9ccbd 100644
--- a/cppcache/src/SerializationRegistry.cpp
+++ b/cppcache/src/SerializationRegistry.cpp
@@ -118,8 +118,8 @@ void TheTypeMap::setup() {
}
/** This starts at reading the typeid.. assumes the length has been read. */
-SerializablePtr SerializationRegistry::deserialize(DataInput& input,
- int8_t typeId) const {
+std::shared_ptr<Serializable> SerializationRegistry::deserialize(
+ DataInput& input, int8_t typeId) const {
bool findinternal = false;
auto currentTypeId = typeId;
@@ -135,7 +135,8 @@ SerializablePtr SerializationRegistry::deserialize(DataInput& input,
break;
}
case GeodeTypeIds::CacheableNullString: {
- return SerializablePtr(CacheableString::createDeserializable());
+ return std::shared_ptr<Serializable>(
+ CacheableString::createDeserializable());
break;
}
case GeodeTypeIdsImpl::PDX: {
@@ -204,7 +205,7 @@ SerializablePtr SerializationRegistry::deserialize(DataInput& input,
throw IllegalStateException("Unregistered class ID in deserialization");
}
- SerializablePtr obj(createType());
+ std::shared_ptr<Serializable> obj(createType());
obj->fromData(input);
return obj;
}
@@ -236,11 +237,11 @@ void SerializationRegistry::addType2(int64_t compId, TypeFactoryMethod func) {
void SerializationRegistry::removeType2(int64_t compId) {
theTypeMap.unbind2(compId);
}
-
-PdxSerializablePtr SerializationRegistry::getPdxType(char* className) {
+std::shared_ptr<PdxSerializable> SerializationRegistry::getPdxType(
+ char* className) {
TypeFactoryMethodPdx objectType = nullptr;
theTypeMap.findPdxType(className, objectType);
- PdxSerializablePtr pdxObj;
+ std::shared_ptr<PdxSerializable> pdxObj;
if (nullptr == objectType) {
try {
pdxObj =
@@ -259,41 +260,38 @@ PdxSerializablePtr SerializationRegistry::getPdxType(char* className) {
return pdxObj;
}
-void SerializationRegistry::setPdxSerializer(PdxSerializerPtr serializer) {
+void SerializationRegistry::setPdxSerializer(std::shared_ptr<PdxSerializer> serializer) {
this->pdxSerializer = serializer;
}
-
-PdxSerializerPtr SerializationRegistry::getPdxSerializer() {
+std::shared_ptr<PdxSerializer> SerializationRegistry::getPdxSerializer() {
return pdxSerializer;
}
-int32_t SerializationRegistry::GetPDXIdForType(PoolPtr pool,
- SerializablePtr pdxType) const {
+int32_t SerializationRegistry::GetPDXIdForType(std::shared_ptr<Pool> pool,
+ std::shared_ptr<Serializable> pdxType) const {
if (pool == nullptr) {
throw IllegalStateException("Pool not found, Pdx operation failed");
}
return static_cast<ThinClientPoolDM*>(pool.get())->GetPDXIdForType(pdxType);
}
-
-SerializablePtr SerializationRegistry::GetPDXTypeById(PoolPtr pool,
+ std::shared_ptr<Serializable> SerializationRegistry::GetPDXTypeById(std::shared_ptr<Pool> pool,
int32_t typeId) const {
- if (pool == nullptr) {
- throw IllegalStateException("Pool not found, Pdx operation failed");
+ if (pool == nullptr) {
+ throw IllegalStateException("Pool not found, Pdx operation failed");
}
return static_cast<ThinClientPoolDM*>(pool.get())->GetPDXTypeById(typeId);
}
-int32_t SerializationRegistry::GetEnumValue(PoolPtr pool,
- SerializablePtr enumInfo) const {
+int32_t SerializationRegistry::GetEnumValue(std::shared_ptr<Pool> pool,
+ std::shared_ptr<Serializable> enumInfo) const {
if (pool == nullptr) {
throw IllegalStateException("Pool not found, Pdx operation failed");
}
return static_cast<ThinClientPoolDM*>(pool.get())->GetEnumValue(enumInfo);
-}
-SerializablePtr SerializationRegistry::GetEnum(PoolPtr pool,
+} std::shared_ptr<Serializable> SerializationRegistry::GetEnum(std::shared_ptr<Pool> pool,
int32_t val) const {
if (pool == nullptr) {
throw IllegalStateException("Pool not found, Pdx operation failed");
diff --git a/cppcache/src/SerializationRegistry.hpp b/cppcache/src/SerializationRegistry.hpp
index 3324a2d..56fafb0 100644
--- a/cppcache/src/SerializationRegistry.hpp
+++ b/cppcache/src/SerializationRegistry.hpp
@@ -124,6 +124,8 @@ class TheTypeMap : private NonCopyable {
void rebindPdxType(char* objFullName, TypeFactoryMethodPdx func);
};
+class Pool;
+
class CPPCACHE_EXPORT SerializationRegistry {
public:
SerializationRegistry() : theTypeMap() {}
@@ -174,7 +176,7 @@ class CPPCACHE_EXPORT SerializationRegistry {
}
}
- inline void serialize(const SerializablePtr& obj, DataOutput& output) const {
+ inline void serialize(const std::shared_ptr<Serializable>& obj, DataOutput& output) const {
serialize(obj.get(), output);
}
@@ -182,7 +184,7 @@ class CPPCACHE_EXPORT SerializationRegistry {
* Read the length, typeid, and run the objs fromData. Returns the New
* object.
*/
- SerializablePtr deserialize(DataInput& input, int8_t typeId = -1) const;
+ std::shared_ptr<Serializable> deserialize(DataInput& input, int8_t typeId = -1) const;
void addType(TypeFactoryMethod func);
@@ -190,9 +192,9 @@ class CPPCACHE_EXPORT SerializationRegistry {
void addPdxType(TypeFactoryMethodPdx func);
- void setPdxSerializer(PdxSerializerPtr pdxSerializer);
+ void setPdxSerializer(std::shared_ptr<PdxSerializer> pdxSerializer);
- PdxSerializerPtr getPdxSerializer();
+ std::shared_ptr<PdxSerializer> getPdxSerializer();
void removeType(int64_t compId);
@@ -205,14 +207,17 @@ class CPPCACHE_EXPORT SerializationRegistry {
void removeType2(int64_t compId);
- int32_t GetPDXIdForType(PoolPtr pool, SerializablePtr pdxType) const;
+ int32_t GetPDXIdForType(std::shared_ptr<Pool> pool,
+ std::shared_ptr<Serializable> pdxType) const;
- SerializablePtr GetPDXTypeById(PoolPtr pool, int32_t typeId) const;
+ std::shared_ptr<Serializable> GetPDXTypeById(std::shared_ptr<Pool> pool,
+ int32_t typeId) const;
- int32_t GetEnumValue(PoolPtr pool, SerializablePtr enumInfo) const;
- SerializablePtr GetEnum(PoolPtr pool, int32_t val) const;
+ int32_t GetEnumValue(std::shared_ptr<Pool> pool, std::shared_ptr<Serializable> enumInfo) const;
+ std::shared_ptr<Serializable> GetEnum(std::shared_ptr<Pool> pool,
+ int32_t val) const;
- PdxSerializablePtr getPdxType(char* className);
+ std::shared_ptr<PdxSerializable> getPdxType(char* className);
typedef std::function<std::shared_ptr<Serializable>(DataInput&)>
PdxTypeHandler;
@@ -221,13 +226,11 @@ class CPPCACHE_EXPORT SerializationRegistry {
}
private:
- PdxSerializerPtr pdxSerializer;
+ std::shared_ptr<PdxSerializer> pdxSerializer;
TheTypeMap theTypeMap;
PdxTypeHandler pdxTypeHandler;
};
-typedef std::shared_ptr<SerializationRegistry> SerializationRegistryPtr;
-
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/ServerLocation.hpp b/cppcache/src/ServerLocation.hpp
index cbe57f9..369e0df 100644
--- a/cppcache/src/ServerLocation.hpp
+++ b/cppcache/src/ServerLocation.hpp
@@ -70,7 +70,7 @@ class CPPCACHE_EXPORT ServerLocation : public Serializable {
}
return "";
}
- void setServername(CacheableStringPtr sn) { m_serverName = sn; }
+ void setServername(std::shared_ptr<CacheableString> sn) { m_serverName = sn; }
int getPort() const { return m_port; }
void toData(DataOutput& output) const {
if (m_serverName != nullptr) {
@@ -156,7 +156,7 @@ class CPPCACHE_EXPORT ServerLocation : public Serializable {
void makeEpString();
protected:
- CacheableStringPtr m_serverName;
+ std::shared_ptr<CacheableString> m_serverName;
int m_port;
std::string m_epString;
};
diff --git a/cppcache/src/StackTrace.hpp b/cppcache/src/StackTrace.hpp
index 7aa5155..f403f26 100644
--- a/cppcache/src/StackTrace.hpp
+++ b/cppcache/src/StackTrace.hpp
@@ -32,7 +32,6 @@ namespace geode {
namespace client {
class StackTrace;
-typedef std::shared_ptr<StackTrace> StackTracePtr;
#ifdef _WINDOWS
class StackTrace {
public:
diff --git a/cppcache/src/Struct.cpp b/cppcache/src/Struct.cpp
index ecc9429..b9bf0bb 100644
--- a/cppcache/src/Struct.cpp
+++ b/cppcache/src/Struct.cpp
@@ -27,7 +27,8 @@ namespace client {
Struct::Struct() : m_parent(nullptr), m_lastAccessIndex(0) {}
-Struct::Struct(StructSet* ssPtr, std::vector<SerializablePtr>& fieldValues) {
+Struct::Struct(StructSet* ssPtr,
+ std::vector<std::shared_ptr<Serializable>>& fieldValues) {
m_parent = ssPtr;
m_fieldValues.insert(m_fieldValues.end(), fieldValues.begin(),
fieldValues.end());
@@ -68,7 +69,7 @@ void Struct::fromData(DataInput& input) {
m_parent = nullptr;
for (int32_t i = 0; i < numOfFields; i++) {
- CacheableStringPtr fieldName = input.readNativeString();
+ auto fieldName = input.readNativeString();
m_fieldNames.emplace(fieldName->asChar(), i);
}
int32_t lengthForTypes = input.readArrayLen();
@@ -80,7 +81,7 @@ void Struct::fromData(DataInput& input) {
int32_t numOfSerializedValues = input.readArrayLen();
skipClassName(input);
for (int i = 0; i < numOfSerializedValues; i++) {
- SerializablePtr val;
+ std::shared_ptr<Serializable> val;
input.readObject(val); // need to look
m_fieldValues.push_back(val);
}
@@ -98,7 +99,7 @@ const std::string& Struct::getFieldName(const int32_t index) const {
throw OutOfRangeException("Struct: fieldName not found.");
}
-const SerializablePtr Struct::operator[](int32_t index) const {
+const std::shared_ptr<Serializable> Struct::operator[](int32_t index) const {
if (index >= m_fieldValues.size()) {
return nullptr;
}
@@ -106,7 +107,8 @@ const SerializablePtr Struct::operator[](int32_t index) const {
return m_fieldValues[index];
}
-const SerializablePtr Struct::operator[](const std::string& fieldName) const {
+const std::shared_ptr<Serializable> Struct::operator[](
+ const std::string& fieldName) const {
int32_t index;
if (m_parent == nullptr) {
const auto& iter = m_fieldNames.find(fieldName);
@@ -120,8 +122,8 @@ const SerializablePtr Struct::operator[](const std::string& fieldName) const {
return m_fieldValues[index];
}
-const StructSetPtr Struct::getStructSet() const {
- return StructSetPtr(m_parent);
+const std::shared_ptr<StructSet> Struct::getStructSet() const {
+ return std::shared_ptr<StructSet>(m_parent);
}
bool Struct::hasNext() const {
@@ -131,7 +133,7 @@ bool Struct::hasNext() const {
return false;
}
-const SerializablePtr Struct::next() {
+const std::shared_ptr<Serializable> Struct::next() {
m_lastAccessIndex++;
return m_fieldValues[m_lastAccessIndex - 1];
}
diff --git a/cppcache/src/StructSetImpl.cpp b/cppcache/src/StructSetImpl.cpp
index c489504..aaed1ab 100644
--- a/cppcache/src/StructSetImpl.cpp
+++ b/cppcache/src/StructSetImpl.cpp
@@ -23,8 +23,8 @@
using namespace apache::geode::client;
StructSetImpl::StructSetImpl(
- const CacheableVectorPtr& response,
- const std::vector<CacheableStringPtr>& fieldNames) {
+ const std::shared_ptr<CacheableVector>& response,
+ const std::vector<std::shared_ptr<CacheableString>>& fieldNames) {
m_nextIndex = 0;
size_t numOfFields = fieldNames.size();
@@ -41,7 +41,7 @@ StructSetImpl::StructSetImpl(
m_structVector = CacheableVector::create();
while (valStoredCnt < numOfValues) {
- std::vector<SerializablePtr> tmpVec;
+ std::vector<std::shared_ptr<Serializable>> tmpVec;
for (size_t i = 0; i < numOfFields; i++) {
tmpVec.push_back(response->operator[](valStoredCnt++));
}
@@ -54,7 +54,8 @@ bool StructSetImpl::isModifiable() const { return false; }
int32_t StructSetImpl::size() const { return m_structVector->size(); }
-const SerializablePtr StructSetImpl::operator[](int32_t index) const {
+const std::shared_ptr<Serializable> StructSetImpl::operator[](
+ int32_t index) const {
if (index >= m_structVector->size()) {
throw IllegalArgumentException("Index out of bounds");
}
diff --git a/cppcache/src/StructSetImpl.hpp b/cppcache/src/StructSetImpl.hpp
index 90b260c..ffdc44d 100644
--- a/cppcache/src/StructSetImpl.hpp
+++ b/cppcache/src/StructSetImpl.hpp
@@ -44,14 +44,15 @@ class CPPCACHE_EXPORT StructSetImpl
: public StructSet,
public std::enable_shared_from_this<StructSetImpl> {
public:
- StructSetImpl(const CacheableVectorPtr& values,
- const std::vector<CacheableStringPtr>& fieldNames);
+ StructSetImpl(
+ const std::shared_ptr<CacheableVector>& values,
+ const std::vector<std::shared_ptr<CacheableString>>& fieldNames);
bool isModifiable() const;
int32_t size() const;
- const SerializablePtr operator[](int32_t index) const;
+ const std::shared_ptr<Serializable> operator[](int32_t index) const;
const int32_t getFieldIndex(const std::string& fieldname);
@@ -68,7 +69,7 @@ class CPPCACHE_EXPORT StructSetImpl
virtual ~StructSetImpl();
private:
- CacheableVectorPtr m_structVector;
+ std::shared_ptr<CacheableVector> m_structVector;
std::map<std::string, int32_t> m_fieldNameIndexMap;
diff --git a/cppcache/src/SuspendedTxExpiryHandler.cpp b/cppcache/src/SuspendedTxExpiryHandler.cpp
index 5fb4b24..9891c00 100644
--- a/cppcache/src/SuspendedTxExpiryHandler.cpp
+++ b/cppcache/src/SuspendedTxExpiryHandler.cpp
@@ -28,7 +28,7 @@
using namespace apache::geode::client;
SuspendedTxExpiryHandler::SuspendedTxExpiryHandler(
- CacheTransactionManagerImpl* cacheTxMgr, TransactionIdPtr tid,
+ CacheTransactionManagerImpl* cacheTxMgr, std::shared_ptr<TransactionId> tid,
std::chrono::seconds duration)
: // UNUSED m_duration(duration),
m_cacheTxMgr(cacheTxMgr),
diff --git a/cppcache/src/SuspendedTxExpiryHandler.hpp b/cppcache/src/SuspendedTxExpiryHandler.hpp
index c9e51c9..5c6c57e 100644
--- a/cppcache/src/SuspendedTxExpiryHandler.hpp
+++ b/cppcache/src/SuspendedTxExpiryHandler.hpp
@@ -48,7 +48,7 @@ class CPPCACHE_EXPORT SuspendedTxExpiryHandler : public ACE_Event_Handler {
* Constructor
*/
SuspendedTxExpiryHandler(CacheTransactionManagerImpl* cacheTxMgr,
- TransactionIdPtr txid,
+ std::shared_ptr<TransactionId> txid,
std::chrono::seconds duration);
/** This task object will be registered with the Timer Queue.
@@ -66,7 +66,7 @@ class CPPCACHE_EXPORT SuspendedTxExpiryHandler : public ACE_Event_Handler {
// modification.
// UNUSED uint32_t m_duration;
CacheTransactionManagerImpl* m_cacheTxMgr;
- TransactionIdPtr m_txid;
+ std::shared_ptr<TransactionId> m_txid;
};
} // namespace client
} // namespace geode
diff --git a/cppcache/src/SystemProperties.cpp b/cppcache/src/SystemProperties.cpp
index e593a7e..282a99a 100644
--- a/cppcache/src/SystemProperties.cpp
+++ b/cppcache/src/SystemProperties.cpp
@@ -160,8 +160,8 @@ void* getFactoryFunc(const char* lib, const char* funcName);
} // namespace impl
-SystemProperties::SystemProperties(const PropertiesPtr& propertiesPtr,
- const char* configFile)
+SystemProperties::SystemProperties(
+ const std::shared_ptr<Properties>& propertiesPtr, const char* configFile)
: m_statisticsSampleInterval(DefaultSamplingInterval),
m_statisticsEnabled(DefaultSamplingEnabled),
m_appDomainEnabled(DefaultAppDomainEnabled),
@@ -230,9 +230,10 @@ SystemProperties::SystemProperties(const PropertiesPtr& propertiesPtr,
public:
explicit ProcessPropsVisitor(SystemProperties* sysProps)
: m_sysProps(sysProps) {}
- void visit(const CacheableKeyPtr& key, const CacheablePtr& value) {
- CacheableStringPtr prop = key->toString();
- CacheableStringPtr val;
+ void visit(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value) {
+ auto prop = key->toString();
+ std::shared_ptr<CacheableString> val;
if (value != nullptr) {
val = value->toString();
}
@@ -241,7 +242,7 @@ SystemProperties::SystemProperties(const PropertiesPtr& propertiesPtr,
} processPropsVisitor(this);
m_securityPropertiesPtr = Properties::create();
- PropertiesPtr givenConfigPtr = Properties::create();
+ auto givenConfigPtr = Properties::create();
// Load the file from product tree.
try {
std::string defsysprops =
@@ -298,7 +299,7 @@ void SystemProperties::parseDurationProperty(
try {
duration = util::chrono::duration::from_string<
std::chrono::duration<_Rep, _Period>>(value);
- } catch (std::invalid_argument& e) {
+ } catch (std::invalid_argument&) {
throwError(
("SystemProperties: non-duration " + property + "=" + value).c_str());
}
@@ -331,7 +332,7 @@ void SystemProperties::processProperty(const char* property,
m_pingInterval =
util::chrono::duration::from_string<decltype(m_pingInterval)>(
std::string(value));
- } catch (std::invalid_argument& e) {
+ } catch (std::invalid_argument&) {
throwError(
("SystemProperties: non-duration " + prop + "=" + value).c_str());
}
@@ -340,7 +341,7 @@ void SystemProperties::processProperty(const char* property,
m_redundancyMonitorInterval =
util::chrono::duration::from_string<decltype(
m_redundancyMonitorInterval)>(std::string(value));
- } catch (std::invalid_argument& e) {
+ } catch (std::invalid_argument&) {
throwError(
("SystemProperties: non-duration " + prop + "=" + value).c_str());
}
@@ -349,7 +350,7 @@ void SystemProperties::processProperty(const char* property,
m_notifyAckInterval =
util::chrono::duration::from_string<decltype(m_notifyAckInterval)>(
std::string(value));
- } catch (std::invalid_argument& e) {
+ } catch (std::invalid_argument&) {
throwError(
("SystemProperties: non-duration " + prop + "=" + value).c_str());
}
diff --git a/cppcache/src/TXCommitMessage.cpp b/cppcache/src/TXCommitMessage.cpp
index 55f7b30..9026ce1 100644
--- a/cppcache/src/TXCommitMessage.cpp
+++ b/cppcache/src/TXCommitMessage.cpp
@@ -115,7 +115,7 @@ m_processorId = -1;
int32_t len = input.readArrayLen();
for (int j = 0; j < len; j++) {
- CacheablePtr tmp;
+ std::shared_ptr<Cacheable> tmp;
input.readObject(tmp);
}
}
@@ -134,10 +134,10 @@ Serializable* TXCommitMessage::create(
}
void TXCommitMessage::apply(Cache* cache) {
- for (std::vector<RegionCommitPtr>::iterator iter = m_regions.begin();
+ for (std::vector<std::shared_ptr<RegionCommit>>::iterator iter =
+ m_regions.begin();
m_regions.end() != iter; iter++) {
- RegionCommitPtr regionCommit =
- std::static_pointer_cast<RegionCommit>(*iter);
+ auto regionCommit = std::static_pointer_cast<RegionCommit>(*iter);
regionCommit->apply(cache);
}
}
diff --git a/cppcache/src/TXCommitMessage.hpp b/cppcache/src/TXCommitMessage.hpp
index eb12895..b4b4977 100644
--- a/cppcache/src/TXCommitMessage.hpp
+++ b/cppcache/src/TXCommitMessage.hpp
@@ -29,8 +29,6 @@ namespace apache {
namespace geode {
namespace client {
-_GF_PTR_DEF_(TXCommitMessage, TXCommitMessagePtr);
-
class TXCommitMessage : public apache::geode::client::Cacheable {
public:
TXCommitMessage(MemberListForVersionStamp& memberListForVersionStamp);
@@ -50,7 +48,7 @@ class TXCommitMessage : public apache::geode::client::Cacheable {
// UNUSED int32_t m_processorId;
bool isAckRequired();
MemberListForVersionStamp& m_memberListForVersionStamp;
- std::vector<RegionCommitPtr> m_regions;
+ std::vector<std::shared_ptr<RegionCommit>> m_regions;
};
} // namespace client
diff --git a/cppcache/src/TXEntryState.hpp b/cppcache/src/TXEntryState.hpp
index 702e7c5..e3f436c 100644
--- a/cppcache/src/TXEntryState.hpp
+++ b/cppcache/src/TXEntryState.hpp
@@ -44,7 +44,7 @@ class TXEntryState {
// UNUSED int32_t m_modSerialNum;
int8_t m_op;
- // TXRegionStatePtr m_txRegionState;
+ // std::shared_ptr<TXRegionState> m_txRegionState;
// UNUSED bool m_bulkOp;
// ORDER of the following is important to the implementation!
@@ -82,7 +82,6 @@ class TXEntryState {
static const int8_t OP_NLOAD_PUT = 26;
};
-_GF_PTR_DEF_(TXEntryState, TXEntryStatePtr);
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/TXId.hpp b/cppcache/src/TXId.hpp
index 54aa2cc..4ca426f 100644
--- a/cppcache/src/TXId.hpp
+++ b/cppcache/src/TXId.hpp
@@ -35,8 +35,6 @@ namespace apache {
namespace geode {
namespace client {
-_GF_PTR_DEF_(TXId, TXIdPtr);
-
class TXId : public apache::geode::client::TransactionId {
public:
TXId();
diff --git a/cppcache/src/TXState.cpp b/cppcache/src/TXState.cpp
index 6e01fc7..ab8e851 100644
--- a/cppcache/src/TXState.cpp
+++ b/cppcache/src/TXState.cpp
@@ -32,7 +32,7 @@ namespace geode {
namespace client {
TXState::TXState(Cache* cache) {
- m_txId = TXIdPtr(new TXId());
+ m_txId = std::shared_ptr<TXId>(new TXId());
m_closed = false;
m_modSerialNum = 0;
m_dirty = false;
@@ -48,59 +48,58 @@ TXState::TXState(Cache* cache) {
}
TXState::~TXState() {}
-
-TXIdPtr TXState::getTransactionId() { return m_txId; }
+std::shared_ptr<TXId> TXState::getTransactionId() { return m_txId; }
int32_t TXState::nextModSerialNum() {
m_modSerialNum += 1;
return m_modSerialNum;
}
+ std::shared_ptr<Cacheable> TXState::replay(bool isRollback) {
+ GfErrTypeThrowException("Replay is unsupported", GF_NOTSUP);
+ int retryAttempts = 3;
-CacheablePtr TXState::replay(bool isRollback) {
- GfErrTypeThrowException("Replay is unsupported", GF_NOTSUP);
- int retryAttempts = 3;
+ std::shared_ptr<Cacheable> result = nullptr;
- CacheablePtr result = nullptr;
+ ReplayControl replayControl(this);
+ m_dirty = false;
+ // if retryAttempts < 0 we retry until there are no servers available
+ for (int i = 0; (retryAttempts < 0) || (i < retryAttempts); i++) {
+ // try {
+ if (isRollback) { // need to roll back these
+ try {
+ m_cache->getCacheTransactionManager()
+ ->rollback(); // this.firstProxy.rollback(proxy.getTxId().getUniqId());
+ } catch (const Exception& ex) {
+ LOGFINE(
+ "caught exception when rolling back before retrying transaction "
+ "%s",
+ ex.getMessage());
+ }
+ }
+ m_txId = std::shared_ptr<TXId>(new TXId());
+ // LOGFINE("retrying transaction after loss of state in server. Attempt #"
+ // + (i+1));
+ try {
+ for (const auto& operation : m_operations) {
+ result = operation->replay(m_cache);
+ }
- ReplayControl replayControl(this);
- m_dirty = false;
- // if retryAttempts < 0 we retry until there are no servers available
- for (int i = 0; (retryAttempts < 0) || (i < retryAttempts); i++) {
- // try {
- if (isRollback) { // need to roll back these
- try {
- m_cache->getCacheTransactionManager()
- ->rollback(); // this.firstProxy.rollback(proxy.getTxId().getUniqId());
- } catch (const Exception& ex) {
- LOGFINE(
- "caught exception when rolling back before retrying transaction %s",
- ex.getMessage());
- }
- }
- m_txId = TXIdPtr(new TXId());
- // LOGFINE("retrying transaction after loss of state in server. Attempt #"
- // + (i+1));
- try {
- for (const auto& operation : m_operations) {
- result = operation->replay(m_cache);
- }
-
- return result;
- } catch (const TransactionDataNodeHasDepartedException& ex) {
- LOGDEBUG("Transaction exception:%s", ex.getMessage());
- isRollback = false;
- // try again
- } catch (const TransactionDataRebalancedException& ex) {
- LOGDEBUG("Transaction exception:%s", ex.getMessage());
- isRollback = true;
- // try again
- }
- }
+ return result;
+ } catch (const TransactionDataNodeHasDepartedException& ex) {
+ LOGDEBUG("Transaction exception:%s", ex.getMessage());
+ isRollback = false;
+ // try again
+ } catch (const TransactionDataRebalancedException& ex) {
+ LOGDEBUG("Transaction exception:%s", ex.getMessage());
+ isRollback = true;
+ // try again
+ }
+ }
- GfErrTypeThrowException(
- "Unable to reestablish transaction context on servers", GF_EUNDEF);
+ GfErrTypeThrowException(
+ "Unable to reestablish transaction context on servers", GF_EUNDEF);
- return nullptr;
+ return nullptr;
}
void TXState::releaseStickyConnection() {
@@ -129,10 +128,11 @@ void TXState::releaseStickyConnection() {
// manager.releaseThreadLocalConnection();
}
-void TXState::recordTXOperation(ServerRegionOperation op,
- const char* regionName, CacheableKeyPtr key,
- VectorOfCacheablePtr arguments) {
- m_operations.push_back(TransactionalOperationPtr(
+void TXState::recordTXOperation(
+ ServerRegionOperation op, const char* regionName,
+ std::shared_ptr<CacheableKey> key,
+ std::shared_ptr<std::vector<std::shared_ptr<Cacheable>>> arguments) {
+ m_operations.push_back(std::shared_ptr<TransactionalOperation>(
new TransactionalOperation(op, regionName, key, arguments)));
}
} // namespace client
diff --git a/cppcache/src/TXState.hpp b/cppcache/src/TXState.hpp
index e1b3081..84e3e89 100644
--- a/cppcache/src/TXState.hpp
+++ b/cppcache/src/TXState.hpp
@@ -29,6 +29,8 @@
#include "TXId.hpp"
#include "TransactionalOperation.hpp"
#include <string>
+#include <vector>
+
namespace apache {
namespace geode {
@@ -39,15 +41,17 @@ class TXState {
TXState(Cache* cache);
virtual ~TXState();
- TXIdPtr getTransactionId();
+ std::shared_ptr<TXId> getTransactionId();
bool isDirty() { return m_dirty; }
void setDirty() { m_dirty = true; }
bool isReplay() { return m_replay; }
bool isPrepared() { return m_prepared; }
void setPrepared() { m_prepared = true; }
- void recordTXOperation(ServerRegionOperation op, const char* regionName,
- CacheableKeyPtr key, VectorOfCacheablePtr arguments);
- CacheablePtr replay(bool isRollback);
+ void recordTXOperation(
+ ServerRegionOperation op, const char* regionName,
+ std::shared_ptr<CacheableKey> key,
+ std::shared_ptr<std::vector<std::shared_ptr<Cacheable>>> arguments);
+ std::shared_ptr<Cacheable> replay(bool isRollback);
void releaseStickyConnection();
// This variable is used only when the transaction is suspended and resumed.
@@ -67,7 +71,7 @@ class TXState {
void endReplay() { m_replay = false; };
private:
- TXIdPtr m_txId;
+ std::shared_ptr<TXId> m_txId;
/**
* Used to hand out modification serial numbers used to preserve
* the order of operation done by this transaction.
@@ -82,7 +86,7 @@ class TXState {
std::string epNameStr;
int32_t nextModSerialNum();
bool m_replay;
- std::vector<TransactionalOperationPtr> m_operations;
+ std::vector<std::shared_ptr<TransactionalOperation>> m_operations;
Cache* m_cache;
ThinClientPoolDM* m_pooldm;
long m_suspendedExpiryTaskId;
diff --git a/cppcache/src/TcrChunkedContext.hpp b/cppcache/src/TcrChunkedContext.hpp
index 068bb09..0aade81 100644
--- a/cppcache/src/TcrChunkedContext.hpp
+++ b/cppcache/src/TcrChunkedContext.hpp
@@ -44,7 +44,7 @@ namespace client {
class TcrChunkedResult {
private:
ACE_Semaphore* m_finalizeSema;
- ExceptionPtr m_ex;
+ std::shared_ptr<Exception> m_ex;
bool m_inSameThread;
std::unique_ptr<AppDomainContext> appDomainContext;
@@ -123,11 +123,9 @@ class TcrChunkedResult {
inline void setException(Exception& ex) { m_ex.reset(ex.clone()); }
- inline ExceptionPtr& getException() { return m_ex; }
+ inline std::shared_ptr<Exception>& getException() { return m_ex; }
};
-typedef std::shared_ptr<TcrChunkedResult> TcrChunkedResultPtr;
-
/**
* Holds the context for a chunk including the chunk bytes, length and the
* {@link TcrChunkedResult} object.
diff --git a/cppcache/src/TcrConnection.cpp b/cppcache/src/TcrConnection.cpp
index 43272b0..9a5086d 100644
--- a/cppcache/src/TcrConnection.cpp
+++ b/cppcache/src/TcrConnection.cpp
@@ -181,8 +181,8 @@ bool TcrConnection::InitTcrConnection(
bool isDhOn = false;
bool requireServerAuth = false;
- PropertiesPtr credentials;
- CacheableBytesPtr serverChallenge;
+ std::shared_ptr<Properties> credentials;
+ std::shared_ptr<CacheableBytes> serverChallenge;
// Write overrides (just conflation for now)
handShakeMsg->write(getOverrides(&sysProp));
@@ -192,7 +192,7 @@ bool TcrConnection::InitTcrConnection(
if (m_endpointObj) {
tmpIsSecurityOn = tmpIsSecurityOn || this->m_endpointObj->isMultiUserMode();
- CacheableStringPtr dhalgo =
+ auto dhalgo =
sysProp.getSecurityProperties()->find("security-client-dhalgo");
LOGDEBUG("TcrConnection this->m_endpointObj->isMultiUserMode() = %d ",
@@ -250,8 +250,7 @@ bool TcrConnection::InitTcrConnection(
}
if (isDhOn) {
- CacheableStringPtr ksPath =
- tmpSecurityProperties->find("security-client-kspath");
+ auto ksPath = tmpSecurityProperties->find("security-client-kspath");
requireServerAuth = (ksPath != nullptr && ksPath->length() > 0);
handShakeMsg->writeBoolean(requireServerAuth);
LOGFINE(
@@ -263,7 +262,7 @@ bool TcrConnection::InitTcrConnection(
handShakeMsg->writeASCII(sysProp.securityClientDhAlgo());
// Send the client's DH public key to the server
- CacheableBytesPtr dhPubKey = m_dh->getPublicKey();
+ auto dhPubKey = m_dh->getPublicKey();
LOGDEBUG("DH pubkey send len is %d", dhPubKey->length());
dhPubKey->toData(*handShakeMsg);
@@ -306,7 +305,7 @@ bool TcrConnection::InitTcrConnection(
ConnErrType error = sendData(data, msgLengh, connectTimeout, false);
if (error == CONN_NOERR) {
- CacheableBytesPtr acceptanceCode = readHandshakeData(1, connectTimeout);
+ auto acceptanceCode = readHandshakeData(1, connectTimeout);
LOGDEBUG(" Handshake: Got Accept Code %d", (*acceptanceCode)[0]);
/* adongre */
@@ -321,7 +320,7 @@ bool TcrConnection::InitTcrConnection(
// if diffie-hellman based credential encryption is enabled
if (isDhOn && (*acceptanceCode)[0] == REPLY_OK) {
// read the server's DH public key
- CacheableBytesPtr pubKeyBytes = readHandshakeByteArray(connectTimeout);
+ auto pubKeyBytes = readHandshakeByteArray(connectTimeout);
LOGDEBUG(" Handshake: Got pubKeySize %d", pubKeyBytes->length());
// set the server's public key on client's DH side
@@ -334,11 +333,10 @@ bool TcrConnection::InitTcrConnection(
if (requireServerAuth) {
// Read Subject Name
- CacheableStringPtr subjectName = readHandshakeString(connectTimeout);
+ auto subjectName = readHandshakeString(connectTimeout);
LOGDEBUG("Got subject %s", subjectName->asChar());
// read the server's signature bytes
- CacheableBytesPtr responseBytes =
- readHandshakeByteArray(connectTimeout);
+ auto responseBytes = readHandshakeByteArray(connectTimeout);
LOGDEBUG("Handshake: Got response size %d", responseBytes->length());
LOGDEBUG("Handshake: Got serverChallenge size %d",
serverChallenge->length());
@@ -350,7 +348,7 @@ bool TcrConnection::InitTcrConnection(
}
// read the challenge bytes from the server
- CacheableBytesPtr challengeBytes = readHandshakeByteArray(connectTimeout);
+ auto challengeBytes = readHandshakeByteArray(connectTimeout);
LOGDEBUG("Handshake: Got challengeSize %d", challengeBytes->length());
// encrypt the credentials and challenge bytes
@@ -359,7 +357,7 @@ bool TcrConnection::InitTcrConnection(
credentials->toData(*cleartext);
}
challengeBytes->toData(*cleartext);
- CacheableBytesPtr ciphertext =
+ auto ciphertext =
m_dh->encrypt(cleartext->getBuffer(), cleartext->getBufferLength());
auto sendCreds = cacheImpl->getCache()->createDataOutput();
@@ -390,7 +388,7 @@ bool TcrConnection::InitTcrConnection(
}
}
- CacheableBytesPtr serverQueueStatus = readHandshakeData(1, connectTimeout);
+ auto serverQueueStatus = readHandshakeData(1, connectTimeout);
// TESTING: Durable clients - set server queue status.
// 0 - Non-Redundant , 1- Redundant , 2- Primary
@@ -401,7 +399,7 @@ bool TcrConnection::InitTcrConnection(
} else {
m_hasServerQueue = NON_REDUNDANT_SERVER;
}
- CacheableBytesPtr queueSizeMsg = readHandshakeData(4, connectTimeout);
+ auto queueSizeMsg = readHandshakeData(4, connectTimeout);
auto dI = cacheImpl->getCache()->createDataInput(queueSizeMsg->value(),
queueSizeMsg->length());
int32_t queueSize = 0;
@@ -428,19 +426,17 @@ bool TcrConnection::InitTcrConnection(
if (!isClientNotification) {
// Read and ignore the DistributedMember object
- CacheableBytesPtr arrayLenHeader = readHandshakeData(1, connectTimeout);
+ auto arrayLenHeader = readHandshakeData(1, connectTimeout);
int32_t recvMsgLen = static_cast<int32_t>((*arrayLenHeader)[0]);
// now check for array length headers - since GFE 5.7
if (static_cast<int8_t>((*arrayLenHeader)[0]) == -2) {
- CacheableBytesPtr recvMsgLenBytes =
- readHandshakeData(2, connectTimeout);
+ auto recvMsgLenBytes = readHandshakeData(2, connectTimeout);
auto dI2 =
m_connectionManager->getCacheImpl()->getCache()->createDataInput(
recvMsgLenBytes->value(), recvMsgLenBytes->length());
recvMsgLen = dI2->readInt16();
} else if (static_cast<int8_t>((*arrayLenHeader)[0]) == -3) {
- CacheableBytesPtr recvMsgLenBytes =
- readHandshakeData(4, connectTimeout);
+ auto recvMsgLenBytes = readHandshakeData(4, connectTimeout);
auto dI2 =
m_connectionManager->getCacheImpl()->getCache()->createDataInput(
recvMsgLenBytes->value(), recvMsgLenBytes->length());
@@ -452,7 +448,7 @@ bool TcrConnection::InitTcrConnection(
LOGDEBUG("Deserializing distributed member Id");
auto diForClient = cacheImpl->getCache()->createDataInput(
recvMessage->value(), recvMessage->length());
- ClientProxyMembershipIDPtr member;
+ std::shared_ptr<ClientProxyMembershipID> member;
member = diForClient->readObject<ClientProxyMembershipID>();
auto memId = cacheImpl->getMemberListForVersionStamp()->add(member);
getEndpointObject()->setDistributedMemberID(memId);
@@ -460,15 +456,14 @@ bool TcrConnection::InitTcrConnection(
}
}
- CacheableBytesPtr recvMsgLenBytes = readHandshakeData(2, connectTimeout);
+ auto recvMsgLenBytes = readHandshakeData(2, connectTimeout);
auto dI3 = m_connectionManager->getCacheImpl()->getCache()->createDataInput(
recvMsgLenBytes->value(), recvMsgLenBytes->length());
uint16_t recvMsgLen2 = dI3->readInt16();
- CacheableBytesPtr recvMessage =
- readHandshakeData(recvMsgLen2, connectTimeout);
+ auto recvMessage = readHandshakeData(recvMsgLen2, connectTimeout);
if (!isClientNotification) {
- CacheableBytesPtr deltaEnabledMsg = readHandshakeData(1, connectTimeout);
+ auto deltaEnabledMsg = readHandshakeData(1, connectTimeout);
auto di =
m_connectionManager->getCacheImpl()->getCache()->createDataInput(
deltaEnabledMsg->value(), 1);
@@ -1130,15 +1125,7 @@ void TcrConnection::close() {
}
}
-/* adongre
- * CID 28738: Unsigned compared against 0 (NO_EFFECT)
- * This less-than-zero comparison of an unsigned value is never true. "msgLength
- * < 0U".
- * Changing the unint32_t to int32_t
- */
-// CacheableBytesPtr TcrConnection::readHandshakeData(uint32_t msgLength,
-// uint32_t connectTimeout )
-CacheableBytesPtr TcrConnection::readHandshakeData(
+std::shared_ptr<CacheableBytes> TcrConnection::readHandshakeData(
int32_t msgLength, std::chrono::microseconds connectTimeout) {
ConnErrType error = CONN_NOERR;
if (msgLength < 0) {
@@ -1173,13 +1160,7 @@ CacheableBytesPtr TcrConnection::readHandshakeData(
return nullptr;
}
-// read just the bytes without the trailing null terminator
-/* adongre
- * CID 28739: Unsigned compared against 0 (NO_EFFECT)
- * change the input parameter from unint32_t to int32_t
- * as the comparasion case is valid
- */
-CacheableBytesPtr TcrConnection::readHandshakeRawData(
+std::shared_ptr<CacheableBytes> TcrConnection::readHandshakeRawData(
int32_t msgLength, std::chrono::microseconds connectTimeout) {
ConnErrType error = CONN_NOERR;
if (msgLength < 0) {
@@ -1213,8 +1194,7 @@ CacheableBytesPtr TcrConnection::readHandshakeRawData(
}
}
-// read a byte array
-CacheableBytesPtr TcrConnection::readHandshakeByteArray(
+std::shared_ptr<CacheableBytes> TcrConnection::readHandshakeByteArray(
std::chrono::microseconds connectTimeout) {
uint32_t arraySize = readHandshakeArraySize(connectTimeout);
return readHandshakeRawData(arraySize, connectTimeout);
@@ -1223,7 +1203,7 @@ CacheableBytesPtr TcrConnection::readHandshakeByteArray(
// read a byte array
uint32_t TcrConnection::readHandshakeArraySize(
std::chrono::microseconds connectTimeout) {
- CacheableBytesPtr codeBytes = readHandshakeData(1, connectTimeout);
+ auto codeBytes = readHandshakeData(1, connectTimeout);
auto codeDI =
m_connectionManager->getCacheImpl()->getCache()->createDataInput(
codeBytes->value(), codeBytes->length());
@@ -1235,19 +1215,19 @@ uint32_t TcrConnection::readHandshakeArraySize(
int32_t tempLen = code;
if (tempLen > 252) { // 252 is java's ((byte)-4 && 0xFF)
if (code == 0xFE) {
- CacheableBytesPtr lenBytes = readHandshakeData(2, connectTimeout);
+ auto lenBytes = readHandshakeData(2, connectTimeout);
auto lenDI =
m_connectionManager->getCacheImpl()->getCache()->createDataInput(
lenBytes->value(), lenBytes->length());
uint16_t val = lenDI->readInt16();
tempLen = val;
} else if (code == 0xFD) {
- CacheableBytesPtr lenBytes = readHandshakeData(4, connectTimeout);
- auto lenDI =
- m_connectionManager->getCacheImpl()->getCache()->createDataInput(
- lenBytes->value(), lenBytes->length());
- uint32_t val = lenDI->readInt32();
- tempLen = val;
+ auto lenBytes = readHandshakeData(4, connectTimeout);
+ auto lenDI =
+ m_connectionManager->getCacheImpl()->getCache()->createDataInput(
+ lenBytes->value(), lenBytes->length());
+ uint32_t val = lenDI->readInt32();
+ tempLen = val;
} else {
GF_SAFE_DELETE_CON(m_conn);
throwException(IllegalStateException("unexpected array length code"));
@@ -1345,7 +1325,8 @@ int32_t TcrConnection::readHandShakeInt(
return val;
}
-CacheableStringPtr TcrConnection::readHandshakeString(
+
+std::shared_ptr<CacheableString> TcrConnection::readHandshakeString(
std::chrono::microseconds connectTimeout) {
ConnErrType error = CONN_NOERR;
@@ -1374,7 +1355,7 @@ CacheableStringPtr TcrConnection::readHandshakeString(
break;
}
case GF_STRING: {
- CacheableBytesPtr lenBytes = readHandshakeData(2, connectTimeout);
+ auto lenBytes = readHandshakeData(2, connectTimeout);
auto lenDI =
m_connectionManager->getCacheImpl()->getCache()->createDataInput(
lenBytes->value(), lenBytes->length());
@@ -1421,7 +1402,7 @@ CacheableStringPtr TcrConnection::readHandshakeString(
return nullptr;
} else {
LOGDEBUG(" Received string data [%s]", recvMessage);
- CacheableStringPtr retval =
+ auto retval =
CacheableString::createNoCopy(recvMessage, length);
return retval;
}
diff --git a/cppcache/src/TcrConnection.hpp b/cppcache/src/TcrConnection.hpp
index f672254..2b4e2b2 100644
--- a/cppcache/src/TcrConnection.hpp
+++ b/cppcache/src/TcrConnection.hpp
@@ -291,7 +291,8 @@ class CPPCACHE_EXPORT TcrConnection {
return *m_connectionManager;
}
- CacheableBytesPtr encryptBytes(CacheableBytesPtr data) {
+ std::shared_ptr<CacheableBytes> encryptBytes(
+ std::shared_ptr<CacheableBytes> data) {
if (m_dh != nullptr) {
return m_dh->encrypt(data);
} else {
@@ -299,7 +300,8 @@ class CPPCACHE_EXPORT TcrConnection {
}
}
- CacheableBytesPtr decryptBytes(CacheableBytesPtr data) {
+ std::shared_ptr<CacheableBytes> decryptBytes(
+ std::shared_ptr<CacheableBytes> data) {
if (m_dh != nullptr) {
return m_dh->decrypt(data);
} else {
@@ -348,27 +350,27 @@ class CPPCACHE_EXPORT TcrConnection {
/**
* Reads bytes from socket and handles error conditions in case of Handshake.
*/
- CacheableBytesPtr readHandshakeData(int32_t msgLength,
- std::chrono::microseconds connectTimeout);
+ std::shared_ptr<CacheableBytes> readHandshakeData(
+ int32_t msgLength, std::chrono::microseconds connectTimeout);
/**
* Reads raw bytes (without appending nullptr terminator) from socket and
* handles error conditions in case of Handshake.
*/
- CacheableBytesPtr readHandshakeRawData(
+ std::shared_ptr<CacheableBytes> readHandshakeRawData(
int32_t msgLength, std::chrono::microseconds connectTimeout);
/**
* Reads a string from socket and handles error conditions in case of
* Handshake.
*/
- CacheableStringPtr readHandshakeString(
+ std::shared_ptr<CacheableString> readHandshakeString(
std::chrono::microseconds connectTimeout);
/**
* Reads a byte array (using initial length) from socket and handles error
* conditions in case of Handshake.
*/
- CacheableBytesPtr readHandshakeByteArray(
+ std::shared_ptr<CacheableBytes> readHandshakeByteArray(
std::chrono::microseconds connectTimeout);
/**
diff --git a/cppcache/src/TcrConnectionManager.cpp b/cppcache/src/TcrConnectionManager.cpp
index 94a70ce..c3ea897 100644
--- a/cppcache/src/TcrConnectionManager.cpp
+++ b/cppcache/src/TcrConnectionManager.cpp
@@ -85,7 +85,7 @@ void TcrConnectionManager::init(bool isPool) {
m_pingTaskId, pingInterval.count());
}
- CacheAttributesPtr cacheAttributes = m_cache->getAttributes();
+ auto cacheAttributes = m_cache->getAttributes();
const char *endpoints;
m_redundancyManager->m_HAenabled = false;
@@ -163,7 +163,7 @@ void TcrConnectionManager::close() {
GF_SAFE_DELETE(m_failoverTask);
}
- CacheAttributesPtr cacheAttributes = m_cache->getAttributes();
+ auto cacheAttributes = m_cache->getAttributes();
if (cacheAttributes != nullptr &&
(cacheAttributes->getRedundancyLevel() > 0 || m_isDurable)) {
if (m_servermonitorTaskId > 0) {
diff --git a/cppcache/src/TcrConnectionManager.hpp b/cppcache/src/TcrConnectionManager.hpp
index 2fec248..fea7fb7 100644
--- a/cppcache/src/TcrConnectionManager.hpp
+++ b/cppcache/src/TcrConnectionManager.hpp
@@ -126,7 +126,7 @@ class CPPCACHE_EXPORT TcrConnectionManager {
m_distMngrsLock.release();
}
- bool checkDupAndAdd(EventIdPtr eventid) {
+ bool checkDupAndAdd(std::shared_ptr<EventId> eventid) {
return m_redundancyManager->checkDupAndAdd(eventid);
}
diff --git a/cppcache/src/TcrEndpoint.cpp b/cppcache/src/TcrEndpoint.cpp
index 3c8a100..f823e11 100644
--- a/cppcache/src/TcrEndpoint.cpp
+++ b/cppcache/src/TcrEndpoint.cpp
@@ -307,7 +307,7 @@ void TcrEndpoint::authenticateEndpoint(TcrConnection*& conn) {
this->setConnected();
ACE_Guard<ACE_Recursive_Thread_Mutex> guard(m_endpointAuthenticationLock);
GfErrType err = GF_NOERR;
- PropertiesPtr creds = getCredentials();
+ auto creds = getCredentials();
if (creds != nullptr) {
LOGDEBUG("TcrEndpoint::authenticateEndpoint got creds from app = %d",
@@ -350,8 +350,7 @@ void TcrEndpoint::authenticateEndpoint(TcrConnection*& conn) {
m_isAuthenticated = true;
}
}
-
-PropertiesPtr TcrEndpoint::getCredentials() {
+std::shared_ptr<Properties> TcrEndpoint::getCredentials() {
const auto& distributedSystem = m_cacheImpl->getDistributedSystem();
const auto& tmpSecurityProperties =
distributedSystem.getSystemProperties().getSecurityProperties();
@@ -591,7 +590,7 @@ void TcrEndpoint::pingServer(ThinClientPoolDM* poolDM) {
}
}
-bool TcrEndpoint::checkDupAndAdd(EventIdPtr eventid) {
+bool TcrEndpoint::checkDupAndAdd(std::shared_ptr<EventId> eventid) {
return m_cacheImpl->tcrConnectionManager().checkDupAndAdd(eventid);
}
@@ -651,7 +650,7 @@ int TcrEndpoint::receiveNotification(volatile bool& isRunning) {
if (!msg->hasCqPart()) {
if (msg->getMessageType() != TcrMessage::CLIENT_MARKER) {
const std::string& regionFullPath1 = msg->getRegionName();
- RegionPtr region1;
+ std::shared_ptr<Region> region1;
m_cacheImpl->getRegion(regionFullPath1.c_str(), region1);
if (region1 != nullptr &&
!static_cast<ThinClientRegion*>(region1.get())
@@ -685,7 +684,7 @@ int TcrEndpoint::receiveNotification(volatile bool& isRunning) {
if (!msg->hasCqPart()) // || msg->isInterestListPassed())
{
const std::string& regionFullPath = msg->getRegionName();
- RegionPtr region;
+ std::shared_ptr<Region> region;
m_cacheImpl->getRegion(regionFullPath.c_str(), region);
if (region != nullptr) {
static_cast<ThinClientRegion*>(region.get())
@@ -698,11 +697,11 @@ int TcrEndpoint::receiveNotification(volatile bool& isRunning) {
}
} else {
LOGDEBUG("receive cq notification %d", msg->getMessageType());
- QueryServicePtr queryService = getQueryService();
- if (queryService != nullptr) {
- static_cast<RemoteQueryService*>(queryService.get())
- ->receiveNotification(msg);
- }
+ auto queryService = getQueryService();
+ if (queryService != nullptr) {
+ static_cast<RemoteQueryService*>(queryService.get())
+ ->receiveNotification(msg);
+ }
}
}
}
@@ -1341,17 +1340,16 @@ bool TcrEndpoint::isQueueHosted() { return m_isQueueHosted; }
void TcrEndpoint::processMarker() {
m_cacheImpl->tcrConnectionManager().processMarker();
}
-
-QueryServicePtr TcrEndpoint::getQueryService() {
- return m_cacheImpl->getQueryService(true);
-}
-void TcrEndpoint::sendRequestForChunkedResponse(const TcrMessage& request,
- TcrMessageReply& reply,
- TcrConnection* conn) {
- conn->sendRequestForChunkedResponse(request, request.getMsgLength(), reply);
-}
-void TcrEndpoint::closeFailedConnection(TcrConnection*& conn) {
- closeConnection(conn);
+ std::shared_ptr<QueryService> TcrEndpoint::getQueryService() {
+ return m_cacheImpl->getQueryService(true);
+ }
+ void TcrEndpoint::sendRequestForChunkedResponse(const TcrMessage& request,
+ TcrMessageReply& reply,
+ TcrConnection* conn) {
+ conn->sendRequestForChunkedResponse(request, request.getMsgLength(), reply);
+ }
+ void TcrEndpoint::closeFailedConnection(TcrConnection*& conn) {
+ closeConnection(conn);
}
} // namespace client
diff --git a/cppcache/src/TcrEndpoint.hpp b/cppcache/src/TcrEndpoint.hpp
index 4837059..e6d1fc4 100644
--- a/cppcache/src/TcrEndpoint.hpp
+++ b/cppcache/src/TcrEndpoint.hpp
@@ -45,6 +45,7 @@ class ThinClientBaseDM;
class CacheImpl;
class ThinClientPoolHADM;
class ThinClientPoolDM;
+class QueryService;
class CPPCACHE_EXPORT TcrEndpoint {
public:
@@ -188,13 +189,13 @@ class CPPCACHE_EXPORT TcrEndpoint {
}
protected:
- PropertiesPtr getCredentials();
+ std::shared_ptr<Properties> getCredentials();
volatile int m_maxConnections;
FairQueue<TcrConnection> m_opConnections;
- virtual bool checkDupAndAdd(EventIdPtr eventid);
+ virtual bool checkDupAndAdd(std::shared_ptr<EventId> eventid);
virtual void processMarker();
virtual void triggerRedundancyThread();
- virtual QueryServicePtr getQueryService();
+ virtual std::shared_ptr<QueryService> getQueryService();
virtual void sendRequestForChunkedResponse(const TcrMessage& request,
TcrMessageReply& reply,
TcrConnection* conn);
diff --git a/cppcache/src/TcrHADistributionManager.cpp b/cppcache/src/TcrHADistributionManager.cpp
index 2a50a52..923980d 100644
--- a/cppcache/src/TcrHADistributionManager.cpp
+++ b/cppcache/src/TcrHADistributionManager.cpp
@@ -28,7 +28,7 @@ using namespace apache::geode::client;
TcrHADistributionManager::TcrHADistributionManager(
ThinClientRegion* theRegion, TcrConnectionManager& connManager,
- CacheAttributesPtr cacheAttributes)
+ std::shared_ptr<CacheAttributes> cacheAttributes)
: ThinClientDistributionManager(connManager, theRegion),
m_cacheAttributes(cacheAttributes),
m_theTcrConnManager(connManager) {
diff --git a/cppcache/src/TcrHADistributionManager.hpp b/cppcache/src/TcrHADistributionManager.hpp
index 61817c6..b471f37 100644
--- a/cppcache/src/TcrHADistributionManager.hpp
+++ b/cppcache/src/TcrHADistributionManager.hpp
@@ -39,7 +39,7 @@ class CPPCACHE_EXPORT TcrHADistributionManager
public:
TcrHADistributionManager(ThinClientRegion* theRegion,
TcrConnectionManager& connManager,
- CacheAttributesPtr cacheAttributes);
+ std::shared_ptr<CacheAttributes> cacheAttributes);
void init();
@@ -83,7 +83,7 @@ class CPPCACHE_EXPORT TcrHADistributionManager
// Disallow copy constructor and assignment operator.
TcrHADistributionManager(const TcrHADistributionManager&);
TcrHADistributionManager& operator=(const TcrHADistributionManager&);
- CacheAttributesPtr m_cacheAttributes;
+ std::shared_ptr<CacheAttributes> m_cacheAttributes;
TcrConnectionManager& m_theTcrConnManager;
GfErrType sendRequestToPrimary(TcrMessage& request, TcrMessageReply& reply) {
diff --git a/cppcache/src/TcrMessage.cpp b/cppcache/src/TcrMessage.cpp
index 7e4c623..8d4f7d1 100644
--- a/cppcache/src/TcrMessage.cpp
+++ b/cppcache/src/TcrMessage.cpp
@@ -116,7 +116,7 @@ void TcrMessage::readBooleanPartAsObject(DataInput& input, bool* boolVal) {
void TcrMessage::readOldValue(DataInput& input) {
int32_t lenObj = input.readInt32();
input.read(); // ignore isObj
- CacheablePtr value;
+ std::shared_ptr<Cacheable> value;
input.readObject(value); // we are not using this value currently
}
@@ -130,12 +130,11 @@ void TcrMessage::readPrMetaData(DataInput& input) {
m_serverGroupVersion);
}
}
-
-VersionTagPtr TcrMessage::readVersionTagPart(
+std::shared_ptr<VersionTag> TcrMessage::readVersionTagPart(
DataInput& input, uint16_t endpointMemId,
MemberListForVersionStamp& memberListForVersionStamp) {
auto isObj = input.read();
- VersionTagPtr versionTag;
+ std::shared_ptr<VersionTag> versionTag;
if (isObj == GeodeTypeIds::NullObj) return versionTag;
@@ -324,10 +323,12 @@ void TcrMessage::readUniqueIDObjectPart(DataInput& input) {
int64_t TcrMessage::getConnectionId(TcrConnection* conn) {
if (m_connectionIDBytes != nullptr) {
- CacheableBytesPtr tmp = conn->decryptBytes(m_connectionIDBytes);
- auto di = m_tcdm->getConnectionManager().getCacheImpl()->getCache()->createDataInput(
- tmp->value(), tmp->length());
- return di->readInt64();
+ auto tmp = conn->decryptBytes(m_connectionIDBytes);
+ auto di = m_tcdm->getConnectionManager()
+ .getCacheImpl()
+ ->getCache()
+ ->createDataInput(tmp->value(), tmp->length());
+ return di->readInt64();
} else {
LOGWARN("Returning 0 as internal connection ID msgtype = %d ", m_msgType);
return 0;
@@ -338,7 +339,7 @@ int64_t TcrMessage::getUniqueId(TcrConnection* conn) {
if (m_value != nullptr) {
auto encryptBytes = std::static_pointer_cast<CacheableBytes>(m_value);
- CacheableBytesPtr tmp = conn->decryptBytes(encryptBytes);
+ auto tmp = conn->decryptBytes(encryptBytes);
auto di = m_tcdm->getConnectionManager().getCacheImpl()->getCache()->createDataInput(
tmp->value(), tmp->length());
@@ -382,9 +383,9 @@ inline void TcrMessage::writeInt(uint8_t* buffer, uint32_t value) {
*(buffer++) = static_cast<uint8_t>(value >> 8);
*(buffer++) = static_cast<uint8_t>(value);
}
-
-SerializablePtr TcrMessage::readCacheableString(DataInput& input, int lenObj) {
- SerializablePtr sPtr;
+std::shared_ptr<Serializable> TcrMessage::readCacheableString(DataInput& input,
+ int lenObj) {
+ std::shared_ptr<Serializable> sPtr;
// check whether unicode or ASCII string (bug #356)
unsigned int decodedLen =
DataInput::getDecodedLength(input.currentBufferPosition(), lenObj);
@@ -421,8 +422,8 @@ SerializablePtr TcrMessage::readCacheableString(DataInput& input, int lenObj) {
return sPtr;
}
-
-SerializablePtr TcrMessage::readCacheableBytes(DataInput& input, int lenObj) {
+std::shared_ptr<Serializable> TcrMessage::readCacheableBytes(DataInput& input,
+ int lenObj) {
if (lenObj <= 252) { // 252 is java's ((byte)-4 && 0xFF)
input.rewindCursor(1);
uint8_t* buffer = const_cast<uint8_t*>(input.currentBufferPosition());
@@ -476,9 +477,9 @@ bool TcrMessage::readExceptionPart(DataInput& input, uint8_t isLastChunk,
return false;
}
-void TcrMessage::writeObjectPart(const SerializablePtr& se, bool isDelta,
- bool callToData,
- const VectorOfCacheableKey* getAllKeyList) {
+void TcrMessage::writeObjectPart(
+ const std::shared_ptr<Serializable>& se, bool isDelta, bool callToData,
+ const std::vector<std::shared_ptr<CacheableKey>>* getAllKeyList) {
// no nullptr check since for some messages nullptr object may be valid
uint32_t size = 0;
m_request->writeInt(
@@ -570,7 +571,7 @@ void TcrMessage::readInt(uint8_t* buffer, uint32_t* value) {
*value = tmp;
}
-void TcrMessage::writeBytesOnly(const SerializablePtr& se) {
+void TcrMessage::writeBytesOnly(const std::shared_ptr<Serializable>& se) {
uint32_t cBufferLength = m_request->getBufferLength();
uint8_t* startBytes = nullptr;
m_request->writeObject(se);
@@ -813,9 +814,9 @@ void TcrMessage::processChunk(const uint8_t* bytes, int32_t len,
if (bytes == nullptr) {
// last chunk -- wait for processing of all the chunks to complete
m_chunkedResult->waitFinalize();
- ExceptionPtr ex = m_chunkedResult->getException();
- if (ex != nullptr) {
- ex->raise();
+ auto ex = m_chunkedResult->getException();
+ if (ex != nullptr) {
+ ex->raise();
}
}
break;
@@ -924,7 +925,7 @@ void TcrMessage::processChunk(const uint8_t* bytes, int32_t len,
const char* TcrMessage::getPoolName() {
if (m_region != nullptr) {
- const PoolPtr& p = (const_cast<Region*>(m_region))->getPool();
+ const std::shared_ptr<Pool>& p = (const_cast<Region*>(m_region))->getPool();
if (p != nullptr) {
return p->getName();
} else {
@@ -1269,7 +1270,7 @@ void TcrMessage::handleByteArrayResponse(
LOGDEBUG("RESPONSE_CLIENT_PR_METADATA len is 17");
return;
}
- m_metadata = new std::vector<std::vector<BucketServerLocationPtr> >();
+ m_metadata = new std::vector<std::vector<std::shared_ptr<BucketServerLocation>> >();
for (int32_t i = 0; i < numparts; i++) {
int32_t bits32 = input->readInt32(); // partlen;
input->read(); // isObj;
@@ -1280,7 +1281,7 @@ void TcrMessage::handleByteArrayResponse(
bits32 = input->readArrayLen(); // array length
LOGDEBUG("Array length = %d ", bits32);
if (bits32 > 0) {
- std::vector<BucketServerLocationPtr> bucketServerLocations;
+ std::vector<std::shared_ptr<BucketServerLocation>> bucketServerLocations;
for (int32_t index = 0; index < bits32; index++) {
// ignore DS typeid, CLASS typeid, and string typeid
input->advanceCursor(3);
@@ -1332,7 +1333,7 @@ void TcrMessage::handleByteArrayResponse(
bits32 = input->readArrayLen(); // array length
if (bits32 > 0) {
- m_fpaSet = new std::vector<FixedPartitionAttributesImplPtr>();
+ m_fpaSet = new std::vector<std::shared_ptr<FixedPartitionAttributesImpl>>();
for (int32_t index = 0; index < bits32; index++) {
input->advanceCursor(
3); // ignore DS typeid, CLASS typeid, string typeid
@@ -1413,7 +1414,7 @@ void TcrMessage::handleByteArrayResponse(
TcrMessageDestroyRegion::TcrMessageDestroyRegion(
std::unique_ptr<DataOutput> dataOutput, const Region* region,
- const SerializablePtr& aCallbackArgument,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
std::chrono::milliseconds messageResponsetimeout,
ThinClientBaseDM* connectionDM) {
m_request = std::move(dataOutput);
@@ -1449,7 +1450,7 @@ TcrMessageDestroyRegion::TcrMessageDestroyRegion(
TcrMessageClearRegion::TcrMessageClearRegion(
std::unique_ptr<DataOutput> dataOutput, const Region* region,
- const SerializablePtr& aCallbackArgument,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
std::chrono::milliseconds messageResponsetimeout,
ThinClientBaseDM* connectionDM) {
m_request = std::move(dataOutput);
@@ -1572,7 +1573,8 @@ TcrMessageCloseCQ::TcrMessageCloseCQ(
TcrMessageQueryWithParameters::TcrMessageQueryWithParameters(
std::unique_ptr<DataOutput> dataOutput, const std::string& regionName,
- const SerializablePtr& aCallbackArgument, CacheableVectorPtr paramList,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<CacheableVector> paramList,
std::chrono::milliseconds messageResponsetimeout,
ThinClientBaseDM* connectionDM) {
m_request = std::move(dataOutput);
@@ -1602,8 +1604,8 @@ TcrMessageQueryWithParameters::TcrMessageQueryWithParameters(
// Part-5: Parameters
if (paramList != nullptr) {
for (int32_t i = 0; i < paramList->size(); i++) {
- CacheablePtr value = (*paramList)[i];
- writeObjectPart(value);
+ auto value = (*paramList)[i];
+ writeObjectPart(value);
}
}
writeMessageLength();
@@ -1611,8 +1613,9 @@ TcrMessageQueryWithParameters::TcrMessageQueryWithParameters(
TcrMessageContainsKey::TcrMessageContainsKey(
std::unique_ptr<DataOutput> dataOutput, const Region* region,
- const CacheableKeyPtr& key, const SerializablePtr& aCallbackArgument,
- bool isContainsKey, ThinClientBaseDM* connectionDM) {
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument, bool isContainsKey,
+ ThinClientBaseDM* connectionDM) {
m_request = std::move(dataOutput);
m_msgType = TcrMessage::CONTAINS_KEY;
m_tcdm = connectionDM;
@@ -1658,11 +1661,11 @@ TcrMessageGetDurableCqs::TcrMessageGetDurableCqs(
writeMessageLength();
}
-TcrMessageRequest::TcrMessageRequest(std::unique_ptr<DataOutput> dataOutput,
- const Region* region,
- const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument,
- ThinClientBaseDM* connectionDM) {
+TcrMessageRequest::TcrMessageRequest(
+ std::unique_ptr<DataOutput> dataOutput, const Region* region,
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ ThinClientBaseDM* connectionDM) {
m_request = std::move(dataOutput);
m_msgType = TcrMessage::REQUEST;
m_tcdm = connectionDM;
@@ -1698,7 +1701,8 @@ TcrMessageRequest::TcrMessageRequest(std::unique_ptr<DataOutput> dataOutput,
TcrMessageInvalidate::TcrMessageInvalidate(
std::unique_ptr<DataOutput> dataOutput, const Region* region,
- const CacheableKeyPtr& key, const SerializablePtr& aCallbackArgument,
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
ThinClientBaseDM* connectionDM) {
m_request = std::move(dataOutput);
m_msgType = TcrMessage::INVALIDATE;
@@ -1733,12 +1737,12 @@ TcrMessageInvalidate::TcrMessageInvalidate(
writeMessageLength();
}
-TcrMessageDestroy::TcrMessageDestroy(std::unique_ptr<DataOutput> dataOutput,
- const Region* region,
- const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument,
- ThinClientBaseDM* connectionDM) {
+TcrMessageDestroy::TcrMessageDestroy(
+ std::unique_ptr<DataOutput> dataOutput, const Region* region,
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ ThinClientBaseDM* connectionDM) {
m_request = std::move(dataOutput);
m_msgType = TcrMessage::DESTROY;
m_tcdm = connectionDM;
@@ -1766,11 +1770,11 @@ TcrMessageDestroy::TcrMessageDestroy(std::unique_ptr<DataOutput> dataOutput,
writeObjectPart(key);
writeObjectPart(value); // expectedOldValue part
uint8_t removeByte = 8; // OP_TYPE_DESTROY value from Operation.java
- CacheableBytePtr removeBytePart = CacheableByte::create(removeByte);
- writeObjectPart(removeBytePart); // operation part
- writeEventIdPart();
- if (aCallbackArgument != nullptr) {
- writeObjectPart(aCallbackArgument);
+ auto removeBytePart = CacheableByte::create(removeByte);
+ writeObjectPart(removeBytePart); // operation part
+ writeEventIdPart();
+ if (aCallbackArgument != nullptr) {
+ writeObjectPart(aCallbackArgument);
}
writeMessageLength();
} else {
@@ -1788,13 +1792,13 @@ TcrMessageDestroy::TcrMessageDestroy(std::unique_ptr<DataOutput> dataOutput,
}
}
-TcrMessagePut::TcrMessagePut(std::unique_ptr<DataOutput> dataOutput,
- const Region* region, const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument, bool isDelta,
- ThinClientBaseDM* connectionDM, bool isMetaRegion,
- bool fullValueAfterDeltaFail,
- const char* regionName) {
+TcrMessagePut::TcrMessagePut(
+ std::unique_ptr<DataOutput> dataOutput, const Region* region,
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument, bool isDelta,
+ ThinClientBaseDM* connectionDM, bool isMetaRegion,
+ bool fullValueAfterDeltaFail, const char* regionName) {
m_request = std::move(dataOutput);
// m_securityHeaderLength = 0;
m_isMetaRegion = isMetaRegion;
@@ -1890,9 +1894,9 @@ TcrMessageClientMarker::TcrMessageClientMarker(
TcrMessageRegisterInterestList::TcrMessageRegisterInterestList(
std::unique_ptr<DataOutput> dataOutput, const Region* region,
- const VectorOfCacheableKey& keys, bool isDurable, bool isCachingEnabled,
- bool receiveValues, InterestResultPolicy interestPolicy,
- ThinClientBaseDM* connectionDM) {
+ const std::vector<std::shared_ptr<CacheableKey>>& keys, bool isDurable,
+ bool isCachingEnabled, bool receiveValues,
+ InterestResultPolicy interestPolicy, ThinClientBaseDM* connectionDM) {
m_request = std::move(dataOutput);
m_msgType = TcrMessage::REGISTER_INTEREST_LIST;
m_tcdm = connectionDM;
@@ -1929,23 +1933,23 @@ TcrMessageRegisterInterestList::TcrMessageRegisterInterestList(
writeObjectPart(cal);
uint8_t bytes[2];
- CacheableBytesPtr byteArr = nullptr;
- bytes[0] = receiveValues ? 0 : 1; // reveive values
- byteArr = CacheableBytes::create(bytes, 1);
- writeObjectPart(byteArr);
- bytes[0] = isCachingEnabled ? 1 : 0; // region policy
- bytes[1] = 0; // serialize values
- byteArr = CacheableBytes::create(bytes, 2);
- writeObjectPart(byteArr);
- writeMessageLength();
- m_interestPolicy = interestPolicy.ordinal;
+std::shared_ptr<CacheableBytes> byteArr = nullptr;
+bytes[0] = receiveValues ? 0 : 1; // reveive values
+byteArr = CacheableBytes::create(bytes, 1);
+writeObjectPart(byteArr);
+bytes[0] = isCachingEnabled ? 1 : 0; // region policy
+bytes[1] = 0; // serialize values
+byteArr = CacheableBytes::create(bytes, 2);
+writeObjectPart(byteArr);
+writeMessageLength();
+m_interestPolicy = interestPolicy.ordinal;
}
TcrMessageUnregisterInterestList::TcrMessageUnregisterInterestList(
std::unique_ptr<DataOutput> dataOutput, const Region* region,
- const VectorOfCacheableKey& keys, bool isDurable, bool isCachingEnabled,
- bool receiveValues, InterestResultPolicy interestPolicy,
- ThinClientBaseDM* connectionDM) {
+ const std::vector<std::shared_ptr<CacheableKey>>& keys, bool isDurable,
+ bool isCachingEnabled, bool receiveValues,
+ InterestResultPolicy interestPolicy, ThinClientBaseDM* connectionDM) {
m_request = std::move(dataOutput);
m_msgType = TcrMessage::UNREGISTER_INTEREST_LIST;
m_tcdm = connectionDM;
@@ -2022,19 +2026,19 @@ TcrMessageRegisterInterest::TcrMessageRegisterInterest(
writeRegionPart(str2); // regexp string
uint8_t bytes[2];
- CacheableBytesPtr byteArr = nullptr;
- bytes[0] = receiveValues ? 0 : 1;
- byteArr = CacheableBytes::create(bytes, 1);
- writeObjectPart(byteArr);
- bytes[0] = isCachingEnabled ? 1 : 0; // region data policy
- bytes[1] = 0; // serializevalues
- byteArr = CacheableBytes::create(bytes, 2);
- writeObjectPart(byteArr);
+std::shared_ptr<CacheableBytes> byteArr = nullptr;
+bytes[0] = receiveValues ? 0 : 1;
+byteArr = CacheableBytes::create(bytes, 1);
+writeObjectPart(byteArr);
+bytes[0] = isCachingEnabled ? 1 : 0; // region data policy
+bytes[1] = 0; // serializevalues
+byteArr = CacheableBytes::create(bytes, 2);
+writeObjectPart(byteArr);
- writeMessageLength();
- m_regionName = str1;
- m_regex = str2;
- m_interestPolicy = interestPolicy.ordinal;
+writeMessageLength();
+m_regionName = str1;
+m_regex = str2;
+m_interestPolicy = interestPolicy.ordinal;
}
TcrMessageUnregisterInterest::TcrMessageUnregisterInterest(
@@ -2142,11 +2146,11 @@ TcrMessagePeriodicAck::TcrMessagePeriodicAck(
writeHeader(m_msgType, numParts);
for (EventIdMapEntryList::const_iterator entry = entries.begin();
entry != entries.end(); ++entry) {
- EventSourcePtr src = entry->first;
- EventSequencePtr seq = entry->second;
- EventIdPtr eid = EventId::create(src->getMemId(), src->getMemIdLen(),
- src->getThrId(), seq->getSeqNum());
- writeObjectPart(eid);
+ auto src = entry->first;
+ auto seq = entry->second;
+ auto eid = EventId::create(src->getMemId(), src->getMemIdLen(),
+ src->getThrId(), seq->getSeqNum());
+ writeObjectPart(eid);
}
writeMessageLength();
}
@@ -2155,7 +2159,7 @@ TcrMessagePutAll::TcrMessagePutAll(
std::unique_ptr<DataOutput> dataOutput, const Region* region,
const HashMapOfCacheable& map,
std::chrono::milliseconds messageResponsetimeout,
- ThinClientBaseDM* connectionDM, const SerializablePtr& aCallbackArgument) {
+ ThinClientBaseDM* connectionDM, const std::shared_ptr<Serializable>& aCallbackArgument) {
m_tcdm = connectionDM;
m_regionName = region->getFullPath();
m_region = region;
@@ -2220,11 +2224,11 @@ TcrMessagePutAll::TcrMessagePutAll(
writeMessageLength();
}
-TcrMessageRemoveAll::TcrMessageRemoveAll(std::unique_ptr<DataOutput> dataOutput,
- const Region* region,
- const VectorOfCacheableKey& keys,
- const SerializablePtr& aCallbackArgument,
- ThinClientBaseDM* connectionDM) {
+TcrMessageRemoveAll::TcrMessageRemoveAll(
+ std::unique_ptr<DataOutput> dataOutput, const Region* region,
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ ThinClientBaseDM* connectionDM) {
m_msgType = TcrMessage::REMOVE_ALL;
m_tcdm = connectionDM;
m_regionName = region->getFullPath();
@@ -2275,11 +2279,11 @@ TcrMessageUpdateClientNotification::TcrMessageUpdateClientNotification(
writeMessageLength();
}
-TcrMessageGetAll::TcrMessageGetAll(std::unique_ptr<DataOutput> dataOutput,
- const Region* region,
- const VectorOfCacheableKey* keys,
- ThinClientBaseDM* connectionDM,
- const SerializablePtr& aCallbackArgument) {
+TcrMessageGetAll::TcrMessageGetAll(
+ std::unique_ptr<DataOutput> dataOutput, const Region* region,
+ const std::vector<std::shared_ptr<CacheableKey>>* keys,
+ ThinClientBaseDM* connectionDM,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
m_msgType = TcrMessage::GET_ALL_70;
m_tcdm = connectionDM;
m_keyList = keys;
@@ -2309,7 +2313,7 @@ TcrMessageGetAll::TcrMessageGetAll(std::unique_ptr<DataOutput> dataOutput,
writeMessageLength();*/
}
-void TcrMessage::InitializeGetallMsg(const SerializablePtr& aCallbackArgument) {
+void TcrMessage::InitializeGetallMsg(const std::shared_ptr<Serializable>& aCallbackArgument) {
/*CacheableObjectArrayPtr keyArr = nullptr;
if (m_keyList != nullptr) {
keyArr = CacheableObjectArray::create();
@@ -2386,8 +2390,8 @@ TcrMessageExecuteCqWithIr::TcrMessageExecuteCqWithIr(
TcrMessageExecuteFunction::TcrMessageExecuteFunction(
std::unique_ptr<DataOutput> dataOutput, const std::string& funcName,
- const CacheablePtr& args, uint8_t getResult, ThinClientBaseDM* connectionDM,
- std::chrono::milliseconds timeout) {
+ const std::shared_ptr<Cacheable>& args, uint8_t getResult,
+ ThinClientBaseDM* connectionDM, std::chrono::milliseconds timeout) {
m_request = std::move(dataOutput);
m_msgType = TcrMessage::EXECUTE_FUNCTION;
@@ -2404,10 +2408,11 @@ TcrMessageExecuteFunction::TcrMessageExecuteFunction(
TcrMessageExecuteRegionFunction::TcrMessageExecuteRegionFunction(
std::unique_ptr<DataOutput> dataOutput, const std::string& funcName,
- const Region* region, const CacheablePtr& args,
- CacheableVectorPtr routingObj, uint8_t getResult,
- CacheableHashSetPtr failedNodes, std::chrono::milliseconds timeout,
- ThinClientBaseDM* connectionDM, int8_t reExecute) {
+ const Region* region, const std::shared_ptr<Cacheable>& args,
+ std::shared_ptr<CacheableVector> routingObj, uint8_t getResult,
+ std::shared_ptr<CacheableHashSet> failedNodes,
+ std::chrono::milliseconds timeout, ThinClientBaseDM* connectionDM,
+ int8_t reExecute) {
m_request = std::move(dataOutput);
m_msgType = TcrMessage::EXECUTE_REGION_FUNCTION;
@@ -2457,9 +2462,9 @@ TcrMessageExecuteRegionFunction::TcrMessageExecuteRegionFunction(
TcrMessageExecuteRegionFunctionSingleHop::
TcrMessageExecuteRegionFunctionSingleHop(
std::unique_ptr<DataOutput> dataOutput, const std::string& funcName,
- const Region* region, const CacheablePtr& args,
- CacheableHashSetPtr routingObj, uint8_t getResult,
- CacheableHashSetPtr failedNodes, bool allBuckets,
+ const Region* region, const std::shared_ptr<Cacheable>& args,
+ std::shared_ptr<CacheableHashSet> routingObj, uint8_t getResult,
+ std::shared_ptr<CacheableHashSet> failedNodes, bool allBuckets,
std::chrono::milliseconds timeout, ThinClientBaseDM* connectionDM) {
m_request = std::move(dataOutput);
@@ -2543,7 +2548,7 @@ TcrMessageSize::TcrMessageSize(std::unique_ptr<DataOutput> dataOutput,
}
TcrMessageUserCredential::TcrMessageUserCredential(
- std::unique_ptr<DataOutput> dataOutput, PropertiesPtr creds,
+ std::unique_ptr<DataOutput> dataOutput, std::shared_ptr<Properties> creds,
ThinClientBaseDM* connectionDM) {
m_request = std::move(dataOutput);
@@ -2577,7 +2582,7 @@ TcrMessageRemoveUserAuth::TcrMessageRemoveUserAuth(
// adding dummy part as server has check for numberofparts > 0
uint8_t dummy = 0;
if (keepAlive) dummy = 1;
- CacheableBytesPtr cbp = CacheableBytes::create(&dummy, 1);
+ auto cbp = CacheableBytes::create(&dummy, 1);
writeObjectPart(cbp, false);
writeMessageLength();
LOGDEBUG("TcrMessage REMOVE_USER_AUTH = %s ",
@@ -2594,9 +2599,9 @@ void TcrMessage::createUserCredentialMessage(TcrConnection* conn) {
if (m_creds != nullptr) m_creds->toData(*dOut);
- CacheableBytesPtr credBytes =
+ auto credBytes =
CacheableBytes::create(dOut->getBuffer(), dOut->getBufferLength());
- CacheableBytesPtr encryptBytes = conn->encryptBytes(credBytes);
+ auto encryptBytes = conn->encryptBytes(credBytes);
writeObjectPart(encryptBytes);
writeMessageLength();
@@ -2623,10 +2628,10 @@ void TcrMessage::addSecurityPart(int64_t connectionId, int64_t unique_id,
dOutput->writeInt(connectionId);
dOutput->writeInt(unique_id);
- CacheableBytesPtr bytes =
+ auto bytes =
CacheableBytes::create(dOutput->getBuffer(), dOutput->getBufferLength());
- CacheableBytesPtr encryptBytes = conn->encryptBytes(bytes);
+ auto encryptBytes = conn->encryptBytes(bytes);
writeObjectPart(encryptBytes);
writeMessageLength();
@@ -2652,10 +2657,10 @@ void TcrMessage::addSecurityPart(int64_t connectionId, TcrConnection* conn) {
dOutput->writeInt(connectionId);
- CacheableBytesPtr bytes =
+ auto bytes =
CacheableBytes::create(dOutput->getBuffer(), dOutput->getBufferLength());
- CacheableBytesPtr encryptBytes = conn->encryptBytes(bytes);
+ auto encryptBytes = conn->encryptBytes(bytes);
writeObjectPart(encryptBytes);
writeMessageLength();
@@ -2667,7 +2672,7 @@ void TcrMessage::addSecurityPart(int64_t connectionId, TcrConnection* conn) {
}
TcrMessageRequestEventValue::TcrMessageRequestEventValue(
- std::unique_ptr<DataOutput> dataOutput, EventIdPtr eventId) {
+ std::unique_ptr<DataOutput> dataOutput, std::shared_ptr<EventId> eventId) {
m_request = std::move(dataOutput);
m_msgType = TcrMessage::REQUEST_EVENT_VALUE;
@@ -2678,8 +2683,9 @@ TcrMessageRequestEventValue::TcrMessageRequestEventValue(
}
TcrMessageGetPdxIdForType::TcrMessageGetPdxIdForType(
- std::unique_ptr<DataOutput> dataOutput, const CacheablePtr& pdxType,
- ThinClientBaseDM* connectionDM, int32_t pdxTypeId) {
+ std::unique_ptr<DataOutput> dataOutput,
+ const std::shared_ptr<Cacheable>& pdxType, ThinClientBaseDM* connectionDM,
+ int32_t pdxTypeId) {
m_request = std::move(dataOutput);
m_msgType = TcrMessage::GET_PDX_ID_FOR_TYPE;
m_tcdm = connectionDM;
@@ -2695,8 +2701,9 @@ TcrMessageGetPdxIdForType::TcrMessageGetPdxIdForType(
}
TcrMessageAddPdxType::TcrMessageAddPdxType(
- std::unique_ptr<DataOutput> dataOutput, const CacheablePtr& pdxType,
- ThinClientBaseDM* connectionDM, int32_t pdxTypeId) {
+ std::unique_ptr<DataOutput> dataOutput,
+ const std::shared_ptr<Cacheable>& pdxType, ThinClientBaseDM* connectionDM,
+ int32_t pdxTypeId) {
m_request = std::move(dataOutput);
m_msgType = TcrMessage::ADD_PDX_TYPE;
m_tcdm = connectionDM;
@@ -2713,8 +2720,9 @@ TcrMessageAddPdxType::TcrMessageAddPdxType(
}
TcrMessageGetPdxIdForEnum::TcrMessageGetPdxIdForEnum(
- std::unique_ptr<DataOutput> dataOutput, const CacheablePtr& pdxType,
- ThinClientBaseDM* connectionDM, int32_t pdxTypeId) {
+ std::unique_ptr<DataOutput> dataOutput,
+ const std::shared_ptr<Cacheable>& pdxType, ThinClientBaseDM* connectionDM,
+ int32_t pdxTypeId) {
m_request = std::move(dataOutput);
m_msgType = TcrMessage::GET_PDX_ID_FOR_ENUM;
m_tcdm = connectionDM;
@@ -2730,8 +2738,9 @@ TcrMessageGetPdxIdForEnum::TcrMessageGetPdxIdForEnum(
}
TcrMessageAddPdxEnum::TcrMessageAddPdxEnum(
- std::unique_ptr<DataOutput> dataOutput, const CacheablePtr& pdxType,
- ThinClientBaseDM* connectionDM, int32_t pdxTypeId) {
+ std::unique_ptr<DataOutput> dataOutput,
+ const std::shared_ptr<Cacheable>& pdxType, ThinClientBaseDM* connectionDM,
+ int32_t pdxTypeId) {
m_request = std::move(dataOutput);
m_msgType = TcrMessage::ADD_PDX_ENUM;
m_tcdm = connectionDM;
@@ -2848,20 +2857,19 @@ void TcrMessage::setMessageTypeRequest(int32_t msgType) {
int32_t TcrMessage::getMessageTypeRequest() const { return m_msgTypeRequest; }
const std::map<std::string, int>* TcrMessage::getCqs() const { return m_cqs; }
+ std::shared_ptr<CacheableKey> TcrMessage::getKey() const { return m_key; }
-CacheableKeyPtr TcrMessage::getKey() const { return m_key; }
-
-const CacheableKeyPtr& TcrMessage::getKeyRef() const { return m_key; }
-
-CacheablePtr TcrMessage::getValue() const { return m_value; }
+const std::shared_ptr<CacheableKey>& TcrMessage::getKeyRef() const { return m_key; }
+std::shared_ptr<Cacheable> TcrMessage::getValue() const { return m_value; }
-const CacheablePtr& TcrMessage::getValueRef() const { return m_value; }
-
-CacheablePtr TcrMessage::getCallbackArgument() const {
+const std::shared_ptr<Cacheable>& TcrMessage::getValueRef() const {
+ return m_value;
+}
+std::shared_ptr<Cacheable> TcrMessage::getCallbackArgument() const {
return m_callbackArgument;
}
-const CacheablePtr& TcrMessage::getCallbackArgumentRef() const {
+const std::shared_ptr<Cacheable>& TcrMessage::getCallbackArgumentRef() const {
return m_callbackArgument;
}
@@ -2884,17 +2892,16 @@ uint32_t TcrMessage::getMsgLength() const {
uint32_t TcrMessage::getMsgBodyLength() const {
return m_request->getBufferLength() - g_headerLen;
}
+ std::shared_ptr<EventId> TcrMessage::getEventId() const { return m_eventid; }
-EventIdPtr TcrMessage::getEventId() const { return m_eventid; }
+ int32_t TcrMessage::getTransId() const { return m_txId; }
-int32_t TcrMessage::getTransId() const { return m_txId; }
+ void TcrMessage::setTransId(int32_t txId) { m_txId = txId; }
-void TcrMessage::setTransId(int32_t txId) { m_txId = txId; }
+ std::chrono::milliseconds TcrMessage::getTimeout() const { return m_timeout; }
-std::chrono::milliseconds TcrMessage::getTimeout() const { return m_timeout; }
-
-void TcrMessage::setTimeout(std::chrono::milliseconds timeout) {
- m_timeout = timeout;
+ void TcrMessage::setTimeout(std::chrono::milliseconds timeout) {
+ m_timeout = timeout;
}
void TcrMessage::skipParts(DataInput& input, int32_t numParts) {
@@ -2921,31 +2928,30 @@ void TcrMessage::readEventIdPart(DataInput& input, bool skip, int32_t parts) {
m_eventid = input.readObject<EventId>();
}
-
-DSMemberForVersionStampPtr TcrMessage::readDSMember(
+ std::shared_ptr<DSMemberForVersionStamp> TcrMessage::readDSMember(
apache::geode::client::DataInput& input) {
- uint8_t typeidLen = input.read();
- if (typeidLen == 1) {
- uint8_t typeidofMember = input.read();
- if (typeidofMember != GeodeTypeIdsImpl::InternalDistributedMember) {
- throw Exception(
- "Reading DSMember. Expecting type id 92 for "
- "InternalDistributedMember. ");
- }
-
- ClientProxyMembershipIDPtr memId =
- ClientProxyMembershipIDPtr(new ClientProxyMembershipID());
- memId->fromData(input);
- return (DSMemberForVersionStampPtr)memId;
- } else if (typeidLen == 2) {
- uint16_t typeidofMember = input.readInt16();
- if (typeidofMember != GeodeTypeIdsImpl::DiskStoreId) {
- throw Exception(
- "Reading DSMember. Expecting type id 2133 for DiskStoreId. ");
- }
- DiskStoreId* diskStore = new DiskStoreId();
- diskStore->fromData(input);
- return DSMemberForVersionStampPtr(diskStore);
+ uint8_t typeidLen = input.read();
+ if (typeidLen == 1) {
+ uint8_t typeidofMember = input.read();
+ if (typeidofMember != GeodeTypeIdsImpl::InternalDistributedMember) {
+ throw Exception(
+ "Reading DSMember. Expecting type id 92 for "
+ "InternalDistributedMember. ");
+ }
+
+ auto memId = std::shared_ptr<ClientProxyMembershipID>(
+ new ClientProxyMembershipID());
+ memId->fromData(input);
+ return (std::shared_ptr<DSMemberForVersionStamp>)memId;
+ } else if (typeidLen == 2) {
+ uint16_t typeidofMember = input.readInt16();
+ if (typeidofMember != GeodeTypeIdsImpl::DiskStoreId) {
+ throw Exception(
+ "Reading DSMember. Expecting type id 2133 for DiskStoreId. ");
+ }
+ DiskStoreId* diskStore = new DiskStoreId();
+ diskStore->fromData(input);
+ return std::shared_ptr<DSMemberForVersionStamp>(diskStore);
} else {
throw Exception(
"Reading DSMember. Expecting type id length as either one or two "
@@ -2953,7 +2959,8 @@ DSMemberForVersionStampPtr TcrMessage::readDSMember(
}
}
void TcrMessage::readHashMapForGCVersions(
- apache::geode::client::DataInput& input, CacheableHashMapPtr& value) {
+ apache::geode::client::DataInput& input,
+ std::shared_ptr<CacheableHashMap>& value) {
uint8_t hashmaptypeid = input.read();
if (hashmaptypeid != GeodeTypeIds::CacheableHashMap) {
throw Exception(
@@ -2962,8 +2969,8 @@ void TcrMessage::readHashMapForGCVersions(
int32_t len = input.readArrayLen();
if (len > 0) {
- CacheableKeyPtr key;
- CacheablePtr val;
+ std::shared_ptr<CacheableKey> key;
+ std::shared_ptr<Cacheable> val;
for (int32_t index = 0; index < len; index++) {
key = readDSMember(input);
uint8_t versiontype = input.read();
@@ -2984,7 +2991,7 @@ void TcrMessage::readHashMapForGCVersions(
}
void TcrMessage::readHashSetForGCVersions(
- apache::geode::client::DataInput& input, CacheableHashSetPtr& value) {
+ apache::geode::client::DataInput& input, std::shared_ptr<CacheableHashSet>& value) {
uint8_t hashsettypeid = input.read();
if (hashsettypeid != GeodeTypeIds::CacheableHashSet) {
throw Exception(
@@ -2993,10 +3000,10 @@ void TcrMessage::readHashSetForGCVersions(
int32_t len = input.readArrayLen();
if (len > 0) {
- CacheableKeyPtr key;
- CacheablePtr val;
+ std::shared_ptr<CacheableKey> key;
+ std::shared_ptr<Cacheable> val;
for (int32_t index = 0; index < len; index++) {
- CacheableKeyPtr keyPtr = input.readObject<CacheableKey>();
+ auto keyPtr = input.readObject<CacheableKey>();
value->insert(keyPtr);
}
}
diff --git a/cppcache/src/TcrMessage.hpp b/cppcache/src/TcrMessage.hpp
index 2a8e01b..24526d0 100644
--- a/cppcache/src/TcrMessage.hpp
+++ b/cppcache/src/TcrMessage.hpp
@@ -34,7 +34,6 @@
#include <geode/DataOutput.hpp>
#include <geode/DataInput.hpp>
#include <geode/ExceptionTypes.hpp>
-#include <geode/VectorT.hpp>
#include <geode/CacheableBuiltins.hpp>
#include "InterestResultPolicy.hpp"
@@ -209,7 +208,7 @@ class CPPCACHE_EXPORT TcrMessage {
}
return false;
}
- static VersionTagPtr readVersionTagPart(
+ static std::shared_ptr<VersionTag> readVersionTagPart(
DataInput& input, uint16_t endpointMemId,
MemberListForVersionStamp& memberListForVersionStamp);
@@ -232,13 +231,13 @@ class CPPCACHE_EXPORT TcrMessage {
// = false, bool receiveValues = true, ThinClientBaseDM *connectionDM =
// nullptr);
- void InitializeGetallMsg(const SerializablePtr& aCallbackArgument);
+ void InitializeGetallMsg(const std::shared_ptr<Serializable>& aCallbackArgument);
// for multiuser cache close
// Updates the early ack byte of the message to reflect that it is a retry op
void updateHeaderForRetry();
- inline const VectorOfCacheableKey* getKeys() const { return m_keyList; }
+ inline const std::vector<std::shared_ptr<CacheableKey>> * getKeys() const { return m_keyList; }
inline const std::string& getRegex() const { return m_regex; }
@@ -312,12 +311,12 @@ class CPPCACHE_EXPORT TcrMessage {
// that was made if this is a
// reply
int32_t getMessageTypeRequest() const;
- CacheableKeyPtr getKey() const;
- const CacheableKeyPtr& getKeyRef() const;
- CacheablePtr getValue() const;
- const CacheablePtr& getValueRef() const;
- CacheablePtr getCallbackArgument() const;
- const CacheablePtr& getCallbackArgumentRef() const;
+ std::shared_ptr<CacheableKey> getKey() const;
+ const std::shared_ptr<CacheableKey>& getKeyRef() const;
+ std::shared_ptr<Cacheable> getValue() const;
+ const std::shared_ptr<Cacheable>& getValueRef() const;
+ std::shared_ptr<Cacheable> getCallbackArgument() const;
+ const std::shared_ptr<Cacheable>& getCallbackArgumentRef() const;
const std::map<std::string, int>* getCqs() const;
bool getBoolValue() const { return m_boolValue; };
@@ -331,7 +330,7 @@ class CPPCACHE_EXPORT TcrMessage {
const char* getMsgBody() const;
uint32_t getMsgLength() const;
uint32_t getMsgBodyLength() const;
- EventIdPtr getEventId() const;
+ std::shared_ptr<EventId> getEventId() const;
int32_t getTransId() const;
void setTransId(int32_t txId);
@@ -369,11 +368,11 @@ class CPPCACHE_EXPORT TcrMessage {
}
TcrChunkedResult* getChunkedResultHandler() { return m_chunkedResult; }
void setVersionedObjectPartList(
- VersionedCacheableObjectPartListPtr versionObjPartListptr) {
+ std::shared_ptr<VersionedCacheableObjectPartList> versionObjPartListptr) {
m_versionObjPartListptr = versionObjPartListptr;
}
- VersionedCacheableObjectPartListPtr getVersionedObjectPartList() {
+ std::shared_ptr<VersionedCacheableObjectPartList> getVersionedObjectPartList() {
return m_versionObjPartListptr;
}
@@ -382,11 +381,11 @@ class CPPCACHE_EXPORT TcrMessage {
// getDeltaBytes( ) is called *only* by CqService, returns a CacheableBytes
// that
// takes ownership of delta bytes.
- CacheableBytesPtr getDeltaBytes() {
+ std::shared_ptr<CacheableBytes> getDeltaBytes() {
if (m_deltaBytes == nullptr) {
return nullptr;
}
- CacheableBytesPtr retVal(
+ std::shared_ptr<CacheableBytes> retVal(
CacheableBytes::createNoCopy(m_deltaBytes, m_deltaBytesLen));
m_deltaBytes = nullptr;
return retVal;
@@ -417,19 +416,19 @@ class CPPCACHE_EXPORT TcrMessage {
int32_t getNumBuckets() const { return m_bucketCount; }
- CacheableStringPtr getColocatedWith() const { return m_colocatedWith; }
+ std::shared_ptr<CacheableString> getColocatedWith() const { return m_colocatedWith; }
- CacheableStringPtr getPartitionResolver() const {
+ std::shared_ptr<CacheableString> getPartitionResolver() const {
return m_partitionResolverName;
}
- std::vector<std::vector<BucketServerLocationPtr> >* getMetadata() {
+ std::vector<std::vector<std::shared_ptr<BucketServerLocation>> >* getMetadata() {
return m_metadata;
}
- std::vector<FixedPartitionAttributesImplPtr>* getFpaSet() { return m_fpaSet; }
+ std::vector<std::shared_ptr<FixedPartitionAttributesImpl>>* getFpaSet() { return m_fpaSet; }
- CacheableHashSetPtr getFailedNode() { return m_failedNode; }
+ std::shared_ptr<CacheableHashSet> getFailedNode() { return m_failedNode; }
bool isCallBackArguement() const { return m_isCallBackArguement; }
@@ -437,16 +436,16 @@ class CPPCACHE_EXPORT TcrMessage {
m_isCallBackArguement = aCallBackArguement;
}
- void setBucketServerLocation(BucketServerLocationPtr serverLocation) {
+ void setBucketServerLocation(std::shared_ptr<BucketServerLocation> serverLocation) {
m_bucketServerLocation = serverLocation;
}
- void setVersionTag(VersionTagPtr versionTag) { m_versionTag = versionTag; }
- VersionTagPtr getVersionTag() { return m_versionTag; }
+ void setVersionTag(std::shared_ptr<VersionTag> versionTag) { m_versionTag = versionTag; }
+ std::shared_ptr<VersionTag> getVersionTag() { return m_versionTag; }
uint8_t hasResult() const { return m_hasResult; }
- CacheableHashMapPtr getTombstoneVersions() const {
+ std::shared_ptr<CacheableHashMap> getTombstoneVersions() const {
return m_tombstoneVersions;
}
- CacheableHashSetPtr getTombstoneKeys() const { return m_tombstoneKeys; }
+ std::shared_ptr<CacheableHashSet> getTombstoneKeys() const { return m_tombstoneKeys; }
bool isFEAnotherHop();
@@ -514,24 +513,26 @@ class CPPCACHE_EXPORT TcrMessage {
void handleSpecialFECase();
bool m_feAnotherHop;
- void writeBytesOnly(const SerializablePtr& se);
- SerializablePtr readCacheableBytes(DataInput& input, int lenObj);
- SerializablePtr readCacheableString(DataInput& input, int lenObj);
+ void writeBytesOnly(const std::shared_ptr<Serializable>& se);
+ std::shared_ptr<Serializable> readCacheableBytes(DataInput& input,
+ int lenObj);
+ std::shared_ptr<Serializable> readCacheableString(DataInput& input,
+ int lenObj);
static std::atomic<int32_t> m_transactionId;
static uint8_t* m_keepalive;
const static int m_flag_empty;
const static int m_flag_concurrency_checks;
- CacheableBytesPtr m_connectionIDBytes;
+ std::shared_ptr<CacheableBytes> m_connectionIDBytes;
bool isSecurityOn;
uint8_t m_isLastChunkAndisSecurityHeader;
bool m_isSecurityHeaderAdded;
- PropertiesPtr m_creds;
+ std::shared_ptr<Properties> m_creds;
int32_t m_securityHeaderLength;
bool m_isMetaRegion;
- CacheableStringPtr exceptionMessage;
+ std::shared_ptr<CacheableString> exceptionMessage;
TcrMessage(const TcrMessage&) = delete;
TcrMessage& operator=(const TcrMessage&) = delete;
@@ -554,9 +555,10 @@ class CPPCACHE_EXPORT TcrMessage {
MemberListForVersionStamp& memberListForVersionStamp);
void readOldValue(DataInput& input);
void readPrMetaData(DataInput& input);
- void writeObjectPart(const SerializablePtr& se, bool isDelta = false,
- bool callToData = false,
- const VectorOfCacheableKey* getAllKeyList = nullptr);
+ void writeObjectPart(const std::shared_ptr<Serializable>& se,
+ bool isDelta = false, bool callToData = false,
+ const std::vector<std::shared_ptr<CacheableKey>>*
+ getAllKeyList = nullptr);
void writeHeader(uint32_t msgType, uint32_t numOfParts);
void writeRegionPart(const std::string& regionName);
void writeStringPart(const std::string& str);
@@ -579,10 +581,10 @@ class CPPCACHE_EXPORT TcrMessage {
void readStringPart(DataInput& input, uint32_t* len, char** str);
void readCqsPart(DataInput& input);
void readHashMapForGCVersions(apache::geode::client::DataInput& input,
- CacheableHashMapPtr& value);
+ std::shared_ptr<CacheableHashMap>& value);
void readHashSetForGCVersions(apache::geode::client::DataInput& input,
- CacheableHashSetPtr& value);
- DSMemberForVersionStampPtr readDSMember(
+ std::shared_ptr<CacheableHashSet>& value);
+ std::shared_ptr<DSMemberForVersionStamp> readDSMember(
apache::geode::client::DataInput& input);
std::unique_ptr<DataOutput> m_request;
int32_t m_msgType;
@@ -598,13 +600,13 @@ class CPPCACHE_EXPORT TcrMessage {
ThinClientBaseDM* m_tcdm;
TcrChunkedResult* m_chunkedResult;
- const VectorOfCacheableKey* m_keyList;
- CacheableKeyPtr m_key;
- CacheablePtr m_value;
- CacheableHashSetPtr m_failedNode;
- CacheablePtr m_callbackArgument;
- VersionTagPtr m_versionTag;
- EventIdPtr m_eventid;
+ const std::vector<std::shared_ptr<CacheableKey>>* m_keyList;
+ std::shared_ptr<CacheableKey> m_key;
+ std::shared_ptr<Cacheable> m_value;
+ std::shared_ptr<CacheableHashSet> m_failedNode;
+ std::shared_ptr<Cacheable> m_callbackArgument;
+ std::shared_ptr<VersionTag> m_versionTag;
+ std::shared_ptr<EventId> m_eventid;
std::string m_regionName;
const Region* m_region;
std::string m_regex;
@@ -617,12 +619,12 @@ class CPPCACHE_EXPORT TcrMessage {
bool m_shouldIgnore;
int8_t m_metaDataVersion;
int8_t m_serverGroupVersion;
- std::vector<BucketServerLocationPtr> m_bucketServerLocations;
- std::vector<std::vector<BucketServerLocationPtr> >* m_metadata;
+ std::vector<std::shared_ptr<BucketServerLocation>> m_bucketServerLocations;
+ std::vector<std::vector<std::shared_ptr<BucketServerLocation>>>* m_metadata;
int32_t m_bucketCount;
- CacheableStringPtr m_colocatedWith;
- CacheableStringPtr m_partitionResolverName;
- CacheableVectorPtr m_vectorPtr;
+ std::shared_ptr<CacheableString> m_colocatedWith;
+ std::shared_ptr<CacheableString> m_partitionResolverName;
+ std::shared_ptr<CacheableVector> m_vectorPtr;
uint32_t m_numCqPart;
uint32_t m_msgTypeForCq; // new part since 7.0 for cq event message type.
std::map<std::string, int>* m_cqs;
@@ -632,26 +634,26 @@ class CPPCACHE_EXPORT TcrMessage {
uint8_t* m_deltaBytes;
int32_t m_deltaBytesLen;
bool m_isCallBackArguement;
- BucketServerLocationPtr m_bucketServerLocation;
+ std::shared_ptr<BucketServerLocation> m_bucketServerLocation;
uint32_t m_entryNotFound;
- std::vector<FixedPartitionAttributesImplPtr>* m_fpaSet;
+ std::vector<std::shared_ptr<FixedPartitionAttributesImpl>>* m_fpaSet;
std::vector<int8_t>* m_functionAttributes;
uint8_t m_hasResult;
- CacheableHashMapPtr m_tombstoneVersions;
- CacheableHashSetPtr m_tombstoneKeys;
+ std::shared_ptr<CacheableHashMap> m_tombstoneVersions;
+ std::shared_ptr<CacheableHashSet> m_tombstoneKeys;
/*Added this member for PutALL versioning changes*/
- VersionedCacheableObjectPartListPtr m_versionObjPartListptr;
+ std::shared_ptr<VersionedCacheableObjectPartList> m_versionObjPartListptr;
friend class TcrMessageHelper;
};
class TcrMessageDestroyRegion : public TcrMessage {
public:
- TcrMessageDestroyRegion(std::unique_ptr<DataOutput> dataOutput,
- const Region* region,
- const SerializablePtr& aCallbackArgument,
- std::chrono::milliseconds messageResponsetimeout,
- ThinClientBaseDM* connectionDM);
+ TcrMessageDestroyRegion(
+ std::unique_ptr<DataOutput> dataOutput, const Region* region,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::chrono::milliseconds messageResponsetimeout,
+ ThinClientBaseDM* connectionDM);
virtual ~TcrMessageDestroyRegion() {}
@@ -662,7 +664,7 @@ class TcrMessageClearRegion : public TcrMessage {
public:
TcrMessageClearRegion(std::unique_ptr<DataOutput> dataOutput,
const Region* region,
- const SerializablePtr& aCallbackArgument,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
std::chrono::milliseconds messageResponsetimeout,
ThinClientBaseDM* connectionDM);
@@ -711,7 +713,8 @@ class TcrMessageQueryWithParameters : public TcrMessage {
public:
TcrMessageQueryWithParameters(
std::unique_ptr<DataOutput> dataOutput, const std::string& regionName,
- const SerializablePtr& aCallbackArgument, CacheableVectorPtr paramList,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<CacheableVector> paramList,
std::chrono::milliseconds messageResponsetimeout,
ThinClientBaseDM* connectionDM);
@@ -723,8 +726,9 @@ class TcrMessageQueryWithParameters : public TcrMessage {
class TcrMessageContainsKey : public TcrMessage {
public:
TcrMessageContainsKey(std::unique_ptr<DataOutput> dataOutput,
- const Region* region, const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument,
+ const Region* region,
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
bool isContainsKey, ThinClientBaseDM* connectionDM);
virtual ~TcrMessageContainsKey() {}
@@ -745,8 +749,9 @@ class TcrMessageGetDurableCqs : public TcrMessage {
class TcrMessageRequest : public TcrMessage {
public:
TcrMessageRequest(std::unique_ptr<DataOutput> dataOutput,
- const Region* region, const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument,
+ const Region* region,
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
ThinClientBaseDM* connectionDM = nullptr);
virtual ~TcrMessageRequest() {}
@@ -757,8 +762,9 @@ class TcrMessageRequest : public TcrMessage {
class TcrMessageInvalidate : public TcrMessage {
public:
TcrMessageInvalidate(std::unique_ptr<DataOutput> dataOutput,
- const Region* region, const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument,
+ const Region* region,
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
ThinClientBaseDM* connectionDM = nullptr);
private:
@@ -767,9 +773,10 @@ class TcrMessageInvalidate : public TcrMessage {
class TcrMessageDestroy : public TcrMessage {
public:
TcrMessageDestroy(std::unique_ptr<DataOutput> dataOutput,
- const Region* region, const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument,
+ const Region* region,
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
ThinClientBaseDM* connectionDM = nullptr);
private:
@@ -779,8 +786,9 @@ class TcrMessageRegisterInterestList : public TcrMessage {
public:
TcrMessageRegisterInterestList(
std::unique_ptr<DataOutput> dataOutput, const Region* region,
- const VectorOfCacheableKey& keys, bool isDurable = false,
- bool isCachingEnabled = false, bool receiveValues = true,
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ bool isDurable = false, bool isCachingEnabled = false,
+ bool receiveValues = true,
InterestResultPolicy interestPolicy = InterestResultPolicy::NONE,
ThinClientBaseDM* connectionDM = nullptr);
@@ -793,8 +801,9 @@ class TcrMessageUnregisterInterestList : public TcrMessage {
public:
TcrMessageUnregisterInterestList(
std::unique_ptr<DataOutput> dataOutput, const Region* region,
- const VectorOfCacheableKey& keys, bool isDurable = false,
- bool isCachingEnabled = false, bool receiveValues = true,
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ bool isDurable = false, bool isCachingEnabled = false,
+ bool receiveValues = true,
InterestResultPolicy interestPolicy = InterestResultPolicy::NONE,
ThinClientBaseDM* connectionDM = nullptr);
@@ -806,9 +815,10 @@ class TcrMessageUnregisterInterestList : public TcrMessage {
class TcrMessagePut : public TcrMessage {
public:
TcrMessagePut(std::unique_ptr<DataOutput> dataOutput, const Region* region,
- const CacheableKeyPtr& key, const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument, bool isDelta = false,
- ThinClientBaseDM* connectionDM = nullptr,
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ bool isDelta = false, ThinClientBaseDM* connectionDM = nullptr,
bool isMetaRegion = false, bool fullValueAfterDeltaFail = false,
const char* regionName = nullptr);
@@ -921,7 +931,7 @@ class TcrMessagePutAll : public TcrMessage {
const HashMapOfCacheable& map,
std::chrono::milliseconds messageResponsetimeout,
ThinClientBaseDM* connectionDM,
- const SerializablePtr& aCallbackArgument);
+ const std::shared_ptr<Serializable>& aCallbackArgument);
virtual ~TcrMessagePutAll() {}
@@ -931,8 +941,9 @@ class TcrMessagePutAll : public TcrMessage {
class TcrMessageRemoveAll : public TcrMessage {
public:
TcrMessageRemoveAll(std::unique_ptr<DataOutput> dataOutput,
- const Region* region, const VectorOfCacheableKey& keys,
- const SerializablePtr& aCallbackArgument,
+ const Region* region,
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
ThinClientBaseDM* connectionDM = nullptr);
virtual ~TcrMessageRemoveAll() {}
@@ -968,9 +979,10 @@ class TcrMessageExecuteRegionFunction : public TcrMessage {
public:
TcrMessageExecuteRegionFunction(
std::unique_ptr<DataOutput> dataOutput, const std::string& funcName,
- const Region* region, const CacheablePtr& args,
- CacheableVectorPtr routingObj, uint8_t getResult,
- CacheableHashSetPtr failedNodes, std::chrono::milliseconds timeout,
+ const Region* region, const std::shared_ptr<Cacheable>& args,
+ std::shared_ptr<CacheableVector> routingObj, uint8_t getResult,
+ std::shared_ptr<CacheableHashSet> failedNodes,
+ std::chrono::milliseconds timeout,
ThinClientBaseDM* connectionDM = nullptr, int8_t reExecute = 0);
virtual ~TcrMessageExecuteRegionFunction() {}
@@ -982,9 +994,9 @@ class TcrMessageExecuteRegionFunctionSingleHop : public TcrMessage {
public:
TcrMessageExecuteRegionFunctionSingleHop(
std::unique_ptr<DataOutput> dataOutput, const std::string& funcName,
- const Region* region, const CacheablePtr& args,
- CacheableHashSetPtr routingObj, uint8_t getResult,
- CacheableHashSetPtr failedNodes, bool allBuckets,
+ const Region* region, const std::shared_ptr<Cacheable>& args,
+ std::shared_ptr<CacheableHashSet> routingObj, uint8_t getResult,
+ std::shared_ptr<CacheableHashSet> failedNodes, bool allBuckets,
std::chrono::milliseconds timeout, ThinClientBaseDM* connectionDM);
virtual ~TcrMessageExecuteRegionFunctionSingleHop() {}
@@ -1025,7 +1037,7 @@ class TcrMessageSize : public TcrMessage {
class TcrMessageUserCredential : public TcrMessage {
public:
TcrMessageUserCredential(std::unique_ptr<DataOutput> dataOutput,
- PropertiesPtr creds,
+ std::shared_ptr<Properties> creds,
ThinClientBaseDM* connectionDM = nullptr);
virtual ~TcrMessageUserCredential() {}
@@ -1046,7 +1058,7 @@ class TcrMessageRemoveUserAuth : public TcrMessage {
class TcrMessageGetPdxIdForType : public TcrMessage {
public:
TcrMessageGetPdxIdForType(std::unique_ptr<DataOutput> dataOutput,
- const CacheablePtr& pdxType,
+ const std::shared_ptr<Cacheable>& pdxType,
ThinClientBaseDM* connectionDM,
int32_t pdxTypeId = 0);
@@ -1058,7 +1070,7 @@ class TcrMessageGetPdxIdForType : public TcrMessage {
class TcrMessageAddPdxType : public TcrMessage {
public:
TcrMessageAddPdxType(std::unique_ptr<DataOutput> dataOutput,
- const CacheablePtr& pdxType,
+ const std::shared_ptr<Cacheable>& pdxType,
ThinClientBaseDM* connectionDM, int32_t pdxTypeId = 0);
virtual ~TcrMessageAddPdxType() {}
@@ -1069,7 +1081,7 @@ class TcrMessageAddPdxType : public TcrMessage {
class TcrMessageGetPdxIdForEnum : public TcrMessage {
public:
TcrMessageGetPdxIdForEnum(std::unique_ptr<DataOutput> dataOutput,
- const CacheablePtr& pdxType,
+ const std::shared_ptr<Cacheable>& pdxType,
ThinClientBaseDM* connectionDM,
int32_t pdxTypeId = 0);
@@ -1081,7 +1093,7 @@ class TcrMessageGetPdxIdForEnum : public TcrMessage {
class TcrMessageAddPdxEnum : public TcrMessage {
public:
TcrMessageAddPdxEnum(std::unique_ptr<DataOutput> dataOutput,
- const CacheablePtr& pdxType,
+ const std::shared_ptr<Cacheable>& pdxType,
ThinClientBaseDM* connectionDM, int32_t pdxTypeId = 0);
virtual ~TcrMessageAddPdxEnum() {}
@@ -1134,7 +1146,7 @@ class TcrMessageKeySet : public TcrMessage {
class TcrMessageRequestEventValue : public TcrMessage {
public:
TcrMessageRequestEventValue(std::unique_ptr<DataOutput> dataOutput,
- EventIdPtr eventId);
+ std::shared_ptr<EventId> eventId);
virtual ~TcrMessageRequestEventValue() {}
@@ -1163,10 +1175,11 @@ class TcrMessageUpdateClientNotification : public TcrMessage {
class TcrMessageGetAll : public TcrMessage {
public:
- TcrMessageGetAll(std::unique_ptr<DataOutput> dataOutput, const Region* region,
- const VectorOfCacheableKey* keys,
- ThinClientBaseDM* connectionDM = nullptr,
- const SerializablePtr& aCallbackArgument = nullptr);
+ TcrMessageGetAll(
+ std::unique_ptr<DataOutput> dataOutput, const Region* region,
+ const std::vector<std::shared_ptr<CacheableKey>>* keys,
+ ThinClientBaseDM* connectionDM = nullptr,
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr);
virtual ~TcrMessageGetAll() {}
@@ -1177,8 +1190,8 @@ class TcrMessageExecuteFunction : public TcrMessage {
public:
TcrMessageExecuteFunction(std::unique_ptr<DataOutput> dataOutput,
const std::string& funcName,
- const CacheablePtr& args, uint8_t getResult,
- ThinClientBaseDM* connectionDM,
+ const std::shared_ptr<Cacheable>& args,
+ uint8_t getResult, ThinClientBaseDM* connectionDM,
std::chrono::milliseconds timeout);
virtual ~TcrMessageExecuteFunction() {}
diff --git a/cppcache/src/TcrPoolEndPoint.cpp b/cppcache/src/TcrPoolEndPoint.cpp
index 9021fcd..e4a33aa 100644
--- a/cppcache/src/TcrPoolEndPoint.cpp
+++ b/cppcache/src/TcrPoolEndPoint.cpp
@@ -26,12 +26,12 @@ TcrPoolEndPoint::TcrPoolEndPoint(const std::string& name, CacheImpl* cache,
ThinClientPoolDM* dm)
: TcrEndpoint(name, cache, failoverSema, cleanupSema, redundancySema, dm),
m_dm(dm) {}
-bool TcrPoolEndPoint::checkDupAndAdd(EventIdPtr eventid) {
+bool TcrPoolEndPoint::checkDupAndAdd(std::shared_ptr<EventId> eventid) {
return m_dm->checkDupAndAdd(eventid);
}
void TcrPoolEndPoint::processMarker() { m_dm->processMarker(); }
-QueryServicePtr TcrPoolEndPoint::getQueryService() {
+std::shared_ptr<QueryService> TcrPoolEndPoint::getQueryService() {
return m_dm->getQueryServiceWithoutCheck();
}
void TcrPoolEndPoint::sendRequestForChunkedResponse(const TcrMessage& request,
diff --git a/cppcache/src/TcrPoolEndPoint.hpp b/cppcache/src/TcrPoolEndPoint.hpp
index cffb4e6..ae79941 100644
--- a/cppcache/src/TcrPoolEndPoint.hpp
+++ b/cppcache/src/TcrPoolEndPoint.hpp
@@ -32,9 +32,9 @@ class TcrPoolEndPoint : public TcrEndpoint {
ACE_Semaphore& redundancySema, ThinClientPoolDM* dm);
virtual ThinClientPoolDM* getPoolHADM();
- virtual bool checkDupAndAdd(EventIdPtr eventid);
+ virtual bool checkDupAndAdd(std::shared_ptr<EventId> eventid);
virtual void processMarker();
- virtual QueryServicePtr getQueryService();
+ virtual std::shared_ptr<QueryService> getQueryService();
virtual void sendRequestForChunkedResponse(const TcrMessage& request,
TcrMessageReply& reply,
TcrConnection* conn);
diff --git a/cppcache/src/ThinClientBaseDM.cpp b/cppcache/src/ThinClientBaseDM.cpp
index 9c37f20..760dc84 100644
--- a/cppcache/src/ThinClientBaseDM.cpp
+++ b/cppcache/src/ThinClientBaseDM.cpp
@@ -280,9 +280,8 @@ void ThinClientBaseDM::beforeSendingRequest(const TcrMessage& request,
connId = conn->getConnectionId();
uniqueId = conn->getEndpointObject()->getUniqueId();
} else {
- UserAttributesPtr userAttribute =
- TSSUserAttributesWrapper::s_geodeTSSUserAttributes
- ->getUserAttributes();
+ auto userAttribute = TSSUserAttributesWrapper::s_geodeTSSUserAttributes
+ ->getUserAttributes();
connId = conn->getConnectionId();
if (!(request.getMessageType() == TcrMessage::USER_CREDENTIAL_MESSAGE)) {
uniqueId =
@@ -312,7 +311,7 @@ void ThinClientBaseDM::afterSendingRequest(const TcrMessage& request,
if (request.getMessageType() == TcrMessage::USER_CREDENTIAL_MESSAGE) {
if (TcrMessage::RESPONSE == reply.getMessageType()) {
if (this->isMultiUserMode()) {
- UserAttributesPtr userAttribute =
+ auto userAttribute =
TSSUserAttributesWrapper::s_geodeTSSUserAttributes
->getUserAttributes();
userAttribute->setConnectionAttributes(conn->getEndpointObject(),
diff --git a/cppcache/src/ThinClientBaseDM.hpp b/cppcache/src/ThinClientBaseDM.hpp
index b3d3f74..887a99e 100644
--- a/cppcache/src/ThinClientBaseDM.hpp
+++ b/cppcache/src/ThinClientBaseDM.hpp
@@ -109,7 +109,7 @@ class ThinClientBaseDM {
virtual TcrEndpoint* getActiveEndpoint() { return nullptr; }
- virtual bool checkDupAndAdd(EventIdPtr eventid) {
+ virtual bool checkDupAndAdd(std::shared_ptr<EventId> eventid) {
return m_connManager.checkDupAndAdd(eventid);
}
diff --git a/cppcache/src/ThinClientCacheDistributionManager.hpp b/cppcache/src/ThinClientCacheDistributionManager.hpp
index 20a5fb8..0c6e804 100644
--- a/cppcache/src/ThinClientCacheDistributionManager.hpp
+++ b/cppcache/src/ThinClientCacheDistributionManager.hpp
@@ -59,8 +59,6 @@ class CPPCACHE_EXPORT ThinClientCacheDistributionManager
const ThinClientCacheDistributionManager&);
};
-typedef std::shared_ptr<ThinClientCacheDistributionManager>
- ThinClientCacheDistributionManagerPtr;
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/ThinClientDistributionManager.cpp b/cppcache/src/ThinClientDistributionManager.cpp
index 7edd6f8..1b915e8 100644
--- a/cppcache/src/ThinClientDistributionManager.cpp
+++ b/cppcache/src/ThinClientDistributionManager.cpp
@@ -308,8 +308,8 @@ bool ThinClientDistributionManager::preFailoverAction() { return true; }
bool ThinClientDistributionManager::postFailoverAction(TcrEndpoint* endpoint) {
return true;
}
-
-PropertiesPtr ThinClientDistributionManager::getCredentials(TcrEndpoint* ep) {
+std::shared_ptr<Properties> ThinClientDistributionManager::getCredentials(
+ TcrEndpoint* ep) {
auto cacheImpl = m_connManager.getCacheImpl();
const auto& distributedSystem = cacheImpl->getDistributedSystem();
const auto& tmpSecurityProperties =
@@ -331,7 +331,7 @@ PropertiesPtr ThinClientDistributionManager::getCredentials(TcrEndpoint* ep) {
}
GfErrType ThinClientDistributionManager::sendUserCredentials(
- PropertiesPtr credentials, TcrEndpoint* ep) {
+ std::shared_ptr<Properties> credentials, TcrEndpoint* ep) {
LOGDEBUG("ThinClientPoolDM::sendUserCredentials");
GfErrType err = GF_NOERR;
diff --git a/cppcache/src/ThinClientDistributionManager.hpp b/cppcache/src/ThinClientDistributionManager.hpp
index f8a2ca4..3251111 100644
--- a/cppcache/src/ThinClientDistributionManager.hpp
+++ b/cppcache/src/ThinClientDistributionManager.hpp
@@ -66,9 +66,10 @@ class ThinClientDistributionManager : public ThinClientBaseDM {
virtual void destroyAction();
- PropertiesPtr getCredentials(TcrEndpoint* ep);
+ std::shared_ptr<Properties> getCredentials(TcrEndpoint* ep);
- GfErrType sendUserCredentials(PropertiesPtr credentials, TcrEndpoint* ep);
+ GfErrType sendUserCredentials(std::shared_ptr<Properties> credentials,
+ TcrEndpoint* ep);
volatile int m_activeEndpoint;
diff --git a/cppcache/src/ThinClientHARegion.cpp b/cppcache/src/ThinClientHARegion.cpp
index 5fd63fb..053ba1d 100644
--- a/cppcache/src/ThinClientHARegion.cpp
+++ b/cppcache/src/ThinClientHARegion.cpp
@@ -26,12 +26,12 @@ namespace apache {
namespace geode {
namespace client {
-ThinClientHARegion::ThinClientHARegion(const std::string& name,
- CacheImpl* cache,
- const RegionInternalPtr& rPtr,
- const RegionAttributesPtr& attributes,
- const CacheStatisticsPtr& stats,
- bool shared, bool enableNotification)
+ThinClientHARegion::ThinClientHARegion(
+ const std::string& name, CacheImpl* cache,
+ const std::shared_ptr<RegionInternal>& rPtr,
+ const std::shared_ptr<RegionAttributes>& attributes,
+ const std::shared_ptr<CacheStatistics>& stats, bool shared,
+ bool enableNotification)
: ThinClientRegion(name, cache, rPtr, attributes, stats, shared),
m_attribute(attributes),
m_processedMarker(false),
@@ -165,9 +165,9 @@ void ThinClientHARegion::addDisMessToQueue() {
}
}
-GfErrType ThinClientHARegion::getNoThrow_FullObject(EventIdPtr eventId,
- CacheablePtr& fullObject,
- VersionTagPtr& versionTag) {
+GfErrType ThinClientHARegion::getNoThrow_FullObject(
+ std::shared_ptr<EventId> eventId, std::shared_ptr<Cacheable>& fullObject,
+ std::shared_ptr<VersionTag>& versionTag) {
TcrMessageRequestEventValue fullObjectMsg(m_cache->createDataOutput(),
eventId);
TcrMessageReply reply(true, nullptr);
diff --git a/cppcache/src/ThinClientHARegion.hpp b/cppcache/src/ThinClientHARegion.hpp
index dd5a01c..0d62e4f 100644
--- a/cppcache/src/ThinClientHARegion.hpp
+++ b/cppcache/src/ThinClientHARegion.hpp
@@ -47,10 +47,10 @@ class CPPCACHE_EXPORT ThinClientHARegion : public ThinClientRegion {
* @brief constructor/destructor
*/
ThinClientHARegion(const std::string& name, CacheImpl* cache,
- const RegionInternalPtr& rPtr,
- const RegionAttributesPtr& attributes,
- const CacheStatisticsPtr& stats, bool shared = false,
- bool enableNotification = true);
+ const std::shared_ptr<RegionInternal>& rPtr,
+ const std::shared_ptr<RegionAttributes>& attributes,
+ const std::shared_ptr<CacheStatistics>& stats,
+ bool shared = false, bool enableNotification = true);
virtual ~ThinClientHARegion() {
if (m_poolDM) m_tcrdm = nullptr;
@@ -64,12 +64,12 @@ class CPPCACHE_EXPORT ThinClientHARegion : public ThinClientRegion {
void addDisMessToQueue();
protected:
- virtual GfErrType getNoThrow_FullObject(EventIdPtr eventId,
- CacheablePtr& fullObject,
- VersionTagPtr& versionTag);
+ virtual GfErrType getNoThrow_FullObject(
+ std::shared_ptr<EventId> eventId, std::shared_ptr<Cacheable>& fullObject,
+ std::shared_ptr<VersionTag>& versionTag);
private:
- RegionAttributesPtr m_attribute;
+ std::shared_ptr<RegionAttributes> m_attribute;
volatile bool m_processedMarker;
void handleMarker();
diff --git a/cppcache/src/ThinClientLocatorHelper.cpp b/cppcache/src/ThinClientLocatorHelper.cpp
index 2147b8f..3012b05 100644
--- a/cppcache/src/ThinClientLocatorHelper.cpp
+++ b/cppcache/src/ThinClientLocatorHelper.cpp
@@ -124,7 +124,7 @@ GfErrType ThinClientLocatorHelper::getAllServers(
auto di = m_poolDM->getConnectionManager().getCacheImpl()->getCache()->createDataInput(
reinterpret_cast<uint8_t*>(buff), receivedLength);
- GetAllServersResponsePtr response(nullptr);
+ std::shared_ptr<GetAllServersResponse> response(nullptr);
/* adongre
* SSL Enabled on Location and not in the client
@@ -215,7 +215,7 @@ GfErrType ThinClientLocatorHelper::getEndpointForNewCallBackConn(
}
auto di = m_poolDM->getConnectionManager().getCacheImpl()->getCache()->createDataInput(
reinterpret_cast<uint8_t*>(buff), receivedLength);
- QueueConnectionResponsePtr response(nullptr);
+ std::shared_ptr<QueueConnectionResponse> response(nullptr);
/* adongre
* ssl defect
@@ -317,7 +317,7 @@ GfErrType ThinClientLocatorHelper::getEndpointForNewFwdConn(
}
auto di = m_poolDM->getConnectionManager().getCacheImpl()->getCache()->createDataInput(
reinterpret_cast<uint8_t*>(buff), receivedLength);
- ClientConnectionResponsePtr response;
+ std::shared_ptr<ClientConnectionResponse> response;
/* adongre
* SSL is enabled on locator and not in the client
@@ -421,7 +421,7 @@ GfErrType ThinClientLocatorHelper::updateLocators(
di->rewindCursor(1);
response = di->readObject<LocatorListResponse>();
- std::vector<ServerLocation> locators = response->getLocators();
+ auto locators = response->getLocators();
if (locators.size() > 0) {
RandGen randGen;
std::random_shuffle(locators.begin(), locators.end(), randGen);
diff --git a/cppcache/src/ThinClientPoolDM.cpp b/cppcache/src/ThinClientPoolDM.cpp
index 1045bf9..94dccbb 100644
--- a/cppcache/src/ThinClientPoolDM.cpp
+++ b/cppcache/src/ThinClientPoolDM.cpp
@@ -49,28 +49,29 @@ class GetAllWork : public PooledWork<GfErrType>,
private NonCopyable,
private NonAssignable {
ThinClientPoolDM* m_poolDM;
- BucketServerLocationPtr m_serverLocation;
+ std::shared_ptr<BucketServerLocation> m_serverLocation;
TcrMessage* m_request;
TcrMessageReply* m_reply;
MapOfUpdateCounters m_mapOfUpdateCounters;
bool m_attemptFailover;
bool m_isBGThread;
bool m_addToLocalCache;
- UserAttributesPtr m_userAttribute;
+ std::shared_ptr<UserAttributes> m_userAttribute;
ChunkedGetAllResponse* m_responseHandler;
std::string m_regionName;
- const VectorOfCacheableKeyPtr m_keys;
- const RegionPtr m_region;
+ const std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>> m_keys;
+ const std::shared_ptr<Region> m_region;
TcrChunkedResult* m_resultCollector;
- const SerializablePtr& m_aCallbackArgument;
+ const std::shared_ptr<Serializable>& m_aCallbackArgument;
public:
- GetAllWork(ThinClientPoolDM* poolDM, const RegionPtr& region,
- const BucketServerLocationPtr& serverLocation,
- const VectorOfCacheableKeyPtr& keys, bool attemptFailover,
- bool isBGThread, bool addToLocalCache,
- ChunkedGetAllResponse* responseHandler,
- const SerializablePtr& aCallbackArgument)
+ GetAllWork(
+ ThinClientPoolDM* poolDM, const std::shared_ptr<Region>& region,
+ const std::shared_ptr<BucketServerLocation>& serverLocation,
+ const std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>>& keys,
+ bool attemptFailover, bool isBGThread, bool addToLocalCache,
+ ChunkedGetAllResponse* responseHandler,
+ const std::shared_ptr<Serializable>& aCallbackArgument)
: m_poolDM(poolDM),
m_serverLocation(serverLocation),
m_attemptFailover(attemptFailover),
@@ -128,7 +129,7 @@ const char* ThinClientPoolDM::NC_MC_Thread = "NC MC Thread";
#define PRIMARY_QUEUE_NOT_AVAILABLE -2
ThinClientPoolDM::ThinClientPoolDM(const char* name,
- PoolAttributesPtr poolAttrs,
+ std::shared_ptr<PoolAttributes> poolAttrs,
TcrConnectionManager& connManager)
: ThinClientBaseDM(connManager, nullptr),
Pool(poolAttrs),
@@ -240,8 +241,7 @@ void ThinClientPoolDM::init() {
LOGDEBUG("ThinClientPoolDM::init: Completed initialization");
}
-
-PropertiesPtr ThinClientPoolDM::getCredentials(TcrEndpoint* ep) {
+std::shared_ptr<Properties> ThinClientPoolDM::getCredentials(TcrEndpoint* ep) {
auto cacheImpl = m_connManager.getCacheImpl();
const auto& distributedSystem = cacheImpl->getDistributedSystem();
const auto& tmpSecurityProperties =
@@ -614,15 +614,15 @@ void ThinClientPoolDM::addConnection(TcrConnection* conn) {
}
GfErrType ThinClientPoolDM::sendRequestToAllServers(
const char* func, uint8_t getResult, std::chrono::milliseconds timeout,
- CacheablePtr args, ResultCollectorPtr& rs,
- CacheableStringPtr& exceptionPtr) {
+ std::shared_ptr<Cacheable> args, std::shared_ptr<ResultCollector>& rs,
+ std::shared_ptr<CacheableString>& exceptionPtr) {
GfErrType err = GF_NOERR;
getStats().setCurClientOps(++m_clientOps);
auto resultCollectorLock = std::make_shared<ACE_Recursive_Thread_Mutex>();
- CacheableStringArrayPtr csArray = getServers();
+ auto csArray = getServers();
if (csArray != nullptr && csArray->length() == 0) {
LOGWARN("No server found to execute the function");
@@ -632,10 +632,10 @@ GfErrType ThinClientPoolDM::sendRequestToAllServers(
int feIndex = 0;
FunctionExecution* fePtrList = new FunctionExecution[csArray->length()];
auto* threadPool = m_connManager.getCacheImpl()->getThreadPool();
- UserAttributesPtr userAttr =
+ auto userAttr =
TSSUserAttributesWrapper::s_geodeTSSUserAttributes->getUserAttributes();
for (int i = 0; i < csArray->length(); i++) {
- CacheableStringPtr cs = (*csArray)[i];
+ auto cs = (*csArray)[i];
std::string endpointStr(cs->asChar());
TcrEndpoint* ep = nullptr;
if (m_endpoints.find(endpointStr, ep)) {
@@ -697,9 +697,11 @@ GfErrType ThinClientPoolDM::sendRequestToAllServers(
return finalErrorReturn;
}
-const CacheableStringArrayPtr ThinClientPoolDM::getLocators() const {
+const std::shared_ptr<CacheableStringArray> ThinClientPoolDM::getLocators()
+ const {
int32_t size = static_cast<int32_t>(m_attrs->m_initLocList.size());
- CacheableStringPtr* ptrArr = new CacheableStringPtr[size];
+ std::shared_ptr<CacheableString>* ptrArr =
+ new std::shared_ptr<CacheableString>[size];
for (int i = 0; i < size; ++i) {
ptrArr[i] = CacheableString::create(
@@ -709,12 +711,12 @@ const CacheableStringArrayPtr ThinClientPoolDM::getLocators() const {
return CacheableStringArray::createNoCopy(ptrArr, size);
}
-const CacheableStringArrayPtr ThinClientPoolDM::getServers() {
+const std::shared_ptr<CacheableStringArray> ThinClientPoolDM::getServers() {
int32_t size = static_cast<int32_t>(m_attrs->m_initServList.size());
- CacheableStringPtr* ptrArr = nullptr;
+ std::shared_ptr<CacheableString>* ptrArr = nullptr;
if (size > 0) {
- ptrArr = new CacheableStringPtr[size];
+ ptrArr = new std::shared_ptr<CacheableString>[size];
for (int32_t i = 0; i < size; ++i) {
ptrArr[i] = CacheableString::create(
m_attrs->m_initServList[i].c_str(),
@@ -732,7 +734,7 @@ const CacheableStringArrayPtr ThinClientPoolDM::getServers() {
((ThinClientLocatorHelper*)m_locHelper)
->getAllServers(vec, m_attrs->m_serverGrp);
- ptrArr = new CacheableStringPtr[vec.size()];
+ ptrArr = new std::shared_ptr<CacheableString>[vec.size()];
std::vector<ServerLocation>::iterator it;
size = static_cast<int32_t>(vec.size());
@@ -869,8 +871,7 @@ bool ThinClientPoolDM::isDestroyed() const {
// TODO: dummy implementation
return m_isDestroyed;
}
-
-QueryServicePtr ThinClientPoolDM::getQueryService() {
+std::shared_ptr<QueryService> ThinClientPoolDM::getQueryService() {
// TODO:
if (m_isMultiUserMode) {
LOGERROR(
@@ -883,10 +884,9 @@ QueryServicePtr ThinClientPoolDM::getQueryService() {
return getQueryServiceWithoutCheck();
}
-
-QueryServicePtr ThinClientPoolDM::getQueryServiceWithoutCheck() {
- if (!(m_remoteQueryServicePtr == nullptr)) {
- return m_remoteQueryServicePtr;
+ std::shared_ptr<QueryService> ThinClientPoolDM::getQueryServiceWithoutCheck() {
+ if (!(m_remoteQueryServicePtr == nullptr)) {
+ return m_remoteQueryServicePtr;
}
auto& props = m_connManager.getCacheImpl()
->getDistributedSystem()
@@ -906,33 +906,33 @@ QueryServicePtr ThinClientPoolDM::getQueryServiceWithoutCheck() {
}
void ThinClientPoolDM::sendUserCacheCloseMessage(bool keepAlive) {
LOGDEBUG("ThinClientPoolDM::sendUserCacheCloseMessage");
- UserAttributesPtr userAttribute =
+ auto userAttribute =
TSSUserAttributesWrapper::s_geodeTSSUserAttributes->getUserAttributes();
- std::map<std::string, UserConnectionAttributes*>& uca =
- userAttribute->getUserConnectionServers();
+ std::map<std::string, UserConnectionAttributes*>& uca =
+ userAttribute->getUserConnectionServers();
- std::map<std::string, UserConnectionAttributes*>::iterator it;
+ std::map<std::string, UserConnectionAttributes*>::iterator it;
- for (it = uca.begin(); it != uca.end(); it++) {
- UserConnectionAttributes* uca = (*it).second;
- if (uca->isAuthenticated() && uca->getEndpoint()->connected()) {
- TcrMessageRemoveUserAuth request(
- m_connManager.getCacheImpl()->getCache()->createDataOutput(),
- keepAlive, this);
- TcrMessageReply reply(true, this);
+ for (it = uca.begin(); it != uca.end(); it++) {
+ UserConnectionAttributes* uca = (*it).second;
+ if (uca->isAuthenticated() && uca->getEndpoint()->connected()) {
+ TcrMessageRemoveUserAuth request(
+ m_connManager.getCacheImpl()->getCache()->createDataOutput(),
+ keepAlive, this);
+ TcrMessageReply reply(true, this);
- sendRequestToEP(request, reply, uca->getEndpoint());
+ sendRequestToEP(request, reply, uca->getEndpoint());
- uca->setUnAuthenticated();
- } else {
- uca->setUnAuthenticated();
- }
- }
+ uca->setUnAuthenticated();
+ } else {
+ uca->setUnAuthenticated();
+ }
+ }
}
TcrConnection* ThinClientPoolDM::getConnectionInMultiuserMode(
- UserAttributesPtr userAttribute) {
+ std::shared_ptr<UserAttributes> userAttribute) {
LOGDEBUG("ThinClientPoolDM::getConnectionInMultiuserMode:");
UserConnectionAttributes* uca = userAttribute->getConnectionAttribute();
if (uca != nullptr) {
@@ -946,7 +946,7 @@ TcrConnection* ThinClientPoolDM::getConnectionInMultiuserMode(
}
}
-int32_t ThinClientPoolDM::GetPDXIdForType(SerializablePtr pdxType) {
+int32_t ThinClientPoolDM::GetPDXIdForType(std::shared_ptr<Serializable> pdxType) {
LOGDEBUG("ThinClientPoolDM::GetPDXIdForType:");
GfErrType err = GF_NOERR;
@@ -986,7 +986,7 @@ int32_t ThinClientPoolDM::GetPDXIdForType(SerializablePtr pdxType) {
return pdxTypeId;
}
-void ThinClientPoolDM::AddPdxType(SerializablePtr pdxType, int32_t pdxTypeId) {
+void ThinClientPoolDM::AddPdxType(std::shared_ptr<Serializable> pdxType, int32_t pdxTypeId) {
LOGDEBUG("ThinClientPoolDM::GetPDXIdForType:");
GfErrType err = GF_NOERR;
@@ -1007,8 +1007,7 @@ void ThinClientPoolDM::AddPdxType(SerializablePtr pdxType, int32_t pdxTypeId) {
throw IllegalStateException("Failed to register PdxSerializable Type");
}
}
-
-SerializablePtr ThinClientPoolDM::GetPDXTypeById(int32_t typeId) {
+ std::shared_ptr<Serializable> ThinClientPoolDM::GetPDXTypeById(int32_t typeId) {
LOGDEBUG("ThinClientPoolDM::GetPDXTypeById:");
GfErrType err = GF_NOERR;
@@ -1032,7 +1031,7 @@ SerializablePtr ThinClientPoolDM::GetPDXTypeById(int32_t typeId) {
return reply.getValue();
}
-int32_t ThinClientPoolDM::GetEnumValue(SerializablePtr enumInfo) {
+int32_t ThinClientPoolDM::GetEnumValue(std::shared_ptr<Serializable> enumInfo) {
LOGDEBUG("ThinClientPoolDM::GetEnumValue:");
GfErrType err = GF_NOERR;
@@ -1072,8 +1071,7 @@ int32_t ThinClientPoolDM::GetEnumValue(SerializablePtr enumInfo) {
return enumVal;
}
-
-SerializablePtr ThinClientPoolDM::GetEnum(int32_t val) {
+ std::shared_ptr<Serializable> ThinClientPoolDM::GetEnum(int32_t val) {
LOGDEBUG("ThinClientPoolDM::GetEnum:");
GfErrType err = GF_NOERR;
@@ -1096,7 +1094,7 @@ SerializablePtr ThinClientPoolDM::GetEnum(int32_t val) {
return reply.getValue();
}
-void ThinClientPoolDM::AddEnum(SerializablePtr enumInfo, int enumVal) {
+void ThinClientPoolDM::AddEnum(std::shared_ptr<Serializable> enumInfo, int enumVal) {
LOGDEBUG("ThinClientPoolDM::AddEnum:");
GfErrType err = GF_NOERR;
@@ -1118,7 +1116,7 @@ void ThinClientPoolDM::AddEnum(SerializablePtr enumInfo, int enumVal) {
}
}
-GfErrType ThinClientPoolDM::sendUserCredentials(PropertiesPtr credentials,
+GfErrType ThinClientPoolDM::sendUserCredentials(std::shared_ptr<Properties> credentials,
TcrConnection*& conn,
bool isBGThread,
bool& isServerException) {
@@ -1180,9 +1178,9 @@ GfErrType ThinClientPoolDM::sendUserCredentials(PropertiesPtr credentials,
TcrEndpoint* ThinClientPoolDM::getSingleHopServer(
TcrMessage& request, int8_t& version,
- BucketServerLocationPtr& serverlocation,
+ std::shared_ptr<BucketServerLocation>& serverlocation,
std::set<ServerLocation>& excludeServers) {
- const CacheableKeyPtr& key = request.getKeyRef();
+ const std::shared_ptr<CacheableKey>& key = request.getKeyRef();
if (m_clientMetadataService == nullptr || key == nullptr) return nullptr;
auto r = request.getRegion();
auto region = nullptr == r ? nullptr : r->shared_from_this();
@@ -1207,7 +1205,7 @@ TcrEndpoint* ThinClientPoolDM::getSingleHopServer(
}
TcrEndpoint* ThinClientPoolDM::getEndPoint(
- const BucketServerLocationPtr& serverLocation, int8_t& version,
+ const std::shared_ptr<BucketServerLocation>& serverLocation, int8_t& version,
std::set<ServerLocation>& excludeServers) {
TcrEndpoint* ep = nullptr;
if (serverLocation->isValid()) {
@@ -1240,17 +1238,17 @@ TcrEndpoint* ThinClientPoolDM::getEndPoint(
if (m_attrs->m_initLocList.size()) {
std::string servGrp = this->getServerGroup();
if (servGrp.length() > 0) {
- CacheableStringArrayPtr groups = serverLocation->getServerGroups();
+ auto groups = serverLocation->getServerGroups();
if ((groups != nullptr) && (groups->length() > 0)) {
for (int i = 0; i < groups->length(); i++) {
- CacheableStringPtr cs = (*groups)[i];
- if (cs->length() > 0) {
- std::string str = cs->toString();
- if ((ACE_OS::strcmp(str.c_str(), servGrp.c_str()) == 0)) {
- ep = addEP(
- *(serverLocation.get())); // see if this is new endpoint
- break;
- }
+ auto cs = (*groups)[i];
+ if (cs->length() > 0) {
+ std::string str = cs->toString();
+ if ((ACE_OS::strcmp(str.c_str(), servGrp.c_str()) == 0)) {
+ ep = addEP(
+ *(serverLocation.get())); // see if this is new endpoint
+ break;
+ }
}
}
}
@@ -1285,7 +1283,7 @@ GfErrType ThinClientPoolDM::sendSyncRequest(TcrMessage& request,
type == TcrMessage::GET_ALL_WITH_CALLBACK) &&
m_clientMetadataService != nullptr) {
GfErrType error = GF_NOERR;
- RegionPtr region;
+ std::shared_ptr<Region> region;
m_connManager.getCacheImpl()->getRegion(request.getRegionName().c_str(),
region);
auto locationMap = m_clientMetadataService->getServerToFilterMap(
@@ -1346,7 +1344,7 @@ GfErrType ThinClientPoolDM::sendSyncRequest(TcrMessage& request,
GfErrType ThinClientPoolDM::sendSyncRequest(
TcrMessage& request, TcrMessageReply& reply, bool attemptFailover,
- bool isBGThread, const BucketServerLocationPtr& serverLocation) {
+ bool isBGThread, const std::shared_ptr<BucketServerLocation>& serverLocation) {
LOGDEBUG("ThinClientPoolDM::sendSyncRequest: ....%d %s",
request.getMessageType(), m_poolName.c_str());
// Increment clientOps
@@ -1354,7 +1352,7 @@ GfErrType ThinClientPoolDM::sendSyncRequest(
GfErrType error = GF_NOTCON;
- UserAttributesPtr userAttr = nullptr;
+std::shared_ptr<UserAttributes> userAttr = nullptr;
reply.setDM(this);
int32_t type = request.getMessageType();
@@ -1444,7 +1442,7 @@ GfErrType ThinClientPoolDM::sendSyncRequest(
return GF_CLIENT_WAIT_TIMEOUT;
} else if (queueErr == GF_CLIENT_WAIT_TIMEOUT_REFRESH_PRMETADATA) {
// need to refresh meta data
- RegionPtr region;
+ std::shared_ptr<Region> region;
m_connManager.getCacheImpl()->getRegion(request.getRegionName().c_str(),
region);
if (region != nullptr) {
@@ -1573,7 +1571,7 @@ GfErrType ThinClientPoolDM::sendSyncRequest(
request.getKeyRef() != nullptr && reply.isFEAnotherHop()))) {
// Need to get direct access to Region's name to avoid referencing
// temp data and causing crashes
- RegionPtr region;
+ std::shared_ptr<Region> region;
m_connManager.getCacheImpl()->getRegion(request.getRegionName().c_str(),
region);
if (region != nullptr) {
@@ -1980,44 +1978,43 @@ GfErrType ThinClientPoolDM::sendRequestToEP(const TcrMessage& request,
}
reply.setDM(this);
- UserAttributesPtr ua = nullptr;
+ std::shared_ptr<UserAttributes> ua = nullptr;
// in multi user mode need to chk whether user is authenticated or not
// and then follow usual process which we did in send syncrequest.
// need to user initiative ops
- LOGDEBUG("ThinClientPoolDM::sendRequestToEP: this->m_isMultiUserMode = %d",
- this->m_isMultiUserMode);
- bool isServerException = false;
- if (TcrMessage::isUserInitiativeOps((request)) &&
- (this->m_isSecurityOn || this->m_isMultiUserMode)) {
- if (!this->m_isMultiUserMode && !currentEndpoint->isAuthenticated()) {
- // first authenticate him on this endpoint
- error = this->sendUserCredentials(this->getCredentials(currentEndpoint),
- conn, false, isServerException);
- } else if (this->m_isMultiUserMode) {
- ua = TSSUserAttributesWrapper::s_geodeTSSUserAttributes
- ->getUserAttributes();
- if (ua == nullptr) {
- LOGWARN("Attempted operation type %d without credentials",
- request.getMessageType());
- if (conn != nullptr)
- putInQueue(conn, false, request.forTransaction());
- return GF_NOT_AUTHORIZED_EXCEPTION;
- } else {
- UserConnectionAttributes* uca =
- ua->getConnectionAttribute(currentEndpoint);
+ LOGDEBUG("ThinClientPoolDM::sendRequestToEP: this->m_isMultiUserMode = %d",
+ this->m_isMultiUserMode);
+ bool isServerException = false;
+ if (TcrMessage::isUserInitiativeOps((request)) &&
+ (this->m_isSecurityOn || this->m_isMultiUserMode)) {
+ if (!this->m_isMultiUserMode && !currentEndpoint->isAuthenticated()) {
+ // first authenticate him on this endpoint
+ error = this->sendUserCredentials(this->getCredentials(currentEndpoint),
+ conn, false, isServerException);
+ } else if (this->m_isMultiUserMode) {
+ ua = TSSUserAttributesWrapper::s_geodeTSSUserAttributes
+ ->getUserAttributes();
+ if (ua == nullptr) {
+ LOGWARN("Attempted operation type %d without credentials",
+ request.getMessageType());
+ if (conn != nullptr) putInQueue(conn, false, request.forTransaction());
+ return GF_NOT_AUTHORIZED_EXCEPTION;
+ } else {
+ UserConnectionAttributes* uca =
+ ua->getConnectionAttribute(currentEndpoint);
- if (uca == nullptr) {
- error = this->sendUserCredentials(ua->getCredentials(), conn, false,
- isServerException);
- }
+ if (uca == nullptr) {
+ error = this->sendUserCredentials(ua->getCredentials(), conn, false,
+ isServerException);
}
}
}
+ }
- LOGDEBUG("ThinClientPoolDM::sendRequestToEP after getting creds");
- if (error == GF_NOERR && conn != nullptr) {
- error =
- currentEndpoint->sendRequestConnWithRetry(request, reply, conn, true);
+ LOGDEBUG("ThinClientPoolDM::sendRequestToEP after getting creds");
+ if (error == GF_NOERR && conn != nullptr) {
+ error =
+ currentEndpoint->sendRequestConnWithRetry(request, reply, conn, true);
}
if (isServerException) return error;
diff --git a/cppcache/src/ThinClientPoolDM.hpp b/cppcache/src/ThinClientPoolDM.hpp
index cbc1ef8..c447043 100644
--- a/cppcache/src/ThinClientPoolDM.hpp
+++ b/cppcache/src/ThinClientPoolDM.hpp
@@ -78,7 +78,7 @@ class ThinClientPoolDM
private NonCopyable,
private NonAssignable {
public:
- ThinClientPoolDM(const char* name, PoolAttributesPtr poolAttrs,
+ ThinClientPoolDM(const char* name, std::shared_ptr<PoolAttributes> poolAttrs,
TcrConnectionManager& connManager);
virtual void init();
@@ -88,22 +88,23 @@ class ThinClientPoolDM
virtual GfErrType sendSyncRequest(TcrMessage& request, TcrMessageReply& reply,
bool attemptFailover = true,
bool isBGThread = false);
- GfErrType sendSyncRequest(TcrMessage& request, TcrMessageReply& reply,
- bool attemptFailover, bool isBGThread,
- const BucketServerLocationPtr& serverLocation);
+ GfErrType sendSyncRequest(
+ TcrMessage& request, TcrMessageReply& reply, bool attemptFailover,
+ bool isBGThread,
+ const std::shared_ptr<BucketServerLocation>& serverLocation);
// Pool Specific Fns.
- virtual const CacheableStringArrayPtr getLocators() const;
- virtual const CacheableStringArrayPtr getServers();
+ virtual const std::shared_ptr<CacheableStringArray> getLocators() const;
+ virtual const std::shared_ptr<CacheableStringArray> getServers();
virtual void destroy(bool keepalive = false);
virtual bool isDestroyed() const;
- virtual QueryServicePtr getQueryService();
- virtual QueryServicePtr getQueryServiceWithoutCheck();
+ virtual std::shared_ptr<QueryService> getQueryService();
+ virtual std::shared_ptr<QueryService> getQueryServiceWithoutCheck();
virtual bool isEndpointAttached(TcrEndpoint* ep);
- GfErrType sendRequestToAllServers(const char* func, uint8_t getResult,
- std::chrono::milliseconds timeout,
- CacheablePtr args, ResultCollectorPtr& rs,
- CacheableStringPtr& exceptionPtr);
+ GfErrType sendRequestToAllServers(
+ const char* func, uint8_t getResult, std::chrono::milliseconds timeout,
+ std::shared_ptr<Cacheable> args, std::shared_ptr<ResultCollector>& rs,
+ std::shared_ptr<CacheableString>& exceptionPtr);
GfErrType sendRequestToEP(const TcrMessage& request, TcrMessageReply& reply,
TcrEndpoint* currentEndpoint);
@@ -127,7 +128,7 @@ class ThinClientPoolDM
// void updateQueue(const char* regionPath) ;
ClientProxyMembershipID* getMembershipId() { return m_memId.get(); }
virtual void processMarker(){};
- virtual bool checkDupAndAdd(EventIdPtr eventid) {
+ virtual bool checkDupAndAdd(std::shared_ptr<EventId> eventid) {
return m_connManager.checkDupAndAdd(eventid);
}
ACE_Recursive_Thread_Mutex& getPoolLock() { return getQueueLock(); }
@@ -161,15 +162,15 @@ class ThinClientPoolDM
size_t getNumberOfEndPoints() const { return m_endpoints.current_size(); }
- int32_t GetPDXIdForType(SerializablePtr pdxType);
+ int32_t GetPDXIdForType(std::shared_ptr<Serializable> pdxType);
- SerializablePtr GetPDXTypeById(int32_t typeId);
+ std::shared_ptr<Serializable> GetPDXTypeById(int32_t typeId);
- void AddPdxType(SerializablePtr pdxType, int32_t pdxTypeId);
+ void AddPdxType(std::shared_ptr<Serializable> pdxType, int32_t pdxTypeId);
- int32_t GetEnumValue(SerializablePtr enumInfo);
- SerializablePtr GetEnum(int32_t val);
- void AddEnum(SerializablePtr enumInfo, int enumVal);
+ int32_t GetEnumValue(std::shared_ptr<Serializable> enumInfo);
+ std::shared_ptr<Serializable> GetEnum(int32_t val);
+ void AddEnum(std::shared_ptr<Serializable> enumInfo, int enumVal);
// Tries to get connection to a endpoint. If no connection is available, it
// tries
@@ -181,8 +182,8 @@ class ThinClientPoolDM
virtual inline bool isSticky() { return m_sticky; }
virtual TcrEndpoint* getEndPoint(
- const BucketServerLocationPtr& serverLocation, int8_t& version,
- std::set<ServerLocation>& excludeServers);
+ const std::shared_ptr<BucketServerLocation>& serverLocation,
+ int8_t& version, std::set<ServerLocation>& excludeServers);
ClientMetadataService* getClientMetaDataService() {
return m_clientMetadataService;
@@ -212,7 +213,7 @@ class ThinClientPoolDM
volatile bool m_destroyPending;
volatile bool m_destroyPendingHADM;
void checkRegions();
- RemoteQueryServicePtr m_remoteQueryServicePtr;
+ std::shared_ptr<RemoteQueryService> m_remoteQueryServicePtr;
virtual void startBackgroundThreads();
virtual void stopPingThread();
virtual void stopUpdateLocatorListThread();
@@ -237,7 +238,7 @@ class ThinClientPoolDM
GfErrType* error, std::set<ServerLocation>& excludeServers,
bool isBGThread, TcrMessage& request, int8_t& version, bool& match,
bool& connFound,
- const BucketServerLocationPtr& serverLocation = nullptr) {
+ const std::shared_ptr<BucketServerLocation>& serverLocation = nullptr) {
TcrConnection* conn = nullptr;
TcrEndpoint* theEP = nullptr;
LOGDEBUG("prEnabled = %s, forSingleHop = %s %d",
@@ -246,7 +247,7 @@ class ThinClientPoolDM
request.getMessageType());
match = false;
- BucketServerLocationPtr slTmp = nullptr;
+ std::shared_ptr<BucketServerLocation> slTmp = nullptr;
if (request.forTransaction()) {
bool connFound =
m_manager->getStickyConnection(conn, error, excludeServers, true);
@@ -298,7 +299,7 @@ class ThinClientPoolDM
request.getKey() == nullptr) {
return nullptr;
}
- RegionPtr region;
+ std::shared_ptr<Region> region;
m_connManager.getCacheImpl()->getRegion(
request.getRegionName().c_str(), region);
if (region != nullptr) {
@@ -339,7 +340,7 @@ class ThinClientPoolDM
TcrConnection* getFromEP(TcrEndpoint* theEP);
virtual TcrEndpoint* getSingleHopServer(
TcrMessage& request, int8_t& version,
- BucketServerLocationPtr& serverLocation,
+ std::shared_ptr<BucketServerLocation>& serverLocation,
std::set<ServerLocation>& excludeServers);
// Create pool connection to a specified endpoint.
GfErrType createPoolConnectionToAEndPoint(TcrConnection*& conn,
@@ -350,10 +351,12 @@ class ThinClientPoolDM
private:
bool hasExpired(TcrConnection* conn);
- PropertiesPtr getCredentials(TcrEndpoint* ep);
- GfErrType sendUserCredentials(PropertiesPtr credentials, TcrConnection*& conn,
- bool isBGThread, bool& isServerException);
- TcrConnection* getConnectionInMultiuserMode(UserAttributesPtr userAttribute);
+ std::shared_ptr<Properties> getCredentials(TcrEndpoint* ep);
+ GfErrType sendUserCredentials(std::shared_ptr<Properties> credentials,
+ TcrConnection*& conn, bool isBGThread,
+ bool& isServerException);
+ TcrConnection* getConnectionInMultiuserMode(
+ std::shared_ptr<UserAttributes> userAttribute);
// get endpoint using the endpoint string
TcrEndpoint* getEndPoint(std::string epNameStr);
@@ -430,19 +433,18 @@ class ThinClientPoolDM
int m_primaryServerQueueSize;
};
-typedef std::shared_ptr<ThinClientPoolDM> ThinClientPoolDMPtr;
class FunctionExecution : public PooledWork<GfErrType> {
ThinClientPoolDM* m_poolDM;
TcrEndpoint* m_ep;
const char* m_func;
uint8_t m_getResult;
std::chrono::milliseconds m_timeout;
- CacheablePtr m_args;
+ std::shared_ptr<Cacheable> m_args;
GfErrType m_error;
- ResultCollectorPtr* m_rc;
+ std::shared_ptr<ResultCollector>* m_rc;
std::shared_ptr<ACE_Recursive_Thread_Mutex> m_resultCollectorLock;
- CacheableStringPtr exceptionPtr;
- UserAttributesPtr m_userAttr;
+ std::shared_ptr<CacheableString> exceptionPtr;
+ std::shared_ptr<UserAttributes> m_userAttr;
public:
FunctionExecution() {
@@ -458,13 +460,15 @@ class FunctionExecution : public PooledWork<GfErrType> {
~FunctionExecution() {}
- CacheableStringPtr getException() { return exceptionPtr; }
+ std::shared_ptr<CacheableString> getException() { return exceptionPtr; }
void setParameters(const char* func, uint8_t getResult,
- std::chrono::milliseconds timeout, CacheablePtr args,
- TcrEndpoint* ep, ThinClientPoolDM* poolDM,
+ std::chrono::milliseconds timeout,
+ std::shared_ptr<Cacheable> args, TcrEndpoint* ep,
+ ThinClientPoolDM* poolDM,
const std::shared_ptr<ACE_Recursive_Thread_Mutex>& rCL,
- ResultCollectorPtr* rs, UserAttributesPtr userAttr) {
+ std::shared_ptr<ResultCollector>* rs,
+ std::shared_ptr<UserAttributes> userAttr) {
exceptionPtr = nullptr;
m_resultCollectorLock = rCL;
m_rc = rs;
@@ -542,7 +546,7 @@ class FunctionExecution : public PooledWork<GfErrType> {
};
class OnRegionFunctionExecution : public PooledWork<GfErrType> {
- BucketServerLocationPtr m_serverLocation;
+ std::shared_ptr<BucketServerLocation> m_serverLocation;
TcrMessage* m_request;
TcrMessageReply* m_reply;
bool m_isBGThread;
@@ -550,23 +554,25 @@ class OnRegionFunctionExecution : public PooledWork<GfErrType> {
const char* m_func;
uint8_t m_getResult;
std::chrono::milliseconds m_timeout;
- CacheablePtr m_args;
- CacheableHashSetPtr m_routingObj;
- ResultCollectorPtr m_rc;
+ std::shared_ptr<Cacheable> m_args;
+ std::shared_ptr<CacheableHashSet> m_routingObj;
+ std::shared_ptr<ResultCollector> m_rc;
TcrChunkedResult* m_resultCollector;
std::shared_ptr<ACE_Recursive_Thread_Mutex> m_resultCollectorLock;
- UserAttributesPtr m_userAttr;
+ std::shared_ptr<UserAttributes> m_userAttr;
const Region* m_region;
bool m_allBuckets;
public:
OnRegionFunctionExecution(
- const char* func, const Region* region, CacheablePtr args,
- CacheableHashSetPtr routingObj, uint8_t getResult,
+ const char* func, const Region* region, std::shared_ptr<Cacheable> args,
+ std::shared_ptr<CacheableHashSet> routingObj, uint8_t getResult,
std::chrono::milliseconds timeout, ThinClientPoolDM* poolDM,
const std::shared_ptr<ACE_Recursive_Thread_Mutex>& rCL,
- ResultCollectorPtr rs, UserAttributesPtr userAttr, bool isBGThread,
- const BucketServerLocationPtr& serverLocation, bool allBuckets)
+ std::shared_ptr<ResultCollector> rs,
+ std::shared_ptr<UserAttributes> userAttr, bool isBGThread,
+ const std::shared_ptr<BucketServerLocation>& serverLocation,
+ bool allBuckets)
: m_serverLocation(serverLocation),
m_isBGThread(isBGThread),
m_poolDM(poolDM),
@@ -605,7 +611,7 @@ class OnRegionFunctionExecution : public PooledWork<GfErrType> {
TcrMessage* getReply() { return m_reply; }
- CacheableHashSetPtr getFailedNode() { return m_reply->getFailedNode(); }
+ std::shared_ptr<CacheableHashSet> getFailedNode() { return m_reply->getFailedNode(); }
ChunkedFunctionExecutionResponse* getResultCollector() {
return static_cast<ChunkedFunctionExecutionResponse*>(m_resultCollector);
diff --git a/cppcache/src/ThinClientPoolHADM.cpp b/cppcache/src/ThinClientPoolHADM.cpp
index 86cdff3..af33323 100644
--- a/cppcache/src/ThinClientPoolHADM.cpp
+++ b/cppcache/src/ThinClientPoolHADM.cpp
@@ -21,7 +21,7 @@
using namespace apache::geode::client;
const char* ThinClientPoolHADM::NC_Redundancy = "NC Redundancy";
ThinClientPoolHADM::ThinClientPoolHADM(const char* name,
- PoolAttributesPtr poolAttr,
+ std::shared_ptr<PoolAttributes> poolAttr,
TcrConnectionManager& connManager)
: ThinClientPoolDM(name, poolAttr, connManager),
m_theTcrConnManager(connManager),
diff --git a/cppcache/src/ThinClientPoolHADM.hpp b/cppcache/src/ThinClientPoolHADM.hpp
index ab5dc78..4a369aa 100644
--- a/cppcache/src/ThinClientPoolHADM.hpp
+++ b/cppcache/src/ThinClientPoolHADM.hpp
@@ -30,7 +30,7 @@ namespace client {
class ThinClientPoolHADM : public ThinClientPoolDM {
public:
- ThinClientPoolHADM(const char* name, PoolAttributesPtr poolAttr,
+ ThinClientPoolHADM(const char* name, std::shared_ptr<PoolAttributes> poolAttr,
TcrConnectionManager& connManager);
void init();
@@ -59,7 +59,7 @@ class ThinClientPoolHADM : public ThinClientPoolDM {
void sendNotificationCloseMsgs();
- bool checkDupAndAdd(EventIdPtr eventid) {
+ bool checkDupAndAdd(std::shared_ptr<EventId> eventid) {
return m_redundancyManager->checkDupAndAdd(eventid);
}
@@ -144,7 +144,6 @@ class ThinClientPoolHADM : public ThinClientPoolDM {
friend class ThinClientRedundancyManager;
static const char* NC_Redundancy;
};
-typedef std::shared_ptr<ThinClientPoolHADM> ThinClientPoolHADMPtr;
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/ThinClientPoolRegion.cpp b/cppcache/src/ThinClientPoolRegion.cpp
index b888e1c..9710913 100644
--- a/cppcache/src/ThinClientPoolRegion.cpp
+++ b/cppcache/src/ThinClientPoolRegion.cpp
@@ -30,9 +30,10 @@
using namespace apache::geode::client;
ThinClientPoolRegion::ThinClientPoolRegion(
- const std::string& name, CacheImpl* cache, const RegionInternalPtr& rPtr,
- const RegionAttributesPtr& attributes, const CacheStatisticsPtr& stats,
- bool shared)
+ const std::string& name, CacheImpl* cache,
+ const std::shared_ptr<RegionInternal>& rPtr,
+ const std::shared_ptr<RegionAttributes>& attributes,
+ const std::shared_ptr<CacheStatistics>& stats, bool shared)
: ThinClientRegion(name, cache, rPtr, attributes, stats, shared) {}
ThinClientPoolRegion::~ThinClientPoolRegion() { m_tcrdm = nullptr; }
diff --git a/cppcache/src/ThinClientPoolRegion.hpp b/cppcache/src/ThinClientPoolRegion.hpp
index 4db675d..8fdba1f 100644
--- a/cppcache/src/ThinClientPoolRegion.hpp
+++ b/cppcache/src/ThinClientPoolRegion.hpp
@@ -37,9 +37,10 @@ class ThinClientPoolRegion : public ThinClientRegion {
* @brief constructor/initializer/destructor
*/
ThinClientPoolRegion(const std::string& name, CacheImpl* cache,
- const RegionInternalPtr& rPtr,
- const RegionAttributesPtr& attributes,
- const CacheStatisticsPtr& stats, bool shared = false);
+ const std::shared_ptr<RegionInternal>& rPtr,
+ const std::shared_ptr<RegionAttributes>& attributes,
+ const std::shared_ptr<CacheStatistics>& stats,
+ bool shared = false);
virtual void initTCR();
virtual ~ThinClientPoolRegion();
diff --git a/cppcache/src/ThinClientPoolStickyDM.cpp b/cppcache/src/ThinClientPoolStickyDM.cpp
index 964898b..2e8ea23 100644
--- a/cppcache/src/ThinClientPoolStickyDM.cpp
+++ b/cppcache/src/ThinClientPoolStickyDM.cpp
@@ -21,7 +21,7 @@ using namespace apache::geode::client;
TcrConnection* ThinClientPoolStickyDM::getConnectionFromQueueW(
GfErrType* error, std::set<ServerLocation>& excludeServers, bool isBGThread,
TcrMessage& request, int8_t& version, bool& match, bool& connFound,
- const BucketServerLocationPtr& serverLocation) {
+ const std::shared_ptr<BucketServerLocation>& serverLocation) {
TcrConnection* conn = nullptr;
TcrEndpoint* ep = nullptr;
bool maxConnLimit = false;
@@ -32,7 +32,7 @@ TcrConnection* ThinClientPoolStickyDM::getConnectionFromQueueW(
serverLocation);
return conn;
}
- BucketServerLocationPtr slTmp = nullptr;
+ std::shared_ptr<BucketServerLocation> slTmp = nullptr;
if (m_attrs->getPRSingleHopEnabled() && !request.forTransaction()) {
if (serverLocation != nullptr) {
ep = getEndPoint(serverLocation, version, excludeServers);
diff --git a/cppcache/src/ThinClientPoolStickyDM.hpp b/cppcache/src/ThinClientPoolStickyDM.hpp
index 7ad228b..b46d358 100644
--- a/cppcache/src/ThinClientPoolStickyDM.hpp
+++ b/cppcache/src/ThinClientPoolStickyDM.hpp
@@ -26,7 +26,8 @@ namespace geode {
namespace client {
class ThinClientPoolStickyDM : public ThinClientPoolDM {
public:
- ThinClientPoolStickyDM(const char* name, PoolAttributesPtr poolAttrs,
+ ThinClientPoolStickyDM(const char* name,
+ std::shared_ptr<PoolAttributes> poolAttrs,
TcrConnectionManager& connManager)
: ThinClientPoolDM(name, poolAttrs, connManager) {
m_sticky = true;
@@ -42,7 +43,7 @@ class ThinClientPoolStickyDM : public ThinClientPoolDM {
virtual TcrConnection* getConnectionFromQueueW(
GfErrType* error, std::set<ServerLocation>&, bool isBGThread,
TcrMessage& request, int8_t& version, bool& match, bool& connFound,
- const BucketServerLocationPtr& serverLocation = nullptr);
+ const std::shared_ptr<BucketServerLocation>& serverLocation = nullptr);
virtual void putInQueue(TcrConnection* conn, bool isBGThread,
bool isTransaction = false);
virtual void setStickyNull(bool isBGThread);
@@ -52,7 +53,6 @@ class ThinClientPoolStickyDM : public ThinClientPoolDM {
// virtual void cleanStickyConnections(volatile bool& isRunning);
};
-typedef std::shared_ptr<ThinClientPoolStickyDM> ThinClientPoolStickyDMPtr;
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/ThinClientPoolStickyHADM.hpp b/cppcache/src/ThinClientPoolStickyHADM.hpp
index 07fa4ed..3c7566b 100644
--- a/cppcache/src/ThinClientPoolStickyHADM.hpp
+++ b/cppcache/src/ThinClientPoolStickyHADM.hpp
@@ -26,14 +26,14 @@ namespace geode {
namespace client {
class ThinClientPoolStickyHADM : public ThinClientPoolHADM {
public:
- ThinClientPoolStickyHADM(const char* name, PoolAttributesPtr poolAttrs,
+ ThinClientPoolStickyHADM(const char* name,
+ std::shared_ptr<PoolAttributes> poolAttrs,
TcrConnectionManager& connManager)
: ThinClientPoolHADM(name, poolAttrs, connManager) {
m_sticky = true;
}
virtual ~ThinClientPoolStickyHADM() {}
};
-typedef std::shared_ptr<ThinClientPoolStickyHADM> ThinClientPoolStickyHADMPtr;
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/ThinClientRedundancyManager.cpp b/cppcache/src/ThinClientRedundancyManager.cpp
index 19f93d0..49c6b2e 100644
--- a/cppcache/src/ThinClientRedundancyManager.cpp
+++ b/cppcache/src/ThinClientRedundancyManager.cpp
@@ -402,7 +402,7 @@ GfErrType ThinClientRedundancyManager::maintainRedundancyLevel(
((int)m_redundantEndpoints.size() <= m_redundancyLevel) ||
m_redundancyLevel == -1);
- RemoteQueryServicePtr queryServicePtr;
+ std::shared_ptr<RemoteQueryService> queryServicePtr;
ThinClientPoolDM* poolDM = dynamic_cast<ThinClientPoolDM*>(m_poolHADM);
if (poolDM) {
queryServicePtr = std::dynamic_pointer_cast<RemoteQueryService>(
@@ -805,12 +805,10 @@ bool ThinClientRedundancyManager::sendMakePrimaryMesg(
* is supposed to fail due to notauthorized exception then causing
* subsequent maintainredundancy calls to fail for other ops like CQ
if ( request != nullptr && region != nullptr ) {
- const VectorOfCacheableKey* keys = request->getKeys( );
- bool isDurable = request->isDurable( );
- if ( keys == nullptr || keys->empty( ) ) {
- const std::string& regex = request->getRegex( );
- if ( !regex.empty( ) ) {
- region->addRegex( regex, isDurable );
+ const std::vector<std::shared_ptr<CacheableKey>> * keys =
+ request->getKeys( ); bool isDurable = request->isDurable( ); if ( keys ==
+ nullptr || keys->empty( ) ) { const std::string& regex = request->getRegex(
+ ); if ( !regex.empty( ) ) { region->addRegex( regex, isDurable );
}
} else {
region->addKeys( *keys, isDurable );
@@ -868,13 +866,12 @@ GfErrType ThinClientRedundancyManager::sendSyncRequestCq(
? 5
: attempts; // at least 5 attempts if ep lists are small.
- ProxyCachePtr proxyCache = nullptr;
+ std::shared_ptr<ProxyCache> proxyCache = nullptr;
while (attempts--) {
if (err != GF_NOERR || m_redundantEndpoints.empty()) {
- UserAttributesPtr userAttr =
- TSSUserAttributesWrapper::s_geodeTSSUserAttributes
- ->getUserAttributes();
+ auto userAttr = TSSUserAttributesWrapper::s_geodeTSSUserAttributes
+ ->getUserAttributes();
if (userAttr != nullptr) proxyCache = userAttr->getProxyCache();
err = maintainRedundancyLevel();
// we continue on fatal error because MRL only tries a handshake without
@@ -1270,7 +1267,8 @@ void ThinClientRedundancyManager::startPeriodicAck() {
// notification dup check with the help of eventidmap - called by
// ThinClientRegion
-bool ThinClientRedundancyManager::checkDupAndAdd(EventIdPtr eventid) {
+bool ThinClientRedundancyManager::checkDupAndAdd(
+ std::shared_ptr<EventId> eventid) {
EventIdMapEntry entry = EventIdMap::make(eventid);
return m_eventidmap.put(entry.first, entry.second, true);
}
diff --git a/cppcache/src/ThinClientRedundancyManager.hpp b/cppcache/src/ThinClientRedundancyManager.hpp
index 3cad1e4..469f3a0 100644
--- a/cppcache/src/ThinClientRedundancyManager.hpp
+++ b/cppcache/src/ThinClientRedundancyManager.hpp
@@ -66,7 +66,7 @@ class ThinClientRedundancyManager {
ThinClientBaseDM* theHADM);
void readyForEvents();
void startPeriodicAck();
- bool checkDupAndAdd(EventIdPtr eventid);
+ bool checkDupAndAdd(std::shared_ptr<EventId> eventid);
void netDown();
void acquireRedundancyLock() { m_redundantEndpointsLock.acquire_read(); }
void releaseRedundancyLock() { m_redundantEndpointsLock.release(); }
@@ -92,8 +92,8 @@ class ThinClientRedundancyManager {
std::vector<TcrEndpoint*> m_nonredundantEndpoints;
ACE_Recursive_Thread_Mutex m_redundantEndpointsLock;
TcrConnectionManager* m_theTcrConnManager;
- CacheableStringArrayPtr m_locators;
- CacheableStringArrayPtr m_servers;
+ std::shared_ptr<CacheableStringArray> m_locators;
+ std::shared_ptr<CacheableStringArray> m_servers;
void removeEndpointsInOrder(std::vector<TcrEndpoint*>& destVector,
const std::vector<TcrEndpoint*>& srcVector);
diff --git a/cppcache/src/ThinClientRegion.cpp b/cppcache/src/ThinClientRegion.cpp
index 3064cf7..9afd4c5 100644
--- a/cppcache/src/ThinClientRegion.cpp
+++ b/cppcache/src/ThinClientRegion.cpp
@@ -52,31 +52,32 @@ class PutAllWork : public PooledWork<GfErrType>,
private NonCopyable,
private NonAssignable {
ThinClientPoolDM* m_poolDM;
- BucketServerLocationPtr m_serverLocation;
+ std::shared_ptr<BucketServerLocation> m_serverLocation;
TcrMessage* m_request;
TcrMessageReply* m_reply;
MapOfUpdateCounters m_mapOfUpdateCounters;
bool m_attemptFailover;
bool m_isBGThread;
- UserAttributesPtr m_userAttribute;
- const RegionPtr m_region;
- VectorOfCacheableKeyPtr m_keys;
- HashMapOfCacheablePtr m_map;
- VersionedCacheableObjectPartListPtr m_verObjPartListPtr;
+ std::shared_ptr<UserAttributes> m_userAttribute;
+ const std::shared_ptr<Region> m_region;
+ std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>> m_keys;
+ std::shared_ptr<HashMapOfCacheable> m_map;
+ std::shared_ptr<VersionedCacheableObjectPartList> m_verObjPartListPtr;
std::chrono::milliseconds m_timeout;
- PutAllPartialResultServerExceptionPtr m_papException;
+ std::shared_ptr<PutAllPartialResultServerException> m_papException;
bool m_isPapeReceived;
ChunkedPutAllResponse* m_resultCollector;
- // UNUSED const SerializablePtr& m_aCallbackArgument;
+ // UNUSED const std::shared_ptr<Serializable>& m_aCallbackArgument;
public:
- PutAllWork(ThinClientPoolDM* poolDM,
- const BucketServerLocationPtr& serverLocation,
- const RegionPtr& region, bool attemptFailover, bool isBGThread,
- const HashMapOfCacheablePtr map,
- const VectorOfCacheableKeyPtr keys,
- std::chrono::milliseconds timeout,
- const SerializablePtr& aCallbackArgument)
+ PutAllWork(
+ ThinClientPoolDM* poolDM,
+ const std::shared_ptr<BucketServerLocation>& serverLocation,
+ const std::shared_ptr<Region>& region, bool attemptFailover,
+ bool isBGThread, const std::shared_ptr<HashMapOfCacheable> map,
+ const std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>> keys,
+ std::chrono::milliseconds timeout,
+ const std::shared_ptr<Serializable>& aCallbackArgument)
: m_poolDM(poolDM),
m_serverLocation(serverLocation),
m_attemptFailover(attemptFailover),
@@ -120,17 +121,19 @@ class PutAllWork : public PooledWork<GfErrType>,
TcrMessage* getReply() { return m_reply; }
- HashMapOfCacheablePtr getPutAllMap() { return m_map; }
+ std::shared_ptr<HashMapOfCacheable> getPutAllMap() { return m_map; }
- VersionedCacheableObjectPartListPtr getVerObjPartList() {
+ std::shared_ptr<VersionedCacheableObjectPartList> getVerObjPartList() {
return m_verObjPartListPtr;
}
ChunkedPutAllResponse* getResultCollector() { return m_resultCollector; }
- BucketServerLocationPtr getServerLocation() { return m_serverLocation; }
+ std::shared_ptr<BucketServerLocation> getServerLocation() {
+ return m_serverLocation;
+ }
- PutAllPartialResultServerExceptionPtr getPaPResultException() {
+ std::shared_ptr<PutAllPartialResultServerException> getPaPResultException() {
return m_papException;
}
@@ -199,27 +202,29 @@ class RemoveAllWork : public PooledWork<GfErrType>,
private NonCopyable,
private NonAssignable {
ThinClientPoolDM* m_poolDM;
- BucketServerLocationPtr m_serverLocation;
+ std::shared_ptr<BucketServerLocation> m_serverLocation;
TcrMessage* m_request;
TcrMessageReply* m_reply;
MapOfUpdateCounters m_mapOfUpdateCounters;
bool m_attemptFailover;
bool m_isBGThread;
- UserAttributesPtr m_userAttribute;
- const RegionPtr m_region;
- const SerializablePtr& m_aCallbackArgument;
- VectorOfCacheableKeyPtr m_keys;
- VersionedCacheableObjectPartListPtr m_verObjPartListPtr;
- PutAllPartialResultServerExceptionPtr m_papException;
+ std::shared_ptr<UserAttributes> m_userAttribute;
+ const std::shared_ptr<Region> m_region;
+ const std::shared_ptr<Serializable>& m_aCallbackArgument;
+ std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>> m_keys;
+ std::shared_ptr<VersionedCacheableObjectPartList> m_verObjPartListPtr;
+ std::shared_ptr<PutAllPartialResultServerException> m_papException;
bool m_isPapeReceived;
ChunkedRemoveAllResponse* m_resultCollector;
public:
- RemoveAllWork(ThinClientPoolDM* poolDM,
- const BucketServerLocationPtr& serverLocation,
- const RegionPtr& region, bool attemptFailover, bool isBGThread,
- const VectorOfCacheableKeyPtr keys,
- const SerializablePtr& aCallbackArgument)
+ RemoveAllWork(
+ ThinClientPoolDM* poolDM,
+ const std::shared_ptr<BucketServerLocation>& serverLocation,
+ const std::shared_ptr<Region>& region, bool attemptFailover,
+ bool isBGThread,
+ const std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>> keys,
+ const std::shared_ptr<Serializable>& aCallbackArgument)
: m_poolDM(poolDM),
m_serverLocation(serverLocation),
m_attemptFailover(attemptFailover),
@@ -257,15 +262,17 @@ class RemoveAllWork : public PooledWork<GfErrType>,
TcrMessage* getReply() { return m_reply; }
- VersionedCacheableObjectPartListPtr getVerObjPartList() {
+ std::shared_ptr<VersionedCacheableObjectPartList> getVerObjPartList() {
return m_verObjPartListPtr;
}
ChunkedRemoveAllResponse* getResultCollector() { return m_resultCollector; }
- BucketServerLocationPtr getServerLocation() { return m_serverLocation; }
+ std::shared_ptr<BucketServerLocation> getServerLocation() {
+ return m_serverLocation;
+ }
- PutAllPartialResultServerExceptionPtr getPaPResultException() {
+ std::shared_ptr<PutAllPartialResultServerException> getPaPResultException() {
return m_papException;
}
@@ -330,11 +337,11 @@ class RemoveAllWork : public PooledWork<GfErrType>,
}
};
-ThinClientRegion::ThinClientRegion(const std::string& name,
- CacheImpl* cacheImpl,
- const RegionInternalPtr& rPtr,
- const RegionAttributesPtr& attributes,
- const CacheStatisticsPtr& stats, bool shared)
+ThinClientRegion::ThinClientRegion(
+ const std::string& name, CacheImpl* cacheImpl,
+ const std::shared_ptr<RegionInternal>& rPtr,
+ const std::shared_ptr<RegionAttributes>& attributes,
+ const std::shared_ptr<CacheStatistics>& stats, bool shared)
: LocalRegion(name, cacheImpl, rPtr, attributes, stats, shared),
m_tcrdm((ThinClientBaseDM*)0),
m_notifyRelease(false),
@@ -348,7 +355,7 @@ ThinClientRegion::ThinClientRegion(const std::string& name,
void ThinClientRegion::initTCR() {
bool subscription = false;
- PoolPtr pool = m_cacheImpl->getCache()->getPoolManager().find(
+ auto pool = m_cacheImpl->getCache()->getPoolManager().find(
getAttributes()->getPoolName());
if (pool != nullptr) {
subscription = pool->getSubscriptionEnabled();
@@ -379,10 +386,10 @@ void ThinClientRegion::initTCR() {
}
}
-void ThinClientRegion::registerKeys(const VectorOfCacheableKey& keys,
- bool isDurable, bool getInitialValues,
- bool receiveValues) {
- PoolPtr pool = m_cacheImpl->getCache()->getPoolManager().find(
+void ThinClientRegion::registerKeys(
+ const std::vector<std::shared_ptr<CacheableKey>>& keys, bool isDurable,
+ bool getInitialValues, bool receiveValues) {
+ auto pool = m_cacheImpl->getCache()->getPoolManager().find(
getAttributes()->getPoolName());
if (pool != nullptr) {
if (!pool->getSubscriptionEnabled()) {
@@ -425,8 +432,9 @@ void ThinClientRegion::registerKeys(const VectorOfCacheableKey& keys,
GfErrTypeToException("Region::registerKeys", err);
}
-void ThinClientRegion::unregisterKeys(const VectorOfCacheableKey& keys) {
- PoolPtr pool = m_cacheImpl->getCache()->getPoolManager().find(
+void ThinClientRegion::unregisterKeys(
+ const std::vector<std::shared_ptr<CacheableKey>>& keys) {
+ auto pool = m_cacheImpl->getCache()->getPoolManager().find(
getAttributes()->getPoolName());
if (pool != nullptr) {
if (!pool->getSubscriptionEnabled()) {
@@ -461,7 +469,7 @@ void ThinClientRegion::unregisterKeys(const VectorOfCacheableKey& keys) {
void ThinClientRegion::registerAllKeys(bool isDurable,
bool getInitialValues,
bool receiveValues) {
- PoolPtr pool = m_cacheImpl->getCache()->getPoolManager().find(
+ auto pool = m_cacheImpl->getCache()->getPoolManager().find(
getAttributes()->getPoolName());
if (pool != nullptr) {
if (!pool->getSubscriptionEnabled()) {
@@ -492,7 +500,7 @@ void ThinClientRegion::registerAllKeys(bool isDurable,
LOGDEBUG("ThinClientRegion::registerAllKeys : interestpolicy is %d",
interestPolicy.ordinal);
- VectorOfCacheableKeyPtr resultKeys;
+ std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>> resultKeys;
// if we need to fetch initial data, then we get the keys in
// that call itself using the special GET_ALL message and do not need
// to get the keys in the initial register interest call
@@ -511,7 +519,7 @@ void ThinClientRegion::registerAllKeys(bool isDurable,
void ThinClientRegion::registerRegex(const char* regex, bool isDurable,
bool getInitialValues,
bool receiveValues) {
- PoolPtr pool = m_cacheImpl->getCache()->getPoolManager().find(
+ auto pool = m_cacheImpl->getCache()->getPoolManager().find(
getAttributes()->getPoolName());
if (pool != nullptr) {
if (!pool->getSubscriptionEnabled()) {
@@ -547,8 +555,8 @@ void ThinClientRegion::registerRegex(const char* regex, bool isDurable,
LOGDEBUG("ThinClientRegion::registerRegex : interestpolicy is %d",
interestPolicy.ordinal);
- VectorOfCacheableKeyPtr resultKeys2 =
- std::make_shared<VectorOfCacheableKey>();
+ auto resultKeys2 =
+ std::make_shared<std::vector<std::shared_ptr<CacheableKey>>>();
// if we need to fetch initial data for "allKeys" case, then we
// get the keys in that call itself using the special GET_ALL message and
@@ -565,7 +573,7 @@ void ThinClientRegion::registerRegex(const char* regex, bool isDurable,
}
void ThinClientRegion::unregisterRegex(const char* regex) {
- PoolPtr pool = m_cacheImpl->getCache()->getPoolManager().find(
+ auto pool = m_cacheImpl->getCache()->getPoolManager().find(
getAttributes()->getPoolName());
if (pool != nullptr) {
if (!pool->getSubscriptionEnabled()) {
@@ -591,7 +599,7 @@ void ThinClientRegion::unregisterRegex(const char* regex) {
}
void ThinClientRegion::unregisterAllKeys() {
- PoolPtr pool = m_cacheImpl->getCache()->getPoolManager().find(
+ auto pool = m_cacheImpl->getCache()->getPoolManager().find(
getAttributes()->getPoolName());
if (pool != nullptr) {
if (!pool->getSubscriptionEnabled()) {
@@ -607,9 +615,8 @@ void ThinClientRegion::unregisterAllKeys() {
GfErrType err = unregisterRegexNoThrow(".*");
GfErrTypeToException("Region::unregisterAllKeys", err);
}
-
-SelectResultsPtr ThinClientRegion::query(const char* predicate,
- std::chrono::milliseconds timeout) {
+std::shared_ptr<SelectResults> ThinClientRegion::query(
+ const char* predicate, std::chrono::milliseconds timeout) {
util::PROTOCOL_OPERATION_TIMEOUT_BOUNDS(timeout);
CHECK_DESTROY_PENDING(TryReadGuard, Region::query);
@@ -659,7 +666,7 @@ SelectResultsPtr ThinClientRegion::query(const char* predicate,
squery += predicate;
}
- RemoteQueryPtr queryPtr;
+ std::shared_ptr<RemoteQuery> queryPtr;
// TODO:
ThinClientPoolDM* poolDM = dynamic_cast<ThinClientPoolDM*>(m_tcrdm);
@@ -679,7 +686,7 @@ bool ThinClientRegion::existsValue(const char* predicate,
std::chrono::milliseconds timeout) {
util::PROTOCOL_OPERATION_TIMEOUT_BOUNDS(timeout);
- SelectResultsPtr results = query(predicate, timeout);
+ auto results = query(predicate, timeout);
if (results == nullptr) {
return false;
@@ -689,7 +696,7 @@ bool ThinClientRegion::existsValue(const char* predicate,
}
GfErrType ThinClientRegion::unregisterKeysBeforeDestroyRegion() {
- PoolPtr pool = m_cacheImpl->getCache()->getPoolManager().find(
+ auto pool = m_cacheImpl->getCache()->getPoolManager().find(
getAttributes()->getPoolName());
if (pool != nullptr) {
if (!pool->getSubscriptionEnabled()) {
@@ -713,24 +720,24 @@ GfErrType ThinClientRegion::unregisterKeysBeforeDestroyRegion() {
m_durableInterestListRegexForUpdatesAsInvalidates);
err = opErr != GF_NOERR ? opErr : err;
- VectorOfCacheableKey keysVec;
+ std::vector<std::shared_ptr<CacheableKey>> keysVec;
copyInterestList(keysVec, m_interestList);
opErr = unregisterKeysNoThrowLocalDestroy(keysVec, false);
err = opErr != GF_NOERR ? opErr : err;
- VectorOfCacheableKey keysVecDurable;
+ std::vector<std::shared_ptr<CacheableKey>> keysVecDurable;
copyInterestList(keysVecDurable, m_durableInterestList);
opErr = unregisterKeysNoThrowLocalDestroy(keysVecDurable, false);
err = opErr != GF_NOERR ? opErr : err;
- VectorOfCacheableKey keysVecForUpdatesAsInvalidates;
+ std::vector<std::shared_ptr<CacheableKey>> keysVecForUpdatesAsInvalidates;
copyInterestList(keysVecForUpdatesAsInvalidates,
m_interestListForUpdatesAsInvalidates);
opErr =
unregisterKeysNoThrowLocalDestroy(keysVecForUpdatesAsInvalidates, false);
err = opErr != GF_NOERR ? opErr : err;
- VectorOfCacheableKey keysVecDurableForUpdatesAsInvalidates;
+ std::vector<std::shared_ptr<CacheableKey>> keysVecDurableForUpdatesAsInvalidates;
copyInterestList(keysVecDurableForUpdatesAsInvalidates,
m_durableInterestListForUpdatesAsInvalidates);
opErr = unregisterKeysNoThrowLocalDestroy(
@@ -738,10 +745,9 @@ GfErrType ThinClientRegion::unregisterKeysBeforeDestroyRegion() {
err = opErr != GF_NOERR ? opErr : err;
return err;
}
-
-SerializablePtr ThinClientRegion::selectValue(
+std::shared_ptr<Serializable> ThinClientRegion::selectValue(
const char* predicate, std::chrono::milliseconds timeout) {
- SelectResultsPtr results = query(predicate, timeout);
+ auto results = query(predicate, timeout);
if (results == nullptr || results->size() == 0) {
return nullptr;
@@ -754,14 +760,14 @@ SerializablePtr ThinClientRegion::selectValue(
return results->operator[](0);
}
-VectorOfCacheableKey ThinClientRegion::serverKeys() {
+std::vector<std::shared_ptr<CacheableKey>> ThinClientRegion::serverKeys() {
CHECK_DESTROY_PENDING(TryReadGuard, Region::serverKeys);
TcrMessageReply reply(true, m_tcrdm);
TcrMessageKeySet request(m_cacheImpl->getCache()->createDataOutput(),
m_fullPath, m_tcrdm);
reply.setMessageTypeRequest(TcrMessage::KEY_SET);
- VectorOfCacheableKey serverKeys;
+ std::vector<std::shared_ptr<CacheableKey>> serverKeys;
ChunkedKeySetResponse resultCollector(request, serverKeys, reply);
reply.setChunkedResultHandler(&resultCollector);
@@ -798,15 +804,16 @@ VectorOfCacheableKey ThinClientRegion::serverKeys() {
}
bool ThinClientRegion::containsKeyOnServer(
- const CacheableKeyPtr& keyPtr) const {
+ const std::shared_ptr<CacheableKey>& keyPtr) const {
GfErrType err = GF_NOERR;
bool ret = false;
TXState* txState = getTXState();
if (txState != nullptr) {
// if (!txState->isReplay()) {
- // auto args = std::make_shared<VectorOfCacheable>();
- // txState->recordTXOperation(GF_CONTAINS_KEY,
+ // auto args =
+ //std::make_shared<std::vector<std::shared_ptr<Cacheable>>
+ //>(); txState->recordTXOperation(GF_CONTAINS_KEY,
// getFullPath(),
// keyPtr,
// args);
@@ -816,7 +823,7 @@ bool ThinClientRegion::containsKeyOnServer(
/** @brief Create message and send to bridge server */
TcrMessageContainsKey request(m_cache->createDataOutput(), this, keyPtr,
- static_cast<SerializablePtr>(nullptr), true,
+ static_cast<std::shared_ptr<Serializable>>(nullptr), true,
m_tcrdm);
TcrMessageReply reply(true, m_tcrdm);
reply.setMessageTypeRequest(TcrMessage::CONTAINS_KEY);
@@ -847,7 +854,7 @@ bool ThinClientRegion::containsKeyOnServer(
break;
}
- CacheableBooleanPtr rptr = CacheableBoolean::create(ret);
+ auto rptr = CacheableBoolean::create(ret);
rptr = std::static_pointer_cast<CacheableBoolean>(handleReplay(err, rptr));
GfErrTypeToException("Region::containsKeyOnServer ", err);
@@ -855,14 +862,16 @@ bool ThinClientRegion::containsKeyOnServer(
}
bool ThinClientRegion::containsValueForKey_remote(
- const CacheableKeyPtr& keyPtr) const {
+ const std::shared_ptr<CacheableKey>& keyPtr) const {
GfErrType err = GF_NOERR;
bool ret = false;
TXState* txState = getTXState();
if (txState != nullptr) {
// if (!txState->isReplay()) {
- // auto args = std::make_shared<VectorOfCacheable>();
+ // auto args =
+ //std::make_shared<std::vector<std::shared_ptr<Cacheable>>
+ //>();
// txState->recordTXOperation(GF_CONTAINS_VALUE_FOR_KEY,
// getFullPath(), keyPtr, args);
// }
@@ -871,7 +880,7 @@ bool ThinClientRegion::containsValueForKey_remote(
/** @brief Create message and send to bridge server */
TcrMessageContainsKey request(m_cache->createDataOutput(), this, keyPtr,
- static_cast<SerializablePtr>(nullptr), false,
+ static_cast<std::shared_ptr<Serializable>>(nullptr), false,
m_tcrdm);
TcrMessageReply reply(true, m_tcrdm);
reply.setMessageTypeRequest(TcrMessage::CONTAINS_KEY);
@@ -902,7 +911,7 @@ bool ThinClientRegion::containsValueForKey_remote(
break;
}
- CacheableBooleanPtr rptr = CacheableBoolean::create(ret);
+ auto rptr = CacheableBoolean::create(ret);
rptr = std::static_pointer_cast<CacheableBoolean>(handleReplay(err, rptr));
@@ -910,7 +919,7 @@ bool ThinClientRegion::containsValueForKey_remote(
return rptr->value();
}
-void ThinClientRegion::clear(const SerializablePtr& aCallbackArgument) {
+void ThinClientRegion::clear(const std::shared_ptr<Serializable>& aCallbackArgument) {
GfErrType err = GF_NOERR;
err = localClearNoThrow(aCallbackArgument, CacheEventFlags::NORMAL);
if (err != GF_NOERR) GfErrTypeToException("Region::clear", err);
@@ -953,8 +962,8 @@ void ThinClientRegion::clear(const SerializablePtr& aCallbackArgument) {
}
GfErrType ThinClientRegion::getNoThrow_remote(
- const CacheableKeyPtr& keyPtr, CacheablePtr& valPtr,
- const SerializablePtr& aCallbackArgument, VersionTagPtr& versionTag) {
+ const std::shared_ptr<CacheableKey>& keyPtr, std::shared_ptr<Cacheable>& valPtr,
+ const std::shared_ptr<Serializable>& aCallbackArgument, std::shared_ptr<VersionTag>& versionTag) {
GfErrType err = GF_NOERR;
/** @brief Create message and send to bridge server */
@@ -993,8 +1002,8 @@ GfErrType ThinClientRegion::getNoThrow_remote(
}
GfErrType ThinClientRegion::invalidateNoThrow_remote(
- const CacheableKeyPtr& keyPtr, const SerializablePtr& aCallbackArgument,
- VersionTagPtr& versionTag) {
+ const std::shared_ptr<CacheableKey>& keyPtr, const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag) {
GfErrType err = GF_NOERR;
/** @brief Create message and send to bridge server */
@@ -1032,9 +1041,10 @@ GfErrType ThinClientRegion::invalidateNoThrow_remote(
}
GfErrType ThinClientRegion::putNoThrow_remote(
- const CacheableKeyPtr& keyPtr, const CacheablePtr& valuePtr,
- const SerializablePtr& aCallbackArgument, VersionTagPtr& versionTag,
- bool checkDelta) {
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Cacheable>& valuePtr,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag, bool checkDelta) {
GfErrType err = GF_NOERR;
// do TCR put
// bool delta = valuePtr->hasDelta();
@@ -1095,15 +1105,17 @@ GfErrType ThinClientRegion::putNoThrow_remote(
}
GfErrType ThinClientRegion::createNoThrow_remote(
- const CacheableKeyPtr& keyPtr, const CacheablePtr& valuePtr,
- const SerializablePtr& aCallbackArgument, VersionTagPtr& versionTag) {
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Cacheable>& valuePtr,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag) {
return putNoThrow_remote(keyPtr, valuePtr, aCallbackArgument, versionTag,
false);
}
GfErrType ThinClientRegion::destroyNoThrow_remote(
- const CacheableKeyPtr& keyPtr, const SerializablePtr& aCallbackArgument,
- VersionTagPtr& versionTag) {
+ const std::shared_ptr<CacheableKey>& keyPtr, const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag) {
GfErrType err = GF_NOERR;
// do TCR destroy
@@ -1144,8 +1156,8 @@ GfErrType ThinClientRegion::destroyNoThrow_remote(
} // destroyNoThrow_remote()
GfErrType ThinClientRegion::removeNoThrow_remote(
- const CacheableKeyPtr& keyPtr, const CacheablePtr& cvalue,
- const SerializablePtr& aCallbackArgument, VersionTagPtr& versionTag) {
+ const std::shared_ptr<CacheableKey>& keyPtr, const std::shared_ptr<Cacheable>& cvalue,
+ const std::shared_ptr<Serializable>& aCallbackArgument, std::shared_ptr<VersionTag>& versionTag) {
GfErrType err = GF_NOERR;
// do TCR remove
@@ -1186,8 +1198,8 @@ GfErrType ThinClientRegion::removeNoThrow_remote(
}
GfErrType ThinClientRegion::removeNoThrowEX_remote(
- const CacheableKeyPtr& keyPtr, const SerializablePtr& aCallbackArgument,
- VersionTagPtr& versionTag) {
+ const std::shared_ptr<CacheableKey>& keyPtr, const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag) {
GfErrType err = GF_NOERR;
// do TCR remove
@@ -1228,10 +1240,13 @@ GfErrType ThinClientRegion::removeNoThrowEX_remote(
}
GfErrType ThinClientRegion::getAllNoThrow_remote(
- const VectorOfCacheableKey* keys, const HashMapOfCacheablePtr& values,
- const HashMapOfExceptionPtr& exceptions,
- const VectorOfCacheableKeyPtr& resultKeys, bool addToLocalCache,
- const SerializablePtr& aCallbackArgument) {
+ const std::vector<std::shared_ptr<CacheableKey>>* keys,
+ const std::shared_ptr<HashMapOfCacheable>& values,
+ const std::shared_ptr<HashMapOfException>& exceptions,
+ const std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>>&
+ resultKeys,
+ bool addToLocalCache,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
GfErrType err = GF_NOERR;
MapOfUpdateCounters updateCountMap;
int32_t destroyTracker = 0;
@@ -1243,8 +1258,8 @@ GfErrType ThinClientRegion::getAllNoThrow_remote(
destroyTracker = m_entries->addTrackerForAllEntries(updateCountMap, true);
} else {
for (int32_t index = 0; index < keys->size(); ++index) {
- CacheablePtr oldValue;
- const CacheableKeyPtr& key = keys->operator[](index);
+ std::shared_ptr<Cacheable> oldValue;
+ const std::shared_ptr<CacheableKey>& key = keys->operator[](index);
int updateCount =
m_entries->addTrackerForEntry(key, oldValue, true, false, false);
updateCountMap.insert(std::make_pair(key, updateCount));
@@ -1313,9 +1328,9 @@ GfErrType ThinClientRegion::getAllNoThrow_remote(
GfErrType ThinClientRegion::singleHopPutAllNoThrow_remote(
ThinClientPoolDM* tcrdm, const HashMapOfCacheable& map,
- VersionedCacheableObjectPartListPtr& versionedObjPartList,
+ std::shared_ptr<VersionedCacheableObjectPartList>& versionedObjPartList,
std::chrono::milliseconds timeout,
- const SerializablePtr& aCallbackArgument) {
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
LOGDEBUG(" ThinClientRegion::singleHopPutAllNoThrow_remote map size = %d",
map.size());
auto region = shared_from_this();
@@ -1327,7 +1342,7 @@ GfErrType ThinClientRegion::singleHopPutAllNoThrow_remote(
* If locationMap is nullptr try the old, existing putAll impl that may take
* multiple n/w hops
*/
- auto userKeys = VectorOfCacheableKey();
+ auto userKeys = std::vector<std::shared_ptr<CacheableKey>> ();
for (const auto& iter : map) {
userKeys.push_back(iter.first);
}
@@ -1352,8 +1367,9 @@ GfErrType ThinClientRegion::singleHopPutAllNoThrow_remote(
/*Step-2
* a. create vector of PutAllWork
- * b. locationMap<BucketServerLocationPtr, VectorOfCacheableKeyPtr>.
- * Create server specific filteredMap/subMap by populating all keys
+ * b. locationMap<std::shared_ptr<BucketServerLocation>,
+ * std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>> >>. Create
+ * server specific filteredMap/subMap by populating all keys
* (locationIter.second()) and its corr. values from the user Map.
* c. create new instance of PutAllWork, i.e worker with required params.
* //TODO:: Add details of each parameter later
@@ -1400,12 +1416,13 @@ GfErrType ThinClientRegion::singleHopPutAllNoThrow_remote(
* Step::3
* a. Iterate over all vector of putAllWorkers and populate worker specific
* information into the HashMap
- * resultMap<BucketServerLocationPtr, SerializablePtr>, 2nd part, Value can
- * be a VersionedCacheableObjectPartListPtr or
- * PutAllPartialResultServerExceptionPtr.
- * failedServers<BucketServerLocationPtr, CacheableInt32Ptr>, 2nd part,
- * Value is a ErrorCode.
- * b. delete the worker
+ * resultMap<std::shared_ptr<BucketServerLocation>,
+ * std::shared_ptr<Serializable>>, 2nd part, Value can be a
+ * std::shared_ptr<VersionedCacheableObjectPartList> or
+ * std::shared_ptr<PutAllPartialResultServerException>.
+ * failedServers<std::shared_ptr<BucketServerLocation>,
+ * std::shared_ptr<CacheableInt32>>, 2nd part, Value is a ErrorCode. b. delete
+ * the worker
*/
auto resultMap = ResultMap();
auto failedServers = FailedServersMap();
@@ -1454,10 +1471,10 @@ GfErrType ThinClientRegion::singleHopPutAllNoThrow_remote(
}
/**
* Step:4
- * a. create instance of PutAllPartialResultPtr with total size= map.size()
- * b. Iterate over the resultMap and value for the particular serverlocation
- * is of type VersionedCacheableObjectPartList add keys and versions.
- * C. ToDO:: what if the value in the resultMap is of type
+ * a. create instance of std::shared_ptr<PutAllPartialResult> with total size=
+ * map.size() b. Iterate over the resultMap and value for the particular
+ * serverlocation is of type VersionedCacheableObjectPartList add keys and
+ * versions. C. ToDO:: what if the value in the resultMap is of type
* PutAllPartialResultServerException
*/
ACE_Recursive_Thread_Mutex responseLock;
@@ -1507,8 +1524,8 @@ GfErrType ThinClientRegion::singleHopPutAllNoThrow_remote(
/**
* a. if PutAllPartialResult result does not contains any entry, Iterate over
* locationMap.
- * b. Create VectorOfCacheableKey succeedKeySet, and keep adding set of keys
- * (locationIter.second()) in locationMap for which
+ * b. Create std::vector<std::shared_ptr<CacheableKey>> succeedKeySet, and
+ * keep adding set of keys (locationIter.second()) in locationMap for which
* failedServers->contains(locationIter.first()is false.
*/
@@ -1520,7 +1537,7 @@ GfErrType ThinClientRegion::singleHopPutAllNoThrow_remote(
// then we need to gather up the keys that we know have succeeded so far and
// add them to the partial result set (See bug Id #955)
if (!failedServers.empty()) {
- auto succeedKeySet = std::make_shared<VectorOfCacheableKey>();
+ auto succeedKeySet = std::make_shared<std::vector<std::shared_ptr<CacheableKey>> >();
if (result->getSucceededKeysAndVersions()->size() == 0) {
for (const auto& locationIter : *locationMap) {
if (failedServers.find(locationIter.first) != failedServers.end()) {
@@ -1553,11 +1570,10 @@ GfErrType ThinClientRegion::singleHopPutAllNoThrow_remote(
continue;
}
- VectorOfCacheableKeyPtr failedKeys = nullptr;
- const auto& failedSerInLocMapIter =
- locationMap->find(failedServerIter.first);
- if (failedSerInLocMapIter != locationMap->end()) {
- failedKeys = failedSerInLocMapIter->second;
+ std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>> > failedKeys = nullptr;
+ const auto& failedSerInLocMapIter = locationMap->find(failedServerIter.first);
+ if (failedSerInLocMapIter != locationMap->end()) {
+ failedKeys = failedSerInLocMapIter->second;
}
if (failedKeys == nullptr) {
@@ -1580,7 +1596,7 @@ GfErrType ThinClientRegion::singleHopPutAllNoThrow_remote(
}
}
- VersionedCacheableObjectPartListPtr vcopListPtr;
+ std::shared_ptr<VersionedCacheableObjectPartList> vcopListPtr;
GfErrType errCode = multiHopPutAllNoThrow_remote(
*newSubMap.get(), vcopListPtr, timeout, aCallbackArgument);
if (errCode == GF_NOERR) {
@@ -1594,10 +1610,10 @@ GfErrType ThinClientRegion::singleHopPutAllNoThrow_remote(
} else /*if(errCode != GF_NOERR)*/ {
oneSubMapRetryFailed = true;
const auto& firstKey = newSubMap->begin()->first;
- ExceptionPtr excptPtr = nullptr;
+ std::shared_ptr<Exception> excptPtr = nullptr;
// TODO:: formulat excptPtr from the errCode
- result->saveFailedKey(firstKey, excptPtr);
- error = errCode;
+ result->saveFailedKey(firstKey, excptPtr);
+ error = errCode;
}
}
@@ -1613,9 +1629,9 @@ GfErrType ThinClientRegion::singleHopPutAllNoThrow_remote(
GfErrType ThinClientRegion::multiHopPutAllNoThrow_remote(
const HashMapOfCacheable& map,
- VersionedCacheableObjectPartListPtr& versionedObjPartList,
+ std::shared_ptr<VersionedCacheableObjectPartList>& versionedObjPartList,
std::chrono::milliseconds timeout,
- const SerializablePtr& aCallbackArgument) {
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
// Multiple hop implementation
LOGDEBUG("ThinClientRegion::multiHopPutAllNoThrow_remote ");
auto err = GF_NOERR;
@@ -1678,9 +1694,9 @@ GfErrType ThinClientRegion::multiHopPutAllNoThrow_remote(
GfErrType ThinClientRegion::putAllNoThrow_remote(
const HashMapOfCacheable& map,
- VersionedCacheableObjectPartListPtr& versionedObjPartList,
+ std::shared_ptr<VersionedCacheableObjectPartList>& versionedObjPartList,
std::chrono::milliseconds timeout,
- const SerializablePtr& aCallbackArgument) {
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
LOGDEBUG("ThinClientRegion::putAllNoThrow_remote");
auto poolDM = dynamic_cast<ThinClientPoolDM*>(m_tcrdm);
@@ -1703,12 +1719,13 @@ GfErrType ThinClientRegion::putAllNoThrow_remote(
}
GfErrType ThinClientRegion::singleHopRemoveAllNoThrow_remote(
- ThinClientPoolDM* tcrdm, const VectorOfCacheableKey& keys,
- VersionedCacheableObjectPartListPtr& versionedObjPartList,
- const SerializablePtr& aCallbackArgument) {
+ ThinClientPoolDM* tcrdm,
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ std::shared_ptr<VersionedCacheableObjectPartList>& versionedObjPartList,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
LOGDEBUG(" ThinClientRegion::singleHopRemoveAllNoThrow_remote keys size = %d",
keys.size());
- RegionPtr region = shared_from_this();
+ auto region = shared_from_this();
GfErrType error = GF_NOERR;
auto locationMap = tcrdm->getClientMetaDataService()->getServerToFilterMap(
@@ -1727,8 +1744,9 @@ GfErrType ThinClientRegion::singleHopRemoveAllNoThrow_remote(
/*Step-2
* a. create vector of RemoveAllWork
- * b. locationMap<BucketServerLocationPtr, VectorOfCacheableKeyPtr>.
- * Create server specific filteredMap/subMap by populating all keys
+ * b. locationMap<std::shared_ptr<BucketServerLocation>,
+ * std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>> >>. Create
+ * server specific filteredMap/subMap by populating all keys
* (locationIter.second()) and its corr. values from the user Map.
* c. create new instance of RemoveAllWork, i.e worker with required params.
* //TODO:: Add details of each parameter later
@@ -1762,12 +1780,13 @@ GfErrType ThinClientRegion::singleHopRemoveAllNoThrow_remote(
* Step::3
* a. Iterate over all vector of putAllWorkers and populate worker specific
* information into the HashMap
- * resultMap<BucketServerLocationPtr, SerializablePtr>, 2nd part, Value can
- * be a VersionedCacheableObjectPartListPtr or
- * PutAllPartialResultServerExceptionPtr.
- * failedServers<BucketServerLocationPtr, CacheableInt32Ptr>, 2nd part,
- * Value is a ErrorCode.
- * b. delete the worker
+ * resultMap<std::shared_ptr<BucketServerLocation>,
+ * std::shared_ptr<Serializable>>, 2nd part, Value can be a
+ * std::shared_ptr<VersionedCacheableObjectPartList> or
+ * std::shared_ptr<PutAllPartialResultServerException>.
+ * failedServers<std::shared_ptr<BucketServerLocation>,
+ * std::shared_ptr<CacheableInt32>>, 2nd part, Value is a ErrorCode. b. delete
+ * the worker
*/
auto resultMap = ResultMap();
auto failedServers = FailedServersMap();
@@ -1804,10 +1823,10 @@ GfErrType ThinClientRegion::singleHopRemoveAllNoThrow_remote(
}
/**
* Step:4
- * a. create instance of PutAllPartialResultPtr with total size= map.size()
- * b. Iterate over the resultMap and value for the particular serverlocation
- * is of type VersionedCacheableObjectPartList add keys and versions.
- * C. ToDO:: what if the value in the resultMap is of type
+ * a. create instance of std::shared_ptr<PutAllPartialResult> with total size=
+ * map.size() b. Iterate over the resultMap and value for the particular
+ * serverlocation is of type VersionedCacheableObjectPartList add keys and
+ * versions. C. ToDO:: what if the value in the resultMap is of type
* PutAllPartialResultServerException
*/
ACE_Recursive_Thread_Mutex responseLock;
@@ -1823,18 +1842,18 @@ GfErrType ThinClientRegion::singleHopRemoveAllNoThrow_remote(
for (const auto& resultMapIter : resultMap) {
const auto& value = resultMapIter.second;
PutAllPartialResultServerException* papException = nullptr;
- VersionedCacheableObjectPartListPtr list = nullptr;
-
- if (const auto papException =
- std::dynamic_pointer_cast<PutAllPartialResultServerException>(
- value)) {
- // PutAllPartialResultServerException CASE:: value in resultMap is of type
- // PutAllPartialResultServerException.
- // TODO:: Add failedservers.keySet= all fialed servers, i.e list out all
- // keys in map failedServers,
- // that is set view of the keys contained in failedservers map.
- // TODO:: need to read papException and populate PutAllPartialResult.
- result->consolidate(papException->getResult());
+ std::shared_ptr<VersionedCacheableObjectPartList> list = nullptr;
+
+ if (const auto papException =
+ std::dynamic_pointer_cast<PutAllPartialResultServerException>(
+ value)) {
+ // PutAllPartialResultServerException CASE:: value in resultMap is of type
+ // PutAllPartialResultServerException.
+ // TODO:: Add failedservers.keySet= all fialed servers, i.e list out all
+ // keys in map failedServers,
+ // that is set view of the keys contained in failedservers map.
+ // TODO:: need to read papException and populate PutAllPartialResult.
+ result->consolidate(papException->getResult());
} else if (const auto list =
std::dynamic_pointer_cast<VersionedCacheableObjectPartList>(
value)) {
@@ -1859,8 +1878,8 @@ GfErrType ThinClientRegion::singleHopRemoveAllNoThrow_remote(
/**
* a. if PutAllPartialResult result does not contains any entry, Iterate over
* locationMap.
- * b. Create VectorOfCacheableKey succeedKeySet, and keep adding set of keys
- * (locationIter.second()) in locationMap for which
+ * b. Create std::vector<std::shared_ptr<CacheableKey>> succeedKeySet, and
+ * keep adding set of keys (locationIter.second()) in locationMap for which
* failedServers->contains(locationIter.first()is false.
*/
@@ -1872,7 +1891,7 @@ GfErrType ThinClientRegion::singleHopRemoveAllNoThrow_remote(
// then we need to gather up the keys that we know have succeeded so far and
// add them to the partial result set (See bug Id #955)
if (!failedServers.empty()) {
- auto succeedKeySet = std::make_shared<VectorOfCacheableKey>();
+ auto succeedKeySet = std::make_shared<std::vector<std::shared_ptr<CacheableKey>> >();
if (result->getSucceededKeysAndVersions()->size() == 0) {
for (const auto& locationIter : *locationMap) {
if (failedServers.find(locationIter.first) != failedServers.end()) {
@@ -1905,7 +1924,8 @@ GfErrType ThinClientRegion::singleHopRemoveAllNoThrow_remote(
continue;
}
- VectorOfCacheableKeyPtr failedKeys = nullptr;
+ std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>> failedKeys =
+ nullptr;
const auto& failedSerInLocMapIter =
locationMap->find(failedServerIter.first);
if (failedSerInLocMapIter != locationMap->end()) {
@@ -1919,18 +1939,18 @@ GfErrType ThinClientRegion::singleHopRemoveAllNoThrow_remote(
"that is not valid");
}
- VersionedCacheableObjectPartListPtr vcopListPtr;
- PutAllPartialResultServerExceptionPtr papResultServerExc = nullptr;
- GfErrType errCode = multiHopRemoveAllNoThrow_remote(
- *failedKeys, vcopListPtr, aCallbackArgument);
- if (errCode == GF_NOERR) {
- result->addKeysAndVersions(vcopListPtr);
+ std::shared_ptr<VersionedCacheableObjectPartList> vcopListPtr;
+ std::shared_ptr<PutAllPartialResultServerException> papResultServerExc = nullptr;
+ GfErrType errCode = multiHopRemoveAllNoThrow_remote(*failedKeys, vcopListPtr,
+ aCallbackArgument);
+ if (errCode == GF_NOERR) {
+ result->addKeysAndVersions(vcopListPtr);
} else if (errCode == GF_PUTALL_PARTIAL_RESULT_EXCEPTION) {
oneSubMapRetryFailed = true;
error = errCode;
} else /*if(errCode != GF_NOERR)*/ {
oneSubMapRetryFailed = true;
- ExceptionPtr excptPtr = nullptr;
+ std::shared_ptr<Exception> excptPtr = nullptr;
result->saveFailedKey(failedKeys->at(0), excptPtr);
error = errCode;
}
@@ -1946,9 +1966,9 @@ GfErrType ThinClientRegion::singleHopRemoveAllNoThrow_remote(
}
GfErrType ThinClientRegion::multiHopRemoveAllNoThrow_remote(
- const VectorOfCacheableKey& keys,
- VersionedCacheableObjectPartListPtr& versionedObjPartList,
- const SerializablePtr& aCallbackArgument) {
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ std::shared_ptr<VersionedCacheableObjectPartList>& versionedObjPartList,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
// Multiple hop implementation
LOGDEBUG("ThinClientRegion::multiHopRemoveAllNoThrow_remote ");
GfErrType err = GF_NOERR;
@@ -2001,9 +2021,9 @@ GfErrType ThinClientRegion::multiHopRemoveAllNoThrow_remote(
}
GfErrType ThinClientRegion::removeAllNoThrow_remote(
- const VectorOfCacheableKey& keys,
- VersionedCacheableObjectPartListPtr& versionedObjPartList,
- const SerializablePtr& aCallbackArgument) {
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ std::shared_ptr<VersionedCacheableObjectPartList>& versionedObjPartList,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
LOGDEBUG("ThinClientRegion::removeAllNoThrow_remote");
ThinClientPoolDM* poolDM = dynamic_cast<ThinClientPoolDM*>(m_tcrdm);
@@ -2041,11 +2061,11 @@ uint32_t ThinClientRegion::size_remote() {
switch (reply.getMessageType()) {
case TcrMessage::RESPONSE: {
- CacheableInt32Ptr size =
+ auto size =
std::static_pointer_cast<CacheableInt32>(reply.getValue());
- return size->value();
- // LOGINFO("Map is written into remote server at region %s",
- // m_fullPath.c_str());
+ return size->value();
+ // LOGINFO("Map is written into remote server at region %s",
+ // m_fullPath.c_str());
} break;
case TcrMessage::EXCEPTION:
err =
@@ -2104,26 +2124,26 @@ GfErrType ThinClientRegion::registerKeys(TcrEndpoint* endpoint,
endpoint, m_durableInterestListRegexForUpdatesAsInvalidates, true, false);
err = opErr != GF_NOERR ? opErr : err;
- VectorOfCacheableKey keysVec;
+ std::vector<std::shared_ptr<CacheableKey>> keysVec;
InterestResultPolicy interestPolicy =
copyInterestList(keysVec, m_interestList);
opErr = registerKeysNoThrow(keysVec, false, endpoint, false, interestPolicy);
err = opErr != GF_NOERR ? opErr : err;
- VectorOfCacheableKey keysVecForUpdatesAsInvalidates;
+ std::vector<std::shared_ptr<CacheableKey>> keysVecForUpdatesAsInvalidates;
interestPolicy = copyInterestList(keysVecForUpdatesAsInvalidates,
m_interestListForUpdatesAsInvalidates);
opErr = registerKeysNoThrow(keysVecForUpdatesAsInvalidates, false, endpoint,
false, interestPolicy, false);
err = opErr != GF_NOERR ? opErr : err;
- VectorOfCacheableKey keysVecDurable;
+ std::vector<std::shared_ptr<CacheableKey>> keysVecDurable;
interestPolicy = copyInterestList(keysVecDurable, m_durableInterestList);
opErr = registerKeysNoThrow(keysVecDurable, false, endpoint, true,
interestPolicy);
err = opErr != GF_NOERR ? opErr : err;
- VectorOfCacheableKey keysVecDurableForUpdatesAsInvalidates;
+ std::vector<std::shared_ptr<CacheableKey>> keysVecDurableForUpdatesAsInvalidates;
interestPolicy =
copyInterestList(keysVecDurableForUpdatesAsInvalidates,
m_durableInterestListForUpdatesAsInvalidates);
@@ -2134,7 +2154,7 @@ GfErrType ThinClientRegion::registerKeys(TcrEndpoint* endpoint,
if (request != nullptr && request->getRegionName() == m_fullPath &&
(request->getMessageType() == TcrMessage::REGISTER_INTEREST ||
request->getMessageType() == TcrMessage::REGISTER_INTEREST_LIST)) {
- const VectorOfCacheableKey* newKeysVec = request->getKeys();
+ const std::vector<std::shared_ptr<CacheableKey>> * newKeysVec = request->getKeys();
bool isDurable = request->isDurable();
bool receiveValues = request->receiveValues();
if (newKeysVec == nullptr || newKeysVec->empty()) {
@@ -2206,23 +2226,23 @@ GfErrType ThinClientRegion::unregisterKeys() {
unregisterStoredRegex(m_durableInterestListRegexForUpdatesAsInvalidates);
err = opErr != GF_NOERR ? opErr : err;
- VectorOfCacheableKey keysVec;
+ std::vector<std::shared_ptr<CacheableKey>> keysVec;
copyInterestList(keysVec, m_interestList);
opErr = unregisterKeysNoThrow(keysVec, false);
err = opErr != GF_NOERR ? opErr : err;
- VectorOfCacheableKey keysVecDurable;
+ std::vector<std::shared_ptr<CacheableKey>> keysVecDurable;
copyInterestList(keysVecDurable, m_durableInterestList);
opErr = unregisterKeysNoThrow(keysVecDurable, false);
err = opErr != GF_NOERR ? opErr : err;
- VectorOfCacheableKey keysVecForUpdatesAsInvalidates;
+ std::vector<std::shared_ptr<CacheableKey>> keysVecForUpdatesAsInvalidates;
copyInterestList(keysVecForUpdatesAsInvalidates,
m_interestListForUpdatesAsInvalidates);
opErr = unregisterKeysNoThrow(keysVecForUpdatesAsInvalidates, false);
err = opErr != GF_NOERR ? opErr : err;
- VectorOfCacheableKey keysVecDurableForUpdatesAsInvalidates;
+ std::vector<std::shared_ptr<CacheableKey>> keysVecDurableForUpdatesAsInvalidates;
copyInterestList(keysVecDurableForUpdatesAsInvalidates,
m_durableInterestListForUpdatesAsInvalidates);
opErr = unregisterKeysNoThrow(keysVecDurableForUpdatesAsInvalidates, false);
@@ -2232,7 +2252,7 @@ GfErrType ThinClientRegion::unregisterKeys() {
}
GfErrType ThinClientRegion::destroyRegionNoThrow_remote(
- const SerializablePtr& aCallbackArgument) {
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
GfErrType err = GF_NOERR;
// do TCR destroyRegion
@@ -2268,9 +2288,10 @@ GfErrType ThinClientRegion::destroyRegionNoThrow_remote(
}
GfErrType ThinClientRegion::registerKeysNoThrow(
- const VectorOfCacheableKey& keys, bool attemptFailover,
- TcrEndpoint* endpoint, bool isDurable, InterestResultPolicy interestPolicy,
- bool receiveValues, TcrMessageReply* reply) {
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ bool attemptFailover, TcrEndpoint* endpoint, bool isDurable,
+ InterestResultPolicy interestPolicy, bool receiveValues,
+ TcrMessageReply* reply) {
RegionGlobalLocks acquireLocksRedundancy(this, false);
RegionGlobalLocks acquireLocksFailover(this);
CHECK_DESTROY_PENDING_NOTHROW(TryReadGuard);
@@ -2340,7 +2361,7 @@ GfErrType ThinClientRegion::registerKeysNoThrow(
}
GfErrType ThinClientRegion::unregisterKeysNoThrow(
- const VectorOfCacheableKey& keys, bool attemptFailover) {
+ const std::vector<std::shared_ptr<CacheableKey>> & keys, bool attemptFailover) {
RegionGlobalLocks acquireLocksRedundancy(this, false);
RegionGlobalLocks acquireLocksFailover(this);
CHECK_DESTROY_PENDING_NOTHROW(TryReadGuard);
@@ -2376,7 +2397,7 @@ GfErrType ThinClientRegion::unregisterKeysNoThrow(
}
GfErrType ThinClientRegion::unregisterKeysNoThrowLocalDestroy(
- const VectorOfCacheableKey& keys, bool attemptFailover) {
+ const std::vector<std::shared_ptr<CacheableKey>> & keys, bool attemptFailover) {
RegionGlobalLocks acquireLocksRedundancy(this, false);
RegionGlobalLocks acquireLocksFailover(this);
GfErrType err = GF_NOERR;
@@ -2422,7 +2443,8 @@ bool ThinClientRegion::isRegexRegistered(
GfErrType ThinClientRegion::registerRegexNoThrow(
const std::string& regex, bool attemptFailover, TcrEndpoint* endpoint,
- bool isDurable, VectorOfCacheableKeyPtr resultKeys,
+ bool isDurable,
+ std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>> resultKeys,
InterestResultPolicy interestPolicy, bool receiveValues,
TcrMessageReply* reply) {
RegionGlobalLocks acquireLocksRedundancy(this, false);
@@ -2480,7 +2502,7 @@ GfErrType ThinClientRegion::registerRegexNoThrow(
MapOfUpdateCounters trackers;
int32_t destroyTracker = 1;
if (resultKeys == nullptr) {
- resultKeys = VectorOfCacheableKeyPtr(new VectorOfCacheableKey());
+ resultKeys = std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>> >(new std::vector<std::shared_ptr<CacheableKey>> ());
}
// need to check
getAllResultCollector = (new ChunkedGetAllResponse(
@@ -2513,10 +2535,10 @@ GfErrType ThinClientRegion::registerRegexNoThrow(
if (allKeys) {
localInvalidateRegion_internal();
} else {
- const VectorOfCacheableKeyPtr& keys =
- resultCollector != nullptr
- ? resultCollector->getResultKeys()
- : getAllResultCollector->getResultKeys();
+ const std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>>&
+ keys = resultCollector != nullptr
+ ? resultCollector->getResultKeys()
+ : getAllResultCollector->getResultKeys();
if (keys != nullptr) {
localInvalidateForRegisterInterest(*keys);
}
@@ -2602,29 +2624,33 @@ GfErrType ThinClientRegion::unregisterRegexNoThrowLocalDestroy(
return err;
}
-void ThinClientRegion::addKeys(const VectorOfCacheableKey& keys, bool isDurable,
- bool receiveValues,
- InterestResultPolicy interestpolicy) {
- std::unordered_map<CacheableKeyPtr, InterestResultPolicy>& interestList =
- isDurable ? (receiveValues ? m_durableInterestList
- : m_durableInterestListForUpdatesAsInvalidates)
- : (receiveValues ? m_interestList
- : m_interestListForUpdatesAsInvalidates);
+void ThinClientRegion::addKeys(
+ const std::vector<std::shared_ptr<CacheableKey>>& keys, bool isDurable,
+ bool receiveValues, InterestResultPolicy interestpolicy) {
+ std::unordered_map<std::shared_ptr<CacheableKey>, InterestResultPolicy>&
+ interestList =
+ isDurable
+ ? (receiveValues ? m_durableInterestList
+ : m_durableInterestListForUpdatesAsInvalidates)
+ : (receiveValues ? m_interestList
+ : m_interestListForUpdatesAsInvalidates);
for (const auto& key : keys) {
interestList.insert(
- std::pair<CacheableKeyPtr, InterestResultPolicy>(key, interestpolicy));
+ std::pair<std::shared_ptr<CacheableKey>, InterestResultPolicy>(key, interestpolicy));
}
}
void ThinClientRegion::addRegex(const std::string& regex, bool isDurable,
bool receiveValues,
InterestResultPolicy interestpolicy) {
- std::unordered_map<CacheableKeyPtr, InterestResultPolicy>& interestList =
- isDurable ? (receiveValues ? m_durableInterestList
- : m_durableInterestListForUpdatesAsInvalidates)
- : (receiveValues ? m_interestList
- : m_interestListForUpdatesAsInvalidates);
+ std::unordered_map<std::shared_ptr<CacheableKey>, InterestResultPolicy>&
+ interestList =
+ isDurable
+ ? (receiveValues ? m_durableInterestList
+ : m_durableInterestListForUpdatesAsInvalidates)
+ : (receiveValues ? m_interestList
+ : m_interestListForUpdatesAsInvalidates);
std::unordered_map<std::string, InterestResultPolicy>& interestListRegex =
isDurable
@@ -2642,14 +2668,14 @@ void ThinClientRegion::addRegex(const std::string& regex, bool isDurable,
std::pair<std::string, InterestResultPolicy>(regex, interestpolicy));
}
-VectorOfCacheableKey ThinClientRegion::getInterestList() const {
+std::vector<std::shared_ptr<CacheableKey>> ThinClientRegion::getInterestList() const {
ThinClientRegion* nthis = const_cast<ThinClientRegion*>(this);
RegionGlobalLocks acquireLocksRedundancy(nthis, false);
RegionGlobalLocks acquireLocksFailover(nthis);
CHECK_DESTROY_PENDING(TryReadGuard, getInterestList);
ACE_Guard<ACE_Recursive_Thread_Mutex> keysGuard(nthis->m_keysLock);
- VectorOfCacheableKey vlist;
+ std::vector<std::shared_ptr<CacheableKey>> vlist;
std::transform(std::begin(m_durableInterestList),
std::end(m_durableInterestList), std::back_inserter(vlist),
@@ -2664,14 +2690,14 @@ VectorOfCacheableKey ThinClientRegion::getInterestList() const {
return vlist;
}
-VectorOfCacheableString ThinClientRegion::getInterestListRegex() const {
+std::vector<std::shared_ptr<CacheableString>> ThinClientRegion::getInterestListRegex() const {
ThinClientRegion* nthis = const_cast<ThinClientRegion*>(this);
RegionGlobalLocks acquireLocksRedundancy(nthis, false);
RegionGlobalLocks acquireLocksFailover(nthis);
CHECK_DESTROY_PENDING(TryReadGuard, getInterestListRegex);
ACE_Guard<ACE_Recursive_Thread_Mutex> keysGuard(nthis->m_keysLock);
- VectorOfCacheableString vlist;
+ std::vector<std::shared_ptr<CacheableString>> vlist;
std::transform(std::begin(m_durableInterestListRegex),
std::end(m_durableInterestListRegex),
@@ -2691,7 +2717,7 @@ VectorOfCacheableString ThinClientRegion::getInterestListRegex() const {
GfErrType ThinClientRegion::clientNotificationHandler(TcrMessage& msg) {
GfErrType err = GF_NOERR;
- CacheablePtr oldValue;
+ std::shared_ptr<Cacheable> oldValue;
switch (msg.getMessageType()) {
case TcrMessage::LOCAL_INVALIDATE: {
LocalRegion::invalidateNoThrow(
@@ -2841,26 +2867,26 @@ void ThinClientRegion::receiveNotification(TcrMessage* msg) {
}
void ThinClientRegion::localInvalidateRegion_internal() {
- MapEntryImplPtr me;
- CacheablePtr oldValue;
+ std::shared_ptr<MapEntryImpl> me;
+ std::shared_ptr<Cacheable> oldValue;
- VectorOfCacheableKey keysVec = keys_internal();
+ std::vector<std::shared_ptr<CacheableKey>> keysVec = keys_internal();
for (const auto& key : keysVec) {
- VersionTagPtr versionTag;
+ std::shared_ptr<VersionTag> versionTag;
m_entries->invalidate(key, me, oldValue, versionTag);
}
}
void ThinClientRegion::invalidateInterestList(
- std::unordered_map<CacheableKeyPtr, InterestResultPolicy>& interestList) {
- MapEntryImplPtr me;
- CacheablePtr oldValue;
+ std::unordered_map<std::shared_ptr<CacheableKey>, InterestResultPolicy>& interestList) {
+ std::shared_ptr<MapEntryImpl> me;
+ std::shared_ptr<Cacheable> oldValue;
if (!m_regionAttributes->getCachingEnabled()) {
return;
}
for (const auto& iter : interestList) {
- VersionTagPtr versionTag;
+ std::shared_ptr<VersionTag> versionTag;
m_entries->invalidate(iter.first, me, oldValue, versionTag);
}
}
@@ -2879,7 +2905,7 @@ void ThinClientRegion::localInvalidateFailover() {
}
void ThinClientRegion::localInvalidateForRegisterInterest(
- const VectorOfCacheableKey& keys) {
+ const std::vector<std::shared_ptr<CacheableKey>>& keys) {
CHECK_DESTROY_PENDING(TryReadGuard,
ThinClientRegion::localInvalidateForRegisterInterest);
@@ -2887,23 +2913,24 @@ void ThinClientRegion::localInvalidateForRegisterInterest(
return;
}
- CacheablePtr oldValue;
- MapEntryImplPtr me;
+ std::shared_ptr<Cacheable> oldValue;
+ std::shared_ptr<MapEntryImpl> me;
for (const auto& key : keys) {
- VersionTagPtr versionTag;
+ std::shared_ptr<VersionTag> versionTag;
m_entries->invalidate(key, me, oldValue, versionTag);
updateAccessAndModifiedTimeForEntry(me, true);
}
}
InterestResultPolicy ThinClientRegion::copyInterestList(
- VectorOfCacheableKey& keysVector,
- std::unordered_map<CacheableKeyPtr, InterestResultPolicy>& interestList)
- const {
+ std::vector<std::shared_ptr<CacheableKey>>& keysVector,
+ std::unordered_map<std::shared_ptr<CacheableKey>, InterestResultPolicy>&
+ interestList) const {
InterestResultPolicy interestPolicy = InterestResultPolicy::NONE;
- for (std::unordered_map<CacheableKeyPtr, InterestResultPolicy>::const_iterator
- iter = interestList.begin();
+ for (std::unordered_map<std::shared_ptr<CacheableKey>,
+ InterestResultPolicy>::const_iterator iter =
+ interestList.begin();
iter != interestList.end(); ++iter) {
keysVector.push_back(iter->first);
interestPolicy = iter->second;
@@ -2912,8 +2939,9 @@ InterestResultPolicy ThinClientRegion::copyInterestList(
}
void ThinClientRegion::registerInterestGetValues(
- const char* method, const VectorOfCacheableKey* keys,
- const VectorOfCacheableKeyPtr& resultKeys) {
+ const char* method, const std::vector<std::shared_ptr<CacheableKey>>* keys,
+ const std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>>&
+ resultKeys) {
try {
auto values = std::make_shared<HashMapOfCacheable>();
auto exceptions = std::make_shared<HashMapOfException>();
@@ -2932,7 +2960,7 @@ void ThinClientRegion::registerInterestGetValues(
std::string msg(method);
msg += " failed in getting values";
throw EntryNotFoundException(msg.c_str(), nullptr, false,
- ExceptionPtr(ex.clone()));
+ std::shared_ptr<Exception>(ex.clone()));
}
}
@@ -2985,18 +3013,17 @@ void ThinClientRegion::releaseGlobals(bool isFailover) {
}
}
-void ThinClientRegion::executeFunction(const char* func,
- const CacheablePtr& args,
- CacheableVectorPtr routingObj,
- uint8_t getResult, ResultCollectorPtr rc,
- int32_t retryAttempts,
- std::chrono::milliseconds timeout) {
+void ThinClientRegion::executeFunction(
+ const char* func, const std::shared_ptr<Cacheable>& args,
+ std::shared_ptr<CacheableVector> routingObj, uint8_t getResult,
+ std::shared_ptr<ResultCollector> rc, int32_t retryAttempts,
+ std::chrono::milliseconds timeout) {
int32_t attempt = 0;
- CacheableHashSetPtr failedNodes = CacheableHashSet::create();
- // if pools retry attempts are not set then retry once on all available
- // endpoints
- if (retryAttempts == -1) {
- retryAttempts = static_cast<int32_t>(m_tcrdm->getNumberOfEndPoints());
+ auto failedNodes = CacheableHashSet::create();
+ // if pools retry attempts are not set then retry once on all available
+ // endpoints
+ if (retryAttempts == -1) {
+ retryAttempts = static_cast<int32_t>(m_tcrdm->getNumberOfEndPoints());
}
bool reExecute = false;
@@ -3038,7 +3065,7 @@ void ThinClientRegion::executeFunction(const char* func,
if (err == GF_FUNCTION_EXCEPTION) {
reExecute = true;
rc->clearResults();
- CacheableHashSetPtr failedNodesIds(reply.getFailedNode());
+ std::shared_ptr<CacheableHashSet> failedNodesIds(reply.getFailedNode());
failedNodes->clear();
if (failedNodesIds) {
LOGDEBUG(
@@ -3088,11 +3115,12 @@ void ThinClientRegion::executeFunction(const char* func,
failedNodes, timeout);
}
}
-
-CacheableVectorPtr ThinClientRegion::reExecuteFunction(
- const char* func, const CacheablePtr& args, CacheableVectorPtr routingObj,
- uint8_t getResult, ResultCollectorPtr rc, int32_t retryAttempts,
- CacheableHashSetPtr& failedNodes, std::chrono::milliseconds timeout) {
+std::shared_ptr<CacheableVector> ThinClientRegion::reExecuteFunction(
+ const char* func, const std::shared_ptr<Cacheable>& args,
+ std::shared_ptr<CacheableVector> routingObj, uint8_t getResult,
+ std::shared_ptr<ResultCollector> rc, int32_t retryAttempts,
+ std::shared_ptr<CacheableHashSet>& failedNodes,
+ std::chrono::milliseconds timeout) {
int32_t attempt = 0;
bool reExecute = true;
// if pools retry attempts are not set then retry once on all available
@@ -3131,7 +3159,7 @@ CacheableVectorPtr ThinClientRegion::reExecuteFunction(
if (err == GF_FUNCTION_EXCEPTION) {
reExecute = true;
rc->clearResults();
- CacheableHashSetPtr failedNodesIds(reply.getFailedNode());
+ std::shared_ptr<CacheableHashSet> failedNodesIds(reply.getFailedNode());
failedNodes->clear();
if (failedNodesIds) {
LOGDEBUG(
@@ -3167,11 +3195,11 @@ CacheableVectorPtr ThinClientRegion::reExecuteFunction(
}
bool ThinClientRegion::executeFunctionSH(
- const char* func, const CacheablePtr& args, uint8_t getResult,
- ResultCollectorPtr rc,
- const ClientMetadataService::ServerToKeysMapPtr& locationMap,
- CacheableHashSetPtr& failedNodes, std::chrono::milliseconds timeout,
- bool allBuckets) {
+ const char* func, const std::shared_ptr<Cacheable>& args, uint8_t getResult,
+ std::shared_ptr<ResultCollector> rc,
+ const std::shared_ptr<ClientMetadataService::ServerToKeysMap>& locationMap,
+ std::shared_ptr<CacheableHashSet>& failedNodes,
+ std::chrono::milliseconds timeout, bool allBuckets) {
bool reExecute = false;
auto resultCollectorLock = std::make_shared<ACE_Recursive_Thread_Mutex>();
const auto& userAttr =
@@ -3220,7 +3248,7 @@ bool ThinClientRegion::executeFunctionSH(
ACE_Guard<ACE_Recursive_Thread_Mutex> guard(*resultCollectorLock);
rc->clearResults();
}
- CacheableHashSetPtr failedNodeIds(currentReply->getFailedNode());
+ std::shared_ptr<CacheableHashSet> failedNodeIds(currentReply->getFailedNode());
if (failedNodeIds) {
LOGDEBUG(
"ThinClientRegion::executeFunctionSH with GF_FUNCTION_EXCEPTION "
@@ -3300,9 +3328,9 @@ GfErrType ThinClientRegion::getFuncAttributes(const char* func,
return err;
}
-GfErrType ThinClientRegion::getNoThrow_FullObject(EventIdPtr eventId,
- CacheablePtr& fullObject,
- VersionTagPtr& versionTag) {
+GfErrType ThinClientRegion::getNoThrow_FullObject(std::shared_ptr<EventId> eventId,
+ std::shared_ptr<Cacheable>& fullObject,
+ std::shared_ptr<VersionTag>& versionTag) {
TcrMessageRequestEventValue fullObjectMsg(m_cache->createDataOutput(),
eventId);
TcrMessageReply reply(true, nullptr);
@@ -3316,27 +3344,28 @@ GfErrType ThinClientRegion::getNoThrow_FullObject(EventIdPtr eventId,
return err;
}
-void ThinClientRegion::txDestroy(const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument,
- VersionTagPtr versionTag) {
+void ThinClientRegion::txDestroy(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag> versionTag) {
GfErrType err = destroyNoThrowTX(key, aCallbackArgument, -1,
CacheEventFlags::NORMAL, versionTag);
GfErrTypeToException("Region::destroyTX", err);
}
-void ThinClientRegion::txInvalidate(const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument,
- VersionTagPtr versionTag) {
+void ThinClientRegion::txInvalidate(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag> versionTag) {
GfErrType err = invalidateNoThrowTX(key, aCallbackArgument, -1,
CacheEventFlags::NORMAL, versionTag);
GfErrTypeToException("Region::invalidateTX", err);
}
-void ThinClientRegion::txPut(const CacheableKeyPtr& key,
- const CacheablePtr& value,
- const SerializablePtr& aCallbackArgument,
- VersionTagPtr versionTag) {
- CacheablePtr oldValue;
+void ThinClientRegion::txPut(
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag> versionTag) {
+ std::shared_ptr<Cacheable> oldValue;
int64_t sampleStartNanos = startStatOpTime();
GfErrType err = putNoThrowTX(key, value, aCallbackArgument, oldValue, -1,
CacheEventFlags::NORMAL, versionTag);
@@ -3372,7 +3401,7 @@ void ChunkedInterestResponse::handleChunk(const uint8_t* chunk,
}
if (m_resultKeys == nullptr) {
- m_resultKeys = std::make_shared<VectorOfCacheableKey>();
+ m_resultKeys = std::make_shared<std::vector<std::shared_ptr<CacheableKey>> >();
}
serializer::readObject(*input, *m_resultKeys);
m_replyMsg.readSecureObjectPart(*input, false, true, isLastChunkWithSecurity);
@@ -3423,11 +3452,11 @@ void ChunkedQueryResponse::readObjectPartList(DataInput& input,
for (int32_t index = 0; index < len; ++index) {
if (input.read() == 2 /* for exception*/) {
input.advanceCursor(input.readArrayLen()); // skipLen
- CacheableStringPtr exMsgPtr = input.readNativeString();
+ auto exMsgPtr = input.readNativeString();
throw IllegalStateException(exMsgPtr->asChar());
} else {
if (isResultSet) {
- CacheablePtr value;
+ std::shared_ptr<Cacheable> value;
input.readObject(value);
m_queryResults->push_back(value);
} else {
@@ -3479,7 +3508,7 @@ void ChunkedQueryResponse::handleChunk(const uint8_t* chunk, int32_t chunkLen,
// special case for scalar result
partLen = input->readInt32();
input->read();
- CacheableInt32Ptr intVal = input->readObject<CacheableInt32>(true);
+ auto intVal = input->readObject<CacheableInt32>(true);
m_queryResults->push_back(intVal);
// TODO:
@@ -3517,7 +3546,7 @@ void ChunkedQueryResponse::handleChunk(const uint8_t* chunk, int32_t chunkLen,
skip = true;
}
for (int i = 0; i < numOfFldNames; i++) {
- CacheableStringPtr sptr = input->readNativeString();
+ auto sptr = input->readNativeString();
if (!skip) {
m_structFieldNames.push_back(sptr);
}
@@ -3548,7 +3577,7 @@ void ChunkedQueryResponse::handleChunk(const uint8_t* chunk, int32_t chunkLen,
int32_t arraySize = input->readArrayLen();
skipClass(*input);
for (int32_t arrayItem = 0; arrayItem < arraySize; ++arrayItem) {
- SerializablePtr value;
+ std::shared_ptr<Serializable> value;
if (isResultSet) {
input->readObject(value);
m_queryResults->push_back(value);
@@ -3693,8 +3722,8 @@ void ChunkedFunctionExecutionResponse::handleChunk(
}
// Read either object or exception string from sendException.
- SerializablePtr value;
- // CacheablePtr memberId;
+ std::shared_ptr<Serializable> value;
+ // std::shared_ptr<Cacheable> memberId;
if (readPart) {
input->readObject(value);
// TODO: track this memberId for PrFxHa
@@ -3712,7 +3741,7 @@ void ChunkedFunctionExecutionResponse::handleChunk(
value = CacheableString::create("Function exception result.");
}
if (m_rc != nullptr) {
- CacheablePtr result = nullptr;
+ std::shared_ptr<Cacheable> result = nullptr;
if (isExceptionPart) {
result =
std::make_shared<UserFunctionExecutionException>(value->toString());
@@ -3830,7 +3859,7 @@ void ChunkedPutAllResponse::handleChunk(const uint8_t* chunk, int32_t chunkLen,
const auto byte1 = input->read();
m_msg.readSecureObjectPart(*input, false, true, isLastChunkWithSecurity);
- PoolPtr pool = cache->getPoolManager().find(m_msg.getPoolName());
+ auto pool = cache->getPoolManager().find(m_msg.getPoolName());
if (pool != nullptr && !pool->isDestroyed() &&
pool->getPRSingleHopEnabled()) {
ThinClientPoolDM* poolDM = dynamic_cast<ThinClientPoolDM*>(pool.get());
@@ -3893,7 +3922,7 @@ void ChunkedRemoveAllResponse::handleChunk(const uint8_t* chunk,
const auto byte1 = input->read();
m_msg.readSecureObjectPart(*input, false, true, isLastChunkWithSecurity);
- PoolPtr pool = cache->getPoolManager().find(m_msg.getPoolName());
+ auto pool = cache->getPoolManager().find(m_msg.getPoolName());
if (pool != nullptr && !pool->isDestroyed() &&
pool->getPRSingleHopEnabled()) {
ThinClientPoolDM* poolDM = dynamic_cast<ThinClientPoolDM*>(pool.get());
diff --git a/cppcache/src/ThinClientRegion.hpp b/cppcache/src/ThinClientRegion.hpp
index 7c6ccfa..3b6f4d9 100644
--- a/cppcache/src/ThinClientRegion.hpp
+++ b/cppcache/src/ThinClientRegion.hpp
@@ -59,9 +59,10 @@ class CPPCACHE_EXPORT ThinClientRegion : public LocalRegion {
* @brief constructor/initializer/destructor
*/
ThinClientRegion(const std::string& name, CacheImpl* cache,
- const RegionInternalPtr& rPtr,
- const RegionAttributesPtr& attributes,
- const CacheStatisticsPtr& stats, bool shared = false);
+ const std::shared_ptr<RegionInternal>& rPtr,
+ const std::shared_ptr<RegionAttributes>& attributes,
+ const std::shared_ptr<CacheStatistics>& stats,
+ bool shared = false);
virtual void initTCR();
virtual ~ThinClientRegion();
@@ -69,11 +70,12 @@ class CPPCACHE_EXPORT ThinClientRegion : public LocalRegion {
*/
// Unhide function to prevent SunPro Warnings
using RegionInternal::registerKeys;
- virtual void registerKeys(const VectorOfCacheableKey& keys,
- bool isDurable = false,
- bool getInitialValues = false,
- bool receiveValues = true) override;
- virtual void unregisterKeys(const VectorOfCacheableKey& keys) override;
+ virtual void registerKeys(
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ bool isDurable = false, bool getInitialValues = false,
+ bool receiveValues = true) override;
+ virtual void unregisterKeys(
+ const std::vector<std::shared_ptr<CacheableKey>>& keys) override;
virtual void registerAllKeys(bool isDurable = false,
bool getInitialValues = false,
bool receiveValues = true) override;
@@ -82,50 +84,56 @@ class CPPCACHE_EXPORT ThinClientRegion : public LocalRegion {
bool getInitialValues = false,
bool receiveValues = true) override;
virtual void unregisterRegex(const char* regex) override;
- virtual VectorOfCacheableKey serverKeys() override;
- virtual void clear(
- const SerializablePtr& aCallbackArgument = nullptr) override;
+ virtual std::vector<std::shared_ptr<CacheableKey>> serverKeys() override;
+ virtual void clear(const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override;
- virtual SelectResultsPtr query(const char* predicate,
- std::chrono::milliseconds timeout =
- DEFAULT_QUERY_RESPONSE_TIMEOUT) override;
+ virtual std::shared_ptr<SelectResults> query(
+ const char* predicate, std::chrono::milliseconds timeout =
+ DEFAULT_QUERY_RESPONSE_TIMEOUT) override;
virtual bool existsValue(const char* predicate,
std::chrono::milliseconds timeout =
DEFAULT_QUERY_RESPONSE_TIMEOUT) override;
- virtual SerializablePtr selectValue(
- const char* predicate,
- std::chrono::milliseconds timeout =
- DEFAULT_QUERY_RESPONSE_TIMEOUT) override;
+ virtual std::shared_ptr<Serializable> selectValue(
+ const char* predicate, std::chrono::milliseconds timeout =
+ DEFAULT_QUERY_RESPONSE_TIMEOUT) override;
/** @brief Public Methods from RegionInternal
* These are all virtual methods
*/
GfErrType putAllNoThrow_remote(
const HashMapOfCacheable& map,
- VersionedCacheableObjectPartListPtr& versionedObjPartList,
+ std::shared_ptr<VersionedCacheableObjectPartList>& versionedObjPartList,
std::chrono::milliseconds timeout = DEFAULT_RESPONSE_TIMEOUT,
- const SerializablePtr& aCallbackArgument = nullptr) override;
+ const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override;
GfErrType removeAllNoThrow_remote(
- const VectorOfCacheableKey& keys,
- VersionedCacheableObjectPartListPtr& versionedObjPartList,
- const SerializablePtr& aCallbackArgument = nullptr) override;
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ std::shared_ptr<VersionedCacheableObjectPartList>& versionedObjPartList,
+ const std::shared_ptr<Serializable>& aCallbackArgument =
+ nullptr) override;
GfErrType registerKeys(TcrEndpoint* endpoint = nullptr,
const TcrMessage* request = nullptr,
TcrMessageReply* reply = nullptr);
GfErrType unregisterKeys();
- void addKeys(const VectorOfCacheableKey& keys, bool isDurable,
- bool receiveValues, InterestResultPolicy interestpolicy);
+ void addKeys(const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ bool isDurable, bool receiveValues,
+ InterestResultPolicy interestpolicy);
void addRegex(const std::string& regex, bool isDurable, bool receiveValues,
InterestResultPolicy interestpolicy);
GfErrType findRegex(const std::string& regex);
void clearRegex(const std::string& regex);
- bool containsKeyOnServer(const CacheableKeyPtr& keyPtr) const override;
- virtual bool containsValueForKey_remote(const CacheableKeyPtr& keyPtr) const override;
- virtual VectorOfCacheableKey getInterestList() const override;
- virtual VectorOfCacheableString getInterestListRegex() const override;
+ bool containsKeyOnServer(
+ const std::shared_ptr<CacheableKey>& keyPtr) const override;
+ virtual bool containsValueForKey_remote(
+ const std::shared_ptr<CacheableKey>& keyPtr) const override;
+ virtual std::vector<std::shared_ptr<CacheableKey>> getInterestList()
+ const override;
+ virtual std::vector<std::shared_ptr<CacheableString>> getInterestListRegex()
+ const override;
/** @brief Public Methods from RegionInternal
* These are all virtual methods
@@ -136,30 +144,33 @@ class CPPCACHE_EXPORT ThinClientRegion : public LocalRegion {
static GfErrType handleServerException(const char* func,
const char* exceptionMsg);
- virtual void acquireGlobals(bool failover)override;
- virtual void releaseGlobals(bool failover)override;
+ virtual void acquireGlobals(bool failover) override;
+ virtual void releaseGlobals(bool failover) override;
void localInvalidateFailover();
inline ThinClientBaseDM* getDistMgr() const { return m_tcrdm; }
- CacheableVectorPtr reExecuteFunction(
- const char* func, const CacheablePtr& args, CacheableVectorPtr routingObj,
- uint8_t getResult, ResultCollectorPtr rc, int32_t retryAttempts,
- CacheableHashSetPtr& failedNodes,
+ std::shared_ptr<CacheableVector> reExecuteFunction(
+ const char* func, const std::shared_ptr<Cacheable>& args,
+ std::shared_ptr<CacheableVector> routingObj, uint8_t getResult,
+ std::shared_ptr<ResultCollector> rc, int32_t retryAttempts,
+ std::shared_ptr<CacheableHashSet>& failedNodes,
std::chrono::milliseconds timeout = DEFAULT_QUERY_RESPONSE_TIMEOUT);
bool executeFunctionSH(
- const char* func, const CacheablePtr& args, uint8_t getResult,
- ResultCollectorPtr rc,
- const ClientMetadataService::ServerToKeysMapPtr& locationMap,
- CacheableHashSetPtr& failedNodes,
+ const char* func, const std::shared_ptr<Cacheable>& args,
+ uint8_t getResult, std::shared_ptr<ResultCollector> rc,
+ const std::shared_ptr<ClientMetadataService::ServerToKeysMap>&
+ locationMap,
+ std::shared_ptr<CacheableHashSet>& failedNodes,
std::chrono::milliseconds timeout = DEFAULT_QUERY_RESPONSE_TIMEOUT,
bool allBuckets = false);
void executeFunction(
- const char* func, const CacheablePtr& args, CacheableVectorPtr routingObj,
- uint8_t getResult, ResultCollectorPtr rc, int32_t retryAttempts,
+ const char* func, const std::shared_ptr<Cacheable>& args,
+ std::shared_ptr<CacheableVector> routingObj, uint8_t getResult,
+ std::shared_ptr<ResultCollector> rc, int32_t retryAttempts,
std::chrono::milliseconds timeout = DEFAULT_QUERY_RESPONSE_TIMEOUT);
GfErrType getFuncAttributes(const char* func, std::vector<int8_t>** attr);
@@ -174,65 +185,79 @@ class CPPCACHE_EXPORT ThinClientRegion : public LocalRegion {
uint32_t size_remote() override;
- virtual void txDestroy(const CacheableKeyPtr& key,
- const SerializablePtr& callBack,
- VersionTagPtr versionTag) override;
- virtual void txInvalidate(const CacheableKeyPtr& key,
- const SerializablePtr& callBack,
- VersionTagPtr versionTag) override;
- virtual void txPut(const CacheableKeyPtr& key, const CacheablePtr& value,
- const SerializablePtr& callBack,
- VersionTagPtr versionTag) override;
+ virtual void txDestroy(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& callBack,
+ std::shared_ptr<VersionTag> versionTag) override;
+ virtual void txInvalidate(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& callBack,
+ std::shared_ptr<VersionTag> versionTag) override;
+ virtual void txPut(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
+ const std::shared_ptr<Serializable>& callBack,
+ std::shared_ptr<VersionTag> versionTag) override;
protected:
/** @brief the methods need to be overloaded in TCR
*/
- GfErrType getNoThrow_remote(const CacheableKeyPtr& keyPtr,
- CacheablePtr& valPtr,
- const SerializablePtr& aCallbackArgument,
- VersionTagPtr& versionTag) override;
- GfErrType putNoThrow_remote(const CacheableKeyPtr& keyPtr,
- const CacheablePtr& cvalue,
- const SerializablePtr& aCallbackArgument,
- VersionTagPtr& versionTag,
- bool checkDelta = true) override;
- GfErrType createNoThrow_remote(const CacheableKeyPtr& keyPtr,
- const CacheablePtr& cvalue,
- const SerializablePtr& aCallbackArgument,
- VersionTagPtr& versionTag) override;
- GfErrType destroyNoThrow_remote(const CacheableKeyPtr& keyPtr,
- const SerializablePtr& aCallbackArgument,
- VersionTagPtr& versionTag) override;
- GfErrType removeNoThrow_remote(const CacheableKeyPtr& keyPtr,
- const CacheablePtr& cvalue,
- const SerializablePtr& aCallbackArgument,
- VersionTagPtr& versionTag) override;
- GfErrType removeNoThrowEX_remote(const CacheableKeyPtr& keyPtr,
- const SerializablePtr& aCallbackArgument,
- VersionTagPtr& versionTag) override;
- GfErrType invalidateNoThrow_remote(const CacheableKeyPtr& keyPtr,
- const SerializablePtr& aCallbackArgument,
- VersionTagPtr& versionTag) override;
+ GfErrType getNoThrow_remote(
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ std::shared_ptr<Cacheable>& valPtr,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag) override;
+ GfErrType putNoThrow_remote(
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Cacheable>& cvalue,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag, bool checkDelta = true) override;
+ GfErrType createNoThrow_remote(
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Cacheable>& cvalue,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag) override;
+ GfErrType destroyNoThrow_remote(
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag) override;
+ GfErrType removeNoThrow_remote(
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Cacheable>& cvalue,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag) override;
+ GfErrType removeNoThrowEX_remote(
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag) override;
+ GfErrType invalidateNoThrow_remote(
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Serializable>& aCallbackArgument,
+ std::shared_ptr<VersionTag>& versionTag) override;
GfErrType getAllNoThrow_remote(
- const VectorOfCacheableKey* keys, const HashMapOfCacheablePtr& values,
- const HashMapOfExceptionPtr& exceptions,
- const VectorOfCacheableKeyPtr& resultKeys, bool addToLocalCache,
- const SerializablePtr& aCallbackArgument) override;
+ const std::vector<std::shared_ptr<CacheableKey>>* keys,
+ const std::shared_ptr<HashMapOfCacheable>& values,
+ const std::shared_ptr<HashMapOfException>& exceptions,
+ const std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>>&
+ resultKeys,
+ bool addToLocalCache,
+ const std::shared_ptr<Serializable>& aCallbackArgument) override;
GfErrType destroyRegionNoThrow_remote(
- const SerializablePtr& aCallbackArgument) override;
+ const std::shared_ptr<Serializable>& aCallbackArgument) override;
GfErrType registerKeysNoThrow(
- const VectorOfCacheableKey& keys, bool attemptFailover = true,
- TcrEndpoint* endpoint = nullptr, bool isDurable = false,
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ bool attemptFailover = true, TcrEndpoint* endpoint = nullptr,
+ bool isDurable = false,
InterestResultPolicy interestPolicy = InterestResultPolicy::NONE,
bool receiveValues = true, TcrMessageReply* reply = nullptr);
- GfErrType unregisterKeysNoThrow(const VectorOfCacheableKey& keys,
- bool attemptFailover = true);
- GfErrType unregisterKeysNoThrowLocalDestroy(const VectorOfCacheableKey& keys,
- bool attemptFailover = true);
+ GfErrType unregisterKeysNoThrow(
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ bool attemptFailover = true);
+ GfErrType unregisterKeysNoThrowLocalDestroy(
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ bool attemptFailover = true);
GfErrType registerRegexNoThrow(
const std::string& regex, bool attemptFailover = true,
TcrEndpoint* endpoint = nullptr, bool isDurable = false,
- VectorOfCacheableKeyPtr resultKeys = nullptr,
+ std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>> resultKeys =
+ nullptr,
InterestResultPolicy interestPolicy = InterestResultPolicy::NONE,
bool receiveValues = true, TcrMessageReply* reply = nullptr);
GfErrType unregisterRegexNoThrow(const std::string& regex,
@@ -244,12 +269,12 @@ class CPPCACHE_EXPORT ThinClientRegion : public LocalRegion {
virtual void localInvalidateRegion_internal();
virtual void localInvalidateForRegisterInterest(
- const VectorOfCacheableKey& keys);
+ const std::vector<std::shared_ptr<CacheableKey>>& keys);
InterestResultPolicy copyInterestList(
- VectorOfCacheableKey& keysVector,
- std::unordered_map<CacheableKeyPtr, InterestResultPolicy>& interestList)
- const;
+ std::vector<std::shared_ptr<CacheableKey>>& keysVector,
+ std::unordered_map<std::shared_ptr<CacheableKey>, InterestResultPolicy>&
+ interestList) const;
virtual void release(bool invokeCallbacks = true) override;
GfErrType unregisterKeysBeforeDestroyRegion() override;
@@ -259,17 +284,18 @@ class CPPCACHE_EXPORT ThinClientRegion : public LocalRegion {
ThinClientBaseDM* m_tcrdm;
ACE_Recursive_Thread_Mutex m_keysLock;
mutable ACE_RW_Thread_Mutex m_rwDestroyLock;
- std::unordered_map<CacheableKeyPtr, InterestResultPolicy> m_interestList;
+ std::unordered_map<std::shared_ptr<CacheableKey>, InterestResultPolicy>
+ m_interestList;
std::unordered_map<std::string, InterestResultPolicy> m_interestListRegex;
- std::unordered_map<CacheableKeyPtr, InterestResultPolicy>
+ std::unordered_map<std::shared_ptr<CacheableKey>, InterestResultPolicy>
m_durableInterestList;
std::unordered_map<std::string, InterestResultPolicy>
m_durableInterestListRegex;
- std::unordered_map<CacheableKeyPtr, InterestResultPolicy>
+ std::unordered_map<std::shared_ptr<CacheableKey>, InterestResultPolicy>
m_interestListForUpdatesAsInvalidates;
std::unordered_map<std::string, InterestResultPolicy>
m_interestListRegexForUpdatesAsInvalidates;
- std::unordered_map<CacheableKeyPtr, InterestResultPolicy>
+ std::unordered_map<std::shared_ptr<CacheableKey>, InterestResultPolicy>
m_durableInterestListForUpdatesAsInvalidates;
std::unordered_map<std::string, InterestResultPolicy>
m_durableInterestListRegexForUpdatesAsInvalidates;
@@ -297,50 +323,58 @@ class CPPCACHE_EXPORT ThinClientRegion : public LocalRegion {
GfErrType unregisterStoredRegexLocalDestroy(
std::unordered_map<std::string, InterestResultPolicy>& interestListRegex);
void invalidateInterestList(
- std::unordered_map<CacheableKeyPtr, InterestResultPolicy>& interestList);
- GfErrType createOnServer(const CacheableKeyPtr& keyPtr,
- const CacheablePtr& cvalue,
- const SerializablePtr& aCallbackArgument);
+ std::unordered_map<std::shared_ptr<CacheableKey>, InterestResultPolicy>&
+ interestList);
+ GfErrType createOnServer(
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<Cacheable>& cvalue,
+ const std::shared_ptr<Serializable>& aCallbackArgument);
// method to get the values for a register interest
- void registerInterestGetValues(const char* method,
- const VectorOfCacheableKey* keys,
- const VectorOfCacheableKeyPtr& resultKeys);
- GfErrType getNoThrow_FullObject(EventIdPtr eventId, CacheablePtr& fullObject,
- VersionTagPtr& versionTag) override;
+ void registerInterestGetValues(
+ const char* method,
+ const std::vector<std::shared_ptr<CacheableKey>>* keys,
+ const std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>>&
+ resultKeys);
+ GfErrType getNoThrow_FullObject(
+ std::shared_ptr<EventId> eventId, std::shared_ptr<Cacheable>& fullObject,
+ std::shared_ptr<VersionTag>& versionTag) override;
// Disallow copy constructor and assignment operator.
ThinClientRegion(const ThinClientRegion&);
ThinClientRegion& operator=(const ThinClientRegion&);
GfErrType singleHopPutAllNoThrow_remote(
ThinClientPoolDM* tcrdm, const HashMapOfCacheable& map,
- VersionedCacheableObjectPartListPtr& versionedObjPartList,
+ std::shared_ptr<VersionedCacheableObjectPartList>& versionedObjPartList,
std::chrono::milliseconds timeout = DEFAULT_RESPONSE_TIMEOUT,
- const SerializablePtr& aCallbackArgument = nullptr);
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr);
GfErrType multiHopPutAllNoThrow_remote(
const HashMapOfCacheable& map,
- VersionedCacheableObjectPartListPtr& versionedObjPartList,
+ std::shared_ptr<VersionedCacheableObjectPartList>& versionedObjPartList,
std::chrono::milliseconds timeout = DEFAULT_RESPONSE_TIMEOUT,
- const SerializablePtr& aCallbackArgument = nullptr);
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr);
GfErrType singleHopRemoveAllNoThrow_remote(
- ThinClientPoolDM* tcrdm, const VectorOfCacheableKey& keys,
- VersionedCacheableObjectPartListPtr& versionedObjPartList,
- const SerializablePtr& aCallbackArgument = nullptr);
+ ThinClientPoolDM* tcrdm,
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ std::shared_ptr<VersionedCacheableObjectPartList>& versionedObjPartList,
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr);
GfErrType multiHopRemoveAllNoThrow_remote(
- const VectorOfCacheableKey& keys,
- VersionedCacheableObjectPartListPtr& versionedObjPartList,
- const SerializablePtr& aCallbackArgument = nullptr);
+ const std::vector<std::shared_ptr<CacheableKey>>& keys,
+ std::shared_ptr<VersionedCacheableObjectPartList>& versionedObjPartList,
+ const std::shared_ptr<Serializable>& aCallbackArgument = nullptr);
ACE_RW_Thread_Mutex m_RegionMutex;
bool m_isMetaDataRefreshed;
- typedef std::unordered_map<BucketServerLocationPtr, SerializablePtr,
- dereference_hash<BucketServerLocationPtr>,
- dereference_equal_to<BucketServerLocationPtr>>
+ typedef std::unordered_map<
+ std::shared_ptr<BucketServerLocation>, std::shared_ptr<Serializable>,
+ dereference_hash<std::shared_ptr<BucketServerLocation>>,
+ dereference_equal_to<std::shared_ptr<BucketServerLocation>>>
ResultMap;
- typedef std::unordered_map<BucketServerLocationPtr, CacheableInt32Ptr,
- dereference_hash<BucketServerLocationPtr>,
- dereference_equal_to<BucketServerLocationPtr>>
+ typedef std::unordered_map<
+ std::shared_ptr<BucketServerLocation>, std::shared_ptr<CacheableInt32>,
+ dereference_hash<std::shared_ptr<BucketServerLocation>>,
+ dereference_equal_to<std::shared_ptr<BucketServerLocation>>>
FailedServersMap;
};
@@ -355,22 +389,25 @@ class ChunkedInterestResponse : public TcrChunkedResult {
private:
TcrMessage& m_msg;
TcrMessage& m_replyMsg;
- VectorOfCacheableKeyPtr m_resultKeys;
+ std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>> m_resultKeys;
// disabled
ChunkedInterestResponse(const ChunkedInterestResponse&);
ChunkedInterestResponse& operator=(const ChunkedInterestResponse&);
public:
- inline ChunkedInterestResponse(TcrMessage& msg,
- const VectorOfCacheableKeyPtr& resultKeys,
- TcrMessageReply& replyMsg)
+ inline ChunkedInterestResponse(
+ TcrMessage& msg,
+ const std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>>&
+ resultKeys,
+ TcrMessageReply& replyMsg)
: TcrChunkedResult(),
m_msg(msg),
m_replyMsg(replyMsg),
m_resultKeys(resultKeys) {}
- inline const VectorOfCacheableKeyPtr& getResultKeys() const {
+ inline const std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>>&
+ getResultKeys() const {
return m_resultKeys;
}
@@ -379,8 +416,6 @@ class ChunkedInterestResponse : public TcrChunkedResult {
virtual void reset();
};
-typedef std::shared_ptr<ChunkedInterestResponse> ChunkedInterestResponsePtr;
-
/**
* Handle each chunk of the chunked query response.
*
@@ -389,8 +424,8 @@ typedef std::shared_ptr<ChunkedInterestResponse> ChunkedInterestResponsePtr;
class ChunkedQueryResponse : public TcrChunkedResult {
private:
TcrMessage& m_msg;
- CacheableVectorPtr m_queryResults;
- std::vector<CacheableStringPtr> m_structFieldNames;
+ std::shared_ptr<CacheableVector> m_queryResults;
+ std::vector<std::shared_ptr<CacheableString>> m_structFieldNames;
void skipClass(DataInput& input);
@@ -404,11 +439,11 @@ class ChunkedQueryResponse : public TcrChunkedResult {
m_msg(msg),
m_queryResults(CacheableVector::create()) {}
- inline const CacheableVectorPtr& getQueryResults() const {
+ inline const std::shared_ptr<CacheableVector>& getQueryResults() const {
return m_queryResults;
}
- inline const std::vector<CacheableStringPtr>& getStructFieldNames() const {
+ inline const std::vector<std::shared_ptr<CacheableString>>& getStructFieldNames() const {
return m_structFieldNames;
}
@@ -419,7 +454,6 @@ class ChunkedQueryResponse : public TcrChunkedResult {
void readObjectPartList(DataInput& input, bool isResultSet);
};
-typedef std::shared_ptr<ChunkedQueryResponse> ChunkedQueryResponsePtr;
/**
* Handle each chunk of the chunked function execution response.
*
@@ -428,9 +462,9 @@ typedef std::shared_ptr<ChunkedQueryResponse> ChunkedQueryResponsePtr;
class ChunkedFunctionExecutionResponse : public TcrChunkedResult {
private:
TcrMessage& m_msg;
- // CacheableVectorPtr m_functionExecutionResults;
+ // std::shared_ptr<CacheableVector> m_functionExecutionResults;
bool m_getResult;
- ResultCollectorPtr m_rc;
+ std::shared_ptr<ResultCollector> m_rc;
std::shared_ptr<ACE_Recursive_Thread_Mutex> m_resultCollectorLock;
// disabled
@@ -440,11 +474,11 @@ class ChunkedFunctionExecutionResponse : public TcrChunkedResult {
public:
inline ChunkedFunctionExecutionResponse(TcrMessage& msg, bool getResult,
- ResultCollectorPtr rc)
+ std::shared_ptr<ResultCollector> rc)
: TcrChunkedResult(), m_msg(msg), m_getResult(getResult), m_rc(rc) {}
inline ChunkedFunctionExecutionResponse(
- TcrMessage& msg, bool getResult, ResultCollectorPtr rc,
+ TcrMessage& msg, bool getResult, std::shared_ptr<ResultCollector> rc,
const std::shared_ptr<ACE_Recursive_Thread_Mutex>& resultCollectorLock)
: TcrChunkedResult(),
m_msg(msg),
@@ -452,7 +486,8 @@ class ChunkedFunctionExecutionResponse : public TcrChunkedResult {
m_rc(rc),
m_resultCollectorLock(resultCollectorLock) {}
- /* inline const CacheableVectorPtr& getFunctionExecutionResults() const
+ /* inline const std::shared_ptr<CacheableVector>&
+ getFunctionExecutionResults() const
{
return m_functionExecutionResults;
}*/
@@ -467,8 +502,6 @@ class ChunkedFunctionExecutionResponse : public TcrChunkedResult {
uint8_t isLastChunkWithSecurity, const Cache* cache);
virtual void reset();
};
-typedef std::shared_ptr<ChunkedFunctionExecutionResponse>
- ChunkedFunctionExecutionResponsePtr;
/**
* Handle each chunk of the chunked getAll response.
@@ -479,10 +512,10 @@ class ChunkedGetAllResponse : public TcrChunkedResult {
private:
TcrMessage& m_msg;
ThinClientRegion* m_region;
- const VectorOfCacheableKey* m_keys;
- HashMapOfCacheablePtr m_values;
- HashMapOfExceptionPtr m_exceptions;
- VectorOfCacheableKeyPtr m_resultKeys;
+ const std::vector<std::shared_ptr<CacheableKey>> * m_keys;
+ std::shared_ptr<HashMapOfCacheable> m_values;
+ std::shared_ptr<HashMapOfException> m_exceptions;
+ std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>> m_resultKeys;
MapOfUpdateCounters& m_trackerMap;
int32_t m_destroyTracker;
bool m_addToLocalCache;
@@ -493,14 +526,15 @@ class ChunkedGetAllResponse : public TcrChunkedResult {
ChunkedGetAllResponse& operator=(const ChunkedGetAllResponse&);
public:
- inline ChunkedGetAllResponse(TcrMessage& msg, ThinClientRegion* region,
- const VectorOfCacheableKey* keys,
- const HashMapOfCacheablePtr& values,
- const HashMapOfExceptionPtr& exceptions,
- const VectorOfCacheableKeyPtr& resultKeys,
- MapOfUpdateCounters& trackerMap,
- int32_t destroyTracker, bool addToLocalCache,
- ACE_Recursive_Thread_Mutex& responseLock)
+ inline ChunkedGetAllResponse(
+ TcrMessage& msg, ThinClientRegion* region,
+ const std::vector<std::shared_ptr<CacheableKey>>* keys,
+ const std::shared_ptr<HashMapOfCacheable>& values,
+ const std::shared_ptr<HashMapOfException>& exceptions,
+ const std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>>&
+ resultKeys,
+ MapOfUpdateCounters& trackerMap, int32_t destroyTracker,
+ bool addToLocalCache, ACE_Recursive_Thread_Mutex& responseLock)
: TcrChunkedResult(),
m_msg(msg),
m_region(region),
@@ -520,32 +554,31 @@ class ChunkedGetAllResponse : public TcrChunkedResult {
void add(const ChunkedGetAllResponse* other);
bool getAddToLocalCache() { return m_addToLocalCache; }
- HashMapOfCacheablePtr getValues() { return m_values; }
- HashMapOfExceptionPtr getExceptions() { return m_exceptions; }
- VectorOfCacheableKeyPtr getResultKeys() { return m_resultKeys; }
+ std::shared_ptr<HashMapOfCacheable> getValues() { return m_values; }
+ std::shared_ptr<HashMapOfException> getExceptions() { return m_exceptions; }
+ std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>> > getResultKeys() { return m_resultKeys; }
MapOfUpdateCounters& getUpdateCounters() { return m_trackerMap; }
ACE_Recursive_Thread_Mutex& getResponseLock() { return m_responseLock; }
};
-typedef std::shared_ptr<ChunkedGetAllResponse> ChunkedGetAllResponsePtr;
-
/**
* Handle each chunk of the chunked putAll response.
*/
class ChunkedPutAllResponse : public TcrChunkedResult {
private:
TcrMessage& m_msg;
- const RegionPtr m_region;
+ const std::shared_ptr<Region> m_region;
ACE_Recursive_Thread_Mutex& m_responseLock;
- VersionedCacheableObjectPartListPtr m_list;
+ std::shared_ptr<VersionedCacheableObjectPartList> m_list;
// disabled
ChunkedPutAllResponse(const ChunkedPutAllResponse&);
ChunkedPutAllResponse& operator=(const ChunkedPutAllResponse&);
public:
- inline ChunkedPutAllResponse(const RegionPtr& region, TcrMessage& msg,
- ACE_Recursive_Thread_Mutex& responseLock,
- VersionedCacheableObjectPartListPtr& list)
+ inline ChunkedPutAllResponse(
+ const std::shared_ptr<Region>& region, TcrMessage& msg,
+ ACE_Recursive_Thread_Mutex& responseLock,
+ std::shared_ptr<VersionedCacheableObjectPartList>& list)
: TcrChunkedResult(),
m_msg(msg),
m_region(region),
@@ -555,29 +588,28 @@ class ChunkedPutAllResponse : public TcrChunkedResult {
virtual void handleChunk(const uint8_t* chunk, int32_t chunkLen,
uint8_t isLastChunkWithSecurity, const Cache* cache);
virtual void reset();
- VersionedCacheableObjectPartListPtr getList() { return m_list; }
+ std::shared_ptr<VersionedCacheableObjectPartList> getList() { return m_list; }
ACE_Recursive_Thread_Mutex& getResponseLock() { return m_responseLock; }
};
-typedef std::shared_ptr<ChunkedPutAllResponse> ChunkedPutAllResponsePtr;
-
/**
* Handle each chunk of the chunked removeAll response.
*/
class ChunkedRemoveAllResponse : public TcrChunkedResult {
private:
TcrMessage& m_msg;
- const RegionPtr m_region;
+ const std::shared_ptr<Region> m_region;
ACE_Recursive_Thread_Mutex& m_responseLock;
- VersionedCacheableObjectPartListPtr m_list;
+ std::shared_ptr<VersionedCacheableObjectPartList> m_list;
// disabled
ChunkedRemoveAllResponse(const ChunkedRemoveAllResponse&);
ChunkedRemoveAllResponse& operator=(const ChunkedRemoveAllResponse&);
public:
- inline ChunkedRemoveAllResponse(const RegionPtr& region, TcrMessage& msg,
- ACE_Recursive_Thread_Mutex& responseLock,
- VersionedCacheableObjectPartListPtr& list)
+ inline ChunkedRemoveAllResponse(
+ const std::shared_ptr<Region>& region, TcrMessage& msg,
+ ACE_Recursive_Thread_Mutex& responseLock,
+ std::shared_ptr<VersionedCacheableObjectPartList>& list)
: TcrChunkedResult(),
m_msg(msg),
m_region(region),
@@ -587,12 +619,10 @@ class ChunkedRemoveAllResponse : public TcrChunkedResult {
virtual void handleChunk(const uint8_t* chunk, int32_t chunkLen,
uint8_t isLastChunkWithSecurity, const Cache* cache);
virtual void reset();
- VersionedCacheableObjectPartListPtr getList() { return m_list; }
+ std::shared_ptr<VersionedCacheableObjectPartList> getList() { return m_list; }
ACE_Recursive_Thread_Mutex& getResponseLock() { return m_responseLock; }
};
-typedef std::shared_ptr<ChunkedRemoveAllResponse> ChunkedRemoveAllResponsePtr;
-
/**
* Handle each chunk of the chunked interest registration response.
*
@@ -602,16 +632,16 @@ class ChunkedKeySetResponse : public TcrChunkedResult {
private:
TcrMessage& m_msg;
TcrMessage& m_replyMsg;
- VectorOfCacheableKey& m_resultKeys;
+ std::vector<std::shared_ptr<CacheableKey>> & m_resultKeys;
// disabled
ChunkedKeySetResponse(const ChunkedKeySetResponse&);
ChunkedKeySetResponse& operator=(const ChunkedKeySetResponse&);
public:
- inline ChunkedKeySetResponse(TcrMessage& msg,
- VectorOfCacheableKey& resultKeys,
- TcrMessageReply& replyMsg)
+ inline ChunkedKeySetResponse(
+ TcrMessage& msg, std::vector<std::shared_ptr<CacheableKey>>& resultKeys,
+ TcrMessageReply& replyMsg)
: TcrChunkedResult(),
m_msg(msg),
m_replyMsg(replyMsg),
@@ -622,12 +652,11 @@ class ChunkedKeySetResponse : public TcrChunkedResult {
virtual void reset();
};
-typedef std::shared_ptr<ChunkedKeySetResponse> ChunkedKeySetResponsePtr;
class ChunkedDurableCQListResponse : public TcrChunkedResult {
private:
TcrMessage& m_msg;
- CacheableArrayListPtr m_resultList;
+ std::shared_ptr<CacheableArrayList> m_resultList;
// disabled
ChunkedDurableCQListResponse(const ChunkedDurableCQListResponse&);
@@ -638,15 +667,13 @@ class ChunkedDurableCQListResponse : public TcrChunkedResult {
: TcrChunkedResult(),
m_msg(msg),
m_resultList(CacheableArrayList::create()) {}
- inline CacheableArrayListPtr getResults() { return m_resultList; }
+ inline std::shared_ptr<CacheableArrayList> getResults() { return m_resultList; }
virtual void handleChunk(const uint8_t* chunk, int32_t chunkLen,
uint8_t isLastChunkWithSecurity, const Cache* cache);
virtual void reset();
};
-typedef std::shared_ptr<ChunkedDurableCQListResponse>
- ChunkedDurableCQListResponsePtr;
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/ThinClientStickyManager.cpp b/cppcache/src/ThinClientStickyManager.cpp
index b8a5c0f..3b2347c 100644
--- a/cppcache/src/ThinClientStickyManager.cpp
+++ b/cppcache/src/ThinClientStickyManager.cpp
@@ -64,7 +64,7 @@ void ThinClientStickyManager::addStickyConnection(TcrConnection* conn) {
if (it != m_stickyConnList.end()) {
oldConn->setAndGetBeingUsed(false, false);
m_stickyConnList.erase(it);
- PoolPtr p = nullptr;
+ std::shared_ptr<Pool> p = nullptr;
(*TssConnectionWrapper::s_geodeTSSConn)->setConnection(nullptr, p);
m_dm->put(oldConn, false);
}
diff --git a/cppcache/src/TombstoneExpiryHandler.cpp b/cppcache/src/TombstoneExpiryHandler.cpp
index 15684cd..8f83b26 100644
--- a/cppcache/src/TombstoneExpiryHandler.cpp
+++ b/cppcache/src/TombstoneExpiryHandler.cpp
@@ -30,7 +30,7 @@
using namespace apache::geode::client;
TombstoneExpiryHandler::TombstoneExpiryHandler(
- TombstoneEntryPtr entryPtr, TombstoneList* tombstoneList,
+ std::shared_ptr<TombstoneEntry> entryPtr, TombstoneList* tombstoneList,
std::chrono::milliseconds duration, CacheImpl* cacheImpl)
: m_entryPtr(entryPtr),
m_duration(duration),
@@ -39,7 +39,7 @@ TombstoneExpiryHandler::TombstoneExpiryHandler(
int TombstoneExpiryHandler::handle_timeout(const ACE_Time_Value& current_time,
const void* arg) {
- CacheableKeyPtr key;
+ std::shared_ptr<CacheableKey> key;
m_entryPtr->getEntry()->getKeyI(key);
int64_t creationTime = m_entryPtr->getTombstoneCreationTime();
int64_t curr_time = static_cast<int64_t>(current_time.get_msec());
@@ -83,7 +83,7 @@ int TombstoneExpiryHandler::handle_close(ACE_HANDLE, ACE_Reactor_Mask) {
}
inline void TombstoneExpiryHandler::DoTheExpirationAction(
- const CacheableKeyPtr& key) {
+ const std::shared_ptr<CacheableKey>& key) {
LOGDEBUG(
"EntryExpiryHandler::DoTheExpirationAction LOCAL_DESTROY "
"for region entry with key %s",
diff --git a/cppcache/src/TombstoneExpiryHandler.hpp b/cppcache/src/TombstoneExpiryHandler.hpp
index 845af17..45e69ee 100644
--- a/cppcache/src/TombstoneExpiryHandler.hpp
+++ b/cppcache/src/TombstoneExpiryHandler.hpp
@@ -45,7 +45,7 @@ class CPPCACHE_EXPORT TombstoneExpiryHandler : public ACE_Event_Handler {
/**
* Constructor
*/
- TombstoneExpiryHandler(TombstoneEntryPtr entryPtr,
+ TombstoneExpiryHandler(std::shared_ptr<TombstoneEntry> entryPtr,
TombstoneList* tombstoneList,
std::chrono::milliseconds duration,
CacheImpl* cacheImpl);
@@ -59,17 +59,19 @@ class CPPCACHE_EXPORT TombstoneExpiryHandler : public ACE_Event_Handler {
*/
int handle_close(ACE_HANDLE handle, ACE_Reactor_Mask close_mask);
- void setTombstoneEntry(TombstoneEntryPtr entryPtr) { m_entryPtr = entryPtr; }
+ void setTombstoneEntry(std::shared_ptr<TombstoneEntry> entryPtr) {
+ m_entryPtr = entryPtr;
+ }
private:
// The entry contained in the tombstone list
- TombstoneEntryPtr m_entryPtr;
+ std::shared_ptr<TombstoneEntry> m_entryPtr;
// Duration after which the task should be reset in case of
// modification.
std::chrono::milliseconds m_duration;
CacheImpl* m_cacheImpl;
// perform the actual expiration action
- void DoTheExpirationAction(const CacheableKeyPtr& key);
+ void DoTheExpirationAction(const std::shared_ptr<CacheableKey>& key);
TombstoneList* m_tombstoneList;
};
diff --git a/cppcache/src/TombstoneList.cpp b/cppcache/src/TombstoneList.cpp
index 51b3ebd..c357e89 100644
--- a/cppcache/src/TombstoneList.cpp
+++ b/cppcache/src/TombstoneList.cpp
@@ -52,7 +52,7 @@ long TombstoneList::getExpiryTask(TombstoneExpiryHandler** handler) {
return id;
}
-void TombstoneList::add(const MapEntryImplPtr& entry,
+void TombstoneList::add(const std::shared_ptr<MapEntryImpl>& entry,
TombstoneExpiryHandler* handler, long taskid) {
// This function is not guarded as all functions of this class are called from
// MapSegment
@@ -62,7 +62,7 @@ void TombstoneList::add(const MapEntryImplPtr& entry,
entry, static_cast<int64_t>(currTime.get_msec()));
handler->setTombstoneEntry(tombstoneEntryPtr);
tombstoneEntryPtr->setHandler(handler);
- CacheableKeyPtr key;
+ std::shared_ptr<CacheableKey> key;
entry->getKeyI(key);
tombstoneEntryPtr->setExpiryTaskId(taskid);
@@ -79,8 +79,9 @@ void TombstoneList::add(const MapEntryImplPtr& entry,
void TombstoneList::reapTombstones(std::map<uint16_t, int64_t>& gcVersions) {
// This function is not guarded as all functions of this class are called from
// MapSegment
- std::unordered_set<CacheableKeyPtr, dereference_hash<CacheableKeyPtr>,
- dereference_equal_to<CacheableKeyPtr>>
+ std::unordered_set<std::shared_ptr<CacheableKey>,
+ dereference_hash<std::shared_ptr<CacheableKey>>,
+ dereference_equal_to<std::shared_ptr<CacheableKey>>>
tobeDeleted;
for (const auto& queIter : m_tombstoneMap) {
auto const& mapIter = gcVersions.find(
@@ -102,7 +103,8 @@ void TombstoneList::reapTombstones(std::map<uint16_t, int64_t>& gcVersions) {
}
// Reaps the tombstones whose keys are specified in the hash set .
-void TombstoneList::reapTombstones(CacheableHashSetPtr removedKeys) {
+void TombstoneList::reapTombstones(
+ std::shared_ptr<CacheableHashSet> removedKeys) {
// This function is not guarded as all functions of this class are called from
// MapSegment
for (auto queIter = removedKeys->begin(); queIter != removedKeys->end();
@@ -111,24 +113,26 @@ void TombstoneList::reapTombstones(CacheableHashSetPtr removedKeys) {
}
}
// Call this when the lock of MapSegment has not been taken
-void TombstoneList::removeEntryFromMapSegment(CacheableKeyPtr key) {
+void TombstoneList::removeEntryFromMapSegment(
+ std::shared_ptr<CacheableKey> key) {
m_mapSegment->removeActualEntry(key, false);
}
// Call this when the lock of MapSegment has already been taken
-void TombstoneList::unguardedRemoveEntryFromMapSegment(CacheableKeyPtr key) {
+void TombstoneList::unguardedRemoveEntryFromMapSegment(
+ std::shared_ptr<CacheableKey> key) {
m_mapSegment->unguardedRemoveActualEntry(key);
}
-bool TombstoneList::exists(const CacheableKeyPtr& key) const {
+bool TombstoneList::exists(const std::shared_ptr<CacheableKey>& key) const {
if (key) {
return m_tombstoneMap.find(key) != m_tombstoneMap.end();
}
return false;
}
-void TombstoneList::eraseEntryFromTombstoneList(const CacheableKeyPtr& key,
- bool cancelTask) {
+void TombstoneList::eraseEntryFromTombstoneList(
+ const std::shared_ptr<CacheableKey>& key, bool cancelTask) {
// This function is not guarded as all functions of this class are called from
// MapSegment
if (exists(key)) {
@@ -146,7 +150,8 @@ void TombstoneList::eraseEntryFromTombstoneList(const CacheableKeyPtr& key,
}
long TombstoneList::eraseEntryFromTombstoneListWithoutCancelTask(
- const CacheableKeyPtr& key, TombstoneExpiryHandler*& handler) {
+ const std::shared_ptr<CacheableKey>& key,
+ TombstoneExpiryHandler*& handler) {
// This function is not guarded as all functions of this class are called from
// MapSegment
long taskid = -1;
diff --git a/cppcache/src/TombstoneList.hpp b/cppcache/src/TombstoneList.hpp
index d549ac7..774e6d5 100644
--- a/cppcache/src/TombstoneList.hpp
+++ b/cppcache/src/TombstoneList.hpp
@@ -39,13 +39,14 @@ class MapSegment;
class TombstoneExpiryHandler;
class TombstoneEntry {
public:
- TombstoneEntry(const MapEntryImplPtr& entry, int64_t tombstoneCreationTime)
+ TombstoneEntry(const std::shared_ptr<MapEntryImpl>& entry,
+ int64_t tombstoneCreationTime)
: m_entry(entry),
m_tombstoneCreationTime(tombstoneCreationTime),
m_expiryTaskId(0),
m_handler(nullptr) {}
virtual ~TombstoneEntry() {}
- MapEntryImplPtr getEntry() { return m_entry; }
+ std::shared_ptr<MapEntryImpl> getEntry() { return m_entry; }
int64_t getTombstoneCreationTime() { return m_tombstoneCreationTime; }
ExpiryTaskManager::id_type getExpiryTaskId() { return m_expiryTaskId; }
void setExpiryTaskId(ExpiryTaskManager::id_type expiryTaskId) {
@@ -55,41 +56,42 @@ class TombstoneEntry {
void setHandler(TombstoneExpiryHandler* handler) { m_handler = handler; };
private:
- MapEntryImplPtr m_entry;
+ std::shared_ptr<MapEntryImpl> m_entry;
int64_t m_tombstoneCreationTime;
ExpiryTaskManager::id_type m_expiryTaskId;
TombstoneExpiryHandler* m_handler;
};
-typedef std::shared_ptr<TombstoneEntry> TombstoneEntryPtr;
class TombstoneList {
public:
TombstoneList(MapSegment* mapSegment, CacheImpl* cacheImpl)
: m_mapSegment(mapSegment), m_cacheImpl(cacheImpl) {}
virtual ~TombstoneList() { cleanUp(); }
- void add(const MapEntryImplPtr& entry, TombstoneExpiryHandler* handler,
- long taskID);
+ void add(const std::shared_ptr<MapEntryImpl>& entry,
+ TombstoneExpiryHandler* handler, long taskID);
// Reaps the tombstones which have been gc'ed on server.
// A map that has identifier for ClientProxyMembershipID as key
// and server version of the tombstone with highest version as the
// value is passed as paramter
void reapTombstones(std::map<uint16_t, int64_t>& gcVersions);
- void reapTombstones(CacheableHashSetPtr removedKeys);
- void eraseEntryFromTombstoneList(const CacheableKeyPtr& key,
+ void reapTombstones(std::shared_ptr<CacheableHashSet> removedKeys);
+ void eraseEntryFromTombstoneList(const std::shared_ptr<CacheableKey>& key,
bool cancelTask = true);
long eraseEntryFromTombstoneListWithoutCancelTask(
- const CacheableKeyPtr& key, TombstoneExpiryHandler*& handler);
+ const std::shared_ptr<CacheableKey>& key,
+ TombstoneExpiryHandler*& handler);
void cleanUp();
long getExpiryTask(TombstoneExpiryHandler** handler);
- bool exists(const CacheableKeyPtr& key) const;
+ bool exists(const std::shared_ptr<CacheableKey>& key) const;
private:
- void removeEntryFromMapSegment(CacheableKeyPtr key);
- void unguardedRemoveEntryFromMapSegment(CacheableKeyPtr key);
- typedef std::unordered_map<CacheableKeyPtr, TombstoneEntryPtr,
- dereference_hash<CacheableKeyPtr>,
- dereference_equal_to<CacheableKeyPtr>>
+ void removeEntryFromMapSegment(std::shared_ptr<CacheableKey> key);
+ void unguardedRemoveEntryFromMapSegment(std::shared_ptr<CacheableKey> key);
+ typedef std::unordered_map<
+ std::shared_ptr<CacheableKey>, std::shared_ptr<TombstoneEntry>,
+ dereference_hash<std::shared_ptr<CacheableKey>>,
+ dereference_equal_to<std::shared_ptr<CacheableKey>>>
TombstoneMap;
TombstoneMap m_tombstoneMap;
ACE_Recursive_Thread_Mutex m_queueLock;
@@ -97,7 +99,6 @@ class TombstoneList {
CacheImpl* m_cacheImpl;
friend class TombstoneExpiryHandler;
};
-typedef std::shared_ptr<TombstoneList> TombstoneListPtr;
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/TrackedMapEntry.cpp b/cppcache/src/TrackedMapEntry.cpp
index 102e40c..dbee5ee 100644
--- a/cppcache/src/TrackedMapEntry.cpp
+++ b/cppcache/src/TrackedMapEntry.cpp
@@ -20,15 +20,15 @@
using namespace apache::geode::client;
-void TrackedMapEntry::getKey(CacheableKeyPtr& result) const {
+void TrackedMapEntry::getKey(std::shared_ptr<CacheableKey>& result) const {
m_entry->getKeyI(result);
}
-void TrackedMapEntry::getValue(CacheablePtr& result) const {
+void TrackedMapEntry::getValue(std::shared_ptr<Cacheable>& result) const {
m_entry->getValueI(result);
}
-void TrackedMapEntry::setValue(const CacheablePtr& value) {
+void TrackedMapEntry::setValue(const std::shared_ptr<Cacheable>& value) {
m_entry->setValueI(value);
}
diff --git a/cppcache/src/TrackedMapEntry.hpp b/cppcache/src/TrackedMapEntry.hpp
index 35879d2..e35b252 100644
--- a/cppcache/src/TrackedMapEntry.hpp
+++ b/cppcache/src/TrackedMapEntry.hpp
@@ -30,17 +30,17 @@ class TrackedMapEntry : public MapEntry {
public:
// Constructor should be invoked only when starting the tracking
// of a MapEntry, so m_trackingNumber is initialized with 1.
- inline TrackedMapEntry(const MapEntryImplPtr& entry, int trackingNumber,
- int updateCount)
- : m_entry(const_cast<MapEntryImplPtr&>(entry)),
+ inline TrackedMapEntry(const std::shared_ptr<MapEntryImpl>& entry,
+ int trackingNumber, int updateCount)
+ : m_entry(const_cast<std::shared_ptr<MapEntryImpl>&>(entry)),
m_trackingNumber(trackingNumber),
m_updateCount(updateCount) {}
virtual ~TrackedMapEntry() {}
- virtual MapEntryImplPtr getImplPtr() { return m_entry; }
+ virtual std::shared_ptr<MapEntryImpl> getImplPtr() { return m_entry; }
- virtual int addTracker(MapEntryPtr& newEntry) {
+ virtual int addTracker(std::shared_ptr<MapEntry>& newEntry) {
++m_trackingNumber;
return m_updateCount;
}
@@ -56,7 +56,7 @@ class TrackedMapEntry : public MapEntry {
return std::make_pair(false, m_trackingNumber);
}
- virtual int incrementUpdateCount(MapEntryPtr& newEntry) {
+ virtual int incrementUpdateCount(std::shared_ptr<MapEntry>& newEntry) {
return ++m_updateCount;
}
@@ -64,16 +64,16 @@ class TrackedMapEntry : public MapEntry {
virtual int getUpdateCount() const { return m_updateCount; }
- virtual void getKey(CacheableKeyPtr& result) const;
- virtual void getValue(CacheablePtr& result) const;
- virtual void setValue(const CacheablePtr& value);
+ virtual void getKey(std::shared_ptr<CacheableKey>& result) const;
+ virtual void getValue(std::shared_ptr<Cacheable>& result) const;
+ virtual void setValue(const std::shared_ptr<Cacheable>& value);
virtual LRUEntryProperties& getLRUProperties();
virtual ExpEntryProperties& getExpProperties();
virtual VersionStamp& getVersionStamp();
virtual void cleanup(const CacheEventFlags eventFlags);
private:
- MapEntryImplPtr m_entry;
+ std::shared_ptr<MapEntryImpl> m_entry;
int m_trackingNumber;
int m_updateCount;
};
diff --git a/cppcache/src/TransactionalOperation.cpp b/cppcache/src/TransactionalOperation.cpp
index 3f21c4d..495c41b 100644
--- a/cppcache/src/TransactionalOperation.cpp
+++ b/cppcache/src/TransactionalOperation.cpp
@@ -32,19 +32,18 @@ namespace apache {
namespace geode {
namespace client {
-TransactionalOperation::TransactionalOperation(ServerRegionOperation op,
- const char* regionName,
- CacheableKeyPtr key,
- VectorOfCacheablePtr arguments)
+TransactionalOperation::TransactionalOperation(
+ ServerRegionOperation op, const char* regionName,
+ std::shared_ptr<CacheableKey> key,
+ std::shared_ptr<std::vector<std::shared_ptr<Cacheable>>> arguments)
: m_operation(op),
m_regionName(regionName),
m_key(key),
m_arguments(arguments) {}
TransactionalOperation::~TransactionalOperation() {}
-
-CacheablePtr TransactionalOperation::replay(Cache* cache) {
- CacheablePtr result = nullptr;
+std::shared_ptr<Cacheable> TransactionalOperation::replay(Cache* cache) {
+ std::shared_ptr<Cacheable> result = nullptr;
switch (m_operation) {
case GF_CONTAINS_KEY:
@@ -64,9 +63,9 @@ CacheablePtr TransactionalOperation::replay(Cache* cache) {
cache->getRegion(m_regionName)->destroy(m_key, m_arguments->at(0));
break;
case GF_EXECUTE_FUNCTION: {
- ExecutionPtr execution;
+ std::shared_ptr<Execution> execution;
if (m_regionName == nullptr) {
- execution = FunctionService::onServer(CachePtr(cache));
+ execution = FunctionService::onServer(std::shared_ptr<Cache>(cache));
} else {
execution = FunctionService::onRegion(cache->getRegion(m_regionName));
}
@@ -94,7 +93,8 @@ CacheablePtr TransactionalOperation::replay(Cache* cache) {
std::static_pointer_cast<RegionInternal>(
cache->getRegion(m_regionName))
->getAll_internal(
- *std::dynamic_pointer_cast<VectorOfCacheableKey>(
+ *std::dynamic_pointer_cast<
+ std::vector<std::shared_ptr<CacheableKey>>>(
m_arguments->at(0)),
nullptr,
std::static_pointer_cast<CacheableBoolean>(m_arguments->at(3))
@@ -115,7 +115,8 @@ CacheablePtr TransactionalOperation::replay(Cache* cache) {
case GF_KEY_SET: {
auto tmp = cache->getRegion(m_regionName)->serverKeys();
auto serverKeys =
- std::dynamic_pointer_cast<VectorOfCacheableKey>(m_arguments->at(0));
+ std::dynamic_pointer_cast<std::vector<std::shared_ptr<CacheableKey>>>(
+ m_arguments->at(0));
serverKeys->insert(serverKeys->end(), tmp.begin(), tmp.end());
break;
}
diff --git a/cppcache/src/TransactionalOperation.hpp b/cppcache/src/TransactionalOperation.hpp
index 3fd9a1e..29248f7 100644
--- a/cppcache/src/TransactionalOperation.hpp
+++ b/cppcache/src/TransactionalOperation.hpp
@@ -29,8 +29,7 @@
#include <geode/geode_globals.hpp>
#include <geode/geode_types.hpp>
#include <geode/Cacheable.hpp>
-#include <geode/VectorT.hpp>
-
+#include <vector>
namespace apache {
namespace geode {
namespace client {
@@ -52,21 +51,20 @@ enum ServerRegionOperation {
GF_PUT_ALL
};
-_GF_PTR_DEF_(TransactionalOperation, TransactionalOperationPtr);
-
+class CacheableKey;
class TransactionalOperation {
public:
TransactionalOperation(ServerRegionOperation op, const char* regionName,
- CacheableKeyPtr key, VectorOfCacheablePtr arguments);
+ std::shared_ptr<CacheableKey> key, std::shared_ptr<std::vector<std::shared_ptr<Cacheable>> > arguments);
virtual ~TransactionalOperation();
- CacheablePtr replay(Cache* cache);
+ std::shared_ptr<Cacheable> replay(Cache* cache);
private:
ServerRegionOperation m_operation;
const char* m_regionName;
- CacheableKeyPtr m_key;
- VectorOfCacheablePtr m_arguments;
+ std::shared_ptr<CacheableKey> m_key;
+ std::shared_ptr<std::vector<std::shared_ptr<Cacheable>> > m_arguments;
};
} // namespace client
} // namespace geode
diff --git a/cppcache/src/TssConnectionWrapper.cpp b/cppcache/src/TssConnectionWrapper.cpp
index 3ec10bc..9c2c545 100644
--- a/cppcache/src/TssConnectionWrapper.cpp
+++ b/cppcache/src/TssConnectionWrapper.cpp
@@ -21,7 +21,7 @@ using namespace apache::geode::client;
ACE_TSS<TssConnectionWrapper>* TssConnectionWrapper::s_geodeTSSConn =
new ACE_TSS<TssConnectionWrapper>();
TssConnectionWrapper::TssConnectionWrapper() {
- PoolPtr p = nullptr;
+ std::shared_ptr<Pool> p = nullptr;
m_pool = p;
m_tcrConn = nullptr;
}
@@ -66,7 +66,7 @@ TcrConnection* TssConnectionWrapper::getSHConnection(TcrEndpoint* ep,
return pw->getSHConnection(ep);
}
-void TssConnectionWrapper::releaseSHConnections(PoolPtr pool) {
+void TssConnectionWrapper::releaseSHConnections(std::shared_ptr<Pool> pool) {
std::string pn(pool->getName());
poolVsEndpointConnMap::iterator iter = m_poolVsEndpointConnMap.find(pn);
PoolWrapper* pw = nullptr;
@@ -113,7 +113,7 @@ PoolWrapper::PoolWrapper() {}
PoolWrapper::~PoolWrapper() {}
-void PoolWrapper::releaseSHConnections(PoolPtr pool) {
+void PoolWrapper::releaseSHConnections(std::shared_ptr<Pool> pool) {
for (EpNameVsConnection::iterator iter = m_EpnameVsConnection.begin();
iter != m_EpnameVsConnection.end(); iter++) {
TcrConnection* tmp = iter->second;
diff --git a/cppcache/src/TssConnectionWrapper.hpp b/cppcache/src/TssConnectionWrapper.hpp
index e808bde..5d91a13 100644
--- a/cppcache/src/TssConnectionWrapper.hpp
+++ b/cppcache/src/TssConnectionWrapper.hpp
@@ -33,7 +33,7 @@ typedef std::map<std::string, TcrConnection*> EpNameVsConnection;
class PoolWrapper {
private:
- PoolPtr m_pool;
+ std::shared_ptr<Pool> m_pool;
EpNameVsConnection m_EpnameVsConnection;
PoolWrapper& operator=(const PoolWrapper&);
PoolWrapper(const PoolWrapper&);
@@ -43,7 +43,7 @@ class PoolWrapper {
void setSHConnection(TcrEndpoint* ep, TcrConnection* conn);
PoolWrapper();
~PoolWrapper();
- void releaseSHConnections(PoolPtr pool);
+ void releaseSHConnections(std::shared_ptr<Pool> pool);
TcrConnection* getAnyConnection();
};
@@ -52,7 +52,7 @@ typedef std::map<std::string, PoolWrapper*> poolVsEndpointConnMap;
class TssConnectionWrapper {
private:
TcrConnection* m_tcrConn;
- PoolPtr m_pool;
+ std::shared_ptr<Pool> m_pool;
poolVsEndpointConnMap m_poolVsEndpointConnMap;
TssConnectionWrapper& operator=(const TssConnectionWrapper&);
TssConnectionWrapper(const TssConnectionWrapper&);
@@ -62,7 +62,7 @@ class TssConnectionWrapper {
static ACE_TSS<TssConnectionWrapper>* s_geodeTSSConn;
TcrConnection* getConnection() { return m_tcrConn; }
TcrConnection* getSHConnection(TcrEndpoint* ep, const char* poolname);
- void setConnection(TcrConnection* conn, const PoolPtr& pool) {
+ void setConnection(TcrConnection* conn, const std::shared_ptr<Pool>& pool) {
m_tcrConn = conn;
m_pool = pool;
}
@@ -70,7 +70,7 @@ class TssConnectionWrapper {
TcrConnection** getConnDoublePtr() { return &m_tcrConn; }
TssConnectionWrapper();
~TssConnectionWrapper();
- void releaseSHConnections(PoolPtr p);
+ void releaseSHConnections(std::shared_ptr<Pool> p);
TcrConnection* getAnyConnection(const char* poolname);
};
} // namespace client
diff --git a/cppcache/src/TypeRegistry.cpp b/cppcache/src/TypeRegistry.cpp
index 0829e73..4e911c0 100644
--- a/cppcache/src/TypeRegistry.cpp
+++ b/cppcache/src/TypeRegistry.cpp
@@ -37,7 +37,8 @@ void TypeRegistry::registerPdxType(TypeFactoryMethodPdx creationFunction) {
->addPdxType(creationFunction);
}
-void TypeRegistry::registerPdxSerializer(PdxSerializerPtr pdxSerializer) {
+void TypeRegistry::registerPdxSerializer(
+ std::shared_ptr<PdxSerializer> pdxSerializer) {
CacheRegionHelper::getCacheImpl(&m_cache)
->getSerializationRegistry()
->setPdxSerializer(pdxSerializer);
diff --git a/cppcache/src/UserAttributes.cpp b/cppcache/src/UserAttributes.cpp
index c94c561..620ed8a 100644
--- a/cppcache/src/UserAttributes.cpp
+++ b/cppcache/src/UserAttributes.cpp
@@ -19,12 +19,13 @@
using namespace apache::geode::client;
-UserAttributes::UserAttributes(PropertiesPtr credentials, PoolPtr pool,
+UserAttributes::UserAttributes(std::shared_ptr<Properties> credentials,
+ std::shared_ptr<Pool> pool,
ProxyCache* proxyCache)
: m_isUserAuthenticated(false), m_pool(pool) {
m_credentials = credentials;
- ProxyCachePtr pcp(proxyCache);
+ std::shared_ptr<ProxyCache> pcp(proxyCache);
m_proxyCache = pcp;
}
@@ -81,8 +82,7 @@ void UserAttributes::unAuthenticateEP(TcrEndpoint* endpoint) {
uca->setUnAuthenticated();
}*/
}
-
-PoolPtr UserAttributes::getPool() { return m_pool; }
+std::shared_ptr<Pool> UserAttributes::getPool() { return m_pool; }
UserConnectionAttributes* UserAttributes::getConnectionAttribute(
TcrEndpoint* ep) {
@@ -113,7 +113,7 @@ bool UserAttributes::isEndpointAuthenticated(TcrEndpoint* ep) {
}
return false;
}
-PropertiesPtr UserAttributes::getCredentials() {
+std::shared_ptr<Properties> UserAttributes::getCredentials() {
if (m_proxyCache->isClosed()) {
throw IllegalStateException("User cache has been closed");
}
@@ -124,25 +124,26 @@ PropertiesPtr UserAttributes::getCredentials() {
}
return m_credentials;
}
-
-ProxyCachePtr UserAttributes::getProxyCache() { return m_proxyCache; }
-
-ACE_TSS<TSSUserAttributesWrapper>
- TSSUserAttributesWrapper::s_geodeTSSUserAttributes;
-
-GuardUserAttribures::GuardUserAttribures(ProxyCachePtr proxyCache) {
- setProxyCache(proxyCache);
-}
-
-void GuardUserAttribures::setProxyCache(ProxyCachePtr proxyCache) {
- m_proxyCache = proxyCache;
- LOGDEBUG("GuardUserAttribures::GuardUserAttribures:");
- if (m_proxyCache != nullptr && !proxyCache->isClosed()) {
- TSSUserAttributesWrapper::s_geodeTSSUserAttributes->setUserAttributes(
- proxyCache->m_userAttributes);
- } else {
- throw CacheClosedException("User Cache has been closed");
- }
+ std::shared_ptr<ProxyCache> UserAttributes::getProxyCache() { return m_proxyCache; }
+
+ ACE_TSS<TSSUserAttributesWrapper>
+ TSSUserAttributesWrapper::s_geodeTSSUserAttributes;
+
+ GuardUserAttribures::GuardUserAttribures(
+ std::shared_ptr<ProxyCache> proxyCache) {
+ setProxyCache(proxyCache);
+ }
+
+ void GuardUserAttribures::setProxyCache(
+ std::shared_ptr<ProxyCache> proxyCache) {
+ m_proxyCache = proxyCache;
+ LOGDEBUG("GuardUserAttribures::GuardUserAttribures:");
+ if (m_proxyCache != nullptr && !proxyCache->isClosed()) {
+ TSSUserAttributesWrapper::s_geodeTSSUserAttributes->setUserAttributes(
+ proxyCache->m_userAttributes);
+ } else {
+ throw CacheClosedException("User Cache has been closed");
+ }
}
GuardUserAttribures::GuardUserAttribures() { m_proxyCache = nullptr; }
diff --git a/cppcache/src/UserAttributes.hpp b/cppcache/src/UserAttributes.hpp
index 3ddfd2a..6f80a40 100644
--- a/cppcache/src/UserAttributes.hpp
+++ b/cppcache/src/UserAttributes.hpp
@@ -31,7 +31,6 @@ namespace apache {
namespace geode {
namespace client {
class ProxyCache;
-typedef std::shared_ptr<ProxyCache> ProxyCachePtr;
class ThinClientPoolDM;
class UserConnectionAttributes {
public:
@@ -74,14 +73,14 @@ class CPPCACHE_EXPORT UserAttributes {
// servers
public:
~UserAttributes();
- UserAttributes(PropertiesPtr credentials, PoolPtr pool,
- ProxyCache* proxyCache);
+ UserAttributes(std::shared_ptr<Properties> credentials,
+ std::shared_ptr<Pool> pool, ProxyCache* proxyCache);
bool isCacheClosed();
- ProxyCachePtr getProxyCache();
+ std::shared_ptr<ProxyCache> getProxyCache();
- PoolPtr getPool();
+ std::shared_ptr<Pool> getPool();
void setConnectionAttributes(TcrEndpoint* endpoint, uint64_t id) {
m_isUserAuthenticated = true;
@@ -96,7 +95,7 @@ class CPPCACHE_EXPORT UserAttributes {
UserConnectionAttributes* getConnectionAttribute();
UserConnectionAttributes* getConnectionAttribute(TcrEndpoint* ep);
- PropertiesPtr getCredentials();
+ std::shared_ptr<Properties> getCredentials();
std::map<std::string, UserConnectionAttributes*>& getUserConnectionServers() {
return m_connectionAttr;
@@ -108,30 +107,28 @@ class CPPCACHE_EXPORT UserAttributes {
private:
std::map<std::string, UserConnectionAttributes*> m_connectionAttr;
- PropertiesPtr m_credentials;
+ std::shared_ptr<Properties> m_credentials;
// ThinClientPoolDM m_pool;
ACE_Recursive_Thread_Mutex m_listLock;
bool m_isUserAuthenticated;
- ProxyCachePtr m_proxyCache;
- PoolPtr m_pool;
+ std::shared_ptr<ProxyCache> m_proxyCache;
+ std::shared_ptr<Pool> m_pool;
// Disallow copy constructor and assignment operator.
UserAttributes(const UserAttributes&);
UserAttributes& operator=(const UserAttributes&);
};
-typedef std::shared_ptr<UserAttributes> UserAttributesPtr;
-
class TSSUserAttributesWrapper {
private:
- UserAttributesPtr m_userAttribute;
+ std::shared_ptr<UserAttributes> m_userAttribute;
TSSUserAttributesWrapper& operator=(const TSSUserAttributesWrapper&);
TSSUserAttributesWrapper(const TSSUserAttributesWrapper&);
public:
static ACE_TSS<TSSUserAttributesWrapper> s_geodeTSSUserAttributes;
- UserAttributesPtr getUserAttributes() { return m_userAttribute; }
- void setUserAttributes(UserAttributesPtr userAttr) {
+ std::shared_ptr<UserAttributes> getUserAttributes() { return m_userAttribute; }
+ void setUserAttributes(std::shared_ptr<UserAttributes> userAttr) {
m_userAttribute = userAttr;
}
TSSUserAttributesWrapper() : m_userAttribute(nullptr) {}
@@ -142,14 +139,14 @@ class GuardUserAttribures {
public:
GuardUserAttribures();
- GuardUserAttribures(ProxyCachePtr proxyCache);
+ GuardUserAttribures(std::shared_ptr<ProxyCache> proxyCache);
- void setProxyCache(ProxyCachePtr proxyCache);
+ void setProxyCache(std::shared_ptr<ProxyCache> proxyCache);
~GuardUserAttribures();
private:
- ProxyCachePtr m_proxyCache;
+ std::shared_ptr<ProxyCache> m_proxyCache;
};
} // namespace client
} // namespace geode
diff --git a/cppcache/src/UserFunctionExecutionException.cpp b/cppcache/src/UserFunctionExecutionException.cpp
index b3de8d0..982f353 100644
--- a/cppcache/src/UserFunctionExecutionException.cpp
+++ b/cppcache/src/UserFunctionExecutionException.cpp
@@ -47,7 +47,7 @@ int8_t UserFunctionExecutionException::typeId() const {
}
UserFunctionExecutionException::UserFunctionExecutionException(
- CacheableStringPtr msg)
+ std::shared_ptr<CacheableString> msg)
: m_message(msg) {}
} // namespace client
} // namespace geode
diff --git a/cppcache/src/Utils.cpp b/cppcache/src/Utils.cpp
index b64e3db..e52968f 100644
--- a/cppcache/src/Utils.cpp
+++ b/cppcache/src/Utils.cpp
@@ -164,10 +164,8 @@ char* Utils::copyString(const char* str) {
}
return resStr;
}
-
-CacheableStringPtr Utils::convertBytesToString(const uint8_t* bytes,
- int32_t length,
- size_t maxLength) {
+std::shared_ptr<CacheableString> Utils::convertBytesToString(
+ const uint8_t* bytes, int32_t length, size_t maxLength) {
if (bytes != nullptr) {
std::string str;
size_t totalBytes = 0;
diff --git a/cppcache/src/Utils.hpp b/cppcache/src/Utils.hpp
index 3e62fb0..675d384 100644
--- a/cppcache/src/Utils.hpp
+++ b/cppcache/src/Utils.hpp
@@ -91,7 +91,8 @@ class CPPCACHE_EXPORT Utils {
str.append(typeIdName);
}
- inline static CacheableStringPtr demangleTypeName(const char* typeIdName) {
+ inline static std::shared_ptr<CacheableString> demangleTypeName(
+ const char* typeIdName) {
#ifdef __GNUC__
size_t len;
char* demangledName = _gnuDemangledName(typeIdName, len);
@@ -107,9 +108,9 @@ class CPPCACHE_EXPORT Utils {
/**
* The only operations that is well defined on the result is "asChar".
*/
- inline static CacheableStringPtr getCacheableKeyString(
- const CacheableKeyPtr& key) {
- CacheableStringPtr result;
+ inline static std::shared_ptr<CacheableString> getCacheableKeyString(
+ const std::shared_ptr<CacheableKey>& key) {
+ std::shared_ptr<CacheableString> result;
if (key != nullptr) {
char* buf;
GF_NEW(buf, char[_GF_MSG_LIMIT + 1]);
@@ -125,12 +126,13 @@ class CPPCACHE_EXPORT Utils {
return result;
}
- static CacheableStringPtr getCacheableString(const CacheablePtr& val) {
+ static std::shared_ptr<CacheableString> getCacheableString(
+ const std::shared_ptr<Cacheable>& val) {
if (val != nullptr) {
if (const auto key = std::dynamic_pointer_cast<CacheableKey>(val)) {
return getCacheableKeyString(key);
} else {
- const CacheableStringPtr& cStr = val->toString();
+ const std::shared_ptr<CacheableString>& cStr = val->toString();
if (cStr != nullptr) {
if (cStr->isCString()) {
return cStr;
@@ -150,7 +152,8 @@ class CPPCACHE_EXPORT Utils {
// Check objectSize() implementation return value and log a warning at most
// once.
- inline static uint32_t checkAndGetObjectSize(const CacheablePtr& theObject) {
+ inline static uint32_t checkAndGetObjectSize(
+ const std::shared_ptr<Cacheable>& theObject) {
uint32_t objectSize = theObject->objectSize();
static bool youHaveBeenWarned = false;
if ((objectSize == 0 || objectSize == (static_cast<uint32_t>(-1))) &&
@@ -186,14 +189,14 @@ class CPPCACHE_EXPORT Utils {
* Convert the byte array to a string as "%d %d ...".
* <code>maxLength</code> as zero implies no limit.
*/
- static CacheableStringPtr convertBytesToString(
+ static std::shared_ptr<CacheableString> convertBytesToString(
const uint8_t* bytes, int32_t length, size_t maxLength = _GF_MSG_LIMIT);
/**
* Convert the byte array to a string as "%d %d ...".
* <code>maxLength</code> as zero implies no limit.
*/
- inline static CacheableStringPtr convertBytesToString(
+ inline static std::shared_ptr<CacheableString> convertBytesToString(
const char* bytes, int32_t length, size_t maxLength = _GF_MSG_LIMIT) {
return convertBytesToString(reinterpret_cast<const uint8_t*>(bytes),
length);
diff --git a/cppcache/src/VersionStamp.cpp b/cppcache/src/VersionStamp.cpp
index 8a95356..1f20648 100644
--- a/cppcache/src/VersionStamp.cpp
+++ b/cppcache/src/VersionStamp.cpp
@@ -27,7 +27,7 @@ namespace apache {
namespace geode {
namespace client {
-void VersionStamp::setVersions(VersionTagPtr versionTag) {
+void VersionStamp::setVersions(std::shared_ptr<VersionTag> versionTag) {
int32_t eVersion = versionTag->getEntryVersion();
m_entryVersionLowBytes = static_cast<uint16_t>(eVersion & 0xffff);
m_entryVersionHighByte = static_cast<uint8_t>((eVersion & 0xff0000) >> 16);
@@ -60,10 +60,9 @@ uint16_t VersionStamp::getMemberId() const { return m_memberID; }
// This is based on the basicprocessVersionTag function of
// AbstractRegionEntry.java
// Any change to the java function should be reflected here as well.
-GfErrType VersionStamp::processVersionTag(const RegionInternal* region,
- const CacheableKeyPtr& keyPtr,
- const VersionTagPtr& tag,
- const bool deltaCheck) const {
+GfErrType VersionStamp::processVersionTag(
+ const RegionInternal* region, const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<VersionTag>& tag, const bool deltaCheck) const {
char key[256];
int16_t keyLen = keyPtr->logString(key, 256);
std::string keystr(key, keyLen);
@@ -78,7 +77,7 @@ GfErrType VersionStamp::processVersionTag(const RegionInternal* region,
GfErrType VersionStamp::checkForConflict(const RegionInternal* region,
const std::string& keystr,
- const VersionTagPtr& tag,
+ const std::shared_ptr<VersionTag>& tag,
const bool deltaCheck) const {
if (getEntryVersion() == 0 && getRegionVersion() == 0 && getMemberId() == 0) {
LOGDEBUG(
@@ -174,11 +173,10 @@ GfErrType VersionStamp::checkForConflict(const RegionInternal* region,
return GF_NOERR;
}
-GfErrType VersionStamp::checkForDeltaConflict(const RegionInternal* region,
- const std::string& keystr,
- const int64_t stampVersion,
- const int64_t tagVersion,
- const VersionTagPtr& tag) const {
+GfErrType VersionStamp::checkForDeltaConflict(
+ const RegionInternal* region, const std::string& keystr,
+ const int64_t stampVersion, const int64_t tagVersion,
+ const std::shared_ptr<VersionTag>& tag) const {
auto memberList = region->getCacheImpl()->getMemberListForVersionStamp();
auto tcRegion = dynamic_cast<const ThinClientRegion*>(region);
ThinClientPoolDM* poolDM = nullptr;
diff --git a/cppcache/src/VersionStamp.hpp b/cppcache/src/VersionStamp.hpp
index 6a58269..3cd2080 100644
--- a/cppcache/src/VersionStamp.hpp
+++ b/cppcache/src/VersionStamp.hpp
@@ -48,7 +48,7 @@ class CPPCACHE_EXPORT VersionStamp {
m_regionVersionLowBytes(rhs.m_regionVersionLowBytes) {}
virtual ~VersionStamp() {}
- void setVersions(VersionTagPtr versionTag);
+ void setVersions(std::shared_ptr<VersionTag> versionTag);
void setVersions(VersionStamp& versionStamp);
int32_t getEntryVersion() const;
int64_t getRegionVersion() const;
@@ -64,8 +64,8 @@ class CPPCACHE_EXPORT VersionStamp {
return *this;
}
GfErrType processVersionTag(const RegionInternal* region,
- const CacheableKeyPtr& keyPtr,
- const VersionTagPtr& tag,
+ const std::shared_ptr<CacheableKey>& keyPtr,
+ const std::shared_ptr<VersionTag>& tag,
const bool deltaCheck) const;
private:
@@ -76,15 +76,14 @@ class CPPCACHE_EXPORT VersionStamp {
uint32_t m_regionVersionLowBytes;
GfErrType checkForConflict(const RegionInternal* region,
const std::string& keystr,
- const VersionTagPtr& tag,
+ const std::shared_ptr<VersionTag>& tag,
const bool deltaCheck) const;
GfErrType checkForDeltaConflict(const RegionInternal* region,
const std::string& keystr,
const int64_t stampVersion,
const int64_t tagVersion,
- const VersionTagPtr& tag) const;
+ const std::shared_ptr<VersionTag>& tag) const;
};
-typedef std::shared_ptr<VersionStamp> VersionStampPtr;
} // namespace client
} // namespace geode
} // namespace apache
diff --git a/cppcache/src/VersionTag.cpp b/cppcache/src/VersionTag.cpp
index cee7f3b..4587be0 100644
--- a/cppcache/src/VersionTag.cpp
+++ b/cppcache/src/VersionTag.cpp
@@ -87,7 +87,7 @@ void VersionTag::readMembers(uint16_t flags, DataInput& input) {
auto internalMemId = std::make_shared<ClientProxyMembershipID>();
internalMemId->readEssentialData(input);
m_internalMemId = m_memberListForVersionStamp.add(
- (DSMemberForVersionStampPtr)internalMemId);
+ (std::shared_ptr<DSMemberForVersionStamp>)internalMemId);
}
if ((flags & HAS_PREVIOUS_MEMBER_ID) != 0) {
if ((flags & DUPLICATE_MEMBER_IDS) != 0) {
diff --git a/cppcache/src/VersionTag.hpp b/cppcache/src/VersionTag.hpp
index dd7479c..41ea573 100644
--- a/cppcache/src/VersionTag.hpp
+++ b/cppcache/src/VersionTag.hpp
@@ -30,7 +30,6 @@ namespace client {
class RegionInternal;
class CacheImpl;
-_GF_PTR_DEF_(VersionTag, VersionTagPtr);
class VersionTag : public Cacheable {
protected:
diff --git a/cppcache/src/VersionedCacheableObjectPartList.cpp b/cppcache/src/VersionedCacheableObjectPartList.cpp
index 37e4d9f..aee1bd6 100644
--- a/cppcache/src/VersionedCacheableObjectPartList.cpp
+++ b/cppcache/src/VersionedCacheableObjectPartList.cpp
@@ -37,13 +37,12 @@ void VersionedCacheableObjectPartList::toData(DataOutput& output) const {
"VersionedCacheableObjectPartList::toData not implemented");
}
-void VersionedCacheableObjectPartList::readObjectPart(int32_t index,
- DataInput& input,
- CacheableKeyPtr keyPtr) {
- CacheableStringPtr exMsgPtr;
- ExceptionPtr ex;
+void VersionedCacheableObjectPartList::readObjectPart(
+ int32_t index, DataInput& input, std::shared_ptr<CacheableKey> keyPtr) {
+ std::shared_ptr<CacheableString> exMsgPtr;
+ std::shared_ptr<Exception> ex;
auto objType = input.read();
- CacheablePtr value;
+ std::shared_ptr<Cacheable> value;
m_byteArray[index] = objType;
bool isException = (objType == 2 ? 1 : 0);
@@ -102,7 +101,7 @@ void VersionedCacheableObjectPartList::fromData(DataInput& input) {
m_regionIsVersioned = (flags & 0x08) == 0x08;
m_serializeValues = (flags & 0x10) == 0x10;
bool persistent = (flags & 0x20) == 0x20;
- CacheableStringPtr exMsgPtr;
+ std::shared_ptr<CacheableString> exMsgPtr;
int32_t len = 0;
bool valuesNULL = false;
int32_t keysOffset = (m_keysOffset != nullptr ? *m_keysOffset : 0);
@@ -119,12 +118,13 @@ void VersionedCacheableObjectPartList::fromData(DataInput& input) {
"data. Returning,");
}
- auto localKeys = std::make_shared<VectorOfCacheableKey>();
+ auto localKeys =
+ std::make_shared<std::vector<std::shared_ptr<CacheableKey>>>();
if (m_hasKeys) {
len = static_cast<int32_t>(input.readUnsignedVL());
for (int32_t index = 0; index < len; ++index) {
- CacheableKeyPtr key = input.readObject<CacheableKey>(true);
+ auto key = input.readObject<CacheableKey>(true);
if (m_resultKeys != nullptr) {
m_resultKeys->push_back(key);
}
@@ -193,18 +193,18 @@ void VersionedCacheableObjectPartList::fromData(DataInput& input) {
*(m_region->getCacheImpl()->getMemberListForVersionStamp());
for (int32_t index = 0; index < len; index++) {
uint8_t entryType = input.read();
- VersionTagPtr versionTag;
+ std::shared_ptr<VersionTag> versionTag;
switch (entryType) {
case FLAG_NULL_TAG: {
break;
}
case FLAG_FULL_TAG: {
if (persistent) {
- versionTag =
- VersionTagPtr(new DiskVersionTag(memberListForVersionStamp));
+ versionTag = std::shared_ptr<VersionTag>(
+ new DiskVersionTag(memberListForVersionStamp));
} else {
- versionTag =
- VersionTagPtr(new VersionTag(memberListForVersionStamp));
+ versionTag = std::shared_ptr<VersionTag>(
+ new VersionTag(memberListForVersionStamp));
}
versionTag->fromData(input);
versionTag->replaceNullMemberId(getEndpointMemId());
@@ -213,11 +213,11 @@ void VersionedCacheableObjectPartList::fromData(DataInput& input) {
case FLAG_TAG_WITH_NEW_ID: {
if (persistent) {
- versionTag =
- VersionTagPtr(new DiskVersionTag(memberListForVersionStamp));
+ versionTag = std::shared_ptr<VersionTag>(
+ new DiskVersionTag(memberListForVersionStamp));
} else {
- versionTag =
- VersionTagPtr(new VersionTag(memberListForVersionStamp));
+ versionTag = std::shared_ptr<VersionTag>(
+ new VersionTag(memberListForVersionStamp));
}
versionTag->fromData(input);
ids.push_back(versionTag->getInternalMemID());
@@ -226,11 +226,11 @@ void VersionedCacheableObjectPartList::fromData(DataInput& input) {
case FLAG_TAG_WITH_NUMBER_ID: {
if (persistent) {
- versionTag =
- VersionTagPtr(new DiskVersionTag(memberListForVersionStamp));
+ versionTag = std::shared_ptr<VersionTag>(
+ new DiskVersionTag(memberListForVersionStamp));
} else {
- versionTag =
- VersionTagPtr(new VersionTag(memberListForVersionStamp));
+ versionTag = std::shared_ptr<VersionTag>(
+ new VersionTag(memberListForVersionStamp));
}
versionTag->fromData(input);
int32_t idNumber = input.readUnsignedVL();
@@ -241,18 +241,18 @@ void VersionedCacheableObjectPartList::fromData(DataInput& input) {
}
m_versionTags[index] = versionTag;
}
- } else { // if consistancyEnabled=false, we need to pass empty or NULLPtr
- // m_versionTags
+ } else { // if consistancyEnabled=false, we need to pass empty or
+ // std::shared_ptr<NULL> m_versionTags
for (int32_t index = 0; index < len; ++index) {
- VersionTagPtr versionTag;
+ std::shared_ptr<VersionTag> versionTag;
m_versionTags[index] = versionTag;
}
}
if (hasObjects) {
- CacheableKeyPtr key;
- VersionTagPtr versionTag;
- CacheablePtr value;
+ std::shared_ptr<CacheableKey> key;
+ std::shared_ptr<VersionTag> versionTag;
+ std::shared_ptr<Cacheable> value;
for (int32_t index = 0; index < len; ++index) {
if (m_keys != nullptr && !m_hasKeys) {
@@ -268,7 +268,7 @@ void VersionedCacheableObjectPartList::fromData(DataInput& input) {
const auto& iter = m_values->find(key);
value = iter == m_values->end() ? nullptr : iter->second;
if (m_byteArray[index] != 3) { // 3 - key not found on server
- CacheablePtr oldValue;
+ std::shared_ptr<Cacheable> oldValue;
if (m_addToLocalCache) {
int updateCount = -1;
versionTag = m_versionTags[index];
diff --git a/cppcache/src/VersionedCacheableObjectPartList.hpp b/cppcache/src/VersionedCacheableObjectPartList.hpp
index df4b10a..312cac4 100644
--- a/cppcache/src/VersionedCacheableObjectPartList.hpp
+++ b/cppcache/src/VersionedCacheableObjectPartList.hpp
@@ -44,21 +44,16 @@ class ThinClientRegion;
*
*
*/
-
-class VersionedCacheableObjectPartList;
-typedef std::shared_ptr<VersionedCacheableObjectPartList>
- VersionedCacheableObjectPartListPtr;
-
class VersionedCacheableObjectPartList : public CacheableObjectPartList {
private:
bool m_regionIsVersioned;
bool m_serializeValues;
bool m_hasTags;
bool m_hasKeys;
- std::vector<VersionTagPtr> m_versionTags;
+ std::vector<std::shared_ptr<VersionTag>> m_versionTags;
std::vector<uint8_t> m_byteArray;
uint16_t m_endpointMemId;
- VectorOfCacheableKeyPtr m_tempKeys;
+ std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>> > m_tempKeys;
ACE_Recursive_Thread_Mutex& m_responseLock;
static const uint8_t FLAG_NULL_TAG;
@@ -66,7 +61,7 @@ class VersionedCacheableObjectPartList : public CacheableObjectPartList {
static const uint8_t FLAG_TAG_WITH_NEW_ID;
static const uint8_t FLAG_TAG_WITH_NUMBER_ID;
- void readObjectPart(int32_t index, DataInput& input, CacheableKeyPtr keyPtr);
+ void readObjectPart(int32_t index, DataInput& input, std::shared_ptr<CacheableKey> keyPtr);
// never implemented.
VersionedCacheableObjectPartList& operator=(
const VersionedCacheableObjectPartList& other);
@@ -77,24 +72,24 @@ class VersionedCacheableObjectPartList : public CacheableObjectPartList {
m_regionIsVersioned = false;
m_serializeValues = false;
m_endpointMemId = 0;
- GF_NEW(m_tempKeys, VectorOfCacheableKey);
+ GF_NEW(m_tempKeys, std::vector<std::shared_ptr<CacheableKey>> );
}*/
public:
- VersionedCacheableObjectPartList(const VectorOfCacheableKey* keys,
- uint32_t* keysOffset,
- const HashMapOfCacheablePtr& values,
- const HashMapOfExceptionPtr& exceptions,
- const VectorOfCacheableKeyPtr& resultKeys,
- ThinClientRegion* region,
- MapOfUpdateCounters* trackerMap,
- int32_t destroyTracker, bool addToLocalCache,
- uint16_t m_dsmemId,
- ACE_Recursive_Thread_Mutex& responseLock)
+ VersionedCacheableObjectPartList(
+ const std::vector<std::shared_ptr<CacheableKey>>* keys,
+ uint32_t* keysOffset, const std::shared_ptr<HashMapOfCacheable>& values,
+ const std::shared_ptr<HashMapOfException>& exceptions,
+ const std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>>>&
+ resultKeys,
+ ThinClientRegion* region, MapOfUpdateCounters* trackerMap,
+ int32_t destroyTracker, bool addToLocalCache, uint16_t m_dsmemId,
+ ACE_Recursive_Thread_Mutex& responseLock)
: CacheableObjectPartList(keys, keysOffset, values, exceptions,
resultKeys, region, trackerMap, destroyTracker,
addToLocalCache),
- m_tempKeys(std::make_shared<VectorOfCacheableKey>()),
+ m_tempKeys(
+ std::make_shared<std::vector<std::shared_ptr<CacheableKey>>>()),
m_responseLock(responseLock) {
m_regionIsVersioned = false;
m_serializeValues = false;
@@ -103,7 +98,7 @@ class VersionedCacheableObjectPartList : public CacheableObjectPartList {
m_hasKeys = false;
}
- VersionedCacheableObjectPartList(VectorOfCacheableKey* keys,
+ VersionedCacheableObjectPartList(std::vector<std::shared_ptr<CacheableKey>> * keys,
int32_t totalMapSize,
ACE_Recursive_Thread_Mutex& responseLock)
: m_tempKeys(keys), m_responseLock(responseLock) {
@@ -128,7 +123,7 @@ class VersionedCacheableObjectPartList : public CacheableObjectPartList {
;
}
- VersionedCacheableObjectPartList(VectorOfCacheableKey* keys,
+ VersionedCacheableObjectPartList(std::vector<std::shared_ptr<CacheableKey>> * keys,
ACE_Recursive_Thread_Mutex& responseLock)
: m_tempKeys(keys), m_responseLock(responseLock) {
m_regionIsVersioned = false;
@@ -139,7 +134,7 @@ class VersionedCacheableObjectPartList : public CacheableObjectPartList {
}
VersionedCacheableObjectPartList(ThinClientRegion* region,
- VectorOfCacheableKey* keys,
+ std::vector<std::shared_ptr<CacheableKey>> * keys,
ACE_Recursive_Thread_Mutex& responseLock)
: CacheableObjectPartList(region),
m_tempKeys(keys),
@@ -163,9 +158,9 @@ class VersionedCacheableObjectPartList : public CacheableObjectPartList {
inline uint16_t getEndpointMemId() { return m_endpointMemId; }
- std::vector<VersionTagPtr>& getVersionedTagptr() { return m_versionTags; }
+ std::vector<std::shared_ptr<VersionTag>>& getVersionedTagptr() { return m_versionTags; }
- void setVersionedTagptr(std::vector<VersionTagPtr>& versionTags) {
+ void setVersionedTagptr(std::vector<std::shared_ptr<VersionTag>>& versionTags) {
m_versionTags = versionTags;
m_hasTags = (m_versionTags.size() > 0);
}
@@ -174,11 +169,12 @@ class VersionedCacheableObjectPartList : public CacheableObjectPartList {
return static_cast<int>(m_versionTags.size());
}
- VectorOfCacheableKeyPtr getSucceededKeys() { return m_tempKeys; }
+ std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>> > getSucceededKeys() { return m_tempKeys; }
inline VersionedCacheableObjectPartList(
uint16_t endpointMemId, ACE_Recursive_Thread_Mutex& responseLock)
- : m_tempKeys(std::make_shared<VectorOfCacheableKey>()),
+ : m_tempKeys(
+ std::make_shared<std::vector<std::shared_ptr<CacheableKey>>>()),
m_responseLock(responseLock) {
m_regionIsVersioned = false;
m_serializeValues = false;
@@ -187,12 +183,13 @@ class VersionedCacheableObjectPartList : public CacheableObjectPartList {
m_hasKeys = false;
}
- void addAll(VersionedCacheableObjectPartListPtr other) {
+ void addAll(std::shared_ptr<VersionedCacheableObjectPartList> other) {
// LOGDEBUG("DEBUG:: COPL.addAll called");
// ACE_Guard< ACE_Recursive_Thread_Mutex > guard( this->m_responseLock );
if (other->m_tempKeys != nullptr) {
if (this->m_tempKeys == nullptr) {
- this->m_tempKeys = std::make_shared<VectorOfCacheableKey>();
+ this->m_tempKeys =
+ std::make_shared<std::vector<std::shared_ptr<CacheableKey>>>();
this->m_hasKeys = true;
const auto size = other->m_tempKeys->size();
for (int i = 0; i < size; i++) {
@@ -238,10 +235,11 @@ class VersionedCacheableObjectPartList : public CacheableObjectPartList {
return -1;
}
- void addAllKeys(VectorOfCacheableKeyPtr keySet) {
+ void addAllKeys(std::shared_ptr<std::vector<std::shared_ptr<CacheableKey>> > keySet) {
if (!this->m_hasKeys) {
this->m_hasKeys = true;
- this->m_tempKeys = std::make_shared<VectorOfCacheableKey>(*keySet);
+ this->m_tempKeys =
+ std::make_shared<std::vector<std::shared_ptr<CacheableKey>>>(*keySet);
} else {
for (int i = 0; i < keySet->size(); i++) {
this->m_tempKeys->push_back(keySet->at(i));
diff --git a/cppcache/src/statistics/HostStatSampler.cpp b/cppcache/src/statistics/HostStatSampler.cpp
index 9e97f62..0ecd1d0 100644
--- a/cppcache/src/statistics/HostStatSampler.cpp
+++ b/cppcache/src/statistics/HostStatSampler.cpp
@@ -545,7 +545,7 @@ void HostStatSampler::putStatsInAdminRegion() {
// Get Values of gets, puts,misses,listCalls,numThreads
static bool initDone = false;
static std::string clientId = "";
- AdminRegionPtr adminRgn = m_statMngr->getAdminRegion();
+ auto adminRgn = m_statMngr->getAdminRegion();
if (adminRgn == nullptr) return;
auto conn_man = adminRgn->getConnectionManager();
if (conn_man->isNetDown()) {
@@ -581,8 +581,8 @@ void HostStatSampler::putStatsInAdminRegion() {
cpuTime = HostStatHelper::getCpuTime();
}
static int numCPU = ACE_OS::num_processors();
- ClientHealthStatsPtr obj = ClientHealthStats::create(
- gets, puts, misses, numListeners, numThreads, cpuTime, numCPU);
+ auto obj = ClientHealthStats::create(gets, puts, misses, numListeners,
+ numThreads, cpuTime, numCPU);
if (clientId.empty()) {
ACE_TCHAR hostName[256];
ACE_OS::hostname(hostName, sizeof(hostName) - 1);
@@ -597,7 +597,7 @@ void HostStatSampler::putStatsInAdminRegion() {
clientId = memId->getDSMemberIdForThinClientUse();
}
- CacheableKeyPtr keyPtr = CacheableString::create(clientId.c_str());
+ auto keyPtr = CacheableString::create(clientId.c_str());
adminRgn->put(keyPtr, obj);
}
}
diff --git a/cppcache/src/statistics/PoolStatsSampler.cpp b/cppcache/src/statistics/PoolStatsSampler.cpp
index 094b59f..f53ca28 100644
--- a/cppcache/src/statistics/PoolStatsSampler.cpp
+++ b/cppcache/src/statistics/PoolStatsSampler.cpp
@@ -115,11 +115,11 @@ void PoolStatsSampler::putStatsInAdminRegion() {
cpuTime = HostStatHelper::getCpuTime();
}
static int numCPU = ACE_OS::num_processors();
- ClientHealthStatsPtr obj = ClientHealthStats::create(
- gets, puts, misses, numListeners, numThreads, cpuTime, numCPU);
+ auto obj = ClientHealthStats::create(gets, puts, misses, numListeners,
+ numThreads, cpuTime, numCPU);
ClientProxyMembershipID* memId = m_distMan->getMembershipId();
clientId = memId->getDSMemberIdForThinClientUse();
- CacheableKeyPtr keyPtr = CacheableString::create(clientId.c_str());
+ auto keyPtr = CacheableString::create(clientId.c_str());
m_adminRegion->put(keyPtr, obj);
}
} catch (const AllConnectionsInUseException&) {
diff --git a/cppcache/src/statistics/StatisticsManager.hpp b/cppcache/src/statistics/StatisticsManager.hpp
index 536bea3..f5f5f5d 100644
--- a/cppcache/src/statistics/StatisticsManager.hpp
+++ b/cppcache/src/statistics/StatisticsManager.hpp
@@ -59,7 +59,7 @@ class StatisticsManager {
// Mutex to lock the list of Stats
ACE_Recursive_Thread_Mutex m_statsListLock;
- AdminRegionPtr m_adminRegion;
+ std::shared_ptr<AdminRegion> m_adminRegion;
std::unique_ptr<GeodeStatisticsFactory> m_statisticsFactory;
@@ -72,11 +72,11 @@ class StatisticsManager {
const std::chrono::seconds durableTimeout,
int64_t statFileLimit = 0, int64_t statDiskSpaceLimit = 0);
- void RegisterAdminRegion(AdminRegionPtr adminRegPtr) {
+ void RegisterAdminRegion(std::shared_ptr<AdminRegion> adminRegPtr) {
m_adminRegion = adminRegPtr;
}
- AdminRegionPtr getAdminRegion() { return m_adminRegion; }
+ std::shared_ptr<AdminRegion> getAdminRegion() { return m_adminRegion; }
void forceSample();
diff --git a/cppcache/test/AttributesFactoryTest.cpp b/cppcache/test/AttributesFactoryTest.cpp
index 1fa375e..993a933 100644
--- a/cppcache/test/AttributesFactoryTest.cpp
+++ b/cppcache/test/AttributesFactoryTest.cpp
@@ -25,7 +25,8 @@ TEST(AttributesFactoryTest, setEntryIdleTimeoutSeconds) {
AttributesFactory attributesFactory;
attributesFactory.setEntryIdleTimeout(ExpirationAction::DESTROY,
std::chrono::seconds(10));
- auto regionAttributes = attributesFactory.createRegionAttributes();
+ std::shared_ptr<RegionAttributes> regionAttributes =
+ attributesFactory.createRegionAttributes();
EXPECT_EQ(std::chrono::seconds(10), regionAttributes->getEntryIdleTimeout());
}
@@ -33,7 +34,8 @@ TEST(AttributesFactoryTest, setEntryTimeToLiveSeconds) {
AttributesFactory attributesFactory;
attributesFactory.setEntryTimeToLive(ExpirationAction::DESTROY,
std::chrono::seconds(10));
- auto regionAttributes = attributesFactory.createRegionAttributes();
+ std::shared_ptr<RegionAttributes> regionAttributes =
+ attributesFactory.createRegionAttributes();
EXPECT_EQ(std::chrono::seconds(10), regionAttributes->getEntryTimeToLive());
}
@@ -41,7 +43,8 @@ TEST(AttributesFactoryTest, setRegionIdleTimeoutSeconds) {
AttributesFactory attributesFactory;
attributesFactory.setRegionIdleTimeout(ExpirationAction::DESTROY,
std::chrono::seconds(10));
- auto regionAttributes = attributesFactory.createRegionAttributes();
+ std::shared_ptr<RegionAttributes> regionAttributes =
+ attributesFactory.createRegionAttributes();
EXPECT_EQ(std::chrono::seconds(10), regionAttributes->getRegionIdleTimeout());
}
@@ -49,6 +52,7 @@ TEST(AttributesFactoryTest, setRegionTimeToLiveSeconds) {
AttributesFactory attributesFactory;
attributesFactory.setRegionTimeToLive(ExpirationAction::DESTROY,
std::chrono::seconds(10));
- auto regionAttributes = attributesFactory.createRegionAttributes();
+ std::shared_ptr<RegionAttributes> regionAttributes =
+ attributesFactory.createRegionAttributes();
EXPECT_EQ(std::chrono::seconds(10), regionAttributes->getRegionTimeToLive());
}
diff --git a/cppcache/test/DataInputTest.cpp b/cppcache/test/DataInputTest.cpp
index 63264bd..311f0f2 100644
--- a/cppcache/test/DataInputTest.cpp
+++ b/cppcache/test/DataInputTest.cpp
@@ -142,16 +142,18 @@ class TestDataInput {
int32_t readNativeInt32() { return m_dataInput.readNativeInt32(); }
- bool readNativeString(CacheableStringPtr &csPtr) {
+ bool readNativeString(std::shared_ptr<CacheableString> &csPtr) {
csPtr = m_dataInput.readNativeString();
return csPtr != nullptr;
}
- SerializablePtr readDirectObject(int8_t typeId = -1) {
+ std::shared_ptr<Serializable> readDirectObject(int8_t typeId = -1) {
return m_dataInput.readDirectObject(typeId);
}
- void readObject(SerializablePtr &ptr) { m_dataInput.readObject(ptr); }
+ void readObject(std::shared_ptr<Serializable> &ptr) {
+ m_dataInput.readObject(ptr);
+ }
void readCharArray(char **value, int32_t &length) {
m_dataInput.readCharArray(value, length);
@@ -645,7 +647,7 @@ TEST_F(DataInputTest, TestReadUTFHugeWide) {
TEST_F(DataInputTest, TestReadObjectSharedPtr) {
TestDataInput dataInput(
"57001B596F7520686164206D65206174206D65617420746F726E61646F2E", nullptr);
- CacheableStringPtr objptr;
+ std::shared_ptr<CacheableString> objptr;
dataInput.readObject(objptr);
EXPECT_STREQ((const char *)"You had me at meat tornado.",
(const char *)objptr->toString())
@@ -667,7 +669,7 @@ TEST_F(DataInputTest, TestReadNativeInt32) {
TEST_F(DataInputTest, TestReadNativeString) {
TestDataInput dataInput(
"57001B596F7520686164206D65206174206D65617420746F726E61646F2E", nullptr);
- CacheableStringPtr objptr;
+ std::shared_ptr<CacheableString> objptr;
ASSERT_EQ(true, dataInput.readNativeString(objptr)) << "Successful read";
EXPECT_STREQ((const char *)"You had me at meat tornado.",
(const char *)objptr->toString())
@@ -677,7 +679,7 @@ TEST_F(DataInputTest, TestReadNativeString) {
TEST_F(DataInputTest, TestReadDirectObject) {
TestDataInput dataInput(
"57001B596F7520686164206D65206174206D65617420746F726E61646F2E", nullptr);
- SerializablePtr objptr = dataInput.readDirectObject();
+ auto objptr = dataInput.readDirectObject();
EXPECT_STREQ(
(const char *)"You had me at meat tornado.",
(const char *)(std::dynamic_pointer_cast<CacheableString>(objptr))
@@ -688,7 +690,7 @@ TEST_F(DataInputTest, TestReadDirectObject) {
TEST_F(DataInputTest, TestReadObjectSerializablePtr) {
TestDataInput dataInput(
"57001B596F7520686164206D65206174206D65617420746F726E61646F2E", nullptr);
- SerializablePtr objptr;
+ std::shared_ptr<Serializable> objptr;
dataInput.readObject(objptr);
EXPECT_STREQ(
(const char *)"You had me at meat tornado.",
diff --git a/cppcache/test/DataOutputTest.cpp b/cppcache/test/DataOutputTest.cpp
index a27cc0a..493dac5 100644
--- a/cppcache/test/DataOutputTest.cpp
+++ b/cppcache/test/DataOutputTest.cpp
@@ -285,8 +285,7 @@ TEST_F(DataOutputTest, TestEncodedLengthWide) {
TEST_F(DataOutputTest, TestWriteObjectSharedPtr) {
TestDataOutput dataOutput(nullptr);
- std::shared_ptr<CacheableString> objptr =
- CacheableString::create("You had me at meat tornado.");
+ auto objptr = CacheableString::create("You had me at meat tornado.");
dataOutput.writeObject(objptr);
EXPECT_BYTEARRAY_EQ(
"57001B596F7520686164206D65206174206D65617420746F726E61646F2E",
@@ -295,8 +294,7 @@ TEST_F(DataOutputTest, TestWriteObjectSharedPtr) {
TEST_F(DataOutputTest, TestWriteObjectCacheableString) {
TestDataOutput dataOutput(nullptr);
- CacheableStringPtr objptr =
- CacheableString::create("You had me at meat tornado.");
+ auto objptr = CacheableString::create("You had me at meat tornado.");
dataOutput.writeObject(objptr);
EXPECT_BYTEARRAY_EQ(
"57001B596F7520686164206D65206174206D65617420746F726E61646F2E",
diff --git a/cppcache/test/PdxLocalReaderTest.cpp b/cppcache/test/PdxLocalReaderTest.cpp
index 5852562..cbd43ee 100644
--- a/cppcache/test/PdxLocalReaderTest.cpp
+++ b/cppcache/test/PdxLocalReaderTest.cpp
@@ -32,8 +32,8 @@ class MyPdxClass : public PdxSerializable {
public:
MyPdxClass();
~MyPdxClass();
- virtual void toData(PdxWriterPtr output);
- virtual void fromData(PdxReaderPtr input);
+ virtual void toData(std::shared_ptr<PdxWriter> output);
+ virtual void fromData(std::shared_ptr<PdxReader> input);
virtual void setAString(std::string a_string);
virtual std::string getAString();
virtual const char *getClassName() const;
@@ -52,11 +52,11 @@ std::string MyPdxClass::getAString() { return _a_string; }
MyPdxClass::~MyPdxClass() {}
-void MyPdxClass::toData(PdxWriterPtr output) {
+void MyPdxClass::toData(std::shared_ptr<PdxWriter> output) {
output->writeString("name", _a_string.c_str());
}
-void MyPdxClass::fromData(PdxReaderPtr input) {
+void MyPdxClass::fromData(std::shared_ptr<PdxReader> input) {
_a_string = input->readString("name");
}
const char *MyPdxClass::getClassName() const { return "MyPdxClass"; }
@@ -71,7 +71,7 @@ class DISABLED_PdxLocalReaderTest : public ::testing::Test {
}
protected:
- CachePtr cache;
+ std::shared_ptr<Cache> cache;
};
TEST_F(DISABLED_PdxLocalReaderTest, testSerializationOfPdxType) {
diff --git a/cppcache/test/StructSetTest.cpp b/cppcache/test/StructSetTest.cpp
index e833b1b..05a61f0 100644
--- a/cppcache/test/StructSetTest.cpp
+++ b/cppcache/test/StructSetTest.cpp
@@ -23,9 +23,9 @@
using namespace apache::geode::client;
TEST(StructSetTest, Basic) {
- CacheableVectorPtr values = CacheableVector::create();
- std::vector<CacheableStringPtr> fieldNames;
-
+ auto values = CacheableVector::create();
+ std::vector<std::shared_ptr<CacheableString>> fieldNames;
+
size_t numOfFields = 10;
for (size_t i = 0; i < numOfFields; i++) {
@@ -43,9 +43,9 @@ TEST(StructSetTest, Basic) {
}
TEST(StructSetTest, MissingFieldIndex) {
- CacheableVectorPtr values = CacheableVector::create();
- std::vector<CacheableStringPtr> fieldNames;
-
+ auto values = CacheableVector::create();
+ std::vector<std::shared_ptr<CacheableString>> fieldNames;
+
size_t numOfFields = 10;
for (size_t i = 0; i < numOfFields; i++) {
@@ -63,9 +63,9 @@ TEST(StructSetTest, MissingFieldIndex) {
}
TEST(StructSetTest, MissingFieldName) {
- CacheableVectorPtr values = CacheableVector::create();
- std::vector<CacheableStringPtr> fieldNames;
-
+ auto values = CacheableVector::create();
+ std::vector<std::shared_ptr<CacheableString>> fieldNames;
+
size_t numOfFields = 10;
for (size_t i = 0; i < numOfFields; i++) {
diff --git a/cppcache/test/TcrMessage_unittest.cpp b/cppcache/test/TcrMessage_unittest.cpp
index 33fe861..cd67084 100644
--- a/cppcache/test/TcrMessage_unittest.cpp
+++ b/cppcache/test/TcrMessage_unittest.cpp
@@ -65,7 +65,7 @@ TEST_F(TcrMessageTest, intializeDefaultConstructor) {
TEST_F(TcrMessageTest, testConstructor1MessageDataContentWithDESTROY_REGION) {
const Region *region = nullptr;
- const SerializablePtr aCallbackArgument = nullptr;
+ const std::shared_ptr<Serializable> aCallbackArgument = nullptr;
std::chrono::milliseconds messageResponseTimeout{1000};
ThinClientBaseDM *connectionDM = nullptr;
@@ -84,7 +84,7 @@ TEST_F(TcrMessageTest, testConstructor1MessageDataContentWithDESTROY_REGION) {
TEST_F(TcrMessageTest, testConstructor1MessageDataContentWithCLEAR_REGION) {
const Region *region = nullptr;
- const SerializablePtr aCallbackArgument = nullptr;
+ const std::shared_ptr<Serializable> aCallbackArgument = nullptr;
std::chrono::milliseconds messageResponseTimeout{1000};
ThinClientBaseDM *connectionDM = nullptr;
@@ -167,8 +167,8 @@ TEST_F(TcrMessageTest,
testParameterizedQueryConstructorWithQUERY_WITH_PARAMETERS) {
std::chrono::milliseconds messageResponseTimeout{1000};
ThinClientBaseDM *connectionDM = nullptr;
- const SerializablePtr aCallbackArgument = nullptr;
- CacheableVectorPtr paramList = CacheableVector::create();
+ const std::shared_ptr<Serializable> aCallbackArgument = nullptr;
+ auto paramList = CacheableVector::create();
TcrMessageQueryWithParameters message(
std::unique_ptr<DataOutputUnderTest>(new DataOutputUnderTest()),
@@ -188,8 +188,9 @@ TEST_F(TcrMessageTest, testConstructorWithCONTAINS_KEY) {
std::unique_ptr<DataOutputUnderTest>(new DataOutputUnderTest()),
static_cast<const Region *>(nullptr),
CacheableString::create(
- "mykey"), // static_cast<const CacheableKeyPtr>(nullptr),
- static_cast<const SerializablePtr>(nullptr),
+ "mykey"), // static_cast<const
+ // std::shared_ptr<CacheableKey>>(nullptr),
+ static_cast<const std::shared_ptr<Serializable>>(nullptr),
true, // isContainsKey
static_cast<ThinClientBaseDM *>(nullptr));
EXPECT_EQ(TcrMessage::CONTAINS_KEY, message.getMessageType());
@@ -215,8 +216,9 @@ TEST_F(TcrMessageTest, testConstructor2WithREQUEST) {
std::unique_ptr<DataOutputUnderTest>(new DataOutputUnderTest()),
static_cast<const Region *>(nullptr),
CacheableString::create(
- "mykey"), // static_cast<const CacheableKeyPtr>(nullptr),
- static_cast<const SerializablePtr>(nullptr),
+ "mykey"), // static_cast<const
+ // std::shared_ptr<CacheableKey>>(nullptr),
+ static_cast<const std::shared_ptr<Serializable>>(nullptr),
static_cast<ThinClientBaseDM *>(nullptr));
EXPECT_EQ(TcrMessage::REQUEST, message.getMessageType());
@@ -231,8 +233,8 @@ TEST_F(TcrMessageTest, testConstructor2WithDESTROY) {
TcrMessageDestroy message(
std::unique_ptr<DataOutputUnderTest>(new DataOutputUnderTest()),
static_cast<const Region *>(nullptr), CacheableString::create("mykey"),
- static_cast<const CacheableKeyPtr>(nullptr),
- static_cast<const SerializablePtr>(nullptr),
+ static_cast<const std::shared_ptr<CacheableKey>>(nullptr),
+ static_cast<const std::shared_ptr<Serializable>>(nullptr),
static_cast<ThinClientBaseDM *>(nullptr));
EXPECT_EQ(TcrMessage::DESTROY, message.getMessageType());
@@ -249,8 +251,9 @@ TEST_F(TcrMessageTest, testConstructor2WithINVALIDATE) {
std::unique_ptr<DataOutputUnderTest>(new DataOutputUnderTest()),
static_cast<const Region *>(nullptr),
CacheableString::create(
- "mykey"), // static_cast<const CacheableKeyPtr>(nullptr),
- static_cast<const SerializablePtr>(nullptr),
+ "mykey"), // static_cast<const
+ // std::shared_ptr<CacheableKey>>(nullptr),
+ static_cast<const std::shared_ptr<Serializable>>(nullptr),
static_cast<ThinClientBaseDM *>(nullptr));
EXPECT_EQ(TcrMessage::INVALIDATE, message.getMessageType());
@@ -267,7 +270,7 @@ TEST_F(TcrMessageTest, testConstructor3WithPUT) {
std::unique_ptr<DataOutputUnderTest>(new DataOutputUnderTest()),
static_cast<const Region *>(nullptr), CacheableString::create("mykey"),
CacheableString::create("myvalue"),
- static_cast<const SerializablePtr>(nullptr),
+ static_cast<const std::shared_ptr<Serializable>>(nullptr),
false, // isDelta
static_cast<ThinClientBaseDM *>(nullptr),
false, // isMetaRegion
@@ -292,7 +295,7 @@ TEST_F(TcrMessageTest, testConstructor4) {
}
TEST_F(TcrMessageTest, testConstructor5WithREGISTER_INTERST_LIST) {
- VectorOfCacheableKey keys;
+ std::vector<std::shared_ptr<CacheableKey>> keys;
keys.push_back(CacheableString::create("mykey"));
TcrMessageRegisterInterestList message(
@@ -313,7 +316,7 @@ TEST_F(TcrMessageTest, testConstructor5WithREGISTER_INTERST_LIST) {
}
TEST_F(TcrMessageTest, testConstructor5WithUNREGISTER_INTERST_LIST) {
- VectorOfCacheableKey keys;
+ std::vector<std::shared_ptr<CacheableKey>> keys;
keys.push_back(CacheableString::create("mykey"));
TcrMessageUnregisterInterestList message(
@@ -438,7 +441,7 @@ TEST_F(TcrMessageTest, testConstructorGET_PDX_ENUM_BY_ID) {
}
TEST_F(TcrMessageTest, testConstructorGET_PDX_ID_FOR_TYPE) {
- CacheablePtr myPtr(CacheableString::createDeserializable());
+ std::shared_ptr<Cacheable> myPtr(CacheableString::createDeserializable());
TcrMessageGetPdxIdForType message(
std::unique_ptr<DataOutputUnderTest>(new DataOutputUnderTest()), myPtr,
static_cast<ThinClientBaseDM *>(nullptr), 42);
@@ -450,7 +453,7 @@ TEST_F(TcrMessageTest, testConstructorGET_PDX_ID_FOR_TYPE) {
}
TEST_F(TcrMessageTest, testConstructorADD_PDX_TYPE) {
- CacheablePtr myPtr(CacheableString::createDeserializable());
+ std::shared_ptr<Cacheable> myPtr(CacheableString::createDeserializable());
TcrMessageAddPdxType message(
std::unique_ptr<DataOutputUnderTest>(new DataOutputUnderTest()), myPtr,
static_cast<ThinClientBaseDM *>(nullptr), 42);
@@ -465,7 +468,7 @@ TEST_F(TcrMessageTest, testConstructorADD_PDX_TYPE) {
TEST_F(TcrMessageTest, testConstructorGET_PDX_ID_FOR_ENUM) {
TcrMessageGetPdxIdForEnum message(
std::unique_ptr<DataOutputUnderTest>(new DataOutputUnderTest()),
- static_cast<CacheablePtr>(nullptr),
+ static_cast<std::shared_ptr<Cacheable>>(nullptr),
static_cast<ThinClientBaseDM *>(nullptr), 42);
EXPECT_EQ(TcrMessage::GET_PDX_ID_FOR_ENUM, message.getMessageType());
@@ -474,11 +477,11 @@ TEST_F(TcrMessageTest, testConstructorGET_PDX_ID_FOR_ENUM) {
}
TEST_F(TcrMessageTest, testConstructorADD_PDX_ENUM) {
- CacheablePtr myPtr(CacheableString::createDeserializable());
+ std::shared_ptr<Cacheable> myPtr(CacheableString::createDeserializable());
TcrMessageAddPdxEnum message(
std::unique_ptr<DataOutputUnderTest>(new DataOutputUnderTest()),
- static_cast<CacheablePtr>(nullptr),
+ static_cast<std::shared_ptr<Cacheable>>(nullptr),
static_cast<ThinClientBaseDM *>(nullptr), 42);
EXPECT_EQ(TcrMessage::ADD_PDX_ENUM, message.getMessageType());
@@ -491,7 +494,7 @@ TEST_F(TcrMessageTest, testConstructorADD_PDX_ENUM) {
TEST_F(TcrMessageTest, testConstructorEventId) {
TcrMessageRequestEventValue message(
std::unique_ptr<DataOutputUnderTest>(new DataOutputUnderTest()),
- static_cast<EventIdPtr>(nullptr));
+ static_cast<std::shared_ptr<EventId>>(nullptr));
EXPECT_EQ(TcrMessage::REQUEST_EVENT_VALUE, message.getMessageType());
@@ -519,7 +522,7 @@ TEST_F(TcrMessageTest, testConstructorREMOVE_USER_AUTH) {
TEST_F(TcrMessageTest, testConstructorUSER_CREDENTIAL_MESSAGE) {
TcrMessageUserCredential message(
std::unique_ptr<DataOutputUnderTest>(new DataOutputUnderTest()),
- static_cast<PropertiesPtr>(nullptr),
+ static_cast<std::shared_ptr<Properties>>(nullptr),
static_cast<ThinClientBaseDM *>(nullptr));
EXPECT_EQ(TcrMessage::USER_CREDENTIAL_MESSAGE, message.getMessageType());
@@ -570,9 +573,9 @@ TEST_F(TcrMessageTest, testConstructorSIZE) {
TEST_F(TcrMessageTest, testConstructorEXECUTE_REGION_FUNCTION_SINGLE_HOP) {
const Region *region = nullptr;
- CacheableHashSetPtr myHashCachePtr = CacheableHashSet::create();
+ auto myHashCachePtr = CacheableHashSet::create();
- CacheablePtr myPtr(CacheableString::createDeserializable());
+ std::shared_ptr<Cacheable> myPtr(CacheableString::createDeserializable());
TcrMessageExecuteRegionFunctionSingleHop message(
std::unique_ptr<DataOutputUnderTest>(new DataOutputUnderTest()),
@@ -596,9 +599,10 @@ TEST_F(TcrMessageTest, testConstructorEXECUTE_REGION_FUNCTION_SINGLE_HOP) {
TEST_F(TcrMessageTest, testConstructorEXECUTE_REGION_FUNCTION) {
const Region *region = nullptr;
- CacheableHashSetPtr myHashCachePtr = CacheableHashSet::create();
- CacheablePtr myCacheablePtr(CacheableString::createDeserializable());
- CacheableVectorPtr myVectPtr = CacheableVector::create();
+ auto myHashCachePtr = CacheableHashSet::create();
+ std::shared_ptr<Cacheable> myCacheablePtr(
+ CacheableString::createDeserializable());
+ auto myVectPtr = CacheableVector::create();
TcrMessageExecuteRegionFunction testMessage(
std::unique_ptr<DataOutputUnderTest>(new DataOutputUnderTest()),
@@ -621,7 +625,8 @@ TEST_F(TcrMessageTest, testConstructorEXECUTE_REGION_FUNCTION) {
}
TEST_F(TcrMessageTest, DISABLED_testConstructorEXECUTE_FUNCTION) {
- CacheablePtr myCacheablePtr(CacheableString::createDeserializable());
+ std::shared_ptr<Cacheable> myCacheablePtr(
+ CacheableString::createDeserializable());
TcrMessageExecuteFunction testMessage(
std::unique_ptr<DataOutputUnderTest>(new DataOutputUnderTest()),
@@ -639,7 +644,8 @@ TEST_F(TcrMessageTest, DISABLED_testConstructorEXECUTE_FUNCTION) {
}
TEST_F(TcrMessageTest, testConstructorEXECUTECQ_MSG_TYPE) {
- CacheablePtr myCacheablePtr(CacheableString::createDeserializable());
+ std::shared_ptr<Cacheable> myCacheablePtr(
+ CacheableString::createDeserializable());
TcrMessageExecuteCq testMessage(
std::unique_ptr<DataOutputUnderTest>(new DataOutputUnderTest()),
@@ -656,7 +662,8 @@ TEST_F(TcrMessageTest, testConstructorEXECUTECQ_MSG_TYPE) {
}
TEST_F(TcrMessageTest, testConstructorWithGinormousQueryEXECUTECQ_MSG_TYPE) {
- CacheablePtr myCacheablePtr(CacheableString::createDeserializable());
+ std::shared_ptr<Cacheable> myCacheablePtr(
+ CacheableString::createDeserializable());
std::ostringstream oss;
oss << "select * from /somewhere s where s.data.id in SET(";
@@ -688,7 +695,8 @@ TEST_F(TcrMessageTest, testConstructorWithGinormousQueryEXECUTECQ_MSG_TYPE) {
}
TEST_F(TcrMessageTest, testConstructorEXECUTECQ_WITH_IR_MSG_TYPE) {
- CacheablePtr myCacheablePtr(CacheableString::createDeserializable());
+ std::shared_ptr<Cacheable> myCacheablePtr(
+ CacheableString::createDeserializable());
TcrMessageExecuteCqWithIr testMessage(
std::unique_ptr<DataOutputUnderTest>(new DataOutputUnderTest()),
diff --git a/cryptoimpl/DHImpl.cpp b/cryptoimpl/DHImpl.cpp
index 1edcce8..632f7c8 100644
--- a/cryptoimpl/DHImpl.cpp
+++ b/cryptoimpl/DHImpl.cpp
@@ -489,7 +489,8 @@ unsigned char *gf_decryptDH(void *dhCtx, const unsigned char *cleartext,
return ciphertext;
}
-// CacheableBytesPtr decrypt(const uint8_t * ciphertext, int len) {
+// std::shared_ptr<CacheableBytes> decrypt(const uint8_t * ciphertext, int len)
+// {
// LOGDH("DH: Used unimplemented decrypt!");
// return NULL;
//}
diff --git a/dhimpl/DHImpl.cpp b/dhimpl/DHImpl.cpp
index cd49cd5..20beb85 100644
--- a/dhimpl/DHImpl.cpp
+++ b/dhimpl/DHImpl.cpp
@@ -397,7 +397,8 @@ unsigned char *gf_encryptDH(const unsigned char *cleartext, int len,
return ciphertext;
}
-// CacheableBytesPtr decrypt(const uint8_t * ciphertext, int len) {
+// std::shared_ptr<CacheableBytes> decrypt(const uint8_t * ciphertext, int len)
+// {
// LOGDH("DH: Used unimplemented decrypt!");
// return NULL;
//}
diff --git a/quickstart/cpp/BasicOperations.cpp b/quickstart/cpp/BasicOperations.cpp
index 21918c1..ddf5376 100644
--- a/quickstart/cpp/BasicOperations.cpp
+++ b/quickstart/cpp/BasicOperations.cpp
@@ -32,7 +32,6 @@
*/
// Include the Geode library.
-#include <geode/GeodeCppCache.hpp>
// Use the "geode" namespace.
using namespace apache::geode::client;
@@ -41,19 +40,18 @@ using namespace apache::geode::client;
int main(int argc, char** argv) {
try {
// Create a Geode Cache.
- CacheFactoryPtr cacheFactory = CacheFactory::createCacheFactory();
+ auto cacheFactory = CacheFactory::createCacheFactory();
- CachePtr cachePtr = cacheFactory->create();
+ auto cachePtr = cacheFactory->create();
LOGINFO("Created the Geode Cache");
- RegionFactoryPtr regionFactory =
- cachePtr->createRegionFactory(CACHING_PROXY);
+ auto regionFactory = cachePtr->createRegionFactory(CACHING_PROXY);
LOGINFO("Created the RegionFactory");
// Create the example Region Programmatically.
- RegionPtr regionPtr = regionFactory->create("exampleRegion");
+ auto regionPtr = regionFactory->create("exampleRegion");
LOGINFO("Created the Region Programmatically.");
@@ -63,8 +61,8 @@ int main(int argc, char** argv) {
LOGINFO("Put the first Entry into the Region");
// Put an Entry into the Region by manually creating a Key and a Value pair.
- CacheableKeyPtr keyPtr = CacheableInt32::create(123);
- CacheablePtr valuePtr = CacheableString::create("123");
+ auto keyPtr = CacheableInt32::create(123);
+ auto valuePtr = CacheableString::create("123");
regionPtr->put(keyPtr, valuePtr);
LOGINFO("Put the second Entry into the Region");
@@ -83,11 +81,11 @@ int main(int argc, char** argv) {
#endif // 64-bit
// Get Entries back out of the Region.
- CacheablePtr result1Ptr = regionPtr->get("Key1");
+ auto result1Ptr = regionPtr->get("Key1");
LOGINFO("Obtained the first Entry from the Region");
- CacheablePtr result2Ptr = regionPtr->get(keyPtr);
+ auto result2Ptr = regionPtr->get(keyPtr);
LOGINFO("Obtained the second Entry from the Region");
diff --git a/quickstart/cpp/CqQuery.cpp b/quickstart/cpp/CqQuery.cpp
index 13c51cf..84504e2 100644
--- a/quickstart/cpp/CqQuery.cpp
+++ b/quickstart/cpp/CqQuery.cpp
@@ -30,7 +30,6 @@
*/
// Include the Geode library.
-#include <geode/GeodeCppCache.hpp>
// Include our Query objects, viz. Portfolio and Position.
#include "queryobjects/Portfolio.hpp"
@@ -46,8 +45,10 @@ class MyCqListener : public CqListener {
public:
void onEvent(const CqEvent& cqe) {
char* opStr = (char*)"Default";
- PortfolioPtr portfolio(dynamic_cast<Portfolio*>(cqe.getNewValue().get()));
- CacheableStringPtr key(dynamic_cast<CacheableString*>(cqe.getKey().get()));
+ std::shared_ptr<Portfolio> portfolio(
+ dynamic_cast<Portfolio*>(cqe.getNewValue().get()));
+ std::shared_ptr<CacheableString> key(
+ dynamic_cast<CacheableString*>(cqe.getKey().get()));
switch (cqe.getQueryOperation()) {
case CqOperation::OP_TYPE_CREATE: {
opStr = (char*)"CREATE";
@@ -78,20 +79,20 @@ class MyCqListener : public CqListener {
int main(int argc, char** argv) {
try {
// Create a Geode Cache Programmatically.
- CacheFactoryPtr cacheFactory = CacheFactory::createCacheFactory();
+ auto cacheFactory = CacheFactory::createCacheFactory();
- CachePtr cachePtr = cacheFactory->addServer("localhost", 50505)
- ->setSubscriptionEnabled(true)
- ->create();
+ auto cachePtr = cacheFactory->addServer("localhost", 50505)
+ ->setSubscriptionEnabled(true)
+ ->create();
LOGINFO("Created the Geode Cache");
- RegionFactoryPtr regionFactory = cachePtr->createRegionFactory(PROXY);
+ auto regionFactory = cachePtr->createRegionFactory(PROXY);
LOGINFO("Created the RegionFactory");
// Create the example Region programmatically.
- RegionPtr regionPtr = regionFactory->create("Portfolios");
+ auto regionPtr = regionFactory->create("Portfolios");
// Register our Serializable/Cacheable Query objects, viz. Portfolio and
// Position.
@@ -101,9 +102,9 @@ int main(int argc, char** argv) {
LOGINFO("Registered Serializable Query Objects");
// Populate the Region with some Portfolio objects.
- PortfolioPtr port1Ptr(new Portfolio(1 /*ID*/, 10 /*size*/));
- PortfolioPtr port2Ptr(new Portfolio(2 /*ID*/, 20 /*size*/));
- PortfolioPtr port3Ptr(new Portfolio(3 /*ID*/, 30 /*size*/));
+ std::shared_ptr<Portfolio> port1Ptr(new Portfolio(1 /*ID*/, 10 /*size*/));
+ std::shared_ptr<Portfolio> port2Ptr(new Portfolio(2 /*ID*/, 20 /*size*/));
+ std::shared_ptr<Portfolio> port3Ptr(new Portfolio(3 /*ID*/, 30 /*size*/));
regionPtr->put("Key1", port1Ptr);
regionPtr->put("Key2", port2Ptr);
regionPtr->put("Key3", port3Ptr);
@@ -111,20 +112,20 @@ int main(int argc, char** argv) {
LOGINFO("Populated some Portfolio Objects");
// Get the QueryService from the Cache.
- QueryServicePtr qrySvcPtr = cachePtr->getQueryService();
+ auto qrySvcPtr = cachePtr->getQueryService();
// Create CqAttributes and Install Listener
CqAttributesFactory cqFac;
- CqListenerPtr cqLstner(new MyCqListener());
+ std::shared_ptr<CqListener> cqLstner(new MyCqListener());
cqFac.addCqListener(cqLstner);
- CqAttributesPtr cqAttr = cqFac.create();
+ auto cqAttr = cqFac.create();
// create a new Cq Query
const char* qryStr = "select * from /Portfolios p where p.ID < 5";
- CqQueryPtr qry = qrySvcPtr->newCq((char*)"MyCq", qryStr, cqAttr);
+ auto qry = qrySvcPtr->newCq((char*)"MyCq", qryStr, cqAttr);
// execute Cq Query with initial Results
- CqResultsPtr resultsPtr = qry->executeWithInitialResults();
+ auto resultsPtr = qry->executeWithInitialResults();
// make change to generate cq events
regionPtr->put("Key3", port1Ptr);
@@ -136,19 +137,19 @@ int main(int argc, char** argv) {
// Iterate through the rows of the query result.
SelectResultsIterator iter = resultsPtr->getIterator();
while (iter.hasNext()) {
- SerializablePtr ser = iter.next();
+ auto ser = iter.next();
if (ser != nullptr) {
LOGINFO(" query pulled object %s\n", ser->toString()->asChar());
- StructPtr stPtr(dynamic_cast<Struct*>(ser.get()));
+ std::shared_ptr<Struct> stPtr(dynamic_cast<Struct*>(ser.get()));
if (stPtr != nullptr) {
LOGINFO(" got struct ptr ");
- SerializablePtr serKey = (*(stPtr.get()))["key"];
+ auto serKey = (*(stPtr.get()))["key"];
if (serKey != nullptr) {
LOGINFO("got struct key %s\n", serKey->toString()->asChar());
}
- SerializablePtr serVal = (*(stPtr.get()))["value"];
+ auto serVal = (*(stPtr.get()))["value"];
if (serVal != nullptr) {
LOGINFO(" got struct value %s\n", serVal->toString()->asChar());
diff --git a/quickstart/cpp/DataExpiration.cpp b/quickstart/cpp/DataExpiration.cpp
index 130fc1a..6ef25b2 100644
--- a/quickstart/cpp/DataExpiration.cpp
+++ b/quickstart/cpp/DataExpiration.cpp
@@ -35,7 +35,6 @@
*/
// Include the Geode library.
-#include <geode/GeodeCppCache.hpp>
#include <chrono>
#include <thread>
@@ -49,28 +48,27 @@ using namespace apache::geode::client;
int main(int argc, char** argv) {
try {
// Create a Geode Cache Programmatically.
- CacheFactoryPtr cacheFactory = CacheFactory::createCacheFactory();
+ auto cacheFactory = CacheFactory::createCacheFactory();
- CachePtr cachePtr = cacheFactory->setSubscriptionEnabled(true)->create();
+ auto cachePtr = cacheFactory->setSubscriptionEnabled(true)->create();
LOGINFO("Created the Geode Cache");
- RegionFactoryPtr regionFactory =
- cachePtr->createRegionFactory(CACHING_PROXY);
+ auto regionFactory = cachePtr->createRegionFactory(CACHING_PROXY);
LOGINFO("Created the RegionFactory");
// Create the example Region programmatically.
- RegionPtr regionPtr =
+ auto regionPtr =
regionFactory->setEntryIdleTimeout(ExpirationAction::DESTROY, 10)
->create("exampleRegion");
LOGINFO("Created the Region from the Cache");
// Plugin the SimpleCacheListener to the Region.
- AttributesMutatorPtr attrMutatorPtr = regionPtr->getAttributesMutator();
+ auto attrMutatorPtr = regionPtr->getAttributesMutator();
attrMutatorPtr->setCacheListener(
- CacheListenerPtr(new SimpleCacheListener()));
+ std::shared_ptr<CacheListener>(new SimpleCacheListener()));
LOGINFO("Set the SimpleCacheListener on the Region");
@@ -90,15 +88,15 @@ int main(int argc, char** argv) {
std::this_thread::sleep_for(std::chrono::milliseconds(entryIdleTimeout * 1000 / 2));
// Get the number of Keys remaining in the Region, should be all 3.
- VectorOfCacheableKey keys;
+ std::vector<std::shared_ptr<CacheableKey>> keys;
regionPtr->keys(keys);
LOGINFO("Got %d keys before the Entry Idle Timeout duration elapsed",
keys.size());
// Get 2 of the 3 Entries from the Region to "reset" their Idle Timeouts.
- CacheablePtr value1Ptr = regionPtr->get("Key1");
- CacheablePtr value2Ptr = regionPtr->get("Key2");
+ auto value1Ptr = regionPtr->get("Key1");
+ auto value2Ptr = regionPtr->get("Key2");
LOGINFO("The SimpleCacheListener should next report the expiration action");
diff --git a/quickstart/cpp/Delta.cpp b/quickstart/cpp/Delta.cpp
index 00e2c03..b083056 100644
--- a/quickstart/cpp/Delta.cpp
+++ b/quickstart/cpp/Delta.cpp
@@ -34,70 +34,67 @@
*
*/
-#include <geode/GeodeCppCache.hpp>
-
#include "deltaobjects/DeltaExample.hpp"
// Use the "geode" namespace.
using namespace apache::geode::client;
// The Delta QuickStart example.
-typedef std::shared_ptr<DeltaExample> DeltaExamplePtr;
int main(int argc, char** argv) {
try {
// Create a Geode Cache.
- PropertiesPtr prptr = Properties::create();
- prptr->insert("cache-xml-file", "XMLs/clientDelta.xml");
+ auto prptr = Properties::create();
+ prptr->insert("cache-xml-file", "XMLs/clientDelta.xml");
- CacheFactoryPtr cacheFactory = CacheFactory::createCacheFactory(prptr);
+ auto cacheFactory = CacheFactory::createCacheFactory(prptr);
- CachePtr cachePtr = cacheFactory->create();
+ auto cachePtr = cacheFactory->create();
- LOGINFO("Created the Geode Cache");
+ LOGINFO("Created the Geode Cache");
- // get the example Region.
- RegionPtr regPtr = cachePtr->getRegion("exampleRegion");
+ // get the example Region.
+ auto regPtr = cachePtr->getRegion("exampleRegion");
- LOGINFO("Obtained the Region from the Cache");
+ LOGINFO("Obtained the Region from the Cache");
- // Register our Serializable/Cacheable Delta objects, DeltaExample.
- serializationRegistry->addType(DeltaExample::create);
+ // Register our Serializable/Cacheable Delta objects, DeltaExample.
+ serializationRegistry->addType(DeltaExample::create);
- // Creating Delta Object.
- DeltaExample* ptr = new DeltaExample(10, 15, 20);
- CacheablePtr valPtr(ptr);
- // Put the delta object. This will send the complete object to the server.
- regPtr->put("Key1", valPtr);
- LOGINFO("Completed put for a delta object");
+ // Creating Delta Object.
+ DeltaExample* ptr = new DeltaExample(10, 15, 20);
+ std::shared_ptr<Cacheable> valPtr(ptr);
+ // Put the delta object. This will send the complete object to the server.
+ regPtr->put("Key1", valPtr);
+ LOGINFO("Completed put for a delta object");
- // Changing state of delta object.
- ptr->setField1(9);
+ // Changing state of delta object.
+ ptr->setField1(9);
- // Put delta object again. Since delta flag is set true it will calculate
- // Delta and send only Delta to the server.
- regPtr->put("Key1", valPtr);
- LOGINFO("Completed put with delta");
+ // Put delta object again. Since delta flag is set true it will calculate
+ // Delta and send only Delta to the server.
+ regPtr->put("Key1", valPtr);
+ LOGINFO("Completed put with delta");
- // Locally invalidating the key.
- regPtr->localInvalidate("Key1");
+ // Locally invalidating the key.
+ regPtr->localInvalidate("Key1");
- // Fetching the value from server.
- auto retVal = std::dynamic_pointer_cast<DeltaExample>(regPtr->get("Key1"));
+ // Fetching the value from server.
+ auto retVal = std::dynamic_pointer_cast<DeltaExample>(regPtr->get("Key1"));
- // Verification
- if (retVal->getField1() != 9)
- throw Exception("First field should have been 9");
- if (retVal->getField2() != 15)
- throw Exception("Second field should have been 15");
- if (retVal->getField3() != 20)
- throw Exception("Third field should have been 20");
- LOGINFO("Delta has been successfully applied at server");
+ // Verification
+ if (retVal->getField1() != 9)
+ throw Exception("First field should have been 9");
+ if (retVal->getField2() != 15)
+ throw Exception("Second field should have been 15");
+ if (retVal->getField3() != 20)
+ throw Exception("Third field should have been 20");
+ LOGINFO("Delta has been successfully applied at server");
- cachePtr->close();
+ cachePtr->close();
- LOGINFO("Closed the Geode Cache");
+ LOGINFO("Closed the Geode Cache");
- return 0;
+ return 0;
}
// An exception should not occur
diff --git a/quickstart/cpp/DistributedSystem.cpp b/quickstart/cpp/DistributedSystem.cpp
index 090802d..01ef8cb 100644
--- a/quickstart/cpp/DistributedSystem.cpp
+++ b/quickstart/cpp/DistributedSystem.cpp
@@ -36,15 +36,14 @@
*/
// Include the Geode library.
-#include <geode/GeodeCppCache.hpp>
// Use the "geode" namespace.
using namespace apache::geode::client;
-void distributedsystem(CachePtr cachePtr, char *hostname, int port,
- char *poolName, char *regionName) {
+void distributedsystem(std::shared_ptr<Cache> cachePtr, char *hostname,
+ int port, char *poolName, char *regionName) {
// create pool factory to create the pool.
- PoolFactoryPtr poolFacPtr = cachePtr->getPoolManager().createFactory();
+ auto poolFacPtr = cachePtr->getPoolManager().createFactory();
// adding host(endpoint) in pool
poolFacPtr->addServer(hostname, port);
@@ -55,7 +54,7 @@ void distributedsystem(CachePtr cachePtr, char *hostname, int port,
// creating pool with name "examplePool"
poolFacPtr->create(poolName, *cachePtr.get());
- RegionFactoryPtr regionFactory = cachePtr->createRegionFactory(CACHING_PROXY);
+ auto regionFactory = cachePtr->createRegionFactory(CACHING_PROXY);
LOGINFO("Created the RegionFactory");
@@ -63,7 +62,7 @@ void distributedsystem(CachePtr cachePtr, char *hostname, int port,
regionFactory->setPoolName(poolName);
// creating first root region
- RegionPtr regionPtr = regionFactory->create(regionName);
+ auto regionPtr = regionFactory->create(regionName);
LOGINFO("Created Region.");
@@ -74,18 +73,18 @@ void distributedsystem(CachePtr cachePtr, char *hostname, int port,
LOGINFO("Put the first Entry into the Region");
// Put an Entry into the Region by manually creating a Key and a Value pair.
- CacheableKeyPtr keyPtr = CacheableInt32::create(123);
- CacheablePtr valuePtr = CacheableString::create("123");
+ auto keyPtr = CacheableInt32::create(123);
+ auto valuePtr = CacheableString::create("123");
regionPtr->put(keyPtr, valuePtr);
LOGINFO("Put the second Entry into the Region");
// Get Entries back out of the Region.
- CacheablePtr result1Ptr = regionPtr->get("Key1");
+ auto result1Ptr = regionPtr->get("Key1");
LOGINFO("Obtained the first Entry from the Region");
- CacheablePtr result2Ptr = regionPtr->get(keyPtr);
+ auto result2Ptr = regionPtr->get(keyPtr);
LOGINFO("Obtained the second Entry from the Region");
@@ -103,12 +102,12 @@ void distributedsystem(CachePtr cachePtr, char *hostname, int port,
// The DistributedSystem QuickStart example.
int main(int argc, char **argv) {
try {
- CacheFactoryPtr cacheFactory = CacheFactory::createCacheFactory();
+ auto cacheFactory = CacheFactory::createCacheFactory();
LOGINFO("Connected to the Geode Distributed System");
// Create a Geode Cache.
- CachePtr cachePtr = cacheFactory->create();
+ auto cachePtr = cacheFactory->create();
LOGINFO("Created the Geode Cache");
diff --git a/quickstart/cpp/DurableClient.cpp b/quickstart/cpp/DurableClient.cpp
index f509bad..561f2b9 100644
--- a/quickstart/cpp/DurableClient.cpp
+++ b/quickstart/cpp/DurableClient.cpp
@@ -30,7 +30,6 @@
*/
// Include the Geode library.
-#include <geode/GeodeCppCache.hpp>
#include <chrono>
#include <thread>
@@ -42,29 +41,29 @@ using namespace apache::geode::client;
void RunDurableClient() {
// Create durable client's properties using api.
- PropertiesPtr pp = Properties::create();
+ auto pp = Properties::create();
pp->insert("durable-client-id", "DurableClientId");
pp->insert("durable-timeout", std::chrono::seconds(300));
// Create a Geode Cache Programmatically.
- CacheFactoryPtr cacheFactory = CacheFactory::createCacheFactory(pp);
- CachePtr cachePtr = cacheFactory->setSubscriptionEnabled(true)->create();
+ auto cacheFactory = CacheFactory::createCacheFactory(pp);
+ auto cachePtr = cacheFactory->setSubscriptionEnabled(true)->create();
LOGINFO("Created the Geode Cache Programmatically");
- RegionFactoryPtr regionFactory = cachePtr->createRegionFactory(CACHING_PROXY);
+ auto regionFactory = cachePtr->createRegionFactory(CACHING_PROXY);
// Create the Region Programmatically.
- RegionPtr regionPtr = regionFactory->create("exampleRegion");
+ auto regionPtr = regionFactory->create("exampleRegion");
LOGINFO("Created the Region Programmatically");
// Plugin the CacheListener with afterRegionLive. "afterRegionLive()" will be
// called
// after all the queued events are recieved by client
- AttributesMutatorPtr attrMutatorPtr = regionPtr->getAttributesMutator();
+ auto attrMutatorPtr = regionPtr->getAttributesMutator();
attrMutatorPtr->setCacheListener(
- CacheListenerPtr(new DurableCacheListener()));
+ std::shared_ptr<CacheListener>(new DurableCacheListener()));
LOGINFO("DurableCacheListener set to region.");
@@ -72,7 +71,7 @@ void RunDurableClient() {
// default ),
// Unregister Interest APIs remain same.
- VectorOfCacheableKey keys;
+ std::vector<std::shared_ptr<CacheableKey>> keys;
keys.push_back(CacheableString::create("Key-1"));
regionPtr->registerKeys(keys, true);
@@ -97,19 +96,19 @@ void RunDurableClient() {
LOGINFO("Closed the Geode Cache with keepalive as true");
}
void RunFeeder() {
- CacheFactoryPtr cacheFactory = CacheFactory::createCacheFactory();
+ auto cacheFactory = CacheFactory::createCacheFactory();
LOGINFO("Feeder connected to the Geode Distributed System");
- CachePtr cachePtr = cacheFactory->create();
+ auto cachePtr = cacheFactory->create();
LOGINFO("Created the Geode Cache");
- RegionFactoryPtr regionFactory = cachePtr->createRegionFactory(PROXY);
+ auto regionFactory = cachePtr->createRegionFactory(PROXY);
LOGINFO("Created the RegionFactory");
// Create the Region Programmatically.
- RegionPtr regionPtr = regionFactory->create("exampleRegion");
+ auto regionPtr = regionFactory->create("exampleRegion");
LOGINFO("Created the Region Programmatically.");
@@ -118,8 +117,8 @@ void RunFeeder() {
const char* vals[] = {"Value-1", "Value-2"};
for (int i = 0; i < 2; i++) {
- CacheableKeyPtr keyPtr = createKey(keys[i]);
- CacheableStringPtr valPtr = CacheableString::create(vals[i]);
+ auto keyPtr = createKey(keys[i]);
+ auto valPtr = CacheableString::create(vals[i]);
regionPtr->create(keyPtr, valPtr);
}
diff --git a/quickstart/cpp/Exceptions.cpp b/quickstart/cpp/Exceptions.cpp
index d6976c7..0be7094 100644
--- a/quickstart/cpp/Exceptions.cpp
+++ b/quickstart/cpp/Exceptions.cpp
@@ -31,7 +31,6 @@
*/
// Include the Geode library.
-#include <geode/GeodeCppCache.hpp>
// Use the "geode" namespace.
using namespace apache::geode::client;
@@ -41,22 +40,22 @@ int main(int argc, char** argv) {
try {
// Create CacheFactory using the user specified settings or from the
// geode.properties file by default.
- PropertiesPtr prp = Properties::create();
+ auto prp = Properties::create();
prp->insert("cache-xml-file", "XMLs/clientExceptions.xml");
- CacheFactoryPtr cacheFactory = CacheFactory::createCacheFactory(prp);
+ auto cacheFactory = CacheFactory::createCacheFactory(prp);
LOGINFO("Created CacheFactory");
// Create a Geode Cache with the "clientExceptions.xml" Cache XML file.
- CachePtr cachePtr = cacheFactory->setSubscriptionEnabled(true)->create();
+ auto cachePtr = cacheFactory->setSubscriptionEnabled(true)->create();
LOGINFO("Created the Geode Cache");
// Get the example Regions from the Cache which are declared in the Cache
// XML file.
- RegionPtr regionPtr = cachePtr->getRegion("exampleRegion");
- RegionPtr regionPtr2 = cachePtr->getRegion("exampleRegion2");
+ auto regionPtr = cachePtr->getRegion("exampleRegion");
+ auto regionPtr2 = cachePtr->getRegion("exampleRegion2");
LOGINFO("Obtained the Regions from the Cache");
@@ -67,23 +66,23 @@ int main(int argc, char** argv) {
LOGINFO("Put the first Entry into the Region");
// Put an Entry into the Region by manually creating a Key and a Value pair.
- CacheableKeyPtr keyPtr = CacheableInt32::create(123);
- CacheablePtr valuePtr = CacheableString::create("123");
+ auto keyPtr = CacheableInt32::create(123);
+ auto valuePtr = CacheableString::create("123");
regionPtr->put(keyPtr, valuePtr);
LOGINFO("Put the second Entry into the Region");
// Get Entries back out of the Region.
- CacheablePtr result1Ptr = regionPtr->get("Key1");
+ auto result1Ptr = regionPtr->get("Key1");
LOGINFO("Obtained the first Entry from the Region");
- CacheablePtr result2Ptr = regionPtr->get(keyPtr);
+ auto result2Ptr = regionPtr->get(keyPtr);
LOGINFO("Obtained the second Entry from the Region");
// Destroy exampleRegion2.
- SerializablePtr userDataPtr = nullptr;
+ std::shared_ptr<Serializable> userDataPtr = nullptr;
regionPtr2->destroyRegion(userDataPtr);
try {
@@ -100,10 +99,10 @@ int main(int argc, char** argv) {
try {
// Its not valid to create two instances of Cache with different settings.
// If the settings are the same it returns the existing Cache instance.
- CacheFactoryPtr cacheFactory2 = CacheFactory::createCacheFactory(prp);
- CachePtr cachePtr1 = cacheFactory2->setSubscriptionEnabled(true)
- ->addServer("localhost", 40405)
- ->create();
+ auto cacheFactory2 = CacheFactory::createCacheFactory(prp);
+ auto cachePtr1 = cacheFactory2->setSubscriptionEnabled(true)
+ ->addServer("localhost", 40405)
+ ->create();
LOGINFO("UNEXPECTED: Cache create should not have succeeded");
return 1;
diff --git a/quickstart/cpp/ExecuteFunctions.cpp b/quickstart/cpp/ExecuteFunctions.cpp
index db9660f..d31d0f5 100644
--- a/quickstart/cpp/ExecuteFunctions.cpp
+++ b/quickstart/cpp/ExecuteFunctions.cpp
@@ -30,7 +30,6 @@
*/
// Include the Geode library.
-#include <geode/GeodeCppCache.hpp>
// Use the "geode" namespace.
using namespace apache::geode::client;
@@ -45,47 +44,48 @@ int main(int argc, char** argv) {
try {
// Create CacheFactory using the settings from the geode.properties file by
// default.
- CacheFactoryPtr cacheFactory = CacheFactory::createCacheFactory();
+ auto cacheFactory = CacheFactory::createCacheFactory();
LOGINFO("Created CacheFactory");
// Create a Geode Cache.
- CachePtr cachePtr = cacheFactory->setSubscriptionEnabled(true)
- ->addServer("localhost", 50505)
- ->addServer("localhost", 40404)
- ->create();
+ auto cachePtr = cacheFactory->setSubscriptionEnabled(true)
+ ->addServer("localhost", 50505)
+ ->addServer("localhost", 40404)
+ ->create();
LOGINFO("Created the Geode Cache");
// Create the example Region Programmatically
- RegionPtr regPtr0 = cachePtr->createRegionFactory(CACHING_PROXY)
- ->create("partition_region");
+ auto regPtr0 = cachePtr->createRegionFactory(CACHING_PROXY)
+ ->create("partition_region");
LOGINFO("Created the Region");
regPtr0->registerAllKeys();
char buf[128];
- CacheableVectorPtr resultList = CacheableVector::create();
+ auto resultList = CacheableVector::create();
for (int i = 0; i < 34; i++) {
sprintf(buf, "VALUE--%d", i);
- CacheablePtr value(CacheableString::create(buf));
+ std::shared_ptr<Cacheable> value(CacheableString::create(buf));
sprintf(buf, "KEY--%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
+ auto key = CacheableKey::create(buf);
regPtr0->put(key, value);
}
bool getResult = true;
- CacheableVectorPtr routingObj = CacheableVector::create();
+ auto routingObj = CacheableVector::create();
for (int i = 0; i < 34; i++) {
if (i % 2 == 0) continue;
sprintf(buf, "KEY--%d", i);
- CacheableKeyPtr key = CacheableKey::create(buf);
+ auto key = CacheableKey::create(buf);
routingObj->push_back(key);
}
LOGINFO("test data independent function with result on one server");
- CacheablePtr args = routingObj;
- ExecutionPtr exc = FunctionService::onServer((RegionServicePtr)cachePtr);
- CacheableVectorPtr executeFunctionResult =
+ auto args = routingObj;
+ auto exc =
+ FunctionService::onServer((std::shared_ptr<RegionService>)cachePtr);
+ auto executeFunctionResult =
exc->withArgs(args)->execute(getFuncIName)->getResult();
if (executeFunctionResult == nullptr) {
LOGINFO("get executeFunctionResult is NULL");
@@ -113,7 +113,7 @@ int main(int argc, char** argv) {
LOGINFO("test data independent function with result on all servers");
getResult = true;
- exc = FunctionService::onServers((RegionServicePtr)cachePtr);
+ exc = FunctionService::onServers((std::shared_ptr<RegionService>)cachePtr);
executeFunctionResult =
exc->withArgs(args)->execute(getFuncIName)->getResult();
if (executeFunctionResult == nullptr) {
diff --git a/quickstart/cpp/HACache.cpp b/quickstart/cpp/HACache.cpp
index 73a1bac..803d0c3 100644
--- a/quickstart/cpp/HACache.cpp
+++ b/quickstart/cpp/HACache.cpp
@@ -31,7 +31,6 @@
*/
// Include the Geode library.
-#include <geode/GeodeCppCache.hpp>
#include <chrono>
#include <thread>
@@ -41,12 +40,12 @@ using namespace apache::geode::client;
// The HA QuickStart example.
int main(int argc, char** argv) {
try {
- CacheFactoryPtr cacheFactory = CacheFactory::createCacheFactory();
+ auto cacheFactory = CacheFactory::createCacheFactory();
LOGINFO("Connected to the Geode Distributed System");
// Create a Geode Cache with the "clientHACache.xml" Cache XML file.
- CachePtr cachePtr =
+ auto cachePtr =
cacheFactory->set("cache-xml-file", "XMLs/clientHACache.xml")
->addServer("localhost", 40404)
->addServer("localhost", 40405)
@@ -58,14 +57,14 @@ int main(int argc, char** argv) {
// Get the example Region from the Cache which is declared in the Cache XML
// file.
- RegionPtr regionPtr = cachePtr->getRegion("exampleRegion");
+ auto regionPtr = cachePtr->getRegion("exampleRegion");
LOGINFO("Obtained the Region from the Cache");
// Register and Unregister Interest on Region for Some Keys.
- VectorOfCacheableKey keys;
- CacheableKeyPtr key1 = CacheableInt32::create(123);
- CacheableKeyPtr key2 = CacheableString::create("Key-123");
+ std::vector<std::shared_ptr<CacheableKey>> keys;
+ auto key1 = CacheableInt32::create(123);
+ auto key2 = CacheableString::create("Key-123");
keys.push_back(key1);
keys.push_back(key2);
regionPtr->registerKeys(keys);
diff --git a/quickstart/cpp/LoaderListenerWriter.cpp b/quickstart/cpp/LoaderListenerWriter.cpp
index 5794b58..639b879 100644
--- a/quickstart/cpp/LoaderListenerWriter.cpp
+++ b/quickstart/cpp/LoaderListenerWriter.cpp
@@ -35,7 +35,6 @@
*/
// Include the Geode library.
-#include <geode/GeodeCppCache.hpp>
// Include the SimpleCacheLoader, SimpleCacheListener and SimpleCacheWriter
// plugins.
@@ -49,11 +48,11 @@ using namespace apache::geode::client;
// The LoaderListenerWriter QuickStart example.
int main(int argc, char** argv) {
try {
- CacheFactoryPtr cacheFactory = CacheFactory::createCacheFactory();
+ auto cacheFactory = CacheFactory::createCacheFactory();
// Create a Geode Cache with the "clientLoaderListenerWriter.xml" Cache
// XML file.
- CachePtr cachePtr =
+ auto cachePtr =
cacheFactory
->set("cache-xml-file", "XMLs/clientLoaderListenerWriter.xml")
->create();
@@ -62,17 +61,19 @@ int main(int argc, char** argv) {
// Get the example Region from the Cache which is declared in the Cache XML
// file.
- RegionPtr regionPtr = cachePtr->getRegion("exampleRegion");
+ auto regionPtr = cachePtr->getRegion("exampleRegion");
LOGINFO("Obtained the Region from the Cache");
// Plugin the SimpleCacheLoader, SimpleCacheListener and SimpleCacheWrite to
// the Region.
- AttributesMutatorPtr attrMutatorPtr = regionPtr->getAttributesMutator();
- attrMutatorPtr->setCacheLoader(CacheLoaderPtr(new SimpleCacheLoader()));
+ auto attrMutatorPtr = regionPtr->getAttributesMutator();
+ attrMutatorPtr->setCacheLoader(
+ std::shared_ptr<CacheLoader>(new SimpleCacheLoader()));
attrMutatorPtr->setCacheListener(
- CacheListenerPtr(new SimpleCacheListener()));
- attrMutatorPtr->setCacheWriter(CacheWriterPtr(new SimpleCacheWriter()));
+ std::shared_ptr<CacheListener>(new SimpleCacheListener()));
+ attrMutatorPtr->setCacheWriter(
+ std::shared_ptr<CacheWriter>(new SimpleCacheWriter()));
LOGINFO("Attached the simple plugins on the Region");
diff --git a/quickstart/cpp/MultiuserSecurity.cpp b/quickstart/cpp/MultiuserSecurity.cpp
index 9aa240f..ec84f0e 100644
--- a/quickstart/cpp/MultiuserSecurity.cpp
+++ b/quickstart/cpp/MultiuserSecurity.cpp
@@ -30,29 +30,28 @@
*/
// Include the Geode library.
-#include <geode/GeodeCppCache.hpp>
// Use the "geode" namespace.
using namespace apache::geode::client;
char* getFuncIName = (char*)"MultiGetFunctionI";
-void runWithUserRoot(CachePtr cachePtr) {
+void runWithUserRoot(std::shared_ptr<Cache> cachePtr) {
// user root's credential who is authorized to do put/get operations
- PropertiesPtr credentials = Properties::create();
+ auto credentials = Properties::create();
credentials->insert("security-username", "root");
credentials->insert("security-password", "root");
// Create user cache by passing credentials
- RegionServicePtr userCache1 = cachePtr->createAuthenticatedView(credentials);
+ auto userCache1 = cachePtr->createAuthenticatedView(credentials);
// Create region using usercache
- RegionPtr regionPtr1 = userCache1->getRegion("partition_region");
+ auto regionPtr1 = userCache1->getRegion("partition_region");
LOGINFO("Obtained the Region from the Cache");
- CacheableKeyPtr key = CacheableKey::create("Key1");
+ auto key = CacheableKey::create("Key1");
// doing operation on behalf of user "writer2"
regionPtr1->put(key, "Value1");
@@ -60,24 +59,24 @@ void runWithUserRoot(CachePtr cachePtr) {
LOGINFO("Entry created in the Region");
// Get Entries back out of the Region.
- CacheablePtr result1Ptr = regionPtr1->get(key);
+ auto result1Ptr = regionPtr1->get(key);
// to execute function on server
bool getResult = true;
- CacheableVectorPtr routingObj = CacheableVector::create();
+ auto routingObj = CacheableVector::create();
routingObj->push_back(key);
// test data independant function with result on one server
LOGINFO("test data independant function with result on one server");
- CacheablePtr args = routingObj;
+ auto args = routingObj;
char buf[128];
- ExecutionPtr exc = FunctionService::onServer(userCache1);
+ auto exc = FunctionService::onServer(userCache1);
- CacheableVectorPtr executeFunctionResult =
+ auto executeFunctionResult =
exc->withArgs(args)->execute(getFuncIName, getResult)->getResult();
- CacheableVectorPtr resultList = CacheableVector::create();
+ auto resultList = CacheableVector::create();
if (executeFunctionResult == nullptr) {
LOGINFO("get executeFunctionResult is NULL");
} else {
@@ -100,10 +99,9 @@ void runWithUserRoot(CachePtr cachePtr) {
// test for Query
// Execute a Query which returns a ResultSet.
- QueryServicePtr qrySvcPtr = userCache1->getQueryService();
- QueryPtr qryPtr =
- qrySvcPtr->newQuery("SELECT DISTINCT * FROM /partition_region");
- SelectResultsPtr resultsPtr = qryPtr->execute();
+ auto qrySvcPtr = userCache1->getQueryService();
+ auto qryPtr = qrySvcPtr->newQuery("SELECT DISTINCT * FROM /partition_region");
+ auto resultsPtr = qryPtr->execute();
LOGINFO("ResultSet Query returned %d rows", resultsPtr->size());
@@ -113,23 +111,23 @@ void runWithUserRoot(CachePtr cachePtr) {
LOGINFO("User root done put/get ops successfully");
}
-void runWithUserWriter(CachePtr cachePtr) {
+void runWithUserWriter(std::shared_ptr<Cache> cachePtr) {
// user writer2's credentials who is authorixed to do only put operation
- PropertiesPtr credentials = Properties::create();
+ auto credentials = Properties::create();
credentials->insert("security-username", "writer2");
credentials->insert("security-password", "writer2");
// Create user cache by passing credentials
- RegionServicePtr userCache2 = cachePtr->createAuthenticatedView(credentials);
+ auto userCache2 = cachePtr->createAuthenticatedView(credentials);
// Create region using usercache
- RegionPtr regionPtr2 = userCache2->getRegion("partition_region");
+ auto regionPtr2 = userCache2->getRegion("partition_region");
LOGINFO("Entry created in the Region");
// Get Entries back out of the Region.
- CacheablePtr result1Ptr = regionPtr2->get("Key1");
+ auto result1Ptr = regionPtr2->get("Key1");
// collect NotAuthorized exception
@@ -140,7 +138,7 @@ void runWithUserWriter(CachePtr cachePtr) {
// The MultiuserSecurityExample QuickStart example.
int main(int argc, char** argv) {
try {
- PropertiesPtr secProp = Properties::create();
+ auto secProp = Properties::create();
// By setting this property client will send credential in encrypted form.
// to do this one need to setup OpenSSL.
@@ -151,19 +149,18 @@ int main(int argc, char** argv) {
// overriding secProp properties.
// Create a Geode Cache.
- CacheFactoryPtr cacheFactory = CacheFactory::createCacheFactory(secProp);
+ auto cacheFactory = CacheFactory::createCacheFactory(secProp);
- CachePtr cachePtr =
- cacheFactory->setMultiuserAuthentication(true)->create();
+ auto cachePtr = cacheFactory->setMultiuserAuthentication(true)->create();
LOGINFO("Created the Geode Cache with multiuser enable.");
- RegionFactoryPtr regionFactory = cachePtr->createRegionFactory(PROXY);
+ auto regionFactory = cachePtr->createRegionFactory(PROXY);
LOGINFO("Created the RegionFactory");
// Create the example Region Programmatically.
- RegionPtr regionPtr = regionFactory->create("partition_region");
+ auto regionPtr = regionFactory->create("partition_region");
runWithUserRoot(cachePtr);
diff --git a/quickstart/cpp/PdxInstance.cpp b/quickstart/cpp/PdxInstance.cpp
index 64ea59a..2ed3554 100644
--- a/quickstart/cpp/PdxInstance.cpp
+++ b/quickstart/cpp/PdxInstance.cpp
@@ -31,7 +31,6 @@
*/
// Include the Geode library.
-#include <geode/GeodeCppCache.hpp>
// Use the "geode" namespace.
using namespace apache::geode::client;
@@ -60,9 +59,9 @@ class Person {
int main(int argc, char** argv) {
try {
// Create a Geode Cache.
- CacheFactoryPtr cacheFactory = CacheFactory::createCacheFactory();
+ auto cacheFactory = CacheFactory::createCacheFactory();
- CachePtr cachePtr =
+ auto cachePtr =
cacheFactory->set("cache-xml-file", "XMLs/clientPdxInstance.xml")
->create();
@@ -70,14 +69,14 @@ int main(int argc, char** argv) {
// Get the example Region from the Cache which is declared in the Cache XML
// file.
- RegionPtr regionPtr = cachePtr->getRegion("Person");
+ auto regionPtr = cachePtr->getRegion("Person");
LOGINFO("Obtained the Region from the Cache.");
Person* p = new Person("Jack", 7, 21);
// PdxInstanceFactory for Person class
- PdxInstanceFactoryPtr pif = cachePtr->createPdxInstanceFactory("Person");
+ auto pif = cachePtr->createPdxInstanceFactory("Person");
LOGINFO("Created PdxInstanceFactory for Person class");
pif->writeString("m_name", p->getName());
@@ -85,7 +84,7 @@ int main(int argc, char** argv) {
pif->markIdentityField("m_id");
pif->writeInt("m_age", p->getAge());
- PdxInstancePtr pdxInstance = pif->create();
+ auto pdxInstance = pif->create();
LOGINFO("Created PdxInstance for Person class");
@@ -93,7 +92,9 @@ int main(int argc, char** argv) {
LOGINFO("Populated PdxInstance Object");
- PdxInstancePtr retPdxInstance = std::dynamic_pointer_cast<apache::geode::client::PdxInstance>(regionPtr->get("Key1"));
+ auto retPdxInstance =
+ std::dynamic_pointer_cast<apache::geode::client::PdxInstance>(
+ regionPtr->get("Key1"));
LOGINFO("Got PdxInstance Object");
diff --git a/quickstart/cpp/PdxRemoteQuery.cpp b/quickstart/cpp/PdxRemoteQuery.cpp
index be3fb9f..5208752 100644
--- a/quickstart/cpp/PdxRemoteQuery.cpp
+++ b/quickstart/cpp/PdxRemoteQuery.cpp
@@ -34,7 +34,6 @@
*/
// Include the Geode library.
-#include <geode/GeodeCppCache.hpp>
// Include our Query objects, viz. PortfolioPdx and PositionPdx.
#include "queryobjects/PortfolioPdx.hpp"
@@ -49,11 +48,11 @@ using namespace testobject;
// The PdxRemoteQuery QuickStart example.
int main(int argc, char** argv) {
try {
- CacheFactoryPtr cacheFactory = CacheFactory::createCacheFactory();
+ auto cacheFactory = CacheFactory::createCacheFactory();
// Create a Geode Cache with the "clientPdxRemoteQuery.xml" Cache XML
// file.
- CachePtr cachePtr =
+ auto cachePtr =
cacheFactory->set("cache-xml-file", "XMLs/clientPdxRemoteQuery.xml")
->create();
@@ -61,7 +60,7 @@ int main(int argc, char** argv) {
// Get the example Region from the Cache which is declared in the Cache XML
// file.
- RegionPtr regionPtr = cachePtr->getRegion("Portfolios");
+ auto regionPtr = cachePtr->getRegion("Portfolios");
LOGINFO("Obtained the Region from the Cache");
@@ -73,9 +72,12 @@ int main(int argc, char** argv) {
LOGINFO("Registered PDX Type Query Objects");
// Populate the Region with some Pdx Type objects, i.e PortfolioPdx objects.
- PortfolioPdxPtr port1Ptr(new PortfolioPdx(1 /*ID*/, 10 /*size*/));
- PortfolioPdxPtr port2Ptr(new PortfolioPdx(2 /*ID*/, 20 /*size*/));
- PortfolioPdxPtr port3Ptr(new PortfolioPdx(3 /*ID*/, 30 /*size*/));
+ std::shared_ptr<PortfolioPdx> port1Ptr(
+ new PortfolioPdx(1 /*ID*/, 10 /*size*/));
+ std::shared_ptr<PortfolioPdx> port2Ptr(
+ new PortfolioPdx(2 /*ID*/, 20 /*size*/));
+ std::shared_ptr<PortfolioPdx> port3Ptr(
+ new PortfolioPdx(3 /*ID*/, 30 /*size*/));
regionPtr->put("Key1", port1Ptr);
regionPtr->put("Key2", port2Ptr);
regionPtr->put("Key3", port3Ptr);
@@ -83,13 +85,13 @@ int main(int argc, char** argv) {
LOGINFO("Populated some PortfolioPdx Objects");
// Get the QueryService from the Cache.
- QueryServicePtr qrySvcPtr = cachePtr->getQueryService("examplePool");
+ auto qrySvcPtr = cachePtr->getQueryService("examplePool");
LOGINFO("Got the QueryService from the Cache");
// Execute a Query which returns a ResultSet.
- QueryPtr qryPtr = qrySvcPtr->newQuery("SELECT DISTINCT * FROM /Portfolios");
- SelectResultsPtr resultsPtr = qryPtr->execute();
+ auto qryPtr = qrySvcPtr->newQuery("SELECT DISTINCT * FROM /Portfolios");
+ auto resultsPtr = qryPtr->execute();
LOGINFO("ResultSet Query returned %d rows", resultsPtr->size());
@@ -118,7 +120,7 @@ int main(int argc, char** argv) {
LOGINFO("Region Query returned %d rows", resultsPtr->size());
// Execute the Region selectValue() API.
- SerializablePtr resultPtr = regionPtr->selectValue("ID = 3");
+ auto resultPtr = regionPtr->selectValue("ID = 3");
auto portPtr = std::dynamic_pointer_cast<PortfolioPdx>(resultPtr);
LOGINFO("Region selectValue() returned an item:\n %s",
diff --git a/quickstart/cpp/PdxSerializer.cpp b/quickstart/cpp/PdxSerializer.cpp
index 90250eb..fd62323 100644
--- a/quickstart/cpp/PdxSerializer.cpp
+++ b/quickstart/cpp/PdxSerializer.cpp
@@ -34,7 +34,6 @@
*/
// Include the Geode library.
-#include <geode/GeodeCppCache.hpp>
// Use the "geode" namespace.
using namespace apache::geode::client;
@@ -105,7 +104,7 @@ class PersonPdxSerializer : public PdxSerializer {
return NULL;
}
- void* fromData(const char* className, PdxReaderPtr pr) {
+ void* fromData(const char* className, std::shared_ptr<PdxReader> pr) {
if (strcmp(className, CLASSNAME) == 0) {
Person* per = new Person();
@@ -121,7 +120,8 @@ class PersonPdxSerializer : public PdxSerializer {
return NULL;
}
- bool toData(void* testObject, const char* className, PdxWriterPtr pw) {
+ bool toData(void* testObject, const char* className,
+ std::shared_ptr<PdxWriter> pw) {
if (strcmp(className, CLASSNAME) == 0) {
Person* per = reinterpret_cast<Person*>(testObject);
@@ -143,10 +143,10 @@ class PersonPdxSerializer : public PdxSerializer {
int main(int argc, char** argv) {
try {
// Create a Geode Cache.
- CacheFactoryPtr cacheFactory = CacheFactory::createCacheFactory();
+ auto cacheFactory = CacheFactory::createCacheFactory();
// Create a Geode Cache with the "clientPdxSerializer.xml" Cache XML file.
- CachePtr cachePtr =
+ auto cachePtr =
cacheFactory->set("cache-xml-file", "XMLs/clientPdxSerializer.xml")
->create();
@@ -154,42 +154,42 @@ int main(int argc, char** argv) {
// Get the example Region from the Cache which is declared in the Cache XML
// file.
- RegionPtr regionPtr = cachePtr->getRegion("Person");
+ auto regionPtr = cachePtr->getRegion("Person");
LOGINFO("Obtained the Region from the Cache.");
// Register PersonPdxSerializer to serialize the domain types(Person class)
// as pdx format
Serializable::registerPdxSerializer(
- PdxSerializerPtr(new PersonPdxSerializer));
+ std::shared_ptr<PdxSerializer>(new PersonPdxSerializer));
LOGINFO("Registered Person Query Objects");
// Populate the Region with some Person objects.
Person* p1 = new Person((char*)"John", 1 /*ID*/, 23 /*age*/);
- PdxWrapperPtr pdxobj1(new PdxWrapper(p1, CLASSNAME));
+ std::shared_ptr<PdxWrapper> pdxobj1(new PdxWrapper(p1, CLASSNAME));
regionPtr->put("Key1", pdxobj1);
Person* p2 = new Person((char*)"Jack", 2 /*ID*/, 20 /*age*/);
- PdxWrapperPtr pdxobj2(new PdxWrapper(p2, CLASSNAME));
+ std::shared_ptr<PdxWrapper> pdxobj2(new PdxWrapper(p2, CLASSNAME));
regionPtr->put("Key2", pdxobj2);
Person* p3 = new Person((char*)"Tony", 3 /*ID*/, 35 /*age*/);
- PdxWrapperPtr pdxobj3(new PdxWrapper(p3, CLASSNAME));
+ std::shared_ptr<PdxWrapper> pdxobj3(new PdxWrapper(p3, CLASSNAME));
regionPtr->put("Key3", pdxobj3);
LOGINFO("Populated some Person Objects through PdxWrapper");
// find the pool
- PoolPtr poolPtr = cachePtr->getPoolManager().find("examplePool");
+ auto poolPtr = cachePtr->getPoolManager().find("examplePool");
// Get the QueryService from the Pool.
- QueryServicePtr qrySvcPtr = poolPtr->getQueryService();
+ auto qrySvcPtr = poolPtr->getQueryService();
LOGINFO("Got the QueryService from the Pool");
// Execute a Query which returns a ResultSet.
- QueryPtr qryPtr = qrySvcPtr->newQuery("SELECT DISTINCT * FROM /Person");
- SelectResultsPtr resultsPtr = qryPtr->execute();
+ auto qryPtr = qrySvcPtr->newQuery("SELECT DISTINCT * FROM /Person");
+ auto resultsPtr = qryPtr->execute();
LOGINFO("ResultSet Query returned %d rows", resultsPtr->size());
@@ -218,7 +218,7 @@ int main(int argc, char** argv) {
LOGINFO("Region Query returned %d rows", resultsPtr->size());
// Execute the Region selectValue() API.
- PdxWrapperPtr pdxWrapperPtr =
+ auto pdxWrapperPtr =
std::dynamic_pointer_cast<apache::geode::client::PdxWrapper>(
regionPtr->selectValue("m_id = 3"));
Person* per = reinterpret_cast<Person*>(pdxWrapperPtr->getObject());
diff --git a/quickstart/cpp/PoolCqQuery.cpp b/quickstart/cpp/PoolCqQuery.cpp
index fc69953..da99ea7 100644
--- a/quickstart/cpp/PoolCqQuery.cpp
+++ b/quickstart/cpp/PoolCqQuery.cpp
@@ -33,7 +33,6 @@
*/
// Include the Geode library.
-#include <geode/GeodeCppCache.hpp>
// Include our Query objects, viz. Portfolio and Position.
#include "queryobjects/Portfolio.hpp"
@@ -49,8 +48,10 @@ class MyCqListener : public CqListener {
public:
void onEvent(const CqEvent& cqe) {
char* opStr = (char*)"Default";
- PortfolioPtr portfolio(dynamic_cast<Portfolio*>(cqe.getNewValue().get()));
- CacheableStringPtr key(dynamic_cast<CacheableString*>(cqe.getKey().get()));
+ std::shared_ptr<Portfolio> portfolio(
+ dynamic_cast<Portfolio*>(cqe.getNewValue().get()));
+ std::shared_ptr<CacheableString> key(
+ dynamic_cast<CacheableString*>(cqe.getKey().get()));
switch (cqe.getQueryOperation()) {
case CqOperation::OP_TYPE_CREATE: {
opStr = (char*)"CREATE";
@@ -82,21 +83,21 @@ int main(int argc, char** argv) {
try {
// Create CacheFactory using the user specified properties or from the
// geode.properties file by default.
- PropertiesPtr prp = Properties::create();
+ auto prp = Properties::create();
prp->insert("cache-xml-file", "XMLs/clientPoolCqQuery.xml");
- CacheFactoryPtr cacheFactory = CacheFactory::createCacheFactory(prp);
+ auto cacheFactory = CacheFactory::createCacheFactory(prp);
LOGINFO("Created CacheFactory");
// Create a Geode Cache with the "clientPoolCqQuery.xml" Cache XML file.
- CachePtr cachePtr = cacheFactory->create();
+ auto cachePtr = cacheFactory->create();
LOGINFO("Created the Geode Cache");
// Get the Portfolios Region from the Cache which is declared in the Cache
// XML file.
- RegionPtr regionPtr = cachePtr->getRegion("Portfolios");
+ auto regionPtr = cachePtr->getRegion("Portfolios");
LOGINFO("Obtained the Region from the Cache");
@@ -108,9 +109,9 @@ int main(int argc, char** argv) {
LOGINFO("Registered Serializable Query Objects");
// Populate the Region with some Portfolio objects.
- PortfolioPtr port1Ptr(new Portfolio(1 /*ID*/, 10 /*size*/));
- PortfolioPtr port2Ptr(new Portfolio(2 /*ID*/, 20 /*size*/));
- PortfolioPtr port3Ptr(new Portfolio(3 /*ID*/, 30 /*size*/));
+ std::shared_ptr<Portfolio> port1Ptr(new Portfolio(1 /*ID*/, 10 /*size*/));
+ std::shared_ptr<Portfolio> port2Ptr(new Portfolio(2 /*ID*/, 20 /*size*/));
+ std::shared_ptr<Portfolio> port3Ptr(new Portfolio(3 /*ID*/, 30 /*size*/));
regionPtr->put("Key1", port1Ptr);
regionPtr->put("Key2", port2Ptr);
@@ -119,22 +120,22 @@ int main(int argc, char** argv) {
LOGINFO("Populated some Portfolio Objects");
// Get the QueryService from the Cache.
- QueryServicePtr qrySvcPtr = cachePtr->getQueryService("examplePool");
+ auto qrySvcPtr = cachePtr->getQueryService("examplePool");
LOGINFO("Got the QueryService from the Cache");
// Create CqAttributes and Install Listener
CqAttributesFactory cqFac;
- CqListenerPtr cqLstner(new MyCqListener());
+ std::shared_ptr<CqListener> cqLstner(new MyCqListener());
cqFac.addCqListener(cqLstner);
- CqAttributesPtr cqAttr = cqFac.create();
+ auto cqAttr = cqFac.create();
// create a new Cq Query
const char* qryStr = "select * from /Portfolios p where p.ID < 5";
- CqQueryPtr qry = qrySvcPtr->newCq((char*)"MyCq", qryStr, cqAttr);
+ auto qry = qrySvcPtr->newCq((char*)"MyCq", qryStr, cqAttr);
// execute Cq Query with initial Results
- CqResultsPtr resultsPtr = qry->executeWithInitialResults();
+ auto resultsPtr = qry->executeWithInitialResults();
// make change to generate cq events
regionPtr->put("Key3", port1Ptr);
@@ -146,18 +147,18 @@ int main(int argc, char** argv) {
// Iterate through the rows of the query result.
SelectResultsIterator iter = resultsPtr->getIterator();
while (iter.hasNext()) {
- SerializablePtr ser = iter.next();
+ auto ser = iter.next();
if (ser != nullptr) {
LOGINFO(" query pulled object %s\n", ser->toString()->asChar());
- StructPtr stPtr(dynamic_cast<Struct*>(ser.get()));
+ std::shared_ptr<Struct> stPtr(dynamic_cast<Struct*>(ser.get()));
if (stPtr != nullptr) {
LOGINFO(" got struct ptr ");
- SerializablePtr serKey = (*(stPtr.get()))["key"];
+ auto serKey = (*(stPtr.get()))["key"];
if (serKey != nullptr) {
LOGINFO("got struct key %s\n", serKey->toString()->asChar());
}
- SerializablePtr serVal = (*(stPtr.get()))["value"];
+ auto serVal = (*(stPtr.get()))["value"];
if (serVal != nullptr) {
LOGINFO(" got struct value %s\n", serVal->toString()->asChar());
diff --git a/quickstart/cpp/PoolRemoteQuery.cpp b/quickstart/cpp/PoolRemoteQuery.cpp
index 9172959..04f0e01 100644
--- a/quickstart/cpp/PoolRemoteQuery.cpp
+++ b/quickstart/cpp/PoolRemoteQuery.cpp
@@ -34,7 +34,6 @@
*/
// Include the Geode library.
-#include <geode/GeodeCppCache.hpp>
// Include our Query objects, viz. Portfolio and Position.
#include "queryobjects/Portfolio.hpp"
@@ -49,11 +48,11 @@ using namespace testobject;
// The PoolRemoteQuery QuickStart example.
int main(int argc, char** argv) {
try {
- CacheFactoryPtr cacheFactory = CacheFactory::createCacheFactory();
+ auto cacheFactory = CacheFactory::createCacheFactory();
// Create a Geode Cache with the "clientRemoteQueryWithPool.xml" Cache XML
// file.
- CachePtr cachePtr =
+ auto cachePtr =
cacheFactory->set("cache-xml-file", "XMLs/clientPoolRemoteQuery.xml")
->create();
@@ -61,7 +60,7 @@ int main(int argc, char** argv) {
// Get the example Region from the Cache which is declared in the Cache XML
// file.
- RegionPtr regionPtr = cachePtr->getRegion("Portfolios");
+ auto regionPtr = cachePtr->getRegion("Portfolios");
LOGINFO("Obtained the Region from the Cache");
@@ -73,9 +72,9 @@ int main(int argc, char** argv) {
LOGINFO("Registered Serializable Query Objects");
// Populate the Region with some Portfolio objects.
- PortfolioPtr port1Ptr(new Portfolio(1 /*ID*/, 10 /*size*/));
- PortfolioPtr port2Ptr(new Portfolio(2 /*ID*/, 20 /*size*/));
- PortfolioPtr port3Ptr(new Portfolio(3 /*ID*/, 30 /*size*/));
+ std::shared_ptr<Portfolio> port1Ptr(new Portfolio(1 /*ID*/, 10 /*size*/));
+ std::shared_ptr<Portfolio> port2Ptr(new Portfolio(2 /*ID*/, 20 /*size*/));
+ std::shared_ptr<Portfolio> port3Ptr(new Portfolio(3 /*ID*/, 30 /*size*/));
regionPtr->put("Key1", port1Ptr);
regionPtr->put("Key2", port2Ptr);
regionPtr->put("Key3", port3Ptr);
@@ -83,13 +82,13 @@ int main(int argc, char** argv) {
LOGINFO("Populated some Portfolio Objects");
// Get the QueryService from the Cache.
- QueryServicePtr qrySvcPtr = cachePtr->getQueryService("examplePool");
+ auto qrySvcPtr = cachePtr->getQueryService("examplePool");
LOGINFO("Got the QueryService from the Cache");
// Execute a Query which returns a ResultSet.
- QueryPtr qryPtr = qrySvcPtr->newQuery("SELECT DISTINCT * FROM /Portfolios");
- SelectResultsPtr resultsPtr = qryPtr->execute();
+ auto qryPtr = qrySvcPtr->newQuery("SELECT DISTINCT * FROM /Portfolios");
+ auto resultsPtr = qryPtr->execute();
LOGINFO("ResultSet Query returned %d rows", resultsPtr->size());
@@ -118,7 +117,7 @@ int main(int argc, char** argv) {
LOGINFO("Region Query returned %d rows", resultsPtr->size());
// Execute the Region selectValue() API.
- SerializablePtr resultPtr = regionPtr->selectValue("ID = 3");
+ auto resultPtr = regionPtr->selectValue("ID = 3");
auto portPtr = std::dynamic_pointer_cast<Portfolio>(resultPtr);
LOGINFO("Region selectValue() returned an item:\n %s",
diff --git a/quickstart/cpp/PoolWithEndpoints.cpp b/quickstart/cpp/PoolWithEndpoints.cpp
index 4c5fa59..ccadce6 100644
--- a/quickstart/cpp/PoolWithEndpoints.cpp
+++ b/quickstart/cpp/PoolWithEndpoints.cpp
@@ -34,7 +34,6 @@
*/
// Include the Geode library.
-#include <geode/GeodeCppCache.hpp>
// Use the "geode" namespace.
using namespace apache::geode::client;
@@ -44,27 +43,26 @@ int main(int argc, char** argv) {
try {
// Create CacheFactory using the settings from the geode.properties file by
// default.
- CacheFactoryPtr cacheFactory = CacheFactory::createCacheFactory();
+ auto cacheFactory = CacheFactory::createCacheFactory();
LOGINFO("Created CacheFactory");
// Create a Geode Cache.
- CachePtr cachePtr = cacheFactory->setSubscriptionEnabled(true)->create();
+ auto cachePtr = cacheFactory->setSubscriptionEnabled(true)->create();
LOGINFO("Created the Geode Cache");
// Create Poolfactory with endpoint and then create pool using poolfactory.
- PoolFactoryPtr pfact = cachePtr->getPoolManager().createFactory();
+ auto pfact = cachePtr->getPoolManager().createFactory();
pfact->addServer("localhost", 40404);
- PoolPtr pptr = pfact->create("examplePool");
+ auto pptr = pfact->create("examplePool");
- RegionFactoryPtr regionFactory =
- cachePtr->createRegionFactory(CACHING_PROXY);
+ auto regionFactory = cachePtr->createRegionFactory(CACHING_PROXY);
LOGINFO("Created the RegionFactory");
// Create the example Region programmatically.
- RegionPtr regionPtr =
+ auto regionPtr =
regionFactory->setPoolName("examplePool")->create("exampleRegion");
LOGINFO("Created the Region Programmatically");
@@ -76,18 +74,18 @@ int main(int argc, char** argv) {
LOGINFO("Put the first Entry into the Region");
// Put an Entry into the Region by manually creating a Key and a Value pair.
- CacheableKeyPtr keyPtr = CacheableInt32::create(123);
- CacheablePtr valuePtr = CacheableString::create("123");
+ auto keyPtr = CacheableInt32::create(123);
+ auto valuePtr = CacheableString::create("123");
regionPtr->put(keyPtr, valuePtr);
LOGINFO("Put the second Entry into the Region");
// Get Entries back out of the Region.
- CacheablePtr result1Ptr = regionPtr->get("Key1");
+ auto result1Ptr = regionPtr->get("Key1");
LOGINFO("Obtained the first Entry from the Region");
- CacheablePtr result2Ptr = regionPtr->get(keyPtr);
+ auto result2Ptr = regionPtr->get(keyPtr);
LOGINFO("Obtained the second Entry from the Region");
diff --git a/quickstart/cpp/PutAllGetAllOperations.cpp b/quickstart/cpp/PutAllGetAllOperations.cpp
index 5750fc4..46a227a 100644
--- a/quickstart/cpp/PutAllGetAllOperations.cpp
+++ b/quickstart/cpp/PutAllGetAllOperations.cpp
@@ -30,7 +30,6 @@
*/
// Include the Geode library.
-#include <geode/GeodeCppCache.hpp>
// Use the "geode" namespace.
using namespace apache::geode::client;
@@ -40,16 +39,15 @@ int main(int argc, char** argv) {
try {
// Create a Geode Cache using CacheFactory. By default it will connect to
// "localhost" at port 40404".
- CachePtr cachePtr = CacheFactory::createCacheFactory()->create();
+ auto cachePtr = CacheFactory::createCacheFactory()->create();
LOGINFO("Created the Geode Cache");
// Set Attributes for the region.
- RegionFactoryPtr regionFactory =
- cachePtr->createRegionFactory(CACHING_PROXY);
+ auto regionFactory = cachePtr->createRegionFactory(CACHING_PROXY);
// Create exampleRegion.
- RegionPtr regionPtr = regionFactory->create("exampleRegion");
+ auto regionPtr = regionFactory->create("exampleRegion");
LOGINFO("Created the Region");
@@ -67,13 +65,13 @@ int main(int argc, char** argv) {
LOGINFO("PutAll 100 entries into the Region");
// GetAll Entries back out of the Region
- VectorOfCacheableKey keys;
+ std::vector<std::shared_ptr<CacheableKey>> keys;
for (int32_t item = 0; item < 100; item++) {
sprintf(key, "key-%d", item);
keys.push_back(CacheableKey::create(key));
}
- HashMapOfCacheablePtr values(new HashMapOfCacheable());
+ std::shared_ptr<HashMapOfCacheable> values(new HashMapOfCacheable());
regionPtr->getAll(keys, values, nullptr, true);
LOGINFO("Obtained 100 entries from the Region");
diff --git a/quickstart/cpp/RefIDExample.cpp b/quickstart/cpp/RefIDExample.cpp
index b29d14c..8899e92 100644
--- a/quickstart/cpp/RefIDExample.cpp
+++ b/quickstart/cpp/RefIDExample.cpp
@@ -35,7 +35,6 @@
*/
// Include the Geode library.
-#include <geode/GeodeCppCache.hpp>
// Use the "geode" namespace.
using namespace apache::geode::client;
@@ -44,27 +43,27 @@ using namespace apache::geode::client;
int main(int argc, char** argv) {
try {
// Create a Geode Cache using XMLs/clientRefIDExample.xml.
- PropertiesPtr prptr = Properties::create();
+ auto prptr = Properties::create();
prptr->insert("cache-xml-file", "XMLs/clientRefIDExample.xml");
- CacheFactoryPtr cacheFactory = CacheFactory::createCacheFactory(prptr);
+ auto cacheFactory = CacheFactory::createCacheFactory(prptr);
- CachePtr cachePtr = cacheFactory->create();
+ auto cachePtr = cacheFactory->create();
LOGINFO("Created the Geode Cache");
// get the root1 Region.
- RegionPtr regionPtr1 = cachePtr->getRegion("root1");
+ auto regionPtr1 = cachePtr->getRegion("root1");
LOGINFO("Obtained the root1 Region from the Cache");
// get the root2 Region.
- RegionPtr regionPtr2 = cachePtr->getRegion("root2");
+ auto regionPtr2 = cachePtr->getRegion("root2");
LOGINFO("Obtained the root2 Region from the Cache");
- RegionAttributesPtr rAttPtr1 = regionPtr1->getAttributes();
- RegionAttributesPtr rAttPtr2 = regionPtr2->getAttributes();
+ std::shared_ptr<RegionAttributes> rAttPtr1 = regionPtr1->getAttributes();
+ std::shared_ptr<RegionAttributes> rAttPtr2 = regionPtr2->getAttributes();
bool isCacheEnabled1 = rAttPtr1->getCachingEnabled();
LOGINFO("For region root1 cachingEnabled is %s ",
@@ -82,16 +81,16 @@ int main(int argc, char** argv) {
LOGINFO("Put the first Entries into both the Regions");
// Put an Entry into the Region by manually creating a Key and a Value pair.
- CacheableKeyPtr keyPtr = CacheableInt32::create(123);
- CacheablePtr valuePtr = CacheableString::create("123");
+ auto keyPtr = CacheableInt32::create(123);
+ auto valuePtr = CacheableString::create("123");
regionPtr1->put(keyPtr, valuePtr);
regionPtr2->put(keyPtr, valuePtr);
LOGINFO("Put the second Entries into both the Regions.");
// Get Entries back out of the Region.
- CacheablePtr resultPtr1 = regionPtr1->get("Key1");
- CacheablePtr resultPtr2 = regionPtr2->get("Key1");
+ auto resultPtr1 = regionPtr1->get("Key1");
+ auto resultPtr2 = regionPtr2->get("Key1");
LOGINFO("Obtained the first Entry from both the Regions");
resultPtr1 = regionPtr1->get(keyPtr);
diff --git a/quickstart/cpp/RegisterInterest.cpp b/quickstart/cpp/RegisterInterest.cpp
index d3f4807..177e09f 100644
--- a/quickstart/cpp/RegisterInterest.cpp
+++ b/quickstart/cpp/RegisterInterest.cpp
@@ -32,7 +32,6 @@
*/
// Include the Geode library.
-#include <geode/GeodeCppCache.hpp>
// Use the "geode" namespace.
using namespace apache::geode::client;
@@ -42,22 +41,22 @@ int main(int argc, char** argv) {
try {
// Create CacheFactory using the user specified properties or from the
// geode.properties file by default.
- PropertiesPtr prp = Properties::create();
+ auto prp = Properties::create();
prp->insert("cache-xml-file", "XMLs/clientRegisterInterest.xml");
- CacheFactoryPtr cacheFactory = CacheFactory::createCacheFactory(prp);
+ auto cacheFactory = CacheFactory::createCacheFactory(prp);
LOGINFO("Created CacheFactory");
// Create a Geode Cache with the "clientRegisterInterest.xml" Cache XML
// file.
- CachePtr cachePtr = cacheFactory->create();
+ auto cachePtr = cacheFactory->create();
LOGINFO("Created the Geode Cache");
// Get the example Region from the Cache which is declared in the Cache XML
// file.
- RegionPtr regionPtr = cachePtr->getRegion("exampleRegion");
+ auto regionPtr = cachePtr->getRegion("exampleRegion");
LOGINFO("Obtained the Region from the Cache");
@@ -68,7 +67,7 @@ int main(int argc, char** argv) {
LOGINFO("Called registerAllKeys() and unregisterAllKeys()");
// Register and Unregister Interest on Region for Some Keys.
- VectorOfCacheableKey keys;
+ std::vector<std::shared_ptr<CacheableKey>> keys;
keys.push_back(CacheableInt32::create(123));
keys.push_back(CacheableString::create("Key-123"));
regionPtr->registerKeys(keys);
diff --git a/quickstart/cpp/RemoteQuery.cpp b/quickstart/cpp/RemoteQuery.cpp
index 7694ba8..e0584e6 100644
--- a/quickstart/cpp/RemoteQuery.cpp
+++ b/quickstart/cpp/RemoteQuery.cpp
@@ -31,7 +31,6 @@
*/
// Include the Geode library.
-#include <geode/GeodeCppCache.hpp>
// Include our Query objects, viz. Portfolio and Position.
#include "queryobjects/Portfolio.hpp"
@@ -47,18 +46,17 @@ using namespace testobject;
int main(int argc, char** argv) {
try {
// Create a Geode Cache Programmatically.
- CacheFactoryPtr cacheFactory = CacheFactory::createCacheFactory();
- CachePtr cachePtr = cacheFactory->setSubscriptionEnabled(true)->create();
+ auto cacheFactory = CacheFactory::createCacheFactory();
+ auto cachePtr = cacheFactory->setSubscriptionEnabled(true)->create();
LOGINFO("Created the Geode Cache");
- RegionFactoryPtr regionFactory =
- cachePtr->createRegionFactory(CACHING_PROXY);
+ auto regionFactory = cachePtr->createRegionFactory(CACHING_PROXY);
LOGINFO("Created the RegionFactory");
// Create the example Region programmatically.
- RegionPtr regionPtr = regionFactory->create("Portfolios");
+ auto regionPtr = regionFactory->create("Portfolios");
LOGINFO("Created the Region.");
@@ -70,9 +68,9 @@ int main(int argc, char** argv) {
LOGINFO("Registered Serializable Query Objects");
// Populate the Region with some Portfolio objects.
- PortfolioPtr port1Ptr(new Portfolio(1 /*ID*/, 10 /*size*/));
- PortfolioPtr port2Ptr(new Portfolio(2 /*ID*/, 20 /*size*/));
- PortfolioPtr port3Ptr(new Portfolio(3 /*ID*/, 30 /*size*/));
+ std::shared_ptr<Portfolio> port1Ptr(new Portfolio(1 /*ID*/, 10 /*size*/));
+ std::shared_ptr<Portfolio> port2Ptr(new Portfolio(2 /*ID*/, 20 /*size*/));
+ std::shared_ptr<Portfolio> port3Ptr(new Portfolio(3 /*ID*/, 30 /*size*/));
regionPtr->put("Key1", port1Ptr);
regionPtr->put("Key2", port2Ptr);
regionPtr->put("Key3", port3Ptr);
@@ -80,13 +78,13 @@ int main(int argc, char** argv) {
LOGINFO("Populated some Portfolio Objects");
// Get the QueryService from the Cache.
- QueryServicePtr qrySvcPtr = cachePtr->getQueryService();
+ auto qrySvcPtr = cachePtr->getQueryService();
LOGINFO("Got the QueryService from the Cache");
// Execute a Query which returns a ResultSet.
- QueryPtr qryPtr = qrySvcPtr->newQuery("SELECT DISTINCT * FROM /Portfolios");
- SelectResultsPtr resultsPtr = qryPtr->execute();
+ auto qryPtr = qrySvcPtr->newQuery("SELECT DISTINCT * FROM /Portfolios");
+ auto resultsPtr = qryPtr->execute();
LOGINFO("ResultSet Query returned %d rows", resultsPtr->size());
@@ -115,7 +113,7 @@ int main(int argc, char** argv) {
LOGINFO("Region Query returned %d rows", resultsPtr->size());
// Execute the Region selectValue() API.
- SerializablePtr resultPtr = regionPtr->selectValue("ID = 3");
+ auto resultPtr = regionPtr->selectValue("ID = 3");
auto portPtr = std::dynamic_pointer_cast<Portfolio>(resultPtr);
LOGINFO("Region selectValue() returned an item:\n %s",
@@ -128,15 +126,15 @@ int main(int argc, char** argv) {
// Execute the parameterized query
// Populate the parameter list (paramList) for the query.
- QueryPtr pqryPtr = qrySvcPtr->newQuery(
+ auto pqryPtr = qrySvcPtr->newQuery(
"SELECT DISTINCT ID, status FROM /Portfolios WHERE ID > $1 and "
"status=$2");
- CacheableVectorPtr paramList = CacheableVector::create();
+ auto paramList = CacheableVector::create();
paramList->push_back(Cacheable::create(1)); // Param-1
paramList->push_back(Cacheable::create("active")); // Param-2
- SelectResultsPtr pqresultsPtr = pqryPtr->execute(paramList);
+ auto pqresultsPtr = pqryPtr->execute(paramList);
LOGINFO("StructSet Query returned %d rows", pqresultsPtr->size());
diff --git a/quickstart/cpp/Security.cpp b/quickstart/cpp/Security.cpp
index 739b5cc..7e65856 100644
--- a/quickstart/cpp/Security.cpp
+++ b/quickstart/cpp/Security.cpp
@@ -28,7 +28,6 @@
*/
// Include the Geode library.
-#include <geode/GeodeCppCache.hpp>
// Use the "geode" namespace.
using namespace apache::geode::client;
@@ -38,7 +37,7 @@ int main(int argc, char** argv) {
try {
// Create client's Authentication Intializer and Credentials using api (
// Same can be set to geode.properties & comment following code ).
- PropertiesPtr properties = Properties::create();
+ auto properties = Properties::create();
properties->insert("security-client-auth-factory",
"createPKCSAuthInitInstance");
properties->insert("security-client-auth-library", "securityImpl");
@@ -48,18 +47,18 @@ int main(int argc, char** argv) {
properties->insert("cache-xml-file", "XMLs/clientSecurity.xml");
// overriding secProp properties.
- CacheFactoryPtr cacheFactory = CacheFactory::createCacheFactory(properties);
+ auto cacheFactory = CacheFactory::createCacheFactory(properties);
LOGINFO("Connected to the Geode Distributed System");
// Create a Geode Cache with the "clientSecurity.xml" Cache XML file.
- CachePtr cachePtr = cacheFactory->create();
+ auto cachePtr = cacheFactory->create();
LOGINFO("Created the Geode Cache");
// Get the example Region from the Cache which is declared in the Cache XML
// file.
- RegionPtr regionPtr = cachePtr->getRegion("exampleRegion");
+ auto regionPtr = cachePtr->getRegion("exampleRegion");
LOGINFO("Obtained the Region from the Cache");
@@ -71,7 +70,7 @@ int main(int argc, char** argv) {
try {
// Get Entries back out of the Region.
- CacheablePtr result1Ptr = regionPtr->get("Key1");
+ auto result1Ptr = regionPtr->get("Key1");
// collect NotAuthorized exception
} catch (const apache::geode::client::NotAuthorizedException& expected) {
diff --git a/quickstart/cpp/Transactions.cpp b/quickstart/cpp/Transactions.cpp
index cc3e3b4..0ff3500 100644
--- a/quickstart/cpp/Transactions.cpp
+++ b/quickstart/cpp/Transactions.cpp
@@ -36,7 +36,6 @@
*/
// Include the Geode library.
-#include <geode/GeodeCppCache.hpp>
// Use the "geode" namespace.
using namespace apache::geode::client;
@@ -45,24 +44,22 @@ using namespace apache::geode::client;
int main(int argc, char** argv) {
try {
// Create a Geode Cache.
- CacheFactoryPtr cacheFactory = CacheFactory::createCacheFactory();
+ auto cacheFactory = CacheFactory::createCacheFactory();
- CachePtr cachePtr = cacheFactory->create();
+ auto cachePtr = cacheFactory->create();
LOGINFO("Created the Geode Cache");
- RegionFactoryPtr regionFactory =
- cachePtr->createRegionFactory(CACHING_PROXY);
+ auto regionFactory = cachePtr->createRegionFactory(CACHING_PROXY);
LOGINFO("Created the RegionFactory");
// Create the example Region Programmatically.
- RegionPtr regionPtr = regionFactory->create("exampleRegion");
+ auto regionPtr = regionFactory->create("exampleRegion");
- CacheableKeyPtr keyPtr = CacheableInt32::create(123);
+ auto keyPtr = CacheableInt32::create(123);
LOGINFO("Created the Region Programmatically.");
- CacheTransactionManagerPtr txManager =
- cachePtr->getCacheTransactionManager();
+ auto txManager = cachePtr->getCacheTransactionManager();
// start a transaction
txManager->begin();
LOGINFO("Transaction Started");
diff --git a/quickstart/cpp/TransactionsXA.cpp b/quickstart/cpp/TransactionsXA.cpp
index 745f83f..baef8bd 100644
--- a/quickstart/cpp/TransactionsXA.cpp
+++ b/quickstart/cpp/TransactionsXA.cpp
@@ -38,7 +38,6 @@
*/
// Include the Geode library.
-#include <geode/GeodeCppCache.hpp>
// Use the "geode" namespace.
using namespace apache::geode::client;
@@ -47,26 +46,25 @@ using namespace apache::geode::client;
int main(int argc, char** argv) {
try {
// Create a Geode Cache.
- CacheFactoryPtr cacheFactory = CacheFactory::createCacheFactory();
+ auto cacheFactory = CacheFactory::createCacheFactory();
- CachePtr cachePtr = cacheFactory->create();
+ auto cachePtr = cacheFactory->create();
LOGINFO("Created the Geode Cache");
- RegionFactoryPtr regionFactory =
- cachePtr->createRegionFactory(CACHING_PROXY);
+ auto regionFactory = cachePtr->createRegionFactory(CACHING_PROXY);
LOGINFO("Created the RegionFactory");
// Create the example Region Programmatically.
- RegionPtr regionPtr = regionFactory->create("exampleRegion");
+ auto regionPtr = regionFactory->create("exampleRegion");
- CacheableKeyPtr keyPtr = CacheableInt32::create(123);
+ auto keyPtr = CacheableInt32::create(123);
LOGINFO("Created the Region Programmatically.");
- InternalCacheTransactionManager2PCPtr txManager =
- std::dynamic_pointer_cast<apache::geode::client::InternalCacheTransactionManager2PC>(
- cachePtr->getCacheTransactionManager());
+ auto txManager = std::dynamic_pointer_cast<
+ apache::geode::client::InternalCacheTransactionManager2PC>(
+ cachePtr->getCacheTransactionManager());
// start a transaction
txManager->begin();
diff --git a/quickstart/cpp/deltaobjects/DeltaExample.hpp b/quickstart/cpp/deltaobjects/DeltaExample.hpp
index 76702d6..c0bd077 100644
--- a/quickstart/cpp/deltaobjects/DeltaExample.hpp
+++ b/quickstart/cpp/deltaobjects/DeltaExample.hpp
@@ -18,8 +18,6 @@
#ifndef __Delta_Example__
#define __Delta_Example__
-#include <geode/GeodeCppCache.hpp>
-
using namespace apache::geode::client;
class DeltaExample : public Cacheable, public Delta {
@@ -147,7 +145,9 @@ class DeltaExample : public Cacheable, public Delta {
virtual uint32_t objectSize() const { return 0; }
- DeltaPtr clone() { return DeltaPtr(new DeltaExample(this)); }
+ std::shared_ptr<Delta> clone() {
+ return std::shared_ptr<Delta>(new DeltaExample(this));
+ }
virtual ~DeltaExample() {}
diff --git a/quickstart/cpp/plugins/DurableCacheListener.hpp b/quickstart/cpp/plugins/DurableCacheListener.hpp
index 0ab8ed5..b483d65 100644
--- a/quickstart/cpp/plugins/DurableCacheListener.hpp
+++ b/quickstart/cpp/plugins/DurableCacheListener.hpp
@@ -24,7 +24,6 @@
*/
// Include the Geode library.
-#include <geode/GeodeCppCache.hpp>
#include <geode/CacheListener.hpp>
// Use the "geode" namespace.
diff --git a/quickstart/cpp/plugins/SimpleCacheListener.cpp b/quickstart/cpp/plugins/SimpleCacheListener.cpp
index 77ad48e..d763204 100644
--- a/quickstart/cpp/plugins/SimpleCacheListener.cpp
+++ b/quickstart/cpp/plugins/SimpleCacheListener.cpp
@@ -41,6 +41,6 @@ void SimpleCacheListener::afterRegionDestroy(const RegionEvent& event) {
LOGINFO("SimpleCacheListener: Got an afterRegionDestroy event.");
}
-void SimpleCacheListener::close(const RegionPtr& region) {
+void SimpleCacheListener::close(const std::shared_ptr<Region>& region) {
LOGINFO("SimpleCacheListener: Got a close event.");
}
diff --git a/quickstart/cpp/plugins/SimpleCacheListener.hpp b/quickstart/cpp/plugins/SimpleCacheListener.hpp
index 87a2415..904bb47 100644
--- a/quickstart/cpp/plugins/SimpleCacheListener.hpp
+++ b/quickstart/cpp/plugins/SimpleCacheListener.hpp
@@ -24,7 +24,6 @@
*/
// Include the Geode library.
-#include <geode/GeodeCppCache.hpp>
#include <geode/CacheListener.hpp>
// Use the "geode" namespace.
@@ -40,5 +39,5 @@ class SimpleCacheListener : public CacheListener {
virtual void afterDestroy(const EntryEvent& event);
virtual void afterRegionInvalidate(const RegionEvent& event);
virtual void afterRegionDestroy(const RegionEvent& event);
- virtual void close(const RegionPtr& region);
+ virtual void close(const std::shared_ptr<Region>& region);
};
diff --git a/quickstart/cpp/plugins/SimpleCacheLoader.cpp b/quickstart/cpp/plugins/SimpleCacheLoader.cpp
index 9b73d75..9644a04 100644
--- a/quickstart/cpp/plugins/SimpleCacheLoader.cpp
+++ b/quickstart/cpp/plugins/SimpleCacheLoader.cpp
@@ -16,18 +16,18 @@
*/
#include "SimpleCacheLoader.hpp"
-
-CacheablePtr SimpleCacheLoader::load(const RegionPtr& region,
- const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument) {
+std::shared_ptr<Cacheable> SimpleCacheLoader::load(
+ const std::shared_ptr<Region>& region,
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument) {
LOGINFO("SimpleCacheLoader: Got a load event.");
- CacheablePtr value = CacheableString::create("LoaderValue");
+ auto value = CacheableString::create("LoaderValue");
return value;
}
-void SimpleCacheLoader::close(const RegionPtr& region) {
+void SimpleCacheLoader::close(const std::shared_ptr<Region>& region) {
LOGINFO("SimpleCacheLoader: Got a close event.");
}
diff --git a/quickstart/cpp/plugins/SimpleCacheLoader.hpp b/quickstart/cpp/plugins/SimpleCacheLoader.hpp
index 0082317..b4bb8ab 100644
--- a/quickstart/cpp/plugins/SimpleCacheLoader.hpp
+++ b/quickstart/cpp/plugins/SimpleCacheLoader.hpp
@@ -24,7 +24,6 @@
*/
// Include the Geode library.
-#include <geode/GeodeCppCache.hpp>
#include <geode/CacheLoader.hpp>
// Use the "geode" namespace.
@@ -33,8 +32,10 @@ using namespace apache::geode::client;
// The SimpleCacheLoader class.
class SimpleCacheLoader : public CacheLoader {
public:
- virtual CacheablePtr load(const RegionPtr& region, const CacheableKeyPtr& key,
- const SerializablePtr& aCallbackArgument);
+ virtual std::shared_ptr<Cacheable> load(
+ const std::shared_ptr<Region>& region,
+ const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Serializable>& aCallbackArgument);
- virtual void close(const RegionPtr& region);
+ virtual void close(const std::shared_ptr<Region>& region);
};
diff --git a/quickstart/cpp/plugins/SimpleCacheWriter.cpp b/quickstart/cpp/plugins/SimpleCacheWriter.cpp
index 375a9e3..e8a1416 100644
--- a/quickstart/cpp/plugins/SimpleCacheWriter.cpp
+++ b/quickstart/cpp/plugins/SimpleCacheWriter.cpp
@@ -45,6 +45,6 @@ bool SimpleCacheWriter::beforeRegionDestroy(const RegionEvent& event) {
return true;
}
-void SimpleCacheWriter::close(const RegionPtr& region) {
+void SimpleCacheWriter::close(const std::shared_ptr<Region>& region) {
LOGINFO("SimpleCacheWriter: Got a close event.");
}
diff --git a/quickstart/cpp/plugins/SimpleCacheWriter.hpp b/quickstart/cpp/plugins/SimpleCacheWriter.hpp
index 7c25720..cd13f4b 100644
--- a/quickstart/cpp/plugins/SimpleCacheWriter.hpp
+++ b/quickstart/cpp/plugins/SimpleCacheWriter.hpp
@@ -24,7 +24,6 @@
*/
// Include the Geode library.
-#include <geode/GeodeCppCache.hpp>
#include <geode/CacheWriter.hpp>
// Use the "geode" namespace.
@@ -40,5 +39,5 @@ class SimpleCacheWriter : public CacheWriter {
virtual bool beforeDestroy(const EntryEvent& event);
virtual void beforeRegionInvalidate(const RegionEvent& event);
virtual bool beforeRegionDestroy(const RegionEvent& event);
- virtual void close(const RegionPtr& region);
+ virtual void close(const std::shared_ptr<Region>& region);
};
diff --git a/quickstart/cpp/queryobjects/Portfolio.cpp b/quickstart/cpp/queryobjects/Portfolio.cpp
index 351c714..5444b89 100644
--- a/quickstart/cpp/queryobjects/Portfolio.cpp
+++ b/quickstart/cpp/queryobjects/Portfolio.cpp
@@ -24,7 +24,8 @@ using namespace testobject;
const char* Portfolio::secIds[] = {"SUN", "IBM", "YHOO", "GOOG", "MSFT",
"AOL", "APPL", "ORCL", "SAP", "DELL"};
-Portfolio::Portfolio(int32_t i, uint32_t size, CacheableStringArrayPtr nm)
+Portfolio::Portfolio(int32_t i, uint32_t size,
+ std::shared_ptr<CacheableStringArray> nm)
: names(nm) {
ID = i;
char pkidbuf[1024];
@@ -99,8 +100,7 @@ Serializable* Portfolio::fromData(DataInput& input) {
input.readBytes(&arrayZeroSize, &tmp);
return this;
}
-
-CacheableStringPtr Portfolio::toString() const {
+std::shared_ptr<CacheableString> Portfolio::toString() const {
char idbuf[1024];
sprintf(idbuf, "PortfolioObject: [ ID=%d", ID);
char pkidbuf[1024];
diff --git a/quickstart/cpp/queryobjects/Portfolio.hpp b/quickstart/cpp/queryobjects/Portfolio.hpp
index c6f14a0..a1780fa 100644
--- a/quickstart/cpp/queryobjects/Portfolio.hpp
+++ b/quickstart/cpp/queryobjects/Portfolio.hpp
@@ -22,7 +22,6 @@
#ifndef __PORTFOLIO_HPP__
#define __PORTFOLIO_HPP__
-#include <geode/GeodeCppCache.hpp>
#include "Position.hpp"
using namespace apache::geode::client;
@@ -32,21 +31,22 @@ namespace testobject {
class TESTOBJECT_EXPORT Portfolio : public Serializable {
private:
int32_t ID;
- CacheableStringPtr pkid;
- PositionPtr position1;
- PositionPtr position2;
- CacheableHashMapPtr positions;
- CacheableStringPtr type;
+ std::shared_ptr<CacheableString> pkid;
+ std::shared_ptr<Position> position1;
+ std::shared_ptr<Position> position2;
+ std::shared_ptr<CacheableHashMap> positions;
+ std::shared_ptr<CacheableString> type;
char* status;
- CacheableStringArrayPtr names;
+ std::shared_ptr<CacheableStringArray> names;
static const char* secIds[];
uint8_t* newVal;
int32_t newValSize;
- CacheableDatePtr creationDate;
+ std::shared_ptr<CacheableDate> creationDate;
uint8_t* arrayNull;
uint8_t* arrayZeroSize;
- inline uint32_t getObjectSize(const SerializablePtr& obj) const {
+ inline uint32_t getObjectSize(
+ const std::shared_ptr<Serializable>& obj) const {
return (obj == nullptr ? 0 : obj->objectSize());
}
@@ -61,7 +61,7 @@ class TESTOBJECT_EXPORT Portfolio : public Serializable {
arrayNull(NULL),
arrayZeroSize(NULL) {}
Portfolio(int32_t id, uint32_t size = 0,
- CacheableStringArrayPtr nm = nullptr);
+ std::shared_ptr<CacheableStringArray> nm = nullptr);
virtual ~Portfolio();
virtual uint32_t objectSize() const {
@@ -91,13 +91,13 @@ class TESTOBJECT_EXPORT Portfolio : public Serializable {
}
}
- CacheableStringPtr getPkid() { return pkid; }
+ std::shared_ptr<CacheableString> getPkid() { return pkid; }
- PositionPtr getP1() { return position1; }
+ std::shared_ptr<Position> getP1() { return position1; }
- PositionPtr getP2() { return position2; }
+ std::shared_ptr<Position> getP2() { return position2; }
- CacheableHashMapPtr getPositions() { return positions; }
+ std::shared_ptr<CacheableHashMap> getPositions() { return positions; }
bool testMethod(bool booleanArg) { return true; }
@@ -109,9 +109,9 @@ class TESTOBJECT_EXPORT Portfolio : public Serializable {
int32_t getNewValSize() { return newValSize; }
- CacheableStringPtr getType() { return this->type; }
+ std::shared_ptr<CacheableString> getType() { return this->type; }
- CacheableDatePtr getCreationDate() { return creationDate; }
+ std::shared_ptr<CacheableDate> getCreationDate() { return creationDate; }
uint8_t* getArrayNull() { return arrayNull; }
@@ -122,9 +122,8 @@ class TESTOBJECT_EXPORT Portfolio : public Serializable {
virtual void toData(DataOutput& output) const;
virtual Serializable* fromData(DataInput& input);
virtual int32_t classId() const { return 0x03; }
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
};
-typedef std::shared_ptr<Portfolio> PortfolioPtr;
} // namespace testobject
#endif
diff --git a/quickstart/cpp/queryobjects/PortfolioPdx.cpp b/quickstart/cpp/queryobjects/PortfolioPdx.cpp
index 516921b..0be8d28 100644
--- a/quickstart/cpp/queryobjects/PortfolioPdx.cpp
+++ b/quickstart/cpp/queryobjects/PortfolioPdx.cpp
@@ -94,7 +94,7 @@ PortfolioPdx::~PortfolioPdx() {
}
}
-void PortfolioPdx::toData(PdxWriterPtr pw) {
+void PortfolioPdx::toData(std::shared_ptr<PdxWriter> pw) {
pw->writeInt("ID", id);
pw->markIdentityField("ID");
@@ -129,7 +129,7 @@ void PortfolioPdx::toData(PdxWriterPtr pw) {
pw->writeByteArray("arrayZeroSize", arrayZeroSize, 0);
}
-void PortfolioPdx::fromData(PdxReaderPtr pr) {
+void PortfolioPdx::fromData(std::shared_ptr<PdxReader> pr) {
id = pr->readInt("ID");
pkid = pr->readString("pkid");
@@ -149,8 +149,7 @@ void PortfolioPdx::fromData(PdxReaderPtr pr) {
int32_t arrayZeroSizeLen = 0;
arrayZeroSize = pr->readByteArray("arrayZeroSize", arrayZeroSizeLen);
}
-
-CacheableStringPtr PortfolioPdx::toString() const {
+std::shared_ptr<CacheableString> PortfolioPdx::toString() const {
LOGINFO("PortfolioPdx::toString() Start");
char idbuf[1024];
sprintf(idbuf, "PortfolioPdxObject: [ id=%d ]", id);
diff --git a/quickstart/cpp/queryobjects/PortfolioPdx.hpp b/quickstart/cpp/queryobjects/PortfolioPdx.hpp
index d48c318..2aedfc9 100644
--- a/quickstart/cpp/queryobjects/PortfolioPdx.hpp
+++ b/quickstart/cpp/queryobjects/PortfolioPdx.hpp
@@ -34,16 +34,16 @@ class TESTOBJECT_EXPORT PortfolioPdx : public PdxSerializable {
char* pkid;
- PositionPdxPtr position1;
- PositionPdxPtr position2;
- CacheableHashMapPtr positions;
+ std::shared_ptr<PositionPdx> position1;
+ std::shared_ptr<PositionPdx> position2;
+ std::shared_ptr<CacheableHashMap> positions;
char* type;
char* status;
char** names;
static const char* secIds[];
int8_t* newVal;
int32_t newValSize;
- CacheableDatePtr creationDate;
+ std::shared_ptr<CacheableDate> creationDate;
int8_t* arrayNull;
int8_t* arrayZeroSize;
@@ -66,11 +66,11 @@ class TESTOBJECT_EXPORT PortfolioPdx : public PdxSerializable {
char* getPkid() { return pkid; }
- PositionPdxPtr getP1() { return position1; }
+ std::shared_ptr<PositionPdx> getP1() { return position1; }
- PositionPdxPtr getP2() { return position2; }
+ std::shared_ptr<PositionPdx> getP2() { return position2; }
- CacheableHashMapPtr getPositions() { return positions; }
+ std::shared_ptr<CacheableHashMap> getPositions() { return positions; }
bool testMethod(bool booleanArg) { return true; }
@@ -84,7 +84,7 @@ class TESTOBJECT_EXPORT PortfolioPdx : public PdxSerializable {
const char* getClassName() { return this->type; }
- CacheableDatePtr getCreationDate() { return creationDate; }
+ std::shared_ptr<CacheableDate> getCreationDate() { return creationDate; }
int8_t* getArrayNull() { return arrayNull; }
@@ -96,12 +96,11 @@ class TESTOBJECT_EXPORT PortfolioPdx : public PdxSerializable {
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void toData(PdxWriterPtr pw);
- virtual void fromData(PdxReaderPtr pr);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
};
-typedef std::shared_ptr<PortfolioPdx> PortfolioPdxPtr;
} // namespace testobject
#endif
diff --git a/quickstart/cpp/queryobjects/PortfolioPdxAuto.cpp b/quickstart/cpp/queryobjects/PortfolioPdxAuto.cpp
index 38ba553..44eadf8 100644
--- a/quickstart/cpp/queryobjects/PortfolioPdxAuto.cpp
+++ b/quickstart/cpp/queryobjects/PortfolioPdxAuto.cpp
@@ -97,8 +97,7 @@ PortfolioPdxAuto::~PortfolioPdxAuto() {
newVal = NULL;
}
}
-
-CacheableStringPtr PortfolioPdxAuto::toString() const {
+std::shared_ptr<CacheableString> PortfolioPdxAuto::toString() const {
LOGINFO("PortfolioPdxAuto::toString() Start");
char idbuf[1024];
sprintf(idbuf, "PortfolioPdxObject: [ id=%d ]", id);
diff --git a/quickstart/cpp/queryobjects/PortfolioPdxAuto.hpp b/quickstart/cpp/queryobjects/PortfolioPdxAuto.hpp
index 603c71a..c248234 100644
--- a/quickstart/cpp/queryobjects/PortfolioPdxAuto.hpp
+++ b/quickstart/cpp/queryobjects/PortfolioPdxAuto.hpp
@@ -35,16 +35,16 @@ class PortfolioPdxAuto : public apache::geode::client::PdxSerializable {
GFID char* pkid;
- GFID PositionPdxPtr position1;
- GFID PositionPdxPtr position2;
- GFID CacheableHashMapPtr positions;
+ GFID std::shared_ptr<PositionPdx> position1;
+ GFID std::shared_ptr<PositionPdx> position2;
+ GFID std::shared_ptr<CacheableHashMap> positions;
GFID char* type;
GFID char* status;
// char** names;
// static const char* secIds[];
GFID int8_t* newVal;
GFARRAYSIZE(newVal) int32_t newValSize;
- GFID CacheableDatePtr creationDate;
+ GFID std::shared_ptr<CacheableDate> creationDate;
GFID int8_t* arrayNull;
GFARRAYSIZE(arrayNull) int32_t arrayNullSize;
@@ -72,11 +72,11 @@ class PortfolioPdxAuto : public apache::geode::client::PdxSerializable {
char* getPkid() { return pkid; }
- PositionPdxPtr getP1() { return position1; }
+ std::shared_ptr<PositionPdx> getP1() { return position1; }
- PositionPdxPtr getP2() { return position2; }
+ std::shared_ptr<PositionPdx> getP2() { return position2; }
- CacheableHashMapPtr getPositions() { return positions; }
+ std::shared_ptr<CacheableHashMap> getPositions() { return positions; }
bool testMethod(bool booleanArg) { return true; }
@@ -90,7 +90,7 @@ class PortfolioPdxAuto : public apache::geode::client::PdxSerializable {
const char* getClassName() { return this->type; }
- CacheableDatePtr getCreationDate() { return creationDate; }
+ std::shared_ptr<CacheableDate> getCreationDate() { return creationDate; }
int8_t* getArrayNull() { return arrayNull; }
@@ -98,14 +98,12 @@ class PortfolioPdxAuto : public apache::geode::client::PdxSerializable {
const char* getClassName() const;
- virtual void toData(PdxWriterPtr pw);
- virtual void fromData(PdxReaderPtr pr);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
static PdxSerializable* createDeserializable();
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
};
-
-typedef std::shared_ptr<PortfolioPdxAuto> PortfolioPdxPtr;
}
#endif
diff --git a/quickstart/cpp/queryobjects/Position.cpp b/quickstart/cpp/queryobjects/Position.cpp
index b514068..794841d 100644
--- a/quickstart/cpp/queryobjects/Position.cpp
+++ b/quickstart/cpp/queryobjects/Position.cpp
@@ -101,8 +101,7 @@ apache::geode::client::Serializable* Position::fromData(
input.readInt(&pid);
return this;
}
-
-CacheableStringPtr Position::toString() const {
+std::shared_ptr<CacheableString> Position::toString() const {
char buf[2048];
sprintf(buf,
"Position Object:[ secId=%s type=%ls sharesOutstanding=%d id=%d ]",
diff --git a/quickstart/cpp/queryobjects/Position.hpp b/quickstart/cpp/queryobjects/Position.hpp
index 34d8a9a..8555bf9 100644
--- a/quickstart/cpp/queryobjects/Position.hpp
+++ b/quickstart/cpp/queryobjects/Position.hpp
@@ -24,7 +24,6 @@
#ifndef __POSITION_HPP__
#define __POSITION_HPP__
-#include <geode/GeodeCppCache.hpp>
#include <string>
#ifdef _WIN32
@@ -44,20 +43,20 @@ namespace testobject {
class TESTOBJECT_EXPORT Position : public apache::geode::client::Serializable {
private:
int64_t avg20DaysVol;
- CacheableStringPtr bondRating;
+ std::shared_ptr<CacheableString> bondRating;
double convRatio;
- CacheableStringPtr country;
+ std::shared_ptr<CacheableString> country;
double delta;
int64_t industry;
int64_t issuer;
double mktValue;
double qty;
- CacheableStringPtr secId;
- CacheableStringPtr secLinks;
+ std::shared_ptr<CacheableString> secId;
+ std::shared_ptr<CacheableString> secLinks;
// wchar_t* secType;
wchar_t* secType;
int32_t sharesOutstanding;
- CacheableStringPtr underlyer;
+ std::shared_ptr<CacheableString> underlyer;
int64_t volatility;
int32_t pid;
@@ -70,7 +69,7 @@ class TESTOBJECT_EXPORT Position : public apache::geode::client::Serializable {
virtual void toData(apache::geode::client::DataOutput& output) const;
virtual void fromData(apache::geode::client::DataInput& input);
virtual int32_t classId() const { return 0x02; }
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
virtual uint32_t objectSize() const {
uint32_t objectSize = sizeof(Position);
@@ -84,7 +83,7 @@ class TESTOBJECT_EXPORT Position : public apache::geode::client::Serializable {
}
static void resetCounter() { cnt = 0; }
- CacheableStringPtr getSecId() { return secId; }
+ std::shared_ptr<CacheableString> getSecId() { return secId; }
int32_t getId() { return pid; }
int32_t getSharesOutstanding() { return sharesOutstanding; }
static apache::geode::client::Serializable* createDeserializable() {
@@ -95,6 +94,5 @@ class TESTOBJECT_EXPORT Position : public apache::geode::client::Serializable {
void init();
};
-typedef std::shared_ptr<Position> PositionPtr;
} // namespace testobject
#endif
diff --git a/quickstart/cpp/queryobjects/PositionPdx.cpp b/quickstart/cpp/queryobjects/PositionPdx.cpp
index 63d7e5e..c1a5306 100644
--- a/quickstart/cpp/queryobjects/PositionPdx.cpp
+++ b/quickstart/cpp/queryobjects/PositionPdx.cpp
@@ -101,7 +101,7 @@ void PositionPdx::init() {
pid = 0;
}
-void PositionPdx::toData(PdxWriterPtr pw) {
+void PositionPdx::toData(std::shared_ptr<PdxWriter> pw) {
pw->writeLong("avg20DaysVol", avg20DaysVol);
pw->markIdentityField("avg20DaysVol");
@@ -151,7 +151,7 @@ void PositionPdx::toData(PdxWriterPtr pw) {
pw->markIdentityField("pid");
}
-void PositionPdx::fromData(PdxReaderPtr pr) {
+void PositionPdx::fromData(std::shared_ptr<PdxReader> pr) {
avg20DaysVol = pr->readLong("avg20DaysVol");
bondRating = pr->readString("bondRating");
convRatio = pr->readDouble("convRatio");
@@ -169,8 +169,7 @@ void PositionPdx::fromData(PdxReaderPtr pr) {
volatility = pr->readLong("volatility");
pid = pr->readInt("pid");
}
-
-CacheableStringPtr PositionPdx::toString() const {
+std::shared_ptr<CacheableString> PositionPdx::toString() const {
char buf[1024];
sprintf(buf, "PositionPdx Object:[ id=%d ]", this->pid);
return CacheableString::create(buf);
diff --git a/quickstart/cpp/queryobjects/PositionPdx.hpp b/quickstart/cpp/queryobjects/PositionPdx.hpp
index 9b371e9..b81523c 100644
--- a/quickstart/cpp/queryobjects/PositionPdx.hpp
+++ b/quickstart/cpp/queryobjects/PositionPdx.hpp
@@ -22,7 +22,6 @@
#ifndef __POSITIONPDX_HPP__
#define __POSITIONPDX_HPP__
-#include <geode/GeodeCppCache.hpp>
#include <geode/PdxSerializable.hpp>
#include <geode/PdxWriter.hpp>
#include <geode/PdxReader.hpp>
@@ -73,10 +72,10 @@ class TESTOBJECT_EXPORT PositionPdx
// This constructor is just for some internal data validation test
PositionPdx(int32_t iForExactVal);
virtual ~PositionPdx();
- virtual void toData(PdxWriterPtr pw);
- virtual void fromData(PdxReaderPtr pr);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
virtual uint32_t objectSize() const {
uint32_t objectSize = sizeof(PositionPdx);
@@ -99,6 +98,5 @@ class TESTOBJECT_EXPORT PositionPdx
void init();
};
-typedef std::shared_ptr<PositionPdx> PositionPdxPtr;
} // namespace testobject
#endif
diff --git a/quickstart/cpp/queryobjects/PositionPdxAuto.cpp b/quickstart/cpp/queryobjects/PositionPdxAuto.cpp
index c638b88..0be2195 100644
--- a/quickstart/cpp/queryobjects/PositionPdxAuto.cpp
+++ b/quickstart/cpp/queryobjects/PositionPdxAuto.cpp
@@ -100,8 +100,7 @@ void PositionPdxAuto::init() {
volatility = 0;
pid = 0;
}
-
-CacheableStringPtr PositionPdxAuto::toString() const {
+std::shared_ptr<CacheableString> PositionPdxAuto::toString() const {
char buf[1024];
sprintf(buf, "PositionPdx Object:[ id=%d ]", this->pid);
return CacheableString::create(buf);
diff --git a/quickstart/cpp/queryobjects/PositionPdxAuto.hpp b/quickstart/cpp/queryobjects/PositionPdxAuto.hpp
index 29e7f9d..441ffe9 100644
--- a/quickstart/cpp/queryobjects/PositionPdxAuto.hpp
+++ b/quickstart/cpp/queryobjects/PositionPdxAuto.hpp
@@ -22,7 +22,6 @@
#ifndef __POSITIONPDX_AUTO__HPP__
#define __POSITIONPDX_AUTO__HPP__
-#include <geode/GeodeCppCache.hpp>
#include <geode/PdxSerializable.hpp>
#include <geode/PdxWriter.hpp>
#include <geode/PdxReader.hpp>
@@ -74,10 +73,10 @@ class PositionPdxAuto : public apache::geode::client::PdxSerializable {
// This constructor is just for some internal data validation test
PositionPdxAuto(int32_t iForExactVal);
virtual ~PositionPdxAuto();
- virtual void toData(PdxWriterPtr pw);
- virtual void fromData(PdxReaderPtr pr);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
virtual uint32_t objectSize() const {
uint32_t objectSize = sizeof(PositionPdxAuto);
@@ -99,7 +98,5 @@ class PositionPdxAuto : public apache::geode::client::PdxSerializable {
private:
void init();
};
-
-typedef std::shared_ptr<PositionPdxAuto> PositionPdxPtr;
}
#endif
diff --git a/sqliteimpl/SqLiteHelper.hpp b/sqliteimpl/SqLiteHelper.hpp
index f9ae9d0..abef843 100644
--- a/sqliteimpl/SqLiteHelper.hpp
+++ b/sqliteimpl/SqLiteHelper.hpp
@@ -23,7 +23,6 @@
#include "sqlite3.h"
#include <geode/PersistenceManager.hpp>
-#include <geode/GeodeCppCache.hpp>
#include <sys/types.h>
#ifndef WIN32
#include <unistd.h>
diff --git a/sqliteimpl/SqLiteImpl.cpp b/sqliteimpl/SqLiteImpl.cpp
index e8933a5..0de4e99 100644
--- a/sqliteimpl/SqLiteImpl.cpp
+++ b/sqliteimpl/SqLiteImpl.cpp
@@ -28,8 +28,8 @@ std::string g_default_persistence_directory = "GeodeRegionData";
using namespace apache::geode::client;
-void SqLiteImpl::init(const RegionPtr& region,
- const PropertiesPtr& diskProperties) {
+void SqLiteImpl::init(const std::shared_ptr<Region>& region,
+ const std::shared_ptr<Properties>& diskProperties) {
// Set the default values
int maxPageCount = 0;
@@ -38,9 +38,9 @@ void SqLiteImpl::init(const RegionPtr& region,
m_persistanceDir = g_default_persistence_directory;
std::string regionName = region->getName();
if (diskProperties != nullptr) {
- CacheableStringPtr maxPageCountPtr = diskProperties->find(MAX_PAGE_COUNT);
- CacheableStringPtr pageSizePtr = diskProperties->find(PAGE_SIZE);
- CacheableStringPtr persDir = diskProperties->find(PERSISTENCE_DIR);
+ auto maxPageCountPtr = diskProperties->find(MAX_PAGE_COUNT);
+ auto pageSizePtr = diskProperties->find(PAGE_SIZE);
+ auto persDir = diskProperties->find(PERSISTENCE_DIR);
if (maxPageCountPtr != nullptr) {
maxPageCount = atoi(maxPageCountPtr->asChar());
@@ -109,7 +109,8 @@ void SqLiteImpl::init(const RegionPtr& region,
}
}
-void SqLiteImpl::write(const CacheableKeyPtr& key, const CacheablePtr& value,
+void SqLiteImpl::write(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value,
void*& dbHandle) {
// Serialize key and value.
auto* cache = m_regionPtr->getCache().get();
@@ -130,8 +131,8 @@ void SqLiteImpl::write(const CacheableKeyPtr& key, const CacheablePtr& value,
}
bool SqLiteImpl::writeAll() { return true; }
-
-CacheablePtr SqLiteImpl::read(const CacheableKeyPtr& key, void*& dbHandle) {
+std::shared_ptr<Cacheable> SqLiteImpl::read(
+ const std::shared_ptr<CacheableKey>& key, void*& dbHandle) {
// Serialize key.
auto keyDataBuffer = m_regionPtr->getCache()->createDataOutput();
uint32_t keyBufferSize;
@@ -146,9 +147,9 @@ CacheablePtr SqLiteImpl::read(const CacheableKeyPtr& key, void*& dbHandle) {
}
// Deserialize object and return value.
- auto valueDataBuffer = m_regionPtr->getCache()->createDataInput(reinterpret_cast<uint8_t*>(valueData),
- valueBufferSize);
- CacheablePtr retValue;
+ auto valueDataBuffer = m_regionPtr->getCache()->createDataInput(
+ reinterpret_cast<uint8_t*>(valueData), valueBufferSize);
+ std::shared_ptr<Cacheable> retValue;
valueDataBuffer->readObject(retValue);
// Free memory for serialized form of Cacheable object.
@@ -174,7 +175,7 @@ void SqLiteImpl::destroyRegion() {
#endif
}
-void SqLiteImpl::destroy(const CacheableKeyPtr& key, void*& dbHandle) {
+void SqLiteImpl::destroy(const std::shared_ptr<CacheableKey>& key, void*& dbHandle) {
// Serialize key and value.
auto keyDataBuffer = m_regionPtr->getCache()->createDataOutput();
uint32_t keyBufferSize;
diff --git a/sqliteimpl/SqLiteImpl.hpp b/sqliteimpl/SqLiteImpl.hpp
index dcf5b7a..2b42803 100644
--- a/sqliteimpl/SqLiteImpl.hpp
+++ b/sqliteimpl/SqLiteImpl.hpp
@@ -49,7 +49,8 @@ class SqLiteImpl : public PersistenceManager {
* @throws InitfailedException if persistence directory/environment directory
* initialization fails.
*/
- void init(const RegionPtr& regionptr, const PropertiesPtr& diskProperties);
+ void init(const std::shared_ptr<Region>& regionptr,
+ const std::shared_ptr<Properties>& diskProperties);
/**
* Stores a key-value pair in the SqLite implementation.
@@ -57,8 +58,8 @@ class SqLiteImpl : public PersistenceManager {
* @param value the value to write
* @throws DiskFailureException if the write fails due to disk failure.
*/
- void write(const CacheableKeyPtr& key, const CacheablePtr& value,
- void*& dbHandle);
+ void write(const std::shared_ptr<CacheableKey>& key,
+ const std::shared_ptr<Cacheable>& value, void*& dbHandle);
/**
* Writes the entire region into the SqLite implementation.
@@ -68,12 +69,13 @@ class SqLiteImpl : public PersistenceManager {
/**
* Reads the value for the key from SqLite.
- * @returns value of type CacheablePtr.
+ * @returns value of type std::shared_ptr<Cacheable>.
* @param key is the key for which the value has to be read.
* @throws IllegalArgumentException if the key is NULL.
* @throws DiskCorruptException if the data to be read is corrupt.
*/
- CacheablePtr read(const CacheableKeyPtr& key, void*& dbHandle);
+ std::shared_ptr<Cacheable> read(const std::shared_ptr<CacheableKey>& key,
+ void*& dbHandle);
/**
* Read all the keys and values for a region stored in SqLite.
@@ -86,7 +88,7 @@ class SqLiteImpl : public PersistenceManager {
* @throws RegionDestroyedException is the region is already destroyed.
* @throws EntryNotFoundException if the entry is not found on the disk.
*/
- // void invalidate(const CacheableKeyPtr& key);
+ // void invalidate(const std::shared_ptr<CacheableKey>& key);
/**
* Destroys an entry stored in SqLite. .
@@ -94,7 +96,7 @@ class SqLiteImpl : public PersistenceManager {
* @throws RegionDestroyedException is the region is already destroyed.
* @throws EntryNotFoundException if the entry is not found on the disk.
*/
- void destroy(const CacheableKeyPtr& key, void*& dbHandle);
+ void destroy(const std::shared_ptr<CacheableKey>& key, void*& dbHandle);
/**
* Returns number of entries stored in SqLite for the region.
@@ -132,7 +134,7 @@ class SqLiteImpl : public PersistenceManager {
private:
SqLiteHelper* m_sqliteHelper;
- RegionPtr m_regionPtr;
+ std::shared_ptr<Region> m_regionPtr;
std::string m_regionDBFile;
std::string m_regionDir;
std::string m_persistanceDir;
diff --git a/templates/security/PkcsAuthInit.cpp b/templates/security/PkcsAuthInit.cpp
index 51a4933..49a4166 100644
--- a/templates/security/PkcsAuthInit.cpp
+++ b/templates/security/PkcsAuthInit.cpp
@@ -93,9 +93,8 @@ bool openSSLInit() {
static bool s_initDone = openSSLInit();
}
// end of extern "C"
-
-PropertiesPtr PKCSAuthInit::getCredentials(const PropertiesPtr& securityprops,
- const char* server) {
+std::shared_ptr<Properties> PKCSAuthInit::getCredentials(
+ const std::shared_ptr<Properties>& securityprops, const char* server) {
if (!s_initDone) {
throw AuthenticationFailedException(
"PKCSAuthInit::getCredentials: "
@@ -107,7 +106,7 @@ PropertiesPtr PKCSAuthInit::getCredentials(const PropertiesPtr& securityprops,
"No security-* properties are set.");
}
- CacheableStringPtr keyStoreptr = securityprops->find(KEYSTORE_FILE_PATH);
+ auto keyStoreptr = securityprops->find(KEYSTORE_FILE_PATH);
const char* keyStorePath = keyStoreptr->asChar();
@@ -117,7 +116,7 @@ PropertiesPtr PKCSAuthInit::getCredentials(const PropertiesPtr& securityprops,
"key-store file path property KEYSTORE_FILE_PATH not set.");
}
- CacheableStringPtr aliasptr = securityprops->find(KEYSTORE_ALIAS);
+ auto aliasptr = securityprops->find(KEYSTORE_ALIAS);
const char* alias = aliasptr->asChar();
@@ -127,7 +126,7 @@ PropertiesPtr PKCSAuthInit::getCredentials(const PropertiesPtr& securityprops,
"key-store alias property KEYSTORE_ALIAS not set.");
}
- CacheableStringPtr keyStorePassptr = securityprops->find(KEYSTORE_PASSWORD);
+ auto keyStorePassptr = securityprops->find(KEYSTORE_PASSWORD);
const char* keyStorePass = keyStorePassptr->asChar();
@@ -173,10 +172,10 @@ PropertiesPtr PKCSAuthInit::getCredentials(const PropertiesPtr& securityprops,
"PKCSAuthInit::getCredentials: "
"Unable to create signature");
}
- CacheablePtr signatureValPtr =
+ auto signatureValPtr =
CacheableBytes::createNoCopy(signatureData, lengthEncryptedData);
- PropertiesPtr credentials = Properties::create();
+ auto credentials = Properties::create();
credentials->insert(KEYSTORE_ALIAS, alias);
credentials->insert(CacheableString::create(SIGNATURE_DATA), signatureValPtr);
return credentials;
diff --git a/templates/security/PkcsAuthInit.hpp b/templates/security/PkcsAuthInit.hpp
index 9e2f1cb..ce162fd 100644
--- a/templates/security/PkcsAuthInit.hpp
+++ b/templates/security/PkcsAuthInit.hpp
@@ -85,8 +85,8 @@ class PKCSAuthInit : public AuthInitialize {
* The format expected is "host:port".
* @returns the credentials to be used for the given <code>server</code>
*/
- PropertiesPtr getCredentials(const PropertiesPtr& securityprops,
- const char* server);
+ std::shared_ptr<Properties> getCredentials(
+ const std::shared_ptr<Properties>& securityprops, const char* server);
/**
* @brief Invoked before the cache goes down.
diff --git a/templates/security/UserPasswordAuthInit.cpp b/templates/security/UserPasswordAuthInit.cpp
index 1adb0b0..bf7335c 100644
--- a/templates/security/UserPasswordAuthInit.cpp
+++ b/templates/security/UserPasswordAuthInit.cpp
@@ -32,11 +32,10 @@ LIBEXP AuthInitialize* createUserPasswordAuthInitInstance() {
return new UserPasswordAuthInit();
}
}
-
-PropertiesPtr UserPasswordAuthInit::getCredentials(
- const PropertiesPtr& securityprops, const char* server) {
+std::shared_ptr<Properties> UserPasswordAuthInit::getCredentials(
+ const std::shared_ptr<Properties>& securityprops, const char* server) {
// LOGDEBUG("UserPasswordAuthInit: inside userPassword::getCredentials");
- CacheablePtr userName;
+ std::shared_ptr<Cacheable> userName;
if (securityprops == nullptr ||
(userName = securityprops->find(SECURITY_USERNAME)) == nullptr) {
throw AuthenticationFailedException(
@@ -44,17 +43,17 @@ PropertiesPtr UserPasswordAuthInit::getCredentials(
"property [" SECURITY_USERNAME "] not set.");
}
- PropertiesPtr credentials = Properties::create();
- credentials->insert(SECURITY_USERNAME, userName->toString()->asChar());
- CacheablePtr passwd = securityprops->find(SECURITY_PASSWORD);
- // If password is not provided then use empty string as the password.
- if (passwd == nullptr) {
- passwd = CacheableString::create("");
- }
- credentials->insert(SECURITY_PASSWORD, passwd->toString()->asChar());
- // LOGDEBUG("UserPasswordAuthInit: inserted username:password - %s:%s",
- // userName->toString()->asChar(), passwd->toString()->asChar());
- return credentials;
+ auto credentials = Properties::create();
+ credentials->insert(SECURITY_USERNAME, userName->toString()->asChar());
+ std::shared_ptr<Cacheable> passwd = securityprops->find(SECURITY_PASSWORD);
+ // If password is not provided then use empty string as the password.
+ if (passwd == nullptr) {
+ passwd = CacheableString::create("");
+ }
+ credentials->insert(SECURITY_PASSWORD, passwd->toString()->asChar());
+ // LOGDEBUG("UserPasswordAuthInit: inserted username:password - %s:%s",
+ // userName->toString()->asChar(), passwd->toString()->asChar());
+ return credentials;
}
} // namespace client
} // namespace geode
diff --git a/templates/security/UserPasswordAuthInit.hpp b/templates/security/UserPasswordAuthInit.hpp
index e3d7ed6..8e8aaa0 100644
--- a/templates/security/UserPasswordAuthInit.hpp
+++ b/templates/security/UserPasswordAuthInit.hpp
@@ -65,8 +65,8 @@ class UserPasswordAuthInit : public AuthInitialize {
* @remarks This method can modify the given set of properties. For
* example it may invoke external agents or even interact with the user.
*/
- PropertiesPtr getCredentials(const PropertiesPtr& securityprops,
- const char* server);
+ std::shared_ptr<Properties> getCredentials(
+ const std::shared_ptr<Properties>& securityprops, const char* server);
/**
* @brief Invoked before the cache goes down.
diff --git a/tests/cpp/fwk/UdpIpc.cpp b/tests/cpp/fwk/UdpIpc.cpp
index a06679e..13ccf0a 100644
--- a/tests/cpp/fwk/UdpIpc.cpp
+++ b/tests/cpp/fwk/UdpIpc.cpp
@@ -25,7 +25,6 @@
// ----------------------------------------------------------------------------
-#include <geode/GeodeCppCache.hpp>
#include <geode/geode_globals.hpp>
#include "fwklib/UDPIpc.hpp"
@@ -82,7 +81,7 @@ void UdpIpc::checkTest(const char *taskId) {
std::lock_guard<spinlock_mutex> guard(m_lck);
setTask(taskId);
if (m_cache == nullptr) {
- PropertiesPtr pp = Properties::create();
+ auto pp = Properties::create();
cacheInitialize(pp);
diff --git a/tests/cpp/fwk/UdpIpc.hpp b/tests/cpp/fwk/UdpIpc.hpp
index 51b5770..4826669 100644
--- a/tests/cpp/fwk/UdpIpc.hpp
+++ b/tests/cpp/fwk/UdpIpc.hpp
@@ -31,7 +31,6 @@
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
-#include <geode/GeodeCppCache.hpp>
#include "fwklib/FrameworkTest.hpp"
diff --git a/tests/cpp/fwklib/ClientTask.hpp b/tests/cpp/fwklib/ClientTask.hpp
index 2c6a032..a1eb95f 100644
--- a/tests/cpp/fwklib/ClientTask.hpp
+++ b/tests/cpp/fwklib/ClientTask.hpp
@@ -20,7 +20,6 @@
* limitations under the License.
*/
-#include <geode/GeodeCppCache.hpp>
#include <atomic>
#include "fwklib/PerfFwk.hpp"
#include "fwklib/FwkObjects.hpp"
diff --git a/tests/cpp/fwklib/FrameworkTest.cpp b/tests/cpp/fwklib/FrameworkTest.cpp
index 636386a..287c076 100644
--- a/tests/cpp/fwklib/FrameworkTest.cpp
+++ b/tests/cpp/fwklib/FrameworkTest.cpp
@@ -230,9 +230,10 @@ const FwkPool* FrameworkTest::getPoolSnippet(const std::string& name) const {
}
// ----------------------------------------------------------------------------
-void FrameworkTest::cacheInitialize(PropertiesPtr& props,
- const CacheAttributesPtr& cAttrs) {
- CacheFactoryPtr cacheFactory;
+void FrameworkTest::cacheInitialize(
+ std::shared_ptr<Properties>& props,
+ const std::shared_ptr<CacheAttributes>& cAttrs) {
+ std::shared_ptr<CacheFactory> cacheFactory;
try {
std::string name = getStringValue("systemName");
bool isPdxSerialized = getBoolValue("PdxReadSerialized");
@@ -323,7 +324,7 @@ void FrameworkTest::destroyAllRegions() {
// ----------------------------------------------------------------------------
-void FrameworkTest::localDestroyRegion(RegionPtr& region) {
+void FrameworkTest::localDestroyRegion(std::shared_ptr<Region>& region) {
try {
region->localDestroyRegion();
} catch (RegionDestroyedException& ignore) {
@@ -338,7 +339,7 @@ void FrameworkTest::localDestroyRegion(RegionPtr& region) {
void FrameworkTest::parseEndPoints(int32_t ep, std::string label,
bool isServer) {
std::string poolName = "_Test_Pool";
- PoolFactoryPtr pfPtr = m_cache->getPoolManager().createFactory();
+ auto pfPtr = m_cache->getPoolManager().createFactory();
std::string tag = getStringValue("TAG");
std::string bb("GFE_BB");
@@ -398,7 +399,7 @@ void FrameworkTest::parseEndPoints(int32_t ep, std::string label,
int32_t redundancyLevel = getIntValue("redundancyLevel");
if (redundancyLevel > 0) pfPtr->setSubscriptionRedundancy(redundancyLevel);
// create tag specific pools
- PoolPtr pptr = nullptr;
+ std::shared_ptr<Pool> pptr = nullptr;
if (!tag.empty()) {
poolName.append(tag);
// check if pool already exists
@@ -442,14 +443,13 @@ void FrameworkTest::createPool() {
parseEndPoints(count, label, false);
}
}
-
-QueryServicePtr FrameworkTest::checkQueryService() {
- PoolFactoryPtr pfPtr = m_cache->getPoolManager().createFactory();
+std::shared_ptr<QueryService> FrameworkTest::checkQueryService() {
+ auto pfPtr = m_cache->getPoolManager().createFactory();
std::string bb("GFE_BB");
std::string keys("testScheme");
std::string mode = bbGetString(bb, keys);
if (mode == "poolwithendpoints" || mode == "poolwithlocator") {
- PoolPtr pool = m_cache->getPoolManager().find("_Test_Pool");
+ auto pool = m_cache->getPoolManager().find("_Test_Pool");
return pool->getQueryService();
} else {
return m_cache->getQueryService();
@@ -479,7 +479,7 @@ void FrameworkTest::setTestScheme() {
}
}
-std::string FrameworkTest::poolAttributesToString(PoolPtr& pool) {
+std::string FrameworkTest::poolAttributesToString(std::shared_ptr<Pool>& pool) {
using namespace apache::geode::util::chrono::duration;
std::string sString;
diff --git a/tests/cpp/fwklib/FrameworkTest.hpp b/tests/cpp/fwklib/FrameworkTest.hpp
index ccf32e2..491602a 100644
--- a/tests/cpp/fwklib/FrameworkTest.hpp
+++ b/tests/cpp/fwklib/FrameworkTest.hpp
@@ -47,9 +47,9 @@ class FrameworkTest // Base class all test classes written for xml testing
FwkTask* m_task;
protected:
- CachePtr m_cache;
+ std::shared_ptr<Cache> m_cache;
// bool m_istransaction;
- CacheTransactionManagerPtr txManager;
+ std::shared_ptr<CacheTransactionManager> txManager;
static spinlock_mutex m_lck;
public:
@@ -59,14 +59,15 @@ class FrameworkTest // Base class all test classes written for xml testing
int32_t initialize(const char* initArgs) { return FWK_SUCCESS; }
int32_t finalize() { return FWK_SUCCESS; }
- void cacheInitialize(PropertiesPtr& props,
- const CacheAttributesPtr& cAttrs = nullptr);
+ void cacheInitialize(
+ std::shared_ptr<Properties>& props,
+ const std::shared_ptr<CacheAttributes>& cAttrs = nullptr);
void cacheFinalize();
void destroyAllRegions();
- void localDestroyRegion(RegionPtr& region);
+ void localDestroyRegion(std::shared_ptr<Region>& region);
void incClientCount();
@@ -74,11 +75,11 @@ class FrameworkTest // Base class all test classes written for xml testing
void createPool();
- std::string poolAttributesToString(PoolPtr& pool);
+ std::string poolAttributesToString(std::shared_ptr<Pool>& pool);
void setTestScheme();
- QueryServicePtr checkQueryService();
+ std::shared_ptr<QueryService> checkQueryService();
void setTask(const char* taskId) {
m_task = const_cast<FwkTask*>(m_coll->getTaskById(taskId));
@@ -98,7 +99,7 @@ class FrameworkTest // Base class all test classes written for xml testing
}
return 0;
}
- CacheTransactionManagerPtr gettxManager() { return txManager; }
+ std::shared_ptr<CacheTransactionManager> gettxManager() { return txManager; }
inline int32_t getClientId() { return m_id; }
inline int32_t getDeltaMicros() { return m_deltaMicros; }
diff --git a/tests/cpp/fwklib/FwkObjects.hpp b/tests/cpp/fwklib/FwkObjects.hpp
index 1880095..9b188ad 100644
--- a/tests/cpp/fwklib/FwkObjects.hpp
+++ b/tests/cpp/fwklib/FwkObjects.hpp
@@ -344,7 +344,7 @@ class ExpiryAttributes {
class PersistManager {
std::string m_libraryName;
std::string m_libraryFunctionName;
- PropertiesPtr m_properties;
+ std::shared_ptr<Properties> m_properties;
void setLibraryName(std::string name) { m_libraryName = name; }
void setLibraryFunctionName(std::string name) {
@@ -359,7 +359,7 @@ class PersistManager {
const char* getLibraryName() { return m_libraryName.c_str(); }
const char* getLibraryFunctionName() { return m_libraryFunctionName.c_str(); }
- PropertiesPtr& getProperties() { return m_properties; }
+ std::shared_ptr<Properties>& getProperties() { return m_properties; }
};
// ----------------------------------------------------------------------------
@@ -443,7 +443,7 @@ class Attributes {
public:
Attributes(const DOMNode* node);
- RegionAttributesPtr getAttributes() {
+ std::shared_ptr<RegionAttributes> getAttributes() {
return m_factory.createRegionAttributes();
}
@@ -481,7 +481,7 @@ class FwkRegion {
const std::string& getName() const { return m_name; }
Attributes* getAttributes() { return m_attributes; }
- const RegionAttributesPtr getAttributesPtr() const {
+ const std::shared_ptr<RegionAttributes> getAttributesPtr() const {
return m_attributes->getAttributes();
}
void print() const { FWKINFO("FwkRegion " << m_name); }
@@ -491,9 +491,9 @@ class FwkRegion {
class FwkPool {
std::string m_name;
- CachePtr m_cache;
+ std::shared_ptr<Cache> m_cache;
PoolManager* m_poolManager;
- PoolFactoryPtr m_poolFactory;
+ std::shared_ptr<PoolFactory> m_poolFactory;
bool m_locators;
bool m_servers;
@@ -608,10 +608,10 @@ class FwkPool {
}
}
- // PoolPtr createPoolForPerf() { return
+ // std::shared_ptr<Pool> createPoolForPerf() { return
// m_poolFactory->create(m_name.c_str()); }
- // PoolPtr createPool() const {
+ // std::shared_ptr<Pool> createPool() const {
// if (m_name.empty()) {
// FWKEXCEPTION("Pool name not specified.");
// } else {
diff --git a/tests/cpp/fwklib/PoolHelper.hpp b/tests/cpp/fwklib/PoolHelper.hpp
index f397992..ee813ec 100644
--- a/tests/cpp/fwklib/PoolHelper.hpp
+++ b/tests/cpp/fwklib/PoolHelper.hpp
@@ -20,8 +20,6 @@
* limitations under the License.
*/
-#include <geode/GeodeCppCache.hpp>
-
#include "fwklib/FrameworkTest.hpp"
#include "fwklib/FwkObjects.hpp"
#include "fwklib/FwkStrCvt.hpp"
@@ -64,7 +62,7 @@ class PoolHelper {
const std::string specName() { return m_spec; }
- std::string poolAttributesToString(PoolPtr& pool) {
+ std::string poolAttributesToString(std::shared_ptr<Pool>& pool) {
std::string sString;
sString += "\npoolName: ";
sString += FwkStrCvt(pool->getName()).toString();
@@ -106,8 +104,7 @@ class PoolHelper {
sString += "\nPRSingleHopEnabled: ";
sString += pool->getPRSingleHopEnabled() ? "true" : "false";
sString += "\nLocator: ";
- CacheableStringArrayPtr str =
- dynamic_cast<CacheableStringArray*>(pool->getLocators().get());
+ auto str = dynamic_cast<CacheableStringArray*>(pool->getLocators().get());
if (pool->getLocators() != nullptr && pool->getLocators()->length() > 0) {
for (int32_t stri = 0; stri < str->length(); stri++) {
sString += str->operator[](stri)->asChar();
@@ -126,17 +123,17 @@ class PoolHelper {
return sString;
}
- PoolPtr createPool() {
+ std::shared_ptr<Pool> createPool() {
const char* poolName = m_pool->getName().c_str();
- PoolPtr pptr = m_pool->m_poolManager.find(poolName);
+ auto pptr = m_pool->m_poolManager.find(poolName);
if (pptr == nullptr) {
pptr = m_pool->createPool();
}
FWKINFO(" Following are Pool attributes :" << poolAttributesToString(pptr));
return pptr;
}
- PoolPtr createPoolForPerf() {
- PoolPtr pptr = m_pool->createPool();
+ std::shared_ptr<Pool> createPoolForPerf() {
+ auto pptr = m_pool->createPool();
FWKINFO(" Following are Pool attributes :" << poolAttributesToString(pptr));
return pptr;
}
diff --git a/tests/cpp/fwklib/QueryHelper.hpp b/tests/cpp/fwklib/QueryHelper.hpp
index c509bdc..145e610 100644
--- a/tests/cpp/fwklib/QueryHelper.hpp
+++ b/tests/cpp/fwklib/QueryHelper.hpp
@@ -20,7 +20,6 @@
* limitations under the License.
*/
-#include <geode/GeodeCppCache.hpp>
#include <cstdlib>
#include <geode/SystemProperties.hpp>
#include <ace/OS.h>
@@ -670,23 +669,24 @@ class QueryHelper {
virtual ~QueryHelper() { ; }
- virtual void populatePortfolioData(RegionPtr& pregion, int setSize,
- int numSets, int32_t objSize = 1);
- virtual void populatePortfolio(RegionPtr& rptr, int maxKey,
+ virtual void populatePortfolioData(std::shared_ptr<Region>& pregion,
+ int setSize, int numSets,
+ int32_t objSize = 1);
+ virtual void populatePortfolio(std::shared_ptr<Region>& rptr, int maxKey,
int32_t objSize = 1);
- virtual void populatePositionData(RegionPtr& pregion, int setSize,
- int numSets);
- virtual void populatePortfolioPdxData(RegionPtr& pregion, int setSize,
- int numSets, int32_t objSize = 1,
- char** nm = NULL);
- virtual void populatePositionPdxData(RegionPtr& pregion, int setSize,
- int numSets);
- virtual void destroyPortfolioOrPositionData(RegionPtr& pregion, int setSize,
- int numSets,
+ virtual void populatePositionData(std::shared_ptr<Region>& pregion,
+ int setSize, int numSets);
+ virtual void populatePortfolioPdxData(std::shared_ptr<Region>& pregion,
+ int setSize, int numSets,
+ int32_t objSize = 1, char** nm = NULL);
+ virtual void populatePositionPdxData(std::shared_ptr<Region>& pregion,
+ int setSize, int numSets);
+ virtual void destroyPortfolioOrPositionData(std::shared_ptr<Region>& pregion,
+ int setSize, int numSets,
const char* dataType);
- virtual void invalidatePortfolioOrPositionData(RegionPtr& pregion,
- int setSize, int numSets,
- const char* dataType);
+ virtual void invalidatePortfolioOrPositionData(
+ std::shared_ptr<Region>& pregion, int setSize, int numSets,
+ const char* dataType);
// might need it in later.
// virtual void getRSQueryString(char category, int& queryIndex, std::string&
@@ -694,16 +694,20 @@ class QueryHelper {
// virtual void getSSQueryString(char category, int& queryIndex, std::string&
// query);
- virtual bool verifyRS(SelectResultsPtr& resultset, int rowCount);
- virtual bool verifySS(SelectResultsPtr& structset, int rowCount,
+ virtual bool verifyRS(std::shared_ptr<SelectResults>& resultset,
+ int rowCount);
+ virtual bool verifySS(std::shared_ptr<SelectResults>& structset, int rowCount,
int fieldCount);
- void populateRangePositionData(RegionPtr& rptr, int start, int end);
- bool compareTwoPositionObjects(SerializablePtr por1, SerializablePtr por2);
- SerializablePtr getExactPositionObject(int iForExactPosObject);
- void putExactPositionObject(RegionPtr& rptr, int iForExactPosObject);
- SerializablePtr getCachedPositionObject(RegionPtr& rptr,
- int iForExactPosObject);
+ void populateRangePositionData(std::shared_ptr<Region>& rptr, int start,
+ int end);
+ bool compareTwoPositionObjects(std::shared_ptr<Serializable> por1,
+ std::shared_ptr<Serializable> por2);
+ std::shared_ptr<Serializable> getExactPositionObject(int iForExactPosObject);
+ void putExactPositionObject(std::shared_ptr<Region>& rptr,
+ int iForExactPosObject);
+ std::shared_ptr<Serializable> getCachedPositionObject(
+ std::shared_ptr<Region>& rptr, int iForExactPosObject);
// utility methods
virtual int getPortfolioSetSize() { return portfolioSetSize; };
@@ -786,19 +790,19 @@ QueryHelper* QueryHelper::singleton = NULL;
//===========================================================================================
-void QueryHelper::populateRangePositionData(RegionPtr& rptr, int start,
- int end) {
+void QueryHelper::populateRangePositionData(std::shared_ptr<Region>& rptr,
+ int start, int end) {
for (int i = start; i <= end; i++) {
auto pos = std::make_shared<Position>(i);
char key[100];
ACE_OS::sprintf(key, "pos%d", i);
- CacheableKeyPtr keyptr = CacheableKey::create(key);
+ auto keyptr = CacheableKey::create(key);
rptr->put(keyptr, pos);
}
}
-bool QueryHelper::compareTwoPositionObjects(SerializablePtr pos1,
- SerializablePtr pos2) {
+bool QueryHelper::compareTwoPositionObjects(
+ std::shared_ptr<Serializable> pos1, std::shared_ptr<Serializable> pos2) {
Position* p1 = dynamic_cast<Position*>(pos1.get());
Position* p2 = dynamic_cast<Position*>(pos2.get());
@@ -828,12 +832,12 @@ bool QueryHelper::compareTwoPositionObjects(SerializablePtr pos1,
}
return true;
}
-
-SerializablePtr QueryHelper::getExactPositionObject(int iForExactPosObject) {
+std::shared_ptr<Serializable> QueryHelper::getExactPositionObject(
+ int iForExactPosObject) {
return std::make_shared<Position>(iForExactPosObject);
}
-void QueryHelper::putExactPositionObject(RegionPtr& rptr,
+void QueryHelper::putExactPositionObject(std::shared_ptr<Region>& rptr,
int iForExactPosObject) {
char key[100];
ACE_OS::sprintf(key, "pos%d", iForExactPosObject);
@@ -841,9 +845,8 @@ void QueryHelper::putExactPositionObject(RegionPtr& rptr,
auto pos = std::make_shared<Position>(iForExactPosObject);
rptr->put(keyptr, pos);
}
-
-SerializablePtr QueryHelper::getCachedPositionObject(RegionPtr& rptr,
- int iForExactPosObject) {
+std::shared_ptr<Serializable> QueryHelper::getCachedPositionObject(
+ std::shared_ptr<Region>& rptr, int iForExactPosObject) {
char key[100];
ACE_OS::sprintf(key, "pos%d", iForExactPosObject);
auto keyptr = CacheableKey::create(key);
@@ -852,12 +855,13 @@ SerializablePtr QueryHelper::getCachedPositionObject(RegionPtr& rptr,
//===========================================================================================
-void QueryHelper::populatePortfolioData(RegionPtr& rptr, int setSize,
- int numSets, int32_t objSize) {
+void QueryHelper::populatePortfolioData(std::shared_ptr<Region>& rptr,
+ int setSize, int numSets,
+ int32_t objSize) {
// lets reset the counter for uniform population of position objects
Position::resetCounter();
- CacheablePtr port;
- CacheableKeyPtr keyport;
+ std::shared_ptr<Cacheable> port;
+ std::shared_ptr<CacheableKey> keyport;
for (int set = 1; set <= numSets; set++) {
for (int current = 1; current <= setSize; current++) {
port = std::make_shared<Portfolio>(current, objSize);
@@ -872,12 +876,12 @@ void QueryHelper::populatePortfolioData(RegionPtr& rptr, int setSize,
FWKINFO("all puts done \n");
}
-void QueryHelper::populatePortfolio(RegionPtr& rptr, int maxKey,
+void QueryHelper::populatePortfolio(std::shared_ptr<Region>& rptr, int maxKey,
int32_t objSize) {
// lets reset the counter for uniform population of position objects
Position::resetCounter();
- CacheablePtr port;
- CacheableKeyPtr keyport;
+ std::shared_ptr<Cacheable> port;
+ std::shared_ptr<CacheableKey> keyport;
for (int current = 0; current <= maxKey; current++) {
port = std::make_shared<Portfolio>(current, objSize);
@@ -891,10 +895,10 @@ void QueryHelper::populatePortfolio(RegionPtr& rptr, int maxKey,
FWKINFO("All Portfolio puts done \n");
}
-void QueryHelper::destroyPortfolioOrPositionData(RegionPtr& rptr, int setSize,
- int numSets,
+void QueryHelper::destroyPortfolioOrPositionData(std::shared_ptr<Region>& rptr,
+ int setSize, int numSets,
const char* dataType) {
- CacheableKeyPtr keyport;
+ std::shared_ptr<CacheableKey> keyport;
try {
for (int set = 1; set <= numSets; set++) {
for (int current = 1; current <= setSize; current++) {
@@ -921,9 +925,9 @@ void QueryHelper::destroyPortfolioOrPositionData(RegionPtr& rptr, int setSize,
FWKINFO("destroy done \n");
}
-void QueryHelper::invalidatePortfolioOrPositionData(RegionPtr& rptr,
- int setSize, int numSets,
- const char* dataType) {
+void QueryHelper::invalidatePortfolioOrPositionData(
+ std::shared_ptr<Region>& rptr, int setSize, int numSets,
+ const char* dataType) {
try {
for (int set = 1; set <= numSets; set++) {
for (int current = 1; current <= setSize; current++) {
@@ -934,7 +938,7 @@ void QueryHelper::invalidatePortfolioOrPositionData(RegionPtr& rptr,
ACE_OS::sprintf(portname, "pos%d-%d", set, current);
}
- CacheableKeyPtr keyport = CacheableKey::create(portname);
+ auto keyport = CacheableKey::create(portname);
rptr->invalidate(keyport);
}
}
@@ -949,11 +953,11 @@ void QueryHelper::invalidatePortfolioOrPositionData(RegionPtr& rptr,
const char* secIds[] = {"SUN", "IBM", "YHOO", "GOOG", "MSFT",
"AOL", "APPL", "ORCL", "SAP", "DELL"};
-void QueryHelper::populatePositionData(RegionPtr& rptr, int setSize,
- int numSets) {
+void QueryHelper::populatePositionData(std::shared_ptr<Region>& rptr,
+ int setSize, int numSets) {
int numSecIds = sizeof(secIds) / sizeof(char*);
- CacheableKeyPtr keypos;
- CacheablePtr pos;
+ std::shared_ptr<CacheableKey> keypos;
+ std::shared_ptr<Cacheable> pos;
for (int set = 1; set <= numSets; set++) {
for (int current = 1; current <= setSize; current++) {
pos = std::make_shared<Position>(secIds[current % numSecIds],
@@ -968,9 +972,9 @@ void QueryHelper::populatePositionData(RegionPtr& rptr, int setSize,
}
}
-void QueryHelper::populatePortfolioPdxData(RegionPtr& rptr, int setSize,
- int numSets, int32_t objSize,
- char** nm) {
+void QueryHelper::populatePortfolioPdxData(std::shared_ptr<Region>& rptr,
+ int setSize, int numSets,
+ int32_t objSize, char** nm) {
// lets reset the counter for uniform population of position objects
testobject::PositionPdx::resetCounter();
@@ -981,7 +985,7 @@ void QueryHelper::populatePortfolioPdxData(RegionPtr& rptr, int setSize,
char portname[100] = {0};
ACE_OS::sprintf(portname, "port%d-%d", set, current);
- CacheableKeyPtr keyport = CacheableKey::create(portname);
+ auto keyport = CacheableKey::create(portname);
rptr->put(keyport, port);
LOGINFO("populatePortfolioPdxData:: Put for iteration current = %d done",
@@ -994,7 +998,7 @@ void QueryHelper::populatePortfolioPdxData(RegionPtr& rptr, int setSize,
printf("all puts done \n");
}
-void QueryHelper::populatePositionPdxData(RegionPtr& rptr, int setSize,
+void QueryHelper::populatePositionPdxData(std::shared_ptr<Region>& rptr, int setSize,
int numSets) {
int numSecIds = sizeof(secIds) / sizeof(char*);
@@ -1006,7 +1010,7 @@ void QueryHelper::populatePositionPdxData(RegionPtr& rptr, int setSize,
char posname[100] = {0};
ACE_OS::sprintf(posname, "pos%d-%d", set, current);
- CacheableKeyPtr keypos = CacheableKey::create(posname);
+ auto keypos = CacheableKey::create(posname);
rptr->put(keypos, pos);
LOGINFO("populatePositionPdxData:: Put for iteration current = %d done",
current);
@@ -1014,29 +1018,29 @@ void QueryHelper::populatePositionPdxData(RegionPtr& rptr, int setSize,
}
// positionSetSize = setSize; positionNumSets = numSets;
}
-bool QueryHelper::verifyRS(SelectResultsPtr& resultSet, int expectedRows) {
+bool QueryHelper::verifyRS(std::shared_ptr<SelectResults>& resultSet, int expectedRows) {
if (!std::dynamic_pointer_cast<ResultSet>(resultSet)) {
return false;
}
- ResultSetPtr rsptr = std::static_pointer_cast<ResultSet>(resultSet);
+ auto rsptr = std::static_pointer_cast<ResultSet>(resultSet);
- int foundRows = 0;
+ int foundRows = 0;
- SelectResultsIterator iter = rsptr->getIterator();
+ SelectResultsIterator iter = rsptr->getIterator();
- for (int32_t rows = 0; rows < rsptr->size(); rows++) {
- SerializablePtr ser = (*rsptr)[rows]; // iter.next();
- foundRows++;
- }
+ for (int32_t rows = 0; rows < rsptr->size(); rows++) {
+ auto ser = (*rsptr)[rows]; // iter.next();
+ foundRows++;
+ }
- FWKINFO("found rows " << foundRows << " expected " << expectedRows);
- if (foundRows == expectedRows) return true;
+ FWKINFO("found rows " << foundRows << " expected " << expectedRows);
+ if (foundRows == expectedRows) return true;
- return false;
+ return false;
}
-bool QueryHelper::verifySS(SelectResultsPtr& structSet, int expectedRows,
+bool QueryHelper::verifySS(std::shared_ptr<SelectResults>& structSet, int expectedRows,
int expectedFields) {
FWKINFO("QueryHelper::verifySS : expectedRows = "
<< expectedRows << " ,expectedFields = " << expectedFields);
@@ -1049,14 +1053,14 @@ bool QueryHelper::verifySS(SelectResultsPtr& structSet, int expectedRows,
return false;
}
- StructSetPtr ssptr = std::static_pointer_cast<StructSet>(structSet);
+ auto ssptr = std::static_pointer_cast<StructSet>(structSet);
- int foundRows = 0;
+ int foundRows = 0;
- SelectResultsIterator iter = ssptr->getIterator();
+ SelectResultsIterator iter = ssptr->getIterator();
- for (int32_t rows = 0; rows < ssptr->size(); rows++) {
- SerializablePtr ser = (*ssptr)[rows]; // iter.next();
+ for (int32_t rows = 0; rows < ssptr->size(); rows++) {
+ auto ser = (*ssptr)[rows]; // iter.next();
foundRows++;
Struct* siptr = dynamic_cast<Struct*>(ser.get());
@@ -1069,7 +1073,7 @@ bool QueryHelper::verifySS(SelectResultsPtr& structSet, int expectedRows,
int foundFields = 0;
for (int32_t cols = 0; cols < siptr->length(); cols++) {
- SerializablePtr field = (*siptr)[cols]; // siptr->next();
+ auto field = (*siptr)[cols]; // siptr->next();
foundFields++;
}
diff --git a/tests/cpp/fwklib/RegionHelper.hpp b/tests/cpp/fwklib/RegionHelper.hpp
index 77049b5..74dadd1 100644
--- a/tests/cpp/fwklib/RegionHelper.hpp
+++ b/tests/cpp/fwklib/RegionHelper.hpp
@@ -24,7 +24,6 @@
#include <string>
#include <map>
-#include <geode/GeodeCppCache.hpp>
#include <geode/util/chrono/duration.hpp>
#include "fwklib/FrameworkTest.hpp"
@@ -65,7 +64,7 @@ class RegionHelper {
}
std::string regionAttributesToString() {
- RegionAttributesPtr atts = m_region->getAttributesPtr();
+ auto atts = m_region->getAttributesPtr();
return regionAttributesToString(atts);
}
@@ -74,11 +73,11 @@ class RegionHelper {
const std::string specName() { return m_spec; }
std::string regionTag() {
- RegionAttributesPtr atts = m_region->getAttributesPtr();
+ auto atts = m_region->getAttributesPtr();
return regionTag(atts);
}
- static std::string regionTag(RegionAttributesPtr attr) {
+ static std::string regionTag(std::shared_ptr<RegionAttributes> attr) {
std::string sString;
sString += attr->getCachingEnabled() ? "Caching" : "NoCache";
@@ -90,7 +89,8 @@ class RegionHelper {
* @param attr Return a string describing this region.
* @retval A String representing aRegion.
*/
- static std::string regionAttributesToString(RegionAttributesPtr& attr) {
+ static std::string regionAttributesToString(
+ std::shared_ptr<RegionAttributes>& attr) {
std::string sString;
sString += "\ncaching: ";
@@ -150,7 +150,7 @@ class RegionHelper {
return sString;
}
void setRegionAttributes(RegionFactory& regionFac) {
- RegionAttributesPtr atts = m_region->getAttributesPtr();
+ auto atts = m_region->getAttributesPtr();
regionFac.setCachingEnabled(atts->getCachingEnabled());
if (atts->getCacheListenerLibrary() != NULL &&
atts->getCacheListenerFactory() != NULL) {
@@ -204,8 +204,8 @@ class RegionHelper {
regionFac.setConcurrencyChecksEnabled(atts->getConcurrencyChecksEnabled());
}
- RegionPtr createRootRegion(CachePtr& cachePtr) {
- RegionPtr region;
+ std::shared_ptr<Region> createRootRegion(std::shared_ptr<Cache>& cachePtr) {
+ std::shared_ptr<Region> region;
std::string regionName = m_region->getName();
if (regionName.empty()) {
FWKEXCEPTION("Region name not specified.");
@@ -213,7 +213,8 @@ class RegionHelper {
return createRootRegion(cachePtr, regionName);
}
- RegionPtr createRootRegion(CachePtr& cachePtr, std::string regionName) {
+ std::shared_ptr<Region> createRootRegion(std::shared_ptr<Cache>& cachePtr,
+ std::string regionName) {
if (regionName.empty()) {
regionName = m_region->getName();
FWKINFO("region name is " << regionName);
diff --git a/tests/cpp/security/CredentialGenerator.cpp b/tests/cpp/security/CredentialGenerator.cpp
index 77f30c8..c367fda 100644
--- a/tests/cpp/security/CredentialGenerator.cpp
+++ b/tests/cpp/security/CredentialGenerator.cpp
@@ -27,23 +27,30 @@ using namespace apache::geode::client::testframework::security;
CredentialGenerator::registeredClassMap* CredentialGenerator::generatormap =
NULL;
-
-CredentialGeneratorPtr CredentialGenerator::create(std::string scheme) {
+std::shared_ptr<CredentialGenerator> CredentialGenerator::create(
+ std::string scheme) {
if (generators().find(scheme) != generators().end()) {
return generators()[scheme];
// first call to create, nothing will be registered until now.
} else if (generators().size() == 0) {
- registerScheme(CredentialGeneratorPtr(new CredentialGenerator()));
- registerScheme(CredentialGeneratorPtr(new DummyCredentialGenerator()));
- registerScheme(CredentialGeneratorPtr(new DummyCredentialGenerator2()));
- registerScheme(CredentialGeneratorPtr(new DummyCredentialGenerator3()));
- registerScheme(CredentialGeneratorPtr(new LdapUserCredentialGenerator()));
- registerScheme(CredentialGeneratorPtr(new PKCSCredentialGenerator()));
- registerScheme(CredentialGeneratorPtr(new NoopCredentialGenerator()));
+ registerScheme(
+ std::shared_ptr<CredentialGenerator>(new CredentialGenerator()));
+ registerScheme(
+ std::shared_ptr<CredentialGenerator>(new DummyCredentialGenerator()));
+ registerScheme(
+ std::shared_ptr<CredentialGenerator>(new DummyCredentialGenerator2()));
+ registerScheme(
+ std::shared_ptr<CredentialGenerator>(new DummyCredentialGenerator3()));
+ registerScheme(std::shared_ptr<CredentialGenerator>(
+ new LdapUserCredentialGenerator()));
+ registerScheme(
+ std::shared_ptr<CredentialGenerator>(new PKCSCredentialGenerator()));
+ registerScheme(
+ std::shared_ptr<CredentialGenerator>(new NoopCredentialGenerator()));
return create(scheme);
} else {
- return CredentialGeneratorPtr(new CredentialGenerator());
+ return std::shared_ptr<CredentialGenerator>(new CredentialGenerator());
}
}
diff --git a/tests/cpp/security/CredentialGenerator.hpp b/tests/cpp/security/CredentialGenerator.hpp
index b0f5042..2529b81 100644
--- a/tests/cpp/security/CredentialGenerator.hpp
+++ b/tests/cpp/security/CredentialGenerator.hpp
@@ -58,7 +58,6 @@ namespace testframework {
namespace security {
class CredentialGenerator;
-typedef std::shared_ptr<CredentialGenerator> CredentialGeneratorPtr;
/**
* @class CredentialGenerator CredentialGenerator.hpp
@@ -69,7 +68,7 @@ typedef std::shared_ptr<CredentialGenerator> CredentialGeneratorPtr;
* authorization schemes.
* <p>
* Usage:
- * CredentialGeneratorPtr cg = CredentialGenerator::create( schemeStr );
+ * auto cg = CredentialGenerator::create( schemeStr );
* @param schemeStr can be one of the following
* DUMMY - simple username/password authentication
* LDAP - LDAP server based authentication.
@@ -86,7 +85,7 @@ typedef std::shared_ptr<CredentialGenerator> CredentialGeneratorPtr;
*/
class CredentialGenerator {
public:
- typedef std::map<std::string, CredentialGeneratorPtr> registeredClassMap;
+ typedef std::map<std::string, std::shared_ptr<CredentialGenerator>> registeredClassMap;
private:
ID m_id;
@@ -116,8 +115,8 @@ class CredentialGenerator {
};
public:
- static CredentialGeneratorPtr create(std::string scheme);
- static bool registerScheme(CredentialGeneratorPtr scheme) {
+ static std::shared_ptr<CredentialGenerator> create(std::string scheme);
+ static bool registerScheme(std::shared_ptr<CredentialGenerator> scheme) {
// if not already registered...
if (generators().find(scheme->m_name) == generators().end()) {
generators()[scheme->m_name] = scheme;
@@ -153,7 +152,7 @@ class CredentialGenerator {
void hashCode(){};
- void getAuthInit(PropertiesPtr& prop) {
+ void getAuthInit(std::shared_ptr<Properties>& prop) {
std::string authinit = this->getClientAuthInitLoaderFactory();
if (!authinit.empty()) {
FWKINFO("Authentication initializer : "
@@ -226,23 +225,23 @@ class CredentialGenerator {
return securityCmdStr;
}
- virtual void getValidCredentials(PropertiesPtr& p) {
+ virtual void getValidCredentials(std::shared_ptr<Properties>& p) {
;
; // no credentials by default
}
- virtual void getInvalidCredentials(PropertiesPtr& p) {
+ virtual void getInvalidCredentials(std::shared_ptr<Properties>& p) {
;
; // no credentials by default
}
virtual void getAllowedCredentialsForOps(opCodeList& opCodes,
- PropertiesPtr& p,
+ std::shared_ptr<Properties>& p,
stringList* regionNames = NULL) {
;
; // no credentials by default
}
virtual void getDisallowedCredentialsForOps(opCodeList& opCodes,
- PropertiesPtr& p,
+ std::shared_ptr<Properties>& p,
stringList* regionNames = NULL) {
;
; // no credentials by default
diff --git a/tests/cpp/security/DummyCredentialGenerator.hpp b/tests/cpp/security/DummyCredentialGenerator.hpp
index 03c1f9d..6d58f6b 100644
--- a/tests/cpp/security/DummyCredentialGenerator.hpp
+++ b/tests/cpp/security/DummyCredentialGenerator.hpp
@@ -70,7 +70,7 @@ class DummyCredentialGenerator : public CredentialGenerator {
return "javaobject.DummyAuthorization.create";
}
- void getValidCredentials(PropertiesPtr& p) {
+ void getValidCredentials(std::shared_ptr<Properties>& p) {
p->insert("security-username", "user1");
p->insert("security-password", "user1");
FWKDEBUG("inserted valid security-username "
@@ -78,7 +78,7 @@ class DummyCredentialGenerator : public CredentialGenerator {
<< p->find("security-password")->asChar());
}
- void getInvalidCredentials(PropertiesPtr& p) {
+ void getInvalidCredentials(std::shared_ptr<Properties>& p) {
p->insert("security-username", "1user");
p->insert("security-password", "user1");
FWKDEBUG("inserted invalid security-username "
@@ -86,13 +86,15 @@ class DummyCredentialGenerator : public CredentialGenerator {
<< p->find("security-password")->asChar());
}
- void getAllowedCredentialsForOps(opCodeList& opCodes, PropertiesPtr& p,
+ void getAllowedCredentialsForOps(opCodeList& opCodes,
+ std::shared_ptr<Properties>& p,
stringList* regionNames = NULL) {
XmlAuthzCredentialGenerator authz(id());
authz.getAllowedCredentials(opCodes, p, regionNames);
}
- void getDisallowedCredentialsForOps(opCodeList& opCodes, PropertiesPtr& p,
+ void getDisallowedCredentialsForOps(opCodeList& opCodes,
+ std::shared_ptr<Properties>& p,
stringList* regionNames = NULL) {
XmlAuthzCredentialGenerator authz(id());
authz.getDisallowedCredentials(opCodes, p, regionNames);
diff --git a/tests/cpp/security/DummyCredentialGenerator2.hpp b/tests/cpp/security/DummyCredentialGenerator2.hpp
index a017498..a786416 100644
--- a/tests/cpp/security/DummyCredentialGenerator2.hpp
+++ b/tests/cpp/security/DummyCredentialGenerator2.hpp
@@ -69,7 +69,7 @@ class DummyCredentialGenerator2 : public CredentialGenerator {
return "javaobject.DummyAuthorization.create";
}
- void getValidCredentials(PropertiesPtr& p) {
+ void getValidCredentials(std::shared_ptr<Properties>& p) {
p->insert("security-username", "user1");
p->insert("security-password", "user1");
FWKDEBUG("inserted valid security-username "
@@ -77,7 +77,7 @@ class DummyCredentialGenerator2 : public CredentialGenerator {
<< p->find("security-password")->asChar());
}
- void getInvalidCredentials(PropertiesPtr& p) {
+ void getInvalidCredentials(std::shared_ptr<Properties>& p) {
p->insert("security-username", "1user");
p->insert("security-password", "user1");
FWKDEBUG("inserted invalid security-username "
@@ -85,13 +85,15 @@ class DummyCredentialGenerator2 : public CredentialGenerator {
<< p->find("security-password")->asChar());
}
- void getAllowedCredentialsForOps(opCodeList& opCodes, PropertiesPtr& p,
+ void getAllowedCredentialsForOps(opCodeList& opCodes,
+ std::shared_ptr<Properties>& p,
stringList* regionNames = NULL) {
XmlAuthzCredentialGenerator authz(id());
authz.getAllowedCredentials(opCodes, p, regionNames);
}
- void getDisallowedCredentialsForOps(opCodeList& opCodes, PropertiesPtr& p,
+ void getDisallowedCredentialsForOps(opCodeList& opCodes,
+ std::shared_ptr<Properties>& p,
stringList* regionNames = NULL) {
XmlAuthzCredentialGenerator authz(id());
authz.getDisallowedCredentials(opCodes, p, regionNames);
diff --git a/tests/cpp/security/DummyCredentialGenerator3.hpp b/tests/cpp/security/DummyCredentialGenerator3.hpp
index 2629dcd..6433ad8 100644
--- a/tests/cpp/security/DummyCredentialGenerator3.hpp
+++ b/tests/cpp/security/DummyCredentialGenerator3.hpp
@@ -69,7 +69,7 @@ class DummyCredentialGenerator3 : public CredentialGenerator {
return "javaobject.DummyAuthorization.create";
}
- void getValidCredentials(PropertiesPtr& p) {
+ void getValidCredentials(std::shared_ptr<Properties>& p) {
p->insert("security-username", "user1");
p->insert("security-password", "user1");
FWKDEBUG("inserted valid security-username "
@@ -77,7 +77,7 @@ class DummyCredentialGenerator3 : public CredentialGenerator {
<< p->find("security-password")->asChar());
}
- void getInvalidCredentials(PropertiesPtr& p) {
+ void getInvalidCredentials(std::shared_ptr<Properties>& p) {
p->insert("security-username", "1user");
p->insert("security-password", "user1");
FWKDEBUG("inserted invalid security-username "
@@ -85,13 +85,15 @@ class DummyCredentialGenerator3 : public CredentialGenerator {
<< p->find("security-password")->asChar());
}
- void getAllowedCredentialsForOps(opCodeList& opCodes, PropertiesPtr& p,
+ void getAllowedCredentialsForOps(opCodeList& opCodes,
+ std::shared_ptr<Properties>& p,
stringList* regionNames = NULL) {
XmlAuthzCredentialGenerator authz(id());
authz.getAllowedCredentials(opCodes, p, regionNames);
}
- void getDisallowedCredentialsForOps(opCodeList& opCodes, PropertiesPtr& p,
+ void getDisallowedCredentialsForOps(opCodeList& opCodes,
+ std::shared_ptr<Properties>& p,
stringList* regionNames = NULL) {
XmlAuthzCredentialGenerator authz(id());
authz.getDisallowedCredentials(opCodes, p, regionNames);
diff --git a/tests/cpp/security/LdapUserCredentialGenerator.hpp b/tests/cpp/security/LdapUserCredentialGenerator.hpp
index 23ebf17..dcd8466 100644
--- a/tests/cpp/security/LdapUserCredentialGenerator.hpp
+++ b/tests/cpp/security/LdapUserCredentialGenerator.hpp
@@ -82,7 +82,7 @@ class LdapUserCredentialGenerator : public CredentialGenerator {
std::string getClientDummyAuthorizer() {
return "javaobject.DummyAuthorization.create";
}
- void getValidCredentials(PropertiesPtr& p) {
+ void getValidCredentials(std::shared_ptr<Properties>& p) {
p->insert("security-username", "geode1");
p->insert("security-password", "geode1");
FWKDEBUG("inserted valid security-username "
@@ -90,7 +90,7 @@ class LdapUserCredentialGenerator : public CredentialGenerator {
<< p->find("security-password")->asChar());
}
- void getInvalidCredentials(PropertiesPtr& p) {
+ void getInvalidCredentials(std::shared_ptr<Properties>& p) {
p->insert("security-username", "geode1");
p->insert("security-password", "1geode");
FWKDEBUG("inserted invalid security-username "
@@ -98,13 +98,15 @@ class LdapUserCredentialGenerator : public CredentialGenerator {
<< p->find("security-password")->asChar());
}
- void getAllowedCredentialsForOps(opCodeList& opCodes, PropertiesPtr& p,
+ void getAllowedCredentialsForOps(opCodeList& opCodes,
+ std::shared_ptr<Properties>& p,
stringList* regionNames = NULL) {
XmlAuthzCredentialGenerator authz(id());
authz.getAllowedCredentials(opCodes, p, regionNames);
}
- void getDisallowedCredentialsForOps(opCodeList& opCodes, PropertiesPtr& p,
+ void getDisallowedCredentialsForOps(opCodeList& opCodes,
+ std::shared_ptr<Properties>& p,
stringList* regionNames = NULL) {
XmlAuthzCredentialGenerator authz(id());
authz.getDisallowedCredentials(opCodes, p, regionNames);
diff --git a/tests/cpp/security/PkcsAuthInit.cpp b/tests/cpp/security/PkcsAuthInit.cpp
index 26889ba..089686c 100644
--- a/tests/cpp/security/PkcsAuthInit.cpp
+++ b/tests/cpp/security/PkcsAuthInit.cpp
@@ -25,8 +25,9 @@
namespace apache {
namespace geode {
namespace client {
-CacheableStringPtr convertBytesToString(const uint8_t* bytes, int32_t length,
- size_t maxLength) {
+std::shared_ptr<CacheableString> convertBytesToString(const uint8_t* bytes,
+ int32_t length,
+ size_t maxLength) {
if (bytes != NULL) {
std::string str;
size_t totalBytes = 0;
@@ -110,9 +111,8 @@ bool openSSLInit() {
static bool s_initDone = openSSLInit();
}
// end of extern "C"
-
-PropertiesPtr PKCSAuthInitInternal::getCredentials(
- const PropertiesPtr& securityprops, const char* server) {
+std::shared_ptr<Properties> PKCSAuthInitInternal::getCredentials(
+ const std::shared_ptr<Properties>& securityprops, const char* server) {
if (!s_initDone) {
throw AuthenticationFailedException(
"PKCSAuthInit::getCredentials: "
@@ -124,7 +124,7 @@ PropertiesPtr PKCSAuthInitInternal::getCredentials(
"No security-* properties are set.");
}
- CacheableStringPtr keyStoreptr = securityprops->find(KEYSTORE_FILE_PATH1);
+ auto keyStoreptr = securityprops->find(KEYSTORE_FILE_PATH1);
const char* keyStorePath = keyStoreptr->asChar();
@@ -134,7 +134,7 @@ PropertiesPtr PKCSAuthInitInternal::getCredentials(
"key-store file path property KEYSTORE_FILE_PATH not set.");
}
- CacheableStringPtr aliasptr = securityprops->find(KEYSTORE_ALIAS1);
+ auto aliasptr = securityprops->find(KEYSTORE_ALIAS1);
const char* alias = aliasptr->asChar();
@@ -144,7 +144,7 @@ PropertiesPtr PKCSAuthInitInternal::getCredentials(
"key-store alias property KEYSTORE_ALIAS not set.");
}
- CacheableStringPtr keyStorePassptr = securityprops->find(KEYSTORE_PASSWORD1);
+ auto keyStorePassptr = securityprops->find(KEYSTORE_PASSWORD1);
const char* keyStorePass = keyStorePassptr->asChar();
@@ -189,7 +189,7 @@ PropertiesPtr PKCSAuthInitInternal::getCredentials(
"PKCSAuthInit::getCredentials: "
"Unable to create signature");
}
- CacheablePtr signatureValPtr;
+ std::shared_ptr<Cacheable> signatureValPtr;
if (m_stringCredentials) {
// convert signature bytes to base64
signatureValPtr =
@@ -202,7 +202,7 @@ PropertiesPtr PKCSAuthInitInternal::getCredentials(
LOGINFO(" Converting CREDS to BYTES: %s",
signatureValPtr->toString()->asChar());
}
- PropertiesPtr credentials = Properties::create();
+ auto credentials = Properties::create();
credentials->insert(KEYSTORE_ALIAS1, alias);
credentials->insert(CacheableString::create(SIGNATURE_DATA1),
signatureValPtr);
diff --git a/tests/cpp/security/PkcsAuthInit.hpp b/tests/cpp/security/PkcsAuthInit.hpp
index e094b1b..ab9ae29 100644
--- a/tests/cpp/security/PkcsAuthInit.hpp
+++ b/tests/cpp/security/PkcsAuthInit.hpp
@@ -88,8 +88,8 @@ class PKCSAuthInitInternal : public AuthInitialize {
* The format expected is "host:port".
* @returns the credentials to be used for the given <code>server</code>
*/
- PropertiesPtr getCredentials(const PropertiesPtr& securityprops,
- const char* server);
+ std::shared_ptr<Properties> getCredentials(
+ const std::shared_ptr<Properties>& securityprops, const char* server);
/**
* @brief Invoked before the cache goes down.
diff --git a/tests/cpp/security/PkcsCredentialGenerator.hpp b/tests/cpp/security/PkcsCredentialGenerator.hpp
index c6ca5da..bf4fa52 100644
--- a/tests/cpp/security/PkcsCredentialGenerator.hpp
+++ b/tests/cpp/security/PkcsCredentialGenerator.hpp
@@ -79,7 +79,8 @@ class PKCSCredentialGenerator : public CredentialGenerator {
return "javaobject.DummyAuthorization.create";
}
- void insertKeyStorePath(PropertiesPtr& p, const char* username) {
+ void insertKeyStorePath(std::shared_ptr<Properties>& p,
+ const char* username) {
char keystoreFilePath[1024];
char* tempPath = NULL;
tempPath = ACE_OS::getenv("TESTSRC");
@@ -96,7 +97,7 @@ class PKCSCredentialGenerator : public CredentialGenerator {
p->insert(KEYSTORE_FILE_PATH, keystoreFilePath);
}
- void setPKCSProperties(PropertiesPtr& p, char* username) {
+ void setPKCSProperties(std::shared_ptr<Properties>& p, char* username) {
char keyStorePassWord[1024];
sprintf(keyStorePassWord, "%s", "geode");
@@ -106,7 +107,7 @@ class PKCSCredentialGenerator : public CredentialGenerator {
insertKeyStorePath(p, username);
}
- void getValidCredentials(PropertiesPtr& p) {
+ void getValidCredentials(std::shared_ptr<Properties>& p) {
char username[20] = {'\0'};
sprintf(username, "geode%d", (rand() % 10) + 1);
setPKCSProperties(p, username);
@@ -114,7 +115,7 @@ class PKCSCredentialGenerator : public CredentialGenerator {
<< p->find("security-username")->asChar());
}
- void getInvalidCredentials(PropertiesPtr& p) {
+ void getInvalidCredentials(std::shared_ptr<Properties>& p) {
char username[20] = {'\0'};
sprintf(username, "%dgeode", (rand() % 11) + 1);
setPKCSProperties(p, username);
@@ -122,7 +123,8 @@ class PKCSCredentialGenerator : public CredentialGenerator {
<< p->find("security-username")->asChar());
}
- void getAllowedCredentialsForOps(opCodeList& opCodes, PropertiesPtr& p,
+ void getAllowedCredentialsForOps(opCodeList& opCodes,
+ std::shared_ptr<Properties>& p,
stringList* regionNames = NULL) {
XmlAuthzCredentialGenerator authz(id());
authz.getAllowedCredentials(opCodes, p, regionNames);
@@ -130,7 +132,8 @@ class PKCSCredentialGenerator : public CredentialGenerator {
insertKeyStorePath(p, username);
}
- void getDisallowedCredentialsForOps(opCodeList& opCodes, PropertiesPtr& p,
+ void getDisallowedCredentialsForOps(opCodeList& opCodes,
+ std::shared_ptr<Properties>& p,
stringList* regionNames = NULL) {
XmlAuthzCredentialGenerator authz(id());
authz.getDisallowedCredentials(opCodes, p, regionNames);
diff --git a/tests/cpp/security/Security.cpp b/tests/cpp/security/Security.cpp
index 5b93e58..7863173 100644
--- a/tests/cpp/security/Security.cpp
+++ b/tests/cpp/security/Security.cpp
@@ -96,7 +96,7 @@ TESTTASK doCloseCache() {
return result;
}
-void Security::getClientSecurityParams(PropertiesPtr prop,
+void Security::getClientSecurityParams(std::shared_ptr<Properties> prop,
std::string credentials) {
std::string securityParams = getStringValue("securityParams");
@@ -121,7 +121,7 @@ void Security::getClientSecurityParams(PropertiesPtr prop,
if (prop == nullptr) prop = Properties::create();
- CredentialGeneratorPtr cg = CredentialGenerator::create(sc);
+ auto cg = CredentialGenerator::create(sc);
cg->getAuthInit(prop);
if (securityParams == "valid" || securityParams == "VALID") {
@@ -161,7 +161,7 @@ void Security::checkTest(const char *taskId) {
std::lock_guard<spinlock_mutex> guard(m_lck);
setTask(taskId);
if (m_cache == nullptr || m_cache->isClosed()) {
- PropertiesPtr pp = Properties::create();
+ auto pp = Properties::create();
getClientSecurityParams(pp, getStringValue("credentials"));
@@ -327,13 +327,13 @@ int32_t Security::doServerKeys()
int32_t expected = getIntValue( "expectedCount" );
- RegionPtr regionPtr = getRegionPtr();
+ auto regionPtr = getRegionPtr();
if ( regionPtr == NULL ) {
FWKEXCEPTION( "Security::doServerKeys(): No region to perform operations
on." );
}
- VectorOfCacheableKey keysVec;
+ std::vector<std::shared_ptr<CacheableKey>> keysVec;
try {
regionPtr->serverKeys( keysVec );
} catch( Exception & e ) {
@@ -403,7 +403,7 @@ int32_t Security::initKeys(bool useDefault) {
void Security::initStrKeys(int32_t low, int32_t high,
const std::string &keyBase) {
- m_KeysA = new CacheableStringPtr[m_MaxKeys];
+ m_KeysA = new std::shared_ptr<CacheableString>[m_MaxKeys];
const char *const base = keyBase.c_str();
char buf[128];
@@ -440,7 +440,7 @@ int32_t Security::initValues(int32_t numKeys, int32_t siz, bool useDefault) {
m_MaxValues = numKeys;
- m_CValue = new CacheableBytesPtr[m_MaxValues];
+ m_CValue = new std::shared_ptr<CacheableBytes>[m_MaxValues];
char *buf = new char[siz];
memset(buf, 'V', siz);
@@ -462,7 +462,7 @@ int32_t Security::createRegion() {
try {
createPool();
RegionHelper help(g_test);
- RegionPtr region = help.createRootRegion(m_cache);
+ auto region = help.createRootRegion(m_cache);
std::string key(region->getName());
bbIncrement(REGIONSBB, key);
@@ -492,20 +492,20 @@ int32_t Security::verifyInterestList()
try {
int32_t countUpdate = 0;
- RegionPtr region = getRegionPtr();
+ auto region = getRegionPtr();
int32_t numOfRegisterKeys = getIntValue( "registerKeys");
int32_t payload = getIntValue( "valueSizes");
- VectorOfCacheableKey keys;
+ std::vector<std::shared_ptr<CacheableKey>> keys;
region->keys(keys);
- CacheableBytesPtr valuePtr;
- CacheableKeyPtr keyPtr;
+ std::shared_ptr<CacheableBytes> valuePtr;
+ std::shared_ptr<CacheableKey> keyPtr;
uint32_t valueSize;
for(int32_t i = 0; i < (int32_t) keys.size(); i++)
{
keyPtr = keys.at(i);
- valuePtr = std::dynamic_pointer_cast<CacheableBytes>( region->get(keyPtr) );
- valueSize = valuePtr->length();
+ valuePtr = std::dynamic_pointer_cast<CacheableBytes>( region->get(keyPtr)
+); valueSize = valuePtr->length();
if( (int32_t)valueSize == payload )
{
@@ -545,7 +545,7 @@ int32_t Security::populateRegion()
FWKINFO( "In Security::populateRegion()" );
try {
- RegionPtr region = getRegionPtr();
+ auto region = getRegionPtr();
TestClient * clnt = TestClient::getTestClient();
resetValue( "distinctKeys" );
initValues( initKeys());
@@ -579,7 +579,7 @@ int32_t Security::registerInterestList() {
FWKINFO("In Security::registerInterestList()");
try {
- RegionPtr region = getRegionPtr();
+ auto region = getRegionPtr();
int32_t numKeys = getIntValue("distinctKeys"); // check distince keys first
if (numKeys <= 0) {
// FWKSEVERE( "Failed to initialize keys with numKeys :" << numKeys);
@@ -593,7 +593,7 @@ int32_t Security::registerInterestList() {
clearKeys();
m_MaxKeys = numOfRegisterKeys;
m_KeyIndexBegin = low;
- VectorOfCacheableKey registerKeyList;
+ std::vector<std::shared_ptr<CacheableKey>> registerKeyList;
int32_t keySize = getIntValue("keySize");
keySize = (keySize > 0) ? keySize : 10;
std::string keyBase(keySize, 'A');
@@ -629,7 +629,7 @@ int32_t Security::registerRegexList() {
int32_t result = FWK_SEVERE;
FWKINFO("In Security::registerRegexList()");
try {
- RegionPtr region = getRegionPtr();
+ auto region = getRegionPtr();
std::string registerRegex = getStringValue("registerRegex");
FWKINFO("Security::registerRegexList region name is "
<< region->getName() << "regex is: " << registerRegex.c_str());
@@ -654,7 +654,7 @@ int32_t Security::unregisterRegexList() {
int32_t result = FWK_SEVERE;
FWKINFO("In Security::unregisterRegexList()");
try {
- RegionPtr region = getRegionPtr();
+ auto region = getRegionPtr();
std::string unregisterRegex = getStringValue("unregisterRegex");
FWKINFO("Security::unregisterRegexList region name is "
<< region->getName() << "regex is: " << unregisterRegex.c_str());
@@ -680,7 +680,7 @@ int32_t Security::registerAllKeys() {
FWKINFO("In Security::registerAllKeys()");
try {
- RegionPtr region = getRegionPtr();
+ auto region = getRegionPtr();
FWKINFO("Security::registerAllKeys region name is " << region->getName());
region->registerAllKeys();
result = FWK_SUCCESS;
@@ -740,9 +740,8 @@ int32_t Security::checkValues() {
}
// ----------------------------------------------------------------------------
-
-RegionPtr Security::getRegionPtr(const char *reg) {
- RegionPtr region;
+std::shared_ptr<Region> Security::getRegionPtr(const char *reg) {
+ std::shared_ptr<Region> region;
std::string name;
if (reg == NULL) {
@@ -815,8 +814,8 @@ bool Security::checkReady(int32_t numClients) {
return false;
}
//----------------------------------------------------------------------------
-CacheablePtr Security::getUserObject(const std::string &objType) {
- CacheablePtr usrObj = nullptr;
+std::shared_ptr<Cacheable> Security::getUserObject(const std::string &objType) {
+ std::shared_ptr<Cacheable> usrObj = nullptr;
resetValue("entryCount");
int numOfKeys =
getIntValue("entryCount"); // number of key should be multiple of 20
@@ -839,8 +838,8 @@ CacheablePtr Security::getUserObject(const std::string &objType) {
return usrObj;
}
// ----------------------------------------------------------------------------
-CacheableStringPtr Security::getKey(int32_t max) {
- CacheableStringPtr keyPtr;
+std::shared_ptr<CacheableString> Security::getKey(int32_t max) {
+ std::shared_ptr<CacheableString> keyPtr;
char buf[32];
resetValue("objectType");
const std::string objectType = getStringValue("objectType");
@@ -894,42 +893,42 @@ void Security::runQuery(int32_t &queryCnt) {
static_cast<uint32_t>(QueryStrings::RSsize()));
ACE_Time_Value startTime, endTime;
- QueryServicePtr qs = m_cache->getQueryService();
- QueryPtr qry;
- SelectResultsPtr results;
- resetValue("largeSetQuery");
- resetValue("unsupportedPRQuery");
- bool islargeSetQuery = g_test->getBoolValue("largeSetQuery");
- bool isUnsupportedPRQuery = g_test->getBoolValue("unsupportedPRQuery");
- if (allowQuery(resultsetQueries[i].category,
- resultsetQueries[i].haveLargeResultset, islargeSetQuery,
- isUnsupportedPRQuery)) {
- FWKINFO(" running resultsetQueries["
- << i << "] query : " << resultsetQueries[i].query());
- qry = qs->newQuery(resultsetQueries[i].query());
- startTime = ACE_OS::gettimeofday();
- results = qry->execute(std::chrono::seconds{600});
- endTime = ACE_OS::gettimeofday() - startTime;
- FWKINFO(" Time Taken to execute the reselt set query : "
- << resultsetQueries[i].query() << ": is " << endTime.sec() << "."
- << endTime.usec() << " sec");
- queryCnt++;
- }
- i = GsRandom::random(static_cast<uint32_t>(0),
- static_cast<uint32_t>(QueryStrings::SSsize()));
- if (allowQuery(structsetQueries[i].category,
- structsetQueries[i].haveLargeResultset, islargeSetQuery,
- isUnsupportedPRQuery)) {
- FWKINFO(" running structsetQueries["
- << i << "] query : " << structsetQueries[i].query());
- qry = qs->newQuery(structsetQueries[i].query());
- startTime = ACE_OS::gettimeofday();
- results = qry->execute(std::chrono::seconds{600});
- endTime = ACE_OS::gettimeofday() - startTime;
- FWKINFO(" Time Taken to execute the struct set query : "
- << structsetQueries[i].query() << ": is " << endTime.sec() << "."
- << endTime.usec() << " sec");
- queryCnt++;
+ auto qs = m_cache->getQueryService();
+ std::shared_ptr<Query> qry;
+ std::shared_ptr<SelectResults> results;
+ resetValue("largeSetQuery");
+ resetValue("unsupportedPRQuery");
+ bool islargeSetQuery = g_test->getBoolValue("largeSetQuery");
+ bool isUnsupportedPRQuery = g_test->getBoolValue("unsupportedPRQuery");
+ if (allowQuery(resultsetQueries[i].category,
+ resultsetQueries[i].haveLargeResultset, islargeSetQuery,
+ isUnsupportedPRQuery)) {
+ FWKINFO(" running resultsetQueries["
+ << i << "] query : " << resultsetQueries[i].query());
+ qry = qs->newQuery(resultsetQueries[i].query());
+ startTime = ACE_OS::gettimeofday();
+ results = qry->execute(std::chrono::seconds{600});
+ endTime = ACE_OS::gettimeofday() - startTime;
+ FWKINFO(" Time Taken to execute the reselt set query : "
+ << resultsetQueries[i].query() << ": is " << endTime.sec() << "."
+ << endTime.usec() << " sec");
+ queryCnt++;
+ }
+ i = GsRandom::random(static_cast<uint32_t>(0),
+ static_cast<uint32_t>(QueryStrings::SSsize()));
+ if (allowQuery(structsetQueries[i].category,
+ structsetQueries[i].haveLargeResultset, islargeSetQuery,
+ isUnsupportedPRQuery)) {
+ FWKINFO(" running structsetQueries["
+ << i << "] query : " << structsetQueries[i].query());
+ qry = qs->newQuery(structsetQueries[i].query());
+ startTime = ACE_OS::gettimeofday();
+ results = qry->execute(std::chrono::seconds{600});
+ endTime = ACE_OS::gettimeofday() - startTime;
+ FWKINFO(" Time Taken to execute the struct set query : "
+ << structsetQueries[i].query() << ": is " << endTime.sec() << "."
+ << endTime.usec() << " sec");
+ queryCnt++;
}
} catch (Exception &e) {
FWKEXCEPTION(
@@ -962,9 +961,9 @@ int32_t Security::doEntryOperations() {
ACE_Time_Value end = ACE_OS::gettimeofday() + ACE_Time_Value(secondsToRun);
ACE_Time_Value now;
- CacheableStringPtr keyPtr;
- CacheablePtr valuePtr;
- CacheablePtr tmpValue;
+ std::shared_ptr<CacheableString> keyPtr;
+ std::shared_ptr<Cacheable> valuePtr;
+ std::shared_ptr<Cacheable> tmpValue;
char *valBuf = new char[valSize + 1];
memset(valBuf, 'A', valSize);
valBuf[valSize] = 0;
@@ -973,98 +972,101 @@ int32_t Security::doEntryOperations() {
std::string objectType;
int32_t creates = 0, puts = 0, gets = 0, dests = 0, invals = 0, query = 0;
- RegionPtr regionPtr = getRegionPtr();
- if (regionPtr == nullptr) {
- fwkResult = FWK_SEVERE;
- FWKSEVERE(
- "CacheServerTest::doEntryOperations(): No region to perform operations "
- "on.");
- now = end; // Do not do the loop
- }
-
- FWKINFO("doEntryOperations will work for " << secondsToRun << " using "
- << valSize << " byte values.");
-
- PaceMeter meter(opsSec);
- objectType = getStringValue("objectType");
- while (now < end) {
- try {
- opcode = getStringValue("entryOps");
- if (opcode.empty()) {
- opcode = "no-op";
- }
- if (opcode == "add") {
- keyPtr = getKey(entryCount);
- if (!objectType.empty()) {
- tmpValue = getUserObject(objectType);
- } else {
- tmpValue = CacheableBytes::create(
- reinterpret_cast<const unsigned char *>(valBuf),
- static_cast<int32_t>(strlen(valBuf)));
- }
- regionPtr->create(keyPtr, tmpValue);
- creates++;
- } else {
- keyPtr = getKey(entryCount);
- if (opcode == "update") {
- if (!objectType.empty()) {
- tmpValue = getUserObject(objectType);
- } else {
- int32_t keyVal = atoi(keyPtr->toString());
- tmpValue = CacheableBytes::create(
- reinterpret_cast<const unsigned char *>(valBuf),
- static_cast<int32_t>(strlen(valBuf)));
- int32_t *val =
- (int32_t *)(std::dynamic_pointer_cast<CacheableBytes>(tmpValue)->value());
- *val = (*val == keyVal) ? keyVal + 1
- : keyVal; // alternate the value so that it
- // can be validated later.
- int64_t *adjNow =
- (int64_t *)(std::dynamic_pointer_cast<CacheableBytes>(tmpValue)->value() + 4);
- *adjNow = getAdjustedNowMicros();
- }
- regionPtr->put(keyPtr, tmpValue);
- puts++;
- } else if (opcode == "invalidate") {
- regionPtr->invalidate(keyPtr);
- invals++;
- } else if (opcode == "destroy") {
- regionPtr->destroy(keyPtr);
- dests++;
- } else if (opcode == "read") {
- valuePtr = regionPtr->get(keyPtr);
- gets++;
- } else if (opcode == "read+localdestroy") {
- valuePtr = regionPtr->get(keyPtr);
- gets++;
- regionPtr->localDestroy(keyPtr);
- dests++;
- } else if (opcode == "query") {
- runQuery(query);
- } else {
- FWKSEVERE("Invalid operation specified: " << opcode);
- }
- }
- } catch (TimeoutException &e) {
- fwkResult = FWK_SEVERE;
- FWKSEVERE("Caught unexpected timeout exception during entry "
- << opcode << " operation: " << e.getMessage()
- << " continuing with test.");
- } catch (EntryExistsException &ignore) {
- ignore.getMessage();
- } catch (EntryNotFoundException &ignore) {
- ignore.getMessage();
- } catch (EntryDestroyedException &ignore) {
- ignore.getMessage();
- } catch (Exception &e) {
- end = 0;
- fwkResult = FWK_SEVERE;
- FWKSEVERE("Caught unexpected exception during entry "
- << opcode << " operation: " << e.getMessage()
- << " exiting task.");
- }
- meter.checkPace();
- now = ACE_OS::gettimeofday();
+ auto regionPtr = getRegionPtr();
+ if (regionPtr == nullptr) {
+ fwkResult = FWK_SEVERE;
+ FWKSEVERE(
+ "CacheServerTest::doEntryOperations(): No region to perform operations "
+ "on.");
+ now = end; // Do not do the loop
+ }
+
+ FWKINFO("doEntryOperations will work for " << secondsToRun << " using "
+ << valSize << " byte values.");
+
+ PaceMeter meter(opsSec);
+ objectType = getStringValue("objectType");
+ while (now < end) {
+ try {
+ opcode = getStringValue("entryOps");
+ if (opcode.empty()) {
+ opcode = "no-op";
+ }
+ if (opcode == "add") {
+ keyPtr = getKey(entryCount);
+ if (!objectType.empty()) {
+ tmpValue = getUserObject(objectType);
+ } else {
+ tmpValue = CacheableBytes::create(
+ reinterpret_cast<const unsigned char *>(valBuf),
+ static_cast<int32_t>(strlen(valBuf)));
+ }
+ regionPtr->create(keyPtr, tmpValue);
+ creates++;
+ } else {
+ keyPtr = getKey(entryCount);
+ if (opcode == "update") {
+ if (!objectType.empty()) {
+ tmpValue = getUserObject(objectType);
+ } else {
+ int32_t keyVal = atoi(keyPtr->toString());
+ tmpValue = CacheableBytes::create(
+ reinterpret_cast<const unsigned char *>(valBuf),
+ static_cast<int32_t>(strlen(valBuf)));
+ int32_t *val =
+ (int32_t *)(std::dynamic_pointer_cast<CacheableBytes>(tmpValue)
+ ->value());
+ *val = (*val == keyVal) ? keyVal + 1
+ : keyVal; // alternate the value so that it
+ // can be validated later.
+ int64_t *adjNow =
+ (int64_t *)(std::dynamic_pointer_cast<CacheableBytes>(tmpValue)
+ ->value() +
+ 4);
+ *adjNow = getAdjustedNowMicros();
+ }
+ regionPtr->put(keyPtr, tmpValue);
+ puts++;
+ } else if (opcode == "invalidate") {
+ regionPtr->invalidate(keyPtr);
+ invals++;
+ } else if (opcode == "destroy") {
+ regionPtr->destroy(keyPtr);
+ dests++;
+ } else if (opcode == "read") {
+ valuePtr = regionPtr->get(keyPtr);
+ gets++;
+ } else if (opcode == "read+localdestroy") {
+ valuePtr = regionPtr->get(keyPtr);
+ gets++;
+ regionPtr->localDestroy(keyPtr);
+ dests++;
+ } else if (opcode == "query") {
+ runQuery(query);
+ } else {
+ FWKSEVERE("Invalid operation specified: " << opcode);
+ }
+ }
+ } catch (TimeoutException &e) {
+ fwkResult = FWK_SEVERE;
+ FWKSEVERE("Caught unexpected timeout exception during entry "
+ << opcode << " operation: " << e.getMessage()
+ << " continuing with test.");
+ } catch (EntryExistsException &ignore) {
+ ignore.getMessage();
+ } catch (EntryNotFoundException &ignore) {
+ ignore.getMessage();
+ } catch (EntryDestroyedException &ignore) {
+ ignore.getMessage();
+ } catch (Exception &e) {
+ end = 0;
+ fwkResult = FWK_SEVERE;
+ FWKSEVERE("Caught unexpected exception during entry "
+ << opcode << " operation: " << e.getMessage()
+ << " exiting task.");
+ }
+ meter.checkPace();
+ now = ACE_OS::gettimeofday();
}
keyPtr = nullptr;
valuePtr = nullptr;
diff --git a/tests/cpp/security/Security.hpp b/tests/cpp/security/Security.hpp
index ac67c29..ae75e37 100644
--- a/tests/cpp/security/Security.hpp
+++ b/tests/cpp/security/Security.hpp
@@ -32,8 +32,6 @@
// ----------------------------------------------------------------------------
-#include <geode/GeodeCppCache.hpp>
-
#include <geode/CacheableString.hpp>
#include <geode/Cache.hpp>
#include <geode/Region.hpp>
@@ -93,9 +91,10 @@ class Security : public FrameworkTest {
// int32_t doServerKeys();
void checkTest(const char* taskId);
- void getClientSecurityParams(PropertiesPtr prop, std::string credentials);
- CacheablePtr getUserObject(const std::string& objType);
- CacheableStringPtr getKey(int32_t max);
+ void getClientSecurityParams(std::shared_ptr<Properties> prop,
+ std::string credentials);
+ std::shared_ptr<Cacheable> getUserObject(const std::string& objType);
+ std::shared_ptr<CacheableString> getKey(int32_t max);
void runQuery(int32_t& queryCnt);
private:
@@ -103,15 +102,15 @@ class Security : public FrameworkTest {
void clearKeys();
void initStrKeys(int32_t low, int32_t high, const std::string& keyBase);
int32_t initValues(int32_t num, int32_t siz = 0, bool useDefault = true);
- RegionPtr getRegionPtr(const char* reg = NULL);
+ std::shared_ptr<Region> getRegionPtr(const char* reg = NULL);
bool checkReady(int32_t numClients);
- CacheableStringPtr* m_KeysA;
+ std::shared_ptr<CacheableString>* m_KeysA;
int32_t m_MaxKeys;
int32_t m_KeyIndexBegin;
int32_t m_MaxValues;
- CacheableBytesPtr* m_CValue;
+ std::shared_ptr<CacheableBytes>* m_CValue;
};
} // namespace security
diff --git a/tests/cpp/security/XmlAuthzCredentialGenerator.hpp b/tests/cpp/security/XmlAuthzCredentialGenerator.hpp
index 73dd576..b25650e 100644
--- a/tests/cpp/security/XmlAuthzCredentialGenerator.hpp
+++ b/tests/cpp/security/XmlAuthzCredentialGenerator.hpp
@@ -49,15 +49,13 @@ const stringList::value_type QRArr[] = {"Portfolios", "Positions"};
const char* PRiUsnm = "%s%d";
class XmlAuthzCredentialGenerator;
-typedef std::shared_ptr<XmlAuthzCredentialGenerator>
- XmlAuthzCredentialGeneratorPtr;
class XmlAuthzCredentialGenerator {
private:
ID m_id;
opCodeList* m_opCode;
stringList* m_regionNames;
- PropertiesPtr* m_prop;
+ std::shared_ptr<Properties>* m_prop;
opCodeList Readers;
opCodeList Writers;
@@ -79,7 +77,8 @@ class XmlAuthzCredentialGenerator {
}
virtual ~XmlAuthzCredentialGenerator() { ; }
- virtual void getAllowedCredentials(opCodeList& opCode, PropertiesPtr& prop,
+ virtual void getAllowedCredentials(opCodeList& opCode,
+ std::shared_ptr<Properties>& prop,
stringList* regionNames) {
try {
m_opCode = &opCode;
@@ -113,7 +112,8 @@ class XmlAuthzCredentialGenerator {
m_prop = NULL;
}
- virtual void getDisallowedCredentials(opCodeList& opCode, PropertiesPtr& prop,
+ virtual void getDisallowedCredentials(opCodeList& opCode,
+ std::shared_ptr<Properties>& prop,
stringList* regionNames) {
try {
m_opCode = &opCode;
diff --git a/tests/cpp/testobject/ArrayOfByte.hpp b/tests/cpp/testobject/ArrayOfByte.hpp
index ef093c4..43e98d1 100644
--- a/tests/cpp/testobject/ArrayOfByte.hpp
+++ b/tests/cpp/testobject/ArrayOfByte.hpp
@@ -20,7 +20,6 @@
* limitations under the License.
*/
-#include <geode/GeodeCppCache.hpp>
#include <string>
#include "fwklib/FwkLog.hpp"
#include "fwklib/FrameworkTest.hpp"
@@ -47,8 +46,8 @@ namespace testobject {
class TESTOBJECT_EXPORT ArrayOfByte {
public:
- static CacheableBytesPtr init(int size, bool encodeKey,
- bool encodeTimestamp) {
+ static std::shared_ptr<CacheableBytes> init(int size, bool encodeKey,
+ bool encodeTimestamp) {
if (encodeKey) {
DataOutputInternal dos;
try {
@@ -80,7 +79,7 @@ class TESTOBJECT_EXPORT ArrayOfByte {
}
}
- static int64_t getTimestamp(CacheableBytesPtr bytes,
+ static int64_t getTimestamp(std::shared_ptr<CacheableBytes> bytes,
SerializationRegistry &serializationRegistry) {
if (bytes == nullptr) {
throw apache::geode::client::IllegalArgumentException(
@@ -99,7 +98,7 @@ class TESTOBJECT_EXPORT ArrayOfByte {
}
}
- static void resetTimestamp(CacheableBytesPtr bytes,
+ static void resetTimestamp(std::shared_ptr<CacheableBytes> bytes,
SerializationRegistry &serializationRegistry) {
DataInputInternal di(bytes->value(), bytes->length(), nullptr);
int32_t index;
diff --git a/tests/cpp/testobject/BatchObject.cpp b/tests/cpp/testobject/BatchObject.cpp
index 99dbf03..8fa01c6 100644
--- a/tests/cpp/testobject/BatchObject.cpp
+++ b/tests/cpp/testobject/BatchObject.cpp
@@ -46,8 +46,7 @@ void BatchObject::fromData(apache::geode::client::DataInput& input) {
batch = input.readInt32();
byteArray = input.readObject<CacheableBytes>();
}
-
-CacheableStringPtr BatchObject::toString() const {
+std::shared_ptr<CacheableString> BatchObject::toString() const {
char buf[102500];
sprintf(buf,
"BatchObject:[index = %d timestamp = %lld batch = %d byteArray=%d ]",
diff --git a/tests/cpp/testobject/BatchObject.hpp b/tests/cpp/testobject/BatchObject.hpp
index ea1fcfb..4e1cdc3 100644
--- a/tests/cpp/testobject/BatchObject.hpp
+++ b/tests/cpp/testobject/BatchObject.hpp
@@ -24,7 +24,6 @@
* @brief User class for testing the cq functionality.
*/
-#include <geode/GeodeCppCache.hpp>
#include <string>
#include "fwklib/Timer.hpp"
#include "fwklib/FrameworkTest.hpp"
@@ -51,9 +50,10 @@ class TESTOBJECT_EXPORT BatchObject : public TimestampedObject {
int32_t index;
uint64_t timestamp;
int32_t batch;
- CacheableBytesPtr byteArray;
+ std::shared_ptr<CacheableBytes> byteArray;
- inline uint32_t getObjectSize(const SerializablePtr& obj) const {
+ inline uint32_t getObjectSize(
+ const std::shared_ptr<Serializable>& obj) const {
return (obj == nullptr ? 0 : obj->objectSize());
}
@@ -64,7 +64,7 @@ class TESTOBJECT_EXPORT BatchObject : public TimestampedObject {
virtual void toData(apache::geode::client::DataOutput& output) const;
virtual void fromData(apache::geode::client::DataInput& input);
virtual int32_t classId() const { return 25; }
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
virtual uint32_t objectSize() const {
uint32_t objectSize = sizeof(BatchObject);
@@ -87,7 +87,6 @@ class TESTOBJECT_EXPORT BatchObject : public TimestampedObject {
}
};
-typedef std::shared_ptr<BatchObject> BatchObjectPtr;
} // namespace testobject
#endif // GEODE_TESTOBJECT_BATCHOBJECT_H_
diff --git a/tests/cpp/testobject/DeltaFastAssetAccount.hpp b/tests/cpp/testobject/DeltaFastAssetAccount.hpp
index 1808292..ac9e417 100644
--- a/tests/cpp/testobject/DeltaFastAssetAccount.hpp
+++ b/tests/cpp/testobject/DeltaFastAssetAccount.hpp
@@ -23,13 +23,16 @@
/*
* @brief User class for testing the query functionality.
*/
-
-#include <geode/GeodeCppCache.hpp>
#include <string>
-#include "fwklib/FrameworkTest.hpp"
+
#include <ace/ACE.h>
#include <ace/OS.h>
#include <ace/Time_Value.h>
+
+#include <geode/Delta.hpp>
+
+#include "fwklib/FrameworkTest.hpp"
+
#include "FastAsset.hpp"
#ifdef _WIN32
@@ -45,19 +48,18 @@
using namespace apache::geode::client;
using namespace testframework;
namespace testobject {
-class DeltaFastAssetAccount;
-typedef std::shared_ptr<DeltaFastAssetAccount> DeltaFastAssetAccountPtr;
+
class TESTOBJECT_EXPORT DeltaFastAssetAccount : public Cacheable, public Delta {
private:
bool encodeTimestamp;
int32_t acctId;
- CacheableStringPtr customerName;
+ std::shared_ptr<CacheableString> customerName;
double netWorth;
- CacheableHashMapPtr assets;
+ std::shared_ptr<CacheableHashMap> assets;
uint64_t timestamp;
bool getBeforeUpdate;
- inline uint32_t getObjectSize(const SerializablePtr& obj) const {
+ inline uint32_t getObjectSize(const std::shared_ptr<Serializable>& obj) const {
return (obj == nullptr ? 0 : obj->objectSize());
}
@@ -80,7 +82,7 @@ class TESTOBJECT_EXPORT DeltaFastAssetAccount : public Cacheable, public Delta {
void toDelta(apache::geode::client::DataOutput& output) const;
void fromDelta(apache::geode::client::DataInput& input);
- CacheableStringPtr toString() const {
+ std::shared_ptr<CacheableString> toString() const {
char buf[102500];
sprintf(buf,
"DeltaFastAssetAccount:[acctId = %d customerName = %s netWorth = "
@@ -91,13 +93,13 @@ class TESTOBJECT_EXPORT DeltaFastAssetAccount : public Cacheable, public Delta {
int getAcctId() { return acctId; }
- CacheableStringPtr getCustomerName() { return customerName; }
+ std::shared_ptr<CacheableString> getCustomerName() { return customerName; }
double getNetWorth() { return netWorth; }
void incrementNetWorth() { ++netWorth; }
- CacheableHashMapPtr getAssets() { return assets; }
+ std::shared_ptr<CacheableHashMap> getAssets() { return assets; }
int getIndex() { return acctId; }
uint64_t getTimestamp() {
if (encodeTimestamp) {
@@ -132,7 +134,7 @@ class TESTOBJECT_EXPORT DeltaFastAssetAccount : public Cacheable, public Delta {
return objectSize;
}
- virtual DeltaPtr clone() {
+ virtual std::shared_ptr<Delta> clone() {
auto clonePtr = std::make_shared<DeltaFastAssetAccount>();
clonePtr->assets = CacheableHashMap::create();
for (const auto& item : *(this->assets)) {
diff --git a/tests/cpp/testobject/DeltaPSTObject.cpp b/tests/cpp/testobject/DeltaPSTObject.cpp
index 74371fb..c540f1f 100644
--- a/tests/cpp/testobject/DeltaPSTObject.cpp
+++ b/tests/cpp/testobject/DeltaPSTObject.cpp
@@ -63,8 +63,7 @@ void DeltaPSTObject::fromData(apache::geode::client::DataInput& input) {
field2 = input.read();
valueData = input.readObject<CacheableBytes>();
}
-
-CacheableStringPtr DeltaPSTObject::toString() const {
+std::shared_ptr<CacheableString> DeltaPSTObject::toString() const {
char buf[102500];
sprintf(
buf,
diff --git a/tests/cpp/testobject/DeltaPSTObject.hpp b/tests/cpp/testobject/DeltaPSTObject.hpp
index 08cdf53..bd9742d 100644
--- a/tests/cpp/testobject/DeltaPSTObject.hpp
+++ b/tests/cpp/testobject/DeltaPSTObject.hpp
@@ -24,7 +24,6 @@
* @brief User class for testing the put functionality for object.
*/
-#include <geode/GeodeCppCache.hpp>
#include <string>
#include "fwklib/Timer.hpp"
#include "fwklib/FrameworkTest.hpp"
@@ -52,7 +51,7 @@ class TESTOBJECT_EXPORT DeltaPSTObject : public Cacheable, public Delta {
uint64_t timestamp;
int32_t field1;
int8_t field2;
- CacheableBytesPtr valueData;
+ std::shared_ptr<CacheableBytes> valueData;
std::shared_ptr<DeltaPSTObject> shared_from_this() {
return std::static_pointer_cast<DeltaPSTObject>(
Serializable::shared_from_this());
@@ -66,7 +65,7 @@ class TESTOBJECT_EXPORT DeltaPSTObject : public Cacheable, public Delta {
void fromData(apache::geode::client::DataInput& input);
void fromDelta(DataInput& input);
void toDelta(DataOutput& output) const;
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
bool hasDelta() { return true; }
int32_t classId() const { return 42; }
@@ -88,14 +87,13 @@ class TESTOBJECT_EXPORT DeltaPSTObject : public Cacheable, public Delta {
startTime.to_usec(tusec);
timestamp = tusec * 1000;
}
- DeltaPtr clone() {
+ std::shared_ptr<Delta> clone() {
// TODO shared_ptr - this isn't actually cloning.
return shared_from_this();
}
static Serializable* createDeserializable() { return new DeltaPSTObject(); }
};
-typedef std::shared_ptr<DeltaPSTObject> DeltaPSTObjectPtr;
} // namespace testobject
#endif // GEODE_TESTOBJECT_DELTAPSTOBJECT_H_
diff --git a/tests/cpp/testobject/DeltaTestImpl.cpp b/tests/cpp/testobject/DeltaTestImpl.cpp
index 9ceb626..2910db8 100644
--- a/tests/cpp/testobject/DeltaTestImpl.cpp
+++ b/tests/cpp/testobject/DeltaTestImpl.cpp
@@ -43,14 +43,16 @@ DeltaTestImpl::DeltaTestImpl() : Delta(nullptr) {
toDeltaCounter = 0;
fromDeltaCounter = 0;
}
-DeltaTestImpl::DeltaTestImpl(int intValue, CacheableStringPtr strptr)
+DeltaTestImpl::DeltaTestImpl(int intValue,
+ std::shared_ptr<CacheableString> strptr)
: Delta(nullptr),
intVar(intValue),
str(strptr),
doubleVar(0),
toDeltaCounter(0),
fromDeltaCounter(0) {}
-DeltaTestImpl::DeltaTestImpl(DeltaTestImplPtr rhs) : Delta(nullptr) {
+DeltaTestImpl::DeltaTestImpl(std::shared_ptr<DeltaTestImpl> rhs)
+ : Delta(nullptr) {
intVar = rhs->intVar;
str = CacheableString::create(rhs->str->asChar());
doubleVar = rhs->doubleVar;
@@ -58,9 +60,10 @@ DeltaTestImpl::DeltaTestImpl(DeltaTestImplPtr rhs) : Delta(nullptr) {
? nullptr
: CacheableBytes::create(rhs->byteArr->value(),
rhs->byteArr->length()));
- testObj = (rhs->testObj == nullptr
- ? nullptr
- : TestObject1Ptr(new TestObject1(*(rhs->testObj.get()))));
+ testObj =
+ (rhs->testObj == nullptr ? nullptr
+ : std::shared_ptr<TestObject1>(
+ new TestObject1(*(rhs->testObj.get()))));
toDeltaCounter = rhs->getToDeltaCounter();
fromDeltaCounter = rhs->getFromDeltaCounter();
}
@@ -135,7 +138,7 @@ void DeltaTestImpl::fromDelta(DataInput& input) {
testObj = input.readObject<TestObject1>();
}
}
-CacheableStringPtr DeltaTestImpl::toString() const {
+std::shared_ptr<CacheableString> DeltaTestImpl::toString() const {
char buf[102500];
sprintf(buf, "DeltaTestImpl[hasDelta=%d int=%d double=%f str=%s \n",
m_hasDelta, intVar, doubleVar, str->toString());
diff --git a/tests/cpp/testobject/DeltaTestImpl.hpp b/tests/cpp/testobject/DeltaTestImpl.hpp
index 1d87624..504272b 100644
--- a/tests/cpp/testobject/DeltaTestImpl.hpp
+++ b/tests/cpp/testobject/DeltaTestImpl.hpp
@@ -27,6 +27,7 @@
#include <ace/Recursive_Thread_Mutex.h>
#include <ace/Time_Value.h>
#include "TestObject1.hpp"
+#include <geode/Delta.hpp>
#ifdef _WIN32
#ifdef BUILD_TESTOBJECT
@@ -42,9 +43,6 @@ using namespace apache::geode::client;
namespace testobject {
-class DeltaTestImpl;
-typedef std::shared_ptr<DeltaTestImpl> DeltaTestImplPtr;
-
class TESTOBJECT_EXPORT DeltaTestImpl : public Cacheable, public Delta {
private:
static uint8_t INT_MASK;
@@ -55,10 +53,10 @@ class TESTOBJECT_EXPORT DeltaTestImpl : public Cacheable, public Delta {
static uint8_t COMPLETE_MASK;
int32_t intVar; // 0000 0001
- CacheableStringPtr str; // 0000 0010
- double doubleVar; // 0000 0100
- CacheableBytesPtr byteArr; // 0000 1000
- TestObject1Ptr testObj; // 0001 0000
+ std::shared_ptr<CacheableString> str; // 0000 0010
+ double doubleVar; // 0000 0100
+ std::shared_ptr<CacheableBytes> byteArr; // 0000 1000
+ std::shared_ptr<TestObject1> testObj; // 0001 0000
bool m_hasDelta;
uint8_t deltaBits;
@@ -68,8 +66,8 @@ class TESTOBJECT_EXPORT DeltaTestImpl : public Cacheable, public Delta {
public:
DeltaTestImpl();
- DeltaTestImpl(int intValue, CacheableStringPtr strptr);
- DeltaTestImpl(DeltaTestImplPtr rhs);
+ DeltaTestImpl(int intValue, std::shared_ptr<CacheableString> strptr);
+ DeltaTestImpl(std::shared_ptr<DeltaTestImpl> rhs);
void fromData(DataInput& input);
void toData(DataOutput& output) const;
@@ -81,18 +79,18 @@ class TESTOBJECT_EXPORT DeltaTestImpl : public Cacheable, public Delta {
uint32_t objectSize() const { return 0; }
- DeltaPtr clone() {
- return DeltaPtr(
+ std::shared_ptr<Delta> clone() {
+ return std::shared_ptr<Delta>(
std::dynamic_pointer_cast<DeltaTestImpl>(shared_from_this()));
}
static Serializable* create() { return new DeltaTestImpl(); }
int32_t getIntVar() { return intVar; }
- CacheableStringPtr getStr() { return str; }
+ std::shared_ptr<CacheableString> getStr() { return str; }
double getDoubleVar() { return doubleVar; }
- CacheableBytesPtr getByteArr() { return byteArr; }
- TestObject1Ptr getTestObj() { return testObj; }
+ std::shared_ptr<CacheableBytes> getByteArr() { return byteArr; }
+ std::shared_ptr<TestObject1> getTestObj() { return testObj; }
int64_t getFromDeltaCounter() { return fromDeltaCounter; }
int64_t getToDeltaCounter() { return toDeltaCounter; }
@@ -104,8 +102,8 @@ class TESTOBJECT_EXPORT DeltaTestImpl : public Cacheable, public Delta {
}
void setStr(char* str1) { str = CacheableString::create(str1); }
void setDoubleVar(double value) { doubleVar = value; }
- void setByteArr(CacheableBytesPtr value) { byteArr = value; }
- void setTestObj(TestObject1Ptr value) { testObj = value; }
+ void setByteArr(std::shared_ptr<CacheableBytes> value) { byteArr = value; }
+ void setTestObj(std::shared_ptr<TestObject1> value) { testObj = value; }
void setDelta(bool value) { m_hasDelta = value; }
@@ -114,7 +112,7 @@ class TESTOBJECT_EXPORT DeltaTestImpl : public Cacheable, public Delta {
void setDoubleVarFlag() { deltaBits = deltaBits | DOUBLE_MASK; }
void setByteArrFlag() { deltaBits = deltaBits | BYTE_ARR_MASK; }
void setTestObjFlag() { deltaBits = deltaBits | TEST_OBJ_MASK; }
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
};
} // namespace testobject
diff --git a/tests/cpp/testobject/DeltaTestObj.hpp b/tests/cpp/testobject/DeltaTestObj.hpp
index 4030dff..1860744 100644
--- a/tests/cpp/testobject/DeltaTestObj.hpp
+++ b/tests/cpp/testobject/DeltaTestObj.hpp
@@ -20,7 +20,6 @@
* limitations under the License.
*/
-#include <geode/GeodeCppCache.hpp>
#include "DeltaTestImpl.hpp"
#ifdef _WIN32
@@ -43,7 +42,8 @@ class TESTOBJECT_EXPORT DeltaTestObj : public DeltaTestImpl {
bool enableFailure;
public:
- DeltaTestObj(int intVal, CacheableStringPtr str, bool enableFail = false)
+ DeltaTestObj(int intVal, std::shared_ptr<CacheableString> str,
+ bool enableFail = false)
: DeltaTestImpl(intVal, str), enableFailure(enableFail) {
// DeltaTestImpl::DeltaTestImpl(intVal, str);
}
@@ -73,7 +73,7 @@ class TESTOBJECT_EXPORT DeltaTestObj : public DeltaTestImpl {
}
void setFromDeltaCounter(int counter) { fromDeltaCounter = counter; }
void setToDeltaCounter(int counter) { toDeltaCounter = counter; }
- CacheableStringPtr toString() const {
+ std::shared_ptr<CacheableString> toString() const {
char buf[102500];
sprintf(buf,
"DeltaTestObj: toDeltaCounter = %lld fromDeltaCounter = %lld\n",
@@ -95,7 +95,6 @@ class TESTOBJECT_EXPORT DeltaTestObj : public DeltaTestImpl {
}
};
-typedef std::shared_ptr<DeltaTestObj> DeltaTestObjPtr;
} // namespace testobject
#endif // GEODE_TESTOBJECT_DELTATESTOBJ_H_
diff --git a/tests/cpp/testobject/EqStruct.cpp b/tests/cpp/testobject/EqStruct.cpp
index 820850f..1cda237 100644
--- a/tests/cpp/testobject/EqStruct.cpp
+++ b/tests/cpp/testobject/EqStruct.cpp
@@ -199,8 +199,7 @@ void EqStruct::fromData(apache::geode::client::DataInput &in) {
pegDifference = in.readDouble();
discretionOffset = in.readDouble();
}
-
-CacheableStringPtr EqStruct::toString() const {
+std::shared_ptr<CacheableString> EqStruct::toString() const {
char buf[102500];
sprintf(buf, "EqStruct:[timestamp = %lld myIndex = %d cxlQty = %d ]",
timestamp, myIndex, cxlQty);
diff --git a/tests/cpp/testobject/EqStruct.hpp b/tests/cpp/testobject/EqStruct.hpp
index 0019ed7..5d6aef9 100644
--- a/tests/cpp/testobject/EqStruct.hpp
+++ b/tests/cpp/testobject/EqStruct.hpp
@@ -24,7 +24,6 @@
* @brief User class for testing the put functionality for object.
*/
-#include <geode/GeodeCppCache.hpp>
#include <string>
#include "fwklib/Timer.hpp"
#include "fwklib/FrameworkTest.hpp"
@@ -99,7 +98,8 @@ class TESTOBJECT_EXPORT EqStruct : public TimestampedObject {
char* var8;
char* var9;
- inline uint32_t getObjectSize(const SerializablePtr& obj) const {
+ inline uint32_t getObjectSize(
+ const std::shared_ptr<Serializable>& obj) const {
return (obj == nullptr ? 0 : obj->objectSize());
}
@@ -110,7 +110,7 @@ class TESTOBJECT_EXPORT EqStruct : public TimestampedObject {
virtual void toData(apache::geode::client::DataOutput& output) const;
virtual void fromData(apache::geode::client::DataInput& input);
virtual int32_t classId() const { return 101; }
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
virtual uint32_t objectSize() const {
uint32_t objectSize = sizeof(EqStruct);
@@ -148,7 +148,6 @@ class TESTOBJECT_EXPORT EqStruct : public TimestampedObject {
}
};
-typedef std::shared_ptr<EqStruct> EqStructPtr;
} // namespace testobject
#endif // GEODE_TESTOBJECT_EQSTRUCT_H_
diff --git a/tests/cpp/testobject/FastAsset.hpp b/tests/cpp/testobject/FastAsset.hpp
index ca866c1..6ad4def 100644
--- a/tests/cpp/testobject/FastAsset.hpp
+++ b/tests/cpp/testobject/FastAsset.hpp
@@ -24,7 +24,6 @@
* @brief User class for testing the query functionality.
*/
-#include <geode/GeodeCppCache.hpp>
#include <string>
#include "fwklib/Timer.hpp"
#include "fwklib/FrameworkTest.hpp"
@@ -46,15 +45,13 @@
using namespace apache::geode::client;
using namespace testframework;
namespace testobject {
-class FastAsset;
-typedef std::shared_ptr<FastAsset> FastAssetPtr;
class TESTOBJECT_EXPORT FastAsset : public TimestampedObject {
private:
int32_t assetId;
double value;
- inline uint32_t getObjectSize(const SerializablePtr& obj) const {
+ inline uint32_t getObjectSize(const std::shared_ptr<Serializable>& obj) const {
return (obj == nullptr ? 0 : obj->objectSize());
}
@@ -90,7 +87,7 @@ class TESTOBJECT_EXPORT FastAsset : public TimestampedObject {
/**
* Makes a copy of this asset.
*/
- FastAssetPtr copy() {
+ std::shared_ptr<FastAsset> copy() {
auto asset = std::make_shared<FastAsset>();
asset->setAssetId(getAssetId());
asset->setValue(getValue());
@@ -101,7 +98,7 @@ class TESTOBJECT_EXPORT FastAsset : public TimestampedObject {
*/
void setAssetId(int i) { assetId = i; }
- CacheableStringPtr toString() const {
+ std::shared_ptr<CacheableString> toString() const {
char buf[102500];
sprintf(buf, "FastAsset:[assetId = %d value = %f]", assetId, value);
return CacheableString::create(buf);
@@ -112,7 +109,6 @@ class TESTOBJECT_EXPORT FastAsset : public TimestampedObject {
}
};
-// typedef std::shared_ptr<FastAsset> FastAssetPtr;
} // namespace testobject
#endif // GEODE_TESTOBJECT_FASTASSET_H_
diff --git a/tests/cpp/testobject/FastAssetAccount.cpp b/tests/cpp/testobject/FastAssetAccount.cpp
index a8b393c..8026c3e 100644
--- a/tests/cpp/testobject/FastAssetAccount.cpp
+++ b/tests/cpp/testobject/FastAssetAccount.cpp
@@ -62,7 +62,7 @@ void FastAssetAccount::fromData(apache::geode::client::DataInput& input) {
timestamp = input.readInt64();
}
-CacheableStringPtr FastAssetAccount::toString() const {
+std::shared_ptr<CacheableString> FastAssetAccount::toString() const {
char buf[102500];
sprintf(buf,
"FastAssetAccount:[acctId = %d customerName = %s netWorth = %f "
diff --git a/tests/cpp/testobject/FastAssetAccount.hpp b/tests/cpp/testobject/FastAssetAccount.hpp
index 126e247..9c9dc1c 100644
--- a/tests/cpp/testobject/FastAssetAccount.hpp
+++ b/tests/cpp/testobject/FastAssetAccount.hpp
@@ -24,7 +24,6 @@
* @brief User class for testing the query functionality.
*/
-#include <geode/GeodeCppCache.hpp>
#include <string>
#include "fwklib/Timer.hpp"
#include "fwklib/FrameworkTest.hpp"
@@ -50,12 +49,13 @@ class TESTOBJECT_EXPORT FastAssetAccount : public TimestampedObject {
protected:
bool encodeTimestamp;
int32_t acctId;
- CacheableStringPtr customerName;
+ std::shared_ptr<CacheableString> customerName;
double netWorth;
- CacheableHashMapPtr assets;
+ std::shared_ptr<CacheableHashMap> assets;
uint64_t timestamp;
- inline uint32_t getObjectSize(const SerializablePtr& obj) const {
+ inline uint32_t getObjectSize(
+ const std::shared_ptr<Serializable>& obj) const {
return (obj == nullptr ? 0 : obj->objectSize());
}
@@ -72,7 +72,7 @@ class TESTOBJECT_EXPORT FastAssetAccount : public TimestampedObject {
virtual void toData(apache::geode::client::DataOutput& output) const;
virtual void fromData(apache::geode::client::DataInput& input);
virtual int32_t classId() const { return 23; }
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
virtual uint32_t objectSize() const {
uint32_t objectSize = sizeof(FastAssetAccount);
@@ -81,13 +81,13 @@ class TESTOBJECT_EXPORT FastAssetAccount : public TimestampedObject {
int getAcctId() { return acctId; }
- CacheableStringPtr getCustomerName() { return customerName; }
+ std::shared_ptr<CacheableString> getCustomerName() { return customerName; }
double getNetWorth() { return netWorth; }
void incrementNetWorth() { ++netWorth; }
- CacheableHashMapPtr getAssets() { return assets; }
+ std::shared_ptr<CacheableHashMap> getAssets() { return assets; }
int getIndex() { return acctId; }
uint64_t getTimestamp() {
if (encodeTimestamp) {
@@ -119,7 +119,6 @@ class TESTOBJECT_EXPORT FastAssetAccount : public TimestampedObject {
}
};
-typedef std::shared_ptr<FastAssetAccount> FastAssetAccountPtr;
} // namespace testobject
#endif // GEODE_TESTOBJECT_FASTASSETACCOUNT_H_
diff --git a/tests/cpp/testobject/InvalidPdxUsage.cpp b/tests/cpp/testobject/InvalidPdxUsage.cpp
index 5f9851d..114233c 100644
--- a/tests/cpp/testobject/InvalidPdxUsage.cpp
+++ b/tests/cpp/testobject/InvalidPdxUsage.cpp
@@ -71,7 +71,7 @@ bool InvalidPdxUsage::generic2DCompare(T1** value1, T2** value2, int length,
// InvalidPdxUsage::~PdxObject() {
//}
-void InvalidPdxUsage::toData(PdxWriterPtr pw) /*const*/ {
+void InvalidPdxUsage::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
// TODO:delete it later
LOGINFO(" NILKANTH InvalidPdxUsage::toData() Start exceptionCounter = %d ",
toDataexceptionCounter);
@@ -456,7 +456,7 @@ void InvalidPdxUsage::toData(PdxWriterPtr pw) /*const*/ {
LOGDEBUG("PdxObject::toData() Done......");
}
-void InvalidPdxUsage::fromData(PdxReaderPtr pr) {
+void InvalidPdxUsage::fromData(std::shared_ptr<PdxReader> pr) {
// TODO:temp added, delete later
LOGINFO(
" NILKANTH InvalidPdxUsage::fromData() Start fromDataexceptionCounter = "
@@ -792,8 +792,7 @@ void InvalidPdxUsage::fromData(PdxReaderPtr pr) {
"and exceptionCounter=%d ",
fromDataexceptionCounter, exceptionCounter);
}
-
-CacheableStringPtr InvalidPdxUsage::toString() const {
+std::shared_ptr<CacheableString> InvalidPdxUsage::toString() const {
char idbuf[1024];
// sprintf(idbuf,"PdxObject: [ m_bool=%d ] [m_byte=%d] [m_int16=%d]
// [m_int32=%d] [m_float=%f] [m_double=%lf] [ m_string=%s ]",m_bool, m_byte,
diff --git a/tests/cpp/testobject/InvalidPdxUsage.hpp b/tests/cpp/testobject/InvalidPdxUsage.hpp
index af07a62..f3c4e8f 100644
--- a/tests/cpp/testobject/InvalidPdxUsage.hpp
+++ b/tests/cpp/testobject/InvalidPdxUsage.hpp
@@ -27,7 +27,8 @@
*/
#include <geode/PdxSerializable.hpp>
-#include <geode/GeodeCppCache.hpp>
+#include <geode/CacheableEnum.hpp>
+#include <geode/CacheableObjectArray.hpp>
#include <geode/PdxWriter.hpp>
#include <geode/PdxReader.hpp>
@@ -74,7 +75,7 @@ class TESTOBJECT_EXPORT CharTypesWithInvalidUsage : public PdxSerializable {
CharTypesWithInvalidUsage() { init(); }
- CacheableStringPtr toString() const {
+ std::shared_ptr<CacheableString> toString() const {
char idbuf[1024];
sprintf(idbuf, "%c %lc %c %c %lc %lc", m_ch, m_widechar, m_chArray[0],
m_chArray[1], m_widecharArray[0], m_widecharArray[1]);
@@ -127,14 +128,14 @@ class TESTOBJECT_EXPORT CharTypesWithInvalidUsage : public PdxSerializable {
using PdxSerializable::toData;
using PdxSerializable::fromData;
- void toData(PdxWriterPtr pw) {
+ void toData(std::shared_ptr<PdxWriter> pw) {
pw->writeChar("m_ch", m_ch);
pw->writeChar("m_widechar", m_widechar);
pw->writeCharArray("m_chArray", m_chArray, 2);
pw->writeWideCharArray("m_widecharArray", m_widecharArray, 2);
}
- void fromData(PdxReaderPtr pr) {
+ void fromData(std::shared_ptr<PdxReader> pr) {
m_ch = pr->readChar("m_ch");
m_widechar = pr->readWideChar("m_widechar");
m_chArray = pr->readCharArray("m_chArray", m_wcharArrayLen);
@@ -145,7 +146,6 @@ class TESTOBJECT_EXPORT CharTypesWithInvalidUsage : public PdxSerializable {
return new CharTypesWithInvalidUsage();
}
};
-typedef std::shared_ptr<CharTypesWithInvalidUsage> CharTypesWithInvalidUsagePtr;
class TESTOBJECT_EXPORT AddressWithInvalidAPIUsage : public PdxSerializable {
private:
@@ -156,7 +156,7 @@ class TESTOBJECT_EXPORT AddressWithInvalidAPIUsage : public PdxSerializable {
public:
AddressWithInvalidAPIUsage() {}
- CacheableStringPtr toString() const {
+ std::shared_ptr<CacheableString> toString() const {
char idbuf[1024];
sprintf(idbuf, "%d %s %s", _aptNumber, _street, _city);
return CacheableString::create(idbuf);
@@ -199,13 +199,13 @@ class TESTOBJECT_EXPORT AddressWithInvalidAPIUsage : public PdxSerializable {
using PdxSerializable::toData;
using PdxSerializable::fromData;
- void toData(PdxWriterPtr pw) {
+ void toData(std::shared_ptr<PdxWriter> pw) {
pw->writeInt("_aptNumber", _aptNumber); // 4
pw->writeString("_street", _street);
pw->writeString("_city", _city);
}
- void fromData(PdxReaderPtr pr) {
+ void fromData(std::shared_ptr<PdxReader> pr) {
_aptNumber = pr->readInt("_aptNumber");
_street = pr->readString("_street");
_city = pr->readString("_city");
@@ -221,8 +221,6 @@ class TESTOBJECT_EXPORT AddressWithInvalidAPIUsage : public PdxSerializable {
const char* getCity() { return _city; }
};
-typedef std::shared_ptr<AddressWithInvalidAPIUsage>
- AddressWithInvalidAPIUsagePtr;
enum pdxEnumTestWithInvalidAPIUsage { mypdx1, mypdx2, mypdx3 };
@@ -249,7 +247,7 @@ class TESTOBJECT_EXPORT InvalidPdxUsage : public PdxSerializable {
wchar_t* m_charArray;
- CacheableDatePtr m_date;
+ std::shared_ptr<CacheableDate> m_date;
int16_t* m_int16Array;
int16_t* m_uint16Array;
@@ -266,23 +264,23 @@ class TESTOBJECT_EXPORT InvalidPdxUsage : public PdxSerializable {
int8_t** m_byteByteArray;
char** m_stringArray;
- SerializablePtr m_address;
+ std::shared_ptr<Serializable> m_address;
AddressWithInvalidAPIUsage* m_add[10];
- CacheableArrayListPtr m_arraylist;
- CacheableHashMapPtr m_map;
- CacheableHashTablePtr m_hashtable;
- CacheableVectorPtr m_vector;
+ std::shared_ptr<CacheableArrayList> m_arraylist;
+ std::shared_ptr<CacheableHashMap> m_map;
+ std::shared_ptr<CacheableHashTable> m_hashtable;
+ std::shared_ptr<CacheableVector> m_vector;
- CacheableHashSetPtr m_chs;
- CacheableLinkedHashSetPtr m_clhs;
+ std::shared_ptr<CacheableHashSet> m_chs;
+ std::shared_ptr<CacheableLinkedHashSet> m_clhs;
int8_t* m_byte252;
int8_t* m_byte253;
int8_t* m_byte65535;
int8_t* m_byte65536;
- CacheableEnumPtr m_pdxEnum;
- CacheableObjectArrayPtr m_objectArray;
+ std::shared_ptr<CacheableEnum> m_pdxEnum;
+ std::shared_ptr<CacheableObjectArray> m_objectArray;
int32_t boolArrayLen;
int32_t charArrayLen;
@@ -430,7 +428,7 @@ class TESTOBJECT_EXPORT InvalidPdxUsage : public PdxSerializable {
m_pdxEnum = CacheableEnum::create("PdxTests.pdxEnumTestWithInvalidAPIUsage",
"mypdx2", mypdx2);
- // AddressWithInvalidAPIUsagePtr* addPtr = NULL;
+ // std::shared_ptr<AddressWithInvalidAPIUsage>* addPtr = NULL;
// m_add = new AddressWithInvalidAPIUsage[10];
// addPtr[i] = AddressWithInvalidAPIUsage::create();
@@ -445,50 +443,28 @@ class TESTOBJECT_EXPORT InvalidPdxUsage : public PdxSerializable {
m_add[8] = new AddressWithInvalidAPIUsage(9, "street8", "city8");
m_add[9] = new AddressWithInvalidAPIUsage(10, "street9", "city9");
- // m_address = SerializablePtr(m_add);
- // CacheablePtr cacheableObject =
- // CacheableObject::create()create(ptrArr,length);
- /*char key[2048];
- VectorOfCacheableKey keys;
- for (int32_t item = 0; item < 3; item++) {
- sprintf(key, "key-%d", item);
- keys.push_back(CacheableKey::create(key));
- }*/
-
m_objectArray = nullptr;
- /*AddressWithInvalidAPIUsagePtr objectArray[3];
- objectArray[0] = new AddressWithInvalidAPIUsage(1, "strt-1", "city-1");
- objectArray[1] = new AddressWithInvalidAPIUsage(2, "strt-2", "city-2");
- objectArray[2] = new AddressWithInvalidAPIUsage(3, "strt-3", "city-3");*/
-
- /*
- auto addObj1 = std::make_shared<AddressWithInvalidAPIUsage>(1,
- "abc", "ABC");
- auto addObj2 = std::make_shared<AddressWithInvalidAPIUsage>(2,
- "def", "DEF");
- auto addObj3 = std::make_shared<AddressWithInvalidAPIUsage>(3,
- "ghi", "GHI");*/
m_objectArray = CacheableObjectArray::create();
- m_objectArray->push_back(AddressWithInvalidAPIUsagePtr(
+ m_objectArray->push_back(std::shared_ptr<AddressWithInvalidAPIUsage>(
new AddressWithInvalidAPIUsage(1, "street0", "city0")));
- m_objectArray->push_back(AddressWithInvalidAPIUsagePtr(
+ m_objectArray->push_back(std::shared_ptr<AddressWithInvalidAPIUsage>(
new AddressWithInvalidAPIUsage(2, "street1", "city1")));
- m_objectArray->push_back(AddressWithInvalidAPIUsagePtr(
+ m_objectArray->push_back(std::shared_ptr<AddressWithInvalidAPIUsage>(
new AddressWithInvalidAPIUsage(3, "street2", "city2")));
- m_objectArray->push_back(AddressWithInvalidAPIUsagePtr(
+ m_objectArray->push_back(std::shared_ptr<AddressWithInvalidAPIUsage>(
new AddressWithInvalidAPIUsage(4, "street3", "city3")));
- m_objectArray->push_back(AddressWithInvalidAPIUsagePtr(
+ m_objectArray->push_back(std::shared_ptr<AddressWithInvalidAPIUsage>(
new AddressWithInvalidAPIUsage(5, "street4", "city4")));
- m_objectArray->push_back(AddressWithInvalidAPIUsagePtr(
+ m_objectArray->push_back(std::shared_ptr<AddressWithInvalidAPIUsage>(
new AddressWithInvalidAPIUsage(6, "street5", "city5")));
- m_objectArray->push_back(AddressWithInvalidAPIUsagePtr(
+ m_objectArray->push_back(std::shared_ptr<AddressWithInvalidAPIUsage>(
new AddressWithInvalidAPIUsage(7, "street6", "city6")));
- m_objectArray->push_back(AddressWithInvalidAPIUsagePtr(
+ m_objectArray->push_back(std::shared_ptr<AddressWithInvalidAPIUsage>(
new AddressWithInvalidAPIUsage(8, "street7", "city7")));
- m_objectArray->push_back(AddressWithInvalidAPIUsagePtr(
+ m_objectArray->push_back(std::shared_ptr<AddressWithInvalidAPIUsage>(
new AddressWithInvalidAPIUsage(9, "street8", "city8")));
- m_objectArray->push_back(AddressWithInvalidAPIUsagePtr(
+ m_objectArray->push_back(std::shared_ptr<AddressWithInvalidAPIUsage>(
new AddressWithInvalidAPIUsage(10, "street9", "city9")));
m_byte252 = new int8_t[252];
@@ -568,7 +544,7 @@ class TESTOBJECT_EXPORT InvalidPdxUsage : public PdxSerializable {
bool getBool() { return m_bool; }
- CacheableHashMapPtr getHashMap() { return m_map; }
+ std::shared_ptr<CacheableHashMap> getHashMap() { return m_map; }
int8_t getSByte() { return m_sbyte; }
@@ -594,15 +570,15 @@ class TESTOBJECT_EXPORT InvalidPdxUsage : public PdxSerializable {
int8_t* getSByteArray() { return m_sbyteArray; }
- CacheableHashSetPtr getHashSet() { return m_chs; }
+ std::shared_ptr<CacheableHashSet> getHashSet() { return m_chs; }
- CacheableLinkedHashSetPtr getLinkedHashSet() { return m_clhs; }
+ std::shared_ptr<CacheableLinkedHashSet> getLinkedHashSet() { return m_clhs; }
- CacheableArrayListPtr getArrayList() { return m_arraylist; }
+ std::shared_ptr<CacheableArrayList> getArrayList() { return m_arraylist; }
- CacheableHashTablePtr getHashTable() { return m_hashtable; }
+ std::shared_ptr<CacheableHashTable> getHashTable() { return m_hashtable; }
- CacheableVectorPtr getVector() { return m_vector; }
+ std::shared_ptr<CacheableVector> getVector() { return m_vector; }
int8_t getByte() { return m_byte; }
@@ -634,11 +610,13 @@ class TESTOBJECT_EXPORT InvalidPdxUsage : public PdxSerializable {
char** getStringArray() { return m_stringArray; }
- CacheableDatePtr getDate() { return m_date; }
+ std::shared_ptr<CacheableDate> getDate() { return m_date; }
- CacheableObjectArrayPtr getCacheableObjectArray() { return m_objectArray; }
+ std::shared_ptr<CacheableObjectArray> getCacheableObjectArray() {
+ return m_objectArray;
+ }
- CacheableEnumPtr getEnum() { return m_pdxEnum; }
+ std::shared_ptr<CacheableEnum> getEnum() { return m_pdxEnum; }
int32_t getByteArrayLength() { return byteArrayLen; }
@@ -663,11 +641,11 @@ class TESTOBJECT_EXPORT InvalidPdxUsage : public PdxSerializable {
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void toData(PdxWriterPtr pw) /*const*/;
+ virtual void toData(std::shared_ptr<PdxWriter> pw) /*const*/;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
const char* getClassName() const { return "PdxTests.InvalidPdxUsage"; }
@@ -687,7 +665,6 @@ class TESTOBJECT_EXPORT InvalidPdxUsage : public PdxSerializable {
bool generic2DCompare(T1** value1, T2** value2, int length,
int* arrLengths) const;
};
-typedef std::shared_ptr<PdxTests::InvalidPdxUsage> InvalidPdxUsagePtr;
} // namespace PdxTests
#endif // GEODE_TESTOBJECT_INVALIDPDXUSAGE_H_
diff --git a/tests/cpp/testobject/NestedPdxObject.cpp b/tests/cpp/testobject/NestedPdxObject.cpp
index b9be571..a732ade 100644
--- a/tests/cpp/testobject/NestedPdxObject.cpp
+++ b/tests/cpp/testobject/NestedPdxObject.cpp
@@ -26,7 +26,7 @@ using namespace testobject;
ChildPdx::~ChildPdx() {}
-void ChildPdx::toData(PdxWriterPtr pw) {
+void ChildPdx::toData(std::shared_ptr<PdxWriter> pw) {
LOGDEBUG("ChildPdx::toData() Started......");
pw->writeInt("m_childId", m_childId);
@@ -37,7 +37,7 @@ void ChildPdx::toData(PdxWriterPtr pw) {
LOGDEBUG("ChildPdx::toData() Done......");
}
-void ChildPdx::fromData(PdxReaderPtr pr) {
+void ChildPdx::fromData(std::shared_ptr<PdxReader> pr) {
LOGINFO("ChildPdx::fromData() start...");
m_childId = pr->readInt("m_childId");
@@ -47,8 +47,7 @@ void ChildPdx::fromData(PdxReaderPtr pr) {
LOGINFO("ChildPdx::fromData() end...");
}
-
-CacheableStringPtr ChildPdx::toString() const {
+std::shared_ptr<CacheableString> ChildPdx::toString() const {
char idbuf[1024];
sprintf(idbuf, "ChildPdx: [m_childId=%d] [ m_childName=%s ]", m_childId,
m_childName);
@@ -77,7 +76,7 @@ bool ChildPdx::equals(ChildPdx& other) const {
ParentPdx::~ParentPdx() {}
-void ParentPdx::toData(PdxWriterPtr pw) {
+void ParentPdx::toData(std::shared_ptr<PdxWriter> pw) {
LOGDEBUG("ParentPdx::toData() Started......");
pw->writeInt("m_parentId", m_parentId);
@@ -103,7 +102,7 @@ void ParentPdx::toData(PdxWriterPtr pw) {
LOGDEBUG("ParentPdx::toData() Done......");
}
-void ParentPdx::fromData(PdxReaderPtr pr) {
+void ParentPdx::fromData(std::shared_ptr<PdxReader> pr) {
LOGINFO("ParentPdx::fromData() start...");
m_parentId = pr->readInt("m_parentId");
@@ -131,70 +130,69 @@ void ParentPdx::fromData(PdxReaderPtr pr) {
LOGINFO("ParentPdx::fromData() end...");
}
-
-CacheableStringPtr ParentPdx::toString() const {
- char idbuf[1024];
- sprintf(idbuf,
- "ParentPdx: [m_parentId=%d] [ m_parentName=%s ] [ "
- "m_wideparentName=%ls ] [m_childPdx = %s ] ",
- m_parentId, m_parentName, m_wideparentName,
- m_childPdx->toString()->asChar());
- return CacheableString::create(idbuf);
-}
-
-bool ParentPdx::equals(ParentPdx& other, bool isPdxReadSerialized) const {
- LOGINFO("ParentPdx::equals");
- ParentPdx* ot = dynamic_cast<ParentPdx*>(&other);
- if (ot == NULL) {
- LOGINFO("ParentPdx::equals1");
- return false;
- }
- if ((strcmp(m_parentName, other.m_parentName) == 0) &&
- (wcscmp(m_wideparentName, other.m_wideparentName) == 0) &&
- (m_parentId == other.m_parentId) &&
- (m_enum->getEnumOrdinal() == other.m_enum->getEnumOrdinal()) &&
- (strcmp(m_enum->getEnumClassName(), other.m_enum->getEnumClassName()) ==
- 0) &&
- (strcmp(m_enum->getEnumName(), other.m_enum->getEnumName()) == 0) &&
- m_arrLength == other.m_arrLength &&
- m_charArrayLen == other.m_charArrayLen &&
- m_wcharArrayLen == other.m_wcharArrayLen && m_char == other.m_char &&
- m_wideChar == other.m_wideChar) {
- LOGINFO("ParentPdx::equals2");
-
- for (int i = 0; i < m_arrLength; i++) {
- if ((wcscmp(m_wideparentArrayName[i], other.m_wideparentArrayName[i]) !=
- 0)) {
- LOGINFO("ParentPdx::equals2 not wcscmp");
- return false;
- }
- }
-
- for (int j = 0; j < m_charArrayLen; j++) {
- if (m_charArray[j] != other.m_charArray[j]) {
- LOGINFO("ParentPdx::equals not char array ");
- return false;
- }
- }
-
- for (int k = 0; k < m_wcharArrayLen; k++) {
- if (m_wideCharArray[k] != other.m_wideCharArray[k]) {
- LOGINFO("ParentPdx::equals not wide char array ");
- return false;
- }
- }
-
- if (!isPdxReadSerialized) {
- ChildPdx* ch1 = dynamic_cast<ChildPdx*>(m_childPdx.get());
- ChildPdx* ch2 = dynamic_cast<ChildPdx*>(other.m_childPdx.get());
-
- if (ch1->equals(*ch2)) {
- LOGINFO("ParentPdx::equals3");
- return true;
- }
- }
- return true;
- }
- LOGINFO("ParentPdx:: not equals");
- return false;
+ std::shared_ptr<CacheableString> ParentPdx::toString() const {
+ char idbuf[1024];
+ sprintf(idbuf,
+ "ParentPdx: [m_parentId=%d] [ m_parentName=%s ] [ "
+ "m_wideparentName=%ls ] [m_childPdx = %s ] ",
+ m_parentId, m_parentName, m_wideparentName,
+ m_childPdx->toString()->asChar());
+ return CacheableString::create(idbuf);
+ }
+
+ bool ParentPdx::equals(ParentPdx& other, bool isPdxReadSerialized) const {
+ LOGINFO("ParentPdx::equals");
+ ParentPdx* ot = dynamic_cast<ParentPdx*>(&other);
+ if (ot == NULL) {
+ LOGINFO("ParentPdx::equals1");
+ return false;
+ }
+ if ((strcmp(m_parentName, other.m_parentName) == 0) &&
+ (wcscmp(m_wideparentName, other.m_wideparentName) == 0) &&
+ (m_parentId == other.m_parentId) &&
+ (m_enum->getEnumOrdinal() == other.m_enum->getEnumOrdinal()) &&
+ (strcmp(m_enum->getEnumClassName(), other.m_enum->getEnumClassName()) ==
+ 0) &&
+ (strcmp(m_enum->getEnumName(), other.m_enum->getEnumName()) == 0) &&
+ m_arrLength == other.m_arrLength &&
+ m_charArrayLen == other.m_charArrayLen &&
+ m_wcharArrayLen == other.m_wcharArrayLen && m_char == other.m_char &&
+ m_wideChar == other.m_wideChar) {
+ LOGINFO("ParentPdx::equals2");
+
+ for (int i = 0; i < m_arrLength; i++) {
+ if ((wcscmp(m_wideparentArrayName[i], other.m_wideparentArrayName[i]) !=
+ 0)) {
+ LOGINFO("ParentPdx::equals2 not wcscmp");
+ return false;
+ }
+ }
+
+ for (int j = 0; j < m_charArrayLen; j++) {
+ if (m_charArray[j] != other.m_charArray[j]) {
+ LOGINFO("ParentPdx::equals not char array ");
+ return false;
+ }
+ }
+
+ for (int k = 0; k < m_wcharArrayLen; k++) {
+ if (m_wideCharArray[k] != other.m_wideCharArray[k]) {
+ LOGINFO("ParentPdx::equals not wide char array ");
+ return false;
+ }
+ }
+
+ if (!isPdxReadSerialized) {
+ ChildPdx* ch1 = dynamic_cast<ChildPdx*>(m_childPdx.get());
+ ChildPdx* ch2 = dynamic_cast<ChildPdx*>(other.m_childPdx.get());
+
+ if (ch1->equals(*ch2)) {
+ LOGINFO("ParentPdx::equals3");
+ return true;
+ }
+ }
+ return true;
+ }
+ LOGINFO("ParentPdx:: not equals");
+ return false;
}
diff --git a/tests/cpp/testobject/NestedPdxObject.hpp b/tests/cpp/testobject/NestedPdxObject.hpp
index d75d43f..2927c15 100644
--- a/tests/cpp/testobject/NestedPdxObject.hpp
+++ b/tests/cpp/testobject/NestedPdxObject.hpp
@@ -25,7 +25,7 @@
*/
#include <geode/PdxSerializable.hpp>
-#include <geode/GeodeCppCache.hpp>
+#include <geode/CacheableEnum.hpp>
#include <geode/PdxWriter.hpp>
#include <geode/PdxReader.hpp>
@@ -47,7 +47,7 @@ class TESTOBJECT_EXPORT ChildPdx : public PdxSerializable {
private:
int m_childId;
char* m_childName;
- CacheableEnumPtr m_enum;
+ std::shared_ptr<CacheableEnum> m_enum;
public:
ChildPdx() {}
@@ -78,11 +78,11 @@ class TESTOBJECT_EXPORT ChildPdx : public PdxSerializable {
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
const char* getClassName() const { return "testobject::ChildPdx"; }
@@ -90,7 +90,6 @@ class TESTOBJECT_EXPORT ChildPdx : public PdxSerializable {
bool equals(ChildPdx& other) const;
};
-typedef std::shared_ptr<ChildPdx> ChildPdxPtr;
class TESTOBJECT_EXPORT ParentPdx : public PdxSerializable {
private:
@@ -98,8 +97,8 @@ class TESTOBJECT_EXPORT ParentPdx : public PdxSerializable {
char* m_parentName;
const wchar_t* m_wideparentName;
wchar_t** m_wideparentArrayName;
- CacheablePtr m_childPdx;
- CacheableEnumPtr m_enum;
+ std::shared_ptr<Cacheable> m_childPdx;
+ std::shared_ptr<CacheableEnum> m_enum;
int m_arrLength;
char m_char;
char16_t m_wideChar;
@@ -168,11 +167,11 @@ class TESTOBJECT_EXPORT ParentPdx : public PdxSerializable {
wchar_t** getWideParentArrayName() { return m_wideparentArrayName; }
- ChildPdxPtr getChildPdx() {
+ std::shared_ptr<ChildPdx> getChildPdx() {
return std::static_pointer_cast<ChildPdx>(m_childPdx);
}
- CacheableEnumPtr getEnum() { return m_enum; }
+ std::shared_ptr<CacheableEnum> getEnum() { return m_enum; }
char getChar() { return m_char; }
@@ -189,11 +188,11 @@ class TESTOBJECT_EXPORT ParentPdx : public PdxSerializable {
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
const char* getClassName() const { return "testobject::ParentPdx"; }
@@ -201,19 +200,18 @@ class TESTOBJECT_EXPORT ParentPdx : public PdxSerializable {
bool equals(ParentPdx& other, bool isPdxReadSerialized) const;
};
-typedef std::shared_ptr<ParentPdx> ParentPdxPtr;
enum enumQuerytest { id1, id2, id3 };
class TESTOBJECT_EXPORT PdxEnumTestClass : public PdxSerializable {
private:
int m_id;
- CacheableEnumPtr m_enumid;
+ std::shared_ptr<CacheableEnum> m_enumid;
public:
int getID() { return m_id; }
- CacheableEnumPtr getEnumID() { return m_enumid; }
+ std::shared_ptr<CacheableEnum> getEnumID() { return m_enumid; }
PdxEnumTestClass(int id) {
m_id = id;
@@ -246,18 +244,18 @@ class TESTOBJECT_EXPORT PdxEnumTestClass : public PdxSerializable {
using PdxSerializable::toData;
using PdxSerializable::fromData;
- void toData(PdxWriterPtr pw) {
+ void toData(std::shared_ptr<PdxWriter> pw) {
pw->writeInt("m_id", m_id);
pw->writeObject("m_enumid", m_enumid);
}
- void fromData(PdxReaderPtr pr) {
+ void fromData(std::shared_ptr<PdxReader> pr) {
m_id = pr->readInt("m_id");
m_enumid =
std::static_pointer_cast<CacheableEnum>(pr->readObject("m_enumid"));
}
- CacheableStringPtr toString() const {
+ std::shared_ptr<CacheableString> toString() const {
return CacheableString::create("PdxEnumTestClass");
}
@@ -267,7 +265,6 @@ class TESTOBJECT_EXPORT PdxEnumTestClass : public PdxSerializable {
return new PdxEnumTestClass();
}
};
-typedef std::shared_ptr<PdxEnumTestClass> PdxEnumTestClassPtr;
class TESTOBJECT_EXPORT SerializePdx : public PdxSerializable {
private:
@@ -300,7 +297,7 @@ class TESTOBJECT_EXPORT SerializePdx : public PdxSerializable {
using PdxSerializable::toData;
using PdxSerializable::fromData;
- void toData(PdxWriterPtr pw) {
+ void toData(std::shared_ptr<PdxWriter> pw) {
pw->writeInt("i1", i1);
pw->markIdentityField("i1");
pw->writeInt("i2", i2);
@@ -309,14 +306,14 @@ class TESTOBJECT_EXPORT SerializePdx : public PdxSerializable {
pw->writeString("s2", s2);
}
- void fromData(PdxReaderPtr pr) {
+ void fromData(std::shared_ptr<PdxReader> pr) {
i1 = pr->readInt("i1");
i2 = pr->readInt("i2");
s1 = pr->readString("s1");
s2 = pr->readString("s2");
}
- CacheableStringPtr toString() const {
+ std::shared_ptr<CacheableString> toString() const {
return CacheableString::create("SerializePdx");
}
@@ -338,7 +335,6 @@ class TESTOBJECT_EXPORT SerializePdx : public PdxSerializable {
return true;
}
};
-typedef std::shared_ptr<SerializePdx> SerializePdxPtr;
} // namespace testobject
#endif // GEODE_TESTOBJECT_NESTEDPDXOBJECT_H_
diff --git a/tests/cpp/testobject/NonPdxType.hpp b/tests/cpp/testobject/NonPdxType.hpp
index 2641870..a9b10b4 100644
--- a/tests/cpp/testobject/NonPdxType.hpp
+++ b/tests/cpp/testobject/NonPdxType.hpp
@@ -26,8 +26,10 @@
* Author: vrao
*/
-#include <geode/GeodeCppCache.hpp>
#include "SerializationRegistry.hpp"
+#include <geode/CacheableEnum.hpp>
+#include <geode/CacheableObjectArray.hpp>
+#include <geode/PdxWrapper.hpp>
#ifdef _WIN32
#ifdef BUILD_TESTOBJECT
#define TESTOBJECT_EXPORT LIBEXP
@@ -105,7 +107,7 @@ class TESTOBJECT_EXPORT NonPdxType {
char* m_charArray;
- CacheableDatePtr m_date;
+ std::shared_ptr<CacheableDate> m_date;
int16_t* m_int16Array;
int16_t* m_uint16Array;
@@ -123,25 +125,25 @@ class TESTOBJECT_EXPORT NonPdxType {
char** m_stringArray;
- SerializablePtr m_address;
+ std::shared_ptr<Serializable> m_address;
NonPdxAddress* m_add[10];
- CacheableArrayListPtr m_arraylist;
- CacheableHashMapPtr m_map;
- CacheableHashTablePtr m_hashtable;
- CacheableVectorPtr m_vector;
+ std::shared_ptr<CacheableArrayList> m_arraylist;
+ std::shared_ptr<CacheableHashMap> m_map;
+ std::shared_ptr<CacheableHashTable> m_hashtable;
+ std::shared_ptr<CacheableVector> m_vector;
- CacheableHashSetPtr m_chs;
- CacheableLinkedHashSetPtr m_clhs;
+ std::shared_ptr<CacheableHashSet> m_chs;
+ std::shared_ptr<CacheableLinkedHashSet> m_clhs;
int8_t* m_byte252;
int8_t* m_byte253;
int8_t* m_byte65535;
int8_t* m_byte65536;
- CacheablePtr m_pdxEnum;
+ std::shared_ptr<Cacheable> m_pdxEnum;
- CacheableObjectArrayPtr m_objectArray;
+ std::shared_ptr<CacheableObjectArray> m_objectArray;
int32_t boolArrayLen;
int32_t charArrayLen;
@@ -163,7 +165,7 @@ class TESTOBJECT_EXPORT NonPdxType {
public:
bool selfCheck();
- inline void init(PdxSerializerPtr pdxSerializer) {
+ inline void init(std::shared_ptr<PdxSerializer> pdxSerializer) {
m_char = 'C';
m_bool = true;
m_byte = 0x74;
@@ -300,36 +302,36 @@ class TESTOBJECT_EXPORT NonPdxType {
m_add[9] = new NonPdxAddress(10, "street9", "city9");
m_objectArray = CacheableObjectArray::create();
- m_objectArray->push_back(
- PdxWrapperPtr(new PdxWrapper(new NonPdxAddress(1, "street0", "city0"),
- "PdxTests.Address", pdxSerializer)));
- m_objectArray->push_back(
- PdxWrapperPtr(new PdxWrapper(new NonPdxAddress(2, "street1", "city1"),
- "PdxTests.Address", pdxSerializer)));
- m_objectArray->push_back(
- PdxWrapperPtr(new PdxWrapper(new NonPdxAddress(3, "street2", "city2"),
- "PdxTests.Address", pdxSerializer)));
- m_objectArray->push_back(
- PdxWrapperPtr(new PdxWrapper(new NonPdxAddress(4, "street3", "city3"),
- "PdxTests.Address", pdxSerializer)));
- m_objectArray->push_back(
- PdxWrapperPtr(new PdxWrapper(new NonPdxAddress(5, "street4", "city4"),
- "PdxTests.Address", pdxSerializer)));
- m_objectArray->push_back(
- PdxWrapperPtr(new PdxWrapper(new NonPdxAddress(6, "street5", "city5"),
- "PdxTests.Address", pdxSerializer)));
- m_objectArray->push_back(
- PdxWrapperPtr(new PdxWrapper(new NonPdxAddress(7, "street6", "city6"),
- "PdxTests.Address", pdxSerializer)));
- m_objectArray->push_back(
- PdxWrapperPtr(new PdxWrapper(new NonPdxAddress(8, "street7", "city7"),
- "PdxTests.Address", pdxSerializer)));
- m_objectArray->push_back(
- PdxWrapperPtr(new PdxWrapper(new NonPdxAddress(9, "street8", "city8"),
- "PdxTests.Address", pdxSerializer)));
- m_objectArray->push_back(
- PdxWrapperPtr(new PdxWrapper(new NonPdxAddress(10, "street9", "city9"),
- "PdxTests.Address", pdxSerializer)));
+ m_objectArray->push_back(std::shared_ptr<PdxWrapper>(
+ new PdxWrapper(new NonPdxAddress(1, "street0", "city0"),
+ "PdxTests.Address", pdxSerializer)));
+ m_objectArray->push_back(std::shared_ptr<PdxWrapper>(
+ new PdxWrapper(new NonPdxAddress(2, "street1", "city1"),
+ "PdxTests.Address", pdxSerializer)));
+ m_objectArray->push_back(std::shared_ptr<PdxWrapper>(
+ new PdxWrapper(new NonPdxAddress(3, "street2", "city2"),
+ "PdxTests.Address", pdxSerializer)));
+ m_objectArray->push_back(std::shared_ptr<PdxWrapper>(
+ new PdxWrapper(new NonPdxAddress(4, "street3", "city3"),
+ "PdxTests.Address", pdxSerializer)));
+ m_objectArray->push_back(std::shared_ptr<PdxWrapper>(
+ new PdxWrapper(new NonPdxAddress(5, "street4", "city4"),
+ "PdxTests.Address", pdxSerializer)));
+ m_objectArray->push_back(std::shared_ptr<PdxWrapper>(
+ new PdxWrapper(new NonPdxAddress(6, "street5", "city5"),
+ "PdxTests.Address", pdxSerializer)));
+ m_objectArray->push_back(std::shared_ptr<PdxWrapper>(
+ new PdxWrapper(new NonPdxAddress(7, "street6", "city6"),
+ "PdxTests.Address", pdxSerializer)));
+ m_objectArray->push_back(std::shared_ptr<PdxWrapper>(
+ new PdxWrapper(new NonPdxAddress(8, "street7", "city7"),
+ "PdxTests.Address", pdxSerializer)));
+ m_objectArray->push_back(std::shared_ptr<PdxWrapper>(
+ new PdxWrapper(new NonPdxAddress(9, "street8", "city8"),
+ "PdxTests.Address", pdxSerializer)));
+ m_objectArray->push_back(std::shared_ptr<PdxWrapper>(
+ new PdxWrapper(new NonPdxAddress(10, "street9", "city9"),
+ "PdxTests.Address", pdxSerializer)));
m_byte252 = new int8_t[252];
for (int i = 0; i < 252; i++) {
@@ -368,7 +370,9 @@ class TESTOBJECT_EXPORT NonPdxType {
lengthArr[1] = 2;
}
- NonPdxType(PdxSerializerPtr pdxSerializer) { init(pdxSerializer); }
+ NonPdxType(std::shared_ptr<PdxSerializer> pdxSerializer) {
+ init(pdxSerializer);
+ }
inline bool compareBool(bool b, bool b2) {
if (b == b2) return b;
@@ -385,7 +389,7 @@ class TESTOBJECT_EXPORT NonPdxType {
bool getBool() { return m_bool; }
- CacheableHashMapPtr getHashMap() { return m_map; }
+ std::shared_ptr<CacheableHashMap> getHashMap() { return m_map; }
int8_t getSByte() { return m_sbyte; }
@@ -411,15 +415,15 @@ class TESTOBJECT_EXPORT NonPdxType {
int8_t* getSByteArray() { return m_sbyteArray; }
- CacheableHashSetPtr getHashSet() { return m_chs; }
+ std::shared_ptr<CacheableHashSet> getHashSet() { return m_chs; }
- CacheableLinkedHashSetPtr getLinkedHashSet() { return m_clhs; }
+ std::shared_ptr<CacheableLinkedHashSet> getLinkedHashSet() { return m_clhs; }
- CacheableArrayListPtr getArrayList() { return m_arraylist; }
+ std::shared_ptr<CacheableArrayList> getArrayList() { return m_arraylist; }
- CacheableHashTablePtr getHashTable() { return m_hashtable; }
+ std::shared_ptr<CacheableHashTable> getHashTable() { return m_hashtable; }
- CacheableVectorPtr getVector() { return m_vector; }
+ std::shared_ptr<CacheableVector> getVector() { return m_vector; }
int8_t getByte() { return m_byte; }
@@ -451,11 +455,13 @@ class TESTOBJECT_EXPORT NonPdxType {
char** getStringArray() { return m_stringArray; }
- CacheableDatePtr getDate() { return m_date; }
+ std::shared_ptr<CacheableDate> getDate() { return m_date; }
- CacheableObjectArrayPtr getCacheableObjectArray() { return m_objectArray; }
+ std::shared_ptr<CacheableObjectArray> getCacheableObjectArray() {
+ return m_objectArray;
+ }
- CacheableEnumPtr getEnum() {
+ std::shared_ptr<CacheableEnum> getEnum() {
return std::static_pointer_cast<CacheableEnum>(m_pdxEnum);
}
diff --git a/tests/cpp/testobject/NoopAuthInit.cpp b/tests/cpp/testobject/NoopAuthInit.cpp
index ac938a5..4308937 100644
--- a/tests/cpp/testobject/NoopAuthInit.cpp
+++ b/tests/cpp/testobject/NoopAuthInit.cpp
@@ -30,11 +30,10 @@ LIBEXP AuthInitialize* createNoopAuthInitInstance() {
return new NoopAuthInit();
}
}
-
-PropertiesPtr NoopAuthInit::getCredentials(const PropertiesPtr& securityprops,
- const char* server) {
+std::shared_ptr<Properties> NoopAuthInit::getCredentials(
+ const std::shared_ptr<Properties>& securityprops, const char* server) {
LOGINFO("rjk: calling NoopAuthInit::getCredentials");
- PropertiesPtr credentials = Properties::create();
+ auto credentials = Properties::create();
return credentials;
}
} // namespace client
diff --git a/tests/cpp/testobject/NoopAuthInit.hpp b/tests/cpp/testobject/NoopAuthInit.hpp
index cf3c240..a792041 100644
--- a/tests/cpp/testobject/NoopAuthInit.hpp
+++ b/tests/cpp/testobject/NoopAuthInit.hpp
@@ -68,8 +68,8 @@ class NoopAuthInit : public AuthInitialize {
* @remarks This method can modify the given set of properties. For
* example it may invoke external agents or even interact with the user.
*/
- PropertiesPtr getCredentials(const PropertiesPtr& securityprops,
- const char* server);
+ std::shared_ptr<Properties> getCredentials(
+ const std::shared_ptr<Properties>& securityprops, const char* server);
/**
* @brief Invoked before the cache goes down.
diff --git a/tests/cpp/testobject/PSTObject.cpp b/tests/cpp/testobject/PSTObject.cpp
index 842b65f..020887d 100644
--- a/tests/cpp/testobject/PSTObject.cpp
+++ b/tests/cpp/testobject/PSTObject.cpp
@@ -54,8 +54,7 @@ void PSTObject::fromData(apache::geode::client::DataInput& input) {
field2 = input.read();
valueData = input.readObject<CacheableBytes>();
}
-
-CacheableStringPtr PSTObject::toString() const {
+std::shared_ptr<CacheableString> PSTObject::toString() const {
char buf[102500];
sprintf(buf,
"PSTObject:[timestamp = %lld field1 = %d field2 = %c valueData=%d ]",
diff --git a/tests/cpp/testobject/PSTObject.hpp b/tests/cpp/testobject/PSTObject.hpp
index 5f9c784..d3ae107 100644
--- a/tests/cpp/testobject/PSTObject.hpp
+++ b/tests/cpp/testobject/PSTObject.hpp
@@ -24,7 +24,6 @@
* @brief User class for testing the put functionality for object.
*/
-#include <geode/GeodeCppCache.hpp>
#include <string>
#include "fwklib/Timer.hpp"
#include "fwklib/FrameworkTest.hpp"
@@ -51,9 +50,10 @@ class TESTOBJECT_EXPORT PSTObject : public TimestampedObject {
uint64_t timestamp;
int32_t field1;
int8_t field2;
- CacheableBytesPtr valueData;
+ std::shared_ptr<CacheableBytes> valueData;
- inline uint32_t getObjectSize(const SerializablePtr& obj) const {
+ inline uint32_t getObjectSize(
+ const std::shared_ptr<Serializable>& obj) const {
return (obj == nullptr ? 0 : obj->objectSize());
}
@@ -64,7 +64,7 @@ class TESTOBJECT_EXPORT PSTObject : public TimestampedObject {
virtual void toData(apache::geode::client::DataOutput& output) const;
virtual void fromData(apache::geode::client::DataInput& input);
virtual int32_t classId() const { return 0x04; }
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
virtual uint32_t objectSize() const {
uint32_t objectSize = sizeof(PSTObject);
@@ -86,7 +86,6 @@ class TESTOBJECT_EXPORT PSTObject : public TimestampedObject {
}
};
-typedef std::shared_ptr<PSTObject> PSTObjectPtr;
} // namespace testobject
#endif // GEODE_TESTOBJECT_PSTOBJECT_H_
diff --git a/tests/cpp/testobject/PdxClassV1.cpp b/tests/cpp/testobject/PdxClassV1.cpp
index 9237243..ba47365 100644
--- a/tests/cpp/testobject/PdxClassV1.cpp
+++ b/tests/cpp/testobject/PdxClassV1.cpp
@@ -53,7 +53,7 @@ int PdxType1V1::getHashCode() {
return 1;
}
-bool PdxType1V1::equals(PdxSerializablePtr obj) {
+bool PdxType1V1::equals(std::shared_ptr<PdxSerializable> obj) {
if (obj == nullptr) return false;
auto pap = std::dynamic_pointer_cast<PdxType1V1>(obj);
@@ -71,7 +71,7 @@ bool PdxType1V1::equals(PdxSerializablePtr obj) {
return false;
}
-void PdxType1V1::toData(PdxWriterPtr pw) {
+void PdxType1V1::toData(std::shared_ptr<PdxWriter> pw) {
if (!m_useWeakHashMap) pw->writeUnreadFields(m_pdxUreadFields);
pw->writeInt("i1", m_i1 + 1);
@@ -102,7 +102,7 @@ void PdxType1V1::toData(PdxWriterPtr pw) {
// LOGDEBUG("PdxObject::toData() Done......");
}
-void PdxType1V1::fromData(PdxReaderPtr pr) {
+void PdxType1V1::fromData(std::shared_ptr<PdxReader> pr) {
// LOGDEBUG("PdxObject::fromData() start...");
if (!m_useWeakHashMap) m_pdxUreadFields = pr->readUnreadFields();
@@ -149,8 +149,7 @@ void PdxType1V1::fromData(PdxReaderPtr pr) {
*/
LOGDEBUG("PdxObject::fromData() End...");
}
-
-CacheableStringPtr PdxType1V1::toString() const {
+std::shared_ptr<CacheableString> PdxType1V1::toString() const {
char idbuf[4096];
// sprintf(idbuf,"PdxObject: [ m_bool=%d ] [m_byte=%d] [m_int16=%d]
// [m_int32=%d] [m_long=%lld] [m_float=%f] [ m_string=%s ]",m_bool, m_byte,
@@ -194,7 +193,7 @@ int PdxType2V1::getHashCode() {
return 1;
}
-bool PdxType2V1::equals(PdxSerializablePtr obj) {
+bool PdxType2V1::equals(std::shared_ptr<PdxSerializable> obj) {
if (obj == nullptr) return false;
auto pap = std::dynamic_pointer_cast<PdxType2V1>(obj);
@@ -212,7 +211,7 @@ bool PdxType2V1::equals(PdxSerializablePtr obj) {
return false;
}
-void PdxType2V1::toData(PdxWriterPtr pw) {
+void PdxType2V1::toData(std::shared_ptr<PdxWriter> pw) {
if (!m_useWeakHashMap) pw->writeUnreadFields(m_unreadFields);
pw->writeInt("i1", m_i1 + 1);
@@ -221,7 +220,7 @@ void PdxType2V1::toData(PdxWriterPtr pw) {
pw->writeInt("i4", m_i4 + 1);
}
-void PdxType2V1::fromData(PdxReaderPtr pr) {
+void PdxType2V1::fromData(std::shared_ptr<PdxReader> pr) {
// LOGDEBUG("PdxObject::fromData() start...");
if (!m_useWeakHashMap) m_unreadFields = pr->readUnreadFields();
@@ -231,30 +230,29 @@ void PdxType2V1::fromData(PdxReaderPtr pr) {
m_i3 = pr->readInt("i3");
m_i4 = pr->readInt("i4");
}
+ std::shared_ptr<CacheableString> PdxType2V1::toString() const {
+ char idbuf[4096];
+ sprintf(idbuf, "PdxType2V1:[ m_i1=%d ] [ m_i2=%d ] [ m_i3=%d ] [ m_i4=%d ]",
+ m_i1, m_i2, m_i3, m_i4);
+ return CacheableString::create(idbuf);
+ }
-CacheableStringPtr PdxType2V1::toString() const {
- char idbuf[4096];
- sprintf(idbuf, "PdxType2V1:[ m_i1=%d ] [ m_i2=%d ] [ m_i3=%d ] [ m_i4=%d ]",
- m_i1, m_i2, m_i3, m_i4);
- return CacheableString::create(idbuf);
-}
-
-/************************************************************
- * PdxType3V1
- * *********************************************************/
+ /************************************************************
+ * PdxType3V1
+ * *********************************************************/
-int PdxType3V1::m_diffInSameFields = 0;
-int PdxType3V1::m_diffInExtraFields = 0;
-bool PdxType3V1::m_useWeakHashMap = false;
+ int PdxType3V1::m_diffInSameFields = 0;
+ int PdxType3V1::m_diffInExtraFields = 0;
+ bool PdxType3V1::m_useWeakHashMap = false;
-PdxType3V1::PdxType3V1() {
- m_i1 = 1;
- m_i2 = 21;
- m_str1 = (char *)"common";
- m_i3 = 31;
- m_i4 = 41;
- m_i5 = 0;
- m_str2 = (char *)"0";
+ PdxType3V1::PdxType3V1() {
+ m_i1 = 1;
+ m_i2 = 21;
+ m_str1 = (char *)"common";
+ m_i3 = 31;
+ m_i4 = 41;
+ m_i5 = 0;
+ m_str2 = (char *)"0";
}
PdxType3V1::~PdxType3V1() {
@@ -272,7 +270,7 @@ int PdxType3V1::getHashCode() {
return 1;
}
-bool PdxType3V1::equals(PdxSerializablePtr obj) {
+bool PdxType3V1::equals(std::shared_ptr<PdxSerializable> obj) {
if (obj == nullptr) return false;
auto pap = std::dynamic_pointer_cast<PdxType3V1>(obj);
@@ -292,7 +290,7 @@ bool PdxType3V1::equals(PdxSerializablePtr obj) {
return false;
}
-void PdxType3V1::toData(PdxWriterPtr pw) {
+void PdxType3V1::toData(std::shared_ptr<PdxWriter> pw) {
if (!m_useWeakHashMap) pw->writeUnreadFields(m_unreadFields);
pw->writeInt("i1", m_i1 + 1);
@@ -307,7 +305,7 @@ void PdxType3V1::toData(PdxWriterPtr pw) {
m_diffInExtraFields++;
}
-void PdxType3V1::fromData(PdxReaderPtr pr) {
+void PdxType3V1::fromData(std::shared_ptr<PdxReader> pr) {
// LOGDEBUG("PdxObject::fromData() start...");
if (!m_useWeakHashMap) m_unreadFields = pr->readUnreadFields();
@@ -336,8 +334,7 @@ void PdxType3V1::fromData(PdxReaderPtr pr) {
memcpy(m_str2, extraFieldsStr, strSize);
}
}
-
-CacheableStringPtr PdxType3V1::toString() const {
+ std::shared_ptr<CacheableString> PdxType3V1::toString() const {
char idbuf[4096];
sprintf(idbuf,
"PdxType2V1:[ m_i1=%d ] [ m_i2=%d ] [m_str1=%s] [ m_i3=%d ] [ "
@@ -373,7 +370,7 @@ int PdxTypesV1R1::getHashCode() {
return 1;
}
-bool PdxTypesV1R1::equals(PdxSerializablePtr obj) {
+bool PdxTypesV1R1::equals(std::shared_ptr<PdxSerializable> obj) {
if (obj == nullptr) return false;
auto pap = std::dynamic_pointer_cast<PdxTypesV1R1>(obj);
@@ -390,7 +387,7 @@ bool PdxTypesV1R1::equals(PdxSerializablePtr obj) {
return false;
}
-void PdxTypesV1R1::toData(PdxWriterPtr pw) {
+void PdxTypesV1R1::toData(std::shared_ptr<PdxWriter> pw) {
if (!m_useWeakHashMap) pw->writeUnreadFields(m_pdxUreadFields);
pw->writeInt("i1", m_i1 + 1);
@@ -401,7 +398,7 @@ void PdxTypesV1R1::toData(PdxWriterPtr pw) {
m_diffInSameFields++;
}
-void PdxTypesV1R1::fromData(PdxReaderPtr pr) {
+void PdxTypesV1R1::fromData(std::shared_ptr<PdxReader> pr) {
if (!m_useWeakHashMap) m_pdxUreadFields = pr->readUnreadFields();
m_i1 = pr->readInt("i1");
@@ -409,8 +406,7 @@ void PdxTypesV1R1::fromData(PdxReaderPtr pr) {
m_i3 = pr->readInt("i3");
m_i4 = pr->readInt("i4");
}
-
-CacheableStringPtr PdxTypesV1R1::toString() const {
+ std::shared_ptr<CacheableString> PdxTypesV1R1::toString() const {
char idbuf[4096];
sprintf(idbuf, "PdxTypesV1R1:[ m_i1=%d ] [ m_i2=%d ] [ m_i3=%d ] [ m_i4=%d ]",
m_i1, m_i2, m_i3, m_i4);
@@ -444,7 +440,7 @@ int PdxTypesV1R2::getHashCode() {
return 1;
}
-bool PdxTypesV1R2::equals(PdxSerializablePtr obj) {
+bool PdxTypesV1R2::equals(std::shared_ptr<PdxSerializable> obj) {
if (obj == nullptr) return false;
auto pap = std::dynamic_pointer_cast<PdxTypesV1R2>(obj);
@@ -461,7 +457,7 @@ bool PdxTypesV1R2::equals(PdxSerializablePtr obj) {
return false;
}
-void PdxTypesV1R2::toData(PdxWriterPtr pw) {
+void PdxTypesV1R2::toData(std::shared_ptr<PdxWriter> pw) {
if (!m_useWeakHashMap) pw->writeUnreadFields(m_pdxUreadFields);
pw->writeInt("i1", m_i1 + 1);
@@ -470,7 +466,7 @@ void PdxTypesV1R2::toData(PdxWriterPtr pw) {
pw->writeInt("i4", m_i4 + 1);
}
-void PdxTypesV1R2::fromData(PdxReaderPtr pr) {
+void PdxTypesV1R2::fromData(std::shared_ptr<PdxReader> pr) {
// LOGDEBUG("PdxObject::fromData() start...");
if (!m_useWeakHashMap) m_pdxUreadFields = pr->readUnreadFields();
@@ -479,34 +475,33 @@ void PdxTypesV1R2::fromData(PdxReaderPtr pr) {
m_i3 = pr->readInt("i3");
m_i4 = pr->readInt("i4");
}
-
-CacheableStringPtr PdxTypesV1R2::toString() const {
+ std::shared_ptr<CacheableString> PdxTypesV1R2::toString() const {
char idbuf[4096];
sprintf(idbuf, "PdxTypesV1R1:[ m_i1=%d ] [ m_i2=%d ] [ m_i3=%d ] [ m_i4=%d ]",
m_i1, m_i2, m_i3, m_i4);
return CacheableString::create(idbuf);
-}
+ }
-/************************************************************
- * PdxTypesIgnoreUnreadFieldsV1
- * *********************************************************/
-int PdxTypesIgnoreUnreadFieldsV1::m_diffInSameFields = 0;
-bool PdxTypesIgnoreUnreadFieldsV1::m_useWeakHashMap = false;
+ /************************************************************
+ * PdxTypesIgnoreUnreadFieldsV1
+ * *********************************************************/
+ int PdxTypesIgnoreUnreadFieldsV1::m_diffInSameFields = 0;
+ bool PdxTypesIgnoreUnreadFieldsV1::m_useWeakHashMap = false;
-PdxTypesIgnoreUnreadFieldsV1::PdxTypesIgnoreUnreadFieldsV1() {
- m_i1 = 34324;
- m_i2 = 2144;
- m_i3 = 4645734;
- m_i4 = 73567;
-}
+ PdxTypesIgnoreUnreadFieldsV1::PdxTypesIgnoreUnreadFieldsV1() {
+ m_i1 = 34324;
+ m_i2 = 2144;
+ m_i3 = 4645734;
+ m_i4 = 73567;
+ }
-PdxTypesIgnoreUnreadFieldsV1::~PdxTypesIgnoreUnreadFieldsV1() {
- // TODO Auto-generated destructor stub
-}
+ PdxTypesIgnoreUnreadFieldsV1::~PdxTypesIgnoreUnreadFieldsV1() {
+ // TODO Auto-generated destructor stub
+ }
-void PdxTypesIgnoreUnreadFieldsV1::reset(bool useWeakHashMap) {
- PdxTypesIgnoreUnreadFieldsV1::m_diffInSameFields = 0;
- PdxTypesIgnoreUnreadFieldsV1::m_useWeakHashMap = useWeakHashMap;
+ void PdxTypesIgnoreUnreadFieldsV1::reset(bool useWeakHashMap) {
+ PdxTypesIgnoreUnreadFieldsV1::m_diffInSameFields = 0;
+ PdxTypesIgnoreUnreadFieldsV1::m_useWeakHashMap = useWeakHashMap;
}
int PdxTypesIgnoreUnreadFieldsV1::getHashCode() {
@@ -514,7 +509,7 @@ int PdxTypesIgnoreUnreadFieldsV1::getHashCode() {
return 1;
}
-bool PdxTypesIgnoreUnreadFieldsV1::equals(PdxSerializablePtr obj) {
+bool PdxTypesIgnoreUnreadFieldsV1::equals(std::shared_ptr<PdxSerializable> obj) {
if (obj == nullptr) return false;
auto pap = std::dynamic_pointer_cast<PdxTypesIgnoreUnreadFieldsV1>(obj);
@@ -531,7 +526,7 @@ bool PdxTypesIgnoreUnreadFieldsV1::equals(PdxSerializablePtr obj) {
return false;
}
-void PdxTypesIgnoreUnreadFieldsV1::toData(PdxWriterPtr pw) {
+void PdxTypesIgnoreUnreadFieldsV1::toData(std::shared_ptr<PdxWriter> pw) {
if (!m_useWeakHashMap) pw->writeUnreadFields(m_unreadFields);
pw->writeInt("i1", m_i1 + 1);
@@ -543,7 +538,7 @@ void PdxTypesIgnoreUnreadFieldsV1::toData(PdxWriterPtr pw) {
m_diffInSameFields++;
}
-void PdxTypesIgnoreUnreadFieldsV1::fromData(PdxReaderPtr pr) {
+void PdxTypesIgnoreUnreadFieldsV1::fromData(std::shared_ptr<PdxReader> pr) {
// LOGDEBUG("PdxObject::fromData() start...");
if (!m_useWeakHashMap) m_unreadFields = pr->readUnreadFields();
@@ -559,78 +554,77 @@ void PdxTypesIgnoreUnreadFieldsV1::fromData(PdxReaderPtr pr) {
hasField = pr->hasField("i4");
if (!hasField) throw Exception("i4 is an valid field");
}
-
-CacheableStringPtr PdxTypesIgnoreUnreadFieldsV1::toString() const {
+ std::shared_ptr<CacheableString> PdxTypesIgnoreUnreadFieldsV1::toString() const {
char idbuf[4096];
sprintf(idbuf, "PdxTypesV1R1:[ m_i1=%d ] [ m_i2=%d ] [ m_i3=%d ] [ m_i4=%d ]",
m_i1, m_i2, m_i3, m_i4);
return CacheableString::create(idbuf);
-}
-
-/************************************************************
- * PdxVersionedV1
- * *********************************************************/
-
-PdxVersionedV1::PdxVersionedV1() {}
-
-void PdxVersionedV1::init(int32_t size) {
- m_char = 'C';
- m_bool = true;
- m_byte = 0x74;
- m_int16 = 0xab;
- m_int32 = 0x2345abdc;
- m_long = 324897980;
- m_float = 23324.324f;
- m_double = 3243298498;
-
- m_string = (char *)"gfestring";
-
- m_boolArray = new bool[3];
- m_boolArray[0] = true;
- m_boolArray[1] = false;
- m_boolArray[2] = true;
-
- m_charArray = new char[2];
- m_charArray[0] = 'c';
- m_charArray[1] = 'v';
-
- m_dateTime = nullptr;
-
- m_int16Array = new int16_t[size];
- m_int32Array = new int32_t[size];
- m_longArray = new int64_t[size];
- m_floatArray = new float[size];
- m_doubleArray = new double[size];
-
- for (int i = 0; i < size; i++) {
- m_int16Array[i] = 0x2332;
- m_int32Array[i] = 34343 + i;
- m_longArray[i] = 324324L + i;
- m_floatArray[i] = 232.565f + i;
- m_doubleArray[i] = 23423432 + i;
- // m_stringArray[i] = String.Format("one{0}", i);
- }
-
- boolArrayLen = 0;
- byteArrayLen = 0;
- shortArrayLen = 0;
- intArrayLen = 0;
- longArrayLen = 0;
- doubleArrayLen = 0;
- floatArrayLen = 0;
- strLenArray = 0;
-}
-
-PdxVersionedV1::PdxVersionedV1(int32_t size) {
- init(size);
- LOGDEBUG("PdxVersioned 1");
-}
-
-PdxVersionedV1::~PdxVersionedV1() {
- // TODO Auto-generated destructor stub
-}
-
-void PdxVersionedV1::toData(PdxWriterPtr pw) {
+ }
+
+ /************************************************************
+ * PdxVersionedV1
+ * *********************************************************/
+
+ PdxVersionedV1::PdxVersionedV1() {}
+
+ void PdxVersionedV1::init(int32_t size) {
+ m_char = 'C';
+ m_bool = true;
+ m_byte = 0x74;
+ m_int16 = 0xab;
+ m_int32 = 0x2345abdc;
+ m_long = 324897980;
+ m_float = 23324.324f;
+ m_double = 3243298498;
+
+ m_string = (char *)"gfestring";
+
+ m_boolArray = new bool[3];
+ m_boolArray[0] = true;
+ m_boolArray[1] = false;
+ m_boolArray[2] = true;
+
+ m_charArray = new char[2];
+ m_charArray[0] = 'c';
+ m_charArray[1] = 'v';
+
+ m_dateTime = nullptr;
+
+ m_int16Array = new int16_t[size];
+ m_int32Array = new int32_t[size];
+ m_longArray = new int64_t[size];
+ m_floatArray = new float[size];
+ m_doubleArray = new double[size];
+
+ for (int i = 0; i < size; i++) {
+ m_int16Array[i] = 0x2332;
+ m_int32Array[i] = 34343 + i;
+ m_longArray[i] = 324324L + i;
+ m_floatArray[i] = 232.565f + i;
+ m_doubleArray[i] = 23423432 + i;
+ // m_stringArray[i] = String.Format("one{0}", i);
+ }
+
+ boolArrayLen = 0;
+ byteArrayLen = 0;
+ shortArrayLen = 0;
+ intArrayLen = 0;
+ longArrayLen = 0;
+ doubleArrayLen = 0;
+ floatArrayLen = 0;
+ strLenArray = 0;
+ }
+
+ PdxVersionedV1::PdxVersionedV1(int32_t size) {
+ init(size);
+ LOGDEBUG("PdxVersioned 1");
+ }
+
+ PdxVersionedV1::~PdxVersionedV1() {
+ // TODO Auto-generated destructor stub
+}
+
+void PdxVersionedV1::toData(std::shared_ptr<PdxWriter> pw) {
// pw->writeChar("m_char", m_char);
pw->writeBoolean("m_bool", m_bool);
pw->writeByte("m_byte", m_byte);
@@ -650,7 +644,7 @@ void PdxVersionedV1::toData(PdxWriterPtr pw) {
pw->writeDoubleArray("m_doubleArray", m_doubleArray, 2);
}
-void PdxVersionedV1::fromData(PdxReaderPtr pr) {
+void PdxVersionedV1::fromData(std::shared_ptr<PdxReader> pr) {
// m_char = pr->readChar("m_char");
m_bool = pr->readBoolean("m_bool");
m_byte = pr->readByte("m_byte");
@@ -669,8 +663,7 @@ void PdxVersionedV1::fromData(PdxReaderPtr pr) {
m_floatArray = pr->readFloatArray("m_floatArray", floatArrayLen);
m_doubleArray = pr->readDoubleArray("m_doubleArray", doubleArrayLen);
}
-
-CacheableStringPtr PdxVersionedV1::toString() const {
+ std::shared_ptr<CacheableString> PdxVersionedV1::toString() const {
char idbuf[4096];
// sprintf(idbuf,"PdxTypesV1R1:[ m_i1=%d ] [ m_i2=%d ] [ m_i3=%d ] [ m_i4=%d
// ]", m_i1, m_i2, m_i3, m_i4 );
@@ -728,7 +721,7 @@ TestEqualsV1::TestEqualsV1() {
// intArr = ;
}
-void TestEqualsV1::toData(PdxWriterPtr pw) {
+void TestEqualsV1::toData(std::shared_ptr<PdxWriter> pw) {
pw->writeInt("i1", i1);
pw->writeInt("i2", i2);
pw->writeString("s1", s1);
@@ -738,7 +731,7 @@ void TestEqualsV1::toData(PdxWriterPtr pw) {
// pw->writeObject("sArrObject", sArr);
}
-void TestEqualsV1::fromData(PdxReaderPtr pr) {
+void TestEqualsV1::fromData(std::shared_ptr<PdxReader> pr) {
i1 = pr->readInt("i1");
i2 = pr->readInt("i2");
s1 = pr->readString("s1");
@@ -747,9 +740,8 @@ void TestEqualsV1::fromData(PdxReaderPtr pr) {
// intArr = (int[]) reader.ReadObject("intArrObject");
// sArr = (string[]) reader.ReadObject("sArrObject");
}
-
-CacheableStringPtr TestEqualsV1::toString() const {
+ std::shared_ptr<CacheableString> TestEqualsV1::toString() const {
char idbuf[1024];
sprintf(idbuf, "TestEqualsV1:[i1=%d ] [i2=%d] ", i1, i2);
return CacheableString::create(idbuf);
-}
+ }
diff --git a/tests/cpp/testobject/PdxClassV1.hpp b/tests/cpp/testobject/PdxClassV1.hpp
index e24a65e..bdee970 100644
--- a/tests/cpp/testobject/PdxClassV1.hpp
+++ b/tests/cpp/testobject/PdxClassV1.hpp
@@ -27,10 +27,9 @@
*/
#include <geode/PdxSerializable.hpp>
-#include <geode/GeodeCppCache.hpp>
#include <geode/PdxWriter.hpp>
#include <geode/PdxReader.hpp>
-
+#include <geode/PdxSerializer.hpp>
#ifdef _WIN32
#ifdef BUILD_TESTOBJECT
#define TESTOBJECT_EXPORT LIBEXP
@@ -52,7 +51,7 @@ class TESTOBJECT_EXPORT PdxType1V1 : public PdxSerializable {
private:
static int32_t m_diffInSameFields;
static bool m_useWeakHashMap;
- PdxUnreadFieldsPtr m_pdxUreadFields;
+ std::shared_ptr<PdxUnreadFields> m_pdxUreadFields;
int32_t m_i1; // = 34324;
int32_t m_i2; // = 2144;
@@ -68,22 +67,21 @@ class TESTOBJECT_EXPORT PdxType1V1 : public PdxSerializable {
int getHashCode();
- bool equals(PdxSerializablePtr obj);
+ bool equals(std::shared_ptr<PdxSerializable> obj);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
const char* getClassName() const { return "PdxTests::PdxTypes1V"; }
static PdxSerializable* createDeserializable() { return new PdxType1V1(); }
};
-typedef std::shared_ptr<PdxType1V1> PdxType1V1Ptr;
/************************************************************
* PdxType2V1
@@ -92,7 +90,7 @@ class TESTOBJECT_EXPORT PdxType2V1 : public PdxSerializable {
private:
static int m_diffInSameFields;
static bool m_useWeakHashMap;
- PdxUnreadFieldsPtr m_unreadFields;
+ std::shared_ptr<PdxUnreadFields> m_unreadFields;
int32_t m_i1;
int32_t m_i2;
int32_t m_i3;
@@ -107,22 +105,21 @@ class TESTOBJECT_EXPORT PdxType2V1 : public PdxSerializable {
int getHashCode();
- bool equals(PdxSerializablePtr obj);
+ bool equals(std::shared_ptr<PdxSerializable> obj);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
const char* getClassName() const { return "PdxTests::PdxTypes2V"; }
static PdxSerializable* createDeserializable() { return new PdxType2V1(); }
};
-typedef std::shared_ptr<PdxType2V1> PdxType2V1Ptr;
/************************************************************
* PdxType3V1
@@ -133,7 +130,7 @@ class TESTOBJECT_EXPORT PdxType3V1 : public PdxSerializable {
static int m_diffInSameFields;
static int m_diffInExtraFields;
static bool m_useWeakHashMap;
- PdxUnreadFieldsPtr m_unreadFields;
+ std::shared_ptr<PdxUnreadFields> m_unreadFields;
int32_t m_i1;
int32_t m_i2;
char* m_str1;
@@ -147,26 +144,25 @@ class TESTOBJECT_EXPORT PdxType3V1 : public PdxSerializable {
virtual ~PdxType3V1();
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
static void reset(bool useWeakHashMap);
int getHashCode();
- bool equals(PdxSerializablePtr obj);
+ bool equals(std::shared_ptr<PdxSerializable> obj);
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
const char* getClassName() const { return "PdxTests::PdxTypes3V"; }
static PdxSerializable* createDeserializable() { return new PdxType3V1(); }
};
-typedef std::shared_ptr<PdxType3V1> PdxType3V1Ptr;
/************************************************************
* PdxTypesV1R1
@@ -175,7 +171,7 @@ class TESTOBJECT_EXPORT PdxTypesV1R1 : public PdxSerializable {
private:
static int m_diffInSameFields;
static bool m_useWeakHashMap;
- PdxUnreadFieldsPtr m_pdxUreadFields;
+ std::shared_ptr<PdxUnreadFields> m_pdxUreadFields;
int32_t m_i1;
int32_t m_i2;
int32_t m_i3;
@@ -186,26 +182,25 @@ class TESTOBJECT_EXPORT PdxTypesV1R1 : public PdxSerializable {
virtual ~PdxTypesV1R1();
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
static void reset(bool useWeakHashMap);
int getHashCode();
- bool equals(PdxSerializablePtr obj);
+ bool equals(std::shared_ptr<PdxSerializable> obj);
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
const char* getClassName() const { return "PdxTests::PdxTypesR1"; }
static PdxSerializable* createDeserializable() { return new PdxTypesV1R1(); }
};
-typedef std::shared_ptr<PdxTypesV1R1> PdxTypesV1R1Ptr;
/************************************************************
* PdxTypesV1R2
@@ -214,7 +209,7 @@ class TESTOBJECT_EXPORT PdxTypesV1R2 : public PdxSerializable {
private:
static int m_diffInSameFields;
static bool m_useWeakHashMap;
- PdxUnreadFieldsPtr m_pdxUreadFields;
+ std::shared_ptr<PdxUnreadFields> m_pdxUreadFields;
int32_t m_i1;
int32_t m_i2;
int32_t m_i3;
@@ -229,22 +224,21 @@ class TESTOBJECT_EXPORT PdxTypesV1R2 : public PdxSerializable {
int getHashCode();
- bool equals(PdxSerializablePtr obj);
+ bool equals(std::shared_ptr<PdxSerializable> obj);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
const char* getClassName() const { return "PdxTests::PdxTypesR2"; }
static PdxSerializable* createDeserializable() { return new PdxTypesV1R2(); }
};
-typedef std::shared_ptr<PdxTypesV1R2> PdxTypesV1R2Ptr;
/************************************************************
* PdxTypesIgnoreUnreadFieldsV1
@@ -253,7 +247,7 @@ class TESTOBJECT_EXPORT PdxTypesIgnoreUnreadFieldsV1 : public PdxSerializable {
private:
static int m_diffInSameFields;
static bool m_useWeakHashMap;
- PdxUnreadFieldsPtr m_unreadFields;
+ std::shared_ptr<PdxUnreadFields> m_unreadFields;
int32_t m_i1;
int32_t m_i2;
int32_t m_i3;
@@ -264,20 +258,20 @@ class TESTOBJECT_EXPORT PdxTypesIgnoreUnreadFieldsV1 : public PdxSerializable {
virtual ~PdxTypesIgnoreUnreadFieldsV1();
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
static void reset(bool useWeakHashMap);
int getHashCode();
- bool equals(PdxSerializablePtr obj);
+ bool equals(std::shared_ptr<PdxSerializable> obj);
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
const char* getClassName() const {
return "PdxTests::PdxTypesIgnoreUnreadFields";
@@ -287,8 +281,7 @@ class TESTOBJECT_EXPORT PdxTypesIgnoreUnreadFieldsV1 : public PdxSerializable {
return new PdxTypesIgnoreUnreadFieldsV1();
}
};
-typedef std::shared_ptr<PdxTypesIgnoreUnreadFieldsV1>
- PdxTypesIgnoreUnreadFieldsV1Ptr;
+
/************************************************************
* PdxVersionedV1
@@ -306,7 +299,7 @@ class TESTOBJECT_EXPORT PdxVersionedV1 : public PdxSerializable {
char* m_string;
bool* m_boolArray;
char* m_charArray;
- CacheableDatePtr m_dateTime;
+ std::shared_ptr<CacheableDate> m_dateTime;
int16_t* m_int16Array;
int32_t* m_int32Array;
int64_t* m_longArray;
@@ -334,14 +327,14 @@ class TESTOBJECT_EXPORT PdxVersionedV1 : public PdxSerializable {
void init(int32_t size);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
const char* getClassName() const { return "PdxTests::PdxVersioned"; }
@@ -349,7 +342,6 @@ class TESTOBJECT_EXPORT PdxVersionedV1 : public PdxSerializable {
return new PdxVersionedV1();
}
};
-typedef std::shared_ptr<PdxVersionedV1> PdxVersionedV1Ptr;
/************************************************************
* TestKey
@@ -426,7 +418,7 @@ class TestPdxSerializerForV1 : public PdxSerializer {
return objectSize;
}
- void* fromDataForTestKeyV1(PdxReaderPtr pr) {
+ void* fromDataForTestKeyV1(std::shared_ptr<PdxReader> pr) {
try {
PdxTests::TestKeyV1* tkv1 = new PdxTests::TestKeyV1;
tkv1->_id = pr->readString("_id");
@@ -436,7 +428,7 @@ class TestPdxSerializerForV1 : public PdxSerializer {
}
}
- bool toDataForTestKeyV1(void* testObject, PdxWriterPtr pw) {
+ bool toDataForTestKeyV1(void* testObject, std::shared_ptr<PdxWriter> pw) {
try {
PdxTests::TestKeyV1* tkv1 =
reinterpret_cast<PdxTests::TestKeyV1*>(testObject);
@@ -448,7 +440,7 @@ class TestPdxSerializerForV1 : public PdxSerializer {
}
}
- void* fromDataForTestDiffTypePdxSV1(PdxReaderPtr pr) {
+ void* fromDataForTestDiffTypePdxSV1(std::shared_ptr<PdxReader> pr) {
try {
PdxTests::TestDiffTypePdxSV1* dtpv1 = new PdxTests::TestDiffTypePdxSV1;
dtpv1->_id = pr->readString("_id");
@@ -459,7 +451,7 @@ class TestPdxSerializerForV1 : public PdxSerializer {
}
}
- bool toDataForTestDiffTypePdxSV1(void* testObject, PdxWriterPtr pw) {
+ bool toDataForTestDiffTypePdxSV1(void* testObject, std::shared_ptr<PdxWriter> pw) {
try {
PdxTests::TestDiffTypePdxSV1* dtpv1 =
reinterpret_cast<PdxTests::TestDiffTypePdxSV1*>(testObject);
@@ -472,7 +464,7 @@ class TestPdxSerializerForV1 : public PdxSerializer {
}
}
- void* fromData(const char* className, PdxReaderPtr pr) {
+ void* fromData(const char* className, std::shared_ptr<PdxReader> pr) {
// ASSERT(strcmp(className, V1CLASSNAME1) == 0 || strcmp(className,
// V1CLASSNAME2) == 0, "Unexpected classname in fromData");
@@ -488,7 +480,7 @@ class TestPdxSerializerForV1 : public PdxSerializer {
}
}
- bool toData(void* testObject, const char* className, PdxWriterPtr pw) {
+ bool toData(void* testObject, const char* className, std::shared_ptr<PdxWriter> pw) {
// ASSERT(strcmp(className, V1CLASSNAME1) == 0 || strcmp(className,
// V1CLASSNAME2) == 0, "Unexpected classname in toData");
@@ -518,14 +510,14 @@ class TESTOBJECT_EXPORT TestEqualsV1 : public PdxSerializable {
public:
TestEqualsV1();
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
const char* getClassName() const { return "PdxTests::TestEquals"; }
diff --git a/tests/cpp/testobject/PdxClassV2.cpp b/tests/cpp/testobject/PdxClassV2.cpp
index cf70f6a..ad55f21 100644
--- a/tests/cpp/testobject/PdxClassV2.cpp
+++ b/tests/cpp/testobject/PdxClassV2.cpp
@@ -57,7 +57,7 @@ int PdxTypes1V2::getHashCode() {
return 1;
}
-bool PdxTypes1V2::equals(PdxSerializablePtr obj) {
+bool PdxTypes1V2::equals(std::shared_ptr<PdxSerializable> obj) {
if (obj == nullptr) return false;
auto pap = std::dynamic_pointer_cast<PdxTypes1V2>(obj);
@@ -77,7 +77,7 @@ bool PdxTypes1V2::equals(PdxSerializablePtr obj) {
return false;
}
-void PdxTypes1V2::toData(PdxWriterPtr pw) {
+void PdxTypes1V2::toData(std::shared_ptr<PdxWriter> pw) {
//
if (!m_useWeakHashMap) pw->writeUnreadFields(m_pdxUreadFields);
@@ -94,7 +94,7 @@ void PdxTypes1V2::toData(PdxWriterPtr pw) {
// LOGDEBUG("PdxObject::toData() Done......");
}
-void PdxTypes1V2::fromData(PdxReaderPtr pr) {
+void PdxTypes1V2::fromData(std::shared_ptr<PdxReader> pr) {
// LOGDEBUG("PdxObject::fromData() start...");
m_i1 = pr->readInt("i1");
bool isIdentity = pr->isIdentityField("i2");
@@ -110,8 +110,7 @@ void PdxTypes1V2::fromData(PdxReaderPtr pr) {
// LOGDEBUG("PdxType1V2::fromData() End...");
}
-
-CacheableStringPtr PdxTypes1V2::toString() const {
+std::shared_ptr<CacheableString> PdxTypes1V2::toString() const {
char idbuf[4096];
sprintf(idbuf,
"PdxType1V1:[ m_i1=%d ] [ m_i2=%d ] [ m_i3=%d ] [ m_i4=%d ] [ "
@@ -152,7 +151,7 @@ int PdxTypes2V2::getHashCode() {
return 1;
}
-bool PdxTypes2V2::equals(PdxSerializablePtr obj) {
+bool PdxTypes2V2::equals(std::shared_ptr<PdxSerializable> obj) {
if (obj == nullptr) return false;
auto pap = std::dynamic_pointer_cast<PdxTypes2V2>(obj);
@@ -172,7 +171,7 @@ bool PdxTypes2V2::equals(PdxSerializablePtr obj) {
return false;
}
-void PdxTypes2V2::toData(PdxWriterPtr pw) {
+void PdxTypes2V2::toData(std::shared_ptr<PdxWriter> pw) {
if (!m_useWeakHashMap) pw->writeUnreadFields(m_unreadFields);
pw->writeInt("i1", m_i1 + 1);
@@ -186,7 +185,7 @@ void PdxTypes2V2::toData(PdxWriterPtr pw) {
m_diffInSameFields++;
}
-void PdxTypes2V2::fromData(PdxReaderPtr pr) {
+void PdxTypes2V2::fromData(std::shared_ptr<PdxReader> pr) {
// LOGDEBUG("PdxObject::fromData() start...");
//
if (!m_useWeakHashMap) m_unreadFields = pr->readUnreadFields();
@@ -198,32 +197,31 @@ void PdxTypes2V2::fromData(PdxReaderPtr pr) {
m_i3 = pr->readInt("i3");
m_i4 = pr->readInt("i4");
}
+ std::shared_ptr<CacheableString> PdxTypes2V2::toString() const {
+ char idbuf[4096];
+ sprintf(idbuf,
+ "PdxTypes2V2:[ m_i1=%d ] [ m_i2=%d ] [ m_i3=%d ] [ m_i4=%d ] [ "
+ "m_i5=%d ] [ m_i6=%d ]",
+ m_i1, m_i2, m_i3, m_i4, m_i5, m_i6);
+ return CacheableString::create(idbuf);
+ }
-CacheableStringPtr PdxTypes2V2::toString() const {
- char idbuf[4096];
- sprintf(idbuf,
- "PdxTypes2V2:[ m_i1=%d ] [ m_i2=%d ] [ m_i3=%d ] [ m_i4=%d ] [ "
- "m_i5=%d ] [ m_i6=%d ]",
- m_i1, m_i2, m_i3, m_i4, m_i5, m_i6);
- return CacheableString::create(idbuf);
-}
+ /************************************************************
+ * PdxTypes3V2
+ * *********************************************************/
-/************************************************************
- * PdxTypes3V2
- * *********************************************************/
-
-int PdxTypes3V2::m_diffInSameFields = 0;
-int PdxTypes3V2::m_diffInExtraFields = 0;
-bool PdxTypes3V2::m_useWeakHashMap = false;
+ int PdxTypes3V2::m_diffInSameFields = 0;
+ int PdxTypes3V2::m_diffInExtraFields = 0;
+ bool PdxTypes3V2::m_useWeakHashMap = false;
-PdxTypes3V2::PdxTypes3V2() {
- m_i1 = 1;
- m_i2 = 21;
- m_str1 = (char *)"common";
- m_i4 = 41;
- m_i3 = 31;
- m_i6 = 0;
- m_str3 = (char *)"0";
+ PdxTypes3V2::PdxTypes3V2() {
+ m_i1 = 1;
+ m_i2 = 21;
+ m_str1 = (char *)"common";
+ m_i4 = 41;
+ m_i3 = 31;
+ m_i6 = 0;
+ m_str3 = (char *)"0";
}
PdxTypes3V2::~PdxTypes3V2() {
@@ -241,7 +239,7 @@ int PdxTypes3V2::getHashCode() {
return 1;
}
-bool PdxTypes3V2::equals(PdxSerializablePtr obj) {
+bool PdxTypes3V2::equals(std::shared_ptr<PdxSerializable> obj) {
if (obj == nullptr) return false;
auto pap = std::dynamic_pointer_cast<PdxTypes3V2>(obj);
@@ -261,7 +259,7 @@ bool PdxTypes3V2::equals(PdxSerializablePtr obj) {
return false;
}
-void PdxTypes3V2::toData(PdxWriterPtr pw) {
+void PdxTypes3V2::toData(std::shared_ptr<PdxWriter> pw) {
//
if (!m_useWeakHashMap) pw->writeUnreadFields(m_unreadFields);
@@ -277,7 +275,7 @@ void PdxTypes3V2::toData(PdxWriterPtr pw) {
m_diffInSameFields++;
}
-void PdxTypes3V2::fromData(PdxReaderPtr pr) {
+void PdxTypes3V2::fromData(std::shared_ptr<PdxReader> pr) {
// LOGDEBUG("PdxObject::fromData() start...");
//
if (!m_useWeakHashMap) m_unreadFields = pr->readUnreadFields();
@@ -306,8 +304,7 @@ void PdxTypes3V2::fromData(PdxReaderPtr pr) {
memcpy(m_str3, extraFieldsStr, strSize);
}
}
-
-CacheableStringPtr PdxTypes3V2::toString() const {
+ std::shared_ptr<CacheableString> PdxTypes3V2::toString() const {
char idbuf[4096];
sprintf(idbuf,
"PdxTypes3V2:[ m_i1=%d ] [ m_i2=%d ] [m_str1=%s] [ m_i3=%d ] [ "
@@ -349,7 +346,7 @@ int PdxTypesR1V2::getHashCode() {
return 1;
}
-bool PdxTypesR1V2::equals(PdxSerializablePtr obj) {
+bool PdxTypesR1V2::equals(std::shared_ptr<PdxSerializable> obj) {
if (obj == nullptr) return false;
auto pap = std::dynamic_pointer_cast<PdxTypesR1V2>(obj);
@@ -371,7 +368,7 @@ bool PdxTypesR1V2::equals(PdxSerializablePtr obj) {
return false;
}
-void PdxTypesR1V2::toData(PdxWriterPtr pw) {
+void PdxTypesR1V2::toData(std::shared_ptr<PdxWriter> pw) {
if (!m_useWeakHashMap) pw->writeUnreadFields(m_pdxUnreadFields);
pw->writeInt("i1", m_i1 + 1);
@@ -386,7 +383,7 @@ void PdxTypesR1V2::toData(PdxWriterPtr pw) {
m_diffInExtraFields++;
}
-void PdxTypesR1V2::fromData(PdxReaderPtr pr) {
+void PdxTypesR1V2::fromData(std::shared_ptr<PdxReader> pr) {
if (!m_useWeakHashMap) m_pdxUnreadFields = pr->readUnreadFields();
m_i1 = pr->readInt("i1");
@@ -397,8 +394,7 @@ void PdxTypesR1V2::fromData(PdxReaderPtr pr) {
m_i5 = pr->readInt("i5");
m_i6 = pr->readInt("i6");
}
-
-CacheableStringPtr PdxTypesR1V2::toString() const {
+ std::shared_ptr<CacheableString> PdxTypesR1V2::toString() const {
char idbuf[4096];
sprintf(idbuf,
"PdxTypesR1V2:[ m_i1=%d ] [ m_i2=%d ] [ m_i3=%d ] [ m_i4=%d ] [ "
@@ -441,7 +437,7 @@ int PdxTypesR2V2::getHashCode() {
return 1;
}
-bool PdxTypesR2V2::equals(PdxSerializablePtr obj) {
+bool PdxTypesR2V2::equals(std::shared_ptr<PdxSerializable> obj) {
if (obj == nullptr) return false;
auto pap = std::dynamic_pointer_cast<PdxTypesR2V2>(obj);
@@ -465,7 +461,7 @@ bool PdxTypesR2V2::equals(PdxSerializablePtr obj) {
return false;
}
-void PdxTypesR2V2::toData(PdxWriterPtr pw) {
+void PdxTypesR2V2::toData(std::shared_ptr<PdxWriter> pw) {
if (!m_useWeakHashMap) pw->writeUnreadFields(m_pdxunreadFields);
pw->writeInt("i1", m_i1 + 1);
@@ -483,7 +479,7 @@ void PdxTypesR2V2::toData(PdxWriterPtr pw) {
pw->writeString("m_str1", tmpBuf);
}
-void PdxTypesR2V2::fromData(PdxReaderPtr pr) {
+void PdxTypesR2V2::fromData(std::shared_ptr<PdxReader> pr) {
LOGDEBUG("PdxObject::fromData() start...");
if (!m_useWeakHashMap) m_pdxunreadFields = pr->readUnreadFields();
@@ -496,8 +492,7 @@ void PdxTypesR2V2::fromData(PdxReaderPtr pr) {
m_i4 = pr->readInt("i4");
m_str1 = pr->readString("m_str1");
}
-
-CacheableStringPtr PdxTypesR2V2::toString() const {
+ std::shared_ptr<CacheableString> PdxTypesR2V2::toString() const {
char idbuf[4096];
sprintf(idbuf,
"PdxTypesR2V2:[ m_i1=%d ] [m_i2=%d] [ m_i3=%d ] [ m_i4=%d ] "
@@ -538,7 +533,7 @@ int PdxTypesIgnoreUnreadFieldsV2::getHashCode() {
return 1;
}
-bool PdxTypesIgnoreUnreadFieldsV2::equals(PdxSerializablePtr obj) {
+bool PdxTypesIgnoreUnreadFieldsV2::equals(std::shared_ptr<PdxSerializable> obj) {
if (obj == nullptr) return false;
auto pap = std::dynamic_pointer_cast<PdxTypesIgnoreUnreadFieldsV2>(obj);
@@ -574,7 +569,7 @@ void PdxTypesIgnoreUnreadFieldsV2::updateMembers() {
m_i6 = (int32_t)m_diffInExtraFields;
}
-void PdxTypesIgnoreUnreadFieldsV2::toData(PdxWriterPtr pw) {
+void PdxTypesIgnoreUnreadFieldsV2::toData(std::shared_ptr<PdxWriter> pw) {
if (!m_useWeakHashMap) pw->writeUnreadFields(m_unreadFields);
pw->writeInt("i1", m_i1 + 1);
@@ -592,7 +587,7 @@ void PdxTypesIgnoreUnreadFieldsV2::toData(PdxWriterPtr pw) {
m_diffInExtraFields++;
}
-void PdxTypesIgnoreUnreadFieldsV2::fromData(PdxReaderPtr pr) {
+void PdxTypesIgnoreUnreadFieldsV2::fromData(std::shared_ptr<PdxReader> pr) {
m_i1 = pr->readInt("i1");
bool isIdentity = pr->isIdentityField("i2");
@@ -608,8 +603,7 @@ void PdxTypesIgnoreUnreadFieldsV2::fromData(PdxReaderPtr pr) {
m_i5 = pr->readInt("i5");
m_i6 = pr->readInt("i6");
}
-
-CacheableStringPtr PdxTypesIgnoreUnreadFieldsV2::toString() const {
+ std::shared_ptr<CacheableString> PdxTypesIgnoreUnreadFieldsV2::toString() const {
char idbuf[4096];
sprintf(idbuf,
"PdxTypesV1R1:[m_i1=%d] [m_i2=%d] [m_i3=%d] [m_i4=%d] [m_i5=%d] "
@@ -679,7 +673,7 @@ PdxVersionedV2::~PdxVersionedV2() {
// TODO Auto-generated destructor stub
}
-void PdxVersionedV2::toData(PdxWriterPtr pw) {
+void PdxVersionedV2::toData(std::shared_ptr<PdxWriter> pw) {
// pw->writeChar("m_char", m_char);
pw->writeBoolean("m_bool", m_bool);
pw->writeByte("m_byte", m_byte);
@@ -699,7 +693,7 @@ void PdxVersionedV2::toData(PdxWriterPtr pw) {
pw->writeDoubleArray("m_doubleArray", m_doubleArray, 2);
}
-void PdxVersionedV2::fromData(PdxReaderPtr pr) {
+void PdxVersionedV2::fromData(std::shared_ptr<PdxReader> pr) {
// m_char = pr->readChar("m_char");
m_bool = pr->readBoolean("m_bool");
m_byte = pr->readByte("m_byte");
@@ -718,8 +712,7 @@ void PdxVersionedV2::fromData(PdxReaderPtr pr) {
m_floatArray = pr->readFloatArray("m_floatArray", floatArrayLen);
m_doubleArray = pr->readDoubleArray("m_doubleArray", doubleArrayLen);
}
-
-CacheableStringPtr PdxVersionedV2::toString() const {
+ std::shared_ptr<CacheableString> PdxVersionedV2::toString() const {
char idbuf[4096];
// sprintf(idbuf,"PdxTypesV1R1:[ m_i1=%d ] [ m_i2=%d ] [ m_i3=%d ] [ m_i4=%d
// ]", m_i1, m_i2, m_i3, m_i4 );
@@ -781,7 +774,7 @@ bool TestDiffTypePdxSV2::equals(TestDiffTypePdxSV2 *obj) {
//intArr = ;
}
- void TestEqualsV1::toData( PdxWriterPtr pw ) {
+ void TestEqualsV1::toData( std::shared_ptr<PdxWriter> pw ) {
pw->writeInt("i1", i1);
pw->writeInt("i2", i2);
pw->writeString("s1", s1);
@@ -791,7 +784,7 @@ bool TestDiffTypePdxSV2::equals(TestDiffTypePdxSV2 *obj) {
//pw->writeObject("sArrObject", sArr);
}
- void TestEqualsV1::fromData( PdxReaderPtr pr )
+ void TestEqualsV1::fromData( std::shared_ptr<PdxReader> pr )
{
i1 = pr->readInt("i1");
i2 = pr->readInt("i2");
@@ -802,7 +795,7 @@ bool TestDiffTypePdxSV2::equals(TestDiffTypePdxSV2 *obj) {
//sArr = (string[]) reader.ReadObject("sArrObject");
}
- CacheableStringPtr TestEqualsV1::toString() const {
+ std::shared_ptr<CacheableString> TestEqualsV1::toString() const {
char idbuf[1024];
sprintf(idbuf,"TestEqualsV1:[i1=%d ] [i2=%d] ", i1, i2 );
return CacheableString::create( idbuf );
diff --git a/tests/cpp/testobject/PdxClassV2.hpp b/tests/cpp/testobject/PdxClassV2.hpp
index 3760ead..a4eccff 100644
--- a/tests/cpp/testobject/PdxClassV2.hpp
+++ b/tests/cpp/testobject/PdxClassV2.hpp
@@ -27,7 +27,7 @@
*/
#include <geode/PdxSerializable.hpp>
-#include <geode/GeodeCppCache.hpp>
+#include <geode/PdxSerializer.hpp>
#include <geode/PdxWriter.hpp>
#include <geode/PdxReader.hpp>
@@ -53,7 +53,7 @@ class TESTOBJECT_EXPORT PdxTypes1V2 : public PdxSerializable {
static int32_t m_diffInSameFields;
static int32_t m_diffInExtraFields;
static bool m_useWeakHashMap;
- PdxUnreadFieldsPtr m_pdxUreadFields;
+ std::shared_ptr<PdxUnreadFields> m_pdxUreadFields;
int32_t m_i1;
int32_t m_i2;
@@ -71,22 +71,21 @@ class TESTOBJECT_EXPORT PdxTypes1V2 : public PdxSerializable {
int getHashCode();
- bool equals(PdxSerializablePtr obj);
+ bool equals(std::shared_ptr<PdxSerializable> obj);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
const char* getClassName() const { return "PdxTests::PdxTypes1V"; }
static PdxSerializable* createDeserializable() { return new PdxTypes1V2(); }
};
-typedef std::shared_ptr<PdxTypes1V2> PdxTypes1V2Ptr;
/************************************************************
* PdxTypes2V2
@@ -97,7 +96,7 @@ class TESTOBJECT_EXPORT PdxTypes2V2 : public PdxSerializable {
static int m_diffInSameFields;
static int m_diffInExtraFields;
static bool m_useWeakHashMap;
- PdxUnreadFieldsPtr m_unreadFields;
+ std::shared_ptr<PdxUnreadFields> m_unreadFields;
int32_t m_i1;
int32_t m_i2;
int32_t m_i3;
@@ -114,22 +113,21 @@ class TESTOBJECT_EXPORT PdxTypes2V2 : public PdxSerializable {
int getHashCode();
- bool equals(PdxSerializablePtr obj);
+ bool equals(std::shared_ptr<PdxSerializable> obj);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
const char* getClassName() const { return "PdxTests::PdxTypes2V"; }
static PdxSerializable* createDeserializable() { return new PdxTypes2V2(); }
};
-typedef std::shared_ptr<PdxTypes2V2> PdxTypes2V2Ptr;
/************************************************************
* PdxTypes3V2
@@ -140,7 +138,7 @@ class TESTOBJECT_EXPORT PdxTypes3V2 : public PdxSerializable {
static int m_diffInSameFields;
static int m_diffInExtraFields;
static bool m_useWeakHashMap;
- PdxUnreadFieldsPtr m_unreadFields;
+ std::shared_ptr<PdxUnreadFields> m_unreadFields;
int32_t m_i1;
int32_t m_i2;
char* m_str1;
@@ -154,26 +152,25 @@ class TESTOBJECT_EXPORT PdxTypes3V2 : public PdxSerializable {
virtual ~PdxTypes3V2();
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
static void reset(bool useWeakHashMap);
int getHashCode();
- bool equals(PdxSerializablePtr obj);
+ bool equals(std::shared_ptr<PdxSerializable> obj);
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
const char* getClassName() const { return "PdxTests::PdxTypes3V"; }
static PdxSerializable* createDeserializable() { return new PdxTypes3V2(); }
};
-typedef std::shared_ptr<PdxTypes3V2> PdxTypes3V2Ptr;
/************************************************************
* PdxTypesR1V2
@@ -184,7 +181,7 @@ class TESTOBJECT_EXPORT PdxTypesR1V2 : public PdxSerializable {
static int32_t m_diffInSameFields;
static int32_t m_diffInExtraFields;
static bool m_useWeakHashMap;
- PdxUnreadFieldsPtr m_pdxUnreadFields;
+ std::shared_ptr<PdxUnreadFields> m_pdxUnreadFields;
int32_t m_i1;
int32_t m_i2;
int32_t m_i3;
@@ -199,26 +196,25 @@ class TESTOBJECT_EXPORT PdxTypesR1V2 : public PdxSerializable {
virtual ~PdxTypesR1V2();
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
static void reset(bool useWeakHashMap);
int getHashCode();
- bool equals(PdxSerializablePtr obj);
+ bool equals(std::shared_ptr<PdxSerializable> obj);
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
const char* getClassName() const { return "PdxTests::PdxTypesR1"; }
static PdxSerializable* createDeserializable() { return new PdxTypesR1V2(); }
};
-typedef std::shared_ptr<PdxTypesR1V2> PdxTypesR1V2Ptr;
/************************************************************
* PdxTypesR2V2
@@ -229,7 +225,7 @@ class TESTOBJECT_EXPORT PdxTypesR2V2 : public PdxSerializable {
static int m_diffInSameFields;
static int m_diffInExtraFields;
static bool m_useWeakHashMap;
- PdxUnreadFieldsPtr m_pdxunreadFields;
+ std::shared_ptr<PdxUnreadFields> m_pdxunreadFields;
int32_t m_i1;
int32_t m_i2;
int32_t m_i3;
@@ -248,22 +244,21 @@ class TESTOBJECT_EXPORT PdxTypesR2V2 : public PdxSerializable {
int getHashCode();
- bool equals(PdxSerializablePtr obj);
+ bool equals(std::shared_ptr<PdxSerializable> obj);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
const char* getClassName() const { return "PdxTests::PdxTypesR2"; }
static PdxSerializable* createDeserializable() { return new PdxTypesR2V2(); }
};
-typedef std::shared_ptr<PdxTypesR2V2> PdxTypesR2V2Ptr;
/************************************************************
* PdxTypesIgnoreUnreadFieldsV2
@@ -274,7 +269,7 @@ class TESTOBJECT_EXPORT PdxTypesIgnoreUnreadFieldsV2 : public PdxSerializable {
static int m_diffInSameFields;
static int m_diffInExtraFields;
static bool m_useWeakHashMap;
- PdxUnreadFieldsPtr m_unreadFields;
+ std::shared_ptr<PdxUnreadFields> m_unreadFields;
int32_t m_i1;
int32_t m_i2;
int32_t m_i3;
@@ -287,7 +282,7 @@ class TESTOBJECT_EXPORT PdxTypesIgnoreUnreadFieldsV2 : public PdxSerializable {
virtual ~PdxTypesIgnoreUnreadFieldsV2();
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
static void reset(bool useWeakHashMap);
@@ -295,14 +290,14 @@ class TESTOBJECT_EXPORT PdxTypesIgnoreUnreadFieldsV2 : public PdxSerializable {
int getHashCode();
- bool equals(PdxSerializablePtr obj);
+ bool equals(std::shared_ptr<PdxSerializable> obj);
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
const char* getClassName() const {
return "PdxTests::PdxTypesIgnoreUnreadFields";
@@ -312,8 +307,7 @@ class TESTOBJECT_EXPORT PdxTypesIgnoreUnreadFieldsV2 : public PdxSerializable {
return new PdxTypesIgnoreUnreadFieldsV2();
}
};
-typedef std::shared_ptr<PdxTypesIgnoreUnreadFieldsV2>
- PdxTypesIgnoreUnreadFieldsV2Ptr;
+
/************************************************************
* PdxVersionedV2
@@ -332,7 +326,7 @@ class TESTOBJECT_EXPORT PdxVersionedV2 : public PdxSerializable {
char* m_string;
bool* m_boolArray;
char* m_charArray;
- CacheableDatePtr m_dateTime;
+ std::shared_ptr<CacheableDate> m_dateTime;
int16_t* m_int16Array;
int32_t* m_int32Array;
int64_t* m_longArray;
@@ -360,14 +354,14 @@ class TESTOBJECT_EXPORT PdxVersionedV2 : public PdxSerializable {
void init(int32_t size);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
const char* getClassName() const { return "PdxTests::PdxVersioned"; }
@@ -375,7 +369,6 @@ class TESTOBJECT_EXPORT PdxVersionedV2 : public PdxSerializable {
return new PdxVersionedV2();
}
};
-typedef std::shared_ptr<PdxVersionedV2> PdxVersionedV2Ptr;
/************************************************************
* TestKey
@@ -454,7 +447,7 @@ class TestPdxSerializerForV2 : public PdxSerializer {
return objectSize;
}
- void* fromDataForTestKeyV2(PdxReaderPtr pr) {
+ void* fromDataForTestKeyV2(std::shared_ptr<PdxReader> pr) {
try {
PdxTests::TestKeyV2* tkv1 = new PdxTests::TestKeyV2;
tkv1->_id = pr->readString("_id");
@@ -464,7 +457,7 @@ class TestPdxSerializerForV2 : public PdxSerializer {
}
}
- bool toDataForTestKeyV2(void* testObject, PdxWriterPtr pw) {
+ bool toDataForTestKeyV2(void* testObject, std::shared_ptr<PdxWriter> pw) {
try {
PdxTests::TestKeyV2* tkv1 =
reinterpret_cast<PdxTests::TestKeyV2*>(testObject);
@@ -476,7 +469,7 @@ class TestPdxSerializerForV2 : public PdxSerializer {
}
}
- void* fromDataForTestDiffTypePdxSV2(PdxReaderPtr pr) {
+ void* fromDataForTestDiffTypePdxSV2(std::shared_ptr<PdxReader> pr) {
try {
PdxTests::TestDiffTypePdxSV2* dtpv1 = new PdxTests::TestDiffTypePdxSV2;
dtpv1->_id = pr->readString("_id");
@@ -488,7 +481,7 @@ class TestPdxSerializerForV2 : public PdxSerializer {
}
}
- bool toDataForTestDiffTypePdxSV2(void* testObject, PdxWriterPtr pw) {
+ bool toDataForTestDiffTypePdxSV2(void* testObject, std::shared_ptr<PdxWriter> pw) {
try {
PdxTests::TestDiffTypePdxSV2* dtpv1 =
reinterpret_cast<PdxTests::TestDiffTypePdxSV2*>(testObject);
@@ -503,7 +496,7 @@ class TestPdxSerializerForV2 : public PdxSerializer {
}
}
- void* fromData(const char* className, PdxReaderPtr pr) {
+ void* fromData(const char* className, std::shared_ptr<PdxReader> pr) {
// ASSERT(strcmp(className, V2CLASSNAME3) == 0 || strcmp(className,
// V2CLASSNAME4) == 0, "Unexpected classname in fromData");
@@ -519,7 +512,7 @@ class TestPdxSerializerForV2 : public PdxSerializer {
}
}
- bool toData(void* testObject, const char* className, PdxWriterPtr pw) {
+ bool toData(void* testObject, const char* className, std::shared_ptr<PdxWriter> pw) {
// ASSERT(strcmp(className, V2CLASSNAME3) == 0 || strcmp(className,
// V2CLASSNAME4) == 0, "Unexpected classname in toData");
@@ -554,14 +547,14 @@ public:
TestEqualsV1();
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw) ;
+ virtual void toData(std::shared_ptr<PdxWriter> pw) ;
const char* getClassName()const {
return "PdxTests::TestEquals";
diff --git a/tests/cpp/testobject/PdxType.cpp b/tests/cpp/testobject/PdxType.cpp
index d8a74a3..8e475cf 100644
--- a/tests/cpp/testobject/PdxType.cpp
+++ b/tests/cpp/testobject/PdxType.cpp
@@ -71,7 +71,7 @@ bool PdxTests::PdxType::generic2DCompare(T1** value1, T2** value2, int length,
// PdxType::~PdxObject() {
//}
-void PdxTests::PdxType::toData(PdxWriterPtr pw) /*const*/ {
+void PdxTests::PdxType::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
// TODO:delete it later
int* lengthArr = new int[2];
@@ -174,7 +174,7 @@ void PdxTests::PdxType::toData(PdxWriterPtr pw) /*const*/ {
// TODO:delete it later
}
-void PdxTests::PdxType::fromData(PdxReaderPtr pr) {
+void PdxTests::PdxType::fromData(std::shared_ptr<PdxReader> pr) {
// TODO:temp added, delete later
int32_t* Lengtharr;
@@ -263,8 +263,7 @@ void PdxTests::PdxType::fromData(PdxReaderPtr pr) {
LOGINFO("PdxObject::readObject() for enum Done...");
}
-
-CacheableStringPtr PdxTests::PdxType::toString() const {
+std::shared_ptr<CacheableString> PdxTests::PdxType::toString() const {
char idbuf[1024];
// sprintf(idbuf,"PdxObject: [ m_bool=%d ] [m_byte=%d] [m_int16=%d]
// [m_int32=%d] [m_float=%f] [m_double=%lf] [ m_string=%s ]",m_bool, m_byte,
diff --git a/tests/cpp/testobject/PdxType.hpp b/tests/cpp/testobject/PdxType.hpp
index a2c96ca..3d7afd1 100644
--- a/tests/cpp/testobject/PdxType.hpp
+++ b/tests/cpp/testobject/PdxType.hpp
@@ -27,9 +27,10 @@
*/
#include <geode/PdxSerializable.hpp>
-#include <geode/GeodeCppCache.hpp>
+#include <geode/CacheableEnum.hpp>
#include <geode/PdxWriter.hpp>
#include <geode/PdxReader.hpp>
+#include <geode/CacheableObjectArray.hpp>
#ifdef _WIN32
#ifdef BUILD_TESTOBJECT
@@ -80,7 +81,6 @@ class TESTOBJECT_EXPORT Parent : public GrandParent {
};
class Child;
-typedef std::shared_ptr<Child> ChildPtr;
class TESTOBJECT_EXPORT Child : public Parent, public PdxSerializable {
private:
@@ -99,7 +99,7 @@ class TESTOBJECT_EXPORT Child : public Parent, public PdxSerializable {
int32_t getMember_f() { return m_f; }
- CacheableStringPtr toString() const {
+ std::shared_ptr<CacheableString> toString() const {
char idbuf[512];
sprintf(idbuf, " Child:: %d %d %d %d %d %d ", m_a, m_b, m_c, m_d, m_e, m_f);
return CacheableString::create(idbuf);
@@ -110,7 +110,7 @@ class TESTOBJECT_EXPORT Child : public Parent, public PdxSerializable {
using PdxSerializable::toData;
using PdxSerializable::fromData;
- void toData(PdxWriterPtr pw) {
+ void toData(std::shared_ptr<PdxWriter> pw) {
pw->writeInt("m_a", m_a);
pw->writeInt("m_b", m_b);
pw->writeInt("m_c", m_c);
@@ -119,7 +119,7 @@ class TESTOBJECT_EXPORT Child : public Parent, public PdxSerializable {
pw->writeInt("m_f", m_f);
}
- void fromData(PdxReaderPtr pr) {
+ void fromData(std::shared_ptr<PdxReader> pr) {
m_a = pr->readInt("m_a");
m_b = pr->readInt("m_b");
m_c = pr->readInt("m_c");
@@ -130,7 +130,7 @@ class TESTOBJECT_EXPORT Child : public Parent, public PdxSerializable {
static PdxSerializable* createDeserializable() { return new Child(); }
- bool equals(PdxSerializablePtr obj) {
+ bool equals(std::shared_ptr<PdxSerializable> obj) {
if (obj == nullptr) return false;
auto pap = std::dynamic_pointer_cast<Child>(obj);
@@ -176,7 +176,7 @@ class TESTOBJECT_EXPORT CharTypes : public PdxSerializable {
CharTypes() { init(); }
- CacheableStringPtr toString() const {
+ std::shared_ptr<CacheableString> toString() const {
char idbuf[1024];
sprintf(idbuf, "%c %lc %c %c %lc %lc", m_ch, m_widechar, m_chArray[0],
m_chArray[1], m_widecharArray[0], m_widecharArray[1]);
@@ -226,14 +226,14 @@ class TESTOBJECT_EXPORT CharTypes : public PdxSerializable {
using PdxSerializable::toData;
using PdxSerializable::fromData;
- void toData(PdxWriterPtr pw) {
+ void toData(std::shared_ptr<PdxWriter> pw) {
pw->writeChar("m_ch", m_ch);
pw->writeChar("m_widechar", m_widechar);
pw->writeCharArray("m_chArray", m_chArray, 2);
pw->writeWideCharArray("m_widecharArray", m_widecharArray, 2);
}
- void fromData(PdxReaderPtr pr) {
+ void fromData(std::shared_ptr<PdxReader> pr) {
m_ch = pr->readChar("m_ch");
m_widechar = pr->readWideChar("m_widechar");
m_chArray = pr->readCharArray("m_chArray", m_wcharArrayLen);
@@ -242,7 +242,6 @@ class TESTOBJECT_EXPORT CharTypes : public PdxSerializable {
static PdxSerializable* createDeserializable() { return new CharTypes(); }
};
-typedef std::shared_ptr<CharTypes> CharTypesPtr;
/**********/
class TESTOBJECT_EXPORT Address : public PdxSerializable {
@@ -254,7 +253,7 @@ class TESTOBJECT_EXPORT Address : public PdxSerializable {
public:
Address() {}
- CacheableStringPtr toString() const {
+ std::shared_ptr<CacheableString> toString() const {
char idbuf[1024];
sprintf(idbuf, "%d %s %s", _aptNumber, _street, _city);
return CacheableString::create(idbuf);
@@ -293,13 +292,13 @@ class TESTOBJECT_EXPORT Address : public PdxSerializable {
using PdxSerializable::toData;
using PdxSerializable::fromData;
- void toData(PdxWriterPtr pw) /*const*/ {
+ void toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
pw->writeInt("_aptNumber", _aptNumber); // 4
pw->writeString("_street", _street);
pw->writeString("_city", _city);
}
- void fromData(PdxReaderPtr pr) {
+ void fromData(std::shared_ptr<PdxReader> pr) {
_aptNumber = pr->readInt("_aptNumber");
_street = pr->readString("_street");
_city = pr->readString("_city");
@@ -313,16 +312,16 @@ class TESTOBJECT_EXPORT Address : public PdxSerializable {
const char* getCity() { return _city; }
- /*static AddressPtr create(int32_t aptN, char* street, char* city)
+ /*static std::shared_ptr<Address> create(int32_t aptN, char* street, char*
+ city)
{
- AddressPtr str = nullptr;
+ std::shared_ptr<Address> str = nullptr;
if (value != NULL) {
str = new Address();
}
return str;
}*/
};
-typedef std::shared_ptr<Address> AddressPtr;
enum pdxEnumTest { pdx1, pdx2, pdx3 };
class TESTOBJECT_EXPORT PdxType : public PdxSerializable {
private:
@@ -347,7 +346,7 @@ class TESTOBJECT_EXPORT PdxType : public PdxSerializable {
wchar_t* m_charArray;
- CacheableDatePtr m_date;
+ std::shared_ptr<CacheableDate> m_date;
int16_t* m_int16Array;
int16_t* m_uint16Array;
@@ -364,25 +363,25 @@ class TESTOBJECT_EXPORT PdxType : public PdxSerializable {
int8_t** m_byteByteArray;
char** m_stringArray;
- SerializablePtr m_address;
+ std::shared_ptr<Serializable> m_address;
Address* m_add[10];
- CacheableArrayListPtr m_arraylist;
- CacheableLinkedListPtr m_linkedlist;
- CacheableHashMapPtr m_map;
- CacheableHashTablePtr m_hashtable;
- CacheableVectorPtr m_vector;
+ std::shared_ptr<CacheableArrayList> m_arraylist;
+ std::shared_ptr<CacheableLinkedList> m_linkedlist;
+ std::shared_ptr<CacheableHashMap> m_map;
+ std::shared_ptr<CacheableHashTable> m_hashtable;
+ std::shared_ptr<CacheableVector> m_vector;
- CacheableHashSetPtr m_chs;
- CacheableLinkedHashSetPtr m_clhs;
+ std::shared_ptr<CacheableHashSet> m_chs;
+ std::shared_ptr<CacheableLinkedHashSet> m_clhs;
int8_t* m_byte252;
int8_t* m_byte253;
int8_t* m_byte65535;
int8_t* m_byte65536;
- CacheablePtr m_pdxEnum;
- CacheableObjectArrayPtr m_objectArray;
- CacheableObjectArrayPtr m_objectArrayEmptyPdxFieldName;
+ std::shared_ptr<Cacheable> m_pdxEnum;
+ std::shared_ptr<CacheableObjectArray> m_objectArray;
+ std::shared_ptr<CacheableObjectArray> m_objectArrayEmptyPdxFieldName;
int32_t boolArrayLen;
int32_t charArrayLen;
@@ -531,7 +530,7 @@ class TESTOBJECT_EXPORT PdxType : public PdxSerializable {
m_pdxEnum = CacheableEnum::create("PdxTests.pdxEnumTest", "pdx2", pdx2);
- // AddressPtr* addPtr = NULL;
+ // std::shared_ptr<Address>* addPtr = NULL;
// m_add = new Address[10];
// addPtr[i] = Address::create();
@@ -546,61 +545,51 @@ class TESTOBJECT_EXPORT PdxType : public PdxSerializable {
m_add[8] = new Address(9, "street8", "city8");
m_add[9] = new Address(10, "street9", "city9");
- // m_address = SerializablePtr(m_add);
- // CacheablePtr cacheableObject =
- // CacheableObject::create()create(ptrArr,length);
- /*char key[2048];
- VectorOfCacheableKey keys;
- for (int32_t item = 0; item < 3; item++) {
- sprintf(key, "key-%d", item);
- keys.push_back(CacheableKey::create(key));
- }*/
-
m_objectArray = nullptr;
m_objectArrayEmptyPdxFieldName = nullptr;
- /*AddressPtr objectArray[3];
- objectArray[0] = new Address(1, "strt-1", "city-1");
- objectArray[1] = new Address(2, "strt-2", "city-2");
- objectArray[2] = new Address(3, "strt-3", "city-3");*/
-
- /*
- auto addObj1 = std::make_shared<Address>(1, "abc", "ABC");
- auto addObj2 = std::make_shared<Address>(2, "def", "DEF");
- auto addObj3 = std::make_shared<Address>(3, "ghi", "GHI");*/
m_objectArray = CacheableObjectArray::create();
- m_objectArray->push_back(AddressPtr(new Address(1, "street0", "city0")));
- m_objectArray->push_back(AddressPtr(new Address(2, "street1", "city1")));
- m_objectArray->push_back(AddressPtr(new Address(3, "street2", "city2")));
- m_objectArray->push_back(AddressPtr(new Address(4, "street3", "city3")));
- m_objectArray->push_back(AddressPtr(new Address(5, "street4", "city4")));
- m_objectArray->push_back(AddressPtr(new Address(6, "street5", "city5")));
- m_objectArray->push_back(AddressPtr(new Address(7, "street6", "city6")));
- m_objectArray->push_back(AddressPtr(new Address(8, "street7", "city7")));
- m_objectArray->push_back(AddressPtr(new Address(9, "street8", "city8")));
- m_objectArray->push_back(AddressPtr(new Address(10, "street9", "city9")));
+ m_objectArray->push_back(
+ std::shared_ptr<Address>(new Address(1, "street0", "city0")));
+ m_objectArray->push_back(
+ std::shared_ptr<Address>(new Address(2, "street1", "city1")));
+ m_objectArray->push_back(
+ std::shared_ptr<Address>(new Address(3, "street2", "city2")));
+ m_objectArray->push_back(
+ std::shared_ptr<Address>(new Address(4, "street3", "city3")));
+ m_objectArray->push_back(
+ std::shared_ptr<Address>(new Address(5, "street4", "city4")));
+ m_objectArray->push_back(
+ std::shared_ptr<Address>(new Address(6, "street5", "city5")));
+ m_objectArray->push_back(
+ std::shared_ptr<Address>(new Address(7, "street6", "city6")));
+ m_objectArray->push_back(
+ std::shared_ptr<Address>(new Address(8, "street7", "city7")));
+ m_objectArray->push_back(
+ std::shared_ptr<Address>(new Address(9, "street8", "city8")));
+ m_objectArray->push_back(std::shared_ptr<Address>(new Address(10, "street9", "city9")));
m_objectArrayEmptyPdxFieldName = CacheableObjectArray::create();
m_objectArrayEmptyPdxFieldName->push_back(
- AddressPtr(new Address(1, "street0", "city0")));
+ std::shared_ptr<Address>(new Address(1, "street0", "city0")));
m_objectArrayEmptyPdxFieldName->push_back(
- AddressPtr(new Address(2, "street1", "city1")));
+ std::shared_ptr<Address>(new Address(2, "street1", "city1")));
m_objectArrayEmptyPdxFieldName->push_back(
- AddressPtr(new Address(3, "street2", "city2")));
+ std::shared_ptr<Address>(new Address(3, "street2", "city2")));
m_objectArrayEmptyPdxFieldName->push_back(
- AddressPtr(new Address(4, "street3", "city3")));
+ std::shared_ptr<Address>(new Address(4, "street3", "city3")));
m_objectArrayEmptyPdxFieldName->push_back(
- AddressPtr(new Address(5, "street4", "city4")));
+ std::shared_ptr<Address>(new Address(5, "street4", "city4")));
m_objectArrayEmptyPdxFieldName->push_back(
- AddressPtr(new Address(6, "street5", "city5")));
+ std::shared_ptr<Address>(new Address(6, "street5", "city5")));
m_objectArrayEmptyPdxFieldName->push_back(
- AddressPtr(new Address(7, "street6", "city6")));
+ std::shared_ptr<Address>(new Address(7, "street6", "city6")));
m_objectArrayEmptyPdxFieldName->push_back(
- AddressPtr(new Address(8, "street7", "city7")));
+ std::shared_ptr<Address>(new Address(8, "street7", "city7")));
m_objectArrayEmptyPdxFieldName->push_back(
- AddressPtr(new Address(9, "street8", "city8")));
+ std::shared_ptr<Address>(new Address(9, "street8", "city8")));
m_objectArrayEmptyPdxFieldName->push_back(
- AddressPtr(new Address(10, "street9", "city9")));
+ std::shared_ptr<Address>(new Address(10, "street9", "city9")));
m_byte252 = new int8_t[252];
for (int i = 0; i < 252; i++) {
@@ -672,7 +661,7 @@ class TESTOBJECT_EXPORT PdxType : public PdxSerializable {
bool getBool() { return m_bool; }
- CacheableHashMapPtr getHashMap() { return m_map; }
+ std::shared_ptr<CacheableHashMap> getHashMap() { return m_map; }
int8_t getSByte() { return m_sbyte; }
@@ -698,17 +687,17 @@ class TESTOBJECT_EXPORT PdxType : public PdxSerializable {
int8_t* getSByteArray() { return m_sbyteArray; }
- CacheableHashSetPtr getHashSet() { return m_chs; }
+ std::shared_ptr<CacheableHashSet> getHashSet() { return m_chs; }
- CacheableLinkedHashSetPtr getLinkedHashSet() { return m_clhs; }
+ std::shared_ptr<CacheableLinkedHashSet> getLinkedHashSet() { return m_clhs; }
- CacheableArrayListPtr getArrayList() { return m_arraylist; }
+ std::shared_ptr<CacheableArrayList> getArrayList() { return m_arraylist; }
- CacheableLinkedListPtr getLinkedList() { return m_linkedlist; }
+ std::shared_ptr<CacheableLinkedList> getLinkedList() { return m_linkedlist; }
- CacheableHashTablePtr getHashTable() { return m_hashtable; }
+ std::shared_ptr<CacheableHashTable> getHashTable() { return m_hashtable; }
- CacheableVectorPtr getVector() { return m_vector; }
+ std::shared_ptr<CacheableVector> getVector() { return m_vector; }
int8_t getByte() { return m_byte; }
@@ -740,15 +729,15 @@ class TESTOBJECT_EXPORT PdxType : public PdxSerializable {
char** getStringArray() { return m_stringArray; }
- CacheableDatePtr getDate() { return m_date; }
+ std::shared_ptr<CacheableDate> getDate() { return m_date; }
- CacheableObjectArrayPtr getCacheableObjectArray() { return m_objectArray; }
+ std::shared_ptr<CacheableObjectArray> getCacheableObjectArray() { return m_objectArray; }
- CacheableObjectArrayPtr getCacheableObjectArrayEmptyPdxFieldName() {
+ std::shared_ptr<CacheableObjectArray> getCacheableObjectArrayEmptyPdxFieldName() {
return m_objectArrayEmptyPdxFieldName;
}
- CacheableEnumPtr getEnum() {
+ std::shared_ptr<CacheableEnum> getEnum() {
return std::static_pointer_cast<CacheableEnum>(m_pdxEnum);
}
@@ -775,11 +764,11 @@ class TESTOBJECT_EXPORT PdxType : public PdxSerializable {
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void toData(PdxWriterPtr pw) /*const*/;
+ virtual void toData(std::shared_ptr<PdxWriter> pw) /*const*/;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
const char* getClassName() const { return "PdxTests.PdxType"; }
@@ -797,7 +786,7 @@ class TESTOBJECT_EXPORT PdxType : public PdxSerializable {
bool generic2DCompare(T1** value1, T2** value2, int length,
int* arrLengths) const;
};
-typedef std::shared_ptr<PdxTests::PdxType> PdxTypePtr;
+
} // namespace PdxTests
#endif // GEODE_TESTOBJECT_PDXTYPE_H_
diff --git a/tests/cpp/testobject/PdxVersioned1.cpp b/tests/cpp/testobject/PdxVersioned1.cpp
index 26da186..8f6b29e 100644
--- a/tests/cpp/testobject/PdxVersioned1.cpp
+++ b/tests/cpp/testobject/PdxVersioned1.cpp
@@ -269,7 +269,7 @@ void PdxVersioned1::init(const char* key) {
lengthArr[1] = 2;
}
-void PdxTests::PdxVersioned1::toData(PdxWriterPtr pw) /*const*/ {
+void PdxTests::PdxVersioned1::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
// TODO:delete it later
int* lengthArr = new int[2];
@@ -319,7 +319,7 @@ void PdxTests::PdxVersioned1::toData(PdxWriterPtr pw) /*const*/ {
// TODO:delete it later
}
-void PdxTests::PdxVersioned1::fromData(PdxReaderPtr pr) {
+void PdxTests::PdxVersioned1::fromData(std::shared_ptr<PdxReader> pr) {
// TODO:temp added, delete later
int32_t* Lengtharr;
@@ -371,8 +371,7 @@ void PdxTests::PdxVersioned1::fromData(PdxReaderPtr pr) {
// TODO:Check for size
m_pdxEnum = pr->readObject("m_pdxEnum");
}
-
-CacheableStringPtr PdxTests::PdxVersioned1::toString() const {
+std::shared_ptr<CacheableString> PdxTests::PdxVersioned1::toString() const {
char idbuf[1024];
// sprintf(idbuf,"PdxObject: [ m_bool=%d ] [m_byte=%d] [m_int16=%d]
// [m_int32=%d] [m_float=%f] [m_double=%lf] [ m_string=%s ]",m_bool, m_byte,
diff --git a/tests/cpp/testobject/PdxVersioned1.hpp b/tests/cpp/testobject/PdxVersioned1.hpp
index 7c153c2..7c3633b 100644
--- a/tests/cpp/testobject/PdxVersioned1.hpp
+++ b/tests/cpp/testobject/PdxVersioned1.hpp
@@ -27,7 +27,7 @@
*/
#include <geode/PdxSerializable.hpp>
-#include <geode/GeodeCppCache.hpp>
+#include <geode/CacheableEnum.hpp>
#include <geode/PdxWriter.hpp>
#include <geode/PdxReader.hpp>
#include "fwklib/FwkExport.hpp"
@@ -69,7 +69,7 @@ class TESTOBJECT_EXPORT PdxVersioned1 : public PdxSerializable {
wchar_t* m_charArray;
- CacheableDatePtr m_date;
+ std::shared_ptr<CacheableDate> m_date;
int16_t* m_int16Array;
int16_t* m_uint16Array;
@@ -86,15 +86,15 @@ class TESTOBJECT_EXPORT PdxVersioned1 : public PdxSerializable {
int8_t** m_byteByteArray;
char** m_stringArray;
- CacheableArrayListPtr m_arraylist;
- CacheableHashMapPtr m_map;
+ std::shared_ptr<CacheableArrayList> m_arraylist;
+ std::shared_ptr<CacheableHashMap> m_map;
int8_t* m_byte252;
int8_t* m_byte253;
int8_t* m_byte65535;
int8_t* m_byte65536;
enum pdxEnumTest { pdx1, pdx2, pdx3, pdx4 };
- CacheablePtr m_pdxEnum;
+ std::shared_ptr<Cacheable> m_pdxEnum;
int32_t boolArrayLen;
int32_t charArrayLen;
@@ -141,7 +141,7 @@ class TESTOBJECT_EXPORT PdxVersioned1 : public PdxSerializable {
bool getBool() { return m_bool; }
- CacheableHashMapPtr getHashMap() { return m_map; }
+ std::shared_ptr<CacheableHashMap> getHashMap() { return m_map; }
int8_t getSByte() { return m_sbyte; }
@@ -169,7 +169,7 @@ class TESTOBJECT_EXPORT PdxVersioned1 : public PdxSerializable {
int8_t* getSByteArray() { return m_sbyteArray; }
- CacheableArrayListPtr getArrayList() { return m_arraylist; }
+ std::shared_ptr<CacheableArrayList> getArrayList() { return m_arraylist; }
int8_t getByte() { return m_byte; }
@@ -203,9 +203,9 @@ class TESTOBJECT_EXPORT PdxVersioned1 : public PdxSerializable {
char** getStringArray() { return m_stringArray; }
- CacheableDatePtr getDate() { return m_date; }
+ std::shared_ptr<CacheableDate> getDate() { return m_date; }
- CacheableEnumPtr getEnum() {
+ std::shared_ptr<CacheableEnum> getEnum() {
return std::static_pointer_cast<CacheableEnum>(m_pdxEnum);
}
@@ -232,11 +232,11 @@ class TESTOBJECT_EXPORT PdxVersioned1 : public PdxSerializable {
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void toData(PdxWriterPtr pw) /*const*/;
+ virtual void toData(std::shared_ptr<PdxWriter> pw) /*const*/;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
const char* getClassName() const { return "PdxTests.PdxVersioned"; }
@@ -254,7 +254,7 @@ class TESTOBJECT_EXPORT PdxVersioned1 : public PdxSerializable {
bool generic2DCompare(T1** value1, T2** value2, int length,
int* arrLengths) const;
};
-typedef std::shared_ptr<PdxTests::PdxVersioned1> PdxVersioned1Ptr;
+
} // namespace PdxTests
#endif // GEODE_TESTOBJECT_PDXVERSIONED1_H_
diff --git a/tests/cpp/testobject/PdxVersioned2.cpp b/tests/cpp/testobject/PdxVersioned2.cpp
index c093398..be016a1 100644
--- a/tests/cpp/testobject/PdxVersioned2.cpp
+++ b/tests/cpp/testobject/PdxVersioned2.cpp
@@ -273,7 +273,7 @@ void PdxVersioned2::init(const char* key) {
lengthArr[1] = 2;
}
-void PdxTests::PdxVersioned2::toData(PdxWriterPtr pw) /*const*/ {
+void PdxTests::PdxVersioned2::toData(std::shared_ptr<PdxWriter> pw) /*const*/ {
// TODO:delete it later
int* lengthArr = new int[2];
@@ -326,7 +326,7 @@ void PdxTests::PdxVersioned2::toData(PdxWriterPtr pw) /*const*/ {
// TODO:delete it later
}
-void PdxTests::PdxVersioned2::fromData(PdxReaderPtr pr) {
+void PdxTests::PdxVersioned2::fromData(std::shared_ptr<PdxReader> pr) {
// TODO:temp added, delete later
int32_t* Lengtharr;
@@ -378,8 +378,7 @@ void PdxTests::PdxVersioned2::fromData(PdxReaderPtr pr) {
// TODO:Check for size
m_pdxEnum = pr->readObject("m_pdxEnum");
}
-
-CacheableStringPtr PdxTests::PdxVersioned2::toString() const {
+std::shared_ptr<CacheableString> PdxTests::PdxVersioned2::toString() const {
char idbuf[1024];
// sprintf(idbuf,"PdxObject: [ m_bool=%d ] [m_byte=%d] [m_int16=%d]
// [m_int32=%d] [m_float=%f] [m_double=%lf] [ m_string=%s ]",m_bool, m_byte,
diff --git a/tests/cpp/testobject/PdxVersioned2.hpp b/tests/cpp/testobject/PdxVersioned2.hpp
index 047daee..03432d1 100644
--- a/tests/cpp/testobject/PdxVersioned2.hpp
+++ b/tests/cpp/testobject/PdxVersioned2.hpp
@@ -27,7 +27,7 @@
*/
#include <geode/PdxSerializable.hpp>
-#include <geode/GeodeCppCache.hpp>
+#include <geode/CacheableEnum.hpp>
#include <geode/PdxWriter.hpp>
#include <geode/PdxReader.hpp>
#include "fwklib/FwkExport.hpp"
@@ -69,7 +69,7 @@ class TESTOBJECT_EXPORT PdxVersioned2 : public PdxSerializable {
wchar_t* m_charArray;
- CacheableDatePtr m_date;
+ std::shared_ptr<CacheableDate> m_date;
int16_t* m_int16Array;
int16_t* m_uint16Array;
@@ -86,15 +86,15 @@ class TESTOBJECT_EXPORT PdxVersioned2 : public PdxSerializable {
int8_t** m_byteByteArray;
char** m_stringArray;
- CacheableArrayListPtr m_arraylist;
- CacheableHashMapPtr m_map;
+ std::shared_ptr<CacheableArrayList> m_arraylist;
+ std::shared_ptr<CacheableHashMap> m_map;
int8_t* m_byte252;
int8_t* m_byte253;
int8_t* m_byte65535;
int8_t* m_byte65536;
enum pdxEnumTest { pdx1, pdx2, pdx3, pdx4 };
- CacheablePtr m_pdxEnum;
+ std::shared_ptr<Cacheable> m_pdxEnum;
int32_t boolArrayLen;
int32_t charArrayLen;
@@ -145,7 +145,7 @@ class TESTOBJECT_EXPORT PdxVersioned2 : public PdxSerializable {
bool getBool() { return m_bool; }
- CacheableHashMapPtr getHashMap() { return m_map; }
+ std::shared_ptr<CacheableHashMap> getHashMap() { return m_map; }
int8_t getSByte() { return m_sbyte; }
@@ -171,7 +171,7 @@ class TESTOBJECT_EXPORT PdxVersioned2 : public PdxSerializable {
int8_t* getSByteArray() { return m_sbyteArray; }
- CacheableArrayListPtr getArrayList() { return m_arraylist; }
+ std::shared_ptr<CacheableArrayList> getArrayList() { return m_arraylist; }
int8_t getByte() { return m_byte; }
@@ -203,9 +203,9 @@ class TESTOBJECT_EXPORT PdxVersioned2 : public PdxSerializable {
char** getStringArray() { return m_stringArray; }
- CacheableDatePtr getDate() { return m_date; }
+ std::shared_ptr<CacheableDate> getDate() { return m_date; }
- CacheableEnumPtr getEnum() {
+ std::shared_ptr<CacheableEnum> getEnum() {
return std::static_pointer_cast<CacheableEnum>(m_pdxEnum);
}
@@ -232,11 +232,11 @@ class TESTOBJECT_EXPORT PdxVersioned2 : public PdxSerializable {
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void toData(PdxWriterPtr pw) /*const*/;
+ virtual void toData(std::shared_ptr<PdxWriter> pw) /*const*/;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
const char* getClassName() const { return "PdxTests.PdxVersioned"; }
/*PdxVersioned2(){
@@ -257,7 +257,7 @@ class TESTOBJECT_EXPORT PdxVersioned2 : public PdxSerializable {
bool generic2DCompare(T1** value1, T2** value2, int length,
int* arrLengths) const;
};
-typedef std::shared_ptr<PdxTests::PdxVersioned2> PdxVersioned2Ptr;
+
} // namespace PdxTests
#endif // GEODE_TESTOBJECT_PDXVERSIONED2_H_
diff --git a/tests/cpp/testobject/Portfolio.cpp b/tests/cpp/testobject/Portfolio.cpp
index 3b0c8a3..9f3dc8b 100644
--- a/tests/cpp/testobject/Portfolio.cpp
+++ b/tests/cpp/testobject/Portfolio.cpp
@@ -22,7 +22,8 @@ using namespace testobject;
const char* Portfolio::secIds[] = {"SUN", "IBM", "YHOO", "GOOG", "MSFT",
"AOL", "APPL", "ORCL", "SAP", "DELL"};
-Portfolio::Portfolio(int32_t i, uint32_t size, CacheableStringArrayPtr nm)
+Portfolio::Portfolio(int32_t i, uint32_t size,
+ std::shared_ptr<CacheableStringArray> nm)
: names(nm) {
ID = i;
char pkidbuf[1024];
@@ -97,8 +98,7 @@ void Portfolio::fromData(DataInput& input) {
input.readBytes(&arrayNull, &tmp);
input.readBytes(&arrayZeroSize, &tmp);
}
-
-CacheableStringPtr Portfolio::toString() const {
+std::shared_ptr<CacheableString> Portfolio::toString() const {
char idbuf[1024];
sprintf(idbuf, "PortfolioObject: [ ID=%d", ID);
char pkidbuf[1024];
diff --git a/tests/cpp/testobject/Portfolio.hpp b/tests/cpp/testobject/Portfolio.hpp
index d842e15..518e7ed 100644
--- a/tests/cpp/testobject/Portfolio.hpp
+++ b/tests/cpp/testobject/Portfolio.hpp
@@ -24,7 +24,8 @@
* @brief User class for testing the put functionality for object.
*/
-#include <geode/GeodeCppCache.hpp>
+#include <geode/CacheableBuiltins.hpp>
+#include <geode/CacheableDate.hpp>
#include "Position.hpp"
using namespace apache::geode::client;
@@ -34,21 +35,22 @@ namespace testobject {
class TESTOBJECT_EXPORT Portfolio : public Serializable {
private:
int32_t ID;
- CacheableStringPtr pkid;
- PositionPtr position1;
- PositionPtr position2;
- CacheableHashMapPtr positions;
- CacheableStringPtr type;
+ std::shared_ptr<CacheableString> pkid;
+ std::shared_ptr<Position> position1;
+ std::shared_ptr<Position> position2;
+ std::shared_ptr<CacheableHashMap> positions;
+ std::shared_ptr<CacheableString> type;
char* status;
- CacheableStringArrayPtr names;
+ std::shared_ptr<CacheableStringArray> names;
static const char* secIds[];
uint8_t* newVal;
int32_t newValSize;
- CacheableDatePtr creationDate;
+ std::shared_ptr<CacheableDate> creationDate;
uint8_t* arrayNull;
uint8_t* arrayZeroSize;
- inline uint32_t getObjectSize(const SerializablePtr& obj) const {
+ inline uint32_t getObjectSize(
+ const std::shared_ptr<Serializable>& obj) const {
return (obj == nullptr ? 0 : obj->objectSize());
}
@@ -63,7 +65,7 @@ class TESTOBJECT_EXPORT Portfolio : public Serializable {
arrayNull(NULL),
arrayZeroSize(NULL) {}
Portfolio(int32_t id, uint32_t size = 0,
- CacheableStringArrayPtr nm = nullptr);
+ std::shared_ptr<CacheableStringArray> nm = nullptr);
virtual ~Portfolio();
virtual uint32_t objectSize() const {
@@ -94,13 +96,13 @@ class TESTOBJECT_EXPORT Portfolio : public Serializable {
}
}
- CacheableStringPtr getPkid() { return pkid; }
+ std::shared_ptr<CacheableString> getPkid() { return pkid; }
- PositionPtr getP1() { return position1; }
+ std::shared_ptr<Position> getP1() { return position1; }
- PositionPtr getP2() { return position2; }
+ std::shared_ptr<Position> getP2() { return position2; }
- CacheableHashMapPtr getPositions() { return positions; }
+ std::shared_ptr<CacheableHashMap> getPositions() { return positions; }
bool testMethod(bool booleanArg) { return true; }
@@ -112,9 +114,9 @@ class TESTOBJECT_EXPORT Portfolio : public Serializable {
int32_t getNewValSize() { return newValSize; }
- CacheableStringPtr getType() { return this->type; }
+ std::shared_ptr<CacheableString> getType() { return this->type; }
- CacheableDatePtr getCreationDate() { return creationDate; }
+ std::shared_ptr<CacheableDate> getCreationDate() { return creationDate; }
uint8_t* getArrayNull() { return arrayNull; }
@@ -125,10 +127,9 @@ class TESTOBJECT_EXPORT Portfolio : public Serializable {
virtual void toData(DataOutput& output) const;
virtual void fromData(DataInput& input);
virtual int32_t classId() const { return 0x03; }
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
};
-typedef std::shared_ptr<Portfolio> PortfolioPtr;
} // namespace testobject
#endif // GEODE_TESTOBJECT_PORTFOLIO_H_
diff --git a/tests/cpp/testobject/PortfolioPdx.cpp b/tests/cpp/testobject/PortfolioPdx.cpp
index 8941b4b..f8b1cc0 100644
--- a/tests/cpp/testobject/PortfolioPdx.cpp
+++ b/tests/cpp/testobject/PortfolioPdx.cpp
@@ -94,7 +94,7 @@ PortfolioPdx::~PortfolioPdx() {
}
}
-void PortfolioPdx::toData(PdxWriterPtr pw) {
+void PortfolioPdx::toData(std::shared_ptr<PdxWriter> pw) {
pw->writeInt("ID", id);
pw->markIdentityField("ID");
@@ -129,7 +129,7 @@ void PortfolioPdx::toData(PdxWriterPtr pw) {
pw->writeByteArray("arrayZeroSize", arrayZeroSize, 0);
}
-void PortfolioPdx::fromData(PdxReaderPtr pr) {
+void PortfolioPdx::fromData(std::shared_ptr<PdxReader> pr) {
id = pr->readInt("ID");
pkid = pr->readString("pkid");
@@ -152,8 +152,7 @@ void PortfolioPdx::fromData(PdxReaderPtr pr) {
int32_t arrayZeroSizeLen = 0;
arrayZeroSize = pr->readByteArray("arrayZeroSize", arrayZeroSizeLen);
}
-
-CacheableStringPtr PortfolioPdx::toString() const {
+std::shared_ptr<CacheableString> PortfolioPdx::toString() const {
LOGINFO("PortfolioPdx::toString() Start");
char idbuf[1024];
sprintf(idbuf, "PortfolioPdxObject: [ id=%d ]", id);
diff --git a/tests/cpp/testobject/PortfolioPdx.hpp b/tests/cpp/testobject/PortfolioPdx.hpp
index 75d1483..ff73c37 100644
--- a/tests/cpp/testobject/PortfolioPdx.hpp
+++ b/tests/cpp/testobject/PortfolioPdx.hpp
@@ -36,16 +36,16 @@ class TESTOBJECT_EXPORT PortfolioPdx : public PdxSerializable {
char* pkid;
- PositionPdxPtr position1;
- PositionPdxPtr position2;
- CacheableHashMapPtr positions;
+ std::shared_ptr<PositionPdx> position1;
+ std::shared_ptr<PositionPdx> position2;
+ std::shared_ptr<CacheableHashMap> positions;
char* type;
char* status;
char** names;
static const char* secIds[];
int8_t* newVal;
int32_t newValSize;
- CacheableDatePtr creationDate;
+ std::shared_ptr<CacheableDate> creationDate;
int8_t* arrayNull;
int8_t* arrayZeroSize;
@@ -68,11 +68,11 @@ class TESTOBJECT_EXPORT PortfolioPdx : public PdxSerializable {
char* getPkid() { return pkid; }
- PositionPdxPtr getP1() { return position1; }
+ std::shared_ptr<PositionPdx> getP1() { return position1; }
- PositionPdxPtr getP2() { return position2; }
+ std::shared_ptr<PositionPdx> getP2() { return position2; }
- CacheableHashMapPtr getPositions() { return positions; }
+ std::shared_ptr<CacheableHashMap> getPositions() { return positions; }
bool testMethod(bool booleanArg) { return true; }
@@ -86,7 +86,7 @@ class TESTOBJECT_EXPORT PortfolioPdx : public PdxSerializable {
const char* getClassName() { return this->type; }
- CacheableDatePtr getCreationDate() { return creationDate; }
+ std::shared_ptr<CacheableDate> getCreationDate() { return creationDate; }
int8_t* getArrayNull() { return arrayNull; }
@@ -99,13 +99,12 @@ class TESTOBJECT_EXPORT PortfolioPdx : public PdxSerializable {
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void toData(PdxWriterPtr pw);
- virtual void fromData(PdxReaderPtr pr);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
};
-typedef std::shared_ptr<PortfolioPdx> PortfolioPdxPtr;
} // namespace testobject
#endif // GEODE_TESTOBJECT_PORTFOLIOPDX_H_
diff --git a/tests/cpp/testobject/Position.cpp b/tests/cpp/testobject/Position.cpp
index 3258b07..5d6c0db 100644
--- a/tests/cpp/testobject/Position.cpp
+++ b/tests/cpp/testobject/Position.cpp
@@ -17,6 +17,8 @@
#include "Position.hpp"
#include <cwchar>
#include <wchar.h>
+#include <geode/DataOutput.hpp>
+#include <geode/DataInput.hpp>
using namespace apache::geode::client;
using namespace testobject;
@@ -117,8 +119,7 @@ void Position::fromData(apache::geode::client::DataInput& input) {
volatility = input.readInt64();
pid = input.readInt32();
}
-
-CacheableStringPtr Position::toString() const {
+std::shared_ptr<CacheableString> Position::toString() const {
char buf[2048];
sprintf(buf,
"Position Object:[ secId=%s type=%ls sharesOutstanding=%d id=%d ]",
diff --git a/tests/cpp/testobject/Position.hpp b/tests/cpp/testobject/Position.hpp
index bedbd13..324993c 100644
--- a/tests/cpp/testobject/Position.hpp
+++ b/tests/cpp/testobject/Position.hpp
@@ -24,9 +24,10 @@
* @brief User class for testing the put functionality for object.
*/
-#include <geode/GeodeCppCache.hpp>
#include <string>
+#include <geode/CacheableString.hpp>
+
#ifdef _WIN32
#ifdef BUILD_TESTOBJECT
#define TESTOBJECT_EXPORT LIBEXP
@@ -44,24 +45,25 @@ namespace testobject {
class TESTOBJECT_EXPORT Position : public apache::geode::client::Serializable {
private:
int64_t avg20DaysVol;
- CacheableStringPtr bondRating;
+ std::shared_ptr<CacheableString> bondRating;
double convRatio;
- CacheableStringPtr country;
+ std::shared_ptr<CacheableString> country;
double delta;
int64_t industry;
int64_t issuer;
double mktValue;
double qty;
- CacheableStringPtr secId;
- CacheableStringPtr secLinks;
+ std::shared_ptr<CacheableString> secId;
+ std::shared_ptr<CacheableString> secLinks;
// wchar_t* secType;
wchar_t* secType;
int32_t sharesOutstanding;
- CacheableStringPtr underlyer;
+ std::shared_ptr<CacheableString> underlyer;
int64_t volatility;
int32_t pid;
- inline uint32_t getObjectSize(const SerializablePtr& obj) const {
+ inline uint32_t getObjectSize(
+ const std::shared_ptr<Serializable>& obj) const {
return (obj == nullptr ? 0 : obj->objectSize());
}
@@ -76,7 +78,7 @@ class TESTOBJECT_EXPORT Position : public apache::geode::client::Serializable {
virtual void toData(apache::geode::client::DataOutput& output) const;
virtual void fromData(apache::geode::client::DataInput& input);
virtual int32_t classId() const { return 0x02; }
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
virtual uint32_t objectSize() const {
uint32_t objectSize = sizeof(Position);
@@ -93,7 +95,7 @@ class TESTOBJECT_EXPORT Position : public apache::geode::client::Serializable {
}
static void resetCounter() { cnt = 0; }
- CacheableStringPtr getSecId() { return secId; }
+ std::shared_ptr<CacheableString> getSecId() { return secId; }
int32_t getId() { return pid; }
int32_t getSharesOutstanding() { return sharesOutstanding; }
static apache::geode::client::Serializable* createDeserializable() {
@@ -104,7 +106,6 @@ class TESTOBJECT_EXPORT Position : public apache::geode::client::Serializable {
void init();
};
-typedef std::shared_ptr<Position> PositionPtr;
} // namespace testobject
#endif // GEODE_TESTOBJECT_POSITION_H_
diff --git a/tests/cpp/testobject/PositionPdx.cpp b/tests/cpp/testobject/PositionPdx.cpp
index e69a11c..714a138 100644
--- a/tests/cpp/testobject/PositionPdx.cpp
+++ b/tests/cpp/testobject/PositionPdx.cpp
@@ -96,7 +96,7 @@ void PositionPdx::init() {
pid = 0;
}
-void PositionPdx::toData(PdxWriterPtr pw) {
+void PositionPdx::toData(std::shared_ptr<PdxWriter> pw) {
pw->writeLong("avg20DaysVol", avg20DaysVol);
pw->markIdentityField("avg20DaysVol");
@@ -146,7 +146,7 @@ void PositionPdx::toData(PdxWriterPtr pw) {
pw->markIdentityField("pid");
}
-void PositionPdx::fromData(PdxReaderPtr pr) {
+void PositionPdx::fromData(std::shared_ptr<PdxReader> pr) {
avg20DaysVol = pr->readLong("avg20DaysVol");
bondRating = pr->readString("bondRating");
convRatio = pr->readDouble("convRatio");
@@ -164,8 +164,7 @@ void PositionPdx::fromData(PdxReaderPtr pr) {
volatility = pr->readLong("volatility");
pid = pr->readInt("pid");
}
-
-CacheableStringPtr PositionPdx::toString() const {
+std::shared_ptr<CacheableString> PositionPdx::toString() const {
char buf[1024];
sprintf(buf, "PositionPdx Object:[ id=%d ]", this->pid);
return CacheableString::create(buf);
diff --git a/tests/cpp/testobject/PositionPdx.hpp b/tests/cpp/testobject/PositionPdx.hpp
index bc8e2fd..7ff1709 100644
--- a/tests/cpp/testobject/PositionPdx.hpp
+++ b/tests/cpp/testobject/PositionPdx.hpp
@@ -24,7 +24,6 @@
* @brief User class for testing the put functionality for object.
*/
-#include <geode/GeodeCppCache.hpp>
#include <geode/PdxSerializable.hpp>
#include <geode/PdxWriter.hpp>
#include <geode/PdxReader.hpp>
@@ -75,10 +74,10 @@ class TESTOBJECT_EXPORT PositionPdx
// This constructor is just for some internal data validation test
PositionPdx(int32_t iForExactVal);
virtual ~PositionPdx();
- virtual void toData(PdxWriterPtr pw);
- virtual void fromData(PdxReaderPtr pr);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
virtual uint32_t objectSize() const {
uint32_t objectSize = sizeof(PositionPdx);
@@ -101,7 +100,6 @@ class TESTOBJECT_EXPORT PositionPdx
void init();
};
-typedef std::shared_ptr<PositionPdx> PositionPdxPtr;
} // namespace testobject
#endif // GEODE_TESTOBJECT_POSITIONPDX_H_
diff --git a/tests/cpp/testobject/TestObject1.hpp b/tests/cpp/testobject/TestObject1.hpp
index 85c08f3..f57325f 100644
--- a/tests/cpp/testobject/TestObject1.hpp
+++ b/tests/cpp/testobject/TestObject1.hpp
@@ -20,7 +20,7 @@
#ifndef GEODE_TESTOBJECT_TESTOBJECT1_H_
#define GEODE_TESTOBJECT_TESTOBJECT1_H_
-#include <geode/GeodeCppCache.hpp>
+#include <geode/CacheableBuiltins.hpp>
#include <string>
#ifdef _WIN32
@@ -35,10 +35,11 @@
using namespace apache::geode::client;
namespace testobject {
+
class TESTOBJECT_EXPORT TestObject1 : public Cacheable {
private:
- CacheableStringPtr name;
- CacheableBytesPtr arr;
+ std::shared_ptr<CacheableString> name;
+ std::shared_ptr<CacheableBytes> arr;
int32_t identifier;
public:
@@ -59,7 +60,6 @@ class TESTOBJECT_EXPORT TestObject1 : public Cacheable {
static Serializable* create();
};
-typedef std::shared_ptr<TestObject1> TestObject1Ptr;
} // namespace testobject
#endif // GEODE_TESTOBJECT_TESTOBJECT1_H_
diff --git a/tests/cpp/testobject/TimestampedObject.hpp b/tests/cpp/testobject/TimestampedObject.hpp
index 0cd30ad..e24447a 100644
--- a/tests/cpp/testobject/TimestampedObject.hpp
+++ b/tests/cpp/testobject/TimestampedObject.hpp
@@ -20,8 +20,6 @@
#ifndef GEODE_TESTOBJECT_TIMESTAMPEDOBJECT_H_
#define GEODE_TESTOBJECT_TIMESTAMPEDOBJECT_H_
-#include <geode/GeodeCppCache.hpp>
-
#ifdef _WIN32
#ifdef BUILD_TESTOBJECT
#define TESTOBJECT_EXPORT LIBEXP
@@ -48,7 +46,6 @@ class TESTOBJECT_EXPORT TimestampedObject
virtual uint32_t objectSize() const { return 0; }
virtual ~TimestampedObject() {}
};
-typedef std::shared_ptr<TimestampedObject> TimestampedObjectPtr;
} // namespace testobject
#endif // GEODE_TESTOBJECT_TIMESTAMPEDOBJECT_H_
diff --git a/tests/cpp/testobject/VariousPdxTypes.cpp b/tests/cpp/testobject/VariousPdxTypes.cpp
index c215bba..ab62a47 100644
--- a/tests/cpp/testobject/VariousPdxTypes.cpp
+++ b/tests/cpp/testobject/VariousPdxTypes.cpp
@@ -22,7 +22,7 @@
*/
#include "VariousPdxTypes.hpp"
-
+#include <geode/CacheableEnum.hpp>
namespace PdxTests {
/************************************************************
@@ -42,7 +42,7 @@ PdxTypes1::~PdxTypes1() {
int32_t PdxTypes1::getHashCode() { return 1; }
-bool PdxTypes1::equals(PdxSerializablePtr obj) {
+bool PdxTypes1::equals(std::shared_ptr<PdxSerializable> obj) {
// LOGDEBUG("NIL:PdxTypes1::==::33");
if (obj == nullptr) {
// LOGDEBUG("NIL:PdxTypes1::==::35");
@@ -67,22 +67,21 @@ bool PdxTypes1::equals(PdxSerializablePtr obj) {
LOGDEBUG("NIL:PdxTypes1::==::51");
return false;
}
-
-CacheableStringPtr PdxTypes1::toString() const {
+std::shared_ptr<CacheableString> PdxTypes1::toString() const {
char idbuf[4096];
sprintf(idbuf, "PdxTypes1:[m_i1=%d] [m_i2=%d] [m_i3=%d] [m_i4=%d]", m_i1,
m_i2, m_i3, m_i4);
return CacheableString::create(idbuf);
}
-void PdxTypes1::toData(PdxWriterPtr pw) {
+void PdxTypes1::toData(std::shared_ptr<PdxWriter> pw) {
pw->writeInt("i1", m_i1);
pw->writeInt("i2", m_i2);
pw->writeInt("i3", m_i3);
pw->writeInt("i4", m_i4);
}
-void PdxTypes1::fromData(PdxReaderPtr pr) {
+void PdxTypes1::fromData(std::shared_ptr<PdxReader> pr) {
m_i1 = pr->readInt("i1");
m_i2 = pr->readInt("i2");
m_i3 = pr->readInt("i3");
@@ -106,7 +105,7 @@ PdxTypes2::~PdxTypes2() {
int32_t PdxTypes2::getHashCode() { return 1; }
-bool PdxTypes2::equals(PdxSerializablePtr obj) {
+bool PdxTypes2::equals(std::shared_ptr<PdxSerializable> obj) {
// LOGDEBUG("NIL:96:this::PdxType2 = %s", this->toString());
if (obj == nullptr) return false;
@@ -125,23 +124,22 @@ bool PdxTypes2::equals(PdxSerializablePtr obj) {
return false;
}
+ std::shared_ptr<CacheableString> PdxTypes2::toString() const {
+ char idbuf[4096];
+ sprintf(idbuf, "PdxTypes2:[m_i1=%d] [m_i2=%d] [m_i3=%d] [m_i4=%d] [m_s1=%s]",
+ m_i1, m_i2, m_i3, m_i4, m_s1);
+ return CacheableString::create(idbuf);
+ }
-CacheableStringPtr PdxTypes2::toString() const {
- char idbuf[4096];
- sprintf(idbuf, "PdxTypes2:[m_i1=%d] [m_i2=%d] [m_i3=%d] [m_i4=%d] [m_s1=%s]",
- m_i1, m_i2, m_i3, m_i4, m_s1);
- return CacheableString::create(idbuf);
+ void PdxTypes2::toData(std::shared_ptr<PdxWriter> pw) {
+ pw->writeString("s1", m_s1);
+ pw->writeInt("i1", m_i1);
+ pw->writeInt("i2", m_i2);
+ pw->writeInt("i3", m_i3);
+ pw->writeInt("i4", m_i4);
}
-void PdxTypes2::toData(PdxWriterPtr pw) {
- pw->writeString("s1", m_s1);
- pw->writeInt("i1", m_i1);
- pw->writeInt("i2", m_i2);
- pw->writeInt("i3", m_i3);
- pw->writeInt("i4", m_i4);
-}
-
-void PdxTypes2::fromData(PdxReaderPtr pr) {
+void PdxTypes2::fromData(std::shared_ptr<PdxReader> pr) {
m_s1 = pr->readString("s1");
m_i1 = pr->readInt("i1");
m_i2 = pr->readInt("i2");
@@ -166,7 +164,7 @@ PdxTypes3::~PdxTypes3() {
int32_t PdxTypes3::getHashCode() { return 1; }
-bool PdxTypes3::equals(PdxSerializablePtr obj) {
+bool PdxTypes3::equals(std::shared_ptr<PdxSerializable> obj) {
if (obj == nullptr) return false;
auto pap = std::dynamic_pointer_cast<PdxTypes3>(obj);
@@ -182,15 +180,14 @@ bool PdxTypes3::equals(PdxSerializablePtr obj) {
return false;
}
-
-CacheableStringPtr PdxTypes3::toString() const {
+ std::shared_ptr<CacheableString> PdxTypes3::toString() const {
char idbuf[4096];
sprintf(idbuf, "PdxTypes3:[m_i1=%d] [m_i2=%d] [m_i3=%d] [m_i4=%d] [m_s1=%s]",
m_i1, m_i2, m_i3, m_i4, m_s1);
return CacheableString::create(idbuf);
}
-void PdxTypes3::toData(PdxWriterPtr pw) {
+void PdxTypes3::toData(std::shared_ptr<PdxWriter> pw) {
pw->writeInt("i1", m_i1);
pw->writeInt("i2", m_i2);
pw->writeInt("i3", m_i3);
@@ -198,7 +195,7 @@ void PdxTypes3::toData(PdxWriterPtr pw) {
pw->writeString("s1", m_s1);
}
-void PdxTypes3::fromData(PdxReaderPtr pr) {
+void PdxTypes3::fromData(std::shared_ptr<PdxReader> pr) {
m_i1 = pr->readInt("i1");
m_i2 = pr->readInt("i2");
m_i3 = pr->readInt("i3");
@@ -223,7 +220,7 @@ PdxTypes4::~PdxTypes4() {
int32_t PdxTypes4::getHashCode() { return 1; }
-bool PdxTypes4::equals(PdxSerializablePtr obj) {
+bool PdxTypes4::equals(std::shared_ptr<PdxSerializable> obj) {
if (obj == nullptr) return false;
auto pap = std::dynamic_pointer_cast<PdxTypes4>(obj);
@@ -239,15 +236,14 @@ bool PdxTypes4::equals(PdxSerializablePtr obj) {
return false;
}
-
-CacheableStringPtr PdxTypes4::toString() const {
+ std::shared_ptr<CacheableString> PdxTypes4::toString() const {
char idbuf[4096];
sprintf(idbuf, "PdxTypes4:[m_i1=%d] [m_i2=%d] [m_i3=%d] [m_i4=%d] [m_s1=%s]",
m_i1, m_i2, m_i3, m_i4, m_s1);
return CacheableString::create(idbuf);
}
-void PdxTypes4::toData(PdxWriterPtr pw) {
+void PdxTypes4::toData(std::shared_ptr<PdxWriter> pw) {
pw->writeInt("i1", m_i1);
pw->writeInt("i2", m_i2);
pw->writeString("s1", m_s1);
@@ -255,7 +251,7 @@ void PdxTypes4::toData(PdxWriterPtr pw) {
pw->writeInt("i4", m_i4);
}
-void PdxTypes4::fromData(PdxReaderPtr pr) {
+void PdxTypes4::fromData(std::shared_ptr<PdxReader> pr) {
m_i1 = pr->readInt("i1");
m_i2 = pr->readInt("i2");
m_s1 = pr->readString("s1");
@@ -281,7 +277,7 @@ PdxTypes5::~PdxTypes5() {
int32_t PdxTypes5::getHashCode() { return 1; }
-bool PdxTypes5::equals(PdxSerializablePtr obj) {
+bool PdxTypes5::equals(std::shared_ptr<PdxSerializable> obj) {
if (obj == nullptr) return false;
auto pap = std::dynamic_pointer_cast<PdxTypes5>(obj);
@@ -298,8 +294,7 @@ bool PdxTypes5::equals(PdxSerializablePtr obj) {
return false;
}
-
-CacheableStringPtr PdxTypes5::toString() const {
+ std::shared_ptr<CacheableString> PdxTypes5::toString() const {
char idbuf[4096];
sprintf(
idbuf,
@@ -308,7 +303,7 @@ CacheableStringPtr PdxTypes5::toString() const {
return CacheableString::create(idbuf);
}
-void PdxTypes5::toData(PdxWriterPtr pw) {
+void PdxTypes5::toData(std::shared_ptr<PdxWriter> pw) {
pw->writeString("s1", m_s1);
pw->writeString("s2", m_s2);
pw->writeInt("i1", m_i1);
@@ -317,7 +312,7 @@ void PdxTypes5::toData(PdxWriterPtr pw) {
pw->writeInt("i4", m_i4);
}
-void PdxTypes5::fromData(PdxReaderPtr pr) {
+void PdxTypes5::fromData(std::shared_ptr<PdxReader> pr) {
m_s1 = pr->readString("s1");
m_s2 = pr->readString("s2");
m_i1 = pr->readInt("i1");
@@ -348,7 +343,7 @@ PdxTypes6::~PdxTypes6() {
int32_t PdxTypes6::getHashCode() { return 1; }
-bool PdxTypes6::equals(PdxSerializablePtr obj) {
+bool PdxTypes6::equals(std::shared_ptr<PdxSerializable> obj) {
LOGDEBUG("PdxTypes6::equals -1");
if (obj == nullptr) return false;
@@ -382,8 +377,7 @@ bool PdxTypes6::equals(PdxSerializablePtr obj) {
return false;
}
-
-CacheableStringPtr PdxTypes6::toString() const {
+ std::shared_ptr<CacheableString> PdxTypes6::toString() const {
char idbuf[4096];
sprintf(
idbuf,
@@ -392,7 +386,7 @@ CacheableStringPtr PdxTypes6::toString() const {
return CacheableString::create(idbuf);
}
-void PdxTypes6::toData(PdxWriterPtr pw) {
+void PdxTypes6::toData(std::shared_ptr<PdxWriter> pw) {
pw->writeString("s1", m_s1);
pw->writeInt("i1", m_i1);
pw->writeByteArray("bytes128", bytes128, 2);
@@ -402,7 +396,7 @@ void PdxTypes6::toData(PdxWriterPtr pw) {
pw->writeString("s2", m_s2);
}
-void PdxTypes6::fromData(PdxReaderPtr pr) {
+void PdxTypes6::fromData(std::shared_ptr<PdxReader> pr) {
m_s1 = pr->readString("s1");
// LOGDEBUG("PdxTypes6::fromData m_s1 = %s", m_s1);
@@ -442,7 +436,7 @@ PdxTypes7::~PdxTypes7() {
int32_t PdxTypes7::getHashCode() { return 1; }
-bool PdxTypes7::equals(PdxSerializablePtr obj) {
+bool PdxTypes7::equals(std::shared_ptr<PdxSerializable> obj) {
if (obj == nullptr) return false;
auto pap = std::dynamic_pointer_cast<PdxTypes7>(obj);
@@ -461,35 +455,34 @@ bool PdxTypes7::equals(PdxSerializablePtr obj) {
return false;
}
-
-CacheableStringPtr PdxTypes7::toString() const {
+ std::shared_ptr<CacheableString> PdxTypes7::toString() const {
char idbuf[4096];
sprintf(
idbuf,
"PdxTypes7:[m_i1=%d] [m_i2=%d] [m_i3=%d] [m_i4=%d] [m_s1=%s] [m_s2=%s]",
m_i1, m_i2, m_i3, m_i4, m_s1, m_s2);
return CacheableString::create(idbuf);
-}
-
-void PdxTypes7::toData(PdxWriterPtr pw) {
- pw->writeInt("i1", m_i1);
- pw->writeInt("i2", m_i2);
- pw->writeString("s1", m_s1);
- pw->writeByteArray("bytes38000", bytes38000, 2);
- pw->writeInt("i3", m_i3);
- pw->writeInt("i4", m_i4);
- pw->writeString("s2", m_s2);
-}
-
-void PdxTypes7::fromData(PdxReaderPtr pr) {
- m_i1 = pr->readInt("i1");
- m_i2 = pr->readInt("i2");
- m_s1 = pr->readString("s1");
- int32_t byteArrLen = 0;
- bytes38000 = pr->readByteArray("bytes38000", byteArrLen);
- m_i3 = pr->readInt("i3");
- m_i4 = pr->readInt("i4");
- m_s2 = pr->readString("s2");
+ }
+
+ void PdxTypes7::toData(std::shared_ptr<PdxWriter> pw) {
+ pw->writeInt("i1", m_i1);
+ pw->writeInt("i2", m_i2);
+ pw->writeString("s1", m_s1);
+ pw->writeByteArray("bytes38000", bytes38000, 2);
+ pw->writeInt("i3", m_i3);
+ pw->writeInt("i4", m_i4);
+ pw->writeString("s2", m_s2);
+ }
+
+ void PdxTypes7::fromData(std::shared_ptr<PdxReader> pr) {
+ m_i1 = pr->readInt("i1");
+ m_i2 = pr->readInt("i2");
+ m_s1 = pr->readString("s1");
+ int32_t byteArrLen = 0;
+ bytes38000 = pr->readByteArray("bytes38000", byteArrLen);
+ m_i3 = pr->readInt("i3");
+ m_i4 = pr->readInt("i4");
+ m_s2 = pr->readString("s2");
}
/************************************************************
@@ -511,7 +504,7 @@ PdxTypes8::~PdxTypes8() { delete[] bytes300; }
int32_t PdxTypes8::getHashCode() { return 1; }
-bool PdxTypes8::equals(PdxSerializablePtr obj) {
+bool PdxTypes8::equals(std::shared_ptr<PdxSerializable> obj) {
if (obj == nullptr) return false;
auto pap = std::dynamic_pointer_cast<PdxTypes8>(obj);
@@ -530,37 +523,36 @@ bool PdxTypes8::equals(PdxSerializablePtr obj) {
return false;
}
-
-CacheableStringPtr PdxTypes8::toString() const {
+ std::shared_ptr<CacheableString> PdxTypes8::toString() const {
char idbuf[4096];
sprintf(
idbuf,
"PdxTypes8:[m_i1=%d] [m_i2=%d] [m_i3=%d] [m_i4=%d] [m_s1=%s] [m_s2=%s]",
m_i1, m_i2, m_i3, m_i4, m_s1, m_s2);
return CacheableString::create(idbuf);
-}
-
-void PdxTypes8::toData(PdxWriterPtr pw) {
- pw->writeInt("i1", m_i1);
- pw->writeInt("i2", m_i2);
- pw->writeString("s1", m_s1);
- pw->writeByteArray("bytes300", bytes300, 2);
- pw->writeObject("_enum", _enum);
- pw->writeString("s2", m_s2);
- pw->writeInt("i3", m_i3);
- pw->writeInt("i4", m_i4);
-}
-
-void PdxTypes8::fromData(PdxReaderPtr pr) {
- m_i1 = pr->readInt("i1");
- m_i2 = pr->readInt("i2");
- m_s1 = pr->readString("s1");
- int32_t byteArrLen = 0;
- bytes300 = pr->readByteArray("bytes300", byteArrLen);
- _enum = pr->readObject("_enum");
- m_s2 = pr->readString("s2");
- m_i3 = pr->readInt("i3");
- m_i4 = pr->readInt("i4");
+ }
+
+ void PdxTypes8::toData(std::shared_ptr<PdxWriter> pw) {
+ pw->writeInt("i1", m_i1);
+ pw->writeInt("i2", m_i2);
+ pw->writeString("s1", m_s1);
+ pw->writeByteArray("bytes300", bytes300, 2);
+ pw->writeObject("_enum", _enum);
+ pw->writeString("s2", m_s2);
+ pw->writeInt("i3", m_i3);
+ pw->writeInt("i4", m_i4);
+ }
+
+ void PdxTypes8::fromData(std::shared_ptr<PdxReader> pr) {
+ m_i1 = pr->readInt("i1");
+ m_i2 = pr->readInt("i2");
+ m_s1 = pr->readString("s1");
+ int32_t byteArrLen = 0;
+ bytes300 = pr->readByteArray("bytes300", byteArrLen);
+ _enum = pr->readObject("_enum");
+ m_s2 = pr->readString("s2");
+ m_i3 = pr->readInt("i3");
+ m_i4 = pr->readInt("i4");
}
/************************************************************
@@ -579,7 +571,7 @@ PdxTypes9::~PdxTypes9() { delete[] m_bytes66000; }
int32_t PdxTypes9::getHashCode() { return 1; }
-bool PdxTypes9::equals(PdxSerializablePtr obj) {
+bool PdxTypes9::equals(std::shared_ptr<PdxSerializable> obj) {
if (obj == nullptr) return false;
auto pap = std::dynamic_pointer_cast<PdxTypes9>(obj);
@@ -598,15 +590,14 @@ bool PdxTypes9::equals(PdxSerializablePtr obj) {
return false;
}
-
-CacheableStringPtr PdxTypes9::toString() const {
+ std::shared_ptr<CacheableString> PdxTypes9::toString() const {
char idbuf[4096];
sprintf(idbuf, "PdxTypes9:[m_s1=%s] [m_s2=%s] [m_s3=%s] [m_s4=%s] [m_s5=%s] ",
m_s1, m_s2, m_s3, m_s4, m_s5);
return CacheableString::create(idbuf);
}
-void PdxTypes9::toData(PdxWriterPtr pw) {
+void PdxTypes9::toData(std::shared_ptr<PdxWriter> pw) {
pw->writeString("s1", m_s1);
pw->writeString("s2", m_s2);
pw->writeByteArray("bytes66000", m_bytes66000, 2);
@@ -615,7 +606,7 @@ void PdxTypes9::toData(PdxWriterPtr pw) {
pw->writeString("s5", m_s5);
}
-void PdxTypes9::fromData(PdxReaderPtr pr) {
+void PdxTypes9::fromData(std::shared_ptr<PdxReader> pr) {
m_s1 = pr->readString("s1");
m_s2 = pr->readString("s2");
int32_t byteArrLen = 0;
@@ -641,7 +632,7 @@ PdxTypes10::~PdxTypes10() { delete[] m_bytes66000; }
int32_t PdxTypes10::getHashCode() { return 1; }
-bool PdxTypes10::equals(PdxSerializablePtr obj) {
+bool PdxTypes10::equals(std::shared_ptr<PdxSerializable> obj) {
if (obj == nullptr) return false;
auto pap = std::dynamic_pointer_cast<PdxTypes10>(obj);
@@ -660,15 +651,14 @@ bool PdxTypes10::equals(PdxSerializablePtr obj) {
return false;
}
-
-CacheableStringPtr PdxTypes10::toString() const {
+ std::shared_ptr<CacheableString> PdxTypes10::toString() const {
char idbuf[4096];
sprintf(idbuf, "PdxTypes9:[m_s1=%s] [m_s2=%s] [m_s3=%s] [m_s4=%s] [m_s5=%s] ",
m_s1, m_s2, m_s3, m_s4, m_s5);
return CacheableString::create(idbuf);
}
-void PdxTypes10::toData(PdxWriterPtr pw) {
+void PdxTypes10::toData(std::shared_ptr<PdxWriter> pw) {
pw->writeString("s1", m_s1);
pw->writeString("s2", m_s2);
pw->writeByteArray("bytes66000", m_bytes66000, 2);
@@ -677,7 +667,7 @@ void PdxTypes10::toData(PdxWriterPtr pw) {
pw->writeString("s5", m_s5);
}
-void PdxTypes10::fromData(PdxReaderPtr pr) {
+void PdxTypes10::fromData(std::shared_ptr<PdxReader> pr) {
m_s1 = pr->readString("s1");
m_s2 = pr->readString("s2");
int32_t byteArrLen = 0;
@@ -721,7 +711,7 @@ NestedPdx::~NestedPdx() {
int32_t NestedPdx::getHashCode() { return 1; }
-bool NestedPdx::equals(PdxSerializablePtr obj) {
+bool NestedPdx::equals(std::shared_ptr<PdxSerializable> obj) {
if (obj == nullptr) return false;
auto pap = std::dynamic_pointer_cast<NestedPdx>(obj);
@@ -739,8 +729,7 @@ bool NestedPdx::equals(PdxSerializablePtr obj) {
return false;
}
-
-CacheableStringPtr NestedPdx::toString() const {
+ std::shared_ptr<CacheableString> NestedPdx::toString() const {
char idbuf[4096];
sprintf(
idbuf,
@@ -749,7 +738,7 @@ CacheableStringPtr NestedPdx::toString() const {
return CacheableString::create(idbuf);
}
-void NestedPdx::toData(PdxWriterPtr pw) {
+void NestedPdx::toData(std::shared_ptr<PdxWriter> pw) {
pw->writeInt("i1", m_i1);
pw->writeObject("pd1", m_pd1);
pw->writeInt("i2", m_i2);
@@ -760,7 +749,7 @@ void NestedPdx::toData(PdxWriterPtr pw) {
pw->writeInt("i4", m_i4);
}
-void NestedPdx::fromData(PdxReaderPtr pr) {
+void NestedPdx::fromData(std::shared_ptr<PdxReader> pr) {
m_i1 = pr->readInt("i1");
m_pd1 = std::static_pointer_cast<PdxTypes1>(pr->readObject("pd1"));
m_i2 = pr->readInt("i2");
@@ -807,7 +796,7 @@ MixedVersionNestedPdx::~MixedVersionNestedPdx() {
int32_t MixedVersionNestedPdx::getHashCode() { return 1; }
-bool MixedVersionNestedPdx::equals(PdxSerializablePtr obj) {
+bool MixedVersionNestedPdx::equals(std::shared_ptr<PdxSerializable> obj) {
if (obj == nullptr) return false;
auto pap = std::dynamic_pointer_cast<MixedVersionNestedPdx>(obj);
@@ -825,8 +814,7 @@ bool MixedVersionNestedPdx::equals(PdxSerializablePtr obj) {
return false;
}
-
-CacheableStringPtr MixedVersionNestedPdx::toString() const {
+ std::shared_ptr<CacheableString> MixedVersionNestedPdx::toString() const {
char idbuf[4096];
sprintf(idbuf,
"MixedVersionNestedPdx:[m_i1=%d] [m_i2=%d] [m_i3=%d] [m_i4=%d] "
@@ -835,7 +823,7 @@ CacheableStringPtr MixedVersionNestedPdx::toString() const {
return CacheableString::create(idbuf);
}
-void MixedVersionNestedPdx::toData(PdxWriterPtr pw) {
+void MixedVersionNestedPdx::toData(std::shared_ptr<PdxWriter> pw) {
pw->writeInt("i1", m_i1);
pw->writeObject("pd1", m_pd1);
pw->writeInt("i2", m_i2);
@@ -847,7 +835,7 @@ void MixedVersionNestedPdx::toData(PdxWriterPtr pw) {
pw->writeInt("i4", m_i4);
}
-void MixedVersionNestedPdx::fromData(PdxReaderPtr pr) {
+void MixedVersionNestedPdx::fromData(std::shared_ptr<PdxReader> pr) {
m_i1 = pr->readInt("i1");
m_pd1 = std::static_pointer_cast<PdxTypes1>(pr->readObject("pd1"));
m_i2 = pr->readInt("i2");
@@ -879,7 +867,7 @@ PdxInsideIGeodeSerializable::~PdxInsideIGeodeSerializable() {
int32_t PdxInsideIGeodeSerializable::getHashCode() { return 1; }
-bool PdxInsideIGeodeSerializable::equals(SerializablePtr obj) {
+bool PdxInsideIGeodeSerializable::equals(std::shared_ptr<Serializable> obj) {
if (obj == nullptr) return false;
auto pap = std::dynamic_pointer_cast<PdxInsideIGeodeSerializable>(obj);
@@ -896,8 +884,7 @@ bool PdxInsideIGeodeSerializable::equals(SerializablePtr obj) {
return false;
}
-
-CacheableStringPtr PdxInsideIGeodeSerializable::toString() const {
+ std::shared_ptr<CacheableString> PdxInsideIGeodeSerializable::toString() const {
char idbuf[4096];
sprintf(idbuf,
"PdxInsideIGeodeSerializable:[m_i1=%d] [m_i2=%d] [m_i3=%d] [m_i4=%d] "
diff --git a/tests/cpp/testobject/VariousPdxTypes.hpp b/tests/cpp/testobject/VariousPdxTypes.hpp
index 0e313ce..27a98f8 100644
--- a/tests/cpp/testobject/VariousPdxTypes.hpp
+++ b/tests/cpp/testobject/VariousPdxTypes.hpp
@@ -21,7 +21,6 @@
#define GEODE_TESTOBJECT_VARIOUSPDXTYPES_H_
#include <geode/PdxSerializable.hpp>
-#include <geode/GeodeCppCache.hpp>
#include <geode/PdxWriter.hpp>
#include <geode/PdxReader.hpp>
@@ -56,22 +55,21 @@ class TESTOBJECT_EXPORT PdxTypes1 : public PdxSerializable {
int32_t getHashCode();
- bool equals(PdxSerializablePtr obj);
+ bool equals(std::shared_ptr<PdxSerializable> obj);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
const char* getClassName() const { return "PdxTests.PdxTypes1"; }
int32_t getm_i1() { return m_i1; }
static PdxSerializable* createDeserializable() { return new PdxTypes1(); }
};
-typedef std::shared_ptr<PdxTypes1> PdxTypes1Ptr;
/************************************************************
* PdxTypes2
@@ -92,22 +90,21 @@ class TESTOBJECT_EXPORT PdxTypes2 : public PdxSerializable {
int32_t getHashCode();
- bool equals(PdxSerializablePtr obj);
+ bool equals(std::shared_ptr<PdxSerializable> obj);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
const char* getClassName() const { return "PdxTests.PdxTypes2"; }
static PdxSerializable* createDeserializable() { return new PdxTypes2(); }
};
-typedef std::shared_ptr<PdxTypes2> PdxTypes2Ptr;
/************************************************************
* PdxTypes3
@@ -128,22 +125,21 @@ class TESTOBJECT_EXPORT PdxTypes3 : public PdxSerializable {
int32_t getHashCode();
- bool equals(PdxSerializablePtr obj);
+ bool equals(std::shared_ptr<PdxSerializable> obj);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
const char* getClassName() const { return "PdxTests.PdxTypes3"; }
static PdxSerializable* createDeserializable() { return new PdxTypes3(); }
};
-typedef std::shared_ptr<PdxTypes3> PdxTypes3Ptr;
/************************************************************
* PdxTypes4
@@ -163,22 +159,21 @@ class TESTOBJECT_EXPORT PdxTypes4 : public PdxSerializable {
int32_t getHashCode();
- bool equals(PdxSerializablePtr obj);
+ bool equals(std::shared_ptr<PdxSerializable> obj);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
const char* getClassName() const { return "PdxTests.PdxTypes4"; }
static PdxSerializable* createDeserializable() { return new PdxTypes4(); }
};
-typedef std::shared_ptr<PdxTypes4> PdxTypes4Ptr;
/************************************************************
* PdxTypes5
@@ -199,22 +194,21 @@ class TESTOBJECT_EXPORT PdxTypes5 : public PdxSerializable {
int32_t getHashCode();
- bool equals(PdxSerializablePtr obj);
+ bool equals(std::shared_ptr<PdxSerializable> obj);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
const char* getClassName() const { return "PdxTests.PdxTypes5"; }
static PdxSerializable* createDeserializable() { return new PdxTypes5(); }
};
-typedef std::shared_ptr<PdxTypes5> PdxTypes5Ptr;
/************************************************************
* PdxTypes6
@@ -236,22 +230,21 @@ class TESTOBJECT_EXPORT PdxTypes6 : public PdxSerializable {
int32_t getHashCode();
- bool equals(PdxSerializablePtr obj);
+ bool equals(std::shared_ptr<PdxSerializable> obj);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
const char* getClassName() const { return "PdxTests.PdxTypes6"; }
static PdxSerializable* createDeserializable() { return new PdxTypes6(); }
};
-typedef std::shared_ptr<PdxTypes6> PdxTypes6Ptr;
/************************************************************
* PdxTypes7
@@ -273,22 +266,21 @@ class TESTOBJECT_EXPORT PdxTypes7 : public PdxSerializable {
int32_t getHashCode();
- bool equals(PdxSerializablePtr obj);
+ bool equals(std::shared_ptr<PdxSerializable> obj);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
const char* getClassName() const { return "PdxTests.PdxTypes7"; }
static PdxSerializable* createDeserializable() { return new PdxTypes7(); }
};
-typedef std::shared_ptr<PdxTypes7> PdxTypes7Ptr;
/************************************************************
* PdxTypes8
@@ -300,7 +292,7 @@ class TESTOBJECT_EXPORT PdxTypes8 : public PdxSerializable {
char* m_s2;
int32_t m_i1;
int8_t* bytes300;
- CacheablePtr _enum;
+ std::shared_ptr<Cacheable> _enum;
int32_t m_i2;
int32_t m_i3;
int32_t m_i4;
@@ -312,22 +304,21 @@ class TESTOBJECT_EXPORT PdxTypes8 : public PdxSerializable {
int32_t getHashCode();
- bool equals(PdxSerializablePtr obj);
+ bool equals(std::shared_ptr<PdxSerializable> obj);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
const char* getClassName() const { return "PdxTests.PdxTypes8"; }
static PdxSerializable* createDeserializable() { return new PdxTypes8(); }
};
-typedef std::shared_ptr<PdxTypes8> PdxTypes8Ptr;
/************************************************************
* PdxTypes9
@@ -348,22 +339,21 @@ class TESTOBJECT_EXPORT PdxTypes9 : public PdxSerializable {
int32_t getHashCode();
- bool equals(PdxSerializablePtr obj);
+ bool equals(std::shared_ptr<PdxSerializable> obj);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
const char* getClassName() const { return "PdxTests.PdxTypes9"; }
static PdxSerializable* createDeserializable() { return new PdxTypes9(); }
};
-typedef std::shared_ptr<PdxTypes9> PdxTypes9Ptr;
/************************************************************
* PdxTypes10
@@ -385,22 +375,21 @@ class TESTOBJECT_EXPORT PdxTypes10 : public PdxSerializable {
int32_t getHashCode();
- bool equals(PdxSerializablePtr obj);
+ bool equals(std::shared_ptr<PdxSerializable> obj);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
const char* getClassName() const { return "PdxTests.PdxTypes10"; }
static PdxSerializable* createDeserializable() { return new PdxTypes10(); }
};
-typedef std::shared_ptr<PdxTypes10> PdxTypes10Ptr;
/************************************************************
* NestedPdx
@@ -408,8 +397,8 @@ typedef std::shared_ptr<PdxTypes10> PdxTypes10Ptr;
class TESTOBJECT_EXPORT NestedPdx : public PdxSerializable {
private:
- PdxTypes1Ptr m_pd1;
- PdxTypes2Ptr m_pd2;
+ std::shared_ptr<PdxTypes1> m_pd1;
+ std::shared_ptr<PdxTypes2> m_pd2;
char* m_s1; //"one"
char* m_s2;
int32_t m_i1;
@@ -425,23 +414,22 @@ class TESTOBJECT_EXPORT NestedPdx : public PdxSerializable {
int32_t getHashCode();
- bool equals(PdxSerializablePtr obj);
+ bool equals(std::shared_ptr<PdxSerializable> obj);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
const char* getClassName() const { return "PdxTests::NestedPdx"; }
const char* getString() { return m_s1; }
static PdxSerializable* createDeserializable() { return new NestedPdx(); }
};
-typedef std::shared_ptr<NestedPdx> NestedPdxPtr;
/************************************************************
* Mixed Version NestedPdx
@@ -449,8 +437,8 @@ typedef std::shared_ptr<NestedPdx> NestedPdxPtr;
class TESTOBJECT_EXPORT MixedVersionNestedPdx : public PdxSerializable {
private:
- PdxTypes1Ptr m_pd1;
- PdxTypes2Ptr m_pd2;
+ std::shared_ptr<PdxTypes1> m_pd1;
+ std::shared_ptr<PdxTypes2> m_pd2;
char* m_s1; //"one"
char* m_s2;
char* m_s3;
@@ -467,16 +455,16 @@ class TESTOBJECT_EXPORT MixedVersionNestedPdx : public PdxSerializable {
int32_t getHashCode();
- bool equals(PdxSerializablePtr obj);
+ bool equals(std::shared_ptr<PdxSerializable> obj);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
using PdxSerializable::toData;
using PdxSerializable::fromData;
- virtual void fromData(PdxReaderPtr pr);
+ virtual void fromData(std::shared_ptr<PdxReader> pr);
- virtual void toData(PdxWriterPtr pw);
+ virtual void toData(std::shared_ptr<PdxWriter> pw);
const char* getClassName() const { return "PdxTests::MixedVersionNestedPdx"; }
const char* getString() { return m_s1; }
@@ -485,7 +473,6 @@ class TESTOBJECT_EXPORT MixedVersionNestedPdx : public PdxSerializable {
return new MixedVersionNestedPdx();
}
};
-typedef std::shared_ptr<MixedVersionNestedPdx> MixedVersionNestedPdxPtr;
/************************************************************
* PdxInsideIGeodeSerializable
@@ -493,8 +480,8 @@ typedef std::shared_ptr<MixedVersionNestedPdx> MixedVersionNestedPdxPtr;
class TESTOBJECT_EXPORT PdxInsideIGeodeSerializable : public Serializable {
private:
- NestedPdxPtr m_npdx;
- PdxTypes3Ptr m_pdx3;
+ std::shared_ptr<NestedPdx> m_npdx;
+ std::shared_ptr<PdxTypes3> m_pdx3;
char* m_s1; //"one"
char* m_s2;
@@ -510,9 +497,9 @@ class TESTOBJECT_EXPORT PdxInsideIGeodeSerializable : public Serializable {
int32_t getHashCode();
- bool equals(SerializablePtr obj);
+ bool equals(std::shared_ptr<Serializable> obj);
- CacheableStringPtr toString() const;
+ std::shared_ptr<CacheableString> toString() const;
virtual void fromData(DataInput& input);
@@ -528,8 +515,7 @@ class TESTOBJECT_EXPORT PdxInsideIGeodeSerializable : public Serializable {
return new PdxInsideIGeodeSerializable();
}
};
-typedef std::shared_ptr<PdxInsideIGeodeSerializable>
- PdxInsideIGeodeSerializablePtr;
+
} /* namespace PdxTests */
--
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <co...@geode.apache.org>'].