rllib
1
|
#include <rlsharedmemory.h>
Public Types | |
enum | SharedMemoryEnum { OK = 0, ERROR_FILE, ERROR_SHMGET, ERROR_SHMAT, ERROR_SHMCTL } |
Public Member Functions | |
rlSharedMemory (const char *name, unsigned long size, int rwmode=0600) | |
virtual | ~rlSharedMemory () |
int | deleteSharedMemory () |
int | write (unsigned long offset, const void *buf, int len) |
int | read (unsigned long offset, void *buf, int len) |
int | readInt (unsigned long offset, int index) |
int | readShort (unsigned long offset, int index) |
int | readByte (unsigned long offset, int index) |
float | readFloat (unsigned long offset, int index) |
int | writeInt (unsigned long offset, int index, int val) |
int | writeShort (unsigned long offset, int index, int val) |
int | writeByte (unsigned long offset, int index, unsigned char val) |
int | writeFloat (unsigned long offset, int index, float val) |
void * | getUserAdr () |
int | shmKey () |
int | shmId () |
unsigned long | size () |
Public Attributes | |
int | status |
char * | name |
Private Attributes | |
int | id |
int | shmkey |
char * | base_adr |
char * | user_adr |
unsigned long | _size |
pthread_mutex_t * | mutex |
HANDLE | hSharedFile |
OVERLAPPED | overlapped |
class for a shared memory.
A shared memory is a piece of RAM that is shared between processes. If many processes have access to the same RAM, it is necessary to lock the shared memory. The read/write methods will do this and copy the data to local data. If you want direct access, you may use getUserAdr().
Definition at line 30 of file rlsharedmemory.h.
Enumerator | |
---|---|
OK | |
ERROR_FILE | |
ERROR_SHMGET | |
ERROR_SHMAT | |
ERROR_SHMCTL |
Definition at line 33 of file rlsharedmemory.h.
rlSharedMemory::rlSharedMemory | ( | const char * | name, |
unsigned long | size, | ||
int | rwmode = 0600 |
||
) |
rwmode := access rights under unix. default 0600 user=read,write
Definition at line 90 of file rlsharedmemory.cpp.
|
virtual |
Definition at line 310 of file rlsharedmemory.cpp.
int rlSharedMemory::deleteSharedMemory | ( | ) |
Definition at line 323 of file rlsharedmemory.cpp.
void * rlSharedMemory::getUserAdr | ( | ) |
Definition at line 491 of file rlsharedmemory.cpp.
int rlSharedMemory::read | ( | unsigned long | offset, |
void * | buf, | ||
int | len | ||
) |
Definition at line 399 of file rlsharedmemory.cpp.
int rlSharedMemory::readByte | ( | unsigned long | offset, |
int | index | ||
) |
Definition at line 440 of file rlsharedmemory.cpp.
float rlSharedMemory::readFloat | ( | unsigned long | offset, |
int | index | ||
) |
Definition at line 448 of file rlsharedmemory.cpp.
int rlSharedMemory::readInt | ( | unsigned long | offset, |
int | index | ||
) |
Definition at line 424 of file rlsharedmemory.cpp.
int rlSharedMemory::readShort | ( | unsigned long | offset, |
int | index | ||
) |
Definition at line 432 of file rlsharedmemory.cpp.
int rlSharedMemory::shmId | ( | ) |
Definition at line 501 of file rlsharedmemory.cpp.
int rlSharedMemory::shmKey | ( | ) |
Definition at line 496 of file rlsharedmemory.cpp.
unsigned long rlSharedMemory::size | ( | ) |
Definition at line 506 of file rlsharedmemory.cpp.
int rlSharedMemory::write | ( | unsigned long | offset, |
const void * | buf, | ||
int | len | ||
) |
Definition at line 374 of file rlsharedmemory.cpp.
int rlSharedMemory::writeByte | ( | unsigned long | offset, |
int | index, | ||
unsigned char | val | ||
) |
Definition at line 475 of file rlsharedmemory.cpp.
int rlSharedMemory::writeFloat | ( | unsigned long | offset, |
int | index, | ||
float | val | ||
) |
Definition at line 483 of file rlsharedmemory.cpp.
int rlSharedMemory::writeInt | ( | unsigned long | offset, |
int | index, | ||
int | val | ||
) |
Definition at line 456 of file rlsharedmemory.cpp.
int rlSharedMemory::writeShort | ( | unsigned long | offset, |
int | index, | ||
int | val | ||
) |
Definition at line 464 of file rlsharedmemory.cpp.
|
private |
Definition at line 67 of file rlsharedmemory.h.
|
private |
Definition at line 65 of file rlsharedmemory.h.
|
private |
Definition at line 70 of file rlsharedmemory.h.
|
private |
Definition at line 63 of file rlsharedmemory.h.
|
private |
Definition at line 68 of file rlsharedmemory.h.
char* rlSharedMemory::name |
Definition at line 61 of file rlsharedmemory.h.
|
private |
Definition at line 71 of file rlsharedmemory.h.
|
private |
Definition at line 64 of file rlsharedmemory.h.
int rlSharedMemory::status |
Definition at line 60 of file rlsharedmemory.h.
|
private |
Definition at line 66 of file rlsharedmemory.h.