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


C++ Eref::dropVec方法代码示例

本文整理汇总了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 );
	}
}
开发者ID:Vivek-sagar,项目名称:moose-1,代码行数:52,代码来源:HSolveHub.cpp


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