Fawkes API  Fawkes Development Version
aqt_vision_threads.h
1 
2 /***************************************************************************
3  * aqt_vision_threads.h - FireVision Base Vision Camera Data
4  *
5  * Created: Mon Sep 24 16:16:05 2007
6  * Copyright 2006-2007 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #ifndef __FIREVISION_APPS_BASE_AQT_VISION_THREADS_H_
24 #define __FIREVISION_APPS_BASE_AQT_VISION_THREADS_H_
25 
26 #include <core/threading/thread_list.h>
27 
28 namespace fawkes {
29  class Clock;
30  class Time;
31  class Barrier;
32 }
33 
35 {
36  friend class FvBaseThread;
37  friend class FvAquisitionThread;
38  public:
41 
42  void add_waiting_thread(fawkes::Thread *thread);
43  void remove_thread(fawkes::Thread *thread);
44  void remove_waiting_thread(fawkes::Thread *thread);
45  void set_thread_running(fawkes::Thread *thread);
46 
47  bool empty();
48  float empty_time();
49 
50  bool has_cyclic_thread();
51  bool has_cont_thread();
52 
53  void wakeup_and_wait_cyclic_threads();
54 
55  void set_prepfin_hold(bool hold);
56 
57  bool has_waiting_thread(fawkes::Thread *t);
58 
59  private:
60  fawkes::ThreadList *running_threads_cyclic;
61  fawkes::ThreadList *running_threads_cont;
62  fawkes::ThreadList *waiting_threads;
63 
64  fawkes::Barrier *cyclic_barrier;
65 
66  fawkes::Clock *clock;
67  fawkes::Time *_empty_time;
68 };
69 
70 #endif
Fawkes library namespace.
This is supposed to be the central clock in Fawkes.
Definition: clock.h:34
A class for handling time.
Definition: time.h:91
Aquisition-dependant threads.
Thread class encapsulation of pthreads.
Definition: thread.h:42
List of threads.
Definition: thread_list.h:57
FireVision base thread.
Definition: base_thread.h:46
A barrier is a synchronization tool which blocks until a given number of threads have reached the bar...
Definition: barrier.h:32