OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc/] [execute/] [formal_protocol-7.m] - Blame information for rev 702

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 702 jeremybenn
/* Contributed by Nicola Pero - Fri Mar  9 21:35:47 CET 2001 */
2
 
3
#include <stdlib.h>
4
#include <objc/Protocol.h>
5
#include "../../objc-obj-c++-shared/TestsuiteObject.m"
6
 
7
/* Test defining two protocols, one incorporating the other one. */
8
 
9
@protocol Configuring
10
- (void) configure;
11
@end
12
 
13
@protocol Processing <Configuring>
14
- (void) process;
15
@end
16
 
17
/* A class adopting the protocol */
18
@interface Test : TestsuiteObject <Processing>
19
{
20
  BOOL didConfigure;
21
  BOOL didProcess;
22
}
23
@end
24
 
25
@implementation Test
26
- (void) configure
27
{
28
  didConfigure = YES;
29
}
30
- (void) process
31
{
32
  didProcess = YES;
33
}
34
@end
35
 
36
int main (void)
37
{
38
  id <Processing> object = [Test new];
39
 
40
  [object configure];
41
  [object process];
42
 
43
  return 0;
44
}
45
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.