-
Notifications
You must be signed in to change notification settings - Fork 40
/
fd.cpp
47 lines (36 loc) · 913 Bytes
/
fd.cpp
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (c) 2013 Arista Networks, Inc. All rights reserved.
// Arista Networks, Inc. Confidential and Proprietary.
#include "eos/fd.h"
#include "impl.h"
namespace eos {
fd_handler::fd_handler() {
impl.register_fd_handler(this);
}
fd_handler::~fd_handler() {
impl.unregister_fd_handler(this);
}
void
fd_handler::on_readable(int fd) {
// Default implementation: do nothing.
}
void
fd_handler::on_writable(int fd) {
// Default implementation: do nothing.
}
void
fd_handler::on_exception(int fd) {
// Default implementation: do nothing.
}
void
fd_handler::watch_readable(int fd, bool interest) {
impl.get_fd_sm(this)->watch_readable(fd, interest);
}
void
fd_handler::watch_writable(int fd, bool interest) {
impl.get_fd_sm(this)->watch_writable(fd, interest);
}
void
fd_handler::watch_exception(int fd, bool interest) {
impl.get_fd_sm(this)->watch_exception(fd, interest);
}
}