ifw-ccf 5.0.2
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
ifw::ccf::control::PubThread Class Reference

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

#include <pubThread.hpp>

Inheritance diagram for ifw::ccf::control::PubThread:
ifw::ccf::mptk::Thread ifw::ccf::Base

Public Member Functions

 PubThread (const std::string &thread_name, ifw::ccf::mptk::MessageBus &message_bus, const double period=0.1)
 
virtual ~PubThread ()
 
void Initialise ()
 Initialise this thread (object).
 
virtual void UserLogic ()
 Use logic invoked periodically (ifw::ccf::mptk::Thread).
 
void SetProcThrOutputQ (std::shared_ptr< ifw::ccf::common::FrameQueue > &queue)
 Set reference to the Output Queue of this Processing Thread.
 
ifw::ccf::common::FrameQueueGetProcThrOutputQ ()
 Get reference to the Output Queue of this Processing Thread.
 
void SetStatus (const ifw::ccf::PubStatus status)
 Set the Publishing Status of this Publisher Thread.
 
ifw::ccf::PubStatus GetStatus () const
 Return Publishing Status of this Publisher Thread.
 
void AddPublisher (ifw::ccf::common::PubBase &pub_obj)
 
uint8_t NbOfPublishers () const
 
const ifw::ccf::common::PubBaseGetPublisher (const uint16_t nb) const
 Get the reference to a specific Data Publisher registered in this Publisher Thread (object).
 
ifw::ccf::common::PubBaseGetPublisher ()
 Get the reference to the internal publisher object.
 
const std::list< ifw::ccf::common::PubBase * > & GetPublishers () const
 Get the list of internal Data Publisher (objects).
 
void SetParentProcThreadName (const std::string &parent_proc_thread_name)
 Set the name of the parent Processing Thread in the object.
 
const std::string & GetParentProcThreadName () const
 Return the name of the parent Processing Thread from the object.
 
ifw::ccf::common::FrameStatisticsGetFrameStat ()
 Get reference to frame handling statistics.
 
- Public Member Functions inherited from ifw::ccf::mptk::Thread
 Thread (const std::string &thread_name, MessageBus &message_bus, const double period=0.1)
 Constructor method, setting up the internal members.
 
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].
 
std::string GetName () const
 Return the thread Name.
 
void Run ()
 Method to invoke the user provided business logic of the thread. The method executes internally a loop.
 
void Start ()
 Start the thread execution.
 
void Stop ()
 Stop the thread execution.
 
void Pause ()
 Pause the thread execution.
 
void Continue ()
 Continue a paused thread execution.
 
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.
 
ThreadExecControl GetExecFlag () const
 Return the value of the Thread Execution Flag.
 
bool Terminated ()
 Returns true if thread no longer running.
 
MessageBusMsgBus ()
 Get acces to the MessageBus associated with this thread object.
 
std::string ToString () const
 Generate ASCII output providing a status of the object.
 
- Public Member Functions inherited from ifw::ccf::Base
 Base ()
 
 ~Base ()
 
const std::string & GetClassName () const
 Return the allocated name of the class.
 

Static Public Member Functions

static void SetStatusAll (const ifw::ccf::PubStatus status)
 Set the Publishing Status of all Publisher Threads running.
 
- Static Public Member Functions inherited from ifw::ccf::Base
static ifw::ccf::mptk::ManagerMptk ()
 Return reference to internal MPTK instance (singleton).
 

Additional Inherited Members

- Public Types inherited from ifw::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 ifw::ccf::mptk::Thread
static std::map< std::string, Thread * > s_thread_registry
 
- Protected Member Functions inherited from ifw::ccf::Base
void SetClassName (const std::string &class_name)
 Set the name of the class in question.
 

Detailed Description

Publisher Thread MPTK Thread implementation (see also ifw::ccf::mptk::Thread).

Constructor & Destructor Documentation

◆ PubThread()

ifw::ccf::control::PubThread::PubThread ( const std::string & thread_name,
ifw::ccf::mptk::MessageBus & message_bus,
const double period = 0.1 )

See ifw::ccf::mptk::Thread. Expects name of the type: "Proc::<name>"!

◆ ~PubThread()

ifw::ccf::control::PubThread::~PubThread ( )
virtual

Member Function Documentation

◆ AddPublisher()

void ifw::ccf::control::PubThread::AddPublisher ( ifw::ccf::common::PubBase & pub_obj)

Register a new Data Publisher in the Publisher Thread. Note: For the moment only one Data Publisher is supported.

◆ GetFrameStat()

ifw::ccf::common::FrameStatistics & ifw::ccf::control::PubThread::GetFrameStat ( )

Get reference to frame handling statistics.

◆ GetParentProcThreadName()

const std::string & ifw::ccf::control::PubThread::GetParentProcThreadName ( ) const

Return the name of the parent Processing Thread from the object.

◆ GetProcThrOutputQ()

ifw::ccf::common::FrameQueue & ifw::ccf::control::PubThread::GetProcThrOutputQ ( )

Get reference to the Output Queue of this Processing Thread.

◆ GetPublisher() [1/2]

ifw::ccf::common::PubBase & ifw::ccf::control::PubThread::GetPublisher ( )

Get the reference to the internal publisher object.

◆ GetPublisher() [2/2]

const ifw::ccf::common::PubBase & ifw::ccf::control::PubThread::GetPublisher ( const uint16_t nb) const

Get the reference to a specific Data Publisher registered in this Publisher Thread (object).

◆ GetPublishers()

const std::list< ifw::ccf::common::PubBase * > & ifw::ccf::control::PubThread::GetPublishers ( ) const

Get the list of internal Data Publisher (objects).

◆ GetStatus()

ifw::ccf::PubStatus ifw::ccf::control::PubThread::GetStatus ( ) const

Return Publishing Status of this Publisher Thread.

◆ Initialise()

void ifw::ccf::control::PubThread::Initialise ( )

Initialise this thread (object).

◆ NbOfPublishers()

uint8_t ifw::ccf::control::PubThread::NbOfPublishers ( ) const

Return the number of internal Data Publishers. Note: For the moment only one Data Publisher is supported.

◆ SetParentProcThreadName()

void ifw::ccf::control::PubThread::SetParentProcThreadName ( const std::string & parent_proc_thread_name)

Set the name of the parent Processing Thread in the object.

◆ SetProcThrOutputQ()

void ifw::ccf::control::PubThread::SetProcThrOutputQ ( std::shared_ptr< ifw::ccf::common::FrameQueue > & queue)

Set reference to the Output Queue of this Processing Thread.

◆ SetStatus()

void ifw::ccf::control::PubThread::SetStatus ( const ifw::ccf::PubStatus status)

Set the Publishing Status of this Publisher Thread.

◆ SetStatusAll()

void ifw::ccf::control::PubThread::SetStatusAll ( const ifw::ccf::PubStatus status)
static

Set the Publishing Status of all Publisher Threads running.

◆ UserLogic()

void ifw::ccf::control::PubThread::UserLogic ( )
virtual

Use logic invoked periodically (ifw::ccf::mptk::Thread).

Reimplemented from ifw::ccf::mptk::Thread.


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