Fawkes API Fawkes Development Version
FvAqtVisionThreads Class Reference

Aquisition-dependant threads. More...

#include "aqt_vision_threads.h"

Public Member Functions

 FvAqtVisionThreads (fawkes::Clock *clock)
 Constructor. More...
 
 ~FvAqtVisionThreads ()
 Destructor. More...
 
void add_waiting_thread (fawkes::Thread *thread)
 Add a thread in waiting state. More...
 
void remove_thread (fawkes::Thread *thread)
 Remove a thread. More...
 
void remove_waiting_thread (fawkes::Thread *thread)
 Remove waiting thread. More...
 
void set_thread_running (fawkes::Thread *thread)
 Mark the thread as running. More...
 
bool empty ()
 Check if there is no thread at all. More...
 
float empty_time ()
 Get the empty time. More...
 
bool has_cyclic_thread ()
 Check if there is at least one cyclic thread. More...
 
bool has_cont_thread ()
 Check if there is at least one continuous thread. More...
 
void wakeup_and_wait_cyclic_threads ()
 Wakeup and wait for all cyclic threads. More...
 
void set_prepfin_hold (bool hold)
 Set prepfin hold fo cyclic threads. More...
 
bool has_waiting_thread (fawkes::Thread *t)
 Check if the given waiting thread is registered. More...
 

Detailed Description

Aquisition-dependant threads.

This class is used for managing the vision threads that depend on a given aquisition thread. Used internally in base vision.

Author
Tim Niemueller

Definition at line 39 of file aqt_vision_threads.h.

Constructor & Destructor Documentation

◆ FvAqtVisionThreads()

FvAqtVisionThreads::FvAqtVisionThreads ( fawkes::Clock clock)

Constructor.

Parameters
clockClock for timeout handling, system time is used only.

Definition at line 43 of file aqt_vision_threads.cpp.

References fawkes::Clock::get_systime().

◆ ~FvAqtVisionThreads()

FvAqtVisionThreads::~FvAqtVisionThreads ( )

Destructor.

Definition at line 50 of file aqt_vision_threads.cpp.

Member Function Documentation

◆ add_waiting_thread()

void FvAqtVisionThreads::add_waiting_thread ( fawkes::Thread thread)

Add a thread in waiting state.

The thread is marked as dependant but it is otherwise ignored.

Parameters
threadthread to add for access to the YUV422_PLANAR image.

Definition at line 60 of file aqt_vision_threads.cpp.

References fawkes::ThreadList::push_back_locked().

Referenced by FvBaseThread::register_for_camera().

◆ empty()

bool FvAqtVisionThreads::empty ( )

Check if there is no thread at all.

Returns
true if there is no thread in any of the internal running or waiting lists, false otherwise

Definition at line 148 of file aqt_vision_threads.cpp.

Referenced by remove_thread(), and remove_waiting_thread().

◆ empty_time()

float FvAqtVisionThreads::empty_time ( )

Get the empty time.

Returns
the time in seconds since the last thread has been removed.

Definition at line 158 of file aqt_vision_threads.cpp.

References fawkes::Clock::elapsed().

◆ has_cont_thread()

bool FvAqtVisionThreads::has_cont_thread ( )

Check if there is at least one continuous thread.

Returns
true if there is at least one continuous thread, false otherwise.

Definition at line 128 of file aqt_vision_threads.cpp.

◆ has_cyclic_thread()

bool FvAqtVisionThreads::has_cyclic_thread ( )

Check if there is at least one cyclic thread.

Returns
true if there is at least one cyclic thread, false otherwise.

Definition at line 119 of file aqt_vision_threads.cpp.

Referenced by wakeup_and_wait_cyclic_threads().

◆ has_waiting_thread()

bool FvAqtVisionThreads::has_waiting_thread ( fawkes::Thread t)

Check if the given waiting thread is registered.

Parameters
tthread to check for
Returns
true if the given thread is marked as waiting, false otherwise

Definition at line 138 of file aqt_vision_threads.cpp.

◆ remove_thread()

void FvAqtVisionThreads::remove_thread ( fawkes::Thread thread)

Remove a thread.

The thread is removed from all internal structures.

Parameters
threadthread to remove

Definition at line 88 of file aqt_vision_threads.cpp.

References empty(), fawkes::Clock::get_systime(), and fawkes::ThreadList::remove_locked().

◆ remove_waiting_thread()

void FvAqtVisionThreads::remove_waiting_thread ( fawkes::Thread thread)

Remove waiting thread.

Parameters
threadthread to remove from waiting structures.

Definition at line 107 of file aqt_vision_threads.cpp.

References empty(), fawkes::Clock::get_systime(), and fawkes::ThreadList::remove_locked().

◆ set_prepfin_hold()

void FvAqtVisionThreads::set_prepfin_hold ( bool  hold)

Set prepfin hold fo cyclic threads.

Sets prepfin hold for cyclice threads and rolls back if it cannot be set for any of the threads.

Parameters
holdprepfin hold value
Exceptions
Exceptionthrown if setting fails
See also
Thread::set_prepfin_hold()
ThreadList::set_prepfin_hold()

Definition at line 182 of file aqt_vision_threads.cpp.

References fawkes::ThreadList::set_prepfin_hold().

Referenced by FvAcquisitionThread::set_vt_prepfin_hold().

◆ set_thread_running()

void FvAqtVisionThreads::set_thread_running ( fawkes::Thread thread)

Mark the thread as running.

Parameters
threadthread to mark as running

Definition at line 69 of file aqt_vision_threads.cpp.

References fawkes::ThreadList::push_back_locked(), fawkes::ThreadList::remove_locked(), and fawkes::VisionAspect::vision_thread_mode().

◆ wakeup_and_wait_cyclic_threads()

void FvAqtVisionThreads::wakeup_and_wait_cyclic_threads ( )

Wakeup and wait for all cyclic threads.

Definition at line 165 of file aqt_vision_threads.cpp.

References has_cyclic_thread(), and fawkes::ThreadList::wakeup().

Referenced by FvAcquisitionThread::loop().


The documentation for this class was generated from the following files: