| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/Foundation.framework |
| Availability | Available in Mac OS X v10.0 and later. |
| Companion guide | |
| Declared in | NSPortCoder.h |
NSPortCoder is a concrete subclass of NSCoder used in the distributed objects system to transmit object proxies (and sometimes objects themselves) between NSConnection objects. An NSPortCoder instance is always created and used by an NSConnection object; you should never need to explicitly create or use one directly yourself.
Creates and returns a new NSPortCoder object.
+ (id)portCoderWithReceivePort:(NSPort *)rcvPort sendPort:(NSPort *)sndPort components:(NSArray *)comps
The receiver port.
The send port.
An array containing an encoded distributed objects message.
A new NSPortCoder object connected to the communication ports receiverPort and sendPort, with an encoded distributed objects message stored in components.
NSPortCoder.hReturns the NSConnection object that uses the receiver.
- (NSConnection *)connection
The NSConnection object that uses the receiver. In an object’s encodeWithCoder: method, this is the sending (server) connection. In initWithCoder: this is the receiving (client) connection.
NSPortCoder.h
Decodes and returns an NSPort object that was previously encoded with any of the general encode...Object: messages.
- (NSPort *)decodePortObject
An NSPort object that was previously encoded with any of the general encode...Object: messages.
This method is primarily for use by NSPort objects themselves—you can always use decodeObject to decode any object.
NSPort invokes this method in its initWithCoder: method so the appropriate kernel information for the port can be decoded. A subclass of NSPortCoder shouldn’t decode an NSPort by sending it an initWithCoder: message. See Subclassing NSCoder for more information.
NSPortCoder.hProcesses and acts upon the distributed object message with which the receiver was initialized.
- (void)dispatch
NSPortCoder.h
Encodes a given port so it can be properly reconstituted in the receiving process or thread.
- (void)encodePortObject:(NSPort *)aPort
The port to encode.
This method is primarily for use by NSPort objects themselves—you can always use the general encode...Object: methods to encode any object.
NSPort invokes this method in its encodeWithCoder: method so that the appropriate kernel information for the port can be encoded. A subclass of NSPortCoder should not encode an NSPort by sending it an encodeWithCoder: message. See Subclassing NSCoder for more information.
NSPortCoder.hInitializes and returns an NSPortCoder object.
- (id)initWithReceivePort:(NSPort *)receiverPort sendPort:(NSPort *)sendPort components:(NSArray *)components
The receive port.
The send port.
An array containing an encoded distributed objects message.
Initializes a newly allocated NSPortCoder object connected to the communication ports receiverPort and sendPort, with an encoded distributed objects message stored in components.
NSPortCoder.hReturns a Boolean value that indicates whether the receiver is encoding an object by copying it.
- (BOOL)isBycopy
YES if the receiver is encoding an object by copying it, NO if it expects a proxy.
See Distributed Objects Programming Topics for more information.
NSPortCoder.hReturns a Boolean value that indicates whether the receiver is encoding an object by reference.
- (BOOL)isByref
YES if the receiver is encoding an object byref, NO if it expects a copy.
See Distributed Objects Programming Topics for more information.
NSPortCoder.h
© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-01-29)