Changeset 1542 for XIOS/trunk/src/filter


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)
Location:
XIOS/trunk/src/filter
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/filter/binary_arithmetic_filter.hpp

    r642 r1542  
    55#include <string> 
    66#include "operator_expr.hpp" 
     7#include <unordered_map> 
    78 
    89namespace xios 
  • XIOS/trunk/src/filter/data_packet.hpp

    r643 r1542  
    22#define __XIOS_CDataPacket__ 
    33 
    4 #include <boost/shared_ptr.hpp> 
     4#include <memory> 
    55 
    66#include "array_new.hpp" 
     
    4343  }; // struct CDataPacket 
    4444 
    45   typedef boost::shared_ptr<CDataPacket> CDataPacketPtr; 
    46   typedef boost::shared_ptr<const CDataPacket> CConstDataPacketPtr; 
     45  typedef std::shared_ptr<CDataPacket> CDataPacketPtr; 
     46  typedef std::shared_ptr<const CDataPacket> CConstDataPacketPtr; 
    4747} // namespace xios 
    4848 
  • XIOS/trunk/src/filter/output_pin.cpp

    r1358 r1542  
    99  { /* Nothing to do */ } 
    1010 
    11   void COutputPin::connectOutput(boost::shared_ptr<CInputPin> inputPin, size_t inputSlot) 
     11  void COutputPin::connectOutput(std::shared_ptr<CInputPin> inputPin, size_t inputSlot) 
    1212  { 
    1313    if (!inputPin) 
     
    4242            "The packet cannot be null."); 
    4343 
    44     std::vector<std::pair<boost::shared_ptr<CInputPin>, size_t> >::iterator it, itEnd; 
     44    std::vector<std::pair<std::shared_ptr<CInputPin>, size_t> >::iterator it, itEnd; 
    4545    for (it = outputs.begin(), itEnd = outputs.end(); it != itEnd; ++it) 
    4646      it->first->setInput(it->second, packet); 
     
    6868  bool COutputPin::mustAutoTrigger() const 
    6969  { 
    70     std::vector<std::pair<boost::shared_ptr<CInputPin>, size_t> >::const_iterator it, itEnd; 
     70    std::vector<std::pair<std::shared_ptr<CInputPin>, size_t> >::const_iterator it, itEnd; 
    7171    for (it = outputs.begin(), itEnd = outputs.end(); it != itEnd; ++it) 
    7272    { 
     
    8080  void COutputPin::setOutputTriggers() 
    8181  { 
    82     std::vector<std::pair<boost::shared_ptr<CInputPin>, size_t> >::iterator it, itEnd; 
     82    std::vector<std::pair<std::shared_ptr<CInputPin>, size_t> >::iterator it, itEnd; 
    8383    for (it = outputs.begin(), itEnd = outputs.end(); it != itEnd; ++it) 
    8484      it->first->setInputTrigger(it->second, this); 
     
    8787  bool COutputPin::isDataExpected(const CDate& date) const 
    8888  { 
    89     std::vector<std::pair<boost::shared_ptr<CInputPin>, size_t> >::const_iterator it, itEnd; 
     89    std::vector<std::pair<std::shared_ptr<CInputPin>, size_t> >::const_iterator it, itEnd; 
    9090    for (it = outputs.begin(), itEnd = outputs.end(); it != itEnd; ++it) 
    9191    { 
  • XIOS/trunk/src/filter/output_pin.hpp

    r1358 r1542  
    2929       * \param inputSlot the input slot number 
    3030       */ 
    31       void connectOutput(boost::shared_ptr<CInputPin> inputPin, size_t inputSlot); 
     31      void connectOutput(std::shared_ptr<CInputPin> inputPin, size_t inputSlot); 
    3232 
    3333      /*! 
     
    9393 
    9494      //!< The list of connected filters and the corresponding slot numbers 
    95       std::vector<std::pair<boost::shared_ptr<CInputPin>, size_t> > outputs; 
     95      std::vector<std::pair<std::shared_ptr<CInputPin>, size_t> > outputs; 
    9696 
    9797      //! Output buffer, store the packets until the output is triggered 
  • XIOS/trunk/src/filter/spatial_transform_filter.cpp

    r1474 r1542  
    1111  { /* Nothing to do */ } 
    1212 
    13   std::pair<boost::shared_ptr<CSpatialTransformFilter>, boost::shared_ptr<CSpatialTransformFilter> > 
     13  std::pair<std::shared_ptr<CSpatialTransformFilter>, std::shared_ptr<CSpatialTransformFilter> > 
    1414  CSpatialTransformFilter::buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, bool hasMissingValue, double missingValue) 
    1515  { 
    1616    if (!srcGrid || !destGrid) 
    17       ERROR("std::pair<boost::shared_ptr<CSpatialTransformFilter>, boost::shared_ptr<CSpatialTransformFilter> >" 
     17      ERROR("std::pair<std::shared_ptr<CSpatialTransformFilter>, std::shared_ptr<CSpatialTransformFilter> >" 
    1818            "buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid)", 
    1919            "Impossible to build the filter graph if either the source or the destination grid are null."); 
    2020 
    21     boost::shared_ptr<CSpatialTransformFilter> firstFilter, lastFilter; 
     21    std::shared_ptr<CSpatialTransformFilter> firstFilter, lastFilter; 
    2222    // Note that this loop goes from the last transformation to the first transformation 
    2323    do 
     
    3636      for (it=algoList.begin();it!=algoList.end();++it)  if (it->second.first == TRANS_TEMPORAL_SPLITTING) isSpatialTemporal=true ; 
    3737 
    38       boost::shared_ptr<CSpatialTransformFilter> filter ; 
    39       if( isSpatialTemporal) filter = boost::shared_ptr<CSpatialTransformFilter>(new CSpatialTemporalFilter(gc, engine, gridTransformation, defaultValue, inputCount)); 
    40       else filter = boost::shared_ptr<CSpatialTransformFilter>(new CSpatialTransformFilter(gc, engine, defaultValue, inputCount)); 
     38      std::shared_ptr<CSpatialTransformFilter> filter ; 
     39      if( isSpatialTemporal) filter = std::shared_ptr<CSpatialTransformFilter>(new CSpatialTemporalFilter(gc, engine, gridTransformation, defaultValue, inputCount)); 
     40      else filter = std::shared_ptr<CSpatialTransformFilter>(new CSpatialTransformFilter(gc, engine, defaultValue, inputCount)); 
    4141 
    4242       
     
    140140  } 
    141141 
    142   std::map<CGridTransformation*, boost::shared_ptr<CSpatialTransformFilterEngine> > CSpatialTransformFilterEngine::engines; 
     142  std::map<CGridTransformation*, std::shared_ptr<CSpatialTransformFilterEngine> > CSpatialTransformFilterEngine::engines; 
    143143 
    144144  CSpatialTransformFilterEngine* CSpatialTransformFilterEngine::get(CGridTransformation* gridTransformation) 
     
    148148            "Impossible to get the requested engine, the grid transformation is invalid."); 
    149149 
    150     std::map<CGridTransformation*, boost::shared_ptr<CSpatialTransformFilterEngine> >::iterator it = engines.find(gridTransformation); 
     150    std::map<CGridTransformation*, std::shared_ptr<CSpatialTransformFilterEngine> >::iterator it = engines.find(gridTransformation); 
    151151    if (it == engines.end()) 
    152152    { 
    153       boost::shared_ptr<CSpatialTransformFilterEngine> engine(new CSpatialTransformFilterEngine(gridTransformation)); 
     153      std::shared_ptr<CSpatialTransformFilterEngine> engine(new CSpatialTransformFilterEngine(gridTransformation)); 
    154154      it = engines.insert(std::make_pair(gridTransformation, engine)).first; 
    155155    } 
  • XIOS/trunk/src/filter/spatial_transform_filter.hpp

    r1275 r1542  
    3636       * \return the first and the last filters of the filter graph 
    3737       */ 
    38       static std::pair<boost::shared_ptr<CSpatialTransformFilter>, boost::shared_ptr<CSpatialTransformFilter> > 
     38      static std::pair<std::shared_ptr<CSpatialTransformFilter>, std::shared_ptr<CSpatialTransformFilter> > 
    3939      buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, bool hasMissingValue, double defaultValue); 
    4040 
     
    141141 
    142142      //! The allocated engines 
    143       static std::map<CGridTransformation*, boost::shared_ptr<CSpatialTransformFilterEngine> > engines; 
     143      static std::map<CGridTransformation*, std::shared_ptr<CSpatialTransformFilterEngine> > engines; 
    144144  }; // class CSpatialTransformFilterEngine 
    145145} // namespace xios 
Note: See TracChangeset for help on using the changeset viewer.