Kiwi Engine
VM for interpreter
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
KEArray.h
Go to the documentation of this file.
1 
8 #ifndef KEARRAY_H
9 #define KEARRAY_H
10 
11 #include <Coconut/Coconut.h>
12 #include "KEObject.h"
13 #include "KEForwarders.h"
14 
21 struct KEArray {
25  struct CNArray valueArray ;
26 } ;
27 
33 struct KEArray *
34 KEAllocateArray(struct CNResource * resource) ;
35 
40 static inline void
41 KERetainArray(struct KEArray * dst)
42 {
43  KERetainObject(&(dst->superClass)) ;
44 }
45 
50 static inline void
51 KEReleaseArray(struct KEArray * dst)
52 {
53  KEReleaseObject(&(dst->superClass)) ;
54 }
55 
61 static inline struct CNResource *
62 KEResourceOfArray(struct KEArray * src)
63 {
64  return KEResourceOfObject(&(src->superClass)) ;
65 }
66 
72 static inline uint64_t
73 KECountOfArray(struct KEArray * src)
74 {
75  return CNCountOfArray(&(src->valueArray)) ;
76 }
77 
84 void
85 KESetValueToArray(struct KEArray * dst, uint64_t index, struct KEValue * src) ;
86 
92 void
93 KEAddValueToArray(struct KEArray * dst, struct KEValue * src) ;
94 
102 static inline struct KEValue *
103 KEValueInArray(const struct KEArray * src, uint64_t index)
104 {
105  return CNPointerInArray(&(src->valueArray), index) ;
106 }
107 
113 void
114 KEDumpArray(struct CNText * outbuf, struct KEArray * src) ;
115 
116 #endif /* KEARRAY_H */
117 
Define KEObject class.
Array of KEValue.
Definition: KEArray.h:21
void KEAddValueToArray(struct KEArray *dst, struct KEValue *src)
Add vaoue as the last element of the array.
struct CNArray valueArray
Definition: KEArray.h:25
Definition: KEObject.h:42
struct KEArray * KEAllocateArray(struct CNResource *resource)
Allocate value array.
Definition: KEValue.h:40
void KESetValueToArray(struct KEArray *dst, uint64_t index, struct KEValue *src)
Set value to the array at the given index.
struct KEObject superClass
Definition: KEArray.h:23
void KEDumpArray(struct CNText *outbuf, struct KEArray *src)
Dump all elements in value array.
Forward declarations of the data type in KiwiEngine.