7#include <tamer/fdhmsg.hh>
15class fdhelper {
public:
21 void open(
const std::string &fname,
int flags, mode_t mode,
22 const event<int> &fd) {
23 _p->open(fname, flags, mode, fd);
25 void fstat(
int fd,
struct stat &stat_out,
const event<int> &done) {
26 _p->fstat(fd, stat_out, done);
28 void read(
int fd,
void *buf,
size_t size,
size_t &nread,
const event<int> &done) {
29 _p->read(fd, buf, size, nread, done);
31 void write(
int fd,
const void *buf,
size_t size,
size_t &nwritten,
const event<int> &done) {
32 _p->write(fd, buf, size, nwritten, done);
40 char buf[PATH_MAX + FDH_MSG_SIZE];
47 return _pid > 0 && _fd;
50 inline void send(
int fd,
size_t size,
const event<int> &done) {
51 _fd.sendmsg(_u.buf, size, fd, done);
53 void recv(
int *fd,
size_t size, event<int> done);
55 class closure__recv__PikQi_;
void recv(closure__recv__PikQi_ &);
58 struct fdhimp :
public enable_ref_ptr {
63 std::list<fdh *> _helpers;
64 std::list<fdh *> _ready;
65 std::list<event<> > _waiting;
70 void get(event<fdh *> done);
73 if (_waiting.size()) {
74 _waiting.front().trigger();
79 void open(std::string fname,
int flags, mode_t mode, event<int> fd);
80 void fstat(
int fd,
struct stat &stat_out, event<int> done);
81 void read(
int fd,
void *buf,
size_t size,
size_t &nread, event<int> done);
82 void write(
int fd,
const void *buf,
size_t size,
size_t &nwritten, event<int> done);
84 class closure__get__QP3fdh_;
void get(closure__get__QP3fdh_ &);
85 class closure__open__Ssi6mode_tQi_;
void open(closure__open__Ssi6mode_tQi_ &);
86 class closure__fstat__iR4statQi_;
void fstat(closure__fstat__iR4statQi_ &);
87 class closure__read__iPvkRkQi_;
void read(closure__read__iPvkRkQi_ &);
88 class closure__write__iPKvkRkQi_;
void write(closure__write__iPKvkRkQi_ &);
Event-based file descriptor wrapper class.
Classes for event-based synchronization.
Namespace containing public Tamer classes and functions for the Tamer core.
Definition adapter.hh:17
The main Tamer header file.