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


C++ ClassList::get方法代码示例

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


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

示例1: createAreaPages_getExternalConnections

void WikiAreaPages::createAreaPages_getExternalConnections( MindArea *area , MindLocalCircuitDef& circuit , MapStringToClass<MindLocalCircuitConnectionDef>& connections , bool isin ) {
	ClassList<MindLocalCircuitConnectionDef> links;
	circuit.getExternalConnections( links , isin );

	MindService *ms = MindService::getService();
	for( int k = 0; k < links.count(); k++ ) {
		MindLocalCircuitConnectionDef *c = links.get( k );

		// ignore secondary
		if( !c -> isPrimary() )
			continue;

		String key;
		if( isin == false ) {
			MindRegion *region = ms -> getMindRegion( c -> getDstRegion() );
			key = region -> getArea() -> getAreaId() + "#" + c -> getSrcRegion() + "#" + c -> getDstRegion() + "#1";
			if( connections.get( key ) == NULL )
				connections.add( key , c );
		}
		else {
			MindRegion *region = ms -> getMindRegion( c -> getSrcRegion() );
			key = region -> getArea() -> getAreaId() + "#" + c -> getDstRegion() + "#" + c -> getSrcRegion() + "#2";
			if( connections.get( key ) == NULL )
				connections.add( key , c );
		}
	}
}
开发者ID:sarbjit-longia,项目名称:ahuman,代码行数:27,代码来源:wikiareapages.cpp

示例2:

ThreadPoolFixedTaskListItem::ThreadPoolFixedTaskListItem( String p_name , int p_threadPoolItem , ClassList<ThreadPoolTask>& p_tasks )
:	ThreadPoolItem( p_name , p_threadPoolItem ) {
	currentTask = 0;

	// assign task list
	for( int k = 0; k < p_tasks.count(); k++ ) {
		ThreadPoolTask *task = p_tasks.get( k );
		task -> thread = this;
		tasks.add( task );
	}
}
开发者ID:AbhishekGhosh,项目名称:Artificial-Human,代码行数:11,代码来源:threadpoolfixedtasklistitem.cpp

示例3: createAreaPages_getInternalConnections

void WikiAreaPages::createAreaPages_getInternalConnections( MindArea *area , MindLocalCircuitDef& circuit , MapStringToClass<MindLocalCircuitConnectionDef>& connections ) {
	ClassList<MindLocalCircuitConnectionDef> links;
	circuit.getInternalConnections( links );

	for( int k = 0; k < links.count(); k++ ) {
		MindLocalCircuitConnectionDef *c = links.get( k );

		// ignore secondary
		if( !c -> isPrimary() )
			continue;

		String key = c -> getSrcRegion() + "#" + c -> getDstRegion();
		if( connections.get( key ) == NULL )
			connections.add( key , c );
	}
}
开发者ID:sarbjit-longia,项目名称:ahuman,代码行数:16,代码来源:wikiareapages.cpp

示例4: create

void ThreadPool::create( ClassList<ThreadPoolTask>& tasks ) {
	if( !runEnabled ) {
		logger.logInfo( "ignore threadPool=" + name + ", runEnabled=false" );
		return;
	}

	int nTasks = tasks.count();
	if( nThreads > nTasks )
		nThreads = nTasks;

	ASSERTMSG( nThreads >= 1 , "nThreads is invalid" );

	int nWhole = nTasks / nThreads;
	int nPart = nTasks % nThreads;

	// split objects by threads
	int nFrom = 0;
	for( int k = 0; k < nThreads; k++ ) {
		// calculate number of objects for thread
		int n = nWhole;
		if( nPart ) {
			n++;
			nPart--;
		}

		// create list of thread tasks
		ClassList<ThreadPoolTask> threadTasks;
		threadTasks.allocate( n );
		for( int j = 0; j < n; j++ ) {
			ThreadPoolTask *task = tasks.get( nFrom + j );
			task -> pool = this;
			threadTasks.add( task );
		}

		// create thread (suspended) and add to the pool
		String threadName = name + "#" + k;
		ThreadPoolItem *thread = new ThreadPoolFixedTaskListItem( threadName , k , threadTasks );
		threads.add( thread );

		// configure thread
		nFrom += n;
	}

	logger.logInfo( String( "threadpool created: name=" ) + name + ", nThreads=" + nThreads + ", nTasks=" + nTasks );
}
开发者ID:AbhishekGhosh,项目名称:Artificial-Human,代码行数:45,代码来源:threadpool.cpp

示例5: deserialize

void NNSamples::deserialize( Object *parent , SerializeObject& so )
{
	clear();

	nSizeIn = so.getPropInt( "nSizeIn" );
	nSizeOut = so.getPropInt( "nSizeOut" );
	
	ClassList<NNSample> va;
	so.getPropObjectList( ( ClassList<Object>& )va , "sampleList" , true );

	for( int k = 0; k < va.count(); k++ )
		{
			NNSample *sample = va.get( k );
			data.add( sample -> getId() , sample );
		}

	limitType = ( LimitType )so.getPropInt( "limitType" );
	maxSize = so.getPropInt( "maxSize" );
}
开发者ID:sarbjit-longia,项目名称:ahuman,代码行数:19,代码来源:nnsamples.cpp


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