libs-base/Source/ProtocolEnforcer.m
mccallum 759a52916e Initial revision
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@750 72102866-910b-0410-8b05-ffd578937521
1996-01-22 23:22:11 +00:00

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