LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
okapi::Supplier< T > Class Template Reference

A supplier of instances of T. More...

#include <supplier.hpp>

Public Member Functions

 Supplier (std::function< T(void)> ifunc)
 
virtual ~Supplier ()=default
 
get () const
 Get an instance of type T.
 

Protected Attributes

std::function< T(void)> func
 

Detailed Description

template<typename T>
class okapi::Supplier< T >

A supplier of instances of T.

Template Parameters
Tthe type to supply

Definition at line 16 of file supplier.hpp.

Constructor & Destructor Documentation

◆ Supplier()

template<typename T >
okapi::Supplier< T >::Supplier ( std::function< T(void)>  ifunc)
inlineexplicit

Definition at line 18 of file supplier.hpp.

◆ ~Supplier()

template<typename T >
virtual okapi::Supplier< T >::~Supplier ( )
virtualdefault

Member Function Documentation

◆ get()

template<typename T >
T okapi::Supplier< T >::get ( ) const
inline

Get an instance of type T.

This is usually a new instance, but it does not have to be.

Returns
an instance of T

Definition at line 27 of file supplier.hpp.

Member Data Documentation

◆ func

template<typename T >
std::function<T(void)> okapi::Supplier< T >::func
protected

Definition at line 32 of file supplier.hpp.


The documentation for this class was generated from the following file: