Impl( const Futures& futures ) { for( const auto& future: futures ) { const std::string& name = future.getName(); if( hasFuture( name )) throwError( name ); addFuture( name, future ); } }
QFuture<void> *QThreadFutureMap::getFuture(const QString &id) { QFuture<void> *future = NULL; if (hasFuture(id)) { future = &((*this)[id]); } return future; }
Futures getFutures( const std::string& name ) const { if( name == ALL_FUTURES ) { Futures futures; for( const auto& nameFuture: _futureMap ) futures.push_back( nameFuture.second ); return futures; } if( !hasFuture( name )) throwError( name ); Futures futures; const auto& itPair = _futureMap.equal_range( name ); for( auto it = itPair.first; it != itPair.second; ++it ) futures.push_back( it->second ); return futures; }