H:/gfcppsancout/product/include/gfcpp/gf_base.hpp File Reference


Detailed Description

Definitions of types and functions supported in the GemFire C++ interface.

Go to the source code of this file.

Namespaces

namespace  gemfire
namespace  gemfire::TypeHelper
namespace  gemfire_statistics

Data Structures

struct  GfErrorInfo
 Structure used to return error information. More...

Defines

#define CPPCACHE_EXPORT
 Defines a GemFire CPPCACHE export.
#define GF_CACHE_EVENT
 Definitions of bit fields in an int32 used to pass information about an event to the event handler.
#define GF_CACHE_EVENT_DISTRIBUTED   0x08
 bit field mask, set if the event was caused by a dstributed operation
#define GF_CACHE_EVENT_EXPIRATION   0x10
 bit field mask, set if the event was caused by an expiration
#define GF_CACHE_EVENT_LOCAL_LOAD   0x01
 bit field mask, set if the event was caused by a local load
#define GF_CACHE_EVENT_MASK_AFTER_CREATE   0x01
 mask to use to get AfterCreate events
#define GF_CACHE_EVENT_MASK_AFTER_DESTROY   0x02
 mask to use to get AfterDestroy events
#define GF_CACHE_EVENT_MASK_AFTER_INVALIDATE   0x04
 mask to use to get AfterInvalidate events
#define GF_CACHE_EVENT_MASK_AFTER_REGION_DESTROY   0x08
 mask to use to get AfterRegionDestroy events
#define GF_CACHE_EVENT_MASK_AFTER_REGION_INVALIDATE   0x10
 mask to use to get AfterRegionInvalidate events
#define GF_CACHE_EVENT_MASK_AFTER_UPDATE   0x20
 mask to use to get AfterUpdate events
#define GF_CACHE_EVENT_MASK_ALL   0x7F
 mask to use to get All events
#define GF_CACHE_EVENT_MASK_CLOSE   0x40
 mask to use to get AfterClose events
#define GF_CACHE_EVENT_MASKS
 Definitions for event masks which can be used to filter certain events so that the handler will not get them.
#define GF_CACHE_EVENT_NET_LOAD   0x02
 bit field mask, set if the event was caused by a net load
#define GF_CACHE_EVENT_NETSEARCH   0x04
 bit field mask, set if the event was caused by a net search
#define GF_CACHE_EVENT_ORIGIN_REMOTE   0x20
 bit field mask, set if the event was originated in a cache other than this one
#define GF_FALSE   0
 boolean value FALSE
#define GF_MAX_ERR_STR_LEN   256
 GemFire maximum error string length.
#define GF_NEW(v, stmt)
 Allocates x and throws OutOfMemoryException if it fails.
#define GF_PROTECT   1
 GemFire shared memory protected.
#define GF_SAFE_DELETE(x)
 Deletes x only if it exists.
#define GF_SAFE_DELETE_ARRAY(x)
 Deletes array x only if it exists.
#define GF_TEMPLATE_EXPORT
 Define GF_TEMPLATE_EXPORT.
#define GF_TRUE   1
 boolean value TRUE
#define GF_UNPROTECT   0
 GemFire shared memory unprotected.
#define GFCEXTERN(type)   LIBIMP type LIBCALL
 Defines a GemFire C extern.
#define LIBCALL
 Library Call.
#define LIBEXP
 Library Export.
#define LIBEXPORT(type)   type
 Library Export a type.
#define LIBIMP   extern
 Library Implementation.
#define MAX_GII_MESSAGE_SIZE   2 * 1024 * 1024
 GemFire maximum getInitialImage message size.

Typedefs

typedef bool gemfire::Bool
 Boolean value.
typedef int64 gemfire::Duration
 duration (time) in milliseconds
typedef GfErrType(* genericFunc )(void *args)
 A generic function definition included in the GfRegion structure to avoid circular type references.
typedef GfErrType(* GfEventHandlerFunction )(GfCacheEventCodes eventCode, int8 boolValues, Oid region, Oid callbackArg, Oid key, Oid newValue, Oid oldValue, int32 keyLen, wchar_t *keyBuf, int32 newValueSize, int8 *newValueBuf, int32 oldValueSize, int8 *oldValueBuf)
 The type declaration for the user supplied EventHandlerFunction called when an event is detected.
typedef int16 gemfire::Int16
 signed 32 bit integer
typedef short int16
 signed 16 bit integer (short)
typedef int32 gemfire::Int32
 signed 32 bit integer
typedef int32_t int32
 signed 32 bit integer
typedef int64 gemfire::Int64
 signed 64 bit integer
