23 friend class cKernelThreadHelperRunnable;
25 typedef std::shared_ptr<ImplBase> shared_base_type;
30 shared_base_type pThisPtr;
32 virtual void Run() = 0;
35 template<
typename Callable>
40 Impl(Callable&& pFunc) : pFunc(std::forward<Callable>(pFunc))
50 template<
typename Callable>
51 std::shared_ptr<Impl<Callable>> MakeCallable(Callable&& pFunc)
53 return std::make_shared<Impl<Callable>>(std::forward<Callable>(pFunc));
56 shared_base_type m_pCallable;
75 template<
typename Callable,
typename ...Args>
79 m_pCallable = MakeCallable(std::bind(std::forward<Callable>(pFunc),
80 std::forward<Args>(args)...));
81 Create(strName, sScheduling);
87 template<
typename Callable,
typename ...Args>
90 std::forward<Callable>(pFunc),
91 std::forward<Args>(args)...)
tInt64 tTimeStamp
type definition for a time value.
A common result class usable as return value throughout.
Class that manages a kernel thread.
kernel_thread(kernel_thread &&)
Move constructor.
tResult SetScheduling(const adtf::services::IKernel::tSchedulingInfo &sScheduling)
Changes the scheduling parameters of the thread.
kernel_thread(const adtf::services::IKernel::tSchedulingInfo &sScheduling, const char *strName, Callable &&pFunc, Args &&... args)
Constructor that allows the definition of scheduling parameters.
tResult Detach()
Detaches from the underlying kernel thread.
bool IsCurrentThread() const
Check if the executing thread is managed by this thread object.
kernel_thread(const char *strName, Callable &&pFunc, Args &&... args)
Constructor that creates a new thread.
bool Joinable() const
Whether or not the thread is joinable.
tResult GetScheduling(adtf::services::IKernel::tSchedulingInfo &sScheduling) const
Retrieves the scheduling parameters of the thread.
kernel_thread & operator=(kernel_thread &&oOther)
Move assignment operator.
void Swap(kernel_thread &oOther)
Swaps two threads.
~kernel_thread()
Destructor.
kernel_thread()
Default constructor.
tResult Join(tTimeStamp nTimeout=-1)
Join the thread.
Object pointer implementation used for reference counting on objects of type IObject.
Copyright © Audi Electronics Venture GmbH.
Namespace for entire ADTF SDK.
Struct for defining scheduling settings of a thread or timer.