4dd6016233cb7cf95a666c08d7630f6f3c781308
[sdk] / doc / ecere / ecere / com / Array.econ
1 {
2    name = "Array",
3    description = "A storage container allowing for dynamic resizing of allocated space at run time. The data type of the data stored in this container as a typecast at the time of declaration.",
4    usage = "Initially declared in the declaration section of code. The resulting array of data is later accessed through the [] syntax: nameOfArray[arrayElement] = arbitraryValue.\n"
5       "\n"
6       "Be certain that when you instantiate an Array that you have a matching delete statement for it, otherwise potential memory leaks could become a problem.",
7    example = "void Test()\n"
8       "{\n"
9       "   Array<int> points { size = 10 };\n"
10       "   points[0] = { 10, 10 };\n"
11       "   points.size = 20;\n"
12       "   points[19] = { 5, 5 };\n"
13       "   delete points;\n"
14       "}",
15    remarks = "Similar to a C++ Vector. The Array class does come with inevitable overhead required for the purposes of dynamically allocating storage. So if it is not required to have dynamic allocation of storage, it would be recommended to use standard arrays: ie) int thisArray[10];",
16    also = "Container",
17    fields = [
18       {
19          "array",
20          {
21             description = "The actual allocated storage for the Array."
22          }
23       },
24       {
25          "count",
26          {
27             description = "The overall size of the Array."
28          }
29       },
30       {
31          "minAllocSize",
32          {
33             description = "The minimum amount of allocated storage for the Array before a reallocation would be necessary."
34          }
35       }
36    ],
37    properties = [
38       {
39          "minAllocSize",
40          {
41             description = "The property to enable manual changes to the minAllocSize."
42          }
43       },
44       {
45          "size",
46          {
47             description = "The property to enable manual changes to the size of the Array."
48          }
49       }
50    ]
51 }