/*---------------------------------------------------------------------------*/
/* IosAsync.h                                                                */
/* copyright (c) innovaphone 2015                                            */
/*                                                                           */
/*---------------------------------------------------------------------------*/

struct tag_ios_async_handler;
@class IosAsync;

@protocol IosAsyncSignal

- (void) ios_async_signal_handler:(IosAsync *)ios_async;
- (id) ios_async_get_id_obj:(int)id;

@end
@interface IosAsync : NSObject

@property (copy) bool (^dequeue)();
@property (copy) bool (^get_bool)();
@property (copy) int (^get_int)();
@property (copy) NSString *(^get_string)();
@property (copy) byte *(^get_byte_array)(int *plen, bool claim);
@property (copy) byte *(^get_memory)(int *plen);
#if !defined(PLATFORM_NO_PACKET)
@property (copy) const byte *(^get_packet)(int *plen);
#endif

+ (id) iosAsyncWithHandlerTable:(struct tag_ios_async_handler *)handler_table handlerCount:(unsigned int)handler_count iosAsyncSignal:(__weak id <IosAsyncSignal>)signal;

- (id) initWithHandlerTable:(struct tag_ios_async_handler *)handler_table handlerCount:(unsigned int)handler_count iosAsyncSignal:(__weak id <IosAsyncSignal>)signal;

@end
