本文整理汇总了C++中GmatCommand::GetObjectMap方法的典型用法代码示例。如果您正苦于以下问题:C++ GmatCommand::GetObjectMap方法的具体用法?C++ GmatCommand::GetObjectMap怎么用?C++ GmatCommand::GetObjectMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GmatCommand
的用法示例。
在下文中一共展示了GmatCommand::GetObjectMap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
//.........这里部分代码省略.........
(wxT("......Function re-executing <%p><%s> [%s]\n"), current,
current->GetTypeName().c_str(),
current->GetGeneratingString(Gmat::NO_COMMENTS).c_str());
#endif
if (!(current->Execute()))
return false;
}
catch (HardwareException &he)
{
// Ignore for hardware exception since spacecraft is associated with Thruster
// but Thruster binds with Tank later in the fcs
}
catch (BaseException &be)
{
throw FunctionException
(wxT("During initialization of local objects before \"") +
current->GetGeneratingString(Gmat::NO_COMMENTS) + wxT("\", ") +
e.GetFullMessage());
}
}
// If current command is BranchCommand and still executing, continue to next
// command in the branch (LOJ: 2009.03.24)
if (current->IsOfType(wxT("BranchCommand")) && current->IsExecuting())
{
#ifdef DEBUG_FUNCTION_EXEC
MessageInterface::ShowMessage
(wxT("In Function '%s', still executing current command is <%p><%s>\n"),
functionName.c_str(), current, current ? current->GetTypeName().c_str() : wxT("NULL"));
#endif
continue;
}
current = current->GetNext();
#ifdef DEBUG_FUNCTION_EXEC
MessageInterface::ShowMessage
(wxT("In Function '%s', the next command is <%p><%s>\n"), functionName.c_str(),
current, current ? current->GetTypeName().c_str() : wxT("NULL"));
#endif
}
// Set ObjectMap from the last command to Validator in order to create
// valid output wrappers (loj: 2008.11.12)
validator->SetObjectMap(last->GetObjectMap());
#ifdef DEBUG_FUNCTION_EXEC
MessageInterface::ShowMessage
(wxT(" Now about to create %d output wrapper(s) to set results, objectsInitialized=%d\n"),
outputNames.size(), objectsInitialized);
#endif
// create output wrappers and put into map
GmatBase *obj;
wrappersToDelete.clear();
for (unsigned int jj = 0; jj < outputNames.size(); jj++)
{
if (!(obj = FindObject(outputNames.at(jj))))
{
wxString errMsg = wxT("Function: Output \"") + outputNames.at(jj);
errMsg += wxT(" not found for function \"") + functionName + wxT("\"");
throw FunctionException(errMsg);
}
wxString outName = outputNames.at(jj);
ElementWrapper *outWrapper =
validator->CreateElementWrapper(outName, false, false);
#ifdef DEBUG_MORE_MEMORY
MessageInterface::ShowMessage
(wxT("+++ GmatFunction::Execute() *outWrapper = validator->")
wxT("CreateElementWrapper(%s), <%p> '%s'\n"), outName.c_str(), outWrapper,
outWrapper->GetDescription().c_str());
#endif
outWrapper->SetRefObject(obj);
// nested CallFunction crashes if old outWrappers are deleted here. (loj: 2008.11.24)
// so collect here and delete when FunctionRunner completes.
wrappersToDelete.push_back(outWrapper);
// Set new outWrapper
outputArgMap[outName] = outWrapper;
#ifdef DEBUG_FUNCTION_EXEC // --------------------------------------------------- debug ---
MessageInterface::ShowMessage(wxT("GmatFunction: Output wrapper created for %s\n"),
(outputNames.at(jj)).c_str());
#endif // -------------------------------------------------------------- end debug ---
}
#ifdef DEBUG_FUNCTION_EXEC
MessageInterface::ShowMessage
(wxT("GmatFunction::Execute() exiting true for '%s'\n"), functionName.c_str());
#endif
#ifdef DEBUG_TRACE
ShowTrace(callCount, t1, wxT("GmatFunction::Execute() exiting"), true);
#endif
return true;
}