#include <djv_data.h>
Public Member Functions | |
| DataLocker () | |
| DataLocker (const Data *inData) | |
| ~DataLocker () | |
| const u8 * | getPtr () const |
| size_t | getSize () const |
| operator const u8 * () const | |
| void | lock (const Data *inData) |
| void | release () |
This class provides easy access to the data on memory.
If the Data instance passed is a MemoryData, this class uses the memory block on that instance whereas allocates a temporary memory block if not a MemoryData.
const Data* data = chunk->getData(); DataLocker lock(data); const char* p = lock.getPtr(); size_t size = lock.getSize();
| Celartem::DjVu::DataLocker::DataLocker | ( | ) | [inline] |
Initialize without locking any Data.
| Celartem::DjVu::DataLocker::DataLocker | ( | const Data * | inData | ) | [inline, explicit] |
| Celartem::DjVu::DataLocker::~DataLocker | ( | ) | [inline] |
Destruct the lock (release the lock).
| const u8* Celartem::DjVu::DataLocker::getPtr | ( | ) | const [inline] |
Get pointer to the locked memory block.
| 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.
| inData | A Data instance to lock. |
Referenced by DataLocker().
| Celartem::DjVu::DataLocker::operator const u8 * | ( | ) | const [inline] |
| void Celartem::DjVu::DataLocker::release | ( | ) | [inline] |
Unlock the Data instance.
Referenced by lock(), and ~DataLocker().