-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathevent_loop.cpp
63 lines (49 loc) · 1.01 KB
/
event_loop.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Copyright (c) 2013 Arista Networks, Inc. All rights reserved.
// Arista Networks, Inc. Confidential and Proprietary.
#include "eos/panic.h"
#include "eos/event_loop.h"
#include "impl.h"
namespace eos {
void
event_loop_handler::on_readable(int) {
impl.main_loop(0);
}
void
event_loop_handler::on_writable(int) {
impl.main_loop(0);
}
void
event_loop_handler::on_exception(int) {
impl.main_loop(0);
}
void
event_loop_handler::on_timeout() {
impl.main_loop(0);
}
event_loop::event_loop(mount_mgr * mgr) : mount_mgr_(mgr) {
}
event_loop::~event_loop() {
}
void
event_loop::wait_for_initialized() const {
}
void
event_loop::run(seconds_t duration) const {
if(duration < 0){
panic("duration must be 0 or greater");
}
impl.main_loop(duration);
}
void
event_loop::flush() const {
impl.main_loop(0);
}
void
event_loop::external_loop_is(event_loop_handler * loop) {
if(!loop) {
panic("The event_loop_handler passed in argument was null");
}
loop_ = loop;
// TODO: No-op impl.
}
}