Contextualization:
I am working on an algorithm of facial recognition and NIST is the organization that is trying to standardize the tests, measurement and comparison among all available algorithms. In order to be tested and compared, I need to implement their interface, which is available in FRVT Project, more specifically at frvt11.h file.
frvt11.h Relevant code for this question:
namespace FRVT {
//...A lot of code defining ReturnStatus, ReturnCode, etc.
/**
* @brief
* The interface to FRVT 1:1 implementation
*
* @details
* The submission software under test will implement this interface by
* sub-classing this class and implementing each method therein.
*/
class Interface {
public:
virtual ~Interface() {}
virtual ReturnStatus
initialize(const std::string &configDir) = 0;
/**
* @brief
* Factory method to return a managed pointer to the Interface object.
* @details
* This function is implemented by the submitted library and must return
* a managed pointer to the Interface object.
*
* @note
* A possible implementation might be:
* return (std::make_shared<Implementation>());
*/
static std::shared_ptr<Interface>
getImplementation();
};
}
implementation.h Relevant code of the implementation I am developing:
#include "frvt11.h"
using namespace FRVT;
struct Implementation : public Interface {
ReturnStatus
initialize(const std::string &configDir) override;
static std::shared_ptr<Interface>
getImplementation();
};
implementation.cpp Relevant code of the implementation I am developing:
#include "implementation.h"
using namespace FRVT;
ReturnStatus
Implementation::initialize(
const std::string &configDir) {
return ReturnStatus(ReturnCode::Success," - initialize");
}
std::shared_ptr<Interface>
Implementation::getImplementation() {
return (std::make_shared<Implementation>());
}
Finally my question:
Question: How to implement getImplementation() in order to return the referred "managed pointer to the Interface object"?