C++ Based OPC UA Client/Server/PubSub SDK  1.7.6.537

This class represents a job to be executed by a worker thread. More...

#include <uathreadpool.h>

Inherited by HistoryJobBase, HistoryTransactionJob, IOManagerUaNodeJob, IOManagerUaNodeSamplingJob, OpcUa::ApplyChangesJob, OpcUa::MethodCallJob, RetryDurableAddItemJob, SecondsTillShutdownJob, SetDurableActiveJob, UaBaseChangeMonitorTypeContext, UaCallAsyncHandler, UaClientSdk::CallbackJob, UaClientSdk::DeleteSubscriptionJob, UaDynamicEventManagerRegistered, UaSubscriptionContext, and UaTMBaseContext.

Public Member Functions

virtual void execute ()=0
 Main function of the job to be executed. More...
 

Detailed Description

This class represents a job to be executed by a worker thread.

The job is executed and deleted by the UaThreadPool.

A derived class must be imlemented that implements the execute() method used as main function for the job. The following code gives an example on how to use a job with the UaThreadPool.

class MyWorkerJob : public UaThreadPoolJob
{
public:
MyWorkerJob(){}
virtual ~MyWorkerJob(){}
void execute()
{
// Do something here
}
};
// Use thread pool
UaThreadPool myThreadPool(4,8);
MyWorkerJob* pMyJob = new MyWorkerJob;
// Add job to thread pool, job is deleted by thread pool after execution
myThreadPool.addJob(pMyJob);

It is not possible to create shallow copies of this class.

Member Function Documentation

virtual void UaThreadPoolJob::execute ( )
pure virtual

Main function of the job to be executed.

Must be implemented by the derived class to execute the functionality

Implemented in UaBaseChangeMonitorTypeContext, UaSubscriptionContext, HistoryUpdateEventsJob, OpcUa::MethodCallJob, and UaTMBaseContext.


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