Open Lighting Architecture
0.9.1
Main Page
Modules
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
common
io
PollerInterface.h
1
/*
2
* This library is free software; you can redistribute it and/or
3
* modify it under the terms of the GNU Lesser General Public
4
* License as published by the Free Software Foundation; either
5
* version 2.1 of the License, or (at your option) any later version.
6
*
7
* This library is distributed in the hope that it will be useful,
8
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10
* Lesser General Public License for more details.
11
*
12
* You should have received a copy of the GNU Lesser General Public
13
* License along with this library; if not, write to the Free Software
14
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15
*
16
* PollerInterface.h
17
* A poller provides the select loop.
18
* Copyright (C) 2013 Simon Newton
19
*/
20
21
#ifndef COMMON_IO_POLLERINTERFACE_H_
22
#define COMMON_IO_POLLERINTERFACE_H_
23
24
#include <ola/Clock.h>
25
#include <ola/io/Descriptor.h>
26
27
#include "common/io/TimeoutManager.h"
28
29
namespace
ola {
30
namespace
io {
31
36
class
PollerInterface
{
37
public
:
41
virtual
~PollerInterface
() {}
42
49
virtual
bool
AddReadDescriptor
(
ReadFileDescriptor
*descriptor) = 0;
50
60
virtual
bool
AddReadDescriptor
(
ConnectedDescriptor
*descriptor,
61
bool
delete_on_close) = 0;
62
68
virtual
bool
RemoveReadDescriptor
(
ReadFileDescriptor
*descriptor) = 0;
69
75
virtual
bool
RemoveReadDescriptor
(
ConnectedDescriptor
*descriptor) = 0;
76
83
virtual
bool
AddWriteDescriptor
(
WriteFileDescriptor
*descriptor) = 0;
84
90
virtual
bool
RemoveWriteDescriptor
(
WriteFileDescriptor
*descriptor) = 0;
91
92
virtual
const
TimeStamp
*WakeUpTime()
const
= 0;
93
100
virtual
bool
Poll
(
TimeoutManager
*timeout_manager,
101
const
TimeInterval
&poll_interval) = 0;
102
103
static
const
char
K_READ_DESCRIPTOR_VAR
[];
104
static
const
char
K_WRITE_DESCRIPTOR_VAR
[];
105
static
const
char
K_CONNECTED_DESCRIPTORS_VAR
[];
106
107
protected
:
108
static
const
char
K_LOOP_TIME
[];
109
static
const
char
K_LOOP_COUNT
[];
110
};
111
}
// namespace io
112
}
// namespace ola
113
#endif // COMMON_IO_POLLERINTERFACE_H_
Generated on Tue Jun 24 2014 03:57:51 for Open Lighting Architecture by
1.8.1.2