当前位置: 首页>>代码示例>>C++>>正文


C++ GmatCommand::RunComplete方法代码示例

本文整理汇总了C++中GmatCommand::RunComplete方法的典型用法代码示例。如果您正苦于以下问题:C++ GmatCommand::RunComplete方法的具体用法?C++ GmatCommand::RunComplete怎么用?C++ GmatCommand::RunComplete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GmatCommand的用法示例。


在下文中一共展示了GmatCommand::RunComplete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Finalize

//------------------------------------------------------------------------------
// void Finalize()
//------------------------------------------------------------------------------
void GmatFunction::Finalize()
{
   #ifdef DEBUG_TRACE
   static Integer callCount = 0;
   callCount++;      
   clock_t t1 = clock();
   ShowTrace(callCount, t1, wxT("GmatFunction::Finalize() entered"));
   #endif
   
   #ifdef DEBUG_FUNCTION_FINALIZE
   MessageInterface::ShowMessage
      (wxT("======================================================================\n")
       wxT("GmatFunction::Finalize() entered for '%s', FCS %s\n"),
       functionName.c_str(), fcsFinalized ? wxT("already finalized, so skp fcs") :
       wxT("NOT finalized, so call fcs->RunComplete"));
   #endif
   
   // Call RunComplete on each command in fcs
   if (!fcsFinalized)
   {
      fcsFinalized = true;
      GmatCommand *current = fcs;
      while (current)
      {
         #ifdef DEBUG_FUNCTION_FINALIZE
            if (!current)
               MessageInterface::ShowMessage
                  (wxT("   GmatFunction:Finalize() Current is NULL!!!\n"));
            else
               MessageInterface::ShowMessage
                  (wxT("   GmatFunction:Finalize() Now about to finalize ")
                   wxT("(call RunComplete on) command %s\n"),
                   (current->GetTypeName()).c_str());
         #endif
         current->RunComplete();
         current = current->GetNext();
      }
   }
   
   Function::Finalize();
   
   #ifdef DEBUG_FUNCTION_FINALIZE
   MessageInterface::ShowMessage(wxT("GmatFunction::Finalize() leaving\n"));
   #endif
   
   #ifdef DEBUG_TRACE
   ShowTrace(callCount, t1, wxT("GmatFunction::Finalize() exiting"), true, true);
   #endif
   
}
开发者ID:,项目名称:,代码行数:53,代码来源:

示例2: ClearCommandSeq

//------------------------------------------------------------------------------
bool GmatCommandUtil::ClearCommandSeq(GmatCommand *seq, bool leaveFirstCmd,
                                      bool callRunComplete)
{
   #ifdef DEBUG_SEQUENCE_CLEARING
   MessageInterface::ShowMessage("CommandUtil::ClearCommandSeq() entered\n");
   #endif
   
   GmatCommand *cmd = seq, *removedCmd = NULL;
   
   if (cmd == NULL)
   {
      #ifdef DEBUG_SEQUENCE_CLEARING
      MessageInterface::ShowMessage
         ("CommandUtil::ClearCommandSeq() exiting, first command is NULL\n");
      #endif
      return true;
   }
   
   #ifdef DEBUG_SEQUENCE_CLEARING
   GmatCommand *current = cmd;
   MessageInterface::ShowMessage("\nClearing this command list:\n");
   while (current)
   {
      ShowCommand("   ", current);
      current = current->GetNext();
   }
   MessageInterface::ShowMessage("\n");
   #endif
   
   cmd = cmd->GetNext();
   while (cmd)
   {
      if (callRunComplete)
      {
         // Be sure we're in an idle state first
         #ifdef DEBUG_SEQUENCE_CLEARING
         MessageInterface::ShowMessage
            ("   Calling %s->RunComplete\n", cmd->GetTypeName().c_str());
         #endif
         
         cmd->RunComplete();
      }
      
      removedCmd = RemoveCommand(seq, cmd);
      
      if (removedCmd != NULL)
      {
         #ifdef DEBUG_MEMORY
         MemoryTracker::Instance()->Remove
            (removedCmd, removedCmd->GetTypeName(), "CommandUtil::ClearCommandSeq()");
         #endif
         delete removedCmd;
      }
      removedCmd = NULL;
      cmd = seq->GetNext();
   }
   
   // if first command is to be delete
   if (!leaveFirstCmd)
   {
      #ifdef DEBUG_SEQUENCE_CLEARING
      MessageInterface::ShowMessage("   seq=<%p>\n", seq);
      #endif
      
      #ifdef DEBUG_MEMORY
      MemoryTracker::Instance()->Remove
         (seq, seq->GetTypeName(), "CommandUtil::ClearCommandSeq()");
      #endif
      delete seq;
      seq = NULL;
   }
   
   #ifdef DEBUG_SEQUENCE_CLEARING
   MessageInterface::ShowMessage("CommandUtil::ClearCommandSeq() returning true\n");
   #endif
   
   return true;
}
开发者ID:,项目名称:,代码行数:79,代码来源:


注:本文中的GmatCommand::RunComplete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。