Control Surface
main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
src
MIDI_Parsers
LambdaPuller.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <AH/STL/utility>
// std::forward
4
#include <Settings/NamespaceSettings.hpp>
5
6
BEGIN_CS_NAMESPACE
7
12
template
<
class
Lambda>
13
class
LambdaPuller_
{
14
public
:
15
LambdaPuller_
(Lambda &&
lambda
) :
lambda
(std::forward<Lambda>(
lambda
)) {}
16
17
template
<
class
T>
18
bool
pull
(T &packet) {
19
return
lambda
(packet);
20
}
21
22
private
:
23
Lambda
lambda
;
24
};
25
26
template
<
class
Lambda>
27
LambdaPuller_<Lambda>
LambdaPuller
(Lambda &&lambda) {
28
return
std::forward<Lambda>(lambda);
29
}
30
31
END_CS_NAMESPACE
LambdaPuller
LambdaPuller_< Lambda > LambdaPuller(Lambda &&lambda)
Definition
LambdaPuller.hpp:27
END_CS_NAMESPACE
#define END_CS_NAMESPACE
Definition
Settings/NamespaceSettings.hpp:14
BEGIN_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition
Settings/NamespaceSettings.hpp:11
LambdaPuller_
Helper to turn a lambda function into a puller.
Definition
LambdaPuller.hpp:13
LambdaPuller_::lambda
Lambda lambda
Definition
LambdaPuller.hpp:23
LambdaPuller_::pull
bool pull(T &packet)
Definition
LambdaPuller.hpp:18
LambdaPuller_::LambdaPuller_
LambdaPuller_(Lambda &&lambda)
Definition
LambdaPuller.hpp:15
Generated by
1.10.0