Public Member Functions | List of all members
Celartem::DjVu::Data Class Referenceabstract

#include <djv_data.h>

Inheritance diagram for Celartem::DjVu::Data:
Inheritance graph
[legend]

Public Member Functions

virtual size_t getSize () const =0
 
virtual AutoPtr< StoragegetReadOnlyStorage () const =0
 
virtual AutoPtr< Dataduplicate (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 ()
 

Detailed Description

An abstract class which defines the requirements for Data.

Member Function Documentation

virtual void Celartem::DjVu::Data::compact ( )
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.

Parameters
outBufferA SimpleArray<u8> to get the decompressed result.
virtual AutoPtr<Data> Celartem::DjVu::Data::duplicate ( bool  inCompaction = false) const
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.

Parameters
inCompactionWhether the duplication process also does compaction of memory usage or not.
Returns
Pointer to the newly created Data instance.

Implemented in Celartem::DjVu::MemoryData, and Celartem::DjVu::StorageData.

virtual AutoPtr<Storage> Celartem::DjVu::Data::getReadOnlyStorage ( ) const
pure virtual

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.

Implemented in Celartem::DjVu::MemoryData, and Celartem::DjVu::StorageData.

Referenced by Celartem::DjVu::PageInfo::decode().

virtual size_t Celartem::DjVu::Data::getSize ( ) const
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.

Returns
The size of the data.

Implemented in Celartem::DjVu::MemoryData, and Celartem::DjVu::StorageData.

virtual void Celartem::DjVu::Data::lock ( ) const
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.

See Also
unlock, Locker, Lockable

Implements Celartem::Lockable.

Implemented in Celartem::DjVu::MemoryData, and Celartem::DjVu::StorageData.

virtual void Celartem::DjVu::Data::unlock ( ) const
pure virtual

Releases the lock on the instance.

See Also
lock, Locker, Lockable

Implements Celartem::Lockable.

Implemented in Celartem::DjVu::MemoryData, and Celartem::DjVu::StorageData.


The documentation for this class was generated from the following file:

Cuminas DjVu SDK 3.0.33103
This document is made with doxygen 1.8.5 at Sun Dec 15 2013 19:38:07.
Cuminas Logo