OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [objc/] [execute/] [formal_protocol-7.m] - Blame information for rev 384

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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