ARSA Language  2.9
(Recursion, Encryption, GPU and Web 3.0)
array.h
Go to the documentation of this file.
1 
8 class array
9 {
10 public:
11 
13 
17  int array();
18 
20 
25  bool array(const char* name);
26 
28 
33  int allocate( int start_count);
34 
36 
42  int allocate( const char* name, int start_count);
43 
46 
51  int push_back(int id, const T& element);
52 
55 
60  int push_front(int id, const T& element);
61 
63 
67  void reallocate(int id, int new_size);
68 
70 
74  void set_used(int id, int usedNow);
75 
77 
82  const T& get(int id, int index);
83 
85 
89  int size(int id);
90 
92 
96  int allocatedsize(int id);
97 
100 
105  int erase(int id, int index);
106 
108 
111  void clear(int id);
112 
114 
118  bool close(int id);
119 
122 
128  int insert(int id, const T& element, int index);
129 
132 
137  int search(int id, const T& element);
138 
141 
147  int search_array(int id, const T& element);
148 
151 
155  bool sort(int id);
156 
158 
164  void for(int id, void* function);
165 
167 
173  bool set(int id, int index, const T& new_element);
174 
176 
179  void log(int id);
180 
182 
187  bool save(int id, const char* filename, const char* option = "xml");
188 
190 
195  const char* tostring(int id, const char* option = "xml");
196 
197 };
int allocate(int start_count)
Constructs an array and allocates an initial chunk of memory.
bool close(int id)
free memory of array
void clear(int id)
Clears the array and deletes all allocated memory.
int push_back(int id, const T &element)
const T & get(int id, int index)
Direct const access operator.
int array()
allocate new memory of array
Definition: array.h:8
void reallocate(int id, int new_size)
Reallocates the array, make it bigger or smaller.
int erase(int id, int index)
int push_front(int id, const T &element)
int allocatedsize(int id)
Get amount of memory allocated.
int size(int id)
Get number of occupied elements of the array.
bool save(int id, const char *filename, const char *option="xml")
save all elements to file as xml or json
const char * tostring(int id, const char *option="xml")
save all elements and value to string buffer as xml or json
void log(int id)
print all elements in log window
bool sort(int id)
int search(int id, const T &element)
int search_array(int id, const T &element)
void set_used(int id, int usedNow)
Sets the size of the array and allocates new elements if necessary.
bool set(int id, int index, const T &new_element)
update element in specific slot.
int insert(int id, const T &element, int index)