ARSA Language  2.8
(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  int array( int start_count);
26 
29 
34  int push_back(int id, const T& element);
35 
38 
43  int push_front(int id, const T& element);
44 
46 
50  void reallocate(int id, int new_size);
51 
53 
57  void set_used(int id, int usedNow);
58 
60 
65  const T& get(int id, int index);
66 
68 
72  int size(int id);
73 
76 
81  int erase(int id, int index);
82 
84 
87  void clear(int id);
88 
90 
94  bool close(int id);
95 
98 
104  int insert(int id, const T& element, int index);
105 
108 
113  int search(int id, const T& element);
114 
117 
123  int search_array(int id, const T& element);
124 
127 
131  bool sort(int id);
132 
134 
140  void for(int id, void* function);
141 
143 
149  bool set(int id, int index, const T& new_element);
150 
152 
155  void log(int id);
156 
158 
163  bool save(int id, const char* filename, const char* option = "xml");
164 
166 
171  const char* tostring(int id, const char* option = "xml");
172 
173 };
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 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)