mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/TACOS.git
synced 2025-08-06 09:37:34 +00:00
Changed registerThread to accept shared_ptrs to fix some issues with polymorphism.
This commit is contained in:
@@ -15,8 +15,9 @@
|
||||
# error "Manger task priority not specified in config.hpp"
|
||||
#else
|
||||
|
||||
#include <list>
|
||||
#include <set>
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <sta/tacos/thread.hpp>
|
||||
|
||||
namespace sta
|
||||
@@ -39,7 +40,10 @@ namespace sta
|
||||
return _instance;
|
||||
}
|
||||
|
||||
void registerThread(TacosThread thread, std::list<uint16_t> states);
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void registerThread(std::shared_ptr<TacosThread> thread, std::list<uint16_t> states);
|
||||
|
||||
void init() override;
|
||||
|
||||
@@ -73,7 +77,7 @@ namespace sta
|
||||
|
||||
void stopThreads(uint16_t state);
|
||||
|
||||
std::set<TacosThread> threads_[STA_TACOS_NUM_STATES];
|
||||
std::set<std::shared_ptr<TacosThread>> threads_[STA_TACOS_NUM_STATES];
|
||||
};
|
||||
} // namespace tacos
|
||||
} // namespace sta
|
||||
|
@@ -61,12 +61,12 @@ namespace sta
|
||||
/**
|
||||
* @brief This function is executed first when this thread is started.
|
||||
*/
|
||||
virtual void init();
|
||||
virtual void init() = 0;
|
||||
|
||||
/**
|
||||
* @brief The body of the thread's loop. Has to be implemented by the user.
|
||||
*/
|
||||
virtual void func();
|
||||
virtual void func() = 0;
|
||||
|
||||
private:
|
||||
|
||||
|
Reference in New Issue
Block a user