Ignore:
Timestamp:
06/18/18 20:32:55 (6 years ago)
Author:
yushan
Message:

branch_openmp merged with trunk r1544

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_openmp/src/interface/c_attr/icaxis_attr.cpp

    r1052 r1545  
    44 
    55#include <boost/multi_array.hpp> 
    6 #include <boost/shared_ptr.hpp> 
     6#include <memory> 
    77#include "xios.hpp" 
    88#include "attribute_template.hpp" 
     
    4444 
    4545 
     46  void cxios_set_axis_axis_type(axis_Ptr axis_hdl, const char * axis_type, int axis_type_size) 
     47  { 
     48    std::string axis_type_str; 
     49    if (!cstr2string(axis_type, axis_type_size, axis_type_str)) return; 
     50    CTimer::get("XIOS").resume(); 
     51    axis_hdl->axis_type.fromString(axis_type_str); 
     52    CTimer::get("XIOS").suspend(); 
     53  } 
     54 
     55  void cxios_get_axis_axis_type(axis_Ptr axis_hdl, char * axis_type, int axis_type_size) 
     56  { 
     57    CTimer::get("XIOS").resume(); 
     58    if (!string_copy(axis_hdl->axis_type.getInheritedStringValue(), axis_type, axis_type_size)) 
     59      ERROR("void cxios_get_axis_axis_type(axis_Ptr axis_hdl, char * axis_type, int axis_type_size)", << "Input string is too short"); 
     60    CTimer::get("XIOS").suspend(); 
     61  } 
     62 
     63  bool cxios_is_defined_axis_axis_type(axis_Ptr axis_hdl) 
     64  { 
     65     CTimer::get("XIOS").resume(); 
     66     bool isDefined = axis_hdl->axis_type.hasInheritedValue(); 
     67     CTimer::get("XIOS").suspend(); 
     68     return isDefined; 
     69  } 
     70 
     71 
    4672  void cxios_set_axis_begin(axis_Ptr axis_hdl, int begin) 
    4773  { 
     
    92118 
    93119 
     120  void cxios_set_axis_bounds_name(axis_Ptr axis_hdl, const char * bounds_name, int bounds_name_size) 
     121  { 
     122    std::string bounds_name_str; 
     123    if (!cstr2string(bounds_name, bounds_name_size, bounds_name_str)) return; 
     124    CTimer::get("XIOS").resume(); 
     125    axis_hdl->bounds_name.setValue(bounds_name_str); 
     126    CTimer::get("XIOS").suspend(); 
     127  } 
     128 
     129  void cxios_get_axis_bounds_name(axis_Ptr axis_hdl, char * bounds_name, int bounds_name_size) 
     130  { 
     131    CTimer::get("XIOS").resume(); 
     132    if (!string_copy(axis_hdl->bounds_name.getInheritedValue(), bounds_name, bounds_name_size)) 
     133      ERROR("void cxios_get_axis_bounds_name(axis_Ptr axis_hdl, char * bounds_name, int bounds_name_size)", << "Input string is too short"); 
     134    CTimer::get("XIOS").suspend(); 
     135  } 
     136 
     137  bool cxios_is_defined_axis_bounds_name(axis_Ptr axis_hdl) 
     138  { 
     139     CTimer::get("XIOS").resume(); 
     140     bool isDefined = axis_hdl->bounds_name.hasInheritedValue(); 
     141     CTimer::get("XIOS").suspend(); 
     142     return isDefined; 
     143  } 
     144 
     145 
     146  void cxios_set_axis_comment(axis_Ptr axis_hdl, const char * comment, int comment_size) 
     147  { 
     148    std::string comment_str; 
     149    if (!cstr2string(comment, comment_size, comment_str)) return; 
     150    CTimer::get("XIOS").resume(); 
     151    axis_hdl->comment.setValue(comment_str); 
     152    CTimer::get("XIOS").suspend(); 
     153  } 
     154 
     155  void cxios_get_axis_comment(axis_Ptr axis_hdl, char * comment, int comment_size) 
     156  { 
     157    CTimer::get("XIOS").resume(); 
     158    if (!string_copy(axis_hdl->comment.getInheritedValue(), comment, comment_size)) 
     159      ERROR("void cxios_get_axis_comment(axis_Ptr axis_hdl, char * comment, int comment_size)", << "Input string is too short"); 
     160    CTimer::get("XIOS").suspend(); 
     161  } 
     162 
     163  bool cxios_is_defined_axis_comment(axis_Ptr axis_hdl) 
     164  { 
     165     CTimer::get("XIOS").resume(); 
     166     bool isDefined = axis_hdl->comment.hasInheritedValue(); 
     167     CTimer::get("XIOS").suspend(); 
     168     return isDefined; 
     169  } 
     170 
     171 
    94172  void cxios_set_axis_data_begin(axis_Ptr axis_hdl, int data_begin) 
    95173  { 
     
    158236     CTimer::get("XIOS").resume(); 
    159237     bool isDefined = axis_hdl->data_n.hasInheritedValue(); 
     238     CTimer::get("XIOS").suspend(); 
     239     return isDefined; 
     240  } 
     241 
     242 
     243  void cxios_set_axis_dim_name(axis_Ptr axis_hdl, const char * dim_name, int dim_name_size) 
     244  { 
     245    std::string dim_name_str; 
     246    if (!cstr2string(dim_name, dim_name_size, dim_name_str)) return; 
     247    CTimer::get("XIOS").resume(); 
     248    axis_hdl->dim_name.setValue(dim_name_str); 
     249    CTimer::get("XIOS").suspend(); 
     250  } 
     251 
     252  void cxios_get_axis_dim_name(axis_Ptr axis_hdl, char * dim_name, int dim_name_size) 
     253  { 
     254    CTimer::get("XIOS").resume(); 
     255    if (!string_copy(axis_hdl->dim_name.getInheritedValue(), dim_name, dim_name_size)) 
     256      ERROR("void cxios_get_axis_dim_name(axis_Ptr axis_hdl, char * dim_name, int dim_name_size)", << "Input string is too short"); 
     257    CTimer::get("XIOS").suspend(); 
     258  } 
     259 
     260  bool cxios_is_defined_axis_dim_name(axis_Ptr axis_hdl) 
     261  { 
     262     CTimer::get("XIOS").resume(); 
     263     bool isDefined = axis_hdl->dim_name.hasInheritedValue(); 
     264     CTimer::get("XIOS").suspend(); 
     265     return isDefined; 
     266  } 
     267 
     268 
     269  void cxios_set_axis_formula(axis_Ptr axis_hdl, const char * formula, int formula_size) 
     270  { 
     271    std::string formula_str; 
     272    if (!cstr2string(formula, formula_size, formula_str)) return; 
     273    CTimer::get("XIOS").resume(); 
     274    axis_hdl->formula.setValue(formula_str); 
     275    CTimer::get("XIOS").suspend(); 
     276  } 
     277 
     278  void cxios_get_axis_formula(axis_Ptr axis_hdl, char * formula, int formula_size) 
     279  { 
     280    CTimer::get("XIOS").resume(); 
     281    if (!string_copy(axis_hdl->formula.getInheritedValue(), formula, formula_size)) 
     282      ERROR("void cxios_get_axis_formula(axis_Ptr axis_hdl, char * formula, int formula_size)", << "Input string is too short"); 
     283    CTimer::get("XIOS").suspend(); 
     284  } 
     285 
     286  bool cxios_is_defined_axis_formula(axis_Ptr axis_hdl) 
     287  { 
     288     CTimer::get("XIOS").resume(); 
     289     bool isDefined = axis_hdl->formula.hasInheritedValue(); 
     290     CTimer::get("XIOS").suspend(); 
     291     return isDefined; 
     292  } 
     293 
     294 
     295  void cxios_set_axis_formula_bounds(axis_Ptr axis_hdl, const char * formula_bounds, int formula_bounds_size) 
     296  { 
     297    std::string formula_bounds_str; 
     298    if (!cstr2string(formula_bounds, formula_bounds_size, formula_bounds_str)) return; 
     299    CTimer::get("XIOS").resume(); 
     300    axis_hdl->formula_bounds.setValue(formula_bounds_str); 
     301    CTimer::get("XIOS").suspend(); 
     302  } 
     303 
     304  void cxios_get_axis_formula_bounds(axis_Ptr axis_hdl, char * formula_bounds, int formula_bounds_size) 
     305  { 
     306    CTimer::get("XIOS").resume(); 
     307    if (!string_copy(axis_hdl->formula_bounds.getInheritedValue(), formula_bounds, formula_bounds_size)) 
     308      ERROR("void cxios_get_axis_formula_bounds(axis_Ptr axis_hdl, char * formula_bounds, int formula_bounds_size)", << "Input string is too short"); 
     309    CTimer::get("XIOS").suspend(); 
     310  } 
     311 
     312  bool cxios_is_defined_axis_formula_bounds(axis_Ptr axis_hdl) 
     313  { 
     314     CTimer::get("XIOS").resume(); 
     315     bool isDefined = axis_hdl->formula_bounds.hasInheritedValue(); 
     316     CTimer::get("XIOS").suspend(); 
     317     return isDefined; 
     318  } 
     319 
     320 
     321  void cxios_set_axis_formula_term(axis_Ptr axis_hdl, const char * formula_term, int formula_term_size) 
     322  { 
     323    std::string formula_term_str; 
     324    if (!cstr2string(formula_term, formula_term_size, formula_term_str)) return; 
     325    CTimer::get("XIOS").resume(); 
     326    axis_hdl->formula_term.setValue(formula_term_str); 
     327    CTimer::get("XIOS").suspend(); 
     328  } 
     329 
     330  void cxios_get_axis_formula_term(axis_Ptr axis_hdl, char * formula_term, int formula_term_size) 
     331  { 
     332    CTimer::get("XIOS").resume(); 
     333    if (!string_copy(axis_hdl->formula_term.getInheritedValue(), formula_term, formula_term_size)) 
     334      ERROR("void cxios_get_axis_formula_term(axis_Ptr axis_hdl, char * formula_term, int formula_term_size)", << "Input string is too short"); 
     335    CTimer::get("XIOS").suspend(); 
     336  } 
     337 
     338  bool cxios_is_defined_axis_formula_term(axis_Ptr axis_hdl) 
     339  { 
     340     CTimer::get("XIOS").resume(); 
     341     bool isDefined = axis_hdl->formula_term.hasInheritedValue(); 
     342     CTimer::get("XIOS").suspend(); 
     343     return isDefined; 
     344  } 
     345 
     346 
     347  void cxios_set_axis_formula_term_bounds(axis_Ptr axis_hdl, const char * formula_term_bounds, int formula_term_bounds_size) 
     348  { 
     349    std::string formula_term_bounds_str; 
     350    if (!cstr2string(formula_term_bounds, formula_term_bounds_size, formula_term_bounds_str)) return; 
     351    CTimer::get("XIOS").resume(); 
     352    axis_hdl->formula_term_bounds.setValue(formula_term_bounds_str); 
     353    CTimer::get("XIOS").suspend(); 
     354  } 
     355 
     356  void cxios_get_axis_formula_term_bounds(axis_Ptr axis_hdl, char * formula_term_bounds, int formula_term_bounds_size) 
     357  { 
     358    CTimer::get("XIOS").resume(); 
     359    if (!string_copy(axis_hdl->formula_term_bounds.getInheritedValue(), formula_term_bounds, formula_term_bounds_size)) 
     360      ERROR("void cxios_get_axis_formula_term_bounds(axis_Ptr axis_hdl, char * formula_term_bounds, int formula_term_bounds_size)", << "Input string is too short"); 
     361    CTimer::get("XIOS").suspend(); 
     362  } 
     363 
     364  bool cxios_is_defined_axis_formula_term_bounds(axis_Ptr axis_hdl) 
     365  { 
     366     CTimer::get("XIOS").resume(); 
     367     bool isDefined = axis_hdl->formula_term_bounds.hasInheritedValue(); 
    160368     CTimer::get("XIOS").suspend(); 
    161369     return isDefined; 
Note: See TracChangeset for help on using the changeset viewer.