typedef int64_t int64
 signed 64 bit integer
typedef int8 gemfire::Int8
 signed 8 bit integer
typedef char int8
 single byte, character or boolean field
typedef uint32 Oid
 See GemfireTypeIds.hpp for a list of predefined objectIds.
typedef uint16 gemfire::UInt16
 unsigned 32 bit integer
typedef unsigned short uint16
 unsigned 16 bit integer (ushort)
typedef uint32 gemfire::UInt32
 unsigned 32 bit integer
typedef uint32_t uint32
 unsigned 32 bit integer
typedef uint64 gemfire::UInt64
 unsigned 64 bit integer
typedef uint64_t uint64
 unsigned 64 bit integer
typedef uint8 gemfire::UInt8
 unsigned 8 bit integer
typedef unsigned char uint8
 unsigned integer value

Enumerations

enum  { GF_S_NOTCON = 0, GF_S_CONN = 1, GF_S_DISCON = 2, GF_S_SHUTDN = 3 }
 Status values returned by gfConnectionStatus. More...
enum  GfCacheEventCodes {
  NO_EVENT, AFTER_CREATE, AFTER_DESTROY, AFTER_INVALIDATE,
  AFTER_REGION_DESTROY, AFTER_REGION_INVALIDATE, AFTER_UPDATE, CLOSE
}
 The event codes used to describe the operation detected in an event. More...
enum  GfErrType {
  GF_NOERR = 0, GF_DEADLK = 1, GF_EACCES = 2, GF_ECONFL = 3,
  GF_EINVAL = 4, GF_ENOENT = 5, GF_ENOMEM = 6, GF_ERANGE = 7,
  GF_ETYPE = 8, GF_NOTOBJ = 9, GF_NOTCON = 10, GF_NOTOWN = 11,
  GF_NOTSUP = 12, GF_SCPGBL = 13, GF_SCPEXC = 14, GF_TIMOUT = 15,
  GF_OVRFLW = 16, GF_IOERR = 17, GF_EINTR = 18, GF_MSG = 19,
  GF_CACHE_REGION_NOT_FOUND = 101, GF_CACHE_REGION_INVALID = 102, GF_CACHE_REGION_KEYS_NOT_STRINGS = 103, GF_CACHE_REGION_ENTRY_NOT_BYTES = 104,
  GF_CACHE_REGION_NOT_GLOBAL = 105, GF_CACHE_PROXY = 106, GF_CACHE_ILLEGAL_ARGUMENT_EXCEPTION = 107, GF_CACHE_ILLEGAL_STATE_EXCEPTION = 108,
  GF_CACHE_TIMEOUT_EXCEPTION = 109, GF_CACHE_WRITER_EXCEPTION = 110, GF_CACHE_REGION_EXISTS_EXCEPTION = 111, GF_CACHE_CLOSED_EXCEPTION = 112,
  GF_CACHE_LEASE_EXPIRED_EXCEPTION = 113, GF_CACHE_LOADER_EXCEPTION = 114, GF_CACHE_REGION_DESTROYED_EXCEPTION = 115, GF_CACHE_ENTRY_DESTROYED_EXCEPTION = 116,
  GF_CACHE_STATISTICS_DISABLED_EXCEPTION = 117, GF_CACHE_CONCURRENT_MODIFICATION_EXCEPTION = 118, GF_CACHE_ENTRY_NOT_FOUND = 119, GF_CACHE_ENTRY_EXISTS = 120,
  GF_CACHEWRITER_ERROR = 121, GF_ENTRYEXISTS_EXCEPTION = 122, GF_CANNOT_PROCESS_GII_REQUEST = 123, GF_CACHESERVER_EXCEPTION = 124,
  GF_CACHE_REDUNDANCY_FAILURE = 125, GF_AUTHENTICATION_FAILED_EXCEPTION = 126, GF_NOT_AUTHORIZED_EXCEPTION = 127 , GF_DUPLICATE_DURABLE_CLIENT = 129,
  GF_EUNDEF = 999
}
 Error codes returned by GemFire C++ interface functions. More...
enum  GfRegionErrorBufSize { GF_REGION_ERROR_BUF_SIZE = 256 }
 the size of the buffer used to save the error text for an error that occured while performing an operation on a region. More...


Define Documentation

#define CPPCACHE_EXPORT

Defines a GemFire CPPCACHE export.

#define GF_CACHE_EVENT

Definitions of bit fields in an int32 used to pass information about an event to the event handler.

#define GF_CACHE_EVENT_DISTRIBUTED   0x08

bit field mask, set if the event was caused by a dstributed operation

