geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbarr...@apache.org
Subject [26/31] geode-native git commit: GEODE-2476: Replace gfcpp with geode.
Date Tue, 21 Feb 2017 17:40:39 GMT
http://git-wip-us.apache.org/repos/asf/geode-native/blob/fd58b100/src/cppcache/include/geode/ExceptionTypes.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/ExceptionTypes.hpp b/src/cppcache/include/geode/ExceptionTypes.hpp
new file mode 100644
index 0000000..a4ad190
--- /dev/null
+++ b/src/cppcache/include/geode/ExceptionTypes.hpp
@@ -0,0 +1,413 @@
+#pragma once
+
+#ifndef GEODE_EXCEPTIONTYPES_H_
+#define GEODE_EXCEPTIONTYPES_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 "Exception.hpp"
+
+namespace apache {
+namespace geode {
+namespace client {
+
+#define _GF_EXCEPTION_DEF(x)                                              \
+  const char _exception_name_##x[] = "apache::geode::client::" #x;        \
+  class x;                                                                \
+  typedef SharedPtr<x> x##Ptr;                                            \
+  class CPPCACHE_EXPORT x : public apache::geode::client::Exception {     \
+   public:                                                                \
+    x(const char* msg1, const char* msg2 = NULL, bool forceStack = false, \
+      const ExceptionPtr& cause = NULLPTR)                                \
+        : Exception(msg1, msg2, forceStack, cause) {}                     \
+    x(const x& other) : Exception(other) {}                               \
+    virtual Exception* clone() const {                                    \
+      return new x(m_message, m_stack, m_cause);                          \
+    }                                                                     \
+    virtual ~x() {}                                                       \
+    virtual const char* getName() const { return _exception_name_##x; }   \
+    virtual void raise() { throw * this; }                                \
+                                                                          \
+   protected:                                                             \
+    x(const CacheableStringPtr& message, const StackTracePtr& stack,      \
+      const ExceptionPtr& cause)                                          \
+        : Exception(message, stack, cause) {}                             \
+                                                                          \
+   private:                                                               \
+    const x& operator=(const x&);                                         \
+  }
+
+/*
+ *
+ * This is the list of exceptions directly derived from
+ * apache::geode::client::Exception.
+ *
+ */
+
+/**
+ *@brief A geode assertion exception.
+ **/
+_GF_EXCEPTION_DEF(AssertionException);
+
+/**
+ *@brief Thrown when an argument to a method is illegal.
+ **/
+_GF_EXCEPTION_DEF(IllegalArgumentException);
+
+/**
+ *@brief Thrown when the state of cache is manipulated to be illegal.
+ **/
+_GF_EXCEPTION_DEF(IllegalStateException);
+
+/**
+ *@brief Thrown when an attempt is made to create an existing cache.
+ **/
+_GF_EXCEPTION_DEF(CacheExistsException);
+
+/**
+ *@brief Thrown when the cache xml is incorrect.
+ **/
+_GF_EXCEPTION_DEF(CacheXmlException);
+/**
+ *@brief Thrown when a timout occurs.
+ **/
+_GF_EXCEPTION_DEF(TimeoutException);
+
+/**
+ *@brief Thrown when the cache writer aborts the operation.
+ **/
+_GF_EXCEPTION_DEF(CacheWriterException);
+
+/**
+ *@brief Thrown when an attempt is made to create an existing region.
+ **/
+_GF_EXCEPTION_DEF(RegionExistsException);
+
+/**
+ *@brief Thrown when an operation is attempted on a closed cache.
+ **/
+_GF_EXCEPTION_DEF(CacheClosedException);
+
+/**
+ *@brief Thrown when lease of cache proxy has expired.
+ **/
+_GF_EXCEPTION_DEF(LeaseExpiredException);
+
+/**
+ *@brief Thrown when the cache loader aborts the operation.
+ **/
+_GF_EXCEPTION_DEF(CacheLoaderException);
+
+/**
+ *@brief Thrown when an operation is attempted on a destroyed region.
+ **/
+_GF_EXCEPTION_DEF(RegionDestroyedException);
+
+/**
+ *@brief Thrown when an operation is attempted on a destroyed entry.
+ **/
+_GF_EXCEPTION_DEF(EntryDestroyedException);
+
+/**
+ *@brief Thrown when the connecting target is not running.
+ **/
+_GF_EXCEPTION_DEF(NoSystemException);
+
+/**
+ *@brief Thrown when an attempt is made to connect to
+ *       DistributedSystem second time.
+ **/
+_GF_EXCEPTION_DEF(AlreadyConnectedException);
+
+/**
+ *@brief Thrown when a non-existing file is accessed.
+ **/
+_GF_EXCEPTION_DEF(FileNotFoundException);
+
+/**
+ *@brief Thrown when an operation is interrupted.
+ **/
+_GF_EXCEPTION_DEF(InterruptedException);
+
+/**
+ *@brief Thrown when an operation unsupported by the
+ *       current configuration is attempted.
+ **/
+_GF_EXCEPTION_DEF(UnsupportedOperationException);
+
+/**
+ *@brief Thrown when statistics are invoked for a region where
+ *       they are disabled.
+ **/
+_GF_EXCEPTION_DEF(StatisticsDisabledException);
+
+/**
+ *@brief Thrown when a concurrent operation fails.
+ **/
+_GF_EXCEPTION_DEF(ConcurrentModificationException);
+
+/**
+ *@brief An unknown exception occurred.
+ **/
+_GF_EXCEPTION_DEF(UnknownException);
+
+/**
+ *@brief Thrown when a cast operation fails.
+ **/
+_GF_EXCEPTION_DEF(ClassCastException);
+
+/**
+ *@brief Thrown when an operation is attempted on a non-existent entry.
+ **/
+_GF_EXCEPTION_DEF(EntryNotFoundException);
+
+/**
+ *@brief Thrown when there is an input/output error.
+ **/
+_GF_EXCEPTION_DEF(GeodeIOException);
+
+/**
+ *@brief Thrown when geode configuration file is incorrect.
+ **/
+_GF_EXCEPTION_DEF(GeodeConfigException);
+
+/**
+ *@brief Thrown when a null argument is provided to a method
+ *       where it is expected to be non-null.
+ **/
+_GF_EXCEPTION_DEF(NullPointerException);
+
+/**
+ *@brief Thrown when attempt is made to create an existing entry.
+ **/
+_GF_EXCEPTION_DEF(EntryExistsException);
+
+/**
+ *@brief Thrown when an operation is attempted before connecting
+ *       to the distributed system.
+ **/
+_GF_EXCEPTION_DEF(NotConnectedException);
+
+/**
+ *@brief Thrown when there is an error in the cache proxy.
+ **/
+_GF_EXCEPTION_DEF(CacheProxyException);
+
+/**
+ *@brief Thrown when the system cannot allocate any more memory.
+ **/
+_GF_EXCEPTION_DEF(OutOfMemoryException);
+
+/**
+ *@brief Thrown when an attempt is made to release a lock not
+ *       owned by the thread.
+ **/
+_GF_EXCEPTION_DEF(NotOwnerException);
+
+/**
+ *@brief Thrown when a region is created in an incorrect scope.
+ **/
+_GF_EXCEPTION_DEF(WrongRegionScopeException);
+
+/**
+ *@brief Thrown when the internal buffer size is exceeded.
+ **/
+_GF_EXCEPTION_DEF(BufferSizeExceededException);
+
+/**
+ *@brief Thrown when a region creation operation fails.
+ **/
+_GF_EXCEPTION_DEF(RegionCreationFailedException);
+
+/**
+ *@brief Thrown when there is a fatal internal exception in geode.
+  */
+_GF_EXCEPTION_DEF(FatalInternalException);
+
+/**
+ *@brief Thrown by the persistence manager when a write
+ *       fails due to disk failure.
+ **/
+_GF_EXCEPTION_DEF(DiskFailureException);
+
+/**
+ *@brief Thrown by the persistence manager when the data
+ *@brief to be read from disk is corrupt.
+ **/
+_GF_EXCEPTION_DEF(DiskCorruptException);
+
+/**
+ *@brief Thrown when persistence manager fails to initialize.
+ **/
+_GF_EXCEPTION_DEF(InitFailedException);
+
+/**
+ *@brief Thrown when persistence manager fails to close properly.
+ **/
+_GF_EXCEPTION_DEF(ShutdownFailedException);
+
+/**
+ *@brief Thrown when an exception occurs on the cache server.
+ **/
+_GF_EXCEPTION_DEF(CacheServerException);
+
+/**
+ *@brief Thrown when bound of array/vector etc. is exceeded.
+ **/
+_GF_EXCEPTION_DEF(OutOfRangeException);
+
+/**
+ *@brief Thrown when query exception occurs at the server.
+ **/
+_GF_EXCEPTION_DEF(QueryException);
+
+/**
+ *@brief Thrown when an unknown message is received from the server.
+ **/
+_GF_EXCEPTION_DEF(MessageException);
+
+/**
+ *@brief Thrown when a non authorized operation is done.
+ **/
+_GF_EXCEPTION_DEF(NotAuthorizedException);
+
+/**
+ *@brief Thrown when authentication fails.
+ **/
+_GF_EXCEPTION_DEF(AuthenticationFailedException);
+
+/**
+ *@brief Thrown when no credentials are provided by client when server expects.
+ **/
+_GF_EXCEPTION_DEF(AuthenticationRequiredException);
+
+/**
+ *@brief Thrown when two durable connect with same Id.
+ **/
+_GF_EXCEPTION_DEF(DuplicateDurableClientException);
+
+/**
+ *@brief Thrown when the cache listener throws an exception.
+ **/
+_GF_EXCEPTION_DEF(CacheListenerException);
+/**
+ *@brief Thrown during continuous query execution time.
+ **/
+_GF_EXCEPTION_DEF(CqException);
+/**
+ *@brief Thrown if the Cq on which the operaion performed is closed
+ **/
+_GF_EXCEPTION_DEF(CqClosedException);
+/**
+ *@brief Thrown if the Cq Query failed
+ **/
+_GF_EXCEPTION_DEF(CqQueryException);
+/**
+ *@brief Thrown if a Cq by this name already exists on this client
+ **/
+_GF_EXCEPTION_DEF(CqExistsException);
+/**
+ *@brief  Thrown if the query doesnot meet the CQ constraints.
+ * E.g.:Query string should refer only one region, join not supported.
+ *      The query must be a SELECT statement.
+ *      DISTINCT queries are not supported.
+ *      Projections are not supported.
+ *      Only one iterator in the FROM clause is supported, and it must be a
+ *region path.
+ *      Bind parameters in the query are not supported for the initial release.
+ **/
+_GF_EXCEPTION_DEF(CqInvalidException);
+/**
+ *@brief Thrown if function execution failed
+ **/
+_GF_EXCEPTION_DEF(FunctionExecutionException);
+/**
+ *@brief Thrown if the No locators are active to reply for new connection.
+ **/
+_GF_EXCEPTION_DEF(NoAvailableLocatorsException);
+/**
+ *@brief Thrown if all connections in the pool are in use.
+ **/
+_GF_EXCEPTION_DEF(AllConnectionsInUseException);
+/**
+ *@brief Thrown if Delta could not be applied.
+ **/
+_GF_EXCEPTION_DEF(InvalidDeltaException);
+/**
+ *@brief Thrown if a Key is not present in the region.
+ **/
+_GF_EXCEPTION_DEF(KeyNotFoundException);
+/**
+* @brief This is for all Exceptions that may be thrown
+* by a Geode transaction.
+**/
+_GF_EXCEPTION_DEF(TransactionException);
+/**
+* @brief The RollbackException exception indicates that either the transaction
+* has been rolled back or an operation cannot complete because the
+* transaction is marked for rollback only.
+**/
+_GF_EXCEPTION_DEF(RollbackException);
+/**
+* @brief Thrown when a commit fails due to a write conflict.
+* @see CacheTransactionManager#commit
+**/
+_GF_EXCEPTION_DEF(CommitConflictException);
+/**
+* @brief Thrown when the transactional data host has shutdown or no longer has
+*the data
+* being modified by the transaction.
+* This can be thrown while doing transactional operations or during commit.
+**/
+_GF_EXCEPTION_DEF(TransactionDataNodeHasDepartedException);
+/**
+* @brief Thrown when a {@link RebalanceOperation} occurs concurrently with a
+*transaction.
+* This can be thrown while doing transactional operations or during commit.
+**/
+_GF_EXCEPTION_DEF(TransactionDataRebalancedException);
+
+/**
+* @brief Thrown if putAll operation with single hop succeeded partially.
+**/
+_GF_EXCEPTION_DEF(PutAllPartialResultException);
+
+/**
+ *@brief Thrown when a version on which delta is based is different than the
+ *current version
+ **/
+
+extern void CPPCACHE_EXPORT GfErrTypeThrowException(const char* str,
+                                                    GfErrType err);
+
+#define GfErrTypeToException(str, err)   \
+  {                                      \
+    if (err != GF_NOERR) {               \
+      GfErrTypeThrowException(str, err); \
+    }                                    \
+  }
+}  // namespace client
+}  // namespace geode
+}  // namespace apache
+
+#endif  // GEODE_EXCEPTIONTYPES_H_

http://git-wip-us.apache.org/repos/asf/geode-native/blob/fd58b100/src/cppcache/include/geode/Execution.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/Execution.hpp b/src/cppcache/include/geode/Execution.hpp
new file mode 100644
index 0000000..83f3fc1
--- /dev/null
+++ b/src/cppcache/include/geode/Execution.hpp
@@ -0,0 +1,116 @@
+#pragma once
+
+#ifndef GEODE_EXECUTION_H_
+#define GEODE_EXECUTION_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.
+ */
+
+/*
+ * The specification of function behaviors is found in the corresponding .cpp
+ * file.
+ */
+
+#include "geode_globals.hpp"
+#include "gf_types.hpp"
+#include "VectorT.hpp"
+#include "SharedPtr.hpp"
+#include "CacheableBuiltins.hpp"
+#include "ResultCollector.hpp"
+
+/**
+ * @file
+ */
+
+namespace apache {
+namespace geode {
+namespace client {
+/**
+ * @class Execution Execution.hpp
+ * gathers results from function execution
+ * @see FunctionService
+ */
+
+class CPPCACHE_EXPORT Execution : public SharedBase {
+ public:
+  /**
+   * Specifies a data filter of routing objects for selecting the Geode
+   * members
+   * to execute the function.
+   * <p>
+   * If the filter set is empty the function is executed on all members
+   * that have the  FunctionService::onRegion(Region).</p>
+   * @param routingObj Set defining the data filter to be used for executing the
+   * function
+   * @return an Execution with the filter
+   * @throws IllegalArgumentException if filter passed is NULLPTR.
+   * @throws UnsupportedOperationException if not called after
+   *    FunctionService::onRegion(Region).
+   */
+  virtual ExecutionPtr withFilter(CacheableVectorPtr routingObj) = 0;
+  /**
+   * Specifies the user data passed to the function when it is executed.
+   * @param args user data passed to the function execution
+   * @return an Execution with args
+   * @throws IllegalArgumentException if the input parameter is NULLPTR
+   *
+   */
+  virtual ExecutionPtr withArgs(CacheablePtr args) = 0;
+  /**
+   * Specifies the {@link ResultCollector} that will receive the results after
+   * the function has been executed.
+   * @return an Execution with a collector
+   * @throws IllegalArgumentException if {@link ResultCollector} is NULLPTR
+   * @see ResultCollector
+   */
+  virtual ExecutionPtr withCollector(ResultCollectorPtr rs) = 0;
+  /**
+   * Executes the function using its name
+   * <p>
+   * @param func the name of the function to be executed
+   * @param timeout value to wait for the operation to finish before timing out.
+   * @throws Exception if there is an error during function execution
+   * @return either a default result collector or one specified by {@link
+   * #withCollector(ResultCollector)}
+   */
+  virtual ResultCollectorPtr execute(
+      const char* func, uint32_t timeout = DEFAULT_QUERY_RESPONSE_TIMEOUT) = 0;
+
+  /**
+   * Executes the function using its name
+   * <p>
+   * @param routingObj Set defining the data filter to be used for executing the
+   * function
+   * @param args user data passed to the function execution
+   * @param rs * Specifies the {@link ResultCollector} that will receive the
+   * results after
+   * the function has been executed.
+   * @param func the name of the function to be executed
+   * @param timeout value to wait for the operation to finish before timing out.
+   * @throws Exception if there is an error during function execution
+   * @return either a default result collector or one specified by {@link
+   * #withCollector(ResultCollector)}
+   */
+  virtual ResultCollectorPtr execute(CacheableVectorPtr& routingObj,
+                                     CacheablePtr& args, ResultCollectorPtr& rs,
+                                     const char* func, uint32_t timeout) = 0;
+};
+}  // namespace client
+}  // namespace geode
+}  // namespace apache
+
+#endif  // GEODE_EXECUTION_H_

http://git-wip-us.apache.org/repos/asf/geode-native/blob/fd58b100/src/cppcache/include/geode/ExpirationAction.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/ExpirationAction.hpp b/src/cppcache/include/geode/ExpirationAction.hpp
new file mode 100644
index 0000000..90393fd
--- /dev/null
+++ b/src/cppcache/include/geode/ExpirationAction.hpp
@@ -0,0 +1,117 @@
+#pragma once
+
+#ifndef GEODE_EXPIRATIONACTION_H_
+#define GEODE_EXPIRATIONACTION_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.
+ */
+
+#include "geode_globals.hpp"
+
+/**
+ * @file
+ */
+
+namespace apache {
+namespace geode {
+namespace client {
+/**
+ * @class ExpirationAction ExpirationAction.hpp
+ * Enumerated type for expiration actions.
+ *
+ * @see ExpirationAttributes
+ */
+class CPPCACHE_EXPORT ExpirationAction {
+  // public static methods
+ public:
+  // types of action
+
+  typedef enum {
+    /** When the region or cached object expires, it is invalidated. */
+    INVALIDATE = 0,
+    /** When expired, invalidated locally only. */
+    LOCAL_INVALIDATE,
+
+    /** When the region or cached object expires, it is destroyed. */
+    DESTROY,
+    /** When expired, destroyed locally only. */
+    LOCAL_DESTROY,
+
+    /** invalid type. */
+    INVALID_ACTION
+  } Action;
+
+  /**
+  * @param name the name of the expiration action
+  */
+  static Action fromName(const char* name);
+
+  /**
+   * Returns whether this is the action for distributed invalidate.
+   * @return true if this in INVALIDATE
+   */
+  inline static bool isInvalidate(const Action type) {
+    return (type == INVALIDATE);
+  }
+
+  /**
+   * Returns whether this is the action for local invalidate.
+   * @return true if this is LOCAL_INVALIDATE
+   */
+  inline static bool isLocalInvalidate(const Action type) {
+    return (type == LOCAL_INVALIDATE);
+  }
+
+  /** Returns whether this is the action for distributed destroy.
+   * @return true if this is DESTROY
+   */
+  inline static bool isDestroy(const Action type) { return (type == DESTROY); }
+
+  /** Returns whether this is the action for local destroy.
+   * @return true if thisis LOCAL_DESTROY
+   */
+  inline static bool isLocalDestroy(const Action type) {
+    return (type == LOCAL_DESTROY);
+  }
+
+  /** Returns whether this action is local.
+   * @return true if this is LOCAL_INVALIDATE or LOCAL_DESTROY
+   */
+  inline static bool isLocal(const Action type) {
+    return (type == LOCAL_INVALIDATE) || (type == LOCAL_DESTROY);
+  }
+
+  /** Returns whether this action is distributed.
+   * @return true if this is INVALIDATE or DESTROY
+   */
+  inline static bool isDistributed(const Action type) {
+    return (type == INVALIDATE) || (type == DESTROY);
+  }
+
+  /** Return the ExpirationAction represented by the specified ordinal */
+  static const char* fromOrdinal(const int ordinal);
+
+ private:
+  ExpirationAction();
+  ~ExpirationAction();
+  static char* names[];
+};
+}  // namespace client
+}  // namespace geode
+}  // namespace apache
+
+#endif  // GEODE_EXPIRATIONACTION_H_

http://git-wip-us.apache.org/repos/asf/geode-native/blob/fd58b100/src/cppcache/include/geode/ExpirationAttributes.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/ExpirationAttributes.hpp b/src/cppcache/include/geode/ExpirationAttributes.hpp
new file mode 100644
index 0000000..b52ebd0
--- /dev/null
+++ b/src/cppcache/include/geode/ExpirationAttributes.hpp
@@ -0,0 +1,103 @@
+#pragma once
+
+#ifndef GEODE_EXPIRATIONATTRIBUTES_H_
+#define GEODE_EXPIRATIONATTRIBUTES_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.
+ */
+
+#include "geode_globals.hpp"
+#include "ExpirationAction.hpp"
+
+/**
+ * @file
+ */
+
+namespace apache {
+namespace geode {
+namespace client {
+/**
+ * @class ExpirationAttributes ExpirationAttributes.hpp
+ *
+ * Immutable parameter object for accessing and setting the attributes
+ * associated with
+ * <code>timeToLive</code> and <code>idleTimeout</code>. If the expiration
+ * action is not specified, it defaults to
+ * <code>ExpirationAction.INVALIDATE</code>.
+ * If the timeout is not specified, it defaults to zero (which means to never
+ * time out).
+ *
+ * @see AttributesFactory
+ * @see RegionAttributes
+ * @see AttributesMutator
+ */
+class CPPCACHE_EXPORT ExpirationAttributes {
+  /**
+    * @brief public methods
+    */
+ public:
+  /**
+   *@brief  constructors
+   */
+
+  /** Constructs a default <code>ExpirationAttributes</code>, which indicates no
+   * expiration
+   * will take place.
+   */
+  ExpirationAttributes();
+
+  /** Constructs an <code>ExpirationAttributes</code> with the specified
+   * expiration time and
+   * expiration action.
+   * @param expirationTime The number of seconds for a value to live before it
+   * expires
+   * @param expirationAction the action to take when the value expires
+   * @throws IllegalArgumentException if expirationTime is nonpositive
+   */
+  ExpirationAttributes(const int expirationTime,
+                       const ExpirationAction::Action expirationAction =
+                           ExpirationAction::INVALIDATE);
+
+  /** Returns the number of seconds before a region or value expires.
+   *
+   * @return the relative number of seconds before a region or value expires
+   * or zero if it will never expire
+   */
+  int getTimeout() const;
+  void setTimeout(int timeout);
+
+  /** Returns the action that should take place when this value or region
+   * expires.
+   *
+   * @return the action to take when expiring
+   */
+  ExpirationAction::Action getAction() const;
+  void setAction(ExpirationAction::Action& action);
+
+ private:
+  /** The action that should take place when this object or region expires.
+   */
+  ExpirationAction::Action m_action;
+  /** The number of seconds since this value or region was created before it
+   * expires. */
+  int m_timeout;
+};
+}  // namespace client
+}  // namespace geode
+}  // namespace apache
+
+#endif  // GEODE_EXPIRATIONATTRIBUTES_H_

http://git-wip-us.apache.org/repos/asf/geode-native/blob/fd58b100/src/cppcache/include/geode/FixedPartitionResolver.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/FixedPartitionResolver.hpp b/src/cppcache/include/geode/FixedPartitionResolver.hpp
new file mode 100644
index 0000000..23f9d4a
--- /dev/null
+++ b/src/cppcache/include/geode/FixedPartitionResolver.hpp
@@ -0,0 +1,96 @@
+#pragma once
+
+#ifndef GEODE_FIXEDPARTITIONRESOLVER_H_
+#define GEODE_FIXEDPARTITIONRESOLVER_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.
+ */
+
+#include "PartitionResolver.hpp"
+#include "CacheableBuiltins.hpp"
+
+namespace apache {
+namespace geode {
+namespace client {
+
+class EntryEvent;
+
+/**
+ * Implementers of interface <code>FixedPartitionResolver</code> helps to
+ * achieve explicit mapping of a "user defined" partition to a data member node.
+ * <p>
+ * Geode uses the partition name returned by
+ * {@link FixedPartitionResolver#getPartitionName(EntryEvent,
+ * CacheableHashSetPtr)}
+ * 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
+ * FixedPartitionResolver to get the name of the quarter based on the date given
+ * as part of {@link EntryEvent}.
+ * </p>
+ *
+ * public class QuarterPartitionResolver implements FixedPartitionResolver{<br>
+ * &nbsp &nbsp public const char* getPartitionName(EntryEvent event,
+ * CacheableHashSetPtr
+ * allAvailablePartitions) {<br>
+ * &nbsp &nbsp Date date = sdf.parse((String)opDetails.getKey());<br>
+ * &nbsp &nbsp Calendar cal = Calendar.getInstance();<br>
+ * &nbsp &nbsp cal.setTime(date);<br>
+ * &nbsp &nbsp int month = cal.get(Calendar.MONTH);<br>
+ * &nbsp &nbsp if (month == 0 || month == 1 || month == 2) {<br>
+ * &nbsp &nbsp &nbsp return "Quarter1";<br>
+ * &nbsp &nbsp }<br>
+ * &nbsp &nbsp else if (month == 3 || month == 4 || month == 5) {<br>
+ * &nbsp &nbsp &nbsp return "Quarter2";<br>
+ * &nbsp &nbsp }<br>
+ * &nbsp &nbsp else if (month == 6 || month == 7 || month == 8) {<br>
+ * &nbsp &nbsp &nbsp return "Quarter3";<br>
+ * &nbsp &nbsp }<br>
+ * &nbsp &nbsp else if (month == 9 || month == 10 || month == 11) {<br>
+ * &nbsp &nbsp &nbsp return "Quarter4";<br>
+ * &nbsp &nbsp }<br>
+ * &nbsp &nbsp else {<br>
+ * &nbsp &nbsp &nbsp return "Invalid Quarter";<br>
+ * &nbsp &nbsp }<br>
+ * &nbsp }<br>
+ *
+ * @see PartitionResolver
+ *
+ */
+class CPPCACHE_EXPORT FixedPartitionResolver : public PartitionResolver {
+  /**
+  * @brief public methods
+  */
+
+ public:
+  /**
+  * This method is used to get the name of the partition for the given entry
+  * operation.
+  *
+  * @param opDetails
+  *          the details of the entry event e.g. {@link Region#get(Object)}
+  *
+  * @return partition-name associated with node which allows mapping of given
+  *         data to user defined partition
+  */
+  virtual const char* getPartitionName(const EntryEvent& opDetails) = 0;
+};
+}  // namespace client
+}  // namespace geode
+}  // namespace apache
+
+#endif  // GEODE_FIXEDPARTITIONRESOLVER_H_

http://git-wip-us.apache.org/repos/asf/geode-native/blob/fd58b100/src/cppcache/include/geode/FunctionService.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/FunctionService.hpp b/src/cppcache/include/geode/FunctionService.hpp
new file mode 100644
index 0000000..b9b86ab
--- /dev/null
+++ b/src/cppcache/include/geode/FunctionService.hpp
@@ -0,0 +1,193 @@
+#pragma once
+
+#ifndef GEODE_FUNCTIONSERVICE_H_
+#define GEODE_FUNCTIONSERVICE_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.
+ */
+
+/*
+ * The specification of function behaviors is found in the corresponding
+ * .cpp file.
+ */
+
+#include "geode_globals.hpp"
+#include "gf_types.hpp"
+#include "Execution.hpp"
+
+/**
+ * @file
+ */
+
+// macros to resolve ambiguity between PoolPtr and RegionServicePtr
+#define GF_TYPE_IS_POOL(T)                          \
+  apache::geode::client::TypeHelper::SuperSubclass< \
+      apache::geode::client::Pool, T>::result
+#define GF_TYPE_IS_POOL_TYPE(T) \
+  apache::geode::client::TypeHelper::YesNoType<GF_TYPE_IS_POOL(T)>::value
+
+namespace apache {
+namespace geode {
+namespace client {
+/**
+ * @class FunctionService FunctionService.hpp
+ * entry point for function execution
+ * @see Execution
+ */
+
+class CPPCACHE_EXPORT FunctionService : public SharedBase {
+ public:
+  /**
+   * Returns a {@link Execution} object that can be used to execute a data
+   * dependent function on the specified Region.<br>
+   * When invoked from a Geode client, the method returns an Execution
+   * instance that sends a message to one of the connected servers as specified
+   * by the {@link Pool} for the region. Depending on the filters setup on the
+   * {@link Execution}, the function is executed on all Geode members that
+   * define the data region, or a subset of members.
+   * {@link Execution::withFilter(filter)}).
+   *
+   * @param region
+   * If Pool is multiusersecure mode then one need to pass nstance of Region
+   * from RegionService.
+   *
+   * @return Execution
+   * @throws NullPointerException
+   *                 if the region passed in is NULLPTR
+   */
+  static ExecutionPtr onRegion(RegionPtr region);
+
+  /**
+   * Returns a {@link Execution} object that can be used to execute a data
+   * independent function on a server in the provided {@link Pool}.
+   * <p>
+   * If the server goes down while dispatching or executing the function, an
+   * Exception will be thrown.
+   * @param pool from which to chose a server for execution
+   * @return Execution
+   * @throws NullPointerException
+   *                 if Pool instance passed in is NULLPTR
+   * @throws UnsupportedOperationException
+   *                 if Pool is in multiusersecure Mode
+   */
+  inline static ExecutionPtr onServer(const PoolPtr& pool) {
+    return onServerWithPool(pool);
+  }
+
+  /**
+   * Returns a {@link Execution} object that can be used to execute a data
+   * independent function on a server where Cache is attached.
+   * <p>
+   * If the server goes down while dispatching or executing the function, an
+   * Exception will be thrown.
+   * @param cache
+   *        cache from which to chose a server for execution
+   * @return Execution
+   * @throws NullPointerException
+   *                 if Pool instance passed in is NULLPTR
+   * @throws UnsupportedOperationException
+   *                 if Pool is in multiusersecure Mode
+   */
+  inline static ExecutionPtr onServer(const RegionServicePtr& cache) {
+    return onServerWithCache(cache);
+  }
+
+  template <typename T>
+  static ExecutionPtr onServer(const SharedPtr<T>& poolOrCache) {
+    return onServer(poolOrCache, GF_TYPE_IS_POOL_TYPE(T));
+  }
+
+  /**
+   * Returns a {@link Execution} object that can be used to execute a data
+   * independent function on all the servers in the provided {@link Pool}.
+   * If one of the servers goes down while dispatching or executing the function
+   * on the server, an Exception will be thrown.
+   *
+   * @param pool the set of servers to execute the function
+   * @return Execution
+   * @throws NullPointerException
+   *                 if Pool instance passed in is NULLPTR
+   * @throws UnsupportedOperationException
+   *                 if Pool is in multiusersecure Mode
+   */
+  inline static ExecutionPtr onServers(const PoolPtr& pool) {
+    return onServersWithPool(pool);
+  }
+
+  /**
+  * Returns a {@link Execution} object that can be used to execute a data
+  * independent function on all the servers where Cache is attached.
+  * If one of the servers goes down while dispatching or executing the function
+  * on the server, an Exception will be thrown.
+  *
+  * @param cache
+  *        the {@link Cache} where function need to execute.
+  * @return Execution
+  * @throws NullPointerException
+  *                 if Pool instance passed in is NULLPTR
+  * @throws UnsupportedOperationException
+  *                 if Pool is in multiusersecure Mode
+  */
+  inline static ExecutionPtr onServers(const RegionServicePtr& cache) {
+    return onServersWithCache(cache);
+  }
+
+  template <typename T>
+  static ExecutionPtr onServers(const SharedPtr<T>& poolOrCache) {
+    return onServers(poolOrCache, GF_TYPE_IS_POOL_TYPE(T));
+  }
+
+  virtual ~FunctionService() {}
+
+ private:
+  static ExecutionPtr onServerWithPool(const PoolPtr& pool);
+
+  static ExecutionPtr onServerWithCache(const RegionServicePtr& cache);
+
+  static ExecutionPtr onServersWithPool(const PoolPtr& pool);
+
+  static ExecutionPtr onServersWithCache(const RegionServicePtr& cache);
+
+  template <typename T>
+  static ExecutionPtr onServer(const SharedPtr<T>& pool,
+                               TypeHelper::yes_type isPool) {
+    return onServerWithPool(pool);
+  }
+
+  template <typename T>
+  static ExecutionPtr onServer(const SharedPtr<T>& cache,
+                               TypeHelper::no_type isPool) {
+    return onServerWithCache(cache);
+  }
+
+  template <typename T>
+  static ExecutionPtr onServers(const SharedPtr<T>& pool,
+                                TypeHelper::yes_type isPool) {
+    return onServersWithPool(pool);
+  }
+
+  template <typename T>
+  static ExecutionPtr onServers(const SharedPtr<T>& cache,
+                                TypeHelper::no_type isPool) {
+    return onServersWithCache(cache);
+  }
+};
+}  // namespace client
+}  // namespace geode
+}  // namespace apache
+
+#endif  // GEODE_FUNCTIONSERVICE_H_

http://git-wip-us.apache.org/repos/asf/geode-native/blob/fd58b100/src/cppcache/include/geode/GeodeCache.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/GeodeCache.hpp b/src/cppcache/include/geode/GeodeCache.hpp
new file mode 100644
index 0000000..7850c89
--- /dev/null
+++ b/src/cppcache/include/geode/GeodeCache.hpp
@@ -0,0 +1,86 @@
+#pragma once
+
+#ifndef GEODE_GEMFIRECACHE_H_
+#define GEODE_GEMFIRECACHE_H_
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "geode_globals.hpp"
+#include "gf_types.hpp"
+#include "RegionService.hpp"
+
+/**
+ * @file
+ */
+
+namespace apache {
+namespace geode {
+namespace client {
+
+/**
+ * GeodeCache represents the singleton cache that must be created
+ * in order to connect to Geode server.
+ * Users must create a {@link Cache}.
+ * Instances of this interface are created using one of the following methods:
+ * <ul>
+ * <li> {@link ClientCacheFactory#create()} creates a client instance of {@link
+ * Cache}.
+ * </ul>
+ *
+ */
+
+class CPPCACHE_EXPORT GeodeCache : public RegionService {
+  /**
+   * @brief public methods
+   */
+ public:
+  /** Returns the name of this cache.
+   * @return the string name of this cache
+   */
+  virtual const char* getName() const = 0;
+
+  /**
+   * Initializes the cache from an xml file
+   *
+   * @param cacheXml
+   *        Valid cache.xml file
+   */
+  virtual void initializeDeclarativeCache(const char* cacheXml) = 0;
+
+  /**
+  * Returns the distributed system that this cache was
+  * {@link CacheFactory::createCacheFactory created} with.
+  */
+  virtual DistributedSystemPtr getDistributedSystem() const = 0;
+
+  /**
+   * Returns whether Cache saves unread fields for Pdx types.
+   */
+  virtual bool getPdxIgnoreUnreadFields() = 0;
+
+  /**
+  * Returns whether { @link PdxInstance} is preferred for PDX types instead of
+  * C++ object.
+  */
+  virtual bool getPdxReadSerialized() = 0;
+};
+}  // namespace client
+}  // namespace geode
+}  // namespace apache
+
+#endif  // GEODE_GEMFIRECACHE_H_

http://git-wip-us.apache.org/repos/asf/geode-native/blob/fd58b100/src/cppcache/include/geode/GeodeCppCache.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/GeodeCppCache.hpp b/src/cppcache/include/geode/GeodeCppCache.hpp
new file mode 100644
index 0000000..1068f2e
--- /dev/null
+++ b/src/cppcache/include/geode/GeodeCppCache.hpp
@@ -0,0 +1,87 @@
+#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 "SharedPtr.hpp"
+#include "StructSet.hpp"
+#include "UserData.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"
+
+#include "GeodeCppCache.inl"
+
+#endif  // GEODE_GEODECPPCACHE_H_

http://git-wip-us.apache.org/repos/asf/geode-native/blob/fd58b100/src/cppcache/include/geode/GeodeCppCache.inl
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/GeodeCppCache.inl b/src/cppcache/include/geode/GeodeCppCache.inl
new file mode 100755
index 0000000..f9f9f81
--- /dev/null
+++ b/src/cppcache/include/geode/GeodeCppCache.inl
@@ -0,0 +1,27 @@
+#ifndef __APACHE_GEODECPPCACHE_INL_
+#define __APACHE_GEODECPPCACHE_INL_
+/*
+ * 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 "Cacheable.inl"
+#include "CacheableKey.inl"
+
+#endif // define __APACHE_GEODECPPCACHE_INL_

http://git-wip-us.apache.org/repos/asf/geode-native/blob/fd58b100/src/cppcache/include/geode/GeodeTypeIds.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/GeodeTypeIds.hpp b/src/cppcache/include/geode/GeodeTypeIds.hpp
new file mode 100644
index 0000000..48c001e
--- /dev/null
+++ b/src/cppcache/include/geode/GeodeTypeIds.hpp
@@ -0,0 +1,88 @@
+#pragma once
+
+#ifndef GEODE_GEODETYPEIDS_H_
+#define GEODE_GEODETYPEIDS_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.
+ */
+
+namespace apache {
+namespace geode {
+namespace client {
+
+class GeodeTypeIds {
+ public:
+  // User visible IDs here
+  // Internal IDs are in GeodeTypeIds.hpp
+
+  enum IdValues {
+    // Do not use IDs 5 and 6 which are used by .NET
+    // ManagedObject and ManagedObjectXml. If those are
+    // required then change those in GeodeTypeIdsM.hpp
+
+    // keep the following in alphabetical order please.
+    EnumInfo = 9,
+    CacheableLinkedList = 10,
+    Properties = 11,
+    PdxType = 17,  // internal hack to read pdxtype in c# layer, look usuage in
+                   // TcrMessage and  C# DistributedM.cpp
+    BooleanArray = 26,
+    CharArray = 27,
+    RegionAttributes = 30,  // because there's no equivalence in java
+    CacheableUndefined = 31,
+    Struct = 32,
+    NullObj = 41,
+    CacheableString = 42,
+    CacheableBytes = 46,
+    CacheableInt16Array = 47,
+    CacheableInt32Array = 48,
+    CacheableInt64Array = 49,
+    CacheableFloatArray = 50,
+    CacheableDoubleArray = 51,
+    CacheableObjectArray = 52,
+    CacheableBoolean = 53,
+    CacheableWideChar = 54,
+    CacheableByte = 55,
+    CacheableInt16 = 56,
+    CacheableInt32 = 57,
+    CacheableInt64 = 58,
+    CacheableFloat = 59,
+    CacheableDouble = 60,
+    CacheableDate = 61,
+    CacheableFileName = 63,
+    CacheableStringArray = 64,
+    CacheableArrayList = 65,
+    CacheableHashSet = 66,
+    CacheableHashMap = 67,
+    CacheableTimeUnit = 68,
+    CacheableNullString = 69,
+    CacheableHashTable = 70,
+    CacheableVector = 71,
+    CacheableIdentityHashMap = 72,
+    CacheableLinkedHashSet = 73,
+    CacheableStack = 74,
+    CacheableASCIIString = 87,
+    CacheableASCIIStringHuge = 88,
+    CacheableStringHuge = 89,
+    CacheableEnum = 94
+  };
+};
+}  // namespace client
+}  // namespace geode
+}  // namespace apache
+
+#endif  // GEODE_GEODETYPEIDS_H_

http://git-wip-us.apache.org/repos/asf/geode-native/blob/fd58b100/src/cppcache/include/geode/HashFunction.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/HashFunction.hpp b/src/cppcache/include/geode/HashFunction.hpp
new file mode 100644
index 0000000..2cff44a
--- /dev/null
+++ b/src/cppcache/include/geode/HashFunction.hpp
@@ -0,0 +1,81 @@
+#pragma once
+
+#ifndef GEODE_HASHFUNCTION_H_
+#define GEODE_HASHFUNCTION_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.
+ */
+
+#include "geode_globals.hpp"
+#include "SharedPtr.hpp"
+#include "CacheableKey.hpp"
+
+/** @file
+ */
+
+namespace apache {
+namespace geode {
+namespace client {
+
+/** typedef for the hash function used by the hashing schemes. */
+typedef int32_t (*Hasher)(const SharedBasePtr&);
+
+/** typedef for the hashing key equality function. */
+typedef bool (*EqualTo)(const SharedBasePtr&, const SharedBasePtr&);
+
+class HashSB {
+ private:
+  Hasher m_hashFn;
+
+  // Never defined.
+  HashSB();
+
+ public:
+  HashSB(const Hasher hashFn) : m_hashFn(hashFn) {}
+
+  int32_t operator()(const SharedBasePtr& p) const { return m_hashFn(p); }
+};
+
+class EqualToSB {
+ private:
+  EqualTo m_equalFn;
+
+  // Never defined.
+  EqualToSB();
+
+ public:
+  EqualToSB(const EqualTo equalFn) : m_equalFn(equalFn) {}
+
+  bool operator()(const SharedBasePtr& x, const SharedBasePtr& y) const {
+    return m_equalFn(x, y);
+  }
+};
+
+template <typename TKEY>
+inline int32_t hashFunction(const TKEY& k) {
+  return k->hashcode();
+}
+
+template <typename TKEY>
+inline bool equalToFunction(const TKEY& x, const TKEY& y) {
+  return (*x.ptr() == *y.ptr());
+}
+}  // namespace client
+}  // namespace geode
+}  // namespace apache
+
+#endif  // GEODE_HASHFUNCTION_H_

http://git-wip-us.apache.org/repos/asf/geode-native/blob/fd58b100/src/cppcache/include/geode/HashMapOfSharedBase.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/HashMapOfSharedBase.hpp b/src/cppcache/include/geode/HashMapOfSharedBase.hpp
new file mode 100644
index 0000000..1329d95
--- /dev/null
+++ b/src/cppcache/include/geode/HashMapOfSharedBase.hpp
@@ -0,0 +1,161 @@
+#pragma once
+
+#ifndef GEODE_HASHMAPOFSHAREDBASE_H_
+#define GEODE_HASHMAPOFSHAREDBASE_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.
+ */
+
+#include "geode_globals.hpp"
+#include "SharedPtr.hpp"
+#include "HashFunction.hpp"
+#ifdef BUILD_CPPCACHE
+#include <unordered_map>
+#endif
+
+/** @file
+ */
+
+namespace apache {
+namespace geode {
+namespace client {
+
+#ifdef BUILD_CPPCACHE
+typedef std::unordered_map<SharedBasePtr, SharedBasePtr, HashSB, EqualToSB>
+    HMofSBP;
+typedef HMofSBP::const_iterator HMofSBPIterator;
+#else
+class HMofSBP;
+class HMofSBPIterator;
+#endif
+
+/** Represents a HashMap of <code>SharedBase</code>
+ */
+class CPPCACHE_EXPORT HashMapOfSharedBase {
+ private:
+  HMofSBP* m_stdHashMap;
+
+  // Never defined.
+  HashMapOfSharedBase();
+
+ public:
+  /** Interface of an iterator for <code>HashMapOfSharedBase</code>.*/
+  class CPPCACHE_EXPORT Iterator {
+   private:
+    HMofSBPIterator* m_iter;
+
+    Iterator(const HMofSBPIterator& iter);
+
+    // Never defined
+    Iterator();
+
+   public:
+    Iterator(const Iterator& other);
+
+    const SharedBasePtr first() const;
+
+    const SharedBasePtr second() const;
+
+    Iterator& operator++();
+
+    void operator++(int);
+
+    bool operator==(const Iterator& other) const;
+
+    bool operator!=(const Iterator& other) const;
+
+    ~Iterator();
+
+    friend class HashMapOfSharedBase;
+
+   private:
+    const Iterator& operator=(const Iterator&);
+  };
+
+  /** Returns the size of the hash_map. */
+  int32_t size() const;
+
+  /** Returns the largest possible size of the hash_map. */
+  int32_t max_size() const;
+
+  /** true if the hash_map's size is 0. */
+  bool empty() const;
+
+  /** Returns the number of buckets used by the hash_map. */
+  int32_t bucket_count() const;
+
+  /** Increases the bucket count to at least n. */
+  void resize(int32_t n);
+
+  /** Swaps the contents of two hash_maps. */
+  void swap(HashMapOfSharedBase& other);
+
+  /** Inserts the <k, v> pair into the hash_map,
+   * when k does not exist in the hash_map.
+   */
+  bool insert(const SharedBasePtr& k, const SharedBasePtr& v);
+
+  /** Erases the element whose key is k. */
+  int32_t erase(const SharedBasePtr& k);
+
+  /** Erases all of the elements. */
+  void clear();
+
+  /** Check if a given key k exists in the hash_map. */
+  bool contains(const SharedBasePtr& k) const;
+
+  /** Finds an element whose key is k. */
+  Iterator find(const SharedBasePtr& k) const;
+
+  /** Counts the number of elements whose key is k. */
+  int32_t count(const SharedBasePtr& k) const;
+
+  /** Returns a reference to the object that is associated
+   * with a particular key.
+   */
+  SharedBasePtr& operator[](const SharedBasePtr& k);
+
+  /** Get an iterator pointing to the start of hash_map. */
+  Iterator begin() const;
+
+  /** Get an iterator pointing to the end of hash_map. */
+  Iterator end() const;
+
+  /** Assignment operator. */
+  HashMapOfSharedBase& operator=(const HashMapOfSharedBase& other);
+
+  /** Creates an empty hash_map using h as the hash function
+   * and k as the key equal function.
+   */
+  HashMapOfSharedBase(const Hasher h, const EqualTo k);
+
+  /** Creates an empty hash_map with at least n buckets,
+   * using h as the hash function and k as the key equal function.
+   */
+  HashMapOfSharedBase(int32_t n, const Hasher h, const EqualTo k);
+
+  /** Copy constructor. */
+  HashMapOfSharedBase(const HashMapOfSharedBase& other);
+
+  /** Destructor, sets all SharedPtr elements to NULLPTR. */
+  ~HashMapOfSharedBase();
+};
+}  // namespace client
+}  // namespace geode
+}  // namespace apache
+
+#endif  // GEODE_HASHMAPOFSHAREDBASE_H_

http://git-wip-us.apache.org/repos/asf/geode-native/blob/fd58b100/src/cppcache/include/geode/HashMapT.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/HashMapT.hpp b/src/cppcache/include/geode/HashMapT.hpp
new file mode 100644
index 0000000..2a3c645
--- /dev/null
+++ b/src/cppcache/include/geode/HashMapT.hpp
@@ -0,0 +1,224 @@
+#pragma once
+
+#ifndef GEODE_HASHMAPT_H_
+#define GEODE_HASHMAPT_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.
+ */
+
+#include "geode_globals.hpp"
+#include "HashMapOfSharedBase.hpp"
+#include "Cacheable.hpp"
+#include "CacheableKey.hpp"
+#include "Exception.hpp"
+
+/** @file
+*/
+
+namespace apache {
+namespace geode {
+namespace client {
+
+/** HashMap of <code>TKEY</code> to <code>TVAL</code>. */
+template <typename TKEY, typename TVAL>
+class HashMapT {
+ private:
+  HashMapOfSharedBase m_map;
+
+ public:
+  class Iterator {
+   private:
+    HashMapOfSharedBase::Iterator m_iter;
+
+    inline Iterator(const HashMapOfSharedBase::Iterator& iter) : m_iter(iter) {}
+
+    // Never defined.
+    Iterator();
+
+   public:
+    inline const TKEY first() const { return staticCast<TKEY>(m_iter.first()); }
+
+    inline const TVAL second() const {
+      return staticCast<TVAL>(m_iter.second());
+    }
+
+    inline Iterator& operator++() {
+      ++m_iter;
+      return *this;
+    }
+
+    inline void operator++(int) { m_iter++; }
+
+    inline bool operator==(const Iterator& other) const {
+      return (m_iter == other.m_iter);
+    }
+
+    inline bool operator!=(const Iterator& other) const {
+      return (m_iter != other.m_iter);
+    }
+
+    friend class HashMapT;
+  };
+
+  static int32_t hasher(const SharedBasePtr& p) {
+    return apache::geode::client::hashFunction<TKEY>(staticCast<TKEY>(p));
+  }
+
+  static bool equal_to(const SharedBasePtr& x, const SharedBasePtr& y) {
+    return apache::geode::client::equalToFunction<TKEY>(staticCast<TKEY>(x),
+                                                        staticCast<TKEY>(y));
+  }
+
+  /** Returns the size of the hash map. */
+  inline int32_t size() const { return static_cast<int32_t>(m_map.size()); }
+
+  /** Returns the largest possible size of the hash map. */
+  inline int32_t max_size() const {
+    return static_cast<int32_t>(m_map.max_size());
+  }
+
+  /** true if the hash map's size is 0. */
+  inline bool empty() const { return m_map.empty(); }
+
+  /** Returns the number of buckets used by the hash map. */
+  inline int32_t bucket_count() const {
+    return static_cast<int32_t>(m_map.bucket_count());
+  }
+
+  /** Increases the bucket count to at least n. */
+  inline void resize(int32_t n) { m_map.resize(n); }
+
+  /** Swaps the contents of two hash maps. */
+  inline void swap(HashMapT& other) { m_map.swap(other.m_map); }
+
+  /** Inserts the <k, v> pair into the hash map,
+   * when k does not exist in the hash map.
+   */
+  inline bool insert(const TKEY& k, const TVAL& v) {
+    return m_map.insert(k, v);
+  }
+
+  /** Updates a value whose key must exist. */
+  inline void update(const TKEY& k, const TVAL& v) { m_map[k] = v; }
+
+  /** Erases the element whose key is k. */
+  inline int32_t erase(const TKEY& k) { return m_map.erase(k); }
+
+  /** Erases all of the elements. */
+  inline void clear() { m_map.clear(); }
+
+  /** Check if a given key k exists in the hash map. */
+  inline bool contains(const TKEY& k) const { return m_map.contains(k); }
+
+  /** Finds an element whose key is k. */
+  inline Iterator find(const TKEY& k) const { return Iterator(m_map.find(k)); }
+
+  /** Counts the number of elements whose key is k. */
+  int32_t count(const SharedBasePtr& k) const { return m_map.count(k); }
+
+  /** Returns a copy of the object that is associated
+   * with a particular key.
+   */
+  inline TVAL operator[](const TKEY& k) { return staticCast<TVAL>(m_map[k]); }
+
+  /** Get an iterator pointing to the start of hash_map. */
+  inline Iterator begin() const { return Iterator(m_map.begin()); }
+
+  /** Get an iterator pointing to the end of hash_map. */
+  inline Iterator end() const { return Iterator(m_map.end()); }
+
+  /** Assignment operator. */
+  inline HashMapT& operator=(const HashMapT& other) {
+    m_map = other.m_map;
+    return *this;
+  }
+
+  /** Creates an empty hash map with hash function
+   * hasher<TKEY> and equal to function equal_to<TKEY>.
+   */
+  inline HashMapT() : m_map(hasher, equal_to) {}
+
+  /** Creates an empty hash map with at least n buckets and
+   * hash function hasher<TKEY> and equal to function equal_to<TKEY>.
+   */
+  inline HashMapT(int32_t n) : m_map(n, hasher, equal_to) {}
+
+  /** Copy constructor. */
+  inline HashMapT(const HashMapT& other) : m_map(other.m_map) {}
+
+  /** Destructor: the destructor of m_map would do required stuff. */
+  inline ~HashMapT() {}
+};
+
+typedef HashMapT<CacheableKeyPtr, CacheablePtr> _HashMapOfCacheable;
+typedef HashMapT<CacheableKeyPtr, ExceptionPtr> _HashMapOfException;
+
+/**
+ * A map of <code>CacheableKey</code> objects to <code>Cacheable</code>
+ * that also extends <code>SharedBase</code> for smart pointers.
+ */
+class CPPCACHE_EXPORT HashMapOfCacheable : public _HashMapOfCacheable,
+                                           public SharedBase {
+ public:
+  /** Iterator class for the hash map. */
+  typedef _HashMapOfCacheable::Iterator Iterator;
+
+  /** Creates an empty hash map. */
+  inline HashMapOfCacheable() : _HashMapOfCacheable() {}
+
+  /** Creates an empty hash map with at least n buckets. */
+  inline HashMapOfCacheable(int32_t n) : _HashMapOfCacheable(n) {}
+
+  /** Copy constructor. */
+  inline HashMapOfCacheable(const HashMapOfCacheable& other)
+      : _HashMapOfCacheable(other) {}
+
+ private:
+  const HashMapOfCacheable& operator=(const HashMapOfCacheable&);
+};
+
+/**
+ * A map of <code>CacheableKey</code> objects to <code>Exception</code>
+ * that also extends <code>SharedBase</code> for smart pointers.
+ */
+class CPPCACHE_EXPORT HashMapOfException : public _HashMapOfException,
+                                           public SharedBase {
+ public:
+  /** Iterator class for the hash map. */
+  typedef _HashMapOfException::Iterator Iterator;
+
+  /** Creates an empty hash map. */
+  inline HashMapOfException() : _HashMapOfException() {}
+
+  /** Creates an empty hash map with at least n buckets. */
+  inline HashMapOfException(int32_t n) : _HashMapOfException(n) {}
+
+  /** Copy constructor. */
+  inline HashMapOfException(const HashMapOfException& other)
+      : _HashMapOfException(other) {}
+
+ private:
+  const HashMapOfException& operator=(const HashMapOfException&);
+};
+
+typedef SharedPtr<HashMapOfCacheable> HashMapOfCacheablePtr;
+typedef SharedPtr<HashMapOfException> HashMapOfExceptionPtr;
+}  // namespace client
+}  // namespace geode
+}  // namespace apache
+
+#endif  // GEODE_HASHMAPT_H_

http://git-wip-us.apache.org/repos/asf/geode-native/blob/fd58b100/src/cppcache/include/geode/HashSetOfSharedBase.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/HashSetOfSharedBase.hpp b/src/cppcache/include/geode/HashSetOfSharedBase.hpp
new file mode 100644
index 0000000..a8675af
--- /dev/null
+++ b/src/cppcache/include/geode/HashSetOfSharedBase.hpp
@@ -0,0 +1,153 @@
+#pragma once
+
+#ifndef GEODE_HASHSETOFSHAREDBASE_H_
+#define GEODE_HASHSETOFSHAREDBASE_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.
+ */
+
+#include "geode_globals.hpp"
+#include "SharedPtr.hpp"
+#include "HashFunction.hpp"
+#ifdef BUILD_CPPCACHE
+#include <unordered_set>
+#endif
+
+/** @file
+ */
+
+namespace apache {
+namespace geode {
+namespace client {
+
+#ifdef BUILD_CPPCACHE
+typedef std::unordered_set<SharedBasePtr, HashSB, EqualToSB> HSofSBP;
+typedef HSofSBP::const_iterator HSofSBPIterator;
+#else
+class HSofSBP;
+class HSofSBPIterator;
+#endif
+
+/** Represents a HashSet of <code>SharedBase</code>
+ */
+class CPPCACHE_EXPORT HashSetOfSharedBase {
+ private:
+  HSofSBP* m_stdHashSet;
+
+  // Never defined.
+  HashSetOfSharedBase();
+
+ public:
+  /** Interface of an iterator for <code>HashSetOfSharedBase</code>.*/
+  class CPPCACHE_EXPORT Iterator {
+   private:
+    const HashSetOfSharedBase& m_set;
+    HSofSBPIterator* m_iter;
+
+    Iterator(const HSofSBPIterator& iter, const HashSetOfSharedBase& set);
+
+    // Never defined.
+    Iterator();
+
+   public:
+    Iterator(const Iterator& other);
+
+    const SharedBasePtr operator*() const;
+
+    bool isEnd() const;
+
+    Iterator& operator++();
+
+    void operator++(int);
+
+    bool operator==(const Iterator& other) const;
+
+    bool operator!=(const Iterator& other) const;
+
+    void reset();
+
+    ~Iterator();
+
+    friend class HashSetOfSharedBase;
+
+   private:
+    const Iterator& operator=(const Iterator&);
+  };
+
+  /** Returns the size of the hash_set. */
+  int32_t size() const;
+
+  /** Returns the largest possible size of the hash_set. */
+  int32_t max_size() const;
+
+  /** true if the hash_set's size is 0. */
+  bool empty() const;
+
+  /** Returns the number of buckets used by the hash_set. */
+  int32_t bucket_count() const;
+
+  /** Increases the bucket count to at least n. */
+  void resize(int32_t n);
+
+  /** Swaps the contents of two hash_sets. */
+  void swap(HashSetOfSharedBase& other);
+
+  /** Inserts the key k into the hash_set. */
+  bool insert(const SharedBasePtr& k);
+
+  /** Erases the element whose key is k. */
+  int32_t erase(const SharedBasePtr& k);
+
+  /** Erases all of the elements. */
+  void clear();
+
+  /** Check if a given key k exists in the hash_set. */
+  bool contains(const SharedBasePtr& k) const;
+
+  /** Counts the number of elements whose key is k. */
+  int32_t count(const SharedBasePtr& k) const;
+
+  /** Get an iterator pointing to the start of hash_set. */
+  Iterator begin() const;
+
+  /** Get an iterator pointing to the end of hash_set. */
+  Iterator end() const;
+
+  /** Assignment operator. */
+  HashSetOfSharedBase& operator=(const HashSetOfSharedBase& other);
+
+  /** Creates an empty hash_set using h as the hash function
+   * and k as the key equal function.
+   */
+  HashSetOfSharedBase(const Hasher h, const EqualTo k);
+
+  /** Creates an empty hash_set with at least n buckets,
+   * using h as the hash function and k as the key equal function.
+   */
+  HashSetOfSharedBase(int32_t n, const Hasher h, const EqualTo k);
+
+  /** Copy constructor. */
+  HashSetOfSharedBase(const HashSetOfSharedBase& other);
+
+  /** Destructor, sets all SharedPtr elements to NULLPTR. */
+  ~HashSetOfSharedBase();
+};
+}  // namespace client
+}  // namespace geode
+}  // namespace apache
+
+#endif  // GEODE_HASHSETOFSHAREDBASE_H_

http://git-wip-us.apache.org/repos/asf/geode-native/blob/fd58b100/src/cppcache/include/geode/HashSetT.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/HashSetT.hpp b/src/cppcache/include/geode/HashSetT.hpp
new file mode 100644
index 0000000..fa7e75c
--- /dev/null
+++ b/src/cppcache/include/geode/HashSetT.hpp
@@ -0,0 +1,180 @@
+#pragma once
+
+#ifndef GEODE_HASHSETT_H_
+#define GEODE_HASHSETT_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.
+ */
+
+#include "geode_globals.hpp"
+#include "HashSetOfSharedBase.hpp"
+#include "CacheableKey.hpp"
+
+/** @file
+*/
+
+namespace apache {
+namespace geode {
+namespace client {
+
+/** HashSet of <code>TKEY</code>. */
+template <typename TKEY>
+class HashSetT {
+ private:
+  HashSetOfSharedBase m_set;
+
+ public:
+  /** Interface of an iterator for <code>HashSetT</code>.*/
+  class Iterator {
+   private:
+    HashSetOfSharedBase::Iterator m_iter;
+
+    inline Iterator(const HashSetOfSharedBase::Iterator& iter) : m_iter(iter) {}
+
+    // Never defined.
+    Iterator();
+
+   public:
+    inline const TKEY operator*() const { return staticCast<TKEY>(*m_iter); }
+
+    inline bool isEnd() const { return m_iter.isEnd(); }
+
+    inline Iterator& operator++() {
+      ++m_iter;
+      return *this;
+    }
+
+    inline void operator++(int) { m_iter++; }
+
+    inline bool operator==(const Iterator& other) const {
+      return (m_iter == other.m_iter);
+    }
+
+    inline bool operator!=(const Iterator& other) const {
+      return (m_iter != other.m_iter);
+    }
+
+    inline void reset() { m_iter.reset(); }
+
+    friend class HashSetT;
+  };
+
+  inline static int32_t hasher(const SharedBasePtr& p) {
+    return apache::geode::client::hashFunction<TKEY>(staticCast<TKEY>(p));
+  }
+
+  inline static bool equal_to(const SharedBasePtr& x, const SharedBasePtr& y) {
+    return apache::geode::client::equalToFunction<TKEY>(staticCast<TKEY>(x),
+                                                        staticCast<TKEY>(y));
+  }
+
+  /** Returns the size of the hash set. */
+  inline int32_t size() const { return m_set.size(); }
+
+  /** Returns the largest possible size of the hash set. */
+  inline int32_t max_size() const { return m_set.max_size(); }
+
+  /** true if the hash set's size is 0. */
+  inline bool empty() const { return m_set.empty(); }
+
+  /** Returns the number of buckets used by the hash set. */
+  inline int32_t bucket_count() const { return m_set.bucket_count(); }
+
+  /** Increases the bucket count to at least n. */
+  inline void resize(int32_t n) { m_set.resize(n); }
+
+  /** Swaps the contents of two hash sets. */
+  inline void swap(HashSetT& other) { m_set.swap(other.m_set); }
+
+  /** Inserts the key k into the hash set,
+   * when k does not exist in the hash set.
+   */
+  inline bool insert(const TKEY& k) { return m_set.insert(k); }
+
+  /** Erases the element whose key is k. */
+  inline int32_t erase(const TKEY& k) { return m_set.erase(k); }
+
+  /** Erases all of the elements. */
+  inline void clear() { m_set.clear(); }
+
+  /** Check if a given key k exists in the hash set. */
+  inline bool contains(const TKEY& k) const { return m_set.contains(k); }
+
+  /** Counts the number of elements whose key is k. */
+  int32_t count(const TKEY& k) const { return m_set.count(k); }
+
+  /** Get an iterator pointing to the start of hash_set. */
+  inline Iterator begin() const { return Iterator(m_set.begin()); }
+
+  /** Get an iterator pointing to the end of hash_set. */
+  inline Iterator end() const { return Iterator(m_set.end()); }
+
+  /** Assignment operator. */
+  inline HashSetT& operator=(const HashSetT& other) {
+    m_set = other.m_set;
+    return *this;
+  }
+
+  /** Creates an empty hash set with hash function
+   * hasher<TKEY> and equal to function equal_to<TKEY>.
+   */
+  inline HashSetT() : m_set(hasher, equal_to) {}
+
+  /** Creates an empty hash set with at least n buckets and
+   * hash function hasher<TKEY> and equal to function equal_to<TKEY>.
+   */
+  inline HashSetT(int32_t n) : m_set(n, hasher, equal_to) {}
+
+  /** Copy constructor. */
+  inline HashSetT(const HashSetT& other) : m_set(other.m_set) {}
+
+  /** Destructor: the destructor of m_set would do required stuff. */
+  inline ~HashSetT() {}
+};
+
+typedef HashSetT<CacheableKeyPtr> _HashSetOfCacheableKey;
+
+/**
+ * A hash set of <code>CacheableKey</code> objects that also extends
+ * <code>SharedBase</code> for smart pointers.
+ */
+class CPPCACHE_EXPORT HashSetOfCacheableKey : public _HashSetOfCacheableKey,
+                                              public SharedBase {
+ public:
+  /** Iterator class for the hash set. */
+  typedef _HashSetOfCacheableKey::Iterator Iterator;
+
+  /** Create an empty HashSet. */
+  inline HashSetOfCacheableKey() : _HashSetOfCacheableKey() {}
+
+  /** Creates an empty hash set with at least n buckets. */
+  inline HashSetOfCacheableKey(int32_t n) : _HashSetOfCacheableKey(n) {}
+
+  /** Copy constructor. */
+  inline HashSetOfCacheableKey(const HashSetOfCacheableKey& other)
+      : _HashSetOfCacheableKey(other) {}
+
+ private:
+  const HashSetOfCacheableKey& operator=(const HashSetOfCacheableKey&);
+};
+
+typedef SharedPtr<HashSetOfCacheableKey> HashSetOfCacheableKeyPtr;
+}  // namespace client
+}  // namespace geode
+}  // namespace apache
+
+#endif  // GEODE_HASHSETT_H_

http://git-wip-us.apache.org/repos/asf/geode-native/blob/fd58b100/src/cppcache/include/geode/InternalCacheTransactionManager2PC.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/include/geode/InternalCacheTransactionManager2PC.hpp b/src/cppcache/include/geode/InternalCacheTransactionManager2PC.hpp
new file mode 100644
index 0000000..3bb3ef9
--- /dev/null
+++ b/src/cppcache/include/geode/InternalCacheTransactionManager2PC.hpp
@@ -0,0 +1,75 @@
+#pragma once
+
+#ifndef GEODE_INTERNALCACHETRANSACTIONMANAGER2PC_H_
+#define GEODE_INTERNALCACHETRANSACTIONMANAGER2PC_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.
+ */
+
+#include "CacheTransactionManager.hpp"
+
+namespace apache {
+namespace geode {
+namespace client {
+
+/**
+ * Extension of the apache::geode::client::CacheTransactionManager that enables
+ * client
+ * application
+ * to use Geode transaction as part of the global XA transaction.
+ *
+ * The prepare method of this class corresponds to the prepare phases of the
+ * 2 phase commit protocol driven by a global transaction manager.
+ *
+ * The implementation of the apache::geode::client::CacheTransactionManager
+ * commit() and
+ * rollback()
+ * methods must be 2 phase commit process aware.
+ *
+ * Methods of this class are expected to be called by a custom XA Resource
+ * Manager
+ * that is wrapping and adapting Geode client to XA specification
+ * requirements.
+ *
+ * @since 8.3
+ *
+ */
+class CPPCACHE_EXPORT InternalCacheTransactionManager2PC
+    : public virtual apache::geode::client::CacheTransactionManager {
+ public:
+  /**
+   * Performs prepare during 2 phase commit completion.
+   * Locks of the entries modified in the current transaction on the server
+   * side.
+   *
+   * Calls to subsequent commit() or rollback() methods overridden by this class
+   * are
+   * expected to succeed after prepare() has returned successfully.
+   * Geode commits internal transaction irreversibly on commit() call.
+   *
+   */
+  virtual void prepare() = 0;
+
+ protected:
+  InternalCacheTransactionManager2PC();
+  virtual ~InternalCacheTransactionManager2PC();
+};
+}  // namespace client
+}  // namespace geode
+}  // namespace apache
+
+#endif  // GEODE_INTERNALCACHETRANSACTIONMANAGER2PC_H_


Mime
View raw message