Difference between revisions of "MESSAGE BUS SERVER"
Jump to navigation
Jump to search
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
| + | =Overview= | ||
| + | The message bus server is implemented in a [https://en.wikipedia.org/wiki/Dynamic-link_library DLL] that exposes an entry-point function named <code>TruxtonMessageBusServer</code>. | ||
| + | An application wishing to communicate to the server hosting the message bus will perform these basic steps: | ||
| + | # Manually load the [https://en.wikipedia.org/wiki/Dynamic-link_library DLL] | ||
| + | # Get the address of the <code>TruxtonMessageBusServer</code> function in that library | ||
| + | # Call <code>TruxtonMessageBusServer</code> with the address of the <code>MESSAGE_BUS_PROVIDER</code> | ||
| + | # Use the function pointers in <code>MESSAGE_BUS_SERVER</code> structure to communicate with the server | ||
| + | |||
=Interface= | =Interface= | ||
<syntaxhighlight lang="C++"> | <syntaxhighlight lang="C++"> | ||
| − | struct | + | struct MESSAGE_BUS_SERVER |
{ | { | ||
uint64_t signature; | uint64_t signature; | ||
| Line 12: | Line 20: | ||
MESSAGE_BUS_SERVER_OPEN open; | MESSAGE_BUS_SERVER_OPEN open; | ||
}; | }; | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | =Defines= | ||
| + | <syntaxhighlight lang="C++"> | ||
| + | #define MESSAGE_BUS_SERVER_SIGNATURE (0x726576726553424DULL) | ||
| + | #define MESSAGE_BUS_SERVER_PROVIDER_ENTRY_POINT_NAME "TruxtonMessageBusServer" | ||
| + | |||
| + | #define MESSAGE_BUS_SERVER_LOG_INFORMATION (0) | ||
| + | #define MESSAGE_BUS_SERVER_LOG_WARNING (1) | ||
| + | #define MESSAGE_BUS_SERVER_LOG_ERROR (2) | ||
| + | #define MESSAGE_BUS_SERVER_LOG_VERBOSE (3) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 22: | Line 41: | ||
using MESSAGE_BUS_SERVER_DESTROY = void (*)(void * handle, char const * name); | using MESSAGE_BUS_SERVER_DESTROY = void (*)(void * handle, char const * name); | ||
using MESSAGE_BUS_SERVER_OPEN = void * (*)(void * library_handle, void * context, MESSAGE_BUS_SERVER_GET_SETTING, void * log_context, MESSAGE_BUS_SERVER_LOG log); | using MESSAGE_BUS_SERVER_OPEN = void * (*)(void * library_handle, void * context, MESSAGE_BUS_SERVER_GET_SETTING, void * log_context, MESSAGE_BUS_SERVER_LOG log); | ||
| + | |||
| + | using MESSAGE_BUS_SERVER_PROVIDER_ENTRY_POINT = void (*)(MESSAGE_BUS_SERVER *); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Latest revision as of 17:50, 1 September 2020
Contents
Overview
The message bus server is implemented in a DLL that exposes an entry-point function named TruxtonMessageBusServer.
An application wishing to communicate to the server hosting the message bus will perform these basic steps:
- Manually load the DLL
- Get the address of the
TruxtonMessageBusServerfunction in that library - Call
TruxtonMessageBusServerwith the address of theMESSAGE_BUS_PROVIDER - Use the function pointers in
MESSAGE_BUS_SERVERstructure to communicate with the server
Interface
struct MESSAGE_BUS_SERVER
{
uint64_t signature;
void * library_handle;
void * implementation_handle;
MESSAGE_BUS_SERVER_CLOSE close;
MESSAGE_BUS_SERVER_CREATE create;
MESSAGE_BUS_SERVER_DESTROY destroy;
MESSAGE_BUS_SERVER_OPEN open;
};
Defines
#define MESSAGE_BUS_SERVER_SIGNATURE (0x726576726553424DULL)
#define MESSAGE_BUS_SERVER_PROVIDER_ENTRY_POINT_NAME "TruxtonMessageBusServer"
#define MESSAGE_BUS_SERVER_LOG_INFORMATION (0)
#define MESSAGE_BUS_SERVER_LOG_WARNING (1)
#define MESSAGE_BUS_SERVER_LOG_ERROR (2)
#define MESSAGE_BUS_SERVER_LOG_VERBOSE (3)
Function Types
using MESSAGE_BUS_SERVER_LOG = void (*)(void * logging_handle, int level, char const * message);
using MESSAGE_BUS_SERVER_GET_SETTING = int (*)(void * context, char const * name, char * destination, int destination_size);
using MESSAGE_BUS_SERVER_CLOSE = void (*)(void * handle);
using MESSAGE_BUS_SERVER_CREATE = void (*)(void * handle, char const * name);
using MESSAGE_BUS_SERVER_DESTROY = void (*)(void * handle, char const * name);
using MESSAGE_BUS_SERVER_OPEN = void * (*)(void * library_handle, void * context, MESSAGE_BUS_SERVER_GET_SETTING, void * log_context, MESSAGE_BUS_SERVER_LOG log);
using MESSAGE_BUS_SERVER_PROVIDER_ENTRY_POINT = void (*)(MESSAGE_BUS_SERVER *);