An abstraction of an instance that performs work on given data.
More...
#include <be_process_worker.h>
Inherited by BiometricEvaluation::Process::MessageCenterListener, and BiometricEvaluation::Process::MessageCenterReceiver.
An abstraction of an instance that performs work on given data.
Definition at line 29 of file be_process_worker.h.
◆ ~Worker()
virtual BiometricEvaluation::Process::Worker::~Worker |
( |
| ) |
|
|
virtual |
◆ Worker()
BiometricEvaluation::Process::Worker::Worker |
( |
| ) |
|
|
protected |
◆ workerMain()
virtual int32_t BiometricEvaluation::Process::Worker::workerMain |
( |
| ) |
|
|
pure virtual |
◆ getParameter()
std::shared_ptr< void > BiometricEvaluation::Process::Worker::getParameter |
( |
const std::string & |
name | ) |
|
Obtain a parameter passed to this Worker.
- Parameters
-
name | The parameter name to retrieve. |
- Returns
- shared_ptr to the parameter argument.
- Exceptions
-
std::out_of_range | name was not set. |
◆ getParameterAsDouble()
double BiometricEvaluation::Process::Worker::getParameterAsDouble |
( |
const std::string & |
name | ) |
|
Obtain a parameter passed to this Worker as a double.
- Parameters
-
name | The parameter name to retrieve. |
- Returns
- Parameter as a double.
- Exceptions
-
std::out_of_range | name was not set. |
◆ getParameterAsInteger()
int64_t BiometricEvaluation::Process::Worker::getParameterAsInteger |
( |
const std::string & |
name | ) |
|
Obtain a parameter passed to this Worker as an integer.
- Parameters
-
name | The parameter name to retrieve. |
- Returns
- Parameter as an integer.
- Exceptions
-
std::out_of_range | name was not set. |
◆ getParameterAsString()
std::string BiometricEvaluation::Process::Worker::getParameterAsString |
( |
const std::string & |
name | ) |
|
Obtain a parameter passed to this Worker as a string.
- Parameters
-
name | The parameter name to retrieve. |
- Returns
- Parameter as a string.
- Exceptions
-
std::out_of_range | name was not set. |
◆ setParameter()
void BiometricEvaluation::Process::Worker::setParameter |
( |
const std::string & |
name, |
|
|
std::shared_ptr< void > |
argument |
|
) |
| |
Pass a parameter to this Worker.
- Parameters
-
name | A unique identifier for this parameter |
argument | A shared_ptr to the object to store. |
◆ stop()
virtual void BiometricEvaluation::Process::Worker::stop |
( |
| ) |
|
|
finalvirtual |
Tell this Worker to return ASAP.
◆ closeWorkerPipeEnds()
void BiometricEvaluation::Process::Worker::closeWorkerPipeEnds |
( |
| ) |
|
Perform initialization for communication from Worker to Manager.
- Note
- Behavior is undefined if called by a non-Manager.
- Exceptions
-
◆ closeManagerPipeEnds()
void BiometricEvaluation::Process::Worker::closeManagerPipeEnds |
( |
| ) |
|
Perform initialization for communication from Manager to Worker.
- Note
- Behavior is undefined if called by a non-Worker.
- Exceptions
-
◆ getSendingPipe()
int BiometricEvaluation::Process::Worker::getSendingPipe |
( |
| ) |
const |
Obtain the pipe used to send messages to this Worker.
- Returns
- Sending pipe.
- Exceptions
-
◆ getReceivingPipe()
int BiometricEvaluation::Process::Worker::getReceivingPipe |
( |
| ) |
const |
Obtain the pipe used to receive messages to this Worker.
- Returns
- Receiving pipe.
- Exceptions
-
◆ sendMessageToManager()
void BiometricEvaluation::Process::Worker::sendMessageToManager |
( |
const Memory::uint8Array & |
message | ) |
|
Send a message to the Manager.
- Parameters
-
[in] | message | Message to send. |
- Exceptions
-
◆ receiveMessageFromManager()
void BiometricEvaluation::Process::Worker::receiveMessageFromManager |
( |
Memory::uint8Array & |
message | ) |
|
Receive a message from the Manager.
- Parameters
-
[out] | message | Buffer to store the received message. |
- Exceptions
-
- See also
- waitForMessage
◆ _initCommunication()
void BiometricEvaluation::Process::Worker::_initCommunication |
( |
| ) |
|
Perform general communication initialization from Constructor.
- Exceptions
-
◆ stopRequested()
virtual bool BiometricEvaluation::Process::Worker::stopRequested |
( |
| ) |
const |
|
finalprotectedvirtual |
Determine if the parent has requested this child to exit.
- Returns
- Whether or not this child should exit.
◆ waitForMessage()
bool BiometricEvaluation::Process::Worker::waitForMessage |
( |
int |
numSeconds = -1 | ) |
const |
|
protected |
Block while waiting for a message from the Manager.
- Parameters
-
numSeconds | Number of seconds to wait for a message, or any value < 0 to wait forever. |
- Returns
- true once a message is ready to be read or false if an error occured.
The documentation for this class was generated from the following file: