TreeFrogFramework 2.10
Loading...
Searching...
No Matches
Public Member Functions | List of all members
TSharedMemory Class Reference

#include <tsharedmemory.h>

Public Member Functions

 TSharedMemory (const QString &name)
 
 ~TSharedMemory ()
 
bool create (size_t size)
 
void unlink ()
 
bool attach ()
 
bool detach ()
 
void * data ()
 
const void * data () const
 
QString name () const
 
size_t size () const
 
bool lockForRead ()
 
bool lockForWrite ()
 
bool unlock ()
 

Detailed Description

The TSharedMemory class provides access to a shared memory segment.

Constructor & Destructor Documentation

◆ TSharedMemory()

TSharedMemory::TSharedMemory ( const QString &  name)

Constructs a shared memory object with the given name.

◆ ~TSharedMemory()

TSharedMemory::~TSharedMemory ( )

Destructor.

Member Function Documentation

◆ attach()

bool TSharedMemory::attach ( )

Attach to the shared memory segment identified by the name that was passed to the constructor.

◆ create()

bool TSharedMemory::create ( size_t  size)

Creates a shared memory segment of size bytes with the name passed to the constructor.

◆ data() [1/2]

void * TSharedMemory::data ( )

Returns a pointer to the contents of the shared memory segment, if one is attached.

◆ data() [2/2]

const void * TSharedMemory::data ( ) const
See also
data()

◆ detach()

bool TSharedMemory::detach ( )

Detaches from the shared memory segment.

◆ lockForRead()

bool TSharedMemory::lockForRead ( )

Locks the shared memory segment for reading by this process.

◆ lockForWrite()

bool TSharedMemory::lockForWrite ( )

Locks the shared memory segment for writing by this process.

◆ name()

QString TSharedMemory::name ( ) const

Returns the name to this shared memory.

◆ size()

size_t TSharedMemory::size ( ) const

◆ unlink()

void TSharedMemory::unlink ( )

Attempts to unlink the shared memory with the name passed to the constructor.

◆ unlock()

bool TSharedMemory::unlock ( )

Releases the lock on the shared memory segment.


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