Code::Blocks  SVN r11506
Public Types | Public Member Functions | Private Attributes | List of all members
SharedMemory Class Reference

#include <ipc.h>

Collaboration diagram for SharedMemory:

Public Types

enum  rw_t { reader, writer }
 

Public Member Functions

 SharedMemory ()
 
 ~SharedMemory ()
 
bool OK () const
 
void * BasePointer () const
 
size_t Size () const
 
bool Server () const
 
bool Client () const
 
bool Lock (rw_t rw)
 
void Unlock (rw_t rw)
 

Private Attributes

shm_handle_t handle
 
union {
semaphore_t semid
 
semaphore_t sem [2]
 
}; 
 
void * shared
 
bool ok
 
bool server
 

Detailed Description

Definition at line 45 of file ipc.h.

Member Enumeration Documentation

◆ rw_t

Enumerator
reader 
writer 

Definition at line 61 of file ipc.h.

Constructor & Destructor Documentation

◆ SharedMemory()

SharedMemory::SharedMemory ( )

Definition at line 75 of file ipc.cpp.

References g_failed_shm, Mgr< LogManager >::Get(), handle, ipc_buf_size, ok, LogManager::Panic(), reader, server, shared, and writer.

Referenced by Unlock().

◆ ~SharedMemory()

SharedMemory::~SharedMemory ( )

Definition at line 97 of file ipc.cpp.

References handle, reader, shared, and writer.

Referenced by Unlock().

Member Function Documentation

◆ BasePointer()

void* SharedMemory::BasePointer ( ) const
inline

Definition at line 68 of file ipc.h.

References shared.

Referenced by IPC::Entry(), and IPC::Send().

◆ Client()

bool SharedMemory::Client ( ) const
inline

Definition at line 72 of file ipc.h.

References Lock(), server, and Unlock().

◆ Lock()

bool SharedMemory::Lock ( rw_t  rw)

Definition at line 105 of file ipc.cpp.

References reader, and writer.

Referenced by Client(), IPC::Entry(), IPC::Send(), and Unlock().

◆ OK()

bool SharedMemory::OK ( ) const
inline

Definition at line 66 of file ipc.h.

References ok.

◆ Server()

bool SharedMemory::Server ( ) const
inline

Definition at line 71 of file ipc.h.

References server.

Referenced by IPC::Server().

◆ Size()

size_t SharedMemory::Size ( ) const
inline

Definition at line 69 of file ipc.h.

References ipc_buf_size.

Referenced by IPC::Send().

◆ Unlock()

void SharedMemory::Unlock ( rw_t  rw)

Member Data Documentation

◆ @6

union { ... }

◆ handle

shm_handle_t SharedMemory::handle
private

Definition at line 47 of file ipc.h.

Referenced by SharedMemory(), Unlock(), and ~SharedMemory().

◆ ok

bool SharedMemory::ok
private

Definition at line 56 of file ipc.h.

Referenced by OK(), SharedMemory(), and Unlock().

◆ server

bool SharedMemory::server
private

Definition at line 57 of file ipc.h.

Referenced by Client(), Server(), SharedMemory(), and Unlock().

◆ shared

void* SharedMemory::shared
private

Definition at line 55 of file ipc.h.

Referenced by BasePointer(), SharedMemory(), Unlock(), and ~SharedMemory().


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