TIBCO ActiveSpaces®

Enumerations | Functions
event.h File Reference

Table Listeners receive event objects in their callback to indicate that a change has occurred on the table they are listening on. More...

## Enumerations
enum | tibdgEventErrorCode { TIBDG_EVENT_ERROR_CODE_INVALID, TIBDG_EVENT_ERROR_CODE_TABLE_DELETED, TIBDG_EVENT_ERROR_CODE_COPYSET_LEADER_FAILURE, TIBDG_EVENT_ERROR_CODE_GRID_REDISTRIBUTING, TIBDG_EVENT_ERROR_CODE_PROXY_FAILURE }
| Enum representing the type of error. More...
enum | tibdgEventType { TIBDG_EVENT_TYPE_INVALID, TIBDG_EVENT_TYPE_PUT, TIBDG_EVENT_TYPE_DELETE, TIBDG_EVENT_TYPE_ERROR, TIBDG_EVENT_TYPE_EXPIRED, TIBDG_EVENT_TYPE_MAX }
| Enum representing the type of a tibdgEvent. More...

## Functions
TIBDG_API tibdgRow | tibdgEvent_GetCurrent (tibEx e, tibdgEvent event)
| Get the value of the tibdgRow after the Put operation. More...
TIBDG_API tibdgEventErrorCode | tibdgEvent_GetErrorCode (tibEx e, tibdgEvent event)
| Get the tibdgEventErrorCode from an error event. More...
TIBDG_API const char * | tibdgEvent_GetErrorDescription (tibEx e, tibdgEvent event)
| Get the description of the error from an error event. More...
TIBDG_API tibdgRow | tibdgEvent_GetPrevious (tibEx e, tibdgEvent event)
| Get the value of the tibdgRow prior to the Put or Delete operation. More...
TIBDG_API tibdgEventType | tibdgEvent_GetType (tibEx e, tibdgEvent event)
| Get the tibdgEventType for this event. More...
TIBDG_API const char * | tibdgEventErrorCode_ToString (tibEx e, tibdgEventErrorCode eventErrorCode)
| Get the string representation of the event error code. More...
TIBDG_API const char * | tibdgEventType_ToString (tibEx e, tibdgEventType eventType)
| Get the string representation of the event type. More...
TIBDG_API char * | tibdgEventTypeList_ToString (tibEx e, tibdgEventType *eventTypeList, tibint32_t numEventTypes)
| Convert an array of event types to a string. The caller must free the string that is returned. More...

## Detailed Description

Table Listeners receive event objects in their callback to indicate that a change has occurred on the table they are listening on.

Event objects are owned by the ActiveSpaces library and must not be accessed outside of the span of the Table Listener's callback function.

## Enumeration Type Documentation

## ◆ tibdgEventErrorCode

enum tibdgEventErrorCode

Enum representing the type of error.

Enumerator
TIBDG_EVENT_ERROR_CODE_INVALID | Default, uninitialized value.
TIBDG_EVENT_ERROR_CODE_TABLE_DELETED | The table has been deleted from the configuration, the listener will not receive any more events.
TIBDG_EVENT_ERROR_CODE_COPYSET_LEADER_FAILURE | One of the Copyset Leaders has failed, recreate the listener when the Copyset Leader has restarted or a new primary has been elected.
TIBDG_EVENT_ERROR_CODE_GRID_REDISTRIBUTING | The Grid is in the process of redistributing data, recreate the listener when the redistributing process is complete.
TIBDG_EVENT_ERROR_CODE_PROXY_FAILURE |

## ◆ tibdgEventType

enum tibdgEventType

Enum representing the type of a tibdgEvent.

Enumerator
TIBDG_EVENT_TYPE_INVALID | Default, uninitialized value.
TIBDG_EVENT_TYPE_PUT | A client put a row into the table.
TIBDG_EVENT_TYPE_DELETE | A client deleted a row from the table.
TIBDG_EVENT_TYPE_ERROR | An error occurred in the system that relates to the table.
TIBDG_EVENT_TYPE_EXPIRED | A row was removed from the table because it expired.
TIBDG_EVENT_TYPE_MAX | A placeholder to indicate the max number of event types.

## Function Documentation

## ◆ tibdgEvent_GetCurrent()

TIBDG_API tibdgRow tibdgEvent_GetCurrent | ( | tibEx | e,
|  | tibdgEvent | event
| ) |  |

Get the value of the tibdgRow after the Put operation.

Parameters

  e | The exception object captures information about failures.
  event | The event

Returns
  The current value

## ◆ tibdgEvent_GetErrorCode()

TIBDG_API tibdgEventErrorCode tibdgEvent_GetErrorCode | ( | tibEx | e,
|  | tibdgEvent | event
| ) |  |

Get the tibdgEventErrorCode from an error event.

Parameters

  e | The exception object captures information about failures.
  event | The event

Returns
  The error code

## ◆ tibdgEvent_GetErrorDescription()

TIBDG_API const char* tibdgEvent_GetErrorDescription | ( | tibEx | e,
|  | tibdgEvent | event
| ) |  |

Get the description of the error from an error event.

Parameters

  e | The exception object captures information about failures.
  event | The event

Returns
  The description

## ◆ tibdgEvent_GetPrevious()

TIBDG_API tibdgRow tibdgEvent_GetPrevious | ( | tibEx | e,
|  | tibdgEvent | event
| ) |  |

Get the value of the tibdgRow prior to the Put or Delete operation.

Parameters

  e | The exception object captures information about failures.
  event | The event

Returns
  The previous value

## ◆ tibdgEvent_GetType()

TIBDG_API tibdgEventType tibdgEvent_GetType | ( | tibEx | e,
|  | tibdgEvent | event
| ) |  |

Get the tibdgEventType for this event.

Parameters

  e | The exception object captures information about failures.
  event | The event

Returns
  The type of the event

## ◆ tibdgEventErrorCode_ToString()

TIBDG_API const char* tibdgEventErrorCode_ToString | ( | tibEx | e,
|  | tibdgEventErrorCode | eventErrorCode
| ) |  |

Get the string representation of the event error code.

Parameters

  e | The exception object captures information about failures.
  eventErrorCode | The error code to convert

Returns
  On success, this call returns the corresponding string name for the error code.
  On failure, this call returns `NULL`.

## ◆ tibdgEventType_ToString()

TIBDG_API const char* tibdgEventType_ToString | ( | tibEx | e,
|  | tibdgEventType | eventType
| ) |  |

Get the string representation of the event type.

Parameters

  e | The exception object captures information about failures.
  eventType | The type to convert

Returns
  On success, this call returns the corresponding string name for the event type.
  On failure, this call returns `NULL`.

## ◆ tibdgEventTypeList_ToString()

TIBDG_API char* tibdgEventTypeList_ToString | ( | tibEx | e,
|  | tibdgEventType * | eventTypeList,
|  | tibint32_t | numEventTypes
| ) |  |

Convert an array of event types to a string. The caller must free the string that is returned.

Parameters

  e | The exception object captures information about failures.
  eventTypeList | An array of tibdgEventType objects
  numEventTypes | The number elements in the list

Returns
  The string of event types. Can be used as the input property when creating a table listener.