KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sample_serialization.h
Go to the documentation of this file.
1 /* $Id: sample_serialization.h 17393 2014-08-23 20:19:14Z predoehl $ */
2 /* {{{=========================================================================== *
3  |
4  | Copyright (c) 1994-2010 by Kobus Barnard (author)
5  |
6  | Personal and educational use of this code is granted, provided that this
7  | header is kept intact, and that the authorship is not misrepresented, that
8  | its use is acknowledged in publications, and relevant papers are cited.
9  |
10  | For other use contact the author (kobus AT cs DOT arizona DOT edu).
11  |
12  | Please note that the code in this file has not necessarily been adequately
13  | tested. Naturally, there is no guarantee of performance, support, or fitness
14  | for any particular task. Nonetheless, I am interested in hearing about
15  | problems that you encounter.
16  |
17  | Author: Kyle Simek
18  * =========================================================================== }}}*/
19 
20 // vim: tabstop=4 shiftwidth=4 foldmethod=marker
21 
22 #ifndef KJB_CPP_SAMPLER_SERIALIZATION_H
23 #define KJB_CPP_SAMPLER_SERIALIZATION_H
24 
25 
26 #include <sample_cpp/sample_base.h>
27 
28 // KJB DEPENDENCY
29 #ifdef KJB_HAVE_BST_SERIAL
30 #include <boost/serialization/deque.hpp>
31 
32 namespace boost
33 {
34 namespace serialization
35 {
36 
37 template<class Archive, class Model>
38 void serialize(Archive& ar, Step_result<Model>& obj, const unsigned int version)
39 {
40  // this class is likely to change, so it's important to use the version functionality to handle changes
41  using namespace boost;
42  ar & obj.type;
43  ar & obj.accept;
44  ar & obj.lt;
45 }
46 
47 template<class Archive, class Model>
48 void serialize(Archive& ar, Step_log<Model>& obj, const unsigned int version)
49 {
50  ar & boost::serialization::base_object<std::deque<Step_result<Model> > >(obj);
51 }
52 
53 
54 } // namespace serialization
55 } // namespace boost
56 
57 #endif /* KJB_HAVE_BST_SERIAL */
58 
59 #endif
Structure for returning results of a single sampling move.
Definition: sample_base.h:55
Definition: sample_base.h:160
std::string type
Definition: sample_base.h:95
bool accept
Definition: sample_base.h:100
double lt
Definition: sample_base.h:102