mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 09:41:15 +00:00
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@750 72102866-910b-0410-8b05-ffd578937521
43 lines
719 B
Objective-C
43 lines
719 B
Objective-C
|
|
@interface ProtocolEnforcer
|
|
{
|
|
id target;
|
|
Protocol *protocol;
|
|
}
|
|
|
|
- initWithProtocol: aProtocol target: anObj;
|
|
|
|
- (BOOL) conformsTo: aProtocol;
|
|
- forward: (SEL)sel :(arglist_t)frame;
|
|
|
|
@end
|
|
|
|
@implementation ProtocolEnforcer
|
|
|
|
- initWithProtocol: aProtocol target: anObj
|
|
{
|
|
[super init];
|
|
protocol = aProtocol;
|
|
target = anObj;
|
|
return self;
|
|
}
|
|
|
|
- (BOOL) conformsTo: aProtocol
|
|
{
|
|
if (aProtocol == protocol)
|
|
return YES;
|
|
else
|
|
return NO;
|
|
}
|
|
|
|
- (retval_t) forward: (SEL)sel :(arglist_t)frame
|
|
{
|
|
if ([protocol descriptionForInstanceMethod:sel])
|
|
return [target performv:sel :frame];
|
|
else
|
|
#warning Fix this
|
|
return
|
|
[self error:"We should punish the remote connection not the local one"];
|
|
}
|
|
|
|
@end
|