Changeset 311


Ignore:
Timestamp:
02/14/12 14:37:56 (10 years ago)
Author:
ymipsl
Message:

CXios::getin has now default parameters

YM

Location:
XIOS/trunk/src
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/cxios.cpp

    r300 r311  
    2222  { 
    2323    tree::CTreeManager::ParseFile(rootFile); 
    24     usingServer=getin<bool>("using_server") ; 
    25     usingOasis=getin<bool>("using_oasis") ; 
    26     info.setLevel(getin<int>("info_level")) ; 
     24    usingServer=getin<bool>("using_server",false) ; 
     25    usingOasis=getin<bool>("using_oasis",false) ; 
     26    info.setLevel(getin<int>("info_level",0)) ; 
    2727    globalComm=MPI_COMM_WORLD ; 
    2828  } 
  • XIOS/trunk/src/cxios.hpp

    r300 r311  
    2222    
    2323     template <typename T> 
     24     static T getin(const string& id,const T& defaultValue) ; 
     25      
     26     template <typename T> 
    2427     static T getin(const string& id) ; 
    25  
    2628 
    2729     static bool isClient ; 
  • XIOS/trunk/src/cxios_impl.hpp

    r300 r311  
    1313  } 
    1414 
     15  template <typename T> 
     16  T CXios::getin(const string& id, const T& defaultValue) 
     17  { 
     18    if (CObjectFactory::HasObject<CVariable>("xios",id)) 
     19      return CObjectFactory::GetObject<CVariable>("xios",id)->getData<T>() ; 
     20    else return defaultValue ; 
     21  } 
    1522 
    1623 
Note: See TracChangeset for help on using the changeset viewer.