Menu

[94f52a]: / poll / pollable.hpp  Maximize  Restore  History

Download this file

28 lines (19 with data), 526 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef CHILON_POLL_POLLABLE_HPP
#define CHILON_POLL_POLLABLE_HPP
#include <chilon/config.hpp>
#include <chilon/poll/poll_status.hpp>
namespace chilon { namespace poll {
struct pollable {
virtual void operator()(poll_status const status) =0;
virtual void error() =0;
bool good() { return -1 != fd_; }
int fd() const { return fd_; }
void set_error() { fd_ = -1; }
virtual ~pollable() {}
pollable() : fd_(-1) {}
pollable(int const fd) : fd_(fd) {}
protected:
int fd_;
};
} }
#endif
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.