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#include <utils/time/time.h>
28
29#include <memory>
30
31namespace fawkes {
32class Clock;
33class Barrier;
34} // namespace fawkes
35
36class FvBaseThread;
37class FvAquisitionThread;
38
40{
41 friend FvBaseThread;
42 friend FvAquisitionThread;
43
44public:
47
49 void remove_thread(fawkes::Thread *thread);
52
53 bool empty();
54 float empty_time();
55
56 bool has_cyclic_thread();
57 bool has_cont_thread();
58
60
61 void set_prepfin_hold(bool hold);
62
64
65private:
66 fawkes::ThreadList running_threads_cyclic;
67 fawkes::ThreadList running_threads_cont;
68 fawkes::ThreadList waiting_threads;
69
70 std::unique_ptr<fawkes::Barrier> cyclic_barrier;
71
72 fawkes::Clock *clock;
73 fawkes::Time _empty_time;
74};
75
76#endif
Aquisition-dependant threads.
~FvAqtVisionThreads()
Destructor.
void add_waiting_thread(fawkes::Thread *thread)
Add a thread in waiting state.
bool has_waiting_thread(fawkes::Thread *t)
Check if the given waiting thread is registered.
void wakeup_and_wait_cyclic_threads()
Wakeup and wait for all cyclic threads.
float empty_time()
Get the empty time.
void remove_waiting_thread(fawkes::Thread *thread)
Remove waiting thread.
void set_prepfin_hold(bool hold)
Set prepfin hold fo cyclic threads.
bool empty()
Check if there is no thread at all.
bool has_cont_thread()
Check if there is at least one continuous thread.
void remove_thread(fawkes::Thread *thread)
Remove a thread.
void set_thread_running(fawkes::Thread *thread)
Mark the thread as running.
FvAqtVisionThreads(fawkes::Clock *clock)
Constructor.
bool has_cyclic_thread()
Check if there is at least one cyclic thread.
FireVision base thread.
Definition: base_thread.h:54
This is supposed to be the central clock in Fawkes.
Definition: clock.h:35
List of threads.
Definition: thread_list.h:56
Thread class encapsulation of pthreads.
Definition: thread.h:46
A class for handling time.
Definition: time.h:93
Fawkes library namespace.