ObjectBox C and C++ API  4.0.3
obx::CustomMsgClientDelegate< CLIENT > Class Template Reference

A helper class that delegates C style function pointers to C++ class method invocations via user data. Also, it provides makeFunctions() and registerProtocol(). More...

#include <objectbox-sync.hpp>

Static Public Member Functions

static std::shared_ptr< CLIENT > * sharedPtrPtr (void *clientUserData)
 
static std::shared_ptr< CLIENT > sharedPtr (void *clientUserData)
 
static void * delegateCreate (uint64_t clientId, const char *url, const char *certPath, void *userConfig)
 
static obx_err delegateStart (void *clientUserData)
 
static void delegateStop (void *clientUserData)
 
static void delegateJoin (void *clientUserData)
 
static void delegateShutdown (void *clientUserData)
 
static bool delegateConnect (void *clientUserData)
 
static void delegateDisconnect (bool clearOutgoingMessages, void *clientUserData)
 
static bool delegateSendAsync (OBX_bytes_lazy *cBytes, void *clientUserData)
 
static void delegateClearOutgoingMessages (void *clientUserData)
 
static OBX_custom_msg_client_functions makeFunctions ()
 Create a OBX_custom_msg_client_functions struct according to the defined template delegates. More...
 
static void registerProtocol (const char *protocol, void *configUserData=nullptr)
 Must be called to register a protocol for your custom messaging client. Call before starting a client. More...
 

Detailed Description

template<typename CLIENT>
class obx::CustomMsgClientDelegate< CLIENT >

A helper class that delegates C style function pointers to C++ class method invocations via user data. Also, it provides makeFunctions() and registerProtocol().

Member Function Documentation

◆ delegateClearOutgoingMessages()

template<typename CLIENT >
static void obx::CustomMsgClientDelegate< CLIENT >::delegateClearOutgoingMessages ( void *  clientUserData)
inlinestatic

◆ delegateConnect()

template<typename CLIENT >
static bool obx::CustomMsgClientDelegate< CLIENT >::delegateConnect ( void *  clientUserData)
inlinestatic

◆ delegateCreate()

template<typename CLIENT >
static void* obx::CustomMsgClientDelegate< CLIENT >::delegateCreate ( uint64_t  clientId,
const char *  url,
const char *  certPath,
void *  userConfig 
)
inlinestatic

◆ delegateDisconnect()

template<typename CLIENT >
static void obx::CustomMsgClientDelegate< CLIENT >::delegateDisconnect ( bool  clearOutgoingMessages,
void *  clientUserData 
)
inlinestatic

◆ delegateJoin()

template<typename CLIENT >
static void obx::CustomMsgClientDelegate< CLIENT >::delegateJoin ( void *  clientUserData)
inlinestatic

◆ delegateSendAsync()

template<typename CLIENT >
static bool obx::CustomMsgClientDelegate< CLIENT >::delegateSendAsync ( OBX_bytes_lazy cBytes,
void *  clientUserData 
)
inlinestatic

◆ delegateShutdown()

template<typename CLIENT >
static void obx::CustomMsgClientDelegate< CLIENT >::delegateShutdown ( void *  clientUserData)
inlinestatic

◆ delegateStart()

template<typename CLIENT >
static obx_err obx::CustomMsgClientDelegate< CLIENT >::delegateStart ( void *  clientUserData)
inlinestatic

◆ delegateStop()

template<typename CLIENT >
static void obx::CustomMsgClientDelegate< CLIENT >::delegateStop ( void *  clientUserData)
inlinestatic

◆ makeFunctions()

template<typename CLIENT >
static OBX_custom_msg_client_functions obx::CustomMsgClientDelegate< CLIENT >::makeFunctions ( )
inlinestatic

Create a OBX_custom_msg_client_functions struct according to the defined template delegates.

◆ registerProtocol()

template<typename CLIENT >
static void obx::CustomMsgClientDelegate< CLIENT >::registerProtocol ( const char *  protocol,
void *  configUserData = nullptr 
)
inlinestatic

Must be called to register a protocol for your custom messaging client. Call before starting a client.

Parameters
protocolthe communication protocol to use, e.g. "tcp"

◆ sharedPtr()

template<typename CLIENT >
static std::shared_ptr<CLIENT> obx::CustomMsgClientDelegate< CLIENT >::sharedPtr ( void *  clientUserData)
inlinestatic

◆ sharedPtrPtr()

template<typename CLIENT >
static std::shared_ptr<CLIENT>* obx::CustomMsgClientDelegate< CLIENT >::sharedPtrPtr ( void *  clientUserData)
inlinestatic