ocarina/include/idle.hpp
Anna Schumaker 14879b03fd idle: Update design and unit test
I didn't have any changes to make to the IdleQueue itself, but I did
need to update the unit test and reword a few things in the design.

Signed-off-by: Anna Schuamker <schumaker.anna@gmail.com>
2014-04-06 19:57:06 -04:00

29 lines
523 B
C++

/*
* Copyright 2013 (c) Anna Schumaker.
*
* DO NOT INCLUDE THIS FILE DIRECTLY. THIS IS A TEMPLATE DEFINITION FILE
* AND ONLY MEANT TO BE INCLUDED BY include/idle.h!
*/
#ifndef OCARINA_IDLE_HPP
#define OCARINA_IDLE_HPP
template <class T>
idle :: IdleTask<T> :: IdleTask(void (*fn)(T &), T param)
: func(fn), data(param)
{
IdleBase :: schedule();
}
template <class T>
idle :: IdleTask<T> :: ~IdleTask()
{
}
template <class T>
void idle :: IdleTask<T> :: run()
{
func(data);
}
#endif /* OCARINA_IDLE_HPP */