library/src/SharedMemoryAccess.h

43 lines
857 B
C

//
// Created by Cigerxwin Chaker on 05.11.19.
//
#ifndef LIBRARY_SHAREDMEMORYACCESSS_H
#define LIBRARY_SHAREDMEMORYACCESSS_H
/**
* use lock and unlock when writing
* @return pointer to the shared memory
*/
char *getSharedMemory();
/**
* use lock and unlock when writing,
* set content to the address
* @param *address target address
* @param size of data
* @param offset where the data is written on the shared memory
*/
void getSharedMemory(char *address, int size, int offset);
/**
*
* @return the size of the shared memory
*/
int getSharedMemorySize();
void lockSharedMemory();
void unlockSharedMemory();
/**
*
* @param data pointer to data
* @param size of data
* @param offset where the data is written on the shared memory
*/
void writeSharedMemory(char *data, int size, int offset);
#endif //LIBRARY_SHAREDMEMORYACCESSS_H