EII Message Bus C Reference
Classes | Macros
protocol.h File Reference

Messaging protocol interface. More...

#include "eii/msgbus/msgbus.h"

Go to the source code of this file.

Classes

struct  protocol_t
 
struct  protocol_exports_t
 

Macros

#define EII_MSGBUS_PROTO(proto_name)
 

Detailed Description

Messaging protocol interface.

Author
Kevin Midkiff kevin.nosp@m..mid.nosp@m.kiff@.nosp@m.inte.nosp@m.l.com

Macro Definition Documentation

◆ EII_MSGBUS_PROTO

#define EII_MSGBUS_PROTO (   proto_name)
Value:
protocol_t* proto_##proto_name##_initialize(const char*, config_t*); \
void proto_##proto_name##_destroy(void* ctx); \
msgbus_ret_t proto_##proto_name##_publisher_new( \
void* ctx, const char* topic, void** pub_ctx); \
msgbus_ret_t proto_##proto_name##_publisher_publish( \
void* ctx, void* pub_ctx, msg_envelope_t* msg); \
void proto_##proto_name##_publisher_destroy(void* ctx, void* pub_ctx); \
msgbus_ret_t proto_##proto_name##_subscriber_new( \
void* ctx, const char* topic, void** subscriber); \
void proto_##proto_name##_recv_ctx_destroy(void* ctx, void* recv_ctx); \
msgbus_ret_t proto_##proto_name##_recv_wait( \
void* ctx, void* recv_ctx, msg_envelope_t** message); \
msgbus_ret_t proto_##proto_name##_recv_timedwait( \
void* ctx, void* recv_ctx, int timeout, msg_envelope_t** message); \
msgbus_ret_t proto_##proto_name##_recv_nowait( \
void* ctx, void* recv_ctx, msg_envelope_t** message); \
msgbus_ret_t proto_##proto_name##_service_get( \
void* ctx, const char* service_name, void** service_ctx); \
msgbus_ret_t proto_##proto_name##_service_new( \
void* ctx, const char* service_name, void** service_ctx); \
msgbus_ret_t proto_##proto_name##_request( \
void* ctx, void* service_ctx, msg_envelope_t* msg); \
msgbus_ret_t proto_##proto_name##_response( \
void* ctx, void* service_ctx, msg_envelope_t* message); \
protocol_exports_t PROTO_EXPORTS = { \
.initialize=proto_##proto_name##_initialize };

Helper macro for defining a new protocol.

This macro defines the function prototypes for all of the functions needed for an EII Message Bus protocol. Additionally, it defines the PROTO_EXPORTS global which is required to dynamically load the protocol into the EII Message Bus.

msg_envelope_t
Definition: msg_envelope.h:111
protocol_t
Definition: protocol.h:39