picofuse-objc

NXMap.h
Go to the documentation of this file.
1 
5 #pragma once
6 #include "NXCollection.h"
7 #include <stddef.h>
8 #include <stdint.h>
9 
31 @interface NXMap : NXObject <NXCollection> {
32 @private
33  void *_entries;
34  size_t _count;
35  size_t _capacity;
36  unsigned _shift;
37  unsigned long _mutations;
38  uintptr_t _changing;
39 }
40 
44 + (id)map;
45 
50 + (id)mapWithCapacity:(size_t)capacity;
51 
57 + (id)mapWithKeysAndObjects:(id)firstKey, ...;
58 
68 + (id)mapWithObjects:(NXArray *)objects forKeys:(NXArray *)keys;
69 
73 - (id)initWithCapacity:(size_t)capacity;
74 
78 - (size_t)count;
79 
83 - (id)objectForKey:(id)key;
84 
88 - (BOOL)containsObject:(id)key;
89 
95 - (BOOL)setObject:(id)object forKey:(id)key;
96 
101 - (BOOL)removeObjectForKey:(id)key;
102 
106 - (void)removeAllObjects;
107 
111 - (NXArray *)allKeys;
112 
117 - (NXArray *)allObjects;
118 
123 - (BOOL)isEqual:(id)anObject;
124 
128 - (uintptr_t)hash;
129 
134 - (id)copy;
135 
139 - (NXString *)description;
140 
141 @end
uintptr_t hash()
Returns a hash of the keys and objects, which is the same for equal maps.
Objects found by keys, which can be changed.
Definition: NXMap.h:31
void removeAllObjects()
Removes every key and object, but keeps the room for them.
size_t count()
Returns the number of keys.
Defines the NXCollection protocol, for objects which hold other objects.
NXString * description()
Returns the descriptions of the keys and objects, such as "{a: 1, b: 2}".
id copy()
Returns a new map of the same keys and objects, or nil if there isn&#39;t enough memory.
id map()
Returns an empty map.
bool BOOL
A Boolean value.
Definition: runtime.h:60
NXArray * allKeys()
Returns the keys, in no particular order, or nil if there isn&#39;t enough memory.
A string of UTF-8 text.
Definition: NXString.h:53
An ordered list of objects, which can be changed.
Definition: NXArray.h:26
The base class for objects in the Foundation framework.
Definition: NXObject.h:28
Objects which hold other objects, such as arrays, which can be gone through with a for...
Definition: NXCollection.h:19
struct objc_object * id
A pointer to an instance of a class.
Definition: runtime.h:18
NXArray * allObjects()
Returns the objects, in the same order as allKeys, or nil if there isn&#39;t enough memory.