#include <djv_data.h>
This implementation provides SimpleArray based data structure.
virtual void Celartem::DjVu::MemoryData::compact |
( |
| ) |
|
|
inlinevirtual |
static AutoPtr<MemoryData> Celartem::DjVu::MemoryData::create |
( |
size_t |
inSize = 0 , |
|
|
size_t |
inReserve = (size_t)-1 , |
|
|
MemoryAllocator * |
inAllocator = NULL , |
|
|
size_t |
inAllocationUnit = 0 |
|
) |
| |
|
inlinestatic |
Creates a MemoryData instance on a memory.
- 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. |
inAllocator | Specifies the MemoryAllocator instance that is used to allocate/deallocate memory blocks. It can be NULL and then SimpleArray uses the default allocator. |
inAllocationUnit | Specifies the unit size for allocation. For more information, see SimpleArray::setAllocationUnit. |
- Returns
- Pointer to the newly created MemoryData instance.
- See Also
- SimpleArray
Referenced by Celartem::DjVu::PageInfo::encodeINFOChunk().
static AutoPtr<MemoryData> Celartem::DjVu::MemoryData::create |
( |
const void * |
inData, |
|
|
size_t |
inSize |
|
) |
| |
|
inlinestatic |
Creates a MemoryData instance by duplicating the specified data.
- Parameters
-
inData | Pointer to a buffer which contains the data. |
inSize | The size of the data. |
- Returns
- Pointer to the newly created MemoryData instance.
Creates a MemoryData instance by loading data from the specified storage block.
- Parameters
-
inStorage | Storage which contains the data. |
inOffset | The data offset. |
inSize | The data size. |
- Returns
- Pointer to the newly created MemoryData instance.
virtual AutoPtr<Data> Celartem::DjVu::MemoryData::duplicate |
( |
bool |
inCompaction = false | ) |
const |
|
inlinevirtual |
Duplicate the Data instance.
- Parameters
-
inCompaction | Whether the duplication process also does compaction of memory usage or not. |
- Returns
- Pointer to the newly created Data instance.
Implements Celartem::DjVu::Data.
const u8* Celartem::DjVu::MemoryData::getRawPtr |
( |
| ) |
const |
|
inline |
virtual AutoPtr<Storage> Celartem::DjVu::MemoryData::getReadOnlyStorage |
( |
| ) |
const |
|
inlinevirtual |
Get readonly Storage access to the actual data.
The caller should not write to the stream but only reads the data from it. The Storage should be rewound to the beginning position.
- Returns
- Pointer to the Storage instance.
Implements Celartem::DjVu::Data.
virtual size_t Celartem::DjVu::MemoryData::getSize |
( |
| ) |
const |
|
inlinevirtual |
Get Storage interface access to the memory data. This is just a helper method and it simply create MemoryStorage on the internal SimpleArray.
- Returns
- Pointer to the newly created MemoryStorage instance.
- See Also
- MemoryStorage
virtual void Celartem::DjVu::MemoryData::lock |
( |
| ) |
const |
|
inlinevirtual |
Locks the instance.
This method provides a synchronization mechanism for processing the instance between threads.
If you plan to use the instance in multi-threaded program, it's recommended to lock the instance before accessing the data.
- See Also
- unlock, Locker, Lockable
Implements Celartem::DjVu::Data.
virtual void Celartem::DjVu::MemoryData::unlock |
( |
| ) |
const |
|
inlinevirtual |
The documentation for this class was generated from the following file: