awNewBrokerEvent
BrokerError awNewBrokerEvent(
BrokerClient client,
char *event_type_name,
BrokerEvent *event);
client | The Broker client for which the new event is to be created. If set to NULL, the event is not type checked. |
event_type_name | The event type name. |
event | The newly created event. This parameter is used for output. |
Creates the event with the type specified by event_type_name for the specified client. The caller is responsible for calling awDeleteEvent on the output value.
If client is not NULL, this function will check the names and types of the event's fields, one by one, as they are set. If you set a field with a type that does not match the event type definition stored in the Broker, an error will be returned. This notifies you that you need to update your application to keep it synchronized with the latest event type definitions managed by the Broker.
For example, if your application adds a field named XX by calling awSetIntegerField and the field is defined to be of type int, an error will be returned.
Note:
If client is set to NULL, no type checking will occur when this event's fields are retrieved or set. However, the event's type name will be recorded in the event for later use.
Possible BrokerError major codes | Meaning |
AW_ERROR_INVALID_CLIENT | A non-NULL client parameter was specified and it is invalid. |
AW_ERROR_INVALID_EVENT_TYPE_NAME | The event_type_name is invalid. |
AW_ERROR_NO_PERMISSION | A non-NULL client parameter was specified and that client does not have permission to publish or subscribe to the event type. |
AW_ERROR_NULL_PARAM | The parameter event_type_name or event is NULL. |
AW_ERROR_UNKNOWN_EVENT_TYPE | A non-NULL client parameter was specified and the event type was not found on the Broker. |
See also: