ESP SDK C API
Entities/Objects | Functions
Data Structures
General

Overview

The EspList and EspMap data structures are used to retrieve multiple pieces of information from the SDK atomically. For example, retrieving the number of streams defined in a project.

Entities/Objects

typedef struct EspList EspList
typedef struct EspMap EspMap
typedef struct EspSdk EspSdk

Enumeration Types

Enumeration of types supported by the EspList interface.

Enumerator:
ESP_LIST_MANAGER_T 

List to return EspManager references

ESP_LIST_CONTROLLER_T 

List to return EspController references

ESP_LIST_WORKSPACE_T 

List to return EspWorkspace (string) references

ESP_LIST_APPLICATION_T 

List to return EspApplication references

ESP_LIST_STRING_T 

List to return strings

ESP_LIST_STREAM_T 

List to return EspStream references

ESP_LIST_EVENT_T 

List to return references to different events

ESP_LIST_UNDEFINED_T 

Functions

ESPAPICALL EspListesp_list_create (const ESP_LIST_ITEM_T type, EspError *error)
ESPAPICALL int32_t esp_list_get_count (const EspList *list, EspError *error)
ESPAPICALL int32_t esp_list_clear (EspList *list, EspError *error)
ESPAPICALL int32_t esp_list_free (EspList *list, EspError *error)
ESPAPICALL const EspStreamesp_list_get_stream (const EspList *list, const int32_t index, EspError *error)
ESPAPICALL const char * esp_list_get_string (const EspList *list, const int32_t index, EspError *error)
ESPAPICALL const void * esp_list_get_event (const EspList *list, const int32_t index, EspError *error)
ESPAPICALL EspMapesp_map_create (EspError *error)
ESPAPICALL int32_t esp_map_set (EspMap *map, const char *key, const char *value, EspError *error)
ESPAPICALL const char * esp_map_get (const EspMap *map, const char *key, EspError *error)
ESPAPICALL int32_t esp_map_count (const EspMap *map, EspError *error)
ESPAPICALL int32_t esp_map_item_at (const EspMap *map, const int32_t index, const char **key, const char **value, EspError *error)
ESPAPICALL int32_t esp_map_free (EspMap *map, EspError *error)

Function Documentation

ESPAPICALL int32_t esp_list_clear ( EspList list,
EspError *  error 
)

Clears all items in the list. The EspList can be re used in a fresh query.

ESPAPICALL EspList* esp_list_create ( const ESP_LIST_ITEM_T  type,
EspError *  error 
)

Creates an EspList data structure. This must be freed using esp_list_free once done.

Parameters:
typeThe type of data this EspList will contain
ESPAPICALL int32_t esp_list_free ( EspList list,
EspError *  error 
)

Frees an EspList object previously retrieved using esp_list_create.

ESPAPICALL int32_t esp_list_get_count ( const EspList list,
EspError *  error 
)

Returns number of items held in the EspList.

ESPAPICALL const void* esp_list_get_event ( const EspList list,
const int32_t  index,
EspError *  error 
)

Returns a reference to one of the supported event types. The returned void pointer needs to be cast to the appropriate category. Use esp_event_get_category() to determine the category of the event.

Returns:
NULL in case of error.
Parameters:
listEspList from which to retrieve
indexIndex at which to retrieve the item
ESPAPICALL const EspStream* esp_list_get_stream ( const EspList list,
const int32_t  index,
EspError *  error 
)

Return the EspStream object as the specified index. Will generate an error if the list is not of the correct type.

Returns:
NULL in case of error.
Parameters:
listEspList from which to retrieve
indexIndex at which to retrieve the item
ESPAPICALL const char* esp_list_get_string ( const EspList list,
const int32_t  index,
EspError *  error 
)

Return a string at the specified index in the list. Will generate an error if the list is not of the correct type.

Returns:
NULL in case of error.
Parameters:
listEspList from which to retrieve
indexIndex at which to retrieve the item
ESPAPICALL int32_t esp_map_count ( const EspMap map,
EspError *  error 
)

Return number of items stored in the map. This function does not correspond to the standard return values scheme used in the SDK.

Returns:
-1 in case of error.
ESPAPICALL EspMap* esp_map_create ( EspError *  error)

Creates an EspMap structure that can be used to store key value pairs. The new EspMap must be freed using esp_map_free once done.

Returns:
NULL in case of error.
ESPAPICALL int32_t esp_map_free ( EspMap map,
EspError *  error 
)
ESPAPICALL const char* esp_map_get ( const EspMap map,
const char *  key,
EspError *  error 
)

Retrieve the value for the specified key.

Returns:
NULL in case of error.
ESPAPICALL int32_t esp_map_item_at ( const EspMap map,
const int32_t  index,
const char **  key,
const char **  value,
EspError *  error 
)
ESPAPICALL int32_t esp_map_set ( EspMap map,
const char *  key,
const char *  value,
EspError *  error 
)

Insert a key value pair into the map.

Returns:
non-zero in case of error.
Parameters:
mapEspMap into which to insert
keyKey of the mapping
valueValue for the mapping
 All Classes Variables