Zen API

- Home
- Topics
- Types
- Files

All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kCollection.h
Go to the documentation of this file.
1
10 #ifndef K_API_COLLECTION_H
11 #define K_API_COLLECTION_H
12
13 #include <kApi/kApiDef.h>
14 #include <kApi/Data/kCollection.x.h>
15
40 //typedef kObject kCollection; --forward-declared in kApiDef.x.h
41
52 //typedef kPointer kIterator; --forward-declared in kApiDef.x.h
53
61 kInlineFx(kType) kCollection_ItemType(kCollection collection)
62 {
63 return xkCollection_VTable(collection)->VItemType(collection);
64 }
65
73 kInlineFx(kSize) kCollection_Count(kCollection collection)
74 {
75 return xkCollection_VTable(collection)->VCount(collection);
76 }
77
85 kInlineFx(kIterator) kCollection_GetIterator(kCollection collection)
86 {
87 return xkCollection_VTable(collection)->VGetIterator(collection);
88 }
89
98 kInlineFx(kBool) kCollection_HasNext(kCollection collection, kIterator iterator)
99 {
100 return xkCollection_VTable(collection)->VHasNext(collection, iterator);
101 }
102
111 kInlineFx(void*) kCollection_Next(kCollection collection, kIterator* iterator)
112 {
113 return xkCollection_VTable(collection)->VNext(collection, iterator);
114 }
115
128 #define kCollection_NextT(kCollection_collection, kIteratorPtr_iterator, T) \
129 kCast(T*, xkCollection_NextT(kCollection_collection, kIteratorPtr_iterator, sizeof(T)))
130
131 #endif
kCollection::kCollection_ItemType
kType kCollection_ItemType(kCollection collection)
Gets the collection element type.
Definition: kCollection.h:61
kCollection
Supports forward iteration over a collection of items.
kSize
Represents an unsigned integer that can store a pointer address.
kInlineFx
#define kInlineFx(TYPE)
Inline method declaration helper.
Definition: kApiDef.h:26
kIterator
Used in conjunction with the kCollection class to iterate over elements.
kCollection::kCollection_HasNext
kBool kCollection_HasNext(kCollection collection, kIterator iterator)
Determines whether a collection has another item.
Definition: kCollection.h:98
kApiDef.h
Core Zen type declarations.
kCollection::kCollection_Next
void * kCollection_Next(kCollection collection, kIterator *iterator)
Gets a pointer to the next collection element and then advances the iterator.
Definition: kCollection.h:111
kType
Represents metadata about a type (class, interface, or value).
kBool
Represents a boolean value.
kCollection::kCollection_Count
kSize kCollection_Count(kCollection collection)
Gets the collection element count.
Definition: kCollection.h:73
kCollection::kCollection_GetIterator
kIterator kCollection_GetIterator(kCollection collection)
Returns an iterator to the first element in the collection.
Definition: kCollection.h:85