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/icfilegroup_attr.cpp

    r1205 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" 
     
    3636     CTimer::get("XIOS").resume(); 
    3737     bool isDefined = filegroup_hdl->append.hasInheritedValue(); 
     38     CTimer::get("XIOS").suspend(); 
     39     return isDefined; 
     40  } 
     41 
     42 
     43  void cxios_set_filegroup_comment(filegroup_Ptr filegroup_hdl, const char * comment, int comment_size) 
     44  { 
     45    std::string comment_str; 
     46    if (!cstr2string(comment, comment_size, comment_str)) return; 
     47    CTimer::get("XIOS").resume(); 
     48    filegroup_hdl->comment.setValue(comment_str); 
     49    CTimer::get("XIOS").suspend(); 
     50  } 
     51 
     52  void cxios_get_filegroup_comment(filegroup_Ptr filegroup_hdl, char * comment, int comment_size) 
     53  { 
     54    CTimer::get("XIOS").resume(); 
     55    if (!string_copy(filegroup_hdl->comment.getInheritedValue(), comment, comment_size)) 
     56      ERROR("void cxios_get_filegroup_comment(filegroup_Ptr filegroup_hdl, char * comment, int comment_size)", << "Input string is too short"); 
     57    CTimer::get("XIOS").suspend(); 
     58  } 
     59 
     60  bool cxios_is_defined_filegroup_comment(filegroup_Ptr filegroup_hdl) 
     61  { 
     62     CTimer::get("XIOS").resume(); 
     63     bool isDefined = filegroup_hdl->comment.hasInheritedValue(); 
    3864     CTimer::get("XIOS").suspend(); 
    3965     return isDefined; 
     
    428454 
    429455 
     456  void cxios_set_filegroup_read_metadata_par(filegroup_Ptr filegroup_hdl, bool read_metadata_par) 
     457  { 
     458    CTimer::get("XIOS").resume(); 
     459    filegroup_hdl->read_metadata_par.setValue(read_metadata_par); 
     460    CTimer::get("XIOS").suspend(); 
     461  } 
     462 
     463  void cxios_get_filegroup_read_metadata_par(filegroup_Ptr filegroup_hdl, bool* read_metadata_par) 
     464  { 
     465    CTimer::get("XIOS").resume(); 
     466    *read_metadata_par = filegroup_hdl->read_metadata_par.getInheritedValue(); 
     467    CTimer::get("XIOS").suspend(); 
     468  } 
     469 
     470  bool cxios_is_defined_filegroup_read_metadata_par(filegroup_Ptr filegroup_hdl) 
     471  { 
     472     CTimer::get("XIOS").resume(); 
     473     bool isDefined = filegroup_hdl->read_metadata_par.hasInheritedValue(); 
     474     CTimer::get("XIOS").suspend(); 
     475     return isDefined; 
     476  } 
     477 
     478 
    430479  void cxios_set_filegroup_record_offset(filegroup_Ptr filegroup_hdl, int record_offset) 
    431480  { 
     
    446495     CTimer::get("XIOS").resume(); 
    447496     bool isDefined = filegroup_hdl->record_offset.hasInheritedValue(); 
     497     CTimer::get("XIOS").suspend(); 
     498     return isDefined; 
     499  } 
     500 
     501 
     502  void cxios_set_filegroup_split_end_offset(filegroup_Ptr filegroup_hdl, cxios_duration split_end_offset_c) 
     503  { 
     504    CTimer::get("XIOS").resume(); 
     505    filegroup_hdl->split_end_offset.allocate(); 
     506    CDuration& split_end_offset = filegroup_hdl->split_end_offset.get(); 
     507    split_end_offset.year = split_end_offset_c.year; 
     508    split_end_offset.month = split_end_offset_c.month; 
     509    split_end_offset.day = split_end_offset_c.day; 
     510    split_end_offset.hour = split_end_offset_c.hour; 
     511    split_end_offset.minute = split_end_offset_c.minute; 
     512    split_end_offset.second = split_end_offset_c.second; 
     513    split_end_offset.timestep = split_end_offset_c.timestep; 
     514    CTimer::get("XIOS").suspend(); 
     515  } 
     516 
     517  void cxios_get_filegroup_split_end_offset(filegroup_Ptr filegroup_hdl, cxios_duration* split_end_offset_c) 
     518  { 
     519    CTimer::get("XIOS").resume(); 
     520    CDuration split_end_offset = filegroup_hdl->split_end_offset.getInheritedValue(); 
     521    split_end_offset_c->year = split_end_offset.year; 
     522    split_end_offset_c->month = split_end_offset.month; 
     523    split_end_offset_c->day = split_end_offset.day; 
     524    split_end_offset_c->hour = split_end_offset.hour; 
     525    split_end_offset_c->minute = split_end_offset.minute; 
     526    split_end_offset_c->second = split_end_offset.second; 
     527    split_end_offset_c->timestep = split_end_offset.timestep; 
     528    CTimer::get("XIOS").suspend(); 
     529  } 
     530 
     531  bool cxios_is_defined_filegroup_split_end_offset(filegroup_Ptr filegroup_hdl) 
     532  { 
     533     CTimer::get("XIOS").resume(); 
     534     bool isDefined = filegroup_hdl->split_end_offset.hasInheritedValue(); 
    448535     CTimer::get("XIOS").suspend(); 
    449536     return isDefined; 
     
    515602 
    516603 
     604  void cxios_set_filegroup_split_last_date(filegroup_Ptr filegroup_hdl, const char * split_last_date, int split_last_date_size) 
     605  { 
     606    std::string split_last_date_str; 
     607    if (!cstr2string(split_last_date, split_last_date_size, split_last_date_str)) return; 
     608    CTimer::get("XIOS").resume(); 
     609    filegroup_hdl->split_last_date.setValue(split_last_date_str); 
     610    CTimer::get("XIOS").suspend(); 
     611  } 
     612 
     613  void cxios_get_filegroup_split_last_date(filegroup_Ptr filegroup_hdl, char * split_last_date, int split_last_date_size) 
     614  { 
     615    CTimer::get("XIOS").resume(); 
     616    if (!string_copy(filegroup_hdl->split_last_date.getInheritedValue(), split_last_date, split_last_date_size)) 
     617      ERROR("void cxios_get_filegroup_split_last_date(filegroup_Ptr filegroup_hdl, char * split_last_date, int split_last_date_size)", << "Input string is too short"); 
     618    CTimer::get("XIOS").suspend(); 
     619  } 
     620 
     621  bool cxios_is_defined_filegroup_split_last_date(filegroup_Ptr filegroup_hdl) 
     622  { 
     623     CTimer::get("XIOS").resume(); 
     624     bool isDefined = filegroup_hdl->split_last_date.hasInheritedValue(); 
     625     CTimer::get("XIOS").suspend(); 
     626     return isDefined; 
     627  } 
     628 
     629 
     630  void cxios_set_filegroup_split_start_offset(filegroup_Ptr filegroup_hdl, cxios_duration split_start_offset_c) 
     631  { 
     632    CTimer::get("XIOS").resume(); 
     633    filegroup_hdl->split_start_offset.allocate(); 
     634    CDuration& split_start_offset = filegroup_hdl->split_start_offset.get(); 
     635    split_start_offset.year = split_start_offset_c.year; 
     636    split_start_offset.month = split_start_offset_c.month; 
     637    split_start_offset.day = split_start_offset_c.day; 
     638    split_start_offset.hour = split_start_offset_c.hour; 
     639    split_start_offset.minute = split_start_offset_c.minute; 
     640    split_start_offset.second = split_start_offset_c.second; 
     641    split_start_offset.timestep = split_start_offset_c.timestep; 
     642    CTimer::get("XIOS").suspend(); 
     643  } 
     644 
     645  void cxios_get_filegroup_split_start_offset(filegroup_Ptr filegroup_hdl, cxios_duration* split_start_offset_c) 
     646  { 
     647    CTimer::get("XIOS").resume(); 
     648    CDuration split_start_offset = filegroup_hdl->split_start_offset.getInheritedValue(); 
     649    split_start_offset_c->year = split_start_offset.year; 
     650    split_start_offset_c->month = split_start_offset.month; 
     651    split_start_offset_c->day = split_start_offset.day; 
     652    split_start_offset_c->hour = split_start_offset.hour; 
     653    split_start_offset_c->minute = split_start_offset.minute; 
     654    split_start_offset_c->second = split_start_offset.second; 
     655    split_start_offset_c->timestep = split_start_offset.timestep; 
     656    CTimer::get("XIOS").suspend(); 
     657  } 
     658 
     659  bool cxios_is_defined_filegroup_split_start_offset(filegroup_Ptr filegroup_hdl) 
     660  { 
     661     CTimer::get("XIOS").resume(); 
     662     bool isDefined = filegroup_hdl->split_start_offset.hasInheritedValue(); 
     663     CTimer::get("XIOS").suspend(); 
     664     return isDefined; 
     665  } 
     666 
     667 
    517668  void cxios_set_filegroup_sync_freq(filegroup_Ptr filegroup_hdl, cxios_duration sync_freq_c) 
    518669  { 
Note: See TracChangeset for help on using the changeset viewer.