2003-07-22 08:52:37 +00:00
|
|
|
/** Interface of NSPortNameServer class for Distributed Objects
|
|
|
|
Copyright (C) 1998,1999,2003 Free Software Foundation, Inc.
|
1998-10-29 12:50:23 +00:00
|
|
|
|
|
|
|
Written by: Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
|
|
|
Created: October 1998
|
|
|
|
|
|
|
|
This file is part of the GNUstep Base Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
2007-09-14 11:36:11 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
1998-10-29 12:50:23 +00:00
|
|
|
License as published by the Free Software Foundation; either
|
2008-06-08 10:38:33 +00:00
|
|
|
version 2 of the License, or (at your option) any later version.
|
1998-10-29 12:50:23 +00:00
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
2007-09-14 11:36:11 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
1998-10-29 12:50:23 +00:00
|
|
|
License along with this library; if not, write to the Free
|
2006-10-31 07:05:46 +00:00
|
|
|
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02111 USA.
|
2003-07-22 08:52:37 +00:00
|
|
|
|
2003-07-22 09:13:04 +00:00
|
|
|
<title>NSPortNameServer class reference</title>
|
|
|
|
|
2003-07-22 08:52:37 +00:00
|
|
|
AutogsdocSource: NSPortNameServer.m
|
|
|
|
AutogsdocSource: NSSocketPortNameServer.m
|
|
|
|
AutogsdocSource: NSMessagePortNameServer.m
|
|
|
|
|
1998-10-29 12:50:23 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __NSPortNameServer_h_GNUSTEP_BASE_INCLUDE
|
|
|
|
#define __NSPortNameServer_h_GNUSTEP_BASE_INCLUDE
|
2006-10-31 07:05:46 +00:00
|
|
|
#import <GNUstepBase/GSVersionMacros.h>
|
1998-10-29 12:50:23 +00:00
|
|
|
|
2006-10-31 07:05:46 +00:00
|
|
|
#import <Foundation/NSObject.h>
|
|
|
|
#import <Foundation/NSMapTable.h>
|
1998-10-29 12:50:23 +00:00
|
|
|
|
2006-10-19 06:44:54 +00:00
|
|
|
#if OS_API_VERSION(GS_API_MACOSX,HS_API_LATEST)
|
|
|
|
|
2006-09-13 10:20:49 +00:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
1999-09-21 19:07:27 +00:00
|
|
|
@class NSPort, NSString, NSMutableArray;
|
1998-10-29 12:50:23 +00:00
|
|
|
|
|
|
|
@interface NSPortNameServer : NSObject
|
2000-07-04 09:49:31 +00:00
|
|
|
+ (id) systemDefaultPortNameServer;
|
1998-10-29 12:50:23 +00:00
|
|
|
- (NSPort*) portForName: (NSString*)name;
|
|
|
|
- (NSPort*) portForName: (NSString*)name
|
|
|
|
onHost: (NSString*)host;
|
|
|
|
- (BOOL) registerPort: (NSPort*)port
|
|
|
|
forName: (NSString*)name;
|
2001-07-15 09:08:27 +00:00
|
|
|
- (BOOL) removePortForName: (NSString*)name;
|
1998-10-29 12:50:23 +00:00
|
|
|
@end
|
|
|
|
|
2003-07-15 05:21:34 +00:00
|
|
|
@interface NSSocketPortNameServer : NSPortNameServer
|
|
|
|
{
|
2010-02-14 10:48:10 +00:00
|
|
|
#if GS_EXPOSE(NSSocketPortNameServer)
|
2003-07-15 05:21:34 +00:00
|
|
|
NSMapTable *_portMap; /* Registered ports information. */
|
|
|
|
NSMapTable *_nameMap; /* Registered names information. */
|
2010-03-02 09:51:12 +00:00
|
|
|
#endif
|
2011-02-16 05:49:45 +00:00
|
|
|
#if GS_NONFRAGILE
|
|
|
|
#else
|
2011-02-14 06:37:45 +00:00
|
|
|
/* Pointer to private additional data used to avoid breaking ABI
|
|
|
|
* when we don't have the non-fragile ABI available.
|
2011-02-16 05:49:45 +00:00
|
|
|
* Use this mechanism rather than changing the instance variable
|
|
|
|
* layout (see Source/GSInternal.h for details).
|
2011-02-14 06:37:45 +00:00
|
|
|
*/
|
2011-03-05 18:12:55 +00:00
|
|
|
@private id _internal GS_UNUSED_IVAR;
|
2011-02-14 06:37:45 +00:00
|
|
|
#endif
|
2003-07-15 05:21:34 +00:00
|
|
|
}
|
|
|
|
+ (id) sharedInstance;
|
2003-07-22 08:52:37 +00:00
|
|
|
- (NSPort*) portForName: (NSString*)name
|
|
|
|
onHost: (NSString*)host;
|
|
|
|
- (BOOL) registerPort: (NSPort*)port
|
|
|
|
forName: (NSString*)name;
|
|
|
|
- (BOOL) removePortForName: (NSString*)name;
|
2003-07-15 05:21:34 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
@interface NSMessagePortNameServer : NSPortNameServer
|
|
|
|
+ (id) sharedInstance;
|
2006-10-19 06:44:54 +00:00
|
|
|
|
|
|
|
/** Returns the [NSMessagePort] instance registered for the specified name
|
|
|
|
* if it exists on the local host.
|
|
|
|
*/
|
|
|
|
- (NSPort*) portForName: (NSString*)name;
|
|
|
|
|
|
|
|
/** Returns the port registered for the specified name (if it exists).<br />
|
|
|
|
* The host must be an empty string or nil, since [NSMessagePort] instances
|
|
|
|
* on other hosts are inaccessible from the current host.
|
|
|
|
*/
|
|
|
|
- (NSPort*) portForName: (NSString*)name
|
|
|
|
onHost: (NSString*)host;
|
2003-07-15 05:21:34 +00:00
|
|
|
@end
|
|
|
|
|
2006-09-13 10:20:49 +00:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
1998-10-29 12:50:23 +00:00
|
|
|
#endif
|
|
|
|
|
2006-10-19 06:44:54 +00:00
|
|
|
#endif
|
|
|
|
|