PubSub+ Messaging API For C  7.29.0.6
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ex/ios/Example.h
/*
* Copyright 2014-2024 Solace Corporation. All rights reserved.
*/
#import "EventCallbackProtocol.h"
#import "ExampleInterface.h"
#import "MessageReceiveCallbackProtocol.h"
#import "LogCallbackProtocol.h"
#import <mach/clock.h>
#import <mach/mach.h>
#import "ParameterInterface.h"
#import <pthread.h>
@interface Example : NSObject <MessageReceiveCallbackProtocol,
EventCallbackProtocol, LogCallbackProtocol>
#define COMMON_MY_SAMPLE_TOPIC "my/sample/topic"
#define COMMON_SEMP_TOPIC_FORMAT "#SEMP/%s/SHOW"
#define COMMON_ATTACHMENT_TEXT "my attached data"
// Thread definitions and typedefs
#define DEFAULT_THREAD_RETURN_ARG (NULL)
#define _NULL_THREAD_ID (0)
typedef void *(*FP)(void *);
typedef void *threadRetType;
typedef threadRetType (*threadFn_pt)(void *param_p);
typedef struct callbackBridge {
void *example_p;
void *user_p;
} callbackBridge_t;
typedef struct contextThreadInfo {
volatile int contextThreadStarted;
volatile int stopContextThread;
int rc;
pthread_t handle;
} contextThreadInfo_t;
typedef struct threadInfo {
volatile int threadStarted; //*< 1 when the thread has been started
volatile int stopThread; //*< set to 1 to stop the context thread
int rc;
pthread_t handle; //*< thread handle
void *user_p;
} threadInfo_t;
@property NSString *name;
@property (copy, atomic)NSString *description;
@property ParameterInterface *parameters;
@property ExampleInterface *exampleInterface;
@property BOOL running;
@property BOOL requestRun;
@property BOOL requestCancel;
@property callbackBridge_t *nullBridge_p;
- (id)initWithExampleInterface:(ExampleInterface *)exampleInterface;
- (void)start;
- (void)run;
- (void)cancel;
- (void)cleanup;
- (void)printToTextView:(NSString *)str;
- (void)logCCSMPVersion;
- (void)setLoggingLevel;
- (void)handleErrorWithReturnCode:(solClient_returnCode_t)rc
errorString:(const char *)errorStr;
createAndConnectSessionWithContext:(solClient_opaqueContext_pt)context_p
session:(solClient_opaqueSession_pt *)session_p
messageCallback:
eventCallback_p;
createAndConnectSessionWithContext:(solClient_opaqueContext_pt)context_p
session:(solClient_opaqueSession_pt *)session_p
messageCallback:
eventCallback_p
userData:(callbackBridge_t *)user_p;
publishMessageWithSession:(solClient_opaqueSession_pt)session_p
topic:(char *)topic_p
deliveryMode:(solClient_uint32_t)deliveryMode;
- (pthread_t)startThreadWithFP:(FP)fp argument:(void *)arg;
- (void)waitOnThread:(pthread_t)handle;
- (threadRetType)contextThread:(void *)contextInfo_p;
threadRetType contextThread(void *user_p);
- (int)startContextThread:(contextThreadInfo_t *)info_p;
- (void)stopContextThread:(contextThreadInfo_t *)info_p;
- (UInt64)getTimeInUs;
- (void)getUsageTimeWithUserTime:(long long *)userTime_p
systemTime:(long long *)systemTime_p;
@end