client-c  0.8.1
kaa_event.h File Reference

Kaa event subsystem API. More...

#include <stddef.h>
#include "kaa_error.h"
#include "platform/ext_event_listeners_callback.h"
+ Include dependency graph for kaa_event.h:

Go to the source code of this file.

Macros

#define KAA_EVENT_MANAGER_T
 

Typedefs

typedef void(* kaa_event_callback_t )(const char *event_fqn, const char *event_data, size_t event_data_size, kaa_endpoint_id_p event_source)
 
typedef size_t kaa_event_block_id
 
typedef struct kaa_event_manager_t kaa_event_manager_t
 

Functions

kaa_error_t kaa_event_manager_find_event_listeners (kaa_event_manager_t *self, const char *fqns[], size_t fqns_count, const kaa_event_listeners_callback_t *callback)
 Initiates a request to the server to search for available event listeners by given FQNs. More...
 
kaa_error_t kaa_event_create_transaction (kaa_event_manager_t *self, kaa_event_block_id *trx_id)
 Start a new event block. More...
 
kaa_error_t kaa_event_finish_transaction (kaa_event_manager_t *self, kaa_event_block_id trx_id)
 Send all the events from the event block at once. More...
 
kaa_error_t kaa_event_remove_transaction (kaa_event_manager_t *self, kaa_event_block_id trx_id)
 Removes the event block without sending events. More...
 
const char * kaa_find_class_family_name (const char *fqn)
 Find class family name of the event by its fully-qualified name. More...
 

Detailed Description

Kaa event subsystem API.

Copyright 2014-2016 CyberVision, Inc.

Licensed 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.

Supplies API for Kaa event subsystem

Definition in file kaa_event.h.

Macro Definition Documentation

#define KAA_EVENT_MANAGER_T

Definition at line 39 of file kaa_event.h.

Typedef Documentation

typedef size_t kaa_event_block_id

Definition at line 36 of file kaa_event.h.

typedef void(* kaa_event_callback_t)(const char *event_fqn, const char *event_data, size_t event_data_size, kaa_endpoint_id_p event_source)

Definition at line 35 of file kaa_event.h.

Definition at line 40 of file kaa_event.h.

Function Documentation

kaa_error_t kaa_event_create_transaction ( kaa_event_manager_t self,
kaa_event_block_id trx_id 
)

Start a new event block.

Returns a new id which must be used to add an event to the block.

Parameters
[in]selfValid pointer to the event manager instance.
[in,out]trx_idPointer to the kaa_event_block_id instance which will be fulfilled with a corresponding ID.
Returns
Error code.
kaa_error_t kaa_event_finish_transaction ( kaa_event_manager_t self,
kaa_event_block_id  trx_id 
)

Send all the events from the event block at once.

The event block is identified by the given trx_id.

Parameters
[in]selfValid pointer to the event manager instance.
[in]trx_idThe ID of the event block to be sent.
Returns
Error code.
kaa_error_t kaa_event_manager_find_event_listeners ( kaa_event_manager_t self,
const char *  fqns[],
size_t  fqns_count,
const kaa_event_listeners_callback_t callback 
)

Initiates a request to the server to search for available event listeners by given FQNs.

Parameters
[in]selfValid pointer to the event manager instance.
[in]fqnsList of FQN strings.
[in]fqns_countNumber of FQNs in the list.
[in]callbackPointer to callback structure.
Returns
Error code.
kaa_error_t kaa_event_remove_transaction ( kaa_event_manager_t self,
kaa_event_block_id  trx_id 
)

Removes the event block without sending events.

Parameters
[in]selfValid pointer to the event manager instance.
[in]trx_idThe ID of the event block to be sent.
Returns
Error code.
const char* kaa_find_class_family_name ( const char *  fqn)

Find class family name of the event by its fully-qualified name.

Parameters
[in]fqnFully-qualified name of the event (null-terminated string).
Returns
Null-terminated string if corresponding event class family was found, NULL otherwise.