Elm
1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
Functions | |
template<class T > | |
void | elm::array::copy (T *target, const T *source, int size) |
template<class T > | |
void | elm::array::move (T *target, const T *source, int size) |
template<class T > | |
void | elm::array::set (T *target, int size, const T &v) |
template<class T > | |
void | elm::array::clear (T *target, int size) |
This group provides optimized to work with C native array (whatever the running OS).
Most of these functions uses information of the type provided by the type_info<T> structure to optimize or not the array operations. Particularly, they uses the is_deep definition to know if a value may be copied byte-per-byte or need more complex processing because of its data structure. Any non-scalar type is basically considered as non-deep but you may change this behavior by specializing the type_info for your own type, MyType in the example below:
void elm::array::clear | ( | T * | target, |
int | size | ||
) |
Set the items of an array of the given size to 0.
target | Target array. |
size | Size of both arrays. |
Referenced by elm::genstruct::DLList< T, E >::~DLList().
void elm::array::copy | ( | T * | target, |
const T * | source, | ||
int | size | ||
) |
Copy source array of the given size to the target as fast as possible. The arrays must not overlap.
target | Target array. |
source | Source array. |
size | Size of both arrays. |
Referenced by elm::WAHVector::copy(), elm::genstruct::DeletableTable< elm::String >::copy(), FixArray::insert(), elm::avl::GenTree< T, K, C >::Iterator::Iterator(), FixArray::removeAt(), and elm::WAHVector::WAHVector().
void elm::array::move | ( | T * | target, |
const T * | source, | ||
int | size | ||
) |
Copy source array of the given size to the target as fast as possible. The arrays may overlap.
target | Target array. |
source | Source array. |
size | Size of both arrays. |
void elm::array::set | ( | T * | target, |
int | size, | ||
const T & | v | ||
) |
Set the items of an array of the given size to the given value, as fast as possible.
target | Target array. |
size | Size of both arrays. |
v | Value to set. |
Referenced by elm::genstruct::FragTable< T >::insert(), and elm::genstruct::FragTable< T >::removeAt().