2
Copyright (C) 2000-2005 SKYRIX Software AG
4
This file is part of SOPE.
6
SOPE is free software; you can redistribute it and/or modify it under
7
the terms of the GNU Lesser General Public License as published by the
8
Free Software Foundation; either version 2, or (at your option) any
11
SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
12
WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14
License for more details.
16
You should have received a copy of the GNU Lesser General Public
17
License along with SOPE; see the file COPYING. If not, write to the
18
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22
#ifndef __NGExtensions_NGBitSet_H__
23
#define __NGExtensions_NGBitSet_H__
25
#import <Foundation/NSObject.h>
26
#import <Foundation/NSRange.h>
28
@class NSArray, NSEnumerator;
30
typedef unsigned int NGBitSetStorage;
32
@protocol NGBitSet < NSObject >
36
- (unsigned int)count;
40
- (BOOL)isMember:(unsigned int)_element;
41
- (void)addMember:(unsigned int)_element;
42
- (void)addMembersInRange:(NSRange)_range;
43
- (void)removeMember:(unsigned int)_element;
44
- (void)removeMembersInRange:(NSRange)_range;
45
- (void)removeAllMembers;
49
@interface NGBitSet : NSObject < NGBitSet, NSCopying, NSCoding >
52
unsigned int universe;
54
NGBitSetStorage *storage;
58
+ (id)bitSetWithCapacity:(unsigned)_capacity;
59
+ (id)bitSetWithBitSet:(NGBitSet *)_set;
61
- (id)initWithCapacity:(unsigned)_capacity; // designated initializer
62
- (id)initWithBitSet:(NGBitSet *)_set;
63
- (id)initWithNullTerminatedArray:(unsigned int *)_array;
67
- (unsigned int)capacity;
71
- (unsigned int)firstMember;
72
- (unsigned int)lastMember;
73
- (void)addMembersFromBitSet:(NGBitSet *)_set;
77
- (BOOL)isEqual:(id)_object;
78
- (BOOL)isEqualToSet:(NGBitSet *)_set;
82
- (NSEnumerator *)objectEnumerator;
87
- (id)copyWithZone:(NSZone *)_zone;
91
- (void)encodeWithCoder:(NSCoder *)_coder;
92
- (id)initWithCoder:(NSCoder *)_coder;
96
- (NSString *)description;
101
NSString *stringValueForBitset(unsigned int _set, char _setC, char _unsetC,
104
#endif /* __NGExtensions_NGBitSet_H__ */