#import <MyThreadConnection.h>


Public Member Functions | |
| (NSPort *) | - mainPort |
| Accessor to the port of the "main" end of the connection. | |
| (NSPort *) | - threadPort |
| Accessor to the port of the "thread" end of the connection. | |
| (BOOL) | - connectionIdle |
| Check wether some message remains to be processed. | |
| (NSProxy *) | - proxyForObject:inThread: |
| Creation of a proxy for the object controlling one thread. | |
| (void) | - setRootObject: |
| Set the object controlling the creating thread. | |
| (NSProxy *) | - rootProxy |
| Access to the proxy for the object controlling the creating thread. | |
| (id) | - initWithMainPort:threadPort: |
| Connection initialization. | |
| (id) | - initWithMainPort:threadPort:queueSize: |
| Connection initialization. | |
Static Public Member Functions | |
| (void) | + performSelectorOnMainThread:forObject:withArg: |
| Call a selector on an object on the main thread. | |
Contrary to the standard NSConnection, the arguments to inter-thread calls are passed by address. This saves time but forbid use in inter-process or network messaging.
The thread which creates the connection is called "main" hereunder, even though it can be any thread.
| - (NSPort *) mainPort |
Accessor to the port of the "main" end of the connection.
| - (NSPort *) threadPort |
Accessor to the port of the "thread" end of the connection.
| - (BOOL) connectionIdle |
Check wether some message remains to be processed.
| - (NSProxy *) proxyForObject: | (id) | object | ||
| inThread: | (BOOL) | inThread | ||
Creation of a proxy for the object controlling one thread.
| object | The controlling object | |
| inThread | Selects the created thread if YES |
| - (void) setRootObject: | (id) | anObject |
Set the object controlling the creating thread.
| anObject | The controlling object |
| - (NSProxy *) rootProxy |
Access to the proxy for the object controlling the creating thread.
| + (void) performSelectorOnMainThread: | (SEL) | sel | ||
| forObject: | (NSObject*) | target | ||
| withArg: | (id) | arg | ||
Call a selector on an object on the main thread.
| selector | The selector to perform | |
| target | The target object | |
| arg | The only argument of the method being called The selector shall take only one argument of type id, or no argument at all. The MyThreadConnection registered for the current thread will be used for sending the request. |
Connection initialization.
| mainPort | The port of the creating thread | |
| threadPort | The port for the created thread |
| - (id) initWithMainPort: | (NSPort*) | mainPort | ||
| threadPort: | (NSPort*) | threadPort | ||
| queueSize: | (int) | queueSize | ||
Connection initialization.
| mainPort | The port of the creating thread | |
| threadPort | The port for the created thread | |
| queueSize | Number of elements to queue when Mach port is full |
1.5.4