ifw-ccf  3.0.0-pre2
Public Member Functions | List of all members
ccf::mptk::Manager Class Reference

IFW CTD Multiprocessing Toolkit Manager class. More...

#include <manager.hpp>

Public Member Functions

 Manager ()
 
 ~Manager ()
 
void Reset ()
 Reset the object. This includes stopping the possible running threads and deleting all thread objects allocated. More...
 
void StartThreads ()
 Execute all threads registered. More...
 
void PauseThreads ()
 Pause the threads. More...
 
void StopThreads ()
 Request threads to end execution. More...
 
int16_t WaitForThreadTerm (const double time_out=core::utils::base::NO_TIMEOUT)
 Wait for threads to terminate execution. Returns the number of threads running. More...
 
int16_t NbOfThreadsRunning () const
 Returns the number of threads running; this includes the ones that may be paused. More...
 
MessageBusMsgBus ()
 Get reference to Message Bus. More...
 
std::string ToString () const
 Generate ASCII output providing a status of the object. More...
 
template<class THREAD_TYPE >
void CreateThread (const std::string &thread_name, const double period=0.1, THREAD_TYPE **thread_obj=nullptr)
 Allocate new MPTK thread object of the given type. The allocated thread object is handled internally in the thread manager. More...
 
template<class THREAD_TYPE >
void CreateThread (const THREAD_TYPE &factory_object, const std::string &thread_name, const double period=0.1, THREAD_TYPE **thread_obj=nullptr)
 Allocate new MPTK thread object of the given type. The allocated thread object is handled internally in the thread manager. More...
 
template<class THREAD_TYPE >
void GetThread (const std::string &thread_name, THREAD_TYPE **thread_obj)
 Get reference to MPTK thread, registered in the Thread Registry. More...
 
void GetThreadNames (std::list< std::string > &thread_names) const
 Return list with names of threads registered. More...
 

Detailed Description

IFW CTD Multiprocessing Toolkit Manager class.

The Manager class provides the services to manage one MPTK instance, for what concerns the MPTK Threads running in it and the MPTK Message Bus.

Constructor & Destructor Documentation

◆ Manager()

ccf::mptk::Manager::Manager ( )

◆ ~Manager()

ccf::mptk::Manager::~Manager ( )

Member Function Documentation

◆ CreateThread() [1/2]

template<class THREAD_TYPE >
void ccf::mptk::Manager::CreateThread ( const std::string &  thread_name,
const double  period = 0.1,
THREAD_TYPE **  thread_obj = nullptr 
)
inline

Allocate new MPTK thread object of the given type. The allocated thread object is handled internally in the thread manager.

◆ CreateThread() [2/2]

template<class THREAD_TYPE >
void ccf::mptk::Manager::CreateThread ( const THREAD_TYPE &  factory_object,
const std::string &  thread_name,
const double  period = 0.1,
THREAD_TYPE **  thread_obj = nullptr 
)
inline

Allocate new MPTK thread object of the given type. The allocated thread object is handled internally in the thread manager.

◆ GetThread()

template<class THREAD_TYPE >
void ccf::mptk::Manager::GetThread ( const std::string &  thread_name,
THREAD_TYPE **  thread_obj 
)
inline

Get reference to MPTK thread, registered in the Thread Registry.

◆ GetThreadNames()

void ccf::mptk::Manager::GetThreadNames ( std::list< std::string > &  thread_names) const

Return list with names of threads registered.

◆ MsgBus()

MessageBus & ccf::mptk::Manager::MsgBus ( )

Get reference to Message Bus.

◆ NbOfThreadsRunning()

int16_t ccf::mptk::Manager::NbOfThreadsRunning ( ) const

Returns the number of threads running; this includes the ones that may be paused.

◆ PauseThreads()

void ccf::mptk::Manager::PauseThreads ( )

Pause the threads.

◆ Reset()

void ccf::mptk::Manager::Reset ( )

Reset the object. This includes stopping the possible running threads and deleting all thread objects allocated.

◆ StartThreads()

void ccf::mptk::Manager::StartThreads ( )

Execute all threads registered.

◆ StopThreads()

void ccf::mptk::Manager::StopThreads ( )

Request threads to end execution.

◆ ToString()

std::string ccf::mptk::Manager::ToString ( ) const

Generate ASCII output providing a status of the object.

◆ WaitForThreadTerm()

int16_t ccf::mptk::Manager::WaitForThreadTerm ( const double  time_out = core::utils::base::NO_TIMEOUT)

Wait for threads to terminate execution. Returns the number of threads running.


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