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
20namespace gbxiceutilacfr {
21
72class Thread : public IceUtil::Thread, public gbxutilacfr::Stoppable
73{
74public:
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
94protected:
95
100 void waitForStop();
101
102private:
103 bool isStopping_;
104};
105
106typedef IceUtil::Handle<gbxiceutilacfr::Thread> ThreadPtr;
107
110void stop( gbxiceutilacfr::Thread* thread );
111
114void stopAndJoin( gbxiceutilacfr::Thread* thread );
115
118inline void stop( const gbxiceutilacfr::ThreadPtr& thread )
119{ stop(thread.get()); }
120
123inline void stopAndJoin( const gbxiceutilacfr::ThreadPtr& thread )
124{ stopAndJoin(thread.get()); }
125
126} // end namespace
127
128#endif
A minor extention of the IceUtil::Thread class.
Definition thread.h:73
void waitForStop()
Definition thread.cpp:48
virtual bool isStopping()
Returns TRUE if the thread is in Stopping state, FALSE otherwise.
Definition thread.cpp:40
void stop()
Definition thread.cpp:32
bool isActive()
Definition thread.h:92
bool isStarted()
Returns TRUE if the thread is in Started state, FALSE otherwise.
Definition thread.cpp:24
An abstract interface class representing an stoppable activity.
Definition stoppable.h:61
Utility namespace (part of SICK-ACFR driver)
Definition buffer.h:21
IceUtil::Handle< gbxiceutilacfr::Thread > ThreadPtr
A smart pointer to the thread class.
Definition thread.h:106
void stopAndJoin(gbxiceutilacfr::Thread *thread)
Definition thread.cpp:74
void stop(gbxiceutilacfr::Thread *thread)
Definition thread.cpp:55
 

Generated for GearBox by  doxygen 1.4.5