Questions?


Get in touch with us today and our team of imaging professionals will be pleased to assist you.

Contact Us

eSDK Pro Plugin TaskWorker Class

This topic describes the TaskWorker class in the eSDK Pro Plugin API.


TaskWorker Class

Namespace: eSdkPro::Plugin  

Header: eSdkPro/plugin/taskworker.h

Base class for all task workers. A task worker provides the implementation of a task to process input data and produce output data.

To implement custom data processing, a subclass of TaskWorker must be created implementing the custom processing, and RegisterTaskPlugin() must be called to register the task with eSDK Pro. The task can then be added to a pipeline using a PluginTask.

TaskWorker()

eSdkPro::Plugin::TaskWorker::TaskWorker()


Constructs a task for being processed within a pipeline in eCapturePro. Task parameters and I/O defined by the task should be added within the constructor.

Init()

virtual bool eSdkPro::Plugin::TaskWorker::Init()


Initializes this pipeline task processing. Allocate all internal data structures that are necessary prior to processing anything in the Process() function.

Returns: True if the task was successfully initialized, false otherwise.

Start()

virtual void eSdkPro::Plugin::TaskWorker::Start()


Called before processing starts.

Process()

virtual bool eSdkPro::Plugin::TaskWorker::Process() = 0


Interface for doing any type of processing during a pipeline's execution. This function executes in a dedicated TaskWorker processing thread and will be called once input data is available to be processed.

Returns: True if the inputs were successfully processed and outputs were set; false otherwise.

Stop()

virtual void eSdkPro::Plugin::TaskWorker::Stop()


Called after processing ends.

Deinit()

virtual void eSdkPro::Plugin::TaskWorker::Deinit()


Deinitializes this pipeline task. It must release or destroy all internally allocated data structures. If this function is called from the destructor, make sure to add safety checks to not double release resources.

CreateParameter()

template <typename T, typename = ValidTaskParam<T>>
T eSdkPro::Plugin::TaskWorker::CreateParameter(const std::string& name)


Creates a task parameter of type T.

Template parameter: T — The type of the task parameter. T must derive from TaskParam.

Parameter: name — The name of the parameter.

Returns: The created task parameter object of type T.

GetParameter()

template <typename T, typename = ValidTaskParam<T>>
T eSdkPro::Plugin::TaskWorker::GetParameter(const std::string& name) const


Gets a task parameter of type T.

Template parameter: T — The type of the task parameter. T must derive from TaskParam.

Parameter: name — The name of the parameter.

Returns: The task parameter object of type T.

SetName()

void eSdkPro::Plugin::TaskWorker::SetName(const std::string& name)


Sets a unique name for this task. A task cannot be used if no name is set.

Parameter: name — The unique name of the task.

CreateFrameInput()

FrameInput eSdkPro::Plugin::TaskWorker::CreateFrameInput(
	const std::string& name,
	HWPlatform platform = HWPlatform::Host)


Creates a frame Input port.

Parameters:

  • name — The name of the port.
  • platform — The hardware platform of the port.

Returns: The Input port.

CreateFrameOutput()

FrameOutput eSdkPro::Plugin::TaskWorker::CreateFrameOutput(
	const std::string& name,
	HWPlatform platform = HWPlatform::Host)


Creates a frame Output port.

Parameters:

  • name — The name of the port.
  • platform — The hardware platform of the port.

Returns: The Output port.

Abort()

void eSdkPro::Plugin::TaskWorker::Abort(const std::string& msg)


Aborts the task and stops any future execution. The pipeline will stop if any task is aborted.

Parameter: msg — A message indicating why the task has aborted.

LogMessage()

void eSdkPro::Plugin::TaskWorker::LogMessage(LogLevel level, const std::string& msg)


Logs a message.

Avoid producing too many log messages as a large number of log messages may congest the server, reducing performance and responsiveness.

Parameters:

  • level — The logging level.
  • msg — The message to log.


See Also

Updated on
November 9, 2025
Questions?


Get in touch with us today and our team of imaging professionals will be pleased to assist you.

Contact Us