#include <cel_dsarray.h>
Public Member Functions | |
virtual void | serialize (Stream *inStream, size_t inLevel, Endian inEndian) |
virtual AutoPtr< Serializable > | duplicate () const |
virtual AutoPtr< DataArray< T > > | duplicateDataArray () const |
SimpleArray< T > & | getReference () |
const SimpleArray< T > & | getReference () const |
T * | getPtr () |
const T * | getPtr () const |
virtual const void * | getVoidPtr () const |
T & | at (size_t pos) |
const T & | at (size_t pos) const |
virtual bool | isValid () const |
virtual size_t | getSize () const |
void | allocate (size_t inSize, size_t inReserve=(size_t)-1) |
void | reserve (size_t inSize) |
void | reallocate (size_t inSize) |
void | resize (size_t inSize) |
void | free () |
void | duplicate (const SimpleArray< T > &inSa) |
void | duplicate (const Serializable *inDataArray) |
void | duplicate (const T *inBuffer, size_t inSize, Endian inEndian=endianHost) |
void | fill (const T &t) |
void | zeroClear () |
void | swap (SimpleArray< T > &inSa) |
void | swap (Serializable *inDataArray) |
void | push_back (T &t) |
T | pop_back () |
virtual u16 | getTag () const |
virtual void | setTag (u16 tag) |
virtual u16 | getType () const |
virtual void | setType (u16 type) |
Public Member Functions inherited from Celartem::BasicDataArray | |
virtual size_t | getAsInt (size_t inIndex) const |
virtual double | getAsDouble (size_t inIndex) const |
virtual TIFF_RATIONAL | getAsRational (size_t inIndex) const |
Public Member Functions inherited from Celartem::Serializable | |
const Guid & | getClassId () const |
String | getClassName () const |
Public Member Functions inherited from Celartem::Referable | |
Referable () | |
void | addRef () const |
void | releaseRef () const |
size_t | getReferenceCount () const |
Static Public Member Functions | |
static AutoPtr< Serializable > | deserialize (Stream *inStream, size_t inLevel, Endian inEndian) |
static AutoPtr< DataArray< T > > | create () |
static AutoPtr< DataArray< T > > | create (size_t inSize, size_t inReserve=(size_t)-1) |
Static Public Member Functions inherited from Celartem::Referable | |
static void | dumpDbgAllRefCount () |
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.
|
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.
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. |
|
inline |
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.
|
inline |
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.
|
inlinestatic |
This function creates a new DataArray<T> instance. The SimpleArray instance held by this instance is set SimpleArray::strictCleanup attributes.
Referenced by Celartem::DataArray< T >::deserialize().
|
inlinestatic |
This function creates a new DataArray<T> instance. The SimpleArray instance held by this instance is set SimpleArray::strictCleanup attributes.
|
inlinestatic |
This method deserializes a DataArray<T>
instance from the specified storage.
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. |
|
inlinevirtual |
This method duplicates the DataArray<T> instance.
Implements Celartem::Serializable.
|
inline |
This method also set strictCleanup attributes to this instance after duplication. The tag/type associated to the instance will be cleared.
|
inline |
This method duplicates the specified array.
inDataArray | Pointer to the DataArray<T> instance to be duplicated. This method also set strictCleanup attributes to this instance after duplication. |
|
inline |
This method duplicates the specified array.
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. |
|
inlinevirtual |
This method duplicates the DataArray<T> instance.
|
inline |
This method is a general version of fill function; fill(0)
fills all array with 0.
t | The value to fill with. |
|
inline |
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.
|
inline |
This method returns raw pointer to the array.
|
inline |
This method returns raw pointer to the array.
|
inline |
This method returns the reference to the holding SimpleArray instance.
|
inline |
This method returns the reference to the holding SimpleArray instance. (const version)
|
inlinevirtual |
This method returns the size of array in number of entries.
Implements Celartem::BasicDataArray.
|
inlinevirtual |
This method is for compatibility with TIFF 6.0 Specification.
Implements Celartem::BasicDataArray.
|
inlinevirtual |
This method is for compatibility with TIFF 6.0 Specification.
Implements Celartem::BasicDataArray.
|
inlinevirtual |
This method returns the pointer to the internal data.
Implements Celartem::BasicDataArray.
|
inlinevirtual |
This method checks whether the array is valid or not.
true
if the array is valid, otherwise false
. Implements Celartem::BasicDataArray.
|
inline |
This method is almost identical to vector::pop_back
.
|
inline |
This method is almost identical to vector::push_back
.
t | Value to add. |
|
inline |
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.
inSize | Specifies the new size of the array in number of entries. |
|
inline |
This method changes the reservation size of the array.
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. |
|
inline |
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
.
inSize | Specifies the new size of the array in number of entries. |
|
inlinevirtual |
This method serializes a DataArray
instance into the specified storage.
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.
|
inlinevirtual |
This method is for compatibility with TIFF 6.0 Specification.
Implements Celartem::BasicDataArray.
|
inlinevirtual |
This method is for compatibility with TIFF 6.0 Specification.
Implements Celartem::BasicDataArray.
|
inline |
This method swaps the contents of the array with the specified array instance.
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. |
|
inline |
This method swaps the contents of the array with the specified array instance.
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. |
|
inline |
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.