AEMessageQueue.h File Reference
#import <Foundation/Foundation.h>
#import "AETime.h"

Go to the source code of this file.

Classes

struct  AEArgument
 Argument to method call, for use with AEMessageQueuePerformSelectorOnMainThread. More...
 
class  AEMessageQueue
 Message Queue. More...
 

Macros

#define AEArgumentScalar(argument)   (AEArgument){ YES, &(typeof(argument)){argument}, sizeof(argument) }
 Create a scalar argument for use with AEMessageQueuePerformSelectorOnMainThread.
 
#define AEArgumentStruct(argument)   (AEArgument){ YES, &(argument), sizeof(argument) }
 Create a structure argument for use with AEMessageQueuePerformSelectorOnMainThread.
 
#define AEArgumentData(buffer, size)   (AEArgument) { NO, buffer, size }
 Create a data argument for use with AEMessageQueuePerformSelectorOnMainThread.
 

Typedefs

typedef void(^ AEMessageQueueBlock )()
 Block.
 

Variables

AEArgument AEArgumentNone
 Empty argument, to terminate list of arguments in AEMessageQueuePerformSelectorOnMainThread.
 

Class Documentation

struct AEArgument

Argument to method call, for use with AEMessageQueuePerformSelectorOnMainThread.

Class Members
BOOL isValue
const void *_Nullable data
size_t length

Macro Definition Documentation

#define AEArgumentScalar (   argument)    (AEArgument){ YES, &(typeof(argument)){argument}, sizeof(argument) }

Create a scalar argument for use with AEMessageQueuePerformSelectorOnMainThread.

For example, to create a literal int argument:

AEArgumentScalar(1);

To create a pointer argument:

__unsafe_unretained MyClass * myPointer;
AEArgumentScalar(myPointer);

To create a literal structure argument, use AEArgumentStruct; to create an argument that points a memory region, use AEArgumentData.

Parameters
argumentThe argument value
Returns
The initialized argument
#define AEArgumentStruct (   argument)    (AEArgument){ YES, &(argument), sizeof(argument) }

Create a structure argument for use with AEMessageQueuePerformSelectorOnMainThread.

For example (note extra parentheses around braced structure initialization):

AEArgumentStruct(((struct MyStruct) { value1, value2 }))

or

struct myStruct value = { value1, value2 };
AEArgumentStruct(value)
Parameters
argumentThe struct argument
Returns
The initialized argument
#define AEArgumentData (   buffer,
  size 
)    (AEArgument) { NO, buffer, size }

Create a data argument for use with AEMessageQueuePerformSelectorOnMainThread.

The memory region indicated will be copied. For example:

void * myBuffer = ...;
AEArgumentData(myBuffer, myBufferLength);
Parameters
bufferPointer to the buffer to copy
sizeNumber of bytes to copy
Returns
The initialized argument

Typedef Documentation

typedef void(^ AEMessageQueueBlock)()

Block.

Variable Documentation

AEArgument AEArgumentNone

Empty argument, to terminate list of arguments in AEMessageQueuePerformSelectorOnMainThread.