Public Member Functions

Celartem::DjVu::Data Class Reference

#include <djv_data.h>

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

List of all members.

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

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::StorageData, and Celartem::DjVu::MemoryData.

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:
outBuffer A 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:
inCompaction Whether the duplication process also does compaction of memory usage or not.
Returns:
Pointer to the newly created Data instance.

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

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::StorageData, and Celartem::DjVu::MemoryData.

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::StorageData, and Celartem::DjVu::MemoryData.

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::StorageData, and Celartem::DjVu::MemoryData.

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::StorageData, and Celartem::DjVu::MemoryData.


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

This document is made with doxygen 1.7.1 at Sun Sep 5 2010 13:03:40.
Caminova Logo