Changeset 537
- Timestamp:
- 12/11/14 14:32:37 (9 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/attribute_template_decl.cpp
r532 r537 11 11 template class CAttributeTemplate<string> ; 12 12 template class CAttributeTemplate<CDate> ; 13 template class CAttributeTemplate<CDuration> ; 13 14 } -
XIOS/trunk/src/config/context_attribute.conf
r532 r537 2 2 DECLARE_ATTRIBUTE(CDate, start_date) 3 3 DECLARE_ATTRIBUTE(CDate, time_origin) 4 DECLARE_ATTRIBUTE( StdString, timestep)4 DECLARE_ATTRIBUTE(CDuration, timestep) 5 5 DECLARE_ATTRIBUTE(StdString, output_dir) 6 6 -
XIOS/trunk/src/generate_interface_decl.cpp
r532 r537 20 20 macro(double) 21 21 macro(CDate) 22 macro(CDuration) 22 23 } -
XIOS/trunk/src/generate_interface_impl.hpp
r532 r537 17 17 template<> string CInterface::getStrFortranType<float>(void) {return string("REAL") ;} 18 18 template<> string CInterface::getStrFortranType<CDate>(void) {return string("TYPE(txios(date))") ;} 19 template<> string CInterface::getStrFortranType<CDuration>(void) {return string("TYPE(txios(duration))") ;} 19 20 20 21 template<> string CInterface::getStrFortranKind<int>(void) {return string("") ;} … … 23 24 template<> string CInterface::getStrFortranKind<float>(void) {return string("(KIND=4)") ;} 24 25 template<> string CInterface::getStrFortranKind<CDate>(void) {return string("") ;} 26 template<> string CInterface::getStrFortranKind<CDuration>(void) {return string("") ;} 25 27 26 28 template<> string CInterface::getStrFortranKindC<int>(void) {return string("(KIND=C_INT)") ;} … … 29 31 template<> string CInterface::getStrFortranKindC<float>(void) {return string("(KIND=C_FLOAT)") ;} 30 32 template<> string CInterface::getStrFortranKindC<CDate>(void) {return string("") ;} 33 template<> string CInterface::getStrFortranKindC<CDuration>(void) {return string("") ;} 31 34 32 35 template<> bool CInterface::matchingTypeCFortran<int>(void) { return true ; } … … 35 38 template<> bool CInterface::matchingTypeCFortran<float>(void) { return true; } 36 39 template<> bool CInterface::matchingTypeCFortran<CDate>(void) { return true; } 40 template<> bool CInterface::matchingTypeCFortran<CDuration>(void) { return true; } 37 41 38 42 … … 167 171 } 168 172 173 template<> 174 void CInterface::AttributeCInterface<CDuration>(ostream& oss, const string& className,const string& name) 175 { 176 oss << "void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, cxios_duration " << name << "_c)" << iendl; 177 oss << "{" << iendl; 178 oss << " CTimer::get(\"XIOS\").resume();" << iendl; 179 oss << " " << className << "_hdl->" << name << ".allocate();" << iendl; 180 oss << " CDuration& " << name <<" = " << className << "_hdl->" << name << ".get();" << iendl; 181 oss << " " << name << ".year = " << name << "_c.year;" << iendl; 182 oss << " " << name << ".month = " << name << "_c.month;" << iendl; 183 oss << " " << name << ".day = " << name << "_c.day;" << iendl; 184 oss << " " << name << ".hour = " << name << "_c.hour;" << iendl; 185 oss << " " << name << ".minute = " << name << "_c.minute;" << iendl; 186 oss << " " << name << ".second = " << name << "_c.second;" << iendl; 187 oss << " " << name << ".timestep = " << name << "_c.timestep;" << iendl; 188 oss << " CTimer::get(\"XIOS\").suspend();" << iendl; 189 oss << "}" << iendl; 190 191 oss << iendl; 192 193 oss << "void cxios_get_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, cxios_duration* " << name << "_c)" << iendl; 194 oss << "{" << iendl; 195 oss << " CTimer::get(\"XIOS\").resume();" << iendl; 196 oss << " CDuration " << name <<" = " << className << "_hdl->" << name << ".getInheritedValue();" << iendl; 197 oss << " " << name << "_c->year = " << name << ".year;" << iendl; 198 oss << " " << name << "_c->month = " << name << ".month;" << iendl; 199 oss << " " << name << "_c->day = " << name << ".day;" << iendl; 200 oss << " " << name << "_c->hour = " << name << ".hour;" << iendl; 201 oss << " " << name << "_c->minute = " << name << ".minute;" << iendl; 202 oss << " " << name << "_c->second = " << name << ".second;" << iendl; 203 oss << " " << name << "_c->timestep = " << name << ".timestep;" << iendl; 204 oss << " CTimer::get(\"XIOS\").suspend();" << iendl; 205 oss << "}" << iendl; 206 oss << iendl; 207 } 208 169 209 /* 170 210 #define macro(T) \ … … 305 345 oss << " USE IDATE" << iendl; 306 346 oss << " INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; 307 oss << " TYPE( xios_date), VALUE :: " << name << iendl;347 oss << " TYPE(txios(date)), VALUE :: " << name << iendl; 308 348 oss << "END SUBROUTINE cxios_set_" << className << "_" << name << iendl; 309 349 oss << iendl; … … 313 353 oss << " INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; 314 354 oss << " TYPE(txios(date)) :: " << name << iendl; 355 oss << "END SUBROUTINE cxios_get_" << className << "_" << name << iendl; 356 oss << iendl; 357 } 358 359 template <> 360 void CInterface::AttributeFortran2003Interface<CDuration>(ostream& oss, const string& className, const string& name) 361 { 362 oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ") BIND(C)" << iendl; 363 oss << " USE ISO_C_BINDING" << iendl; 364 oss << " USE IDATE" << iendl; 365 oss << " INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; 366 oss << " TYPE(txios(duration)), VALUE :: " << name << iendl; 367 oss << "END SUBROUTINE cxios_set_" << className << "_" << name << iendl; 368 oss << iendl; 369 oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ") BIND(C)" << iendl; 370 oss << " USE ISO_C_BINDING" << iendl; 371 oss << " USE IDATE" << iendl; 372 oss << " INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; 373 oss << " TYPE(txios(duration)) :: " << name << iendl; 315 374 oss << "END SUBROUTINE cxios_get_" << className << "_" << name << iendl; 316 375 oss << iendl; -
XIOS/trunk/src/interface/c/icdate.cpp
r509 r537 23 23 // /////////////////////////////// Définitions ////////////////////////////// // 24 24 25 void cxios_set_timestep(double ts_year, double ts_month, double ts_day,26 double ts_hour, double ts_minute, double ts_second)27 {28 try29 {30 CTimer::get("XIOS").resume() ;31 CDuration dur = {ts_year, ts_month, ts_day, ts_hour, ts_minute, ts_second, 0};32 xios::CContext* context = CContext::getCurrent() ;33 context->timestep.setValue(dur.toString());34 CTimer::get("XIOS").suspend() ;35 }36 catch (xios::CException & exc)37 {38 std::cerr << exc.getMessage() << std::endl;39 exit (EXIT_FAILURE);40 }41 }42 43 25 void cxios_update_calendar(int step) 44 26 { -
XIOS/trunk/src/interface/c/icdate.hpp
r533 r537 4 4 5 5 typedef struct { int year, month, day, hour, minute, second; } cxios_date; 6 typedef struct { double year, month, day, hour, minute, second, timestep; } cxios_duration; 6 7 } // extern "C" -
XIOS/trunk/src/interface/c_attr/iccontext_attr.cpp
r532 r537 146 146 147 147 148 void cxios_set_context_timestep(context_Ptr context_hdl, c onst char * timestep, int timestep_size)148 void cxios_set_context_timestep(context_Ptr context_hdl, cxios_duration timestep_c) 149 149 { 150 std::string timestep_str; 151 if(!cstr2string(timestep, timestep_size, timestep_str)) return; 152 CTimer::get("XIOS").resume(); 153 context_hdl->timestep.setValue(timestep_str); 154 CTimer::get("XIOS").suspend(); 150 CTimer::get("XIOS").resume(); 151 context_hdl->timestep.allocate(); 152 CDuration& timestep = context_hdl->timestep.get(); 153 timestep.year = timestep_c.year; 154 timestep.month = timestep_c.month; 155 timestep.day = timestep_c.day; 156 timestep.hour = timestep_c.hour; 157 timestep.minute = timestep_c.minute; 158 timestep.second = timestep_c.second; 159 timestep.timestep = timestep_c.timestep; 160 CTimer::get("XIOS").suspend(); 155 161 } 156 162 157 void cxios_get_context_timestep(context_Ptr context_hdl, c har * timestep, int timestep_size)163 void cxios_get_context_timestep(context_Ptr context_hdl, cxios_duration* timestep_c) 158 164 { 159 CTimer::get("XIOS").resume(); 160 if(!string_copy(context_hdl->timestep.getInheritedValue(),timestep , timestep_size)) 161 ERROR("void cxios_get_context_timestep(context_Ptr context_hdl, char * timestep, int timestep_size)", <<"Input string is to short"); 162 CTimer::get("XIOS").suspend(); 165 CTimer::get("XIOS").resume(); 166 CDuration timestep = context_hdl->timestep.getInheritedValue(); 167 timestep_c->year = timestep.year; 168 timestep_c->month = timestep.month; 169 timestep_c->day = timestep.day; 170 timestep_c->hour = timestep.hour; 171 timestep_c->minute = timestep.minute; 172 timestep_c->second = timestep.second; 173 timestep_c->timestep = timestep.timestep; 174 CTimer::get("XIOS").suspend(); 163 175 } 164 176 -
XIOS/trunk/src/interface/fortran/idate.F90
r532 r537 10 10 END TYPE txios(date) 11 11 12 TYPE txios(time)13 REAL(kind = 8) :: year=0, month=0, day=0, hour=0, minute=0, second=014 END TYPE txios( time)12 TYPE, BIND(C) :: txios(duration) 13 REAL(kind = C_DOUBLE) :: year=0, month=0, day=0, hour=0, minute=0, second=0, timestep=0 14 END TYPE txios(duration) 15 15 16 16 INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99 17 18 SUBROUTINE cxios_set_timestep(ts_year, ts_month, ts_day, ts_hour, ts_minute, ts_second) BIND(C)19 IMPORT C_DOUBLE20 REAL (kind = C_DOUBLE), VALUE :: ts_year, ts_month , ts_day , &21 ts_hour, ts_minute, ts_second22 END SUBROUTINE cxios_set_timestep23 17 24 18 SUBROUTINE cxios_update_calendar(step) BIND(C) … … 26 20 INTEGER (kind = C_INT), VALUE :: step 27 21 END SUBROUTINE cxios_update_calendar 28 22 29 23 END INTERFACE 30 24 31 25 CONTAINS ! Fonctions disponibles pour les utilisateurs. 32 26 33 34 SUBROUTINE xios(set_timestep)(timestep)35 IMPLICIT NONE36 TYPE(txios(time)), INTENT(IN):: timestep37 38 CALL cxios_set_timestep(timestep%year, timestep%month , timestep%day, &39 timestep%hour, timestep%minute, timestep%second)40 41 END SUBROUTINE xios(set_timestep)42 43 44 45 27 SUBROUTINE xios(update_calendar)(step) 46 28 IMPLICIT NONE … … 52 34 END IF 53 35 CALL cxios_update_calendar(step) 54 55 36 END SUBROUTINE xios(update_calendar) 56 37 57 58 38 END MODULE IDATE -
XIOS/trunk/src/interface/fortran/ixios.F90
r529 r537 19 19 xios(setVar_logic), xios(setVar_char) 20 20 21 USE idate, ONLY : txios(date), txios(time), xios(set_timestep),xios(update_calendar)21 USE idate, ONLY : txios(date), txios(duration), xios(update_calendar) 22 22 23 23 USE idomain, ONLY : txios(domain), txios(domaingroup), xios(get_domain_handle), & … … 158 158 PUBLIC :: txios(domain), txios(domaingroup),txios(field), txios(fieldgroup),txios(file), txios(filegroup), & 159 159 txios(grid), txios(gridgroup), txios(axis), txios(axisgroup),txios(context), txios(date), & 160 txios( time), txios(variable)160 txios(duration), txios(variable) 161 161 162 162 PUBLIC :: xios(set_attr), xios(set_domain_attr), xios(set_domaingroup_attr), xios(set_fieldgroup_attr), & … … 184 184 185 185 PUBLIC :: xios(set_current_context) 186 PUBLIC :: xios( set_timestep),xios(update_calendar)186 PUBLIC :: xios(update_calendar) 187 187 PUBLIC :: xios(initialize), xios(init_server), xios(finalize), xios(context_initialize),xios(context_is_initialized), & 188 188 xios(solve_inheritance), xios(close_context_definition), xios(context_finalize), xios(send_field), & -
XIOS/trunk/src/interface/fortran_attr/context_interface_attr.F90
r532 r537 56 56 USE IDATE 57 57 INTEGER (kind = C_INTPTR_T), VALUE :: context_hdl 58 TYPE( xios_date), VALUE :: start_date58 TYPE(txios(date)), VALUE :: start_date 59 59 END SUBROUTINE cxios_set_context_start_date 60 60 … … 77 77 USE IDATE 78 78 INTEGER (kind = C_INTPTR_T), VALUE :: context_hdl 79 TYPE( xios_date), VALUE :: time_origin79 TYPE(txios(date)), VALUE :: time_origin 80 80 END SUBROUTINE cxios_set_context_time_origin 81 81 … … 94 94 95 95 96 SUBROUTINE cxios_set_context_timestep(context_hdl, timestep , timestep_size) BIND(C)96 SUBROUTINE cxios_set_context_timestep(context_hdl, timestep) BIND(C) 97 97 USE ISO_C_BINDING 98 USE IDATE 98 99 INTEGER (kind = C_INTPTR_T), VALUE :: context_hdl 99 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: timestep 100 INTEGER (kind = C_INT) , VALUE :: timestep_size 100 TYPE(txios(duration)), VALUE :: timestep 101 101 END SUBROUTINE cxios_set_context_timestep 102 102 103 SUBROUTINE cxios_get_context_timestep(context_hdl, timestep , timestep_size) BIND(C)103 SUBROUTINE cxios_get_context_timestep(context_hdl, timestep) BIND(C) 104 104 USE ISO_C_BINDING 105 USE IDATE 105 106 INTEGER (kind = C_INTPTR_T), VALUE :: context_hdl 106 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: timestep 107 INTEGER (kind = C_INT) , VALUE :: timestep_size 107 TYPE(txios(duration)) :: timestep 108 108 END SUBROUTINE cxios_get_context_timestep 109 109 -
XIOS/trunk/src/interface/fortran_attr/icontext_attr.F90
r532 r537 21 21 TYPE(txios(date)) , OPTIONAL, INTENT(IN) :: start_date 22 22 TYPE(txios(date)) , OPTIONAL, INTENT(IN) :: time_origin 23 CHARACTER(len = *), OPTIONAL, INTENT(IN) :: timestep23 TYPE(txios(duration)) , OPTIONAL, INTENT(IN) :: timestep 24 24 25 25 CALL xios(get_context_handle)(context_id,context_hdl) … … 38 38 TYPE(txios(date)) , OPTIONAL, INTENT(IN) :: start_date 39 39 TYPE(txios(date)) , OPTIONAL, INTENT(IN) :: time_origin 40 CHARACTER(len = *), OPTIONAL, INTENT(IN) :: timestep40 TYPE(txios(duration)) , OPTIONAL, INTENT(IN) :: timestep 41 41 42 42 CALL xios(set_context_attr_hdl_) & … … 54 54 TYPE(txios(date)) , OPTIONAL, INTENT(IN) :: start_date_ 55 55 TYPE(txios(date)) , OPTIONAL, INTENT(IN) :: time_origin_ 56 CHARACTER(len = *), OPTIONAL, INTENT(IN) :: timestep_56 TYPE(txios(duration)) , OPTIONAL, INTENT(IN) :: timestep_ 57 57 58 58 IF (PRESENT(calendar_type_)) THEN … … 73 73 74 74 IF (PRESENT(timestep_)) THEN 75 CALL cxios_set_context_timestep(context_hdl%daddr, timestep_ , len(timestep_))75 CALL cxios_set_context_timestep(context_hdl%daddr, timestep_) 76 76 ENDIF 77 77 … … 90 90 TYPE(txios(date)) , OPTIONAL, INTENT(OUT) :: start_date 91 91 TYPE(txios(date)) , OPTIONAL, INTENT(OUT) :: time_origin 92 CHARACTER(len = *), OPTIONAL, INTENT(OUT) :: timestep92 TYPE(txios(duration)) , OPTIONAL, INTENT(OUT) :: timestep 93 93 94 94 CALL xios(get_context_handle)(context_id,context_hdl) … … 107 107 TYPE(txios(date)) , OPTIONAL, INTENT(OUT) :: start_date 108 108 TYPE(txios(date)) , OPTIONAL, INTENT(OUT) :: time_origin 109 CHARACTER(len = *), OPTIONAL, INTENT(OUT) :: timestep109 TYPE(txios(duration)) , OPTIONAL, INTENT(OUT) :: timestep 110 110 111 111 CALL xios(get_context_attr_hdl_) & … … 123 123 TYPE(txios(date)) , OPTIONAL, INTENT(OUT) :: start_date_ 124 124 TYPE(txios(date)) , OPTIONAL, INTENT(OUT) :: time_origin_ 125 CHARACTER(len = *), OPTIONAL, INTENT(OUT) :: timestep_125 TYPE(txios(duration)) , OPTIONAL, INTENT(OUT) :: timestep_ 126 126 127 127 IF (PRESENT(calendar_type_)) THEN … … 142 142 143 143 IF (PRESENT(timestep_)) THEN 144 CALL cxios_get_context_timestep(context_hdl%daddr, timestep_ , len(timestep_))144 CALL cxios_get_context_timestep(context_hdl%daddr, timestep_) 145 145 ENDIF 146 146 -
XIOS/trunk/src/node/context.cpp
r534 r537 111 111 "time_origin: Bad format or date not conform to the calendar"); \ 112 112 \ 113 this->calendar->setTimeStep 114 (CDuration::FromString(this->timestep.getValue()));\113 this->calendar->setTimeStep(this->timestep.getValue()); \ 114 \ 115 115 return; \ 116 116 } -
XIOS/trunk/src/test/test_client.f90
r501 r537 11 11 CHARACTER(len=*),PARAMETER :: id="client" 12 12 INTEGER :: comm 13 TYPE(xios_ time):: dtime13 TYPE(xios_duration) :: dtime 14 14 TYPE(xios_context) :: ctx_hdl 15 15 INTEGER,PARAMETER :: ni_glo=100 … … 88 88 89 89 dtime%second=3600 90 CALL xios_set_ timestep(dtime)90 CALL xios_set_context_attr("test", timestep=dtime) 91 91 92 92 ni=0 ; lonvalue(:)=0 -
XIOS/trunk/src/test/test_complete.f90
r532 r537 12 12 INTEGER :: comm 13 13 TYPE(xios_date) :: start_date, time_origin 14 TYPE(xios_ time):: dtime14 TYPE(xios_duration) :: dtime 15 15 TYPE(xios_context) :: ctx_hdl 16 16 INTEGER,PARAMETER :: ni_glo=100 … … 122 122 123 123 dtime%second=3600 124 CALL xios_set_ timestep(dtime)124 CALL xios_set_context_attr("atmosphere", timestep=dtime) 125 125 126 126 !!! Recupration des valeurs des longitudes et de taille des domaines locaux (pour test de fonctionnalité) … … 204 204 205 205 dtime%second=1800 206 CALL xios_set_ timestep(dtime)206 CALL xios_set_context_attr("surface", timestep=dtime) 207 207 208 208 !!! Recupration des valeurs des longitudes et de taille des domaines locaux (pour test de fonctionnalité) -
XIOS/trunk/src/test/test_cs.f90
r501 r537 30 30 INTEGER :: size 31 31 INTEGER :: comm 32 TYPE(xios_ time):: dtime32 TYPE(xios_duration) :: dtime 33 33 TYPE(xios_context) :: ctx_hdl 34 34 INTEGER,PARAMETER :: ni_glo=100 … … 126 126 127 127 dtime%second=3600 128 CALL xios_set_ timestep(dtime)128 CALL xios_set_context_attr("test", timestep=dtime) 129 129 130 130 ! ni=0 ; lonvalue(:)=0 -
XIOS/trunk/src/test/test_unstruct_complete.f90
r501 r537 11 11 CHARACTER(len=*),PARAMETER :: id="client" 12 12 INTEGER :: comm 13 TYPE(xios_ time):: dtime13 TYPE(xios_duration) :: dtime 14 14 TYPE(xios_context) :: ctx_hdl 15 15 INTEGER, PARAMETER :: nlon=60 … … 209 209 210 210 dtime%second=3600 211 CALL xios_set_ timestep(dtime)211 CALL xios_set_context_attr("surface", timestep=dtime) 212 212 CALL xios_close_context_definition() 213 213 -
XIOS/trunk/src/test/test_xios_interface.f90
r532 r537 13 13 INTEGER :: comm 14 14 TYPE(xios_date) :: start_date, time_origin 15 TYPE(xios_ time):: dtime15 TYPE(xios_duration) :: dtime 16 16 TYPE(xios_context) :: ctx_hdl 17 17 INTEGER,PARAMETER :: ni_glo=10 … … 131 131 132 132 dtime%second=3600 133 CALL xios_set_ timestep(dtime)133 CALL xios_set_context_attr("atmosphere", timestep=dtime) 134 134 135 135 !!! Recupration des valeurs des longitudes et de taille des domaines locaux (pour test de fonctionnalité) … … 213 213 214 214 dtime%second=1800 215 CALL xios_set_ timestep(dtime)215 CALL xios_set_context_attr("surface", timestep=dtime) 216 216 217 217 !!! Recupration des valeurs des longitudes et de taille des domaines locaux (pour test de fonctionnalité) -
XIOS/trunk/src/type/type_decl.cpp
r532 r537 30 30 macro(StdSize) 31 31 macro(CDate) 32 macro(CDuration) 32 33 } -
XIOS/trunk/src/type/type_specialisation.hpp
r533 r537 287 287 ptrValue->setSecond(sec); 288 288 } 289 290 return ret; 291 } 292 293 // template specializations for CDuration 294 295 template <> 296 size_t CType<CDuration>::_size() const 297 { 298 return 7 * sizeof(double); 299 } 300 301 template <> 302 size_t CType_ref<CDuration>::_size() const 303 { 304 return 7 * sizeof(double); 305 } 306 307 template <> 308 bool CType<CDuration>::_toBuffer(CBufferOut& buffer) const 309 { 310 if (buffer.remain() < size()) return false; 311 else 312 { 313 bool ret = true; 314 if (ret) ret &= buffer.put(ptrValue->year); 315 if (ret) ret &= buffer.put(ptrValue->month); 316 if (ret) ret &= buffer.put(ptrValue->day); 317 if (ret) ret &= buffer.put(ptrValue->hour); 318 if (ret) ret &= buffer.put(ptrValue->minute); 319 if (ret) ret &= buffer.put(ptrValue->second); 320 if (ret) ret &= buffer.put(ptrValue->timestep); 321 return ret; 322 } 323 } 324 325 template <> 326 bool CType_ref<CDuration>::_toBuffer(CBufferOut& buffer) const 327 { 328 if (buffer.remain() < size()) return false; 329 else 330 { 331 bool ret = true; 332 if (ret) ret &= buffer.put(ptrValue->year); 333 if (ret) ret &= buffer.put(ptrValue->month); 334 if (ret) ret &= buffer.put(ptrValue->day); 335 if (ret) ret &= buffer.put(ptrValue->hour); 336 if (ret) ret &= buffer.put(ptrValue->minute); 337 if (ret) ret &= buffer.put(ptrValue->second); 338 if (ret) ret &= buffer.put(ptrValue->timestep); 339 return ret; 340 } 341 } 342 343 template <> 344 bool CType<CDuration>::_fromBuffer(CBufferIn& buffer) 345 { 346 allocate(); 347 bool ret = true; 348 349 if (ret) ret &= buffer.get(ptrValue->year); 350 if (ret) ret &= buffer.get(ptrValue->month); 351 if (ret) ret &= buffer.get(ptrValue->day); 352 if (ret) ret &= buffer.get(ptrValue->hour); 353 if (ret) ret &= buffer.get(ptrValue->minute); 354 if (ret) ret &= buffer.get(ptrValue->second); 355 if (ret) ret &= buffer.get(ptrValue->timestep); 356 357 return ret; 358 } 359 360 template <> 361 bool CType_ref<CDuration>::_fromBuffer(CBufferIn& buffer) const 362 { 363 bool ret = true; 364 365 if (ret) ret &= buffer.get(ptrValue->year); 366 if (ret) ret &= buffer.get(ptrValue->month); 367 if (ret) ret &= buffer.get(ptrValue->day); 368 if (ret) ret &= buffer.get(ptrValue->hour); 369 if (ret) ret &= buffer.get(ptrValue->minute); 370 if (ret) ret &= buffer.get(ptrValue->second); 371 if (ret) ret &= buffer.get(ptrValue->timestep); 372 373 return ret; 374 } 375 376 template <> 377 bool CType_ref<CDuration>::_fromBuffer(CBufferIn& buffer) 378 { 379 bool ret = true; 380 381 if (ret) ret &= buffer.get(ptrValue->year); 382 if (ret) ret &= buffer.get(ptrValue->month); 383 if (ret) ret &= buffer.get(ptrValue->day); 384 if (ret) ret &= buffer.get(ptrValue->hour); 385 if (ret) ret &= buffer.get(ptrValue->minute); 386 if (ret) ret &= buffer.get(ptrValue->second); 387 if (ret) ret &= buffer.get(ptrValue->timestep); 289 388 290 389 return ret;
Note: See TracChangeset
for help on using the changeset viewer.