#include <djv_data.h>

Public Member Functions | |
| const u8 * | getRawPtr () const |
| virtual size_t | getSize () const |
| virtual AutoPtr< Storage > | getReadOnlyStorage () const |
| virtual AutoPtr< Data > | duplicate (bool inCompaction=false) const |
| virtual void | compact () |
| SimpleArray< u8 > & | getSimpleArray () |
| AutoPtr< MemoryStorage > | getStorage () |
| virtual void | lock () const |
| virtual void | unlock () const |
Static Public Member Functions | |
| static AutoPtr< MemoryData > | create (size_t inSize=0, size_t inReserve=(size_t)-1, MemoryAllocator *inAllocator=NULL, size_t inAllocationUnit=0) |
| static AutoPtr< MemoryData > | create (const void *inData, size_t inSize) |
| static AutoPtr< MemoryData > | create (Storage *inStorage, uint64_t inOffset, size_t inSize) |
This implementation provides SimpleArray based data structure.
| virtual void Celartem::DjVu::MemoryData::compact | ( | ) | [inline, virtual] |
Minimize the memory usage by removing reserved area.
Implements Celartem::DjVu::Data.
| static AutoPtr<MemoryData> Celartem::DjVu::MemoryData::create | ( | size_t | inSize = 0, |
|
| size_t | inReserve = (size_t)-1, |
|||
| MemoryAllocator * | inAllocator = NULL, |
|||
| size_t | inAllocationUnit = 0 | |||
| ) | [inline, static] |
Creates a MemoryData instance on a memory.
| 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. |
Referenced by Celartem::DjVu::PageInfo::encodeINFOChunk(), getReadOnlyStorage(), and getStorage().
| static AutoPtr<MemoryData> Celartem::DjVu::MemoryData::create | ( | const void * | inData, | |
| size_t | inSize | |||
| ) | [inline, static] |
Creates a MemoryData instance by duplicating the specified data.
| inData | Pointer to a buffer which contains the data. | |
| inSize | The size of the data. |
| static AutoPtr<MemoryData> Celartem::DjVu::MemoryData::create | ( | Storage * | inStorage, | |
| uint64_t | inOffset, | |||
| size_t | inSize | |||
| ) | [inline, static] |
Creates a MemoryData instance by loading data from the specified storage block.
| inStorage | Storage which contains the data. | |
| inOffset | The data offset. | |
| inSize | The data size. |
| virtual AutoPtr<Data> Celartem::DjVu::MemoryData::duplicate | ( | bool | inCompaction = false |
) | const [inline, virtual] |
Duplicate the Data instance.
| inCompaction | Whether the duplication process also does compaction of memory usage or not. |
Implements Celartem::DjVu::Data.
| const u8* Celartem::DjVu::MemoryData::getRawPtr | ( | ) | const [inline] |
Get the actual data.
Referenced by Celartem::DjVu::DataLocker::lock().
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.
Implements Celartem::DjVu::Data.
| SimpleArray<u8>& Celartem::DjVu::MemoryData::getSimpleArray | ( | ) | [inline] |
Get SimpleArray instance which manages actual data.
| virtual size_t Celartem::DjVu::MemoryData::getSize | ( | ) | const [inline, virtual] |
| AutoPtr<MemoryStorage> Celartem::DjVu::MemoryData::getStorage | ( | ) | [inline] |
Get Storage interface access to the memory data. This is just a helper method and it simply create MemoryStorage on the internal SimpleArray.
| virtual void Celartem::DjVu::MemoryData::lock | ( | ) | const [inline, virtual] |
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.
Implements Celartem::DjVu::Data.
| virtual void Celartem::DjVu::MemoryData::unlock | ( | ) | const [inline, virtual] |