mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Remove another obsolete class
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@6734 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5d8d2bc9f8
commit
ed9a581514
12 changed files with 22 additions and 442 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
2000-06-19 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSDate.m: Remove obsolete classForConnectedCoder method
|
||||
* Source/NSPort.m: ditto
|
||||
* Source/NSTcpPort.m: ditto
|
||||
* Source/NSUdpPort.m: ditto
|
||||
* Source/GNUmakefile: remove ConnectedCoder
|
||||
* Source/ConnectedCoder.m: removed
|
||||
* Headers/gnustep/base/ConnectedCoder.h: removed
|
||||
|
||||
2000-06-16 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
Removal of non-OpenStep unused classes.
|
||||
|
|
|
@ -136,13 +136,6 @@
|
|||
+ newWithCoder: (Coder*)aDecoder;
|
||||
@end
|
||||
|
||||
@interface NSObject (CoderAdditions)
|
||||
/* <SelfCoding> not needed because of NSCoding */
|
||||
/* These methods here temporarily until ObjC runtime category bug fixed */
|
||||
- classForConnectedCoder:aRmc;
|
||||
+ (void) encodeObject: anObject withConnectedCoder: aRmc;
|
||||
@end
|
||||
|
||||
GS_EXPORT id CoderSignatureMalformedException;
|
||||
|
||||
#endif /* __Coder_h_GNUSTEP_BASE_INCLUDE */
|
||||
|
|
|
@ -1,82 +0,0 @@
|
|||
/* Interface for coder object for distributed objects
|
||||
Copyright (C) 1994, 1996 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Andrew Kachites McCallum <mccallum@gnu.ai.mit.edu>
|
||||
Date: July 1994
|
||||
|
||||
This file is part of the GNUstep Base Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
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.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
*/
|
||||
|
||||
#ifndef __ConnectedCoder_h
|
||||
#define __ConnectedCoder_h
|
||||
|
||||
#include <base/Coder.h>
|
||||
#include <base/Port.h>
|
||||
|
||||
/* ConnectedCoder identifiers */
|
||||
enum {
|
||||
METHOD_REQUEST = 0,
|
||||
METHOD_REPLY,
|
||||
ROOTPROXY_REQUEST,
|
||||
ROOTPROXY_REPLY,
|
||||
CONNECTION_SHUTDOWN,
|
||||
METHODTYPE_REQUEST, /* these two only needed with NeXT runtime */
|
||||
METHODTYPE_REPLY
|
||||
};
|
||||
|
||||
@class NSConnection;
|
||||
|
||||
@interface ConnectedEncoder : Encoder
|
||||
{
|
||||
NSConnection *connection;
|
||||
unsigned sequence_number;
|
||||
int identifier;
|
||||
}
|
||||
|
||||
+ newForWritingWithConnection: (NSConnection*)c
|
||||
sequenceNumber: (int)n
|
||||
identifier: (int)i;
|
||||
- (void) dismiss;
|
||||
|
||||
- connection;
|
||||
- (unsigned) sequenceNumber;
|
||||
- (int) identifier;
|
||||
|
||||
@end
|
||||
|
||||
@interface ConnectedDecoder : Decoder
|
||||
{
|
||||
NSConnection *connection;
|
||||
unsigned sequence_number;
|
||||
int identifier;
|
||||
}
|
||||
|
||||
+ newDecodingWithPacket: (InPacket*)packet
|
||||
connection: (NSConnection*)c;
|
||||
+ newDecodingWithConnection: (NSConnection*)c
|
||||
timeout: (int) timeout;
|
||||
- (void) dismiss;
|
||||
|
||||
- connection;
|
||||
- (unsigned) sequenceNumber;
|
||||
- (int) identifier;
|
||||
|
||||
- replyPort;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* __ConnectedCoder_h */
|
|
@ -27,12 +27,11 @@
|
|||
/*
|
||||
* Changes from GNU DO to OPENSTEP style DO
|
||||
*
|
||||
* Classes should implement [-classForPortCoder] instead of the old
|
||||
* [-classForConnectedCoder] to return the class that should be sent
|
||||
* over the wire.
|
||||
* Classes should implement [-classForPortCoder] to return the class
|
||||
* that should be sent over the wire.
|
||||
*
|
||||
* Classes should implement [-replacementObjectForPortCoder:] instead of
|
||||
* [+encodeObject:withConnectedCoder:] to encode objects.
|
||||
* Classes should implement [-replacementObjectForPortCoder:] to encode
|
||||
* objects.
|
||||
* The default action is to send a proxy.
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,318 +0,0 @@
|
|||
/* Implementation of coder object for remote messaging
|
||||
Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Andrew Kachites McCallum <mccallum@gnu.ai.mit.edu>
|
||||
Created: July 1994
|
||||
|
||||
This file is part of the GNUstep Base Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
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.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <base/preface.h>
|
||||
#include <base/ConnectedCoder.h>
|
||||
#include <base/CStream.h>
|
||||
#include <base/Port.h>
|
||||
#include <base/MemoryStream.h>
|
||||
#include <Foundation/NSConnection.h>
|
||||
#include <Foundation/NSProxy.h>
|
||||
#include <Foundation/NSException.h>
|
||||
#include <Foundation/NSRunLoop.h>
|
||||
|
||||
#define PTR2LONG(P) (((char*)(P))-(char*)0)
|
||||
#define LONG2PTR(L) (((char*)0)+(L))
|
||||
|
||||
#define DEFAULT_SIZE 256
|
||||
|
||||
#define CONNECTED_CODER_FORMAT_VERSION 0
|
||||
|
||||
static BOOL debug_connected_coder = NO;
|
||||
|
||||
@implementation ConnectedEncoder
|
||||
|
||||
- (void) writeSignature
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
- _initForWritingWithConnection: (NSConnection*)c
|
||||
sequenceNumber: (int)n
|
||||
identifier: (int)i
|
||||
{
|
||||
OutPacket* packet = [[[[c sendPort] outPacketClass] alloc]
|
||||
initForSendingWithCapacity: DEFAULT_SIZE
|
||||
replyInPort: [c receivePort]];
|
||||
[super initForWritingToStream: packet];
|
||||
[packet release];
|
||||
connection = c;
|
||||
sequence_number = n;
|
||||
identifier = i;
|
||||
[self encodeValueOfCType: @encode(typeof(sequence_number))
|
||||
at: &sequence_number
|
||||
withName: @"ConnectedCoder sequence number"];
|
||||
[self encodeValueOfCType: @encode(typeof(identifier))
|
||||
at: &identifier
|
||||
withName: @"ConnectedCoder sequence number"];
|
||||
return self;
|
||||
}
|
||||
|
||||
+ newForWritingWithConnection: (NSConnection*)c
|
||||
sequenceNumber: (int)n
|
||||
identifier: (int)i
|
||||
{
|
||||
/* Export this method and not the -init... method because eventually
|
||||
we may do some caching of old ConnectedEncoder's to speed things up. */
|
||||
return [[self alloc] _initForWritingWithConnection: c
|
||||
sequenceNumber: n
|
||||
identifier: i];
|
||||
}
|
||||
|
||||
- (void) dismiss
|
||||
{
|
||||
id packet = [cstream stream];
|
||||
[[connection sendPort] sendPacket: packet timeout:15.0];
|
||||
if (debug_connected_coder)
|
||||
fprintf(stderr, "dismiss 0x%x: #=%d i=%d %d\n",
|
||||
(unsigned)self, sequence_number, identifier,
|
||||
[packet streamEofPosition]);
|
||||
[self release];
|
||||
}
|
||||
|
||||
|
||||
/* Access to ivars. */
|
||||
|
||||
- (int) identifier
|
||||
{
|
||||
return identifier;
|
||||
}
|
||||
|
||||
- connection
|
||||
{
|
||||
return connection;
|
||||
}
|
||||
|
||||
- (unsigned) sequenceNumber
|
||||
{
|
||||
return sequence_number;
|
||||
}
|
||||
|
||||
|
||||
/* This is called by Coder's designated object encoder */
|
||||
- (void) _doEncodeObject: anObj
|
||||
{
|
||||
id c = [anObj classForConnectedCoder: self];
|
||||
/* xxx Should I also do classname substition here? */
|
||||
[self encodeClass: c];
|
||||
[c encodeObject: anObj withConnectedCoder: self];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation ConnectedDecoder
|
||||
|
||||
+ (void) readSignatureFromCStream: (id <CStreaming>) cs
|
||||
getClassname: (char *) name
|
||||
formatVersion: (int*) version
|
||||
{
|
||||
const char *classname = class_get_class_name (self);
|
||||
strcpy (name, classname);
|
||||
*version = CONNECTED_CODER_FORMAT_VERSION;
|
||||
}
|
||||
|
||||
|
||||
+ newDecodingWithConnection: (NSConnection*)c
|
||||
timeout: (int) timeout
|
||||
{
|
||||
ConnectedDecoder *cd;
|
||||
id in_port;
|
||||
id packet;
|
||||
id reply_port;
|
||||
|
||||
/* Try to get a packet. */
|
||||
in_port = [c receivePort];
|
||||
packet = [in_port receivePacketWithTimeout: timeout];
|
||||
if (!packet)
|
||||
return nil; /* timeout */
|
||||
|
||||
/* Create the new ConnectedDecoder */
|
||||
cd = [self newReadingFromStream: packet];
|
||||
[packet release];
|
||||
reply_port = [packet replyPort];
|
||||
cd->connection = [NSConnection newForInPort: in_port
|
||||
outPort: reply_port
|
||||
ancestorConnection: c];
|
||||
|
||||
/* Decode the ConnectedDecoder's ivars. */
|
||||
[cd decodeValueOfCType: @encode(typeof(cd->sequence_number))
|
||||
at: &(cd->sequence_number)
|
||||
withName: NULL];
|
||||
[cd decodeValueOfCType: @encode(typeof(cd->identifier))
|
||||
at: &(cd->identifier)
|
||||
withName: NULL];
|
||||
|
||||
if (debug_connected_coder)
|
||||
fprintf(stderr, "newDecoding #=%d id=%d\n",
|
||||
cd->sequence_number, cd->identifier);
|
||||
return cd;
|
||||
}
|
||||
|
||||
+ newDecodingWithPacket: (InPacket*)packet
|
||||
connection: (NSConnection*)c
|
||||
{
|
||||
ConnectedDecoder *cd;
|
||||
id in_port;
|
||||
id reply_port;
|
||||
|
||||
in_port = [c receivePort];
|
||||
|
||||
/* Create the new ConnectedDecoder */
|
||||
cd = [self newReadingFromStream: packet];
|
||||
[packet release];
|
||||
reply_port = [packet replyOutPort];
|
||||
cd->connection = [NSConnection newForInPort: in_port
|
||||
outPort: reply_port
|
||||
ancestorConnection: c];
|
||||
|
||||
/* Decode the ConnectedDecoder's ivars. */
|
||||
[cd decodeValueOfCType: @encode(typeof(cd->sequence_number))
|
||||
at: &(cd->sequence_number)
|
||||
withName: NULL];
|
||||
[cd decodeValueOfCType: @encode(typeof(cd->identifier))
|
||||
at: &(cd->identifier)
|
||||
withName: NULL];
|
||||
|
||||
if (debug_connected_coder)
|
||||
fprintf(stderr, "newDecoding #=%d id=%d\n",
|
||||
cd->sequence_number, cd->identifier);
|
||||
return cd;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#if CONNECTION_WIDE_OBJECT_REFERENCES
|
||||
|
||||
/* xxx We need to think carefully about reference counts, bycopy and
|
||||
remote objects before we do this. */
|
||||
|
||||
/* Some notes:
|
||||
|
||||
Is it really more efficient to send "retain" messages across the
|
||||
wire than to resend the object?
|
||||
|
||||
How is this related to bycopy objects? Yipes.
|
||||
|
||||
Never let a Proxy be free'd completely until the connection does
|
||||
down? The other connection is assuming we'll keep track of it and
|
||||
be able to access it simply by the reference number.
|
||||
|
||||
Even if this is unacceptable, and we always have to sent enough info
|
||||
to be able to recreate the proxy, we still win with the choice of
|
||||
+encodeObject:withConnectedCoder because we avoid having
|
||||
to keep around the local proxies. */
|
||||
|
||||
#warning These names need to be updated for the new xref scheme.
|
||||
|
||||
- (BOOL) _coderReferenceForObject: xref
|
||||
{
|
||||
if (is_decoding)
|
||||
return [connection includesProxyForTarget:xref];
|
||||
else
|
||||
return [connection includesLocalObject:(id)LONG2PTR(xref)];
|
||||
}
|
||||
|
||||
- _coderObjectAtReference: (unsigned)xref;
|
||||
{
|
||||
if (is_decoding)
|
||||
return [connection proxyForTarget:xref];
|
||||
else
|
||||
return (id)LONG2PTR(xref);
|
||||
}
|
||||
|
||||
- (void) _coderPutObject: anObj atReference: (unsigned)xref
|
||||
{
|
||||
/* xxx But we need to deal with bycopy's too!!! Not all of the
|
||||
"anObj"s are Proxies! */
|
||||
if (is_decoding)
|
||||
{
|
||||
NSAssert([anObj isProxy], NSInternalInconsistencyException);
|
||||
/* This gets done in Proxy +newForRemote:connection:
|
||||
[connection addProxy:anObj]; */
|
||||
}
|
||||
else
|
||||
{
|
||||
NSAssert(PTR2LONG(anObj) == xref, NSInternalInconsistencyException);
|
||||
[connection addLocalObject:anObj];
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* CONNECTION_WIDE_REFERENCES */
|
||||
|
||||
|
||||
/* Access to ivars. */
|
||||
|
||||
- (int) identifier
|
||||
{
|
||||
return identifier;
|
||||
}
|
||||
|
||||
- connection
|
||||
{
|
||||
return connection;
|
||||
}
|
||||
|
||||
- replyPort
|
||||
{
|
||||
return [(id)[cstream stream] replyPort];
|
||||
}
|
||||
|
||||
- (unsigned) sequenceNumber
|
||||
{
|
||||
return sequence_number;
|
||||
}
|
||||
|
||||
- (void) resetConnectedCoder /* xxx rename resetCoder */
|
||||
{
|
||||
[self notImplemented:_cmd];
|
||||
/* prepare the receiver to do it's stuff again,
|
||||
save time by doing this instead of free/malloc for each message */
|
||||
}
|
||||
|
||||
- (void) dismiss
|
||||
{
|
||||
[self release];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation NSObject (ConnectedCoderCallbacks)
|
||||
|
||||
/* By default, Object's encode themselves as proxies across Connection's */
|
||||
- classForConnectedCoder: aRmc
|
||||
{
|
||||
return [[aRmc connection] proxyClass];
|
||||
}
|
||||
|
||||
/* But if any object overrides the above method to return [Object class]
|
||||
instead, the Object implementation of the coding method will actually
|
||||
encode the object itself, not a proxy */
|
||||
+ (void) encodeObject: anObject withConnectedCoder: aRmc
|
||||
{
|
||||
[anObject encodeWithCoder: aRmc];
|
||||
}
|
||||
|
||||
@end
|
|
@ -580,7 +580,7 @@ my_object_is_class(id object)
|
|||
to the object, we're actually going to encode an object (either a
|
||||
proxy to the object or the object itself).
|
||||
|
||||
ConnectedCoder overrides _doEncodeObject: in order to implement
|
||||
NSPortCoder overrides _doEncodeObject: in order to implement
|
||||
the encoding of proxies. */
|
||||
|
||||
- (void) _doEncodeBycopyObject: anObj
|
||||
|
|
|
@ -70,7 +70,6 @@ FILE_AUTHORS = \
|
|||
|
||||
GNU_MFILES = \
|
||||
BinaryCStream.m \
|
||||
ConnectedCoder.m \
|
||||
Coder.m \
|
||||
CStream.m \
|
||||
Decoder.m \
|
||||
|
@ -137,7 +136,6 @@ BinaryCStream.h \
|
|||
Coder.h \
|
||||
CoderPrivate.h \
|
||||
Coding.h \
|
||||
ConnectedCoder.h \
|
||||
CStream.h \
|
||||
CStreaming.h \
|
||||
Enumerating.h \
|
||||
|
|
|
@ -861,18 +861,13 @@ GSTimeNow()
|
|||
return NSCopyObject(self, 0, zone);
|
||||
}
|
||||
|
||||
- (Class) classForConnectedCoder: aRmc
|
||||
- (Class) classForPortCoder
|
||||
{
|
||||
/* Make sure that Connection's always send us bycopy,
|
||||
i.e. as our own class, not a Proxy class. */
|
||||
return abstractClass;
|
||||
}
|
||||
|
||||
- (Class) classForPortCoder
|
||||
{
|
||||
return abstractClass;
|
||||
}
|
||||
|
||||
- replacementObjectForPortCoder: aRmc
|
||||
{
|
||||
return self;
|
||||
|
|
|
@ -48,8 +48,8 @@ static BOOL debug_connected_coder = NO;
|
|||
/*
|
||||
* The PortEncoder class is essentially the old ConnectedEncoder class
|
||||
* with a name change.
|
||||
* It uses the OPENSTEP method [-classForPortCoder] rather than the
|
||||
* [-classForConnectedCoder] method to ask an object what class to encode.
|
||||
* It uses the OPENSTEP method [-classForPortCoder] to ask an object
|
||||
* what class to encode.
|
||||
*/
|
||||
@interface PortEncoder : Encoder
|
||||
{
|
||||
|
|
|
@ -54,17 +54,12 @@
|
|||
return nil;
|
||||
}
|
||||
|
||||
- (Class) classForConnectedCoder: aRmc
|
||||
- (Class) classForPortCoder
|
||||
{
|
||||
/* Make sure that Connection's always send us bycopy,
|
||||
i.e. as our own class, not a Proxy class. */
|
||||
return [self class];
|
||||
}
|
||||
|
||||
- (Class) classForPortCoder
|
||||
{
|
||||
return [self class];
|
||||
}
|
||||
- replacementObjectForPortCoder: aRmc
|
||||
{
|
||||
return self;
|
||||
|
|
|
@ -915,17 +915,12 @@ static NSMapTable* port_number_2_port;
|
|||
_port_socket];
|
||||
}
|
||||
|
||||
- (Class) classForConnectedCoder: aRmc
|
||||
- (Class) classForPortCoder
|
||||
{
|
||||
/* Make sure that Connection's always send us bycopy, not a Proxy class.
|
||||
Also, encode a "send right" (ala Mach), not the "receive right". */
|
||||
return [TcpOutPort class];
|
||||
}
|
||||
|
||||
- (Class) classForPortCoder
|
||||
{
|
||||
return [TcpOutPort class];
|
||||
}
|
||||
- replacementObjectForPortCoder: aRmc
|
||||
{
|
||||
return self;
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include <config.h>
|
||||
#include <base/UdpPort.h>
|
||||
#include <base/Coder.h>
|
||||
#include <base/ConnectedCoder.h>
|
||||
#include <Foundation/NSPortCoder.h>
|
||||
#include <Foundation/NSLock.h>
|
||||
#include <Foundation/NSException.h>
|
||||
#include <Foundation/NSHost.h>
|
||||
|
@ -283,17 +283,12 @@ static NSMapTable *port_number_2_in_port = NULL;
|
|||
return [UdpInPacket class];
|
||||
}
|
||||
|
||||
- (Class) classForConnectedCoder: aRmc
|
||||
- (Class) classForPortCoder
|
||||
{
|
||||
/* Make sure that Connection's always send us bycopy, not a Proxy class.
|
||||
Also, don't encode a "receive right" (ala Mach), encode a "send right". */
|
||||
return [UdpOutPort class];
|
||||
}
|
||||
|
||||
- (Class) classForPortCoder
|
||||
{
|
||||
return [UdpOutPort class];
|
||||
}
|
||||
- replacementObjectForPortCoder: aRmc
|
||||
{
|
||||
return self;
|
||||
|
|
Loading…
Reference in a new issue