Lunchbox  1.4.0
serializable.h
00001 
00002 /* Copyright (c) 2012, EPFL/Blue Brain Project
00003  *                     Daniel Nachbaur <daniel.nachbaur@epfl.ch>
00004  *
00005  * This file is part of Lunchbox <https://github.com/BlueBrain/Lunchbox>
00006  *
00007  * This library is free software; you can redistribute it and/or modify it under
00008  * the terms of the GNU Lesser General Public License version 3.0 as published
00009  * by the Free Software Foundation.
00010  *  
00011  * This library is distributed in the hope that it will be useful, but WITHOUT
00012  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00013  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00014  * details.
00015  * 
00016  * You should have received a copy of the GNU Lesser General Public License
00017  * along with this library; if not, write to the Free Software Foundation, Inc.,
00018  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00019  */
00020 
00021 #ifndef LUNCHBOX_SERIALIZABLE_H
00022 #define LUNCHBOX_SERIALIZABLE_H
00023 
00024 #include <lunchbox/defines.h>
00025 #ifdef LUNCHBOX_USE_BOOST
00026 
00027 #  include <boost/serialization/access.hpp>
00028 #  include <boost/serialization/split_member.hpp>
00029 
00031 #  define LB_SERIALIZABLE                                       \
00032     friend class boost::serialization::access;                  \
00033     template< class Archive >                                   \
00034     void save( Archive& ar, const unsigned int version ) const; \
00035     template< class Archive >                                   \
00036     void load( Archive& ar, const unsigned int version );       \
00037     BOOST_SERIALIZATION_SPLIT_MEMBER()
00038 
00039 #else
00040 #  define LB_SERIALIZABLE
00041 #endif
00042 
00043 #endif // LUNCHBOX_SERIALIZABLE_H