cxios_impl.hpp 508 B

1234567891011121314151617181920212223242526
  1. #ifndef __XIOS_IMPL_HPP__
  2. #define __XIOS_IMPL_HPP__
  3. #include "xios_spl.hpp"
  4. #include "variable.hpp"
  5. #include "object_template.hpp"
  6. #include "cxios.hpp"
  7. namespace xios
  8. {
  9. template <typename T>
  10. T CXios::getin(const string& id)
  11. {
  12. return CVariable::get("xios",id)->getData<T>() ;
  13. }
  14. template <typename T>
  15. T CXios::getin(const string& id, const T& defaultValue)
  16. {
  17. if (CVariable::has("xios",id)) return CVariable::get("xios",id)->getData<T>() ;
  18. else return defaultValue ;
  19. }
  20. }
  21. #endif