mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/TACOS.git
synced 2025-06-10 16:45:59 +00:00
Fixed the addThread function
This commit is contained in:
parent
9c167e2074
commit
74e1226998
@ -13,6 +13,7 @@
|
||||
#include <sta/tacos/statemachine.hpp>
|
||||
|
||||
#include <initializer_list>
|
||||
#include <type_traits>
|
||||
|
||||
|
||||
namespace sta
|
||||
@ -52,8 +53,11 @@ namespace sta
|
||||
* @param states A list of states in which the thread should run.
|
||||
* @param args The constructor arguments for the provided class.
|
||||
*/
|
||||
template<typename T>
|
||||
void addThread(std::list<uint16_t> states, std::initializer_list<T> args);
|
||||
template<typename T, typename ... Args>
|
||||
void addThread(std::list<uint16_t> states, Args ... args)
|
||||
{
|
||||
Manager::instance()->registerThread(std::make_shared<T>(args...), states);
|
||||
}
|
||||
} // namespace tacos
|
||||
}
|
||||
|
||||
|
@ -26,12 +26,6 @@ namespace sta
|
||||
{
|
||||
Statemachine::instance()->requestTimedStateTransition(from, to, millis, lockout);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void addThread(std::list<uint16_t> states, std::initializer_list<T> args)
|
||||
{
|
||||
Manager::instance()->registerThread(std::make_shared<T>(args), states);
|
||||
}
|
||||
} // namespace tacos
|
||||
|
||||
} // namespace sta
|
||||
|
Loading…
x
Reference in New Issue
Block a user