~ubuntu-branches/ubuntu/edgy/sope/edgy

« back to all changes in this revision

Viewing changes to libFoundation/Foundation/NSConcreteSet.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Ley
  • Date: 2005-08-19 16:53:31 UTC
  • Revision ID: james.westby@ubuntu.com-20050819165331-hs683wz1osm708pw
Tags: upstream-4.4rc.2
ImportĀ upstreamĀ versionĀ 4.4rc.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
   NSConcreteSet.h
 
3
 
 
4
   Copyright (C) 1995, 1996 Ovidiu Predescu and Mircea Oancea.
 
5
   All rights reserved.
 
6
 
 
7
   Author: Mircea Oancea <mircea@jupiter.elcom.pub.ro>
 
8
 
 
9
   This file is part of libFoundation.
 
10
 
 
11
   Permission to use, copy, modify, and distribute this software and its
 
12
   documentation for any purpose and without fee is hereby granted, provided
 
13
   that the above copyright notice appear in all copies and that both that
 
14
   copyright notice and this permission notice appear in supporting
 
15
   documentation.
 
16
 
 
17
   We disclaim all warranties with regard to this software, including all
 
18
   implied warranties of merchantability and fitness, in no event shall
 
19
   we be liable for any special, indirect or consequential damages or any
 
20
   damages whatsoever resulting from loss of use, data or profits, whether in
 
21
   an action of contract, negligence or other tortious action, arising out of
 
22
   or in connection with the use or performance of this software.
 
23
*/
 
24
 
 
25
#ifndef __NSConcreteSet_h__
 
26
#define __NSConcreteSet_h__
 
27
 
 
28
#include <Foundation/NSSet.h>
 
29
#include <Foundation/NSEnumerator.h>
 
30
#include <Foundation/NSUtilities.h>
 
31
 
 
32
/*
 
33
 * Concrete class for NSSet
 
34
 */
 
35
 
 
36
@interface NSConcreteSet : NSSet
 
37
{
 
38
    NSHashTable* table;
 
39
}
 
40
 
 
41
/* Allocating and Initializing */
 
42
 
 
43
- (id)init;
 
44
- (id)initWithObjects:(id*)objects count:(unsigned int)count;
 
45
- (id)initWithSet:(NSSet *)set copyItems:(BOOL)flag;
 
46
 
 
47
/* Accessing keys and values */
 
48
 
 
49
- (unsigned int)count;
 
50
- (id)member:(id)anObject;
 
51
- (NSEnumerator *)objectEnumerator;
 
52
 
 
53
/* Private methods */
 
54
 
 
55
- (void)__setObjectEnumerator:(void*)en;
 
56
 
 
57
@end
 
58
 
 
59
/*
 
60
 * Concrete class for NSMutableSet
 
61
 */
 
62
 
 
63
@interface NSConcreteMutableSet : NSMutableSet
 
64
{
 
65
    NSHashTable* table;
 
66
}
 
67
 
 
68
/* Allocating and Initializing */
 
69
 
 
70
- (id)init;
 
71
- (id)initWithObjects:(id*)objects count:(unsigned int)count;
 
72
- (id)initWithSet:(NSSet *)set copyItems:(BOOL)flag;
 
73
 
 
74
/* Accessing keys and values */
 
75
 
 
76
- (unsigned int)count;
 
77
- (id)member:(id)anObject;
 
78
- (NSEnumerator *)objectEnumerator;
 
79
 
 
80
/* Add and remove entries */
 
81
 
 
82
- (void)addObject:(id)object;
 
83
- (void)removeObject:(id)object;
 
84
- (void)removeAllObjects;
 
85
 
 
86
/* Private methods */
 
87
 
 
88
- (void)__setObjectEnumerator:(void*)en;
 
89
 
 
90
@end
 
91
 
 
92
/*
 
93
 * _NSConcreteSetEnumerator class
 
94
 */
 
95
 
 
96
typedef enum {setEnumHash, setEnumMap} SetEnumMode;
 
97
 
 
98
@interface _NSConcreteSetEnumerator : NSEnumerator
 
99
{
 
100
    id set;
 
101
    SetEnumMode mode;
 
102
    union {
 
103
        NSMapEnumerator  map;
 
104
        NSHashEnumerator hash;
 
105
    } enumerator;
 
106
}
 
107
 
 
108
- (id)initWithSet:(NSSet*)_set mode:(SetEnumMode)_mode;
 
109
- (id)nextObject;
 
110
 
 
111
@end /* _NSConcreteSetEnumerator */
 
112
 
 
113
#endif /* __NSConcreteSet_h__ */
 
114
 
 
115
/*
 
116
  Local Variables:
 
117
  c-basic-offset: 4
 
118
  tab-width: 8
 
119
  End:
 
120
*/