Dynamic array classes...
Here we present a small Purebasic source code utility for implementing dynamic arrays which are embeddable in the sense that you can easily embed these arrays within structures, linked lists, hash tables, other arrays and so on.
More precisely, this little utility exposes two OOP classes; one which implements a 'basic' array class and one which implements a 'structured' array class (one whose elements can consist of an entire structure).
Main features of the array classes:
- Fully open source and fully cross-platform
- Completely thread-safe (with the usual provisions regarding shared resources of course)
- Suitable for use in 32-bit and 64-bit applications
- Completely embeddable; embed arrays inside other arrays or objects or structures or... etc.
- Full memory management in the case of 'structured arrays' containing string fields
- Methods for shifting elements or swapping elements etc.
Personally, I tend to use the 'basic array' class more than the
'structured array' one since this is faster (especially when used to
store pointers to more complex structures). The structured array
objects, whilst convenient, do carry more in the way of overhead
etc.
The download includes all of the source-code, a fully detailed .pdf user manual and a couple of demo programs.
Enjoy!