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

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

#include <pubThread.hpp>

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

Public Member Functions

 PubThread (const std::string &thread_id, ccf::mptk::MessageBus &message_bus, const double period=0.1)
 See ccf::mptk::Thread. More...
 
virtual ~PubThread ()
 
void Initialise ()
 Initialise this thread (object). More...
 
virtual void UserLogic ()
 Use logic invoked periodically (ccf::mptk::Thread). More...
 
void SetProcThrOutputQ (ccf::common::FrameQueue &queue)
 Set reference to the Output Queue of this Processing Thread. More...
 
ccf::common::FrameQueueGetProcThrOutputQ ()
 Get reference to the Output Queue of this Processing Thread. More...
 
void SetStatus (const ccf::common::PubStatus status)
 Set the Publishing Status of this Publisher Thread. More...
 
ccf::common::PubStatus GetStatus () const
 Return Publishing Status of this Publisher Thread. More...
 
void AddPublisher (ccf::common::PubBase *pub_obj)
 
uint8_t NbOfPublishers () const
 
const ccf::common::PubBaseGetPublisher (const uint16_t nb) const
 Get the reference to a specific Data Publisher registered in this Publisher Thread (object). More...
 
const std::list< ccf::common::PubBase * > & GetPublishers () const
 Get the list of internal Data Publisher (objects). More...
 
uint16_t GetProcThreadNb () const
 Get the number (index) allocated to the Processing Thread to which this Data Publisher Thread belongs. More...
 
uint16_t GetPubThreadNb () const
 Return the number (index) of this Publisher 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, const uint16_t pub_thread_nb)
 Generate the Publisher Thread ID used for the interthread communication. More...
 
static void SetStatusAll (const ccf::common::PubStatus status)
 Set the Publishing Status of all Publisher 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

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

Constructor & Destructor Documentation

◆ PubThread()

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

◆ ~PubThread()

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

Member Function Documentation

◆ AddPublisher()

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

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

◆ GenId()

const std::string & ccf::control::PubThread::GenId ( const uint16_t  proc_thread_nb,
const uint16_t  pub_thread_nb 
)
static

Generate the Publisher Thread ID used for the interthread communication.

◆ GetFrameStat()

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

Get reference to frame handling statistics.

◆ GetProcThreadNb()

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

Get the number (index) allocated to the Processing Thread to which this Data Publisher Thread belongs.

◆ GetProcThrOutputQ()

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

Get reference to the Output Queue of this Processing Thread.

◆ GetPublisher()

const ccf::common::PubBase & 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< ccf::common::PubBase * > & ccf::control::PubThread::GetPublishers ( ) const

Get the list of internal Data Publisher (objects).

◆ GetPubThreadNb()

uint16_t ccf::control::PubThread::GetPubThreadNb ( ) const

Return the number (index) of this Publisher Thread.

◆ GetStatus()

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

Return Publishing Status of this Publisher Thread.

◆ Initialise()

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

Initialise this thread (object).

◆ NbOfPublishers()

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

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

◆ SetProcThrOutputQ()

void ccf::control::PubThread::SetProcThrOutputQ ( ccf::common::FrameQueue queue)

Set reference to the Output Queue of this Processing Thread.

◆ SetStatus()

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

Set the Publishing Status of this Publisher Thread.

◆ SetStatusAll()

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

Set the Publishing Status of all Publisher Threads running.

◆ UserLogic()

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

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

Reimplemented from ccf::mptk::Thread.


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