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

An implementation of a work package processor that will extract record store keys, and optionally, values, from a WorkPackage. More...

#include <be_mpi_recordprocessor.h>

Inherits BiometricEvaluation::MPI::WorkPackageProcessor.

Public Member Functions

 RecordProcessor (const std::string &propertiesFileName)
 Construct a work package processor with the given properties. More...
 
virtual ~RecordProcessor ()
 
virtual void processRecord (const std::string &key)=0
 Method implemented by child classes to perform an action using each record from the Record Store. More...
 
virtual void processRecord (const std::string &key, const Memory::uint8Array &value)=0
 Method implemented by child classes to perform an action using each record from the Record Store. More...
 
virtual std::shared_ptr< WorkPackageProcessornewProcessor (std::shared_ptr< IO::Logsheet > &logsheet)=0
 Obtain an object that will process work packages. More...
 
virtual void performInitialization (std::shared_ptr< IO::Logsheet > &logsheet)=0
 Initialization function to be called before work is distributed to the work package processor. More...
 
void processWorkPackage (MPI::WorkPackage &workPackage)
 Process the data contents of the work package. More...
 
- Public Member Functions inherited from BiometricEvaluation::MPI::WorkPackageProcessor
virtual std::shared_ptr< WorkPackageProcessornewProcessor (std::shared_ptr< IO::Logsheet > &logsheet)=0
 Obtain an object that will process work packages. More...
 
virtual void performInitialization (std::shared_ptr< IO::Logsheet > &logsheet)=0
 Initialization function to be called before work is distributed to the work package processor. More...
 
virtual void processWorkPackage (MPI::WorkPackage &workPackage)=0
 Process the data contents of the work package. More...
 
virtual void performShutdown ()
 Terminiation function to be called during shut down after all work package processing is done. More...
 
void setLogsheet (std::shared_ptr< IO::Logsheet > &logsheet)
 Set the IO::Logsheet object that can be used to save message for objects of this class. More...
 
std::shared_ptr< IO::LogsheetgetLogsheet ()
 Obtain the IO::Logsheet object that can be used to save message for objects of this class. More...
 
virtual ~WorkPackageProcessor ()
 

Protected Member Functions

std::shared_ptr< MPI::RecordStoreResourcesgetResources ()
 

Detailed Description

An implementation of a work package processor that will extract record store keys, and optionally, values, from a WorkPackage.

Subclasses of this abstract class must implement the method to process the records associated with the keys.

Definition at line 27 of file be_mpi_recordprocessor.h.

Constructor & Destructor Documentation

◆ RecordProcessor()

BiometricEvaluation::MPI::RecordProcessor::RecordProcessor ( const std::string &  propertiesFileName)

Construct a work package processor with the given properties.

A record processor uses a named record store to retrieve the data to be processed when only the key is delivered as part of a work package. When both key and value are part of the work package, there is no need to have access to the source record store.

Note
The size of a single value item is limited to 2^32 octets. If the size of the value item is larger, behavior is undefined.
Parameters
[in]propertiesFileNameThe name of the file containing the properties for this object.
Exceptions
Error::ExceptionAn error occurred, usually due to missing or incorrect properties.

◆ ~RecordProcessor()

virtual BiometricEvaluation::MPI::RecordProcessor::~RecordProcessor ( )
virtual

Member Function Documentation

◆ processRecord() [1/2]

virtual void BiometricEvaluation::MPI::RecordProcessor::processRecord ( const std::string &  key)
pure virtual

Method implemented by child classes to perform an action using each record from the Record Store.

The source RecordStore must be accessible to the the implementation as the value for each key is not included.

Parameters
[in]keyThe key associated with the record that is to be processed.
Exceptions
Error::ExceptionAn error occurred processing the record: Missing record, input/output error, or memory allocation.

◆ processRecord() [2/2]

virtual void BiometricEvaluation::MPI::RecordProcessor::processRecord ( const std::string &  key,
const Memory::uint8Array value 
)
pure virtual

Method implemented by child classes to perform an action using each record from the Record Store.

Parameters
[in]keyThe key associated with the record that is to be processed.
[in]valueThe data from the record that is to be processed.
Exceptions
Error::ExceptionAn fatal error occurred when processing the work package; the processing responsible for this object should shut down.

◆ newProcessor()

virtual std::shared_ptr< WorkPackageProcessor > BiometricEvaluation::MPI::RecordProcessor::newProcessor ( std::shared_ptr< IO::Logsheet > &  logsheet)
pure virtual

Obtain an object that will process work packages.

This method is part of the factory personality.

Parameters
logsheetA shared pointer to the IO::Logsheet that may be used to save messages generated by the object.
Returns
A shared pointer to the work package processor.
Note
This method should always create a non-null WorkPackageProcessor. If an error occurs during construction, throw a Error::Exception with a message to be caught and logged.

Implements BiometricEvaluation::MPI::WorkPackageProcessor.

◆ performInitialization()

virtual void BiometricEvaluation::MPI::RecordProcessor::performInitialization ( std::shared_ptr< IO::Logsheet > &  logsheet)
pure virtual

Initialization function to be called before work is distributed to the work package processor.

Implementations of this class can use this function to do any processing necessary before work is given to the processor, pre-forking.

This method is part of the factory personality. All state that is to be common across all package processor objects can be initialized in this method.

Parameters
logsheetA shared pointer to the IO::Logsheet that may be used to save messages generated by the object.
Exceptions
Error::ExceptionAn implementation specific error occurred. The exception string will be logged by the Framework.

Implements BiometricEvaluation::MPI::WorkPackageProcessor.

◆ processWorkPackage()

void BiometricEvaluation::MPI::RecordProcessor::processWorkPackage ( MPI::WorkPackage workPackage)
virtual

Process the data contents of the work package.

This method is part of the worker personality.

Parameters
[in]workPackageThe work package.
Exceptions
Error::ExceptionAn fatal error occurred when processing the work package; the processing responsible for this object should shut down.

Implements BiometricEvaluation::MPI::WorkPackageProcessor.

◆ getResources()

std::shared_ptr< MPI::RecordStoreResources > BiometricEvaluation::MPI::RecordProcessor::getResources ( )
protected

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