ifw-ccf  1.0.0
Public Member Functions | Static Public Member Functions | List of all members
ccf::control::ProcThread Class Reference

Processing Thread MPTK Thread implementation (see also ccf::mptk::Thread). More...

#include <procThread.hpp>

Inheritance diagram for ccf::control::ProcThread:
ccf::mptk::Thread ccf::common::Base

Public Member Functions

 ProcThread (const std::string &thread_id, ccf::mptk::MessageBus &message_bus, const double period=0.1)
 See ccf::mptk::Thread. More...
 
virtual ~ProcThread ()
 
void Initialise ()
 Initialise the thread object. More...
 
virtual void UserLogic ()
 Implements the user logic, executed periodically. More...
 
void SetInputQ (ccf::common::FrameQueue &queue)
 Set reference to the Application Input Queue from which the thread gets the frames. More...
 
ccf::common::FrameQueueGetInputQ ()
 Get reference to the Application Input Queue from which the thread gets the frames. More...
 
void SetOutputQ (ccf::common::FrameQueue &queue)
 Set reference to the Output Queue of this Processing Thread. More...
 
ccf::common::FrameQueueGetOutputQ ()
 Get reference to the Output Queue of this Processing Thread. More...
 
void SetStatus (const ccf::common::ProcStatus status)
 Set the Processing Status of this Processing Thread. More...
 
ccf::common::ProcStatus GetStatus () const
 Return the Processing Status of this Processing Thread. More...
 
void AddRecipe (ccf::common::RecipeBase *recipe_obj)
 
uint8_t NbOfRecipes () const
 
const ccf::common::RecipeBaseGetRecipe (const uint16_t nb)
 
uint16_t GetProcThreadNb () const
 Return the number/index allocated to this Processing Thread. More...
 
const std::string & GetProcThreadName () const
 Return the name allocated in the cfg to this Processing Thread. More...
 
ccf::common::FrameStatisticsGetFrameStat ()
 Get reference to frame handling statistics. More...
 
- Public Member Functions inherited from ccf::mptk::Thread
 Thread (const std::string &thread_id, MessageBus &message_bus, const double period=0.1)
 Constructor method, setting up the internal members. More...
 
virtual ~Thread ()
 
void SetPriority (const int prio=-1)
 If invoked, it will run the thread in real-time mode with the given priority [0; 99]. More...
 
std::string GetId () const
 Return the thread ID. More...
 
void Run ()
 Method to invoke the user provided business logic of the thread. The method executes internally a loop. More...
 
void Start ()
 Start the thread execution. More...
 
void Stop ()
 Stop the thread execution. More...
 
void Pause ()
 Pause the thread execution. More...
 
void Continue ()
 Continue a paused thread execution. More...
 
double GetDrift () const
 
bool GetExecFlag ()
 Check the Thread Execution Flag. The Thread Execution Flag shall be called regularly in the thread, at least during every internal cycle (of LogicUser()). The behavior is as follows: THREAD_EXEC_RUNNING: Return immediately with true. THREAD_EXEC_PAUSED: Wait internally for flag to change to THREAD_EXEC_RUN/_STOP. TRHEAD_EXEC_STOPPED: Return immediately with false. Thread LogicUser() shall return. More...
 
ThreadExecControl GetExecFlag () const
 Return the value of the Thread Execution Flag. More...
 
bool Terminated () const
 Returns true if thread no longer running. More...
 
MessageBusMsgBus ()
 Get acces to the MessageBus associated with this thread object. More...
 
std::string ToString () const
 Generate ASCII output providing a status of the object. More...
 
- Public Member Functions inherited from ccf::common::Base
 Base ()
 
 ~Base ()
 
const std::string & GetClassName () const
 Return the allocated name of the class. More...
 

Static Public Member Functions

static const std::string & GenId (const uint16_t proc_thread_nb)
 Generate the Processing Thread ID used for the interthread communication. More...
 
