Public Member Functions | List of all members
Celartem::DjVu::DataLocker Class Reference

#include <djv_data.h>

Public Member Functions

 DataLocker ()
 
 DataLocker (const Data *inData)
 
 ~DataLocker ()
 
const u8getPtr () const
 
size_t getSize () const
 
 operator const u8 * () const
 
void lock (const Data *inData)
 
void release ()
 

Detailed Description

        This class provides easy access to the data on memory.\n
        If the \ref Data instance passed is a \ref MemoryData, this
        class uses the memory block on that instance whereas allocates
        a temporary memory block if not a \ref MemoryData.
const Data* data = chunk->getData();
const char* p = lock.getPtr();
size_t size = lock.getSize();

Constructor & Destructor Documentation

Celartem::DjVu::DataLocker::DataLocker ( )
inline

Initialize without locking any Data.

Celartem::DjVu::DataLocker::DataLocker ( const Data inData)
inlineexplicit

Initialize by locking a Data.

Parameters
inDataA Data instance to lock.
Celartem::DjVu::DataLocker::~DataLocker ( )
inline

Destruct the lock (release the lock).

Member Function Documentation

const u8* Celartem::DjVu::DataLocker::getPtr ( ) const
inline

Get pointer to the locked memory block.

Returns
Pointer to the locked memory block. The memory block will be invalidate after releasing this lock.
See Also
getSize
size_t Celartem::DjVu::DataLocker::getSize ( ) const
inline

Get the size of the locked memory block.

void Celartem::DjVu::DataLocker::lock ( const Data inData)
inline

Lock a Data. The memory block can be obtained by calling getPtr.

Parameters
inDataA Data instance to lock.
See Also
getPtr

Referenced by DataLocker().

Celartem::DjVu::DataLocker::operator const u8 * ( ) const
inline

Get pointer to the locked memory block.

Returns
Pointer to the locked memory block. The memory block will be invalidate after releasing this lock.
See Also
getPtr, getSize
void Celartem::DjVu::DataLocker::release ( )
inline

Unlock the Data instance.

Referenced by lock(), and ~DataLocker().


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