Celartem::DiskStorageLock Class Reference

#include <cel_storage.h>

List of all members.

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 ()


Detailed Description

This class is used to lock a region of a DiskStorage.

Definition at line 500 of file cel_storage.h.


Member Enumeration Documentation

enum Celartem::DiskStorageLock::LockMode

Lock mode.

Enumerator:
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.


Constructor & Destructor Documentation

Celartem::DiskStorageLock::DiskStorageLock ( DiskStorage inStorage,
uint64_t  inPos,
uint64_t  inSize,
LockMode  inMode = Shared 
) [inline]

Locks a region of a DiskStorage instance.

Parameters:
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.

Parameters:
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.


Member Function Documentation

void Celartem::DiskStorageLock::lock ( DiskStorage inStorage,
const LockStorageRegion inRegion,
LockMode  inMode = Shared 
) [inline]

Locks a region of a DiskStorage instance.

Parameters:
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.

Parameters:
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().


The documentation for this class was generated from the following file:
This document is automatically generated using doxygen 1.5.4 at Fri Jun 27 18:23:21 2008.