VMware GemFire Native C++ Reference  9.1
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ExceptionTypes.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #ifndef GEODE_EXCEPTIONTYPES_H_
4 #define GEODE_EXCEPTIONTYPES_H_
5 
6 /*
7  * Licensed to the Apache Software Foundation (ASF) under one or more
8  * contributor license agreements. See the NOTICE file distributed with
9  * this work for additional information regarding copyright ownership.
10  * The ASF licenses this file to You under the Apache License, Version 2.0
11  * (the "License"); you may not use this file except in compliance with
12  * the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  */
22 
27 #include "geode_globals.hpp"
28 #include "Exception.hpp"
29 
30 namespace apache {
31 namespace geode {
32 namespace client {
33 
34 #define _GF_EXCEPTION_DEF(x) \
35  const char _exception_name_##x[] = "apache::geode::client::" #x; \
36  class x; \
37  typedef SharedPtr<x> x##Ptr; \
38  class CPPCACHE_EXPORT x : public apache::geode::client::Exception { \
39  public: \
40  x(const char* msg1, const char* msg2 = NULL, bool forceStack = false, \
41  const ExceptionPtr& cause = NULLPTR) \
42  : Exception(msg1, msg2, forceStack, cause) {} \
43  x(const x& other) : Exception(other) {} \
44  virtual Exception* clone() const { \
45  return new x(m_message, m_stack, m_cause); \
46  } \
47  virtual ~x() {} \
48  virtual const char* getName() const { return _exception_name_##x; } \
49  virtual void raise() { throw * this; } \
50  \
51  protected: \
52  x(const CacheableStringPtr& message, const StackTracePtr& stack, \
53  const ExceptionPtr& cause) \
54  : Exception(message, stack, cause) {} \
55  \
56  private: \
57  const x& operator=(const x&); \
58  }
59 
60 /*
61  *
62  * This is the list of exceptions directly derived from
63  * apache::geode::client::Exception.
64  *
65  */
66 
70 _GF_EXCEPTION_DEF(AssertionException);
71 
75 _GF_EXCEPTION_DEF(IllegalArgumentException);
76 
80 _GF_EXCEPTION_DEF(IllegalStateException);
81 
85 _GF_EXCEPTION_DEF(CacheExistsException);
86 
90 _GF_EXCEPTION_DEF(CacheXmlException);
94 _GF_EXCEPTION_DEF(TimeoutException);
95 
99 _GF_EXCEPTION_DEF(CacheWriterException);
100 
104 _GF_EXCEPTION_DEF(RegionExistsException);
105 
109 _GF_EXCEPTION_DEF(CacheClosedException);
110 
114 _GF_EXCEPTION_DEF(LeaseExpiredException);
115 
119 _GF_EXCEPTION_DEF(CacheLoaderException);
120 
124 _GF_EXCEPTION_DEF(RegionDestroyedException);
125 
129 _GF_EXCEPTION_DEF(EntryDestroyedException);
130 
134 _GF_EXCEPTION_DEF(NoSystemException);
135 
140 _GF_EXCEPTION_DEF(AlreadyConnectedException);
141 
145 _GF_EXCEPTION_DEF(FileNotFoundException);
146 
150 _GF_EXCEPTION_DEF(InterruptedException);
151 
156 _GF_EXCEPTION_DEF(UnsupportedOperationException);
157 
162 _GF_EXCEPTION_DEF(StatisticsDisabledException);
163 
167 _GF_EXCEPTION_DEF(ConcurrentModificationException);
168 
172 _GF_EXCEPTION_DEF(UnknownException);
173 
177 _GF_EXCEPTION_DEF(ClassCastException);
178 
182 _GF_EXCEPTION_DEF(EntryNotFoundException);
183 
187 _GF_EXCEPTION_DEF(GeodeIOException);
188 
192 _GF_EXCEPTION_DEF(GeodeConfigException);
193 
198 _GF_EXCEPTION_DEF(NullPointerException);
199 
203 _GF_EXCEPTION_DEF(EntryExistsException);
204 
209 _GF_EXCEPTION_DEF(NotConnectedException);
210 
214 _GF_EXCEPTION_DEF(CacheProxyException);
215 
219 _GF_EXCEPTION_DEF(OutOfMemoryException);
220 
225 _GF_EXCEPTION_DEF(NotOwnerException);
226 
230 _GF_EXCEPTION_DEF(WrongRegionScopeException);
231 
235 _GF_EXCEPTION_DEF(BufferSizeExceededException);
236 
240 _GF_EXCEPTION_DEF(RegionCreationFailedException);
241 
245 _GF_EXCEPTION_DEF(FatalInternalException);
246 
251 _GF_EXCEPTION_DEF(DiskFailureException);
252 
257 _GF_EXCEPTION_DEF(DiskCorruptException);
258 
262 _GF_EXCEPTION_DEF(InitFailedException);
263 
267 _GF_EXCEPTION_DEF(ShutdownFailedException);
268 
272 _GF_EXCEPTION_DEF(CacheServerException);
273 
277 _GF_EXCEPTION_DEF(OutOfRangeException);
278 
282 _GF_EXCEPTION_DEF(QueryException);
283 
287 _GF_EXCEPTION_DEF(MessageException);
288 
292 _GF_EXCEPTION_DEF(NotAuthorizedException);
293 
297 _GF_EXCEPTION_DEF(AuthenticationFailedException);
298 
302 _GF_EXCEPTION_DEF(AuthenticationRequiredException);
303 
307 _GF_EXCEPTION_DEF(DuplicateDurableClientException);
308 
312 _GF_EXCEPTION_DEF(CacheListenerException);
316 _GF_EXCEPTION_DEF(CqException);
320 _GF_EXCEPTION_DEF(CqClosedException);
324 _GF_EXCEPTION_DEF(CqQueryException);
328 _GF_EXCEPTION_DEF(CqExistsException);
339 _GF_EXCEPTION_DEF(CqInvalidException);
343 _GF_EXCEPTION_DEF(FunctionExecutionException);
347 _GF_EXCEPTION_DEF(NoAvailableLocatorsException);
351 _GF_EXCEPTION_DEF(AllConnectionsInUseException);
355 _GF_EXCEPTION_DEF(InvalidDeltaException);
359 _GF_EXCEPTION_DEF(KeyNotFoundException);
364 _GF_EXCEPTION_DEF(TransactionException);
370 _GF_EXCEPTION_DEF(RollbackException);
375 _GF_EXCEPTION_DEF(CommitConflictException);
382 _GF_EXCEPTION_DEF(TransactionDataNodeHasDepartedException);
388 _GF_EXCEPTION_DEF(TransactionDataRebalancedException);
389 
393 _GF_EXCEPTION_DEF(PutAllPartialResultException);
394 
400 extern void CPPCACHE_EXPORT GfErrTypeThrowException(const char* str,
401  GfErrType err);
402 
403 #define GfErrTypeToException(str, err) \
404  { \
405  if (err != GF_NOERR) { \
406  GfErrTypeThrowException(str, err); \
407  } \
408  }
409 } // namespace client
410 } // namespace geode
411 } // namespace apache
412 
413 #endif // GEODE_EXCEPTIONTYPES_H_
Each enum represents a predefined RegionAttributes in a Cache.
Definition: Assert.hpp:31
void CPPCACHE_EXPORT GfErrTypeThrowException(const char *str, GfErrType err)
Thrown when a version on which delta is based is different than the current version.
#define CPPCACHE_EXPORT
Defines a Geode CPPCACHE export.
Definition: geode_base.hpp:58
GfErrType
Error codes returned by Geode C++ interface functions.
Definition: geode_base.hpp:182
This namespace contains all the Geode C++ API classes, enumerations and globals.

Pivotal GemFire C++ Cache API Documentation