GetNeededData
Description
GetNeededData asks the plugin which data each test needs. The plugin answers "true" for yes or "false" for no if the test number "iunTestIndex" needs or not the data "iwsParameterName".
HOA automatically sends the result of the computation to the plugin, but some specific data take more time to be computed. By default, this kind of data are not computed. If you need it, you have to specify it using the "GetNeededData" function.
Syntax
int GetNeededData(const wchar_t* iwszParameterName, const unsigned int iunTestIndex, bool& obNeeded);
Parameters
Input
iwszParameterName: Data name HOA ask the plugin. See the list of possible values bellow.
iunTestIndex: Number of the test HOA asks.
Output
obNeeded:
- True if your test number "iunTestIndex" needs the data "iwszParameterName".
- False if not.
Return
(int): returns the identification number of the error if an error occurs or 0 if no error occurs.
Example
To get a full example of the API use, download the .Plugin
#define OPT_PLUGIN_NO_ERROR 0
#define OPT_PLUGIN_ERROR_UNKNOWN_TEST 3
std::map<int, std::wstring> gmTestDescription;
gmTestDescription[0] = L"Virtual Image Distance";
gmTestDescription[1] = L"Look Down Angle";
gmTestDescription[2] = L"Look Over Angle";
gmTestDescritpion[3] = L"My own test";
std::map<int, std::vector<std::wstring> > gmNeededData;
gmNeededData[3].pushback(L"KeyWord1");
gmNeededData[3].pushback(L"KeyWord2");
int GetNeededData(const wchar_t* iwszParameterName, const unsigned int iunTestIndex, bool& obNeeded)
{
if (iunTestIndex < gmTestDescription.size())
{
obNeeded = std::find(gmNeededData[iunTestIndex].begin(), gmNeededData[iunTestIndex].end(), std::wstring(iwszParameterName)) != gmNeededData[iunTestIndex].end();
}
else
{
return OPT_PLUGIN_ERROR_UNKNOWN_TEST;
}
return OPT_PLUGIN_NO_ERROR;
}
List of the possible value of "iwszParameterName"
Parameter Name |
Description |
(Empty) |
This function is provisional |