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