Copyright ©1995 by NeXT Computer, Inc.  All Rights Reserved.


9



Mach Kit




Classes





NXConditionLock


Inherits From: Object
Conforms To: NXLock


Initializing an Instance

init Initialize a condition lock
initWith:(int)condition Initialize and set condition


Get the Condition of the Lock

  condition Return the condition


Acquire or Release the Lock

  lock Grab the lock
  lockWhen:(int)condition Wait for the condition
  unlock Release the lock
  unlockWith:(int)condition Release and set the condition




NXData


Inherits From: Object
Conforms To: NXTransport


Transporting Data

  encodeRemotelyFor: Has the data copied across a connection
(NXConnection *)connection
freeAfterEncoding:(BOOL *)flagp
isBycopy:(BOOL)isBycopy
  encodeUsing:(id <NXEncoding>)portal Encodes the data across a connection
  decodeUsing:(id <NXDecoding>)portal Encodes the data across a connection


Initializing and Freeing Instances

  initWithSize:(unsigned int) size Allocates memory for data
  initWithData:(void *)data Wraps preexisting data
size:(unsigned) size
dealloc:(BOOL) flag
  free Frees the object


Getting the Object's Data

  data Returns the data


Getting the Data's Size

  size Returns the size of the data


Copying the Object

  copyFromZone:(NXZone *)zone Copies the object




NXInvalidationNotifier


Inherits From: Object
Conforms To: NXReference


Counting References

  addReference Adds a reference
  free Removes a reference, but doesn't free object
  references Returns number of references


Initializing a New Object

  init Initializes an instance


Really Freeing an Object

  deallocate Frees an instance


Getting and Setting Validity

  invalidate Marks the object as invalid
   isValid Returns whether object is valid


Invalidation Notification

  registerForInvalidationNotification: Ensures object will be notified when receiver dies
(id <NXSenderIsInvalid>)anObject
  unregisterForInvalidationNotification: Removes object for notification list
(id <NXSenderIsInvalid>)anObject




NXLock


Inherits From: Object
Conforms To: NXLock


Acquire or Release a Lock

  lock Grab the lock
  unlock Release the lock




NXNetNameServer


Inherits From: Object


Making a Port Available

+ checkInPort:(NXPort *)nxport Advertises a port
withName:(const char *)aName


Removing a Port

+ checkOutPortWithName: Withdraws a port from public display
(const char *)name


Getting Ports

+ (NXPort *) lookUpPortWithName: Finds a port on the local host
(const char *)name
+ (NXPort *) lookUpPortWithName: Finds a port on a named host
(const char *)name
onHost:(const char *)hostname




NXPort


Inherits From: NXInvalidationNotifier : Object
Conforms To: NXReference (NXInvalidationNotifier)
NXTransport


Transporting Ports

  encodeRemotelyFor: Has the port copied across a connection
(NXConnection *)connection
freeAfterEncoding:(BOOL *)flagp
isBycopy:(BOOL)isBycopy
  encodeUsing:(id <NXEncoding>)portal Encodes the port across a connection
  decodeUsing:(id <NXDecoding>)portal Encodes the port across a connection


Creating an NXPort

+ new Creates a new NXPort object
+ newFromMachPort:(port_t) p Wraps an existing port
+ newFromMachPort:(port_t) p Wraps an existing port
dealloc:(BOOL) flag


Freeing an NXPort

  free Frees an NXPort object


Listening for Port Deaths

+ worryAboutPortInvalidation Forks a thread to listen for port deaths


Identifying the Mach Port

  machPort Returns the embedded mach port
  hash Returns a hashtable value for the object




NXProtocolChecker


Inherits From: Object


Initializing a Protocol Checker

  initWithObject:anObject Initializes a new object
forProtocol:(Protocol *)proto


Reimplemented Object Methods

  forward:(SEL)sel:(void *)args Passes allowed messages to its delegate
  (struct objc_method_description *)
descriptionForMethod:(SEL)sel Required for the run-time system
  free Frees the checker and/or its delegate




NXRecursiveLock


Inherits From: Object
Conforms To: NXLock


Acquire or Release a Lock

  lock Grab the lock
  unlock Release the lock




NXSpinLock


Inherits From: Object
Conforms To: NXLock


Acquire or Release a Lock

  lock Grab the lock
  unlock Release the lock