Home2L - C/C++ API v1.4-0-g38cc (2024-05-25)
Smart Tools for a Private Home
|
Compact list.
This class is similar to CList, but stores the value objects in one big array and may therefore be more efficient in some cases. In particular, the memory layout is more compact, and read accesses as well as changes to individual entries are faster. On the other hand, adding or removing entries may be more time consuming for large objects.
The type 'T' must fulfill the following properties:
#include "base.H"
Public Member Functions | |
Read access ... | |
T * | Get (int idx) |
T * | operator[] (int idx) |
Write access ... | |
For any operations passing a new value object, the object is copied. | |
void | Set (int idx, T *value) |
Set (replace) a value. The entry must exist and 'idx' be valid. Complexity is O(1). | |
void | Insert (int idx, T *value) |
Insert a new value. Complexity is O(n). | |
void | Append (T *value) |
Append a new value. Complexity is O(1) if no resizing is necessary, else O(1). | |
Public Member Functions inherited from CListRaw | |
int | Entries () const |
Get number of entries. | |
void | Clear () |
Clear the list. | |
void | Del (int idx) |
Delete entry; complexity is O(n). | |
virtual void | Dump (const char *name) |
Dump contents by means of INFO logs (for debugging) | |