mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-06 16:56:45 +08:00
37 lines
654 B
C++
37 lines
654 B
C++
#pragma once
|
|
|
|
#include <vector>
|
|
|
|
#include "export.h"
|
|
#include "def.h"
|
|
#include "shm.h"
|
|
|
|
namespace ipc {
|
|
|
|
using shm::handle_t;
|
|
|
|
IPC_EXPORT handle_t connect (std::string const & name);
|
|
IPC_EXPORT void disconnect(handle_t h);
|
|
|
|
IPC_EXPORT bool send(handle_t h, void* data, int size);
|
|
IPC_EXPORT std::vector<byte_t> recv(handle_t h);
|
|
|
|
class channel_;
|
|
class IPC_EXPORT channel {
|
|
public:
|
|
channel(void);
|
|
channel(std::string const & name);
|
|
channel(channel&& rhs);
|
|
|
|
~channel(void);
|
|
|
|
void swap(channel& rhs);
|
|
channel& operator=(channel rhs);
|
|
|
|
private:
|
|
friend class channel_;
|
|
channel_* p_;
|
|
};
|
|
|
|
} // namespace ipc
|