本文整理汇总了C++中IndicesVector::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ IndicesVector::begin方法的具体用法?C++ IndicesVector::begin怎么用?C++ IndicesVector::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IndicesVector
的用法示例。
在下文中一共展示了IndicesVector::begin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: throw
// ----------------------------------------------------------------------
void
ExperimentControl::
flash_programs( std::string id, NodeIdVector nodes,
IndicesVector indices, FlashProgramVector programs )
throw()
{
NodeIdVector response_nodes;
StatusValueVector response_values;
StatusMsgVector response_msgs;
IndicesVector::iterator idx_it = indices.begin();
for ( NodeIdVector::iterator it = nodes.begin();
it != nodes.end();
++it, ++idx_it )
{
shawn::Node *node =
simulation_controller_w().world_w().find_node_by_label_w( *it );
if ( node )
{
TestbedServiceProcessor *proc =
node->get_processor_of_type_w<TestbedServiceProcessor>();
if ( proc )
{
proc->flash_program( programs.at( *idx_it ) );
response_values.push_back( 1 );
}
else
response_values.push_back( 0 );
}
else
response_values.push_back( -1 );
response_nodes.push_back( *it );
response_msgs.push_back( "" );
}
controller().send_receive_status( id, response_nodes, response_values, response_msgs );
}
示例2: IsPrefix
/// Returns true if Prefix is a prefix of longer. That means, Longer has a size
/// that is greater than or equal to the size of prefix, and each of the
/// elements in Prefix is the same as the corresponding elements in Longer.
///
/// This means it also returns true when Prefix and Longer are equal!
static bool IsPrefix(const IndicesVector &Prefix, const IndicesVector &Longer) {
if (Prefix.size() > Longer.size())
return false;
return std::equal(Prefix.begin(), Prefix.end(), Longer.begin());
}