#include <cel_dsarray.h>
List of all members.
Detailed Description
template<typename T>
class Celartem::DataArray< T >
DataArray is a Serializable version of SimpleArray. This class contains SimpleArray and it provides almost all methods supported by SimpleArray. For template parameter T, this class uses StoragePolicy to determine how to deal with T instances.
- See also:
- SimpleArray, Serializable, DataTraits, StoragePolicy
-
BasicDataArray
Member Function Documentation
template<typename T >
| void Celartem::DataArray< T >::allocate |
( |
size_t |
inSize, |
|
|
size_t |
inReserve = (size_t)-1 | |
|
) |
| | [inline] |
This method allocates the array.
This method firstly frees all the contents on the array and renew the array itself; if you want to keep the contents during the reconstruction of the array, use reallocate or resize.
- Parameters:
-
| inSize | Specifies the size of the array in number of entries. |
| inReserve | Specifies the reservation size of the array in number of entries. The reservation size is a parameter that controls relocation of the array. Although the larger reservation size assures you of the better speed performance of array resizing until the size surpasses the reservation size, it firstly request the reservation size of memory to the operating system. |
- See also:
- reallocate, resize
- See also:
- SimpleArray::allocate
This method provides access to the array entries. Since DataArray is Serializable derivative class, it is usually used via AutoPtr<DataStore> and could not provide [] array operator, this method provides the same function to it.
- See also:
- SimpleArray
This method provides access to the array entries. Since DataArray is Serializable derivative class, it is usually used via AutoPtr<DataStore> and could not provide [] array operator, this method provides the same function to it.
- See also:
- SimpleArray
This method deserializes a DataArray<T> instance from the specified storage.
- Parameters:
-
| inStream | The stream from which the instance information is read. |
| inLevel | The de-serialization level. In the top level, this value is 0. |
| inEndian | The endianness used to read the data. |
- Returns:
- Pointer to the newly created Serializable instance.
This method also set strictCleanup attributes to this instance after duplication. The tag/type associated to the instance will be cleared.
- See also:
- SimpleArray::duplicate(const SimpleArray&)
-
SimpleArray::strictCleanup
This method duplicates the specified array.
- Parameters:
-
| inDataArray | Pointer to the DataArray<T> instance to be duplicated. This method also set strictCleanup attributes to this instance after duplication. |
- See also:
- duplicate
-
SimpleArray::strictCleanup
This method duplicates the specified array.
- Parameters:
-
| inBuffer | An array to be duplicated. |
| inSize | The size of the array. |
| inEndian | The endianness of the specified buffer. |
This method also set strictCleanup attributes to this instance after duplication. The tag/type associated to the instance will be cleared.
- See also:
- SimpleArray::duplicate(const T*,size_t,Endian)
-
SimpleArray::strictCleanup
This method duplicates the DataArray<T> instance.
- Returns:
- Pointer to the newly created DataArray instance.
This method is a general version of fill function; fill(0) fills all array with 0.
- Parameters:
-
| t | The value to fill with. |
- See also:
- zeroClear
- See also:
- SimpleArray::fill
This method releases the memory.
Please note that since this method really deallocates the memory block associated with this SimpleArray instance, it does not keep the reservation size after the call. If you want to preserve the allocated memory for it, use reallocate (0) rather than this method.
Please note that this method keeps the current memory allocation unit. To revert the value to the default, use setAllocationUnit method.
- See also:
- reserve, allocate, reallocate
- See also:
- SimpleArray::free
This method returns raw pointer to the array.
- Returns:
- Raw pointer to the array.
- See also:
- SimpleArray::getPtr
This method returns raw pointer to the array.
- Returns:
- Raw pointer to the array.
- See also:
- SimpleArray::getPtr
This method returns the reference to the holding SimpleArray instance. (const version)
- Returns:
- Reference to the SimpleArray instance.
This method returns the reference to the holding SimpleArray instance.
- Returns:
- Reference to the SimpleArray instance.
This method returns the pointer to the internal data.
- Returns:
- Pointer to the internal data.
Implements Celartem::BasicDataArray.
This method is almost identical to vector::pop_back .
- Returns:
- The value that was on the tail of the array.
- See also:
- SimpleArray::pop_back
This method reallocates the array. This method keeps the contents on the array during the reconstruction of the array and it is slower than allocate method; if you don't want to keep the contents, use allocate instead.
resize is just an alias of this method and the behavior is identical to this method.
- Parameters:
-
| inSize | Specifies the new size of the array in number of entries. |
- See also:
- resize, allocate
- See also:
- SimpleArray::reallocate
This method changes the reservation size of the array.
- Parameters:
-
| inSize | Specifies the reservation size of the array in number of entries. The reservation size is a parameter that controls relocation of the array. Although the larger reservation size assures you of the better speed performance of array resizing until the size surpasses the reservation size, it firstly request the reservation size of memory to the operating system. |
- See also:
- SimpleArray::reserve
This method reallocates the array. This method is identical to reallocate method. See reallocate for more information.
This method is provided for the compatibility with std::vector.
- Parameters:
-
| inSize | Specifies the new size of the array in number of entries. |
- See also:
- reallocate
- See also:
- SimpleArray::resize
This method serializes a DataArray instance into the specified storage.
- Parameters:
-
| inStream | The stream to which the instance information is written. |
| inLevel | The serialization level. In the top level, this value is 0. |
| inEndian | The endianness used to write the data. |
Implements Celartem::Serializable.
This method swaps the contents of the array with the specified array instance.
- Parameters:
-
| inDataArray | Pointer to the DataArray<T> instance with which this instance will exchange the contents. This method also set strictCleanup attributes to this instance after duplication. |
- See also:
- SimpleArray::swap(SimpleArray&)
-
SimpleArray::strictCleanup
This method swaps the contents of the array with the specified array instance.
- Parameters:
-
| inSa | The SimpleArray instance with which this instance will exchange the contents. |
This method also set strictCleanup attributes to this instance after duplication. The tag/type information associated to the instance will be cleared.
- See also:
- SimpleArray::swap(SimpleArray&)
-
SimpleArray::strictCleanup
This method zero-clears the array in the way of std::memset . This is very dangerous method and you should consider that you should use fill instead of it.
- See also:
- fill
- See also:
- SimpleArray::zeroClear
The documentation for this class was generated from the following file: