LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
supplier.hpp
Go to the documentation of this file.
1
/*
2
* This Source Code Form is subject to the terms of the Mozilla Public
3
* License, v. 2.0. If a copy of the MPL was not distributed with this
4
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
*/
6
#pragma once
7
8
#include <functional>
9
10
namespace
okapi
{
16
template
<
typename
T>
class
Supplier
{
17
public
:
18
explicit
Supplier
(std::function<T(
void
)> ifunc) :
func
(ifunc) {
19
}
20
21
virtual
~Supplier
() =
default
;
22
27
T
get
()
const
{
28
return
func
();
29
}
30
31
protected
:
32
std::function<T(
void
)>
func
;
33
};
34
}
// namespace okapi
okapi::Supplier
A supplier of instances of T.
Definition
supplier.hpp:16
okapi::Supplier::get
T get() const
Get an instance of type T.
Definition
supplier.hpp:27
okapi::Supplier::Supplier
Supplier(std::function< T(void)> ifunc)
Definition
supplier.hpp:18
okapi::Supplier::~Supplier
virtual ~Supplier()=default
okapi::Supplier::func
std::function< T(void)> func
Definition
supplier.hpp:32
okapi
Definition
chassisController.hpp:16
include
okapi
api
util
supplier.hpp
Generated by
1.9.8