cleanup
[libt2n] / src / t2n_exception.cpp
CommitLineData
7087e187
GE
1/***************************************************************************
2 * Copyright (C) 2006 by Gerd v. Egidy *
3 * gve@intra2net.com *
4 * *
5 * This library is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU Lesser General Public License version *
7 * 2.1 as published by the Free Software Foundation. *
8 * *
9 * This library is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU Lesser General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU Lesser General Public *
15 * License along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
18 ***************************************************************************/
19
e453407d
GE
20#include <boost/archive/binary_oarchive.hpp>
21#include <boost/archive/binary_iarchive.hpp>
22#include <boost/archive/xml_oarchive.hpp>
23#include <boost/archive/xml_iarchive.hpp>
24
7087e187 25#include "t2n_exception.hxx"
e453407d 26
d184c648 27#include <boost/serialization/export.hpp>
7087e187
GE
28
29BOOST_CLASS_EXPORT(libt2n::t2n_exception)
30BOOST_CLASS_EXPORT(libt2n::t2n_communication_error)
31BOOST_CLASS_EXPORT(libt2n::t2n_connect_error)
32BOOST_CLASS_EXPORT(libt2n::t2n_server_error)
33BOOST_CLASS_EXPORT(libt2n::t2n_transfer_error)
34BOOST_CLASS_EXPORT(libt2n::t2n_version_mismatch)
35BOOST_CLASS_EXPORT(libt2n::t2n_command_error)
36BOOST_CLASS_EXPORT(libt2n::t2n_serialization_error)
37BOOST_CLASS_EXPORT(libt2n::t2n_runtime_error)
e453407d
GE
38
39namespace libt2n
40{
41
42template<class Archive>
43void t2n_exception::serialize(Archive & ar, const unsigned int version)
44{
45 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(exception);
46 ar & BOOST_SERIALIZATION_NVP(message);
47}
48
49template<class Archive>
50void t2n_communication_error::serialize(Archive & ar, const unsigned int version)
51{
52 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(t2n_exception);
53}
54
55template<class Archive>
56void t2n_connect_error::serialize(Archive & ar, const unsigned int version)
57{
58 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(t2n_communication_error);
59}
60
61template<class Archive>
62void t2n_server_error::serialize(Archive & ar, const unsigned int version)
63{
64 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(t2n_communication_error);
65}
66
67template<class Archive>
68void t2n_transfer_error::serialize(Archive & ar, const unsigned int version)
69{
70 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(t2n_communication_error);
71}
72
73template<class Archive>
74void t2n_version_mismatch::serialize(Archive & ar, const unsigned int version)
75{
76 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(t2n_communication_error);
77}
78
79template<class Archive>
80void t2n_command_error::serialize(Archive & ar, const unsigned int version)
81{
82 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(t2n_exception);
83}
84
85template<class Archive>
86void t2n_serialization_error::serialize(Archive & ar, const unsigned int version)
87{
88 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(t2n_exception);
89}
90
91template<class Archive>
92void t2n_runtime_error::serialize(Archive & ar, const unsigned int version)
93{
94 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(t2n_exception);
95}
96
97} // namespace libt2n