static void SetStatusAll (const ccf::common::ProcStatus status)
 Set the status of all Processing Threads running. More...
 
- Static Public Member Functions inherited from ccf::common::Base
static ccf::mptk::ManagerMptk ()
 Return reference to internal MPTK instance (singleton). More...
 
static void SetLogLevel (const ccf::common::LogLevel log_level)
 Set the log level. More...
 
static ccf::common::LogLevel GetLogLevel ()
 Return the current CCF log level. More...
 

Additional Inherited Members

- Public Types inherited from ccf::mptk::Thread
enum  ThreadExecControl { THREAD_EXEC_STOPPED = 1, THREAD_EXEC_RUNNING, THREAD_EXEC_PAUSED }
 Thread execution control/status. More...
 
- Static Public Attributes inherited from ccf::mptk::Thread
static std::map< std::string, Thread * > s_thread_registry
 
- Protected Member Functions inherited from ccf::common::Base
void SetClassName (const std::string &class_name)
 Set the name of the class in question. More...
 

Detailed Description

Processing Thread MPTK Thread implementation (see also ccf::mptk::Thread).

Constructor & Destructor Documentation

◆ ProcThread()

ccf::control::ProcThread::ProcThread ( const std::string &  thread_id,
ccf::mptk::MessageBus message_bus,
const double  period = 0.1 
)

◆ ~ProcThread()

ccf::control::ProcThread::~ProcThread ( )
virtual

Member Function Documentation

◆ AddRecipe()

void ccf::control::ProcThread::AddRecipe ( ccf::common::RecipeBase recipe_obj)

◆ GenId()

const std::string & ccf::control::ProcThread::GenId ( const uint16_t  proc_thread_nb)
static

Generate the Processing Thread ID used for the interthread communication.

◆ GetFrameStat()

ccf::common::FrameStatistics & ccf::control::ProcThread::GetFrameStat ( )

Get reference to frame handling statistics.

◆ GetInputQ()

ccf::common::FrameQueue & ccf::control::ProcThread::GetInputQ ( )

Get reference to the Application Input Queue from which the thread gets the frames.

◆ GetOutputQ()

ccf::common::FrameQueue & ccf::control::ProcThread::GetOutputQ ( )

Get reference to the Output Queue of this Processing Thread.

◆ GetProcThreadName()

const std::string& ccf::control::ProcThread::GetProcThreadName ( ) const

Return the name allocated in the cfg to this Processing Thread.

◆ GetProcThreadNb()

uint16_t ccf::control::ProcThread::GetProcThreadNb ( ) const

Return the number/index allocated to this Processing Thread.

◆ GetRecipe()

const ccf::common::RecipeBase & ccf::control::ProcThread::GetRecipe ( const uint16_t  nb)

◆ GetStatus()

ccf::common::ProcStatus ccf::control::ProcThread::GetStatus ( ) const

Return the Processing Status of this Processing Thread.

◆ Initialise()

void ccf::control::ProcThread::Initialise ( )

Initialise the thread object.

◆ NbOfRecipes()

uint8_t ccf::control::ProcThread::NbOfRecipes ( ) const

◆ SetInputQ()

void ccf::control::ProcThread::SetInputQ ( ccf::common::FrameQueue queue)

Set reference to the Application Input Queue from which the thread gets the frames.

◆ SetOutputQ()

void ccf::control::ProcThread::SetOutputQ ( ccf::common::FrameQueue queue)

Set reference to the Output Queue of this Processing Thread.

◆ SetStatus()

void ccf::control::ProcThread::SetStatus ( const ccf::common::ProcStatus  status)

Set the Processing Status of this Processing Thread.

◆ SetStatusAll()

void ccf::control::ProcThread::SetStatusAll ( const ccf::common::ProcStatus  status)
static

Set the status of all Processing Threads running.

◆ UserLogic()

void ccf::control::ProcThread::UserLogic ( )
virtual

Implements the user logic, executed periodically.

Reimplemented from ccf::mptk::Thread.


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