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


C++ To::get_index方法代码示例

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


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

示例1: if

void Pulsar::PlotLoop::plot( std::stack< Reference::To<TextIndex> >& indeces )
{
  if (indeces.empty())
  {
    VERBOSE("Pulsar::PlotLoop::plot plotting");

    for (unsigned i=0; i<plots.size(); i++)
    {
      if (!overlay)
        cpgpage ();

      plots[i]->plot (archives[i]);
    }
    return;
  }

  Reference::To<TextIndex> index = indeces.top();
  indeces.pop();

  vector<string> current (plots.size());

  unsigned loop_size = 0;
  for (unsigned iplot=0; iplot < plots.size(); iplot++)
  {
    index->set_container( archives[iplot]->get_interface() );

    if (iplot == 0)
      loop_size = index->size();
    else if ( loop_size != index->size() )
      throw Error (InvalidState, "Pulsar::PlotLoop::plot",
                   "loop size for plot[0]=%u != that of plot[%u]=%u",
                   loop_size, iplot, index->size());
  }
  
  Reference::To<TextInterface::Parser> interface;

  for (unsigned i=0; i<loop_size; i++)
  {
    for (unsigned iplot=0; iplot < plots.size(); iplot++) try
    {
      index->set_container( archives[iplot]->get_interface() );

      string index_command = index->get_index(i);

      VERBOSE("Pulsar::PlotLoop::plot " << index_command);

      if (!overlay)
      {
	PlotLabel* label = plots[iplot]->get_attributes()->get_label_above();
	current[iplot] = label->get_centre();
	if (current[iplot] != "unset")
	  label->set_centre( current[iplot] + " " + index_command );
      }

      //
      // by not calling Plot::configure, we avoid MultiData::configure,
      // which will add each of these temporary options to its common list
      //
      interface = plots[iplot]->get_interface();
      interface->process( index_command );
  
    }
    catch (Error& error)
    {
      cerr << "Pulsar::PlotLoop::plot error configuring "
	   << index->get_index(i) << " of "
           << "\n\t" << archives[iplot]->get_filename()
           << "\n\t" << error.get_message() << endl;
    }

    try
    {
      plot (indeces);
    }
    catch (Error& error)
    {
      cerr << "Pulsar::PlotLoop::plot error plotting " 
           << "\n\t" << error.get_message() << endl;
    }

    if (!overlay)
      for (unsigned iplot=0; iplot < plots.size(); iplot++)
      {
	PlotLabel* label = plots[iplot]->get_attributes()->get_label_above();
	label->set_centre( current[iplot] );
      }
  }

  indeces.push( index );
}
开发者ID:kernsuite-debian,项目名称:psrchive,代码行数:90,代码来源:PlotLoop.C


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