#define GF_CACHE_EVENT_EXPIRATION   0x10

bit field mask, set if the event was caused by an expiration

#define GF_CACHE_EVENT_LOCAL_LOAD   0x01

bit field mask, set if the event was caused by a local load

#define GF_CACHE_EVENT_MASK_AFTER_CREATE   0x01

mask to use to get AfterCreate events

#define GF_CACHE_EVENT_MASK_AFTER_DESTROY   0x02

mask to use to get AfterDestroy events

#define GF_CACHE_EVENT_MASK_AFTER_INVALIDATE   0x04

mask to use to get AfterInvalidate events

#define GF_CACHE_EVENT_MASK_AFTER_REGION_DESTROY   0x08

mask to use to get AfterRegionDestroy events

#define GF_CACHE_EVENT_MASK_AFTER_REGION_INVALIDATE   0x10

mask to use to get AfterRegionInvalidate events

#define GF_CACHE_EVENT_MASK_AFTER_UPDATE   0x20

mask to use to get AfterUpdate events

#define GF_CACHE_EVENT_MASK_ALL   0x7F

mask to use to get All events

#define GF_CACHE_EVENT_MASK_CLOSE   0x40

mask to use to get AfterClose events

#define GF_CACHE_EVENT_MASKS

Definitions for event masks which can be used to filter certain events so that the handler will not get them.

Masks can be arithmetically OR'd together.

#define GF_CACHE_EVENT_NET_LOAD   0x02

bit field mask, set if the event was caused by a net load

#define GF_CACHE_EVENT_NETSEARCH   0x04

bit field mask, set if the event was caused by a net search

#define GF_CACHE_EVENT_ORIGIN_REMOTE   0x20

bit field mask, set if the event was originated in a cache other than this one

#define GF_FALSE   0

boolean value FALSE

#define GF_MAX_ERR_STR_LEN   256

GemFire maximum error string length.

#define GF_NEW ( v,
stmt   ) 

Value:

