cumbia 1.x
general purpose multi threaded library
Loading...
Searching...
No Matches
CuThreadFactoryImplI Class Referenceabstract

an interface that requires the implementation of a method to create a thread More...

#include <cuthreadfactoryimpl_i.h>

Inheritance diagram for CuThreadFactoryImplI:

Public Member Functions

virtual ~CuThreadFactoryImplI ()
 the class destructor More...
 
virtual CuThreadInterfacecreateThread (const std::string &thread_token, CuThreadsEventBridge_I *eventsBridge, const CuServiceProvider *serviceProvider, std::vector< CuThreadInterface * > *threads) const =0
 instantiates and returns an instance of an implementation of the CuThreadInterface More...
 

Detailed Description

an interface that requires the implementation of a method to create a thread

The implementors of this interface will provide the createThread method in order to instantiate and return an implementation of the CuThreadInterface

The CuThreadFactoryImpl is the cumbia base implementation of this interface. It will return a new CuThread

Constructor & Destructor Documentation

◆ ~CuThreadFactoryImplI()

virtual CuThreadFactoryImplI::~CuThreadFactoryImplI ( )
inlinevirtual

the class destructor

provided to avoid compilers' warnings about virtual destructors

References pdelete.

Member Function Documentation

◆ createThread()

virtual CuThreadInterface * CuThreadFactoryImplI::createThread ( const std::string &  thread_token,
CuThreadsEventBridge_I eventsBridge,
const CuServiceProvider serviceProvider,
std::vector< CuThreadInterface * > *  threads 
) const
pure virtual

instantiates and returns an instance of an implementation of the CuThreadInterface

Parameters
thread_tokena token assigned to this thread. It will be used to decide whether new activities are run in the same thread or in a new one. See CuActivity::registerActivity and CuThread::isEquivalent for more details. See also md_src_tutorial_cuactivity for an example
eventsBridgea pointer to an instance of an implementation of the CuThreadsEventBridge_I (see the documentation).
serviceProvidera pointer to a CuServiceProvider
Returns
an instance of an implementation of CuThreadInterface
Threads event bridge
A thread event bridge provides an interface to deliver events from a background thread to an event loop.

Known implementations:

  • CuThreadsEventBridge: cumbia bridge that relies on the CuEventLoopService
  • QThreadsEventBridge: Qt bridge that relies on QApplication and QApplication::postEvent. This is the first choice when developing Qt applications (cumbia-qtcontrols module)

Implemented in CuThreadFactoryImpl.

Referenced by CuThreadService::getThread().


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