eis/TestProject/SHM/EqpmRecord.h

38 lines
1000 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* @file EqpmShm.h
* @brief 共享内存 map用于将后台规则数据提供给页面使用
* @author your name (you@domain.com)
* @version 0.1
* @date 2023-10-18
*
* Copyright: Baosight Co. Ltd.
* DO NOT COPY/USE WITHOUT PERMISSION
*
*/
#pragma once
#include <mutex>
#include "shm_header.h"
namespace EqpmShm {
using namespace ShmHeader;
const static std::string dir_path = "/users/dsc/shm";
const static std::string shm_file = "EqpmRecord"; ///<映射文件名
const static std::string int_file = "Eqpmtime"; ///<映射文件名
const double data_size = 500; ///< 数据大小 MB
static managed_mapped_file_t obj_mapped_file(
bipc::open_or_create, (dir_path + "/" + shm_file + "_boost.mmap").c_str(),
mix_cc::data_size::MB(data_size));
static void_allocator default_allocator(
obj_mapped_file.get_segment_manager()); ///<默认分配器
///<定义数据
struct EqpmRecord {
int64_t stime;
int64_t etime;
};
} // namespace EqpmShm