{ \
  v = new (std::nothrow) stmt; \
  if ( (v) == NULL ) { \
    throw gemfire::OutOfMemoryException( \
        "Out of Memory while allocating "#v ); \
  } \
}
Allocates x and throws OutOfMemoryException if it fails.

#define GF_PROTECT   1

GemFire shared memory protected.

#define GF_SAFE_DELETE (  ) 

Value:

{ \
  delete x; \
  x = NULL; \
}
Deletes x only if it exists.

#define GF_SAFE_DELETE_ARRAY (  ) 

Value:

{ \
  delete [ ] x; \
  x = NULL; \
}
Deletes array x only if it exists.

#define GF_TEMPLATE_EXPORT

Define GF_TEMPLATE_EXPORT.

#define GF_TRUE   1

boolean value TRUE

#define GF_UNPROTECT   0

GemFire shared memory unprotected.

#define GFCEXTERN ( type   )     LIBIMP type LIBCALL

Defines a GemFire C extern.

#define LIBCALL

Library Call.

#define LIBEXP

Library Export.

#define LIBEXPORT ( type   )     type

Library Export a type.

#define LIBIMP   extern

Library Implementation.

#define MAX_GII_MESSAGE_SIZE   2 * 1024 * 1024

GemFire maximum getInitialImage message size.


Typedef Documentation

typedef GfErrType(* genericFunc)(void *args)

A generic function definition included in the GfRegion structure to avoid circular type references.

Actual type of the _loaderFunction is GfCacheLoaderFunc.

GfEventHandlerFunction

The type declaration for the user supplied EventHandlerFunction called when an event is detected.

The implementation for this function must be thread-safe because it may be called concurrently depending upon the way in which events are generated. As an optimization, keys and values are transmitted to this function in a buffer to avoid shared memory object creation. These buffers are allocated and managed by the C interface and may only be referenced during the execution of the event handler function. DO NOT PASS THE BUFFER POINTERS TO OTHER THREADS.

typedef short int16

signed 16 bit integer (short)

typedef int32_t int32

signed 32 bit integer

typedef int64_t int64

signed 64 bit integer

typedef char int8

single byte, character or boolean field

typedef uint32 Oid

See GemfireTypeIds.hpp for a list of predefined objectIds.

typedef unsigned short uint16

unsigned 16 bit integer (ushort)

typedef uint32_t uint32

unsigned 32 bit integer

typedef uint64_t uint64

unsigned 64 bit integer

typedef unsigned char uint8

unsigned integer value


Enumeration Type Documentation

anonymous enum

Status values returned by gfConnectionStatus.

Enumerator:
GF_S_NOTCON  connection not yet opened
GF_S_CONN  connected
GF_S_DISCON  disconnected with gfDisconnect
GF_S_SHUTDN  disconnected due to manager shutdown

enum GfCacheEventCodes

The event codes used to describe the operation detected in an event.

Enumerator:
NO_EVENT  no event
AFTER_CREATE  After Create.
AFTER_DESTROY  After Destroy.
AFTER_INVALIDATE  After Invalidate.
AFTER_REGION_DESTROY  After Region Destroy.
AFTER_REGION_INVALIDATE  After Region Invalidate.
AFTER_UPDATE  After Update.
CLOSE  Close Event - used to clean up local data structures.

enum GfErrType

Error codes returned by GemFire C++ interface functions.

Enumerator:
GF_NOERR  success - no error
GF_DEADLK  deadlock detected
GF_EACCES  permission problem
GF_ECONFL  class creation conflict
GF_EINVAL  invalid argument
GF_ENOENT  entity does not exist
GF_ENOMEM  insufficient memory
GF_ERANGE  index out of range
GF_ETYPE  type mismatch
GF_NOTOBJ  invalid object reference
GF_NOTCON  not connected to GemFire
GF_NOTOWN  lock not owned by process/thread
GF_NOTSUP  operation not supported
GF_SCPGBL  attempt to exit global scope
GF_SCPEXC  maximum scopes exceeded
GF_TIMOUT  operation timed out
GF_OVRFLW  arithmetic overflow
GF_IOERR  paging file I/O error
GF_EINTR  interrupted GemFire call
GF_MSG  message could not be handled
GF_CACHE_REGION_NOT_FOUND  No region with the specified name.

GF_CACHE_REGION_INVALID  the region is not valid
GF_CACHE_REGION_KEYS_NOT_STRINGS  Entry keys are not strings.
GF_CACHE_REGION_ENTRY_NOT_BYTES  Entry's value is not a byte array.
GF_CACHE_REGION_NOT_GLOBAL  Distributed locks not supported.
GF_CACHE_PROXY  Errors detected in CacheProxy processing.
GF_CACHE_ILLEGAL_ARGUMENT_EXCEPTION  IllegalArgumentException in Cache Proxy.
GF_CACHE_ILLEGAL_STATE_EXCEPTION  IllegalStateException in CacheProxy.
GF_CACHE_TIMEOUT_EXCEPTION  TimeoutException in CacheProxy.
GF_CACHE_WRITER_EXCEPTION  CacheWriterException in CacheProxy.
GF_CACHE_REGION_EXISTS_EXCEPTION  RegionExistsException in CacheProxy.
GF_CACHE_CLOSED_EXCEPTION  CacheClosedException in CacheProxy.
GF_CACHE_LEASE_EXPIRED_EXCEPTION  LeaseExpiredException in CacheProxy.
GF_CACHE_LOADER_EXCEPTION  CacheLoaderException in CacheProxy.
GF_CACHE_REGION_DESTROYED_EXCEPTION  RegionDestroyedException in CacheProxy.
GF_CACHE_ENTRY_DESTROYED_EXCEPTION  EntryDestroyedException in CacheProxy.
GF_CACHE_STATISTICS_DISABLED_EXCEPTION  StatisticsDisabledException in CacheProxy.
GF_CACHE_CONCURRENT_MODIFICATION_EXCEPTION  ConcurrentModificationException in CacheProxy.
GF_CACHE_ENTRY_NOT_FOUND  EntryNotFoundException in CacheProxy.
GF_CACHE_ENTRY_EXISTS  EntryExistsException in CacheProxy.
GF_CACHEWRITER_ERROR  An Exception occured while invoking a cachewritter callback.
GF_ENTRYEXISTS_EXCEPTION  A create was requested when the key already existed in the region.
GF_CANNOT_PROCESS_GII_REQUEST  A failure other than timeout occured durring a batch request.
GF_CACHESERVER_EXCEPTION  Java cache server exception sent to the thin client by java cache server.
GF_CACHE_REDUNDANCY_FAILURE  redundancy level not satisfied
GF_AUTHENTICATION_FAILED_EXCEPTION  Authentication Fails.
GF_NOT_AUTHORIZED_EXCEPTION  Non Authorized Operation Tried.
GF_DUPLICATE_DURABLE_CLIENT  No Authentication Provided.

Java cache server refused duplicate durable client

GF_EUNDEF  unknown exception

enum GfRegionErrorBufSize

the size of the buffer used to save the error text for an error that occured while performing an operation on a region.

Enumerator:
GF_REGION_ERROR_BUF_SIZE  maximum error buffer size


GemFire C++ Cache API Documentation