PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
libpropeller
libpropeller
streaminterface
streaminterface.h
1
#ifndef LIBPROPELLER_STREAMINTERFACE_H_
2
#define LIBPROPELLER_STREAMINTERFACE_H_
3
4
namespace
libpropeller
{
5
6
template
<
class
Derived>
7
struct
InputStream
{
8
int
Get(
const
int
timeout
= -1){
9
return
static_cast<
Derived*
>
(
this
)->Get(
timeout
);
10
}
11
12
int
Get(
char
*
const
buffer,
const
int
length,
const
int
timeout
= -1){
13
return
static_cast<
Derived*
>
(
this
)->Get(buffer, length,
timeout
);
14
}
15
16
int
Get(
char
*
const
buffer,
const
char
terminator =
'\n'
){
17
return
static_cast<
Derived*
>
(
this
)->Get(buffer, terminator);
18
}
19
20
21
};
22
23
template
<
class
Derived>
24
struct
OutputStream
{
25
void
Put(
const
char
character){
26
static_cast<
Derived*
>
(
this
)->Put(character);
27
}
28
29
int
Put(
const
char
* buffer_ptr){
30
return
static_cast<
Derived*
>
(
this
)->Put(buffer_ptr);
31
}
32
33
int
Put(
const
char
* buffer_ptr,
const
int
count
){
34
return
static_cast<
Derived*
>
(
this
)->Put(buffer_ptr,
count
);
35
}
36
};
37
38
}
39
40
#endif // LIBPROPELLER_STREAMINTERFACE_H_
libpropeller::InputStream
Definition:
streaminterface.h:7
timeout
int timeout(int time)
Compares the time against the time elapsed since mark (deprecated).
Definition:
timeout.c:19
count
long count(int pin, long duration)
Count number of low to high transitions an external input applies to an I/O pin over a certain period...
Definition:
count.c:19
libpropeller::OutputStream
Definition:
streaminterface.h:24
libpropeller
Definition:
board_unit_tester.h:4
Generated on Fri May 20 2022 16:48:02 for PropWare by
1.8.17