-
Notifications
You must be signed in to change notification settings - Fork 384
ipc::shm::handle
木头云 edited this page Mar 28, 2019
·
11 revisions
共享内存对象,自动管理共享内存的生存周期,并提供基本操作的封装。
class IPC_EXPORT handle {
public:
handle();
handle(char const * name, std::size_t size, unsigned mode = create | open);
handle(handle&& rhs);
~handle();
void swap(handle& rhs);
handle& operator=(handle rhs);
bool valid() const;
std::size_t size () const;
char const * name () const;
bool acquire(char const * name, std::size_t size, unsigned mode = create | open);
void release();
void* get() const;
void attach(id_t);
id_t detach();
};| 成员 | |
|---|---|
handle |
构造函数 |
~handle |
析构函数 |
swap |
交换两个handle的内容 |
operator= |
赋值操作 |
valid |
handle有效性判断 |
size |
获取handle引用的共享内存的大小 |
name |
获取handle引用的共享内存的名称 |
acquire |
申请一块共享内存 |
release |
释放申请的共享内存 |
get |
获取handle引用的共享内存指针 |
attach |
关联并托管一个共享内存id |
detach |
释放对共享内存id的管控 |
namespaces
classes
ipc::bufferipc::circ::elem_arrayipc::circ::queueipc::routeipc::channelipc::spin_lockipc::rw_lockipc::shm::handleipc::tls::pointeripc::mem::pool_alloc
head files