本文整理汇总了C++中PlugInArg::getActualValue方法的典型用法代码示例。如果您正苦于以下问题:C++ PlugInArg::getActualValue方法的具体用法?C++ PlugInArg::getActualValue怎么用?C++ PlugInArg::getActualValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlugInArg
的用法示例。
在下文中一共展示了PlugInArg::getActualValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseInputArgList
bool RasterElementImporterShell::parseInputArgList(PlugInArgList* pInArgList)
{
if (pInArgList == NULL)
{
return false;
}
StepResource pStep("Validate Inputs", "app", "4CDCFA20-2A40-452D-9956-264A35F8B883");
// Extract the input args
PlugInArg* pArg = NULL;
bool bSuccess = false;
// Progress
bSuccess = pInArgList->getArg(Executable::ProgressArg(), pArg);
if ((bSuccess == true) && (pArg != NULL))
{
if (pArg->isActualSet() == true)
{
mpProgress = reinterpret_cast<Progress*>(pArg->getActualValue());
}
}
// Sensor data
mpRasterElement = pInArgList->getPlugInArgValue<RasterElement>(Importer::ImportElementArg());
if (mpRasterElement == NULL)
{
string msg = "The raster element input value is invalid!";
if (mpProgress != NULL)
{
mpProgress->updateProgress(msg, 0, ERRORS);
}
pStep->finalize(Message::Failure, msg);
return false;
}
pStep->finalize(Message::Success);
return true;
}
示例2: execute
bool PlugInTester::execute(PlugInArgList* pInArgs, PlugInArgList* pOutArgs)
{
VERIFY(pInArgs != NULL);
Progress* pProgress = NULL;
PlugInArg* pArg = NULL;
if (pInArgs != NULL && pInArgs->getArg(Executable::ProgressArg(), pArg) && pArg != NULL)
{
pProgress = reinterpret_cast<Progress*>(pArg->getActualValue());
}
vector<PlugInDescriptor*> allPlugins = mpPlugMgr->getPlugInDescriptors();
vector<string> testablePlugins;
for (vector<PlugInDescriptor*>::const_iterator it = allPlugins.begin(); it != allPlugins.end(); ++it)
{
PlugInDescriptor* pDescriptor = *it;
if (pDescriptor == NULL)
{
continue;
}
if (pDescriptor->isTestable())
{
testablePlugins.push_back(pDescriptor->getName());
}
}
string msg;
bool bSuccess = false;
PlugInSelectorDlg dlg(mpDesktop->getMainWidget(), testablePlugins);
int stat = dlg.exec();
if (stat == QDialog::Accepted)
{
const vector<string>& pluginsToTest = dlg.getSelectedPlugins();
// TODO: Set up a ProgressTracker for each plug-in to test
vector<string>::const_iterator it;
for (it = pluginsToTest.begin(); it != pluginsToTest.end(); ++it)
{
PlugInResource pPlugIn(*it);
Testable* pTestable = dynamic_cast<Testable*>(pPlugIn.get());
if (pTestable == NULL)
{
msg += "The Plug-In " + *it + " cannot be created!";
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 0, ERRORS);
}
return false;
}
msg += "Testing " + *it + "...";
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 0, NORMAL);
}
stringstream ostr;
bSuccess = pTestable->runAllTests(pProgress, ostr);
msg += "Testing of Plug-In " + *it + " has been completed";
ReportingLevel lvl = NORMAL;
if (!bSuccess)
{
lvl = ERRORS;
msg += " with errors!";
}
else
{
msg += "!";
}
if (ostr.str().size() > 0)
{
msg += "\n" + ostr.str() + "\n";
}
else
{
msg += "\n";
}
if (pProgress != NULL)
{
pProgress->updateProgress(msg, 100, lvl);
}
}
}
return bSuccess;
}