cpp-ipc/include/waiter.h
2019-02-12 13:22:49 +08:00

39 lines
564 B
C++

#pragma once
#include "export.h"
namespace ipc {
class IPC_EXPORT waiter {
public:
waiter();
explicit waiter(char const * name);
waiter(waiter&& rhs);
virtual ~waiter();
void swap(waiter& rhs);
waiter& operator=(waiter rhs);
bool valid() const;
char const * name () const;
bool open (char const * name);
void close();
bool wait();
bool wait_if_pred();
bool notify();
bool broadcast();
protected:
virtual bool pred();
private:
class waiter_;
waiter_* p_;
};
} // namespace ipc