icl_core_thread/ThreadImplPosix.h
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 // This file is part of FZIs ic_workspace.
5 //
6 // This program is free software licensed under the LGPL
7 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
8 // You can find a copy of this license in LICENSE folder in the top
9 // directory of the source code.
10 //
11 // © Copyright 2016 FZI Forschungszentrum Informatik, Karlsruhe, Germany
12 //
13 // -- END LICENSE BLOCK ------------------------------------------------
14 
15 //----------------------------------------------------------------------
30 //----------------------------------------------------------------------
31 #ifndef ICL_CORE_THREAD_THREAD_IMPL_POSIX_H_INCLUDED
32 #define ICL_CORE_THREAD_THREAD_IMPL_POSIX_H_INCLUDED
33 
34 #include <icl_core/os_thread.h>
35 
37 
38 namespace icl_core {
39 namespace thread {
40 
41 class Thread;
42 
47 class ThreadImplPosix : public ThreadImpl, protected virtual icl_core::Noncopyable
48 {
49 public:
51 
52  virtual ~ThreadImplPosix();
53 
54  virtual void cancel();
55  virtual icl_core::String getDescription() const { return m_description; }
56  virtual bool isHardRealtime() const { return false; }
57  virtual bool executesHardRealtime() const { return false; }
58  virtual void join();
59  virtual icl_core::ThreadPriority priority() const;
60  virtual void setDescription(const icl_core::String& description) { m_description = description; }
61  virtual bool setHardRealtime(bool hard_realtime) { return !hard_realtime; }
62  virtual bool setPriority(icl_core::ThreadPriority priority);
63  virtual bool start();
64  virtual icl_core::ThreadId threadId() const;
65 
66  //static ::icl_core::ThreadPriority maxPriorityImpl(bool realtime = false)
67  //{
68  // return 20;
69  //}
70 
71  //static ::icl_core::ThreadPriority minPriorityImpl(bool realtime = false)
72  //{
73  // return 1;
74  //}
75 
76 private:
77  static void *runThread(void *arg);
78 
79  pthread_t m_thread_id;
83 };
84 
85 }
86 }
87 
88 #endif
ICL_CORE_OS_IMPL_NS::ThreadId ThreadId
Definition: os_thread.h:49
virtual icl_core::ThreadPriority priority() const
virtual bool setHardRealtime(bool hard_realtime)
ThreadImplPosix(Thread *thread, const icl_core::String &description, icl_core::ThreadPriority priority)
Contains icl_core::thread::ThreadImpl.
virtual icl_core::ThreadId threadId() const
Contains global thread related functions, encapsulated into the icl_core::os namespace.
virtual bool setPriority(icl_core::ThreadPriority priority)
virtual void setDescription(const icl_core::String &description)
std::string String
Definition: BaseTypes.h:43
int32_t ThreadPriority
Definition: os_thread.h:50
virtual icl_core::String getDescription() const


fzi_icl_core
Author(s):
autogenerated on Mon Jun 10 2019 13:17:58