Control Surface
main
MIDI Control Surface library for Arduino
Toggle main menu visibility
Main Page
User Manual
Related Pages
Topics
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
u
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Typedefs
a
b
c
k
m
n
p
t
Enumerations
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
i
l
m
p
r
s
t
v
w
Enumerations
Enumerator
a
b
d
f
h
i
l
m
n
o
p
r
s
v
w
Related Symbols
Files
File List
File Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Functions
a
b
c
d
e
g
i
l
m
o
p
s
u
v
Variables
c
e
f
h
i
l
m
n
o
p
s
u
v
Typedefs
a
b
c
e
f
i
k
m
n
p
s
t
u
v
Enumerations
Enumerator
Macros
a
b
c
d
e
f
h
i
n
u
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
src
MIDI_Parsers
BufferPuller.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <AH/STL/vector>
// std::vector
4
#include <Settings/NamespaceSettings.hpp>
5
6
BEGIN_CS_NAMESPACE
7
12
template
<
class
T = u
int
8_t>
13
class
BufferPuller_
{
14
public
:
15
BufferPuller_
(
const
T *
buffer
,
size_t
length)
16
:
buffer
(
buffer
),
end
(
buffer
+ length) {}
15
BufferPuller_
(
const
T *
buffer
,
size_t
length) {
…
}
17
22
bool
pull
(T &output) {
23
if
(
buffer
!=
end
) {
24
output = *
buffer
++;
25
return
true
;
26
}
27
return
false
;
28
}
22
bool
pull
(T &output) {
…
}
29
30
private
:
31
const
T *
buffer
;
32
const
T *
const
end
;
33
};
13
class
BufferPuller_
{
…
};
34
35
template
<
class
T>
36
BufferPuller_<T>
BufferPuller
(
const
T *buffer,
size_t
length) {
37
return
{buffer, length};
38
}
36
BufferPuller_<T>
BufferPuller
(
const
T *buffer,
size_t
length) {
…
}
39
template
<
class
T>
40
BufferPuller_<T>
BufferPuller
(
const
std::vector<T> &buffer) {
41
return
{buffer.data(), buffer.size()};
42
}
40
BufferPuller_<T>
BufferPuller
(
const
std::vector<T> &buffer) {
…
}
43
template
<
class
T,
size_t
N>
44
BufferPuller_<T>
BufferPuller
(
const
T (&buffer)[N]) {
45
return
{buffer, N};
46
}
44
BufferPuller_<T>
BufferPuller
(
const
T (&buffer)[N]) {
…
}
47
48
END_CS_NAMESPACE
BufferPuller
BufferPuller_< T > BufferPuller(const T *buffer, size_t length)
Definition
BufferPuller.hpp:36
END_CS_NAMESPACE
#define END_CS_NAMESPACE
Definition
Settings/NamespaceSettings.hpp:14
BEGIN_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition
Settings/NamespaceSettings.hpp:11
BufferPuller_
Helper to pull bytes or other objects out of a buffer.
Definition
BufferPuller.hpp:13
BufferPuller_::BufferPuller_
BufferPuller_(const T *buffer, size_t length)
Definition
BufferPuller.hpp:15
BufferPuller_::end
const T *const end
Definition
BufferPuller.hpp:32
BufferPuller_::pull
bool pull(T &output)
Pull a value out of the buffer.
Definition
BufferPuller.hpp:22
BufferPuller_::buffer
const T * buffer
Definition
BufferPuller.hpp:31
Generated by
1.10.0