gaze  0.1.0
Perform gaze tracking with common webcams.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
Public Member Functions | List of all members
gaze::Pipeline Class Reference

The processing pipeline from input to output. More...

#include "gaze/pipeline.h"

Public Member Functions

 Pipeline (std::vector< PipelineStep * > steps, const bool start=true)
 
 ~Pipeline ()
 
void start ()
 
void stop ()
 
util::Data get_data ()
 
std::vector< PipelineStep * > get_steps ()
 

Detailed Description

The processing pipeline from input to output.

Definition at line 19 of file pipeline.h.

Constructor & Destructor Documentation

gaze::Pipeline::Pipeline ( std::vector< PipelineStep * >  steps,
const bool  start = true 
)
explicit

Initializes the pipeline and starts the processing.

The start can be deferred and manually invoked by a call to start().

Parameters
stepsThe PipelineSteps to use.
startif true, the processing will start automatically.

Definition at line 47 of file pipeline.cpp.

References std::ref(), and start().

48  : steps(steps) {
49  this->thread = new std::thread(&Pipeline::operator(), std::ref(*this));
50  if (start) {
51  this->start();
52  }
53 }
void start()
Definition: pipeline.cpp:61
reference_wrapper< _Tp > ref(_Tp &__t) noexcept
gaze::Pipeline::~Pipeline ( )

Stops processing if not already done, joins the thread and deletes it.

Definition at line 55 of file pipeline.cpp.

References stop().

55  {
56  this->stop();
57  this->thread->join();
58  delete this->thread;
59 }

Member Function Documentation

util::Data gaze::Pipeline::get_data ( )
Returns
the last updated data element.

Definition at line 69 of file pipeline.cpp.

References lock().

Referenced by gaze::GazeTracker::get_current_gaze_point(), and gaze::gui::DebugWindow::on_user_event().

69  {
70  std::shared_lock<std::shared_mutex> lock(this->data_access_mutex);
71  return this->current_data;
72 }
void lock(_L1 &__l1, _L2 &__l2, _L3 &...__l3)
std::vector< PipelineStep * > gaze::Pipeline::get_steps ( )
Returns
The PipelineSteps.

Definition at line 74 of file pipeline.cpp.

74  {
75  return this->steps;
76 }
void gaze::Pipeline::start ( )

Starts the processing of the underlying thread.

Definition at line 61 of file pipeline.cpp.

Referenced by Pipeline().

61  {
62  this->running = true;
63 }
void gaze::Pipeline::stop ( )

Stops the processing of the underlying thread.

Definition at line 65 of file pipeline.cpp.

Referenced by ~Pipeline().

65  {
66  this->running = false;
67 }

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