30 #include "azure_c_shared_utility/macro_utils.h" 64 typedef void*(*pfModule_ParseConfigurationFromJson)(
const char* configuration);
128 static const MODULE_API_VERSION Module_ApiGatewayVersion = MODULE_API_VERSION_1;
181 typedef const MODULE_API* (*pfModule_GetApi)(MODULE_API_VERSION gateway_api_version);
184 #define MODULE_GETAPI_NAME ("Module_GetApi") 187 #define MODULE_EXPORT __declspec(dllexport) 189 #define MODULE_EXPORT 195 #define MODULE_STATIC_GETAPI(MODULE_NAME) C2(Module_GetApi_, MODULE_NAME) pfModule_Receive Module_Receive
Function pointer to the Module_Receive function.
Definition: module.h:167
pfModule_FreeConfiguration Module_FreeConfiguration
Function pointer to the Module_FreeConfiguration function.
Definition: module.h:158
void * MODULE_HANDLE
Represents a module instance.
Definition: module.h:25
enum MODULE_API_VERSION_TAG MODULE_API_VERSION
Module API version.
pfModule_Create Module_Create
Function pointer to the Module_Create function.
Definition: module.h:161
struct MODULE_API_1_TAG MODULE_API_1
The module interface, version 1. An instance of this struct contains function pointers to module-spec...
MODULE_API base
Always the first element on a Module's API.
Definition: module.h:150
struct BROKER_HANDLE_DATA_TAG * BROKER_HANDLE
Struct representing a message broker.
Definition: broker.h:18
pfModule_ParseConfigurationFromJson Module_ParseConfigurationFromJson
Function pointer to the Module_ParseConfigurationFromJson function.
Definition: module.h:154
Defines structures and function prototypes for creating, inspecting and disposing of messages publish...
MODULE_API_VERSION_TAG
Module API version.
Definition: module.h:122
pfModule_Start Module_Start
Function pointer to the Module_Start function (optional).
Definition: module.h:171
Structure used to represent/abstract the idea of a module. May contain Handle/FxnPtrs or an interface...
Definition: module.h:44
void(* pfModule_Start)(MODULE_HANDLE moduleHandle)
Signals to the module that the broker is ready to send and receive messages.
Definition: module.h:119
void *(* pfModule_ParseConfigurationFromJson)(const char *configuration)
Translates module configuration from a JSON string to a module specific data structure.
Definition: module.h:64
const MODULE_API * module_apis
Struct containing function pointers.
Definition: module.h:47
MODULE_EXPORT const MODULE_API * Module_GetApi(MODULE_API_VERSION gateway_api_version)
This is the only function exported by a module under a "by convention" name...
void(* pfModule_Receive)(MODULE_HANDLE moduleHandle, MESSAGE_HANDLE messageHandle)
Receives a message from the broker.
Definition: module.h:108
MODULE_HANDLE module_handle
HANDLE for module.
Definition: module.h:49
MODULE_API_VERSION version
The version of the MODULES_API, shall always be the first element of this structure.
Definition: module.h:140
Structure returned by Module_GetApi containing the API version. By convention, the module returns a c...
Definition: module.h:135
void(* pfModule_Destroy)(MODULE_HANDLE moduleHandle)
Disposes of the resources managed by this module.
Definition: module.h:97
void(* pfModule_FreeConfiguration)(void *configuration)
Frees the configuration object returned by the ParseConfigurationFromJson function.
Definition: module.h:75
Library for configuring and using the gateway's message broker.
pfModule_Destroy Module_Destroy
Function pointer to the Module_Destroy function.
Definition: module.h:164
struct MESSAGE_HANDLE_DATA_TAG * MESSAGE_HANDLE
Struct representing a particular message.
Definition: message.h:48
MODULE_HANDLE(* pfModule_Create)(BROKER_HANDLE broker, const void *configuration)
Creates an instance of a module.
Definition: module.h:88
The module interface, version 1. An instance of this struct contains function pointers to module-spec...
Definition: module.h:147