#include <cel_storage.h>
Public Types | |
| enum | LockMode { Shared = 0, Exclusive = 1 } |
Public Member Functions | |
| DiskStorageLock (DiskStorage *inStorage, uint64_t inPos, uint64_t inSize, LockMode inMode=Shared) | |
| DiskStorageLock (DiskStorage *inStorage, const LockStorageRegion &inRegion, LockMode inMode=Shared) | |
| DiskStorageLock () | |
| ~DiskStorageLock () | |
| void | lock (DiskStorage *inStorage, const LockStorageRegion &inRegion, LockMode inMode=Shared) |
| void | lock (DiskStorage *inStorage, uint64_t inPos, uint64_t inSize, LockMode inMode=Shared) |
| void | unlock () |
Definition at line 500 of file cel_storage.h.
Lock mode.
| Shared | Shared lock, which is also called "reader" lock. |
| Exclusive | Exclusive lock, which is also called "writer" lock. |
Definition at line 506 of file cel_storage.h.
| Celartem::DiskStorageLock::DiskStorageLock | ( | DiskStorage * | inStorage, | |
| uint64_t | inPos, | |||
| uint64_t | inSize, | |||
| LockMode | inMode = Shared | |||
| ) | [inline] |
Locks a region of a DiskStorage instance.
| inStorage | A DiskStorage instance to lock a region of. | |
| inPos | The offset of the region to lock. | |
| inSize | The size of the region to lock. | |
| inMode | The lock mode. |
Definition at line 523 of file cel_storage.h.
| Celartem::DiskStorageLock::DiskStorageLock | ( | DiskStorage * | inStorage, | |
| const LockStorageRegion & | inRegion, | |||
| LockMode | inMode = Shared | |||
| ) | [inline] |
Locks a region of a DiskStorage instance.
| inStorage | A DiskStorage instance to lock a region of. | |
| inPos | The offset of the region to lock. | |
| inSize | The size of the region to lock. | |
| inMode | The lock mode. |
Definition at line 540 of file cel_storage.h.
| Celartem::DiskStorageLock::DiskStorageLock | ( | ) | [inline] |
Initializes the instance without locking a storage region.
Definition at line 549 of file cel_storage.h.
| Celartem::DiskStorageLock::~DiskStorageLock | ( | ) | [inline] |
Deinitializes the instance. If a region of a storage is locked, the lock is released.
Definition at line 557 of file cel_storage.h.
| void Celartem::DiskStorageLock::lock | ( | DiskStorage * | inStorage, | |
| const LockStorageRegion & | inRegion, | |||
| LockMode | inMode = Shared | |||
| ) | [inline] |
Locks a region of a DiskStorage instance.
| inStorage | A DiskStorage instance to lock a region of. | |
| inRegion | The region to lock. If the length is 0, this method locks all the subsequent bytes starts from offset. | |
| inMode | The lock mode. |
Definition at line 572 of file cel_storage.h.
Referenced by DiskStorageLock().
| void Celartem::DiskStorageLock::lock | ( | DiskStorage * | inStorage, | |
| uint64_t | inPos, | |||
| uint64_t | inSize, | |||
| LockMode | inMode = Shared | |||
| ) | [inline] |
Locks a region of a DiskStorage instance.
| inStorage | A DiskStorage instance to lock a region of. | |
| inPos | The offset of the region to lock. | |
| inSize | The size of the region to lock. If this is 0, this method locks all the subsequent bytes starts from inPos. | |
| inMode | The lock mode. |
Definition at line 590 of file cel_storage.h.
| void Celartem::DiskStorageLock::unlock | ( | ) | [inline] |
Releases the locked region. If no region is locked, do nothing.
Definition at line 602 of file cel_storage.h.
Referenced by lock(), and ~DiskStorageLock().