Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::FileMappedStorage::Lock Class Reference

Provides easy way to lock a pointer to the memory. More...

#include <FileMappedStorage.h>

Public Member Functions

 Lock (FileMappedStorage &ds)
 Constructor.
 
 Lock (FileMappedStorage &ds, size_type seg_idx)
 Constructor.
 
 ~Lock ()
 Destructor.
 
bool acquire (size_type seg_idx)
 Tries to lock the segment index of the data store and returns true when successful.
 
bool isAcquired () const
 Gets the segment acquired status.
 
 operator bool () const
 Gets the segment acquired status.
 
void * data (size_type blk_ofs)
 Returns pointer to .
 
template<typename T = void*>
T * ptr (size_type blk_ofs)
 
void release ()
 Unlocks memory locked by the segment.
 

Detailed Description

Provides easy way to lock a pointer to the memory.

Constructor & Destructor Documentation

◆ Lock() [1/2]

sf::FileMappedStorage::Lock::Lock ( FileMappedStorage ds)
inlineexplicit

Constructor.

Parameters
dsData store instance.

◆ Lock() [2/2]

sf::FileMappedStorage::Lock::Lock ( FileMappedStorage ds,
size_type  seg_idx 
)
inline

Constructor.

Parameters
dsData store instance.
seg_idxDesignated segment.

◆ ~Lock()

sf::FileMappedStorage::Lock::~Lock ( )
inline

Destructor.

Member Function Documentation

◆ acquire()

bool sf::FileMappedStorage::Lock::acquire ( size_type  seg_idx)

Tries to lock the segment index of the data store and returns true when successful.

Parameters
seg_idxSegment index.
Returns
Return true when acquired.

◆ data()

void * sf::FileMappedStorage::Lock::data ( size_type  blk_ofs)

Returns pointer to .

Parameters
blk_ofsoffset in blocks.
Returns
Data pointer

◆ isAcquired()

bool sf::FileMappedStorage::Lock::isAcquired ( ) const
inline

Gets the segment acquired status.

Returns
True when acquired.

◆ operator bool()

sf::FileMappedStorage::Lock::operator bool ( ) const
inlineexplicit

Gets the segment acquired status.

Returns
True when acquired.

◆ ptr()

template<typename T = void*>
T * sf::FileMappedStorage::Lock::ptr ( size_type  blk_ofs)
inline

Typed template method.

Template Parameters
TType of the return value.
Parameters
blk_ofsoffset in to the data.
Returns
Typed pointer.

◆ release()

void sf::FileMappedStorage::Lock::release ( )

Unlocks memory locked by the segment.


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