Tkrzw
Public Member Functions | Friends | List of all members
tkrzw::MemoryMapAtomicFile::Zone Class Reference

Structure to make a critical section where a region can be accessed. More...

#include <tkrzw_file_mmap.h>

Public Member Functions

 ~Zone ()
 Destuctor. More...
 
 Zone (const Zone &rhs)=delete
 Copy and assignment are disabled. More...
 
Zoneoperator= (const Zone &rhs)=delete
 
int64_t Offset () const
 Gets the offset of the region to access. More...
 
char * Pointer () const
 Gets the pointer to the region to access. More...
 
size_t Size () const
 Gets the size of the region to access. More...
 

Friends

class MemoryMapAtomicFile
 

Detailed Description

Structure to make a critical section where a region can be accessed.

The zone object contains a mutex which is locked by the constructor and unlocked by the destructor. The user can access the region freely while the zone object is alive.

Constructor & Destructor Documentation

◆ ~Zone()

tkrzw::MemoryMapAtomicFile::Zone::~Zone ( )

Destuctor.

◆ Zone()

tkrzw::MemoryMapAtomicFile::Zone::Zone ( const Zone rhs)
explicitdelete

Copy and assignment are disabled.

Member Function Documentation

◆ Offset()

int64_t tkrzw::MemoryMapAtomicFile::Zone::Offset ( ) const

Gets the offset of the region to access.

Returns
The offset of the region to access.

◆ Pointer()

char* tkrzw::MemoryMapAtomicFile::Zone::Pointer ( ) const

Gets the pointer to the region to access.

Returns
The pointer to the region to access.

◆ Size()

size_t tkrzw::MemoryMapAtomicFile::Zone::Size ( ) const

Gets the size of the region to access.

Returns
The size of the region to access.