![]() |
GURLS++
2.0.00
C++ Implementation of GURLS Matlab Toolbox
|
00001 /* 00002 * The GURLS Package in C++ 00003 * 00004 * Copyright (C) 2011-1013, IIT@MIT Lab 00005 * All rights reserved. 00006 * 00007 * author: M. Santoro 00008 * email: msantoro@mit.edu 00009 * website: http://cbcl.mit.edu/IIT@MIT/IIT@MIT.html 00010 * 00011 * Redistribution and use in source and binary forms, with or without 00012 * modification, are permitted provided that the following conditions 00013 * are met: 00014 * 00015 * * Redistributions of source code must retain the above 00016 * copyright notice, this list of conditions and the following 00017 * disclaimer. 00018 * * Redistributions in binary form must reproduce the above 00019 * copyright notice, this list of conditions and the following 00020 * disclaimer in the documentation and/or other materials 00021 * provided with the distribution. 00022 * * Neither the name(s) of the copyright holders nor the names 00023 * of its contributors or of the Massacusetts Institute of 00024 * Technology or of the Italian Institute of Technology may be 00025 * used to endorse or promote products derived from this software 00026 * without specific prior written permission. 00027 * 00028 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00029 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00030 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00031 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 00032 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00033 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00034 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00035 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00036 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00037 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 00038 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00039 * POSSIBILITY OF SUCH DAMAGE. 00040 */ 00041 00042 #ifndef _GURLS_OPTSERIALIZATION_H_ 00043 #define _GURLS_OPTSERIALIZATION_H_ 00044 00045 #include <string> 00046 00047 #include "gurls++/optarray.h" 00048 #include "gurls++/optlist.h" 00049 #include "gurls++/optfunction.h" 00050 #include "gurls++/optmatrix.h" 00051 00052 #include <boost/serialization/split_free.hpp> 00053 00054 namespace boost { 00055 namespace serialization { 00056 00060 template<class Archive> 00061 void save(Archive & ar, const gurls::OptArray & opt, const unsigned int version) 00062 { 00063 gurls::OptTypes type; 00064 00065 type = opt.getType(); 00066 ar & type; 00067 00068 unsigned long size = opt.size(); 00069 ar & size; 00070 00071 const gurls::OptArray::ValueType& value = opt.getValue(); 00072 00073 for (gurls::OptArray::ValueType::const_iterator it = value.begin(); it != value.end(); ++it) 00074 { 00075 gurls::GurlsOption* opt0 = *it; 00076 type = opt0->getType(); 00077 00078 ar & type; 00079 00080 switch(type) 00081 { 00082 case gurls::StringOption: 00083 ar & (*static_cast<gurls::OptString*>(opt0)); 00084 break; 00085 case gurls::StringListOption: 00086 ar & (*static_cast<gurls::OptStringList*>(opt0)); 00087 break; 00088 case gurls::NumberOption: 00089 ar & (*static_cast<gurls::OptNumber*>(opt0)); 00090 break; 00091 case gurls::NumberListOption: 00092 ar & (*static_cast<gurls::OptNumberList*>(opt0)); 00093 break; 00094 case gurls::FunctionOption: 00095 ar & (*static_cast<gurls::OptFunction*>(opt0)); 00096 break; 00097 case gurls::MatrixOption: 00098 { 00099 gurls::OptMatrixBase* optM = static_cast<gurls::OptMatrixBase*>(opt0); 00100 gurls::OptMatrixBase::MatrixType matType = optM->getMatrixType(); 00101 00102 ar & matType; 00103 00104 #ifdef _BGURLS 00105 00106 bool bigArray = optM->hasBigArray(); 00107 ar & bigArray; 00108 00109 if(bigArray) 00110 { 00111 switch(matType) 00112 { 00113 case gurls::OptMatrixBase::FLOAT: 00114 ar & *(static_cast<gurls::OptMatrix<gurls::BigArray<float> >*>(optM)); 00115 break; 00116 case gurls::OptMatrixBase::DOUBLE: 00117 ar & *(static_cast<gurls::OptMatrix<gurls::BigArray<double> >*>(optM)); 00118 break; 00119 case gurls::OptMatrixBase::ULONG: 00120 ar & *(static_cast<gurls::OptMatrix<gurls::BigArray<unsigned long> >*>(optM)); 00121 break; 00122 default: 00123 throw gurls::gException(gurls::Exception_Unsupported_MatrixType); 00124 } 00125 } 00126 else 00127 #endif 00128 { 00129 switch(matType) 00130 { 00131 case gurls::OptMatrixBase::FLOAT: 00132 ar & *(static_cast<gurls::OptMatrix<gurls::gMat2D<float> >*>(optM)); 00133 break; 00134 case gurls::OptMatrixBase::DOUBLE: 00135 ar & *(static_cast<gurls::OptMatrix<gurls::gMat2D<double> >*>(optM)); 00136 break; 00137 case gurls::OptMatrixBase::ULONG: 00138 ar & *(static_cast<gurls::OptMatrix<gurls::gMat2D<unsigned long> >*>(optM)); 00139 break; 00140 default: 00141 throw gurls::gException(gurls::Exception_Unsupported_MatrixType); 00142 } 00143 } 00144 break; 00145 00146 } 00147 case gurls::TaskSequenceOption: 00148 ar & (*static_cast<gurls::OptTaskSequence*>(opt0)); 00149 break; 00150 case gurls::ProcessOption: 00151 ar & (*static_cast<gurls::OptProcess*>(opt0)); 00152 break; 00153 case gurls::OptListOption: 00154 ar & (*static_cast<gurls::GurlsOptionsList*>(opt0)); 00155 break; 00156 case gurls::OptArrayOption: 00157 ar & (*static_cast<gurls::OptArray*>(opt0)); 00158 break; 00159 default: 00160 throw gurls::gException(gurls::Exception_Unknown_Option); 00161 } 00162 } 00163 } 00164 00168 template<class Archive> 00169 void load(Archive &ar, gurls::OptArray &t, const unsigned int) 00170 { 00171 gurls::OptTypes type; 00172 00173 type = t.getType(); 00174 ar & type; 00175 00176 unsigned long n = 0; 00177 ar & n; 00178 00179 t.clear(); 00180 t.reserve(n); 00181 00182 for (unsigned long i = 0; i<n; ++i) 00183 { 00184 ar & type; 00185 00186 switch(type) 00187 { 00188 00189 case gurls::StringOption: 00190 { 00191 gurls::OptString* opt = new gurls::OptString(); 00192 ar & (*opt); 00193 t.push_back(opt); 00194 break; 00195 } 00196 case gurls::StringListOption: 00197 { 00198 gurls::OptStringList* opt = new gurls::OptStringList(); 00199 ar & (*opt); 00200 t.push_back(opt); 00201 break; 00202 } 00203 case gurls::NumberOption: 00204 { 00205 gurls::OptNumber* opt = new gurls::OptNumber(); 00206 ar & (*opt); 00207 t.push_back(opt); 00208 break; 00209 } 00210 case gurls::NumberListOption: 00211 { 00212 gurls::OptNumberList* opt = new gurls::OptNumberList(); 00213 ar & (*opt); 00214 t.push_back(opt); 00215 break; 00216 } 00217 case gurls::FunctionOption: 00218 { 00219 gurls::OptFunction* opt = new gurls::OptFunction(); 00220 ar & (*opt); 00221 t.push_back(opt); 00222 break; 00223 } 00224 case gurls::MatrixOption: 00225 { 00226 00227 gurls::OptMatrixBase::MatrixType matType; 00228 ar & matType; 00229 00230 gurls::OptMatrixBase* opt; 00231 00232 #ifdef _BGURLS 00233 00234 bool bigArray; 00235 ar & bigArray; 00236 00237 if(bigArray) 00238 { 00239 switch(matType) 00240 { 00241 case gurls::OptMatrixBase::FLOAT: 00242 opt = new gurls::OptMatrix<gurls::BigArray<float> >(); 00243 ar & *(static_cast<gurls::OptMatrix<gurls::BigArray<float> >*>(opt)); 00244 break; 00245 case gurls::OptMatrixBase::DOUBLE: 00246 opt = new gurls::OptMatrix<gurls::BigArray<double> >(); 00247 ar & *(static_cast<gurls::OptMatrix<gurls::BigArray<double> >*>(opt)); 00248 break; 00249 case gurls::OptMatrixBase::ULONG: 00250 opt = new gurls::OptMatrix<gurls::BigArray<unsigned long> >(); 00251 ar & *(static_cast<gurls::OptMatrix<gurls::BigArray<unsigned long> >*>(opt)); 00252 break; 00253 default: 00254 throw gurls::gException(gurls::Exception_Unsupported_MatrixType); 00255 } 00256 } 00257 else 00258 #endif 00259 { 00260 switch(matType) 00261 { 00262 case gurls::OptMatrixBase::FLOAT: 00263 opt = new gurls::OptMatrix<gurls::gMat2D<float> >(); 00264 ar & *(static_cast<gurls::OptMatrix<gurls::gMat2D<float> >*>(opt)); 00265 break; 00266 case gurls::OptMatrixBase::DOUBLE: 00267 opt = new gurls::OptMatrix<gurls::gMat2D<double> >(); 00268 ar & *(static_cast<gurls::OptMatrix<gurls::gMat2D<double> >*>(opt)); 00269 break; 00270 case gurls::OptMatrixBase::ULONG: 00271 opt = new gurls::OptMatrix<gurls::gMat2D<unsigned long> >(); 00272 ar & *(static_cast<gurls::OptMatrix<gurls::gMat2D<unsigned long> >*>(opt)); 00273 break; 00274 default: 00275 throw gurls::gException(gurls::Exception_Unsupported_MatrixType); 00276 } 00277 } 00278 00279 t.push_back(opt); 00280 break; 00281 00282 } 00283 case gurls::TaskSequenceOption: 00284 { 00285 gurls::OptTaskSequence* opt = new gurls::OptTaskSequence(); 00286 ar & (*opt); 00287 t.push_back(opt); 00288 break; 00289 } 00290 case gurls::ProcessOption: 00291 { 00292 gurls::OptProcess* opt = new gurls::OptProcess(); 00293 ar & (*opt); 00294 t.push_back(opt); 00295 break; 00296 } 00297 case gurls::OptListOption: 00298 { 00299 gurls::GurlsOptionsList* opt = new gurls::GurlsOptionsList("", false); 00300 ar & (*opt); 00301 t.push_back(opt); 00302 break; 00303 } 00304 case gurls::OptArrayOption: 00305 { 00306 gurls::OptArray* opt = new gurls::OptArray(); 00307 ar & (*opt); 00308 t.push_back(opt); 00309 break; 00310 } 00311 default: 00312 throw gurls::gException(gurls::Exception_Unknown_Option); 00313 00314 } 00315 } 00316 } 00317 00318 00319 00323 template<class Archive> 00324 void save(Archive & ar, const gurls::GurlsOptionsList& opt, const unsigned int /* file_version */) 00325 { 00326 gurls::OptTypes type; 00327 00328 type = opt.getType(); 00329 ar & type; 00330 00331 std::string name = opt.getName(); 00332 ar & name; 00333 00334 int n = opt.size(); 00335 ar & n; 00336 00337 typedef gurls::GurlsOptionsList::ValueType ValueType; 00338 const ValueType& value = opt.getValue(); 00339 00340 for (ValueType::const_iterator it = value.begin(); it != value.end(); ++it) 00341 { 00342 name = it->first; 00343 ar & name; 00344 00345 gurls::GurlsOption* opt0 = it->second; 00346 type = opt0->getType(); 00347 ar & type; 00348 00349 00350 switch(type) 00351 { 00352 case gurls::StringOption: 00353 ar & (*static_cast<gurls::OptString*>(opt0)); 00354 break; 00355 case gurls::StringListOption: 00356 ar & (*static_cast<gurls::OptStringList*>(opt0)); 00357 break; 00358 case gurls::NumberOption: 00359 ar & (*static_cast<gurls::OptNumber*>(opt0)); 00360 break; 00361 case gurls::NumberListOption: 00362 ar & (*static_cast<gurls::OptNumberList*>(opt0)); 00363 break; 00364 case gurls::FunctionOption: 00365 ar & (*static_cast<gurls::OptFunction*>(opt0)); 00366 break; 00367 case gurls::MatrixOption: 00368 { 00369 gurls::OptMatrixBase* optM = static_cast<gurls::OptMatrixBase*>(opt0); 00370 gurls::OptMatrixBase::MatrixType matType = optM->getMatrixType(); 00371 00372 ar & matType; 00373 00374 #ifdef _BGURLS 00375 00376 bool bigArray = optM->hasBigArray(); 00377 ar & bigArray; 00378 00379 if(bigArray) 00380 { 00381 switch(matType) 00382 { 00383 case gurls::OptMatrixBase::FLOAT: 00384 ar & *(static_cast<gurls::OptMatrix<gurls::BigArray<float> >*>(optM)); 00385 break; 00386 case gurls::OptMatrixBase::DOUBLE: 00387 ar & *(static_cast<gurls::OptMatrix<gurls::BigArray<double> >*>(optM)); 00388 break; 00389 case gurls::OptMatrixBase::ULONG: 00390 ar & *(static_cast<gurls::OptMatrix<gurls::BigArray<unsigned long> >*>(optM)); 00391 break; 00392 default: 00393 throw gurls::gException(gurls::Exception_Unsupported_MatrixType); 00394 } 00395 } 00396 else 00397 #endif 00398 { 00399 switch(matType) 00400 { 00401 case gurls::OptMatrixBase::FLOAT: 00402 ar & *(static_cast<gurls::OptMatrix<gurls::gMat2D<float> >*>(optM)); 00403 break; 00404 case gurls::OptMatrixBase::DOUBLE: 00405 ar & *(static_cast<gurls::OptMatrix<gurls::gMat2D<double> >*>(optM)); 00406 break; 00407 case gurls::OptMatrixBase::ULONG: 00408 ar & *(static_cast<gurls::OptMatrix<gurls::gMat2D<unsigned long> >*>(optM)); 00409 break; 00410 default: 00411 throw gurls::gException(gurls::Exception_Unsupported_MatrixType); 00412 } 00413 } 00414 00415 break; 00416 00417 } 00418 case gurls::TaskSequenceOption: 00419 ar & (*static_cast<gurls::OptTaskSequence*>(opt0)); 00420 break; 00421 case gurls::ProcessOption: 00422 ar & (*static_cast<gurls::OptProcess*>(opt0)); 00423 break; 00424 case gurls::OptListOption: 00425 ar & (*static_cast<gurls::GurlsOptionsList*>(opt0)); 00426 break; 00427 case gurls::OptArrayOption: 00428 ar & (*static_cast<gurls::OptArray*>(opt0)); 00429 break; 00430 default: 00431 throw gurls::gException(gurls::Exception_Unknown_Option); 00432 } 00433 } 00434 } 00435 00439 template<class Archive> 00440 void load(Archive & ar, gurls::GurlsOptionsList& opt, const unsigned int /* file_version */) 00441 { 00442 gurls::OptTypes type; 00443 std::string name; 00444 00445 ar & type; 00446 ar & name; 00447 00448 opt.setName(name); 00449 opt.removeOpt("Name"); 00450 00451 int n = 0; 00452 ar & n; 00453 00454 for (int i = 0; i<n; ++i) 00455 { 00456 ar & name; 00457 ar & type; 00458 00459 switch(type) 00460 { 00461 00462 case gurls::StringOption: 00463 { 00464 gurls::OptString* tmp = new gurls::OptString(); 00465 ar & (*tmp); 00466 opt.addOpt(name, tmp); 00467 break; 00468 } 00469 case gurls::StringListOption: 00470 { 00471 gurls::OptStringList* tmp = new gurls::OptStringList(); 00472 ar & (*tmp); 00473 opt.addOpt(name, tmp); 00474 break; 00475 } 00476 case gurls::NumberOption: 00477 { 00478 gurls::OptNumber* tmp = new gurls::OptNumber(); 00479 ar & (*tmp); 00480 opt.addOpt(name, tmp); 00481 break; 00482 } 00483 case gurls::NumberListOption: 00484 { 00485 gurls::OptNumberList* tmp = new gurls::OptNumberList(); 00486 ar & (*tmp); 00487 opt.addOpt(name, tmp); 00488 break; 00489 } 00490 case gurls::FunctionOption: 00491 { 00492 gurls::OptFunction* tmp = new gurls::OptFunction(); 00493 ar & (*tmp); 00494 opt.addOpt(name, tmp); 00495 break; 00496 } 00497 case gurls::MatrixOption: 00498 { 00499 00500 gurls::OptMatrixBase::MatrixType matType; 00501 ar & matType; 00502 00503 gurls::OptMatrixBase* tmp; 00504 00505 #ifdef _BGURLS 00506 00507 bool bigArray; 00508 ar & bigArray; 00509 00510 if(bigArray) 00511 { 00512 switch(matType) 00513 { 00514 case gurls::OptMatrixBase::FLOAT: 00515 tmp = new gurls::OptMatrix<gurls::BigArray<float> >(); 00516 ar & *(static_cast<gurls::OptMatrix<gurls::BigArray<float> >*>(tmp)); 00517 break; 00518 case gurls::OptMatrixBase::DOUBLE: 00519 tmp = new gurls::OptMatrix<gurls::BigArray<double> >(); 00520 ar & *(static_cast<gurls::OptMatrix<gurls::BigArray<double> >*>(tmp)); 00521 break; 00522 case gurls::OptMatrixBase::ULONG: 00523 tmp = new gurls::OptMatrix<gurls::BigArray<unsigned long> >(); 00524 ar & *(static_cast<gurls::OptMatrix<gurls::BigArray<unsigned long> >*>(tmp)); 00525 break; 00526 default: 00527 throw gurls::gException(gurls::Exception_Unsupported_MatrixType); 00528 } 00529 } 00530 else 00531 #endif 00532 { 00533 switch(matType) 00534 { 00535 case gurls::OptMatrixBase::FLOAT: 00536 tmp = new gurls::OptMatrix<gurls::gMat2D<float> >(); 00537 ar & *(static_cast<gurls::OptMatrix<gurls::gMat2D<float> >*>(tmp)); 00538 break; 00539 case gurls::OptMatrixBase::DOUBLE: 00540 tmp = new gurls::OptMatrix<gurls::gMat2D<double> >(); 00541 ar & *(static_cast<gurls::OptMatrix<gurls::gMat2D<double> >*>(tmp)); 00542 break; 00543 case gurls::OptMatrixBase::ULONG: 00544 tmp = new gurls::OptMatrix<gurls::gMat2D<unsigned long> >(); 00545 ar & *(static_cast<gurls::OptMatrix<gurls::gMat2D<unsigned long> >*>(tmp)); 00546 break; 00547 default: 00548 throw gurls::gException(gurls::Exception_Unsupported_MatrixType); 00549 } 00550 } 00551 00552 opt.addOpt(name, tmp); 00553 break; 00554 00555 } 00556 case gurls::TaskSequenceOption: 00557 { 00558 gurls::OptTaskSequence* tmp = new gurls::OptTaskSequence(); 00559 ar & (*tmp); 00560 opt.addOpt(name, tmp); 00561 break; 00562 } 00563 case gurls::ProcessOption: 00564 { 00565 gurls::OptProcess* tmp = new gurls::OptProcess(); 00566 ar & (*tmp); 00567 opt.addOpt(name, tmp); 00568 break; 00569 } 00570 case gurls::OptListOption: 00571 { 00572 gurls::GurlsOptionsList* tmp = new gurls::GurlsOptionsList("", false); 00573 ar & (*tmp); 00574 opt.addOpt(name, tmp); 00575 break; 00576 } 00577 case gurls::OptArrayOption: 00578 { 00579 gurls::OptArray* tmp = new gurls::OptArray(); 00580 ar & (*tmp); 00581 opt.addOpt(name, tmp); 00582 break; 00583 } 00584 default: 00585 throw gurls::gException(gurls::Exception_Unknown_Option); 00586 00587 } 00588 } 00589 00590 opt.setName(opt.getName()); 00591 } 00592 00593 00594 00598 template<class Archive> 00599 void save(Archive & ar, const gurls::OptFunction& opt, const unsigned int /* file_version */) 00600 { 00601 gurls::OptTypes type = opt.getType(); 00602 ar & type; 00603 00604 std::string name = opt.getName(); 00605 ar & name; 00606 } 00607 00611 template<class Archive> 00612 void load(Archive & ar, gurls::OptFunction& opt, const unsigned int /* file_version */) 00613 { 00614 gurls::OptTypes type; 00615 ar & type; 00616 00617 std::string name; 00618 ar & name; 00619 00620 opt = gurls::OptFunction(name); 00621 } 00622 00623 00624 00625 template<class Archive, class OptType> 00626 inline void serialize_opt( Archive& ar, OptType& opt, const unsigned int /*file_version*/) 00627 { 00628 gurls::OptTypes type = opt.getType(); 00629 ar & type; 00630 00631 typename OptType::ValueType& value = opt.getValue(); 00632 ar & value; 00633 } 00634 00635 template<class Archive, class OptType> 00636 void save_vector_opt(Archive & ar, const OptType& opt, const unsigned int /* file_version */) 00637 { 00638 gurls::OptTypes type = opt.getType(); 00639 ar & type; 00640 00641 const typename OptType::ValueType& value = opt.getValue(); 00642 00643 int n = value.size(); 00644 ar & n; 00645 00646 for (int i = 0; i < n; ++i) 00647 ar & value[i]; 00648 } 00649 00650 template<class Archive, class OptType> 00651 void load_vector_opt(Archive & ar, OptType& opt, const unsigned int /* file_version */) 00652 { 00653 gurls::OptTypes type = opt.getType(); 00654 ar & type; 00655 00656 int n = 0; 00657 ar & n; 00658 00659 opt.clear(); 00660 00661 typedef typename OptType::ValueType ValueType; 00662 typename ValueType::value_type tmp; 00663 00664 for(int i = 0; i < n; ++i) 00665 { 00666 ar & tmp; 00667 opt << tmp; 00668 } 00669 00670 // typedef typename OptType::ValueType ValueType; 00671 // ValueType value; 00672 00673 // typename ValueType::value_type tmp; 00674 00675 // for(int i = 0; i < n; ++i) 00676 // { 00677 // ar & tmp; 00678 // value.push_back(tmp); 00679 // } 00680 00681 // opt.setValue(value); 00682 } 00683 00684 00688 template<class Archive, typename T> 00689 inline void serialize(Archive& ar, gurls::OptMatrix<gurls::gMat2D<T> >& opt, const unsigned int file_version) 00690 { 00691 serialize_opt<Archive, gurls::OptMatrix<gurls::gMat2D<T> > >(ar, opt, file_version); 00692 } 00693 00694 #ifdef _BGURLS 00695 00698 template<class Archive, typename T> 00699 inline void serialize(Archive& ar, gurls::OptMatrix<gurls::BigArray<T> >& opt, const unsigned int file_version) 00700 { 00701 serialize_opt<Archive, gurls::OptMatrix<gurls::BigArray<T> > >(ar, opt, file_version); 00702 } 00703 #endif 00704 00708 template<class Archive> 00709 void serialize(Archive& ar, gurls::OptString& opt, const unsigned int file_version) 00710 { 00711 serialize_opt<Archive, gurls::OptString>(ar, opt, file_version); 00712 } 00713 00714 00715 00719 template<class Archive> 00720 void save(Archive & ar, const gurls::OptStringList& opt, const unsigned int file_version) 00721 { 00722 save_vector_opt<Archive, gurls::OptStringList>(ar, opt, file_version); 00723 } 00724 00728 template<class Archive> 00729 void load(Archive & ar, gurls::OptStringList& opt, const unsigned int file_version ) 00730 { 00731 load_vector_opt<Archive, gurls::OptStringList>(ar, opt, file_version); 00732 } 00733 00734 00738 template<class Archive> 00739 void serialize(Archive & ar, gurls::OptNumber& opt, const unsigned int file_version) 00740 { 00741 serialize_opt<Archive, gurls::OptNumber>(ar, opt, file_version); 00742 } 00743 00744 00748 template<class Archive> 00749 void save(Archive & ar, const gurls::OptNumberList& opt, const unsigned int file_version) 00750 { 00751 save_vector_opt<Archive, gurls::OptNumberList>(ar, opt, file_version); 00752 } 00753 00757 template<class Archive> 00758 void load(Archive & ar, gurls::OptNumberList& opt, const unsigned int file_version) 00759 { 00760 load_vector_opt<Archive, gurls::OptNumberList>(ar, opt, file_version); 00761 } 00762 00763 00767 template<class Archive> 00768 void save(Archive & ar, const gurls::OptTaskSequence& opt, const unsigned int file_version) 00769 { 00770 save_vector_opt<Archive, gurls::OptTaskSequence>(ar, opt, file_version); 00771 } 00772 00776 template<class Archive> 00777 void load(Archive & ar, gurls::OptTaskSequence& opt, const unsigned int file_version) 00778 { 00779 load_vector_opt<Archive, gurls::OptTaskSequence>(ar, opt, file_version); 00780 } 00781 00782 00786 template<class Archive> 00787 void save(Archive & ar, const gurls::OptProcess& opt, const unsigned int file_version) 00788 { 00789 save_vector_opt<Archive, gurls::OptProcess>(ar, opt, file_version); 00790 } 00791 00795 template<class Archive> 00796 void load(Archive & ar, gurls::OptProcess& opt, const unsigned int file_version) 00797 { 00798 load_vector_opt<Archive, gurls::OptProcess>(ar, opt, file_version); 00799 } 00800 00801 } // namespace serialization 00802 } // namespace boost 00803 00804 BOOST_SERIALIZATION_SPLIT_FREE(gurls::OptArray) 00805 BOOST_SERIALIZATION_SPLIT_FREE(gurls::GurlsOptionsList) 00806 BOOST_SERIALIZATION_SPLIT_FREE(gurls::OptFunction) 00807 BOOST_SERIALIZATION_SPLIT_FREE(gurls::OptStringList) 00808 BOOST_SERIALIZATION_SPLIT_FREE(gurls::OptNumberList) 00809 BOOST_SERIALIZATION_SPLIT_FREE(gurls::OptTaskSequence) 00810 BOOST_SERIALIZATION_SPLIT_FREE(gurls::OptProcess) 00811 00812 00813 #endif // _GURLS_OPTSERIALIZATION_H_