Ignore:
Timestamp:
06/13/18 16:48:53 (6 years ago)
Author:
oabramkina
Message:

Replacing Boost's unordered_map and shared_pointer by its STL counterparts.

Two notes for Curie:

  • one can see the content of unordered_map with ddt only if XIOS has been compiled with gnu
  • XIOS will not compile any more with pgi (all available versions use old STL which are not up to the c++11 norms)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/field.cpp

    r1524 r1542  
    219219      // Gather all data from different clients       
    220220      recvDataSrv.resize(storeClient.numElements()); 
    221       recvFoperationSrv = boost::shared_ptr<func::CFunctor>(new func::CInstant(recvDataSrv)); 
     221      recvFoperationSrv = std::shared_ptr<func::CFunctor>(new func::CInstant(recvDataSrv)); 
    222222    } 
    223223 
     
    716716   //---------------------------------------------------------------- 
    717717 
    718    boost::shared_ptr<COutputPin> CField::getInstantDataFilter() 
     718   std::shared_ptr<COutputPin> CField::getInstantDataFilter() 
    719719   { 
    720720     return instantDataFilter; 
     
    984984              << "An operation must be defined for field \"" << getId() << "\"."); 
    985985 
    986       boost::shared_ptr<func::CFunctor> functor; 
     986      std::shared_ptr<func::CFunctor> functor; 
    987987      CArray<double, 1> dummyData; 
    988988 
     
    10271027     { 
    10281028        if (!instantDataFilter) 
    1029           instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid,true)); 
     1029          instantDataFilter = clientSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid,true)); 
    10301030 
    10311031 
     
    10351035         if (file && (file->mode.isEmpty() || file->mode == CFile::mode_attr::write)) 
    10361036         { 
    1037            fileServerWriterFilter = boost::shared_ptr<CFileServerWriterFilter>(new CFileServerWriterFilter(gc, this)); 
     1037           fileServerWriterFilter = std::shared_ptr<CFileServerWriterFilter>(new CFileServerWriterFilter(gc, this)); 
    10381038           instantDataFilter->connectOutput(fileServerWriterFilter, 0); 
    10391039         } 
     
    10431043     { 
    10441044       if (!instantDataFilter) 
    1045          instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true)); 
     1045         instantDataFilter = clientSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true)); 
    10461046 
    10471047             // If the field data is to be read by the client or/and written to a file 
     
    10501050         if (file && (file->mode.isEmpty() || file->mode == CFile::mode_attr::write)) 
    10511051         { 
    1052            fileWriterFilter = boost::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this)); 
     1052           fileWriterFilter = std::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this)); 
    10531053           instantDataFilter->connectOutput(fileWriterFilter, 0); 
    10541054         } 
     
    10641064         { 
    10651065           boost::scoped_ptr<IFilterExprNode> expr(parseExpr(getExpression() + '\0')); 
    1066            boost::shared_ptr<COutputPin> filter = expr->reduce(gc, *this); 
     1066           std::shared_ptr<COutputPin> filter = expr->reduce(gc, *this); 
    10671067 
    10681068           // Check if a spatial transformation is needed 
     
    10731073             if (grid && grid != gridRef && grid->hasTransform()) 
    10741074             { 
    1075                  std::pair<boost::shared_ptr<CFilter>, boost::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridRef, grid, detectMissingValues, defaultValue);  
     1075                 std::pair<std::shared_ptr<CFilter>, std::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridRef, grid, detectMissingValues, defaultValue);  
    10761076 
    10771077               filter->connectOutput(filters.first, 0); 
     
    10891089         { 
    10901090           checkTimeAttributes(); 
    1091            instantDataFilter = serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, freq_offset, true, 
     1091           instantDataFilter = serverSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, freq_offset, true, 
    10921092                                                                                                       detectMissingValues, defaultValue)); 
    10931093         } 
     
    10951095         { 
    10961096            if (check_if_active.isEmpty()) check_if_active = false;  
    1097             instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, false, NoneDu, false, 
     1097            instantDataFilter = clientSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, false, NoneDu, false, 
    10981098                                                                                                        detectMissingValues, defaultValue)); 
    10991099         } 
     
    11051105         if (!read_access.isEmpty() && read_access) 
    11061106         { 
    1107            storeFilter = boost::shared_ptr<CStoreFilter>(new CStoreFilter(gc, CContext::getCurrent(), grid, 
     1107           storeFilter = std::shared_ptr<CStoreFilter>(new CStoreFilter(gc, CContext::getCurrent(), grid, 
    11081108                                                                          detectMissingValues, defaultValue)); 
    11091109           instantDataFilter->connectOutput(storeFilter, 0); 
     
    11121112         if (file && (file->mode.isEmpty() || file->mode == CFile::mode_attr::write)) 
    11131113         { 
    1114            fileWriterFilter = boost::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this)); 
     1114           fileWriterFilter = std::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this)); 
    11151115           getTemporalDataFilter(gc, file->output_freq)->connectOutput(fileWriterFilter, 0); 
    11161116         } 
     
    11261126    * \return the output pin corresponding to the field reference 
    11271127    */ 
    1128    boost::shared_ptr<COutputPin> CField::getFieldReference(CGarbageCollector& gc) 
     1128   std::shared_ptr<COutputPin> CField::getFieldReference(CGarbageCollector& gc) 
    11291129   { 
    11301130     if (instantDataFilter || field_ref.isEmpty()) 
     
    11351135     fieldRef->buildFilterGraph(gc, false); 
    11361136 
    1137      std::pair<boost::shared_ptr<CFilter>, boost::shared_ptr<CFilter> > filters; 
     1137     std::pair<std::shared_ptr<CFilter>, std::shared_ptr<CFilter> > filters; 
    11381138     // Check if a spatial transformation is needed 
    11391139     if (grid && grid != fieldRef->grid && grid->hasTransform()) 
     
    11441144     } 
    11451145     else 
    1146        filters.first = filters.second = boost::shared_ptr<CFilter>(new CPassThroughFilter(gc)); 
     1146       filters.first = filters.second = std::shared_ptr<CFilter>(new CPassThroughFilter(gc)); 
    11471147 
    11481148     fieldRef->getInstantDataFilter()->connectOutput(filters.first, 0); 
     
    11601160    * \return the output pin corresponding to a self reference 
    11611161    */ 
    1162    boost::shared_ptr<COutputPin> CField::getSelfReference(CGarbageCollector& gc) 
     1162   std::shared_ptr<COutputPin> CField::getSelfReference(CGarbageCollector& gc) 
    11631163   { 
    11641164     if (instantDataFilter || !hasExpression()) 
     
    11761176         { 
    11771177           checkTimeAttributes(); 
    1178            serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, freq_offset, true, 
     1178           serverSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, freq_offset, true, 
    11791179                                                                                   detectMissingValues, defaultValue)); 
    11801180         } 
     
    11931193         { 
    11941194           if (check_if_active.isEmpty()) check_if_active = false; 
    1195            clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, NoneDu, false, 
     1195           clientSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, NoneDu, false, 
    11961196                                                                                   detectMissingValues, defaultValue)); 
    11971197         } 
     
    12131213    * \return the output pin corresponding to the requested temporal filter 
    12141214    */ 
    1215    boost::shared_ptr<COutputPin> CField::getTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq) 
    1216    { 
    1217      std::map<CDuration, boost::shared_ptr<COutputPin> >::iterator it = temporalDataFilters.find(outFreq); 
     1215   std::shared_ptr<COutputPin> CField::getTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq) 
     1216   { 
     1217     std::map<CDuration, std::shared_ptr<COutputPin> >::iterator it = temporalDataFilters.find(outFreq); 
    12181218 
    12191219     if (it == temporalDataFilters.end()) 
     
    12261226 
    12271227       const bool detectMissingValues = (!detect_missing_value.isEmpty()  && detect_missing_value == true); 
    1228        boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 
     1228       std::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 
    12291229                                                                             CContext::getCurrent()->getCalendar()->getInitDate(), 
    12301230                                                                             freq_op, freq_offset, outFreq, detectMissingValues)); 
     
    12471247    */ 
    12481248    
    1249    boost::shared_ptr<COutputPin> CField::getSelfTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq) 
     1249   std::shared_ptr<COutputPin> CField::getSelfTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq) 
    12501250   { 
    12511251     if (instantDataFilter || !hasExpression()) 
     
    12641264 
    12651265       const bool detectMissingValues = (!detect_missing_value.isEmpty() && detect_missing_value == true); 
    1266        boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 
     1266       std::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 
    12671267                                                                             CContext::getCurrent()->getCalendar()->getInitDate(), 
    12681268                                                                             freq_op, freq_offset, outFreq, detectMissingValues)); 
Note: See TracChangeset for help on using the changeset viewer.