icl_core_logging/Thread.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 //----------------------------------------------------------------------
26 //----------------------------------------------------------------------
27 #ifndef ICL_CORE_LOGGING_THREAD_H_INCLUDED
28 #define ICL_CORE_LOGGING_THREAD_H_INCLUDED
29 
30 #include <icl_core/BaseTypes.h>
31 #include <icl_core/os_thread.h>
32 #include <icl_core/Noncopyable.h>
34 
35 namespace icl_core {
36 namespace logging {
37 
38 class ThreadImpl;
39 
47 {
48 public:
53  Thread(icl_core::ThreadPriority priority = 0);
54 
56  virtual ~Thread();
57 
64  bool execute() const { return m_execute; }
65 
69  void join();
70 
77  virtual void run() = 0;
78 
80  bool running() const { return !m_finished; }
81 
87  bool start();
88 
94  void stop() { waitStarted(); m_execute = false; }
95 
96 private:
100  virtual void runThread();
101 
103  void waitStarted() const;
104 
105  bool m_execute;
107  bool m_joined;
109 
111 
112  // Declare thread implementations as friends so that they have access to the
113  // RunThread() function!
114  friend class ThreadImplLxrt33;
115  friend class ThreadImplLxrt35;
116  friend class ThreadImplLxrt38;
117  friend class ThreadImplPosix;
118  friend class ThreadImplWin32;
119 };
120 
121 }
122 }
123 
124 #endif
Contains import/export definitions for the Win32 plattform.
String join(const std::vector< String > &substrings, const String &delimiter)
Contains global thread related functions, encapsulated into the icl_core::os namespace.
Contains Interface base classes and base types.
Contains icl_core::Noncopyable.
#define ICL_CORE_LOGGING_IMPORT_EXPORT
int32_t ThreadPriority
Definition: os_thread.h:50


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