INTRODUCTION
Overview
Download and Install
Documentation
Publications

REPOSITORY
Libraries

DEVELOPER
Dev Guide
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         
thread.h
1 /*
2  * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
3  * http://gearbox.sf.net/
4  * Copyright (c) 2004-2010 Alex Brooks, Alexei Makarenko, Tobias Kaupp
5  *
6  * This distribution is licensed to you under the terms described in
7  * the LICENSE file included in this distribution.
8  *
9  */
10 
11 #ifndef GBXICEUTILACFR_THREAD_H
12 #define GBXICEUTILACFR_THREAD_H
13 
14 #include <IceUtil/Thread.h>
15 #include <gbxutilacfr/stoppable.h>
16 // this is not needed for implementation of this class.
17 // it's included for convenience of users of Thread class.
18 #include <gbxsickacfr/gbxiceutilacfr/threadutils.h>
19 
20 namespace gbxiceutilacfr {
21 
72 class Thread : public IceUtil::Thread, public gbxutilacfr::Stoppable
73 {
74 public:
75 
76  Thread();
77 
80  void stop();
81 
82  // from gbxutilacfr::Stoppable
84  virtual bool isStopping();
85 
87  bool isStarted();
88 
92  bool isActive() { return !isStopping(); };
93 
94 protected:
95 
100  void waitForStop();
101 
102 private:
103  bool isStopping_;
104 };
106 typedef IceUtil::Handle<gbxiceutilacfr::Thread> ThreadPtr;
107 
110 void stop( gbxiceutilacfr::Thread* thread );
111 
114 void stopAndJoin( gbxiceutilacfr::Thread* thread );
115 
118 inline void stop( const gbxiceutilacfr::ThreadPtr& thread )
119 { stop(thread.get()); }
120 
123 inline void stopAndJoin( const gbxiceutilacfr::ThreadPtr& thread )
124 { stopAndJoin(thread.get()); }
125 
126 } // end namespace
127 
128 #endif
 

Generated for GearBox by  doxygen 1.4.5