43 lines
971 B
C++
43 lines
971 B
C++
/**
|
|
* @file mix_cc/shm/container/vector.h
|
|
* @brief 共享内存vector
|
|
* @author Cat (null.null.null@qq.com)
|
|
* @version 0.1
|
|
* @date 2021-05-07
|
|
*
|
|
* Copyright: Baosight Co. Ltd.
|
|
* DO NOT COPY/USE WITHOUT PERMISSION
|
|
*
|
|
*/
|
|
#pragma once
|
|
|
|
#include <mix_cc/shm/utility.h>
|
|
#include <mix_cc/shm/stl_builder.h>
|
|
#include <boost/interprocess/containers/vector.hpp>
|
|
|
|
namespace mix_cc {
|
|
namespace shm {
|
|
/**
|
|
* @brief 共享内存vector
|
|
* @tparam T
|
|
* @tparam Segment
|
|
* @tparam Options
|
|
*/
|
|
template <class T, class Segment = bip::managed_mapped_file,
|
|
class Options = void>
|
|
using Vector = bip::vector<T, ScopedShmAlloc<T, Segment>, Options>;
|
|
|
|
/**
|
|
* @brief 共享内存vector构造器
|
|
* @tparam T
|
|
* @tparam Segment
|
|
* @tparam Options
|
|
*/
|
|
template <class T, class Segment = bip::managed_mapped_file,
|
|
class Options = void>
|
|
class VectorBuilder
|
|
: public StlBuilder<Vector<T, Segment, Options>, T, Segment> {};
|
|
|
|
} // namespace shm
|
|
} // namespace mix_cc
|