iMinor fox for DO

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@17266 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2003-07-20 18:43:35 +00:00
parent 0f25da62f0
commit 2c6ab181bd
3 changed files with 41 additions and 9 deletions

View file

@ -32,7 +32,10 @@
#include "Foundation/NSAutoreleasePool.h"
#include "Foundation/NSException.h"
#include "Foundation/NSObjCRuntime.h"
#include <limits.h>
#include "Foundation/NSDistantObject.h"
#include "Foundation/NSPortCoder.h"
@class NSDistantObject;
#ifndef NeXT_RUNTIME
extern BOOL __objc_responds_to(id, SEL);
@ -191,6 +194,14 @@ extern BOOL __objc_responds_to(id, SEL);
return self;
}
/**
* Dummy method ... returns the receiver.
*/
- (id) awakeAfterUsingCoder: (NSCoder*)aDecoder
{
return self;
}
/**
* Returns the class of the receiver.
*/
@ -433,6 +444,30 @@ extern BOOL __objc_responds_to(id, SEL);
#endif
}
/**
* Returns the actual object to be encoded for sending over the
* network on a Distributed Objects connection.
*/
- (id) replacementObjectForPortCoder: (NSPortCoder*)aCoder
{
static Class proxyClass = 0;
static IMP proxyImp = 0;
if (proxyImp == 0)
{
proxyClass = [NSDistantObject class];
/*
* use get_imp() because NSDistantObject doesn't implement
* methodForSelector:
*/
proxyImp = get_imp(GSObjCClass((id)proxyClass),
@selector(proxyWithLocal:connection:));
}
return (*proxyImp)(proxyClass, @selector(proxyWithLocal:connection:),
self, [aCoder connection]);
}
/**
* If we respond to the method directly, return YES, otherwise
* forward this request to the object we are acting as a proxy for.