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