mirror of
https://gitee.com/jiuyilian/embedded-framework.git
synced 2025-01-06 10:16:51 -05:00
Improve:SharedData include cleaner.
This commit is contained in:
parent
0a7bf55c3e
commit
3f2bd025b4
|
@ -14,7 +14,11 @@
|
|||
*/
|
||||
#include "ISharedData.h"
|
||||
#include "ILog.h"
|
||||
#include "SharedData.h"
|
||||
#include "SharedDataImpl.h" // TODO: 互相包含,需要修改
|
||||
#include "StatusCode.h"
|
||||
#include <memory>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
void ISharedData::MakeSharedMemory(const unsigned int readableSize, const unsigned int writableSize)
|
||||
{
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
#include "SharedData.h"
|
||||
#include "ILog.h"
|
||||
#include "ISharedData.h"
|
||||
#include "StatusCode.h"
|
||||
#include <memory>
|
||||
#include <stdlib.h>
|
||||
static bool ObjectCheck(void *object)
|
||||
{
|
||||
if (nullptr == object) {
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
*/
|
||||
#include "SharedDataCode.h"
|
||||
#include "ILog.h"
|
||||
#include "SharedData.h"
|
||||
#include "StatusCode.h"
|
||||
#include <string.h>
|
||||
static const char *StatusCodeString[SHARED_DATA_CODE_END - STATUS_CODE_END + 1] = {
|
||||
"SHARED_DATA_CODE_INIT_FAILED", "SHARED_DATA_CODE_WRONG_PEER_PARAMETERS", "SHARED_DATA_CODE_END"};
|
||||
|
|
|
@ -14,9 +14,11 @@
|
|||
*/
|
||||
#include "SharedDataImpl.h"
|
||||
#include "ILog.h"
|
||||
#include "SharedData.h"
|
||||
#include "SharedDataCode.h"
|
||||
#include "SharedMemory.h"
|
||||
#include "StatusCode.h"
|
||||
#include <cstring>
|
||||
static const char *SHARED_DATA_NAME = "shared_data";
|
||||
constexpr short THERE_TWO_USER_DATA_HEADER = 2;
|
||||
SharedDataImpl::SharedDataImpl(const SHARER_NAME &sharerName, const char *path, const int &projectId)
|
||||
: SharedMemory(path, projectId), mSharerName(sharerName)
|
||||
|
|
|
@ -15,13 +15,16 @@
|
|||
#include "SharedMemory.h"
|
||||
#include "ILog.h"
|
||||
#include "LinuxApi.h"
|
||||
#include "SharedData.h"
|
||||
#include "SharedDataCode.h"
|
||||
#include "StatusCode.h"
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/shm.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
constexpr int SHMGET_FAILED = -1;
|
||||
SharedMemory::SharedMemory(const char *path, const int &projectId) : mPath(path), mProjectId(projectId)
|
||||
|
|
Loading…
Reference in New Issue
Block a user