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
virtual bool isStopping()
Returns TRUE if the thread is in Stopping state, FALSE otherwise.
Definition: thread.cpp:40
void waitForStop()
Definition: thread.cpp:48
bool isStarted()
Returns TRUE if the thread is in Started state, FALSE otherwise.
Definition: thread.cpp:24
void stopAndJoin(gbxiceutilacfr::Thread *thread)
Definition: thread.cpp:74
Utility namespace (part of SICK-ACFR driver)
Definition: buffer.h:21
A minor extention of the IceUtil::Thread class.
Definition: thread.h:72
bool isActive()
Definition: thread.h:92
void stop()
Definition: thread.cpp:32
An abstract interface class representing an stoppable activity.
Definition: stoppable.h:60
IceUtil::Handle< gbxiceutilacfr::Thread > ThreadPtr
A smart pointer to the thread class.
Definition: thread.h:106
 

Generated for GearBox by  doxygen 1.4.5