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/object_factory_impl.hpp

    r769 r1542  
    4343 
    4444   template <typename U> 
    45       boost::shared_ptr<U> CObjectFactory::GetObject(const U * const object) 
     45      std::shared_ptr<U> CObjectFactory::GetObject(const U * const object) 
    4646   { 
    4747      if (CurrContext.size() == 0) 
    4848         ERROR("CObjectFactory::GetObject(const U * const object)", 
    4949               << "please define current context id !"); 
    50       std::vector<boost::shared_ptr<U> > & vect = 
     50      std::vector<std::shared_ptr<U> > & vect = 
    5151                     U::AllVectObj[CObjectFactory::CurrContext]; 
    5252 
    53       typename std::vector<boost::shared_ptr<U> >::const_iterator 
     53      typename std::vector<std::shared_ptr<U> >::const_iterator 
    5454         it = vect.begin(), end = vect.end(); 
    5555 
    5656      for (; it != end; it++) 
    5757      { 
    58          boost::shared_ptr<U> ptr = *it; 
     58         std::shared_ptr<U> ptr = *it; 
    5959         if (ptr.get() == object) 
    6060            return (ptr); 
     
    6464               << "[type = " << U::GetName() << ", adress = " << object << "] " 
    6565               << "object was not found."); 
    66       return (boost::shared_ptr<U>()); // jamais atteint 
     66      return (std::shared_ptr<U>()); // jamais atteint 
    6767   } 
    6868 
    6969   template <typename U> 
    70       boost::shared_ptr<U> CObjectFactory::GetObject(const StdString & id) 
     70      std::shared_ptr<U> CObjectFactory::GetObject(const StdString & id) 
    7171   { 
    7272      if (CurrContext.size() == 0) 
     
    8181 
    8282   template <typename U> 
    83       boost::shared_ptr<U> CObjectFactory::GetObject(const StdString & context, const StdString & id) 
     83      std::shared_ptr<U> CObjectFactory::GetObject(const StdString & context, const StdString & id) 
    8484   { 
    8585      if (!CObjectFactory::HasObject<U>(context,id)) 
     
    9191 
    9292   template <typename U> 
    93    boost::shared_ptr<U> CObjectFactory::CreateObject(const StdString& id) 
     93   std::shared_ptr<U> CObjectFactory::CreateObject(const StdString& id) 
    9494   { 
    9595      if (CurrContext.empty()) 
     
    103103      else 
    104104      { 
    105          boost::shared_ptr<U> value(new U(id.empty() ? CObjectFactory::GenUId<U>() : id)); 
     105         std::shared_ptr<U> value(new U(id.empty() ? CObjectFactory::GenUId<U>() : id)); 
    106106 
    107107         U::AllVectObj[CObjectFactory::CurrContext].insert(U::AllVectObj[CObjectFactory::CurrContext].end(), value); 
     
    113113 
    114114   template <typename U> 
    115       const std::vector<boost::shared_ptr<U> > & 
     115      const std::vector<std::shared_ptr<U> > & 
    116116         CObjectFactory::GetObjectVector(const StdString & context) 
    117117   { 
Note: See TracChangeset for help on using the changeset viewer.