本文整理汇总了C++中Eref::dropVec方法的典型用法代码示例。如果您正苦于以下问题:C++ Eref::dropVec方法的具体用法?C++ Eref::dropVec怎么用?C++ Eref::dropVec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Eref
的用法示例。
在下文中一共展示了Eref::dropVec方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: redirectDestMessages
/**
* This function redirects messages arriving at zombie elements onto
* the hub.
* e is the zombie element whose messages are being redirected to the hub.
* eFinfo is the Finfo holding those messages.
* hubFinfo is the Finfo on the hub which will now handle the messages.
* eIndex is the index to look up the element.
*/
void HSolveHub::redirectDestMessages(
Eref hub,
Eref e,
const Finfo* hubFinfo,
const Finfo* eFinfo,
unsigned int eIndex,
vector< unsigned int >& map,
vector< Element * >* elist,
vector< Element * >* include,
bool retain )
{
Conn* i = e.e->targets( eFinfo->msg(), e.i );
vector< Eref > srcElements;
vector< int > srcMsg;
vector< const ConnTainer* > dropList;
while( i->good() ) {
Element* tgt = i->target().e;
// Handle messages going outside purview of solver.
bool inElist = find( elist->begin(), elist->end(), tgt ) != elist->end();
bool inInclude =
include == 0 ||
find( include->begin(), include->end(), tgt ) != include->end();
if ( ! inElist && inInclude ) {
map.push_back( eIndex );
srcElements.push_back( i->target() );
srcMsg.push_back( i->targetMsg() );
if ( !retain )
dropList.push_back( i->connTainer() );
}
i->increment();
}
delete i;
e.dropVec( eFinfo->msg(), dropList );
for ( unsigned int j = 0; j != srcElements.size(); j++ ) {
bool ret = srcElements[j].add( srcMsg[j], hub, hubFinfo->msg(),
ConnTainer::Default );
assert( ret );
}
}