mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
Tidied method signature stuff
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2984 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
dfb3caad5a
commit
e2a88e91e3
2 changed files with 28 additions and 2 deletions
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <Foundation/DistributedObjects.h>
|
#include <Foundation/DistributedObjects.h>
|
||||||
|
#include <Foundation/NSMethodSignature.h>
|
||||||
#include <Foundation/NSException.h>
|
#include <Foundation/NSException.h>
|
||||||
|
|
||||||
static int debug_proxy;
|
static int debug_proxy;
|
||||||
|
@ -299,6 +300,30 @@ format: @"NSDistantObject objects only encode with PortEncoder class"];
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSMethodSignature*) methodSignatureForSelector: (SEL)aSelector
|
||||||
|
{
|
||||||
|
const char *types = 0;
|
||||||
|
|
||||||
|
if (_protocol) {
|
||||||
|
struct objc_method_description* mth;
|
||||||
|
|
||||||
|
mth = [_protocol descriptionForInstanceMethod: aSelector];
|
||||||
|
if (mth == 0) {
|
||||||
|
mth = [_protocol descriptionForClassMethod: aSelector];
|
||||||
|
}
|
||||||
|
if (mth != 0) {
|
||||||
|
types = mth->types;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
types = [self selectorTypeForProxy: aSelector];
|
||||||
|
}
|
||||||
|
if (types == 0) {
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
return [NSMethodSignature signatureWithObjCTypes: types];
|
||||||
|
}
|
||||||
|
|
||||||
- (void) setProtocolForProxy: (Protocol*)aProtocol
|
- (void) setProtocolForProxy: (Protocol*)aProtocol
|
||||||
{
|
{
|
||||||
_protocol = aProtocol;
|
_protocol = aProtocol;
|
||||||
|
|
|
@ -120,7 +120,7 @@
|
||||||
- (void) forwardInvocation: (NSInvocation*)anInvocation
|
- (void) forwardInvocation: (NSInvocation*)anInvocation
|
||||||
{
|
{
|
||||||
[NSException raise: NSInvalidArgumentException
|
[NSException raise: NSInvalidArgumentException
|
||||||
format: @"NSProxy should does not implement '%s'",
|
format: @"NSProxy should not implement '%s'",
|
||||||
sel_get_name(_cmd)];
|
sel_get_name(_cmd)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,7 +171,8 @@
|
||||||
|
|
||||||
- (NSMethodSignature*) methodSignatureForSelector: (SEL)aSelector
|
- (NSMethodSignature*) methodSignatureForSelector: (SEL)aSelector
|
||||||
{
|
{
|
||||||
[self notImplemented: _cmd];
|
[NSException raise: NSInvalidArgumentException format:
|
||||||
|
@"NSProxy should not implement 'methodSignatureForSelector:'"];
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue