Internals¶
Callback functions¶
The LambdaPointer class is used to provide contextfull callback functions, using c++11 lambdas
-
template <typename Out, typename... In>
template<>
classpacketio::LambdaPointer<Out(In...)>¶ A wrapper for storing a pointer to a lambda function, that works with captured variables.
- Template Parameters
Out: lambda return typeIn: lambda argument types
Public Functions
-
template <typename T>
LambdaPointer(T *lambda)¶ Create a LambdaPointer from a lambda, possibly with captures.
- Parameters
lambda: A pointer to the lambda function. Because this a pointer, this must be allocated on the stack.
-
LambdaPointer(Out (*fptr)(In...))¶ Create a LambdaPointer from a raw function pointer.
- Parameters
fptr: The context-less function
-
Out
operator()(In... in)¶ Invoke the underlying function.
-
operator bool()¶ Determine if the reference has been initialized.
Mirror of the Arduino interface¶
These classes, found in _compat, allow testing on the desktop, and potentially execution on
non-Arduino platforms
-
class
Print¶ Lightweight mirror of the (undocumented) arduino Print class, for use on other platforms.
Subclassed by packetio::PacketPrint, Stream
-
class
Stream: Print¶ Lightweight mirror of the arduino Stream class, for use on other platforms.
Subclassed by packetio::PacketStream