Public Member Functions | Static Public Member Functions

Celartem::DjVu::StorageData Class Reference

#include <djv_data.h>

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

List of all members.

Public Member Functions

virtual size_t getSize () const
virtual AutoPtr< StoragegetReadOnlyStorage () const
AutoPtr< StoragegetBaseStorage ()
virtual AutoPtr< Dataduplicate (bool inCompaction=false) const
virtual void compact ()
virtual void lock () const
virtual void unlock () const

Static Public Member Functions

static AutoPtr< StorageDatacreate (Storage *inStorage, uint64_t inOffset, size_t inSize)
static AutoPtr< StorageDatacreate (Storage *inStorage)

Detailed Description

This implementation provides Storage based data structure.


Member Function Documentation

virtual void Celartem::DjVu::StorageData::compact (  )  [inline, virtual]

Minimize the memory usage by removing reserved area.

Implements Celartem::DjVu::Data.

static AutoPtr<StorageData> Celartem::DjVu::StorageData::create ( Storage inStorage  )  [inline, static]

Creates a StorageData instance on an existing Storage.
Please note that StorageData instance always rewind the storage before making the client access the data.

Parameters:
inStorage Storage to load data from.
static AutoPtr<StorageData> Celartem::DjVu::StorageData::create ( Storage inStorage,
uint64_t  inOffset,
size_t  inSize 
) [inline, static]

Creates a StorageData instance on an existing Storage.

Parameters:
inStorage Storage to load data from.
inOffset Absolute data offset from the storage top.
inSize Size of the data. It could be 0 for empty data.

Referenced by duplicate(), and getReadOnlyStorage().

virtual AutoPtr<Data> Celartem::DjVu::StorageData::duplicate ( bool  inCompaction = false  )  const [inline, virtual]

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.

AutoPtr<Storage> Celartem::DjVu::StorageData::getBaseStorage (  )  [inline]

Get the base Storage instance.

Returns:
Pointer to the base Storage instance.
virtual AutoPtr<Storage> Celartem::DjVu::StorageData::getReadOnlyStorage (  )  const [inline, 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.

Implements Celartem::DjVu::Data.

virtual size_t Celartem::DjVu::StorageData::getSize (  )  const [inline, virtual]

Get the size of the data.

Returns:
The size of the data.

Implements Celartem::DjVu::Data.

virtual void Celartem::DjVu::StorageData::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.

See also:
unlock, Locker, Lockable

Implements Celartem::DjVu::Data.

virtual void Celartem::DjVu::StorageData::unlock (  )  const [inline, virtual]

Releases the lock on the instance.

See also:
lock, Locker, Lockable

Implements Celartem::DjVu::Data.


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

This document is made with doxygen 1.7.1 at Thu Feb 17 2011 15:40:20.
Caminova Logo