doc/Container: Some container class documentation
[sdk] / doc / ecere / ecere / com / Container.econ
1 {
2    description = "Base Container template class",
3    properties = [
4       {
5          "copySrc",
6          {
7             description = "Setting this property will fill this container with the elements from specified container (but without duplicating the individual elements)."
8          }
9       },
10       {
11          "firstIterator",
12          {
13             description = "Used to obtain an iterator to first element"
14          }
15       },
16       {
17          "lastIterator",
18          {
19             description = "Used to obtain an iterator to last element"
20          }
21       }
22    ],
23    methods = [
24       {
25          "Add",
26          {
27             description = "Add an element to this container at the end"
28          }
29       },
30       {
31          "Copy",
32          {
33             description = "Copies elements from another container -- Note: Individual elements do not get duplicated through OnCopy()"
34          }
35       },
36       {
37          "Delete",
38          {
39             description = "Remove an element from the container and free its allocated memory"
40          }
41       },
42       {
43          "Find",
44          {
45             description = "Find an element by value within this container"
46          }
47       },
48       {
49          "Free",
50          {
51             description = "Remove all elements from the container freeing their individual allocated memory"
52          }
53       },
54       {
55          "FreeIterator",
56          {
57             description = "Used to free the memory associated with an IteratorPointer for this container (typically only used for containers representing dynamic sequences)"
58          }
59       },
60       {
61          "GetAtPosition",
62          {
63             description = "Return an iterator to the element at position 'pos'. If create is true and the position is not currently occupied, an element will be added at that position. If an element was added as a result (with create set to true) and a non-null 'justAdded' pointer is passed, it will be set to true.",
64             remarks = "Avoid indexing linked lists by index as much as possible.<br><br>This method is used to implement the [ ] container indexing operator.",
65             parameters = [
66                {
67                   "create",
68                   {
69                      description = "Set to true if the element should be created if it does not exist.",
70                      position = 2
71                   }
72                },
73                {
74                   "justAdded",
75                   {
76                      description = "Used to request information whether a previously non-existent element was added (with create = true). The bool variable passed must be initialized to false by the caller.",
77                      position = 3
78                   }
79                },
80                {
81                   "pos",
82                   {
83                      description = "Index ('IT' parameter: integer for Array, Key for Map)",
84                      position = 1
85                   }
86                }
87             ],
88             returnValue = "An iterator pointer to the element indexed, or null if not found and not created."
89          }
90       },
91       {
92          "GetCount",
93          {
94             description = "Return the number of elements within this container"
95          }
96       },
97       {
98          "GetData",
99          {
100             description = "Return the element data at the position of the iterator"
101          }
102       },
103       {
104          "GetFirst",
105          {
106             description = "Return an iterator pointer to the first element"
107          }
108       },
109       {
110          "GetLast",
111          {
112             description = "Return an iterator pointer to the last element"
113          }
114       },
115       {
116          "GetNext",
117          {
118             description = "Return an iterator pointer to the next element"
119          }
120       },
121       {
122          "GetPrev",
123          {
124             description = "Return an iterator pointer to the previous element"
125          }
126       },
127       {
128          "Insert",
129          {
130             description = "Insert an element in this container after a specific element (specify 'null' to add at the beginning)",
131             parameters = [
132                {
133                   "after",
134                   {
135                      description = "Element after which this element should be added (null to add at the beginning)",
136                      position = 1
137                   }
138                },
139                {
140                   "value",
141                   {
142                      description = "Value to be added (Container element type)",
143                      position = 2
144                   }
145                }
146             ],
147             returnValue = "Iterator pointer to the element that was added"
148          }
149       },
150       {
151          "Move",
152          {
153             description = "Move an element after another",
154             parameters = [
155                {
156                   "after",
157                   {
158                      description = "Iterator pointer specifying after which element to move (null to move at the beginning)",
159                      position = 2
160                   }
161                },
162                {
163                   "it",
164                   {
165                      description = "Iterator pointer specifying which element to move",
166                      position = 1
167                   }
168                }
169             ]
170          }
171       },
172       {
173          "Remove",
174          {
175             description = "Remove an element from the container without freeing its allocated memory"
176          }
177       },
178       {
179          "RemoveAll",
180          {
181             description = "Remove all elements from the container withou freeing their individual allocated memory"
182          }
183       },
184       {
185          "SetData",
186          {
187             description = "Set the data at the position of the iterator"
188          }
189       },
190       {
191          "Sort",
192          {
193             description = "Sort the container in ascending or descending order"
194          }
195       },
196       {
197          "TakeOut",
198          {
199             description = "Remove an item from a Container by value (implies a Find and is slower than removing from Iterator). The element is not freed.",
200             remarks = "Beware of using TakeOut() with 'class' data types and 'class_no_expansion' not set, as OnCompare() may resolve two different instances as equivalent.<br><br>Even in containers where values are not guaranteed to be unique, only a single element will be taken out per call.",
201             parameters = [
202                {
203                   "d",
204                   {
205                      description = "Value of element which should be taken out. ",
206                      position = 1
207                   }
208                }
209             ]
210          }
211       }
212    ]
213 }