NIST Biometric Evaluation Framework
Software components for biometric technology evaluations
Public Member Functions | Protected Attributes | List of all members
BiometricEvaluation::Process::WorkerController Class Referenceabstract

Wrapper of a Worker returned from a Process::Manager. More...

#include <be_process_workercontroller.h>

Inherited by BiometricEvaluation::Process::ForkWorkerController, and BiometricEvaluation::Process::POSIXThreadWorkerController.

Public Member Functions

 WorkerController (std::shared_ptr< Worker > worker)
 WorkerController constructor. More...
 
virtual void sendMessageToWorker (const Memory::uint8Array &message)
 Send a message to the Worker contained within this WorkerController. More...
 
virtual void setParameter (const std::string &name, std::shared_ptr< void > argument)
 Set the parameter to be passed to the Worker. More...
 
virtual void setParameterFromDouble (const std::string &name, double argument)
 Set a double parameter to be passed to the Worker. More...
 
virtual void setParameterFromInteger (const std::string &name, int64_t argument)
 Set an integer parameter to be passed to the Worker. More...
 
virtual void setParameterFromString (const std::string &name, const std::string &argument)
 Set a string parameter to be passed to the Worker. More...
 
virtual void reset ()
 Reuse the Worker. More...
 
virtual bool isWorking () const =0
 Obtain whether or not Worker is working. More...
 
virtual bool everWorked () const =0
 Obtain whether or not this Worker has ever worked. More...
 
bool finishedWorking () const
 Obtain whether or not this Worker has both started and finished its task. More...
 
std::shared_ptr< WorkergetWorker () const
 Obtain the Worker instance being wrapped. More...
 
virtual int32_t getExitStatus () const final
 Obtain the exit status of the wrapped Worker. More...
 
virtual ~WorkerController ()
 WorkerController destructor. More...
 

Protected Attributes

std::shared_ptr< Worker_worker
 The Worker instance that is running in this child. More...
 
bool _rvSet
 Whether or not _rv contains a true value. More...
 
int32_t _rv
 Exit status from _worker.workerMain() More...
 

Detailed Description

Wrapper of a Worker returned from a Process::Manager.

Definition at line 29 of file be_process_workercontroller.h.

Constructor & Destructor Documentation

◆ WorkerController()

BiometricEvaluation::Process::WorkerController::WorkerController ( std::shared_ptr< Worker worker)

WorkerController constructor.

Parameters
workerThe Worker instance to wrap.

◆ ~WorkerController()

virtual BiometricEvaluation::Process::WorkerController::~WorkerController ( )
virtual

WorkerController destructor.

Member Function Documentation

◆ sendMessageToWorker()

virtual void BiometricEvaluation::Process::WorkerController::sendMessageToWorker ( const Memory::uint8Array message)
virtual

Send a message to the Worker contained within this WorkerController.

Parameters
messageMessage to send to the Worker.
Exceptions
Error::ObjectDoesNotExistWorker receive pipe is closed (Worker object likely destroyed).
Error::StrategyErrorMessage sending failed.

◆ setParameter()

virtual void BiometricEvaluation::Process::WorkerController::setParameter ( const std::string &  name,
std::shared_ptr< void >  argument 
)
virtual

Set the parameter to be passed to the Worker.

Parameters
[in]nameThe name representing the argument in the Worker.
[in]argumentThe argument to be passed to the Worker.
Note
Subsequent calls to setParameter() with the same name will overwrite any exiting argument.

◆ setParameterFromDouble()

virtual void BiometricEvaluation::Process::WorkerController::setParameterFromDouble ( const std::string &  name,
double  argument 
)
virtual

Set a double parameter to be passed to the Worker.

Parameters
[in]nameThe name representing the argument in the Worker.
[in]argumentThe double to be passed to the Worker.
Note
Subsequent calls to setParameter*() with the same name will overwrite any exiting argument.

◆ setParameterFromInteger()

virtual void BiometricEvaluation::Process::WorkerController::setParameterFromInteger ( const std::string &  name,
int64_t  argument 
)
virtual

Set an integer parameter to be passed to the Worker.

Parameters
[in]nameThe name representing the argument in the Worker.
[in]argumentThe integer to be passed to the Worker.
Note
Subsequent calls to setParameter*() with the same name will overwrite any exiting argument.

◆ setParameterFromString()

virtual void BiometricEvaluation::Process::WorkerController::setParameterFromString ( const std::string &  name,
const std::string &  argument 
)
virtual

Set a string parameter to be passed to the Worker.

Parameters
[in]nameThe name representing the argument in the Worker.
[in]argumentThe string to be passed to the Worker.
Note
Subsequent calls to setParameter*() with the same name will overwrite any exiting argument.

◆ reset()

virtual void BiometricEvaluation::Process::WorkerController::reset ( )
virtual

◆ isWorking()

virtual bool BiometricEvaluation::Process::WorkerController::isWorking ( ) const
pure virtual

Obtain whether or not Worker is working.

Returns
Whether or not the Worker is working.

Implemented in BiometricEvaluation::Process::ForkWorkerController, and BiometricEvaluation::Process::POSIXThreadWorkerController.

◆ everWorked()

virtual bool BiometricEvaluation::Process::WorkerController::everWorked ( ) const
pure virtual

Obtain whether or not this Worker has ever worked.

Returns
true the Worker has ever or is currently working, false otherwise.
Note
reset() will change the result of this method.

Implemented in BiometricEvaluation::Process::ForkWorkerController, and BiometricEvaluation::Process::POSIXThreadWorkerController.

◆ finishedWorking()

bool BiometricEvaluation::Process::WorkerController::finishedWorking ( ) const
inline

Obtain whether or not this Worker has both started and finished its task.

Returns
true if the Worker has both started and finished performing its task, false otherwise.
Note
reset() will change the result of this method.

Definition at line 185 of file be_process_workercontroller.h.

◆ getWorker()

std::shared_ptr< Worker > BiometricEvaluation::Process::WorkerController::getWorker ( ) const

Obtain the Worker instance being wrapped.

Returns
Worker instance.

◆ getExitStatus()

virtual int32_t BiometricEvaluation::Process::WorkerController::getExitStatus ( ) const
finalvirtual

Obtain the exit status of the wrapped Worker.

Returns
Exit status of the wrapped Worker.
Exceptions
Error::ObjectDoesNotExistExit status not set.
Error::StrategyErrorExit status not set (e.g., Worker has not been started or Worker has not finished).

Member Data Documentation

◆ _worker

std::shared_ptr<Worker> BiometricEvaluation::Process::WorkerController::_worker
protected

The Worker instance that is running in this child.

Definition at line 229 of file be_process_workercontroller.h.

◆ _rvSet

bool BiometricEvaluation::Process::WorkerController::_rvSet
protected

Whether or not _rv contains a true value.

Definition at line 231 of file be_process_workercontroller.h.

◆ _rv

int32_t BiometricEvaluation::Process::WorkerController::_rv
protected

Exit status from _worker.workerMain()

Definition at line 233 of file be_process_workercontroller.h.


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