本文整理汇总了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 );
}