a MemMap basic element, holding basic shareable memory block info More...
#include <MemMap.h>
Public Member Functions | |
MemMapSlot () | |
size_t | size () const |
size_t | keySize () const |
bool | sameKey (const cache_key *const aKey) const |
void | set (const unsigned char *aKey, const void *block, size_t blockSize, time_t expire=0) |
bool | empty () const |
bool | reading () const |
bool | writing () const |
Public Attributes | |
std::atomic< uint8_t > | waitingToBeFreed |
may be accessed w/o a lock More... | |
ReadWriteLock | lock |
protects slot data below More... | |
unsigned char | key [MEMMAP_SLOT_KEY_SIZE] |
The entry key. More... | |
unsigned char | p [MEMMAP_SLOT_DATA_SIZE] |
The memory block;. More... | |
size_t | pSize |
time_t | expire |
Detailed Description
Constructor & Destructor Documentation
◆ MemMapSlot()
Ipc::MemMapSlot::MemMapSlot | ( | ) |
Member Function Documentation
◆ empty()
bool Ipc::MemMapSlot::empty | ( | ) | const |
Definition at line 316 of file MemMap.cc.
Referenced by Ipc::MemMap::freeLocked(), Ipc::MemMap::openForReadingAt(), and Ipc::MemMap::openForWritingAt().
◆ keySize()
|
inline |
◆ reading()
|
inline |
Definition at line 42 of file MemMap.h.
References lock, and Ipc::ReadWriteLock::readers.
Referenced by Ipc::MemMap::closeForReading(), Ipc::MemMap::openForWritingAt(), and Ipc::MemMap::peekAtReader().
◆ sameKey()
bool Ipc::MemMapSlot::sameKey | ( | const cache_key *const | aKey | ) | const |
◆ set()
void Ipc::MemMapSlot::set | ( | const unsigned char * | aKey, |
const void * | block, | ||
size_t | blockSize, | ||
time_t | expire = 0 |
||
) |
◆ size()
|
inline |
Definition at line 37 of file MemMap.h.
References MemMapSlot().
◆ writing()
|
inline |
Definition at line 43 of file MemMap.h.
References lock, and Ipc::ReadWriteLock::writing.
Referenced by Ipc::MemMap::abortWriting(), Ipc::MemMap::closeForWriting(), Ipc::MemMap::openForWritingAt(), Ipc::MemMap::peekAtReader(), and Ipc::MemMap::switchWritingToReading().
Member Data Documentation
◆ expire
◆ key
unsigned char Ipc::MemMapSlot::key[MEMMAP_SLOT_KEY_SIZE] |
Definition at line 47 of file MemMap.h.
Referenced by MemMapSlot(), Ipc::MemMap::freeLocked(), and keySize().
◆ lock
|
mutable |
Definition at line 46 of file MemMap.h.
Referenced by Ipc::MemMap::closeForReading(), Ipc::MemMap::closeForWriting(), Ipc::MemMap::free(), Ipc::MemMap::freeLocked(), Ipc::MemMap::openForReadingAt(), Ipc::MemMap::openForWritingAt(), reading(), Ipc::MemMap::switchWritingToReading(), and writing().
◆ p
unsigned char Ipc::MemMapSlot::p[MEMMAP_SLOT_DATA_SIZE] |
Definition at line 48 of file MemMap.h.
Referenced by MemMapSlot().
◆ pSize
◆ waitingToBeFreed
std::atomic<uint8_t> Ipc::MemMapSlot::waitingToBeFreed |
Definition at line 45 of file MemMap.h.
Referenced by Ipc::MemMap::free(), Ipc::MemMap::freeLocked(), Ipc::MemMap::openForReadingAt(), and Ipc::MemMap::openForWritingAt().
The documentation for this class was generated from the following files: