#include <djv_data.h>
Public Member Functions | |
virtual size_t | getSize () const =0 |
virtual AutoPtr< Storage > | getReadOnlyStorage () const =0 |
virtual AutoPtr< Data > | duplicate (bool inCompaction=false) const =0 |
virtual void | compact ()=0 |
virtual void | lock () const =0 |
virtual void | unlock () const =0 |
void | decompressToMemory (SimpleArray< u8 > &outBuffer) const |
Public Member Functions inherited from Celartem::Referable | |
Referable () | |
void | addRef () const |
void | releaseRef () const |
size_t | getReferenceCount () const |
Additional Inherited Members | |
Static Public Member Functions inherited from Celartem::Referable | |
static void | dumpDbgAllRefCount () |
An abstract class which defines the requirements for Data.
|
pure virtual |
Minimize the memory usage by removing reserved area.
Implemented in Celartem::DjVu::MemoryData, and Celartem::DjVu::StorageData.
void Celartem::DjVu::Data::decompressToMemory | ( | SimpleArray< u8 > & | outBuffer | ) | const |
Decompresses (using InflateStream) the data in this instance to the specified buffer.
If the data in the instance is not compressed, this method throws an exception.
outBuffer | A SimpleArray<u8> to get the decompressed result. |
|
pure virtual |
Duplicate the Data instance.
This method never creates StorageData instance but only MemoryData instances. Every StorageData instance is duplicated according to its containing data.
inCompaction | Whether the duplication process also does compaction of memory usage or not. |
Implemented in Celartem::DjVu::MemoryData, and Celartem::DjVu::StorageData.
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.
Implemented in Celartem::DjVu::MemoryData, and Celartem::DjVu::StorageData.
Referenced by Celartem::DjVu::PageInfo::decode().
|
pure virtual |
Get the size of the data. Although some implementation may load the data dynamically on the first time, it will cache the data for the repeated calls.
Implemented in Celartem::DjVu::MemoryData, and Celartem::DjVu::StorageData.
|
pure 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::Lockable.
Implemented in Celartem::DjVu::MemoryData, and Celartem::DjVu::StorageData.
|
pure virtual |
Releases the lock on the instance.
Implements Celartem::Lockable.
Implemented in Celartem::DjVu::MemoryData, and Celartem::DjVu::StorageData.