From a7079c7f92e60ac66d193a6e8622d2b2f0d77ea9 Mon Sep 17 00:00:00 2001 From: Raphael Dumusc Date: Tue, 20 Sep 2016 17:07:17 +0200 Subject: [PATCH] Removed boost::serialization that was used exclusively by Tide --- CMakeLists.txt | 8 +-- deflect/Frame.h | 18 ++----- deflect/Segment.h | 37 +------------ deflect/SegmentParameters.h | 22 ++------ doc/Changelog.md | 2 + tests/cpp/SegmentParametersTests.cpp | 80 ---------------------------- 6 files changed, 14 insertions(+), 153 deletions(-) delete mode 100644 tests/cpp/SegmentParametersTests.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 358e044..d264d5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,15 +17,15 @@ set(DEFLECT_LICENSE BSD) set(DEFLECT_DEPENDENT_LIBRARIES Boost) set(DEFLECT_DEB_DEPENDS freeglut3-dev libxi-dev libxmu-dev libjpeg-turbo8-dev libturbojpeg - libboost-date-time-dev libboost-program-options-dev libboost-serialization-dev - libboost-system-dev libboost-test-dev libboost-thread-dev + libboost-date-time-dev libboost-program-options-dev libboost-system-dev + libboost-test-dev libboost-thread-dev qtbase5-dev qtdeclarative5-dev) set(DEFLECT_PORT_DEPENDS boost freeglut qt5) include(Common) -common_find_package(Boost REQUIRED COMPONENTS date_time program_options - serialization system thread unit_test_framework) +common_find_package(Boost REQUIRED COMPONENTS date_time program_options system + thread unit_test_framework) common_find_package(GLUT) common_find_package(LibJpegTurbo REQUIRED) common_find_package(OpenGL) diff --git a/deflect/Frame.h b/deflect/Frame.h index 6cd3667..f7fb3e9 100644 --- a/deflect/Frame.h +++ b/deflect/Frame.h @@ -1,6 +1,6 @@ /*********************************************************************/ -/* Copyright (c) 2014, EPFL/Blue Brain Project */ -/* Raphael Dumusc */ +/* Copyright (c) 2014-2016, EPFL/Blue Brain Project */ +/* Raphael Dumusc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or */ @@ -44,10 +44,8 @@ #include #include -#include #include -#include -#include +#include namespace deflect { @@ -66,16 +64,6 @@ class Frame /** Get the total dimensions of this frame. */ DEFLECT_API QSize computeDimensions() const; - -private: - friend class boost::serialization::access; - - template - void serialize( Archive & ar, const unsigned int ) - { - ar & segments; - ar & uri; - } }; } diff --git a/deflect/Segment.h b/deflect/Segment.h index e776a79..40220b6 100644 --- a/deflect/Segment.h +++ b/deflect/Segment.h @@ -1,6 +1,6 @@ /*********************************************************************/ -/* Copyright (c) 2013, EPFL/Blue Brain Project */ -/* Raphael Dumusc */ +/* Copyright (c) 2013-2016, EPFL/Blue Brain Project */ +/* Raphael Dumusc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or */ @@ -42,9 +42,6 @@ #include -#include -#include - #include namespace deflect @@ -65,36 +62,6 @@ struct Segment /** @internal raw, uncompressed source image, used for compression */ const ImageWrapper* sourceImage; - -private: - friend class boost::serialization::access; - - template - void save( Archive & ar, const unsigned int ) const - { - ar & parameters; - - int size = imageData.size(); - ar & size; - - ar & boost::serialization::make_binary_object( (void*)imageData.data(), - imageData.size( )); - } - - template - void load( Archive & ar, const unsigned int ) - { - ar & parameters; - - int size = 0; - ar & size; - imageData.resize( size ); - - ar & boost::serialization::make_binary_object( (void*)imageData.data(), - size ); - } - - BOOST_SERIALIZATION_SPLIT_MEMBER() }; } diff --git a/deflect/SegmentParameters.h b/deflect/SegmentParameters.h index f4d72a7..e8d7ec6 100644 --- a/deflect/SegmentParameters.h +++ b/deflect/SegmentParameters.h @@ -1,5 +1,6 @@ /*********************************************************************/ -/* Copyright (c) 2011 - 2012, The University of Texas at Austin. */ +/* Copyright (c) 2013-2016, EPFL/Blue Brain Project */ +/* Raphael Dumusc */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or */ @@ -45,8 +46,6 @@ #include #endif -#include - namespace deflect { @@ -77,22 +76,7 @@ struct SegmentParameters , width( 0 ) , height( 0 ) , compressed( true ) - { - } - -private: - friend class boost::serialization::access; - - /** Serialization method */ - template - void serialize( Archive & ar, const unsigned int ) - { - ar & x; - ar & y; - ar & width; - ar & height; - ar & compressed; - } + {} }; } diff --git a/doc/Changelog.md b/doc/Changelog.md index fd43e82..8c6be9b 100644 --- a/doc/Changelog.md +++ b/doc/Changelog.md @@ -5,6 +5,8 @@ Changelog {#Changelog} ### 0.12.0 (git master) +* [129](https://github.com/BlueBrain/Deflect/pull/129) + Cleared Deflect from boost::serialization that was used exclusively by Tide. * [128](https://github.com/BlueBrain/Deflect/pull/128) New events for transmitting all touch points in addition to existing gestures: - Gives the ability to handle more than one touch point in applications (e.g. diff --git a/tests/cpp/SegmentParametersTests.cpp b/tests/cpp/SegmentParametersTests.cpp deleted file mode 100644 index d61e9c3..0000000 --- a/tests/cpp/SegmentParametersTests.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/*********************************************************************/ -/* Copyright (c) 2013, EPFL/Blue Brain Project */ -/* Raphael Dumusc */ -/* All rights reserved. */ -/* */ -/* Redistribution and use in source and binary forms, with or */ -/* without modification, are permitted provided that the following */ -/* conditions are met: */ -/* */ -/* 1. Redistributions of source code must retain the above */ -/* copyright notice, this list of conditions and the following */ -/* disclaimer. */ -/* */ -/* 2. Redistributions in binary form must reproduce the above */ -/* copyright notice, this list of conditions and the following */ -/* disclaimer in the documentation and/or other materials */ -/* provided with the distribution. */ -/* */ -/* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF TEXAS AT */ -/* AUSTIN ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, */ -/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ -/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */ -/* DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF TEXAS AT */ -/* AUSTIN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */ -/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */ -/* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE */ -/* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR */ -/* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ -/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ -/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT */ -/* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */ -/* POSSIBILITY OF SUCH DAMAGE. */ -/* */ -/* The views and conclusions contained in the software and */ -/* documentation are those of the authors and should not be */ -/* interpreted as representing official policies, either expressed */ -/* or implied, of The University of Texas at Austin. */ -/*********************************************************************/ - -#define BOOST_TEST_MODULE SegmentParametersTests -#include -namespace ut = boost::unit_test; - -#include - -#include -#include -#include - -BOOST_AUTO_TEST_CASE( testSegementParametersSerialization ) -{ - deflect::SegmentParameters params; - params.x = 212; - params.y = 365; - params.height = 32; - params.width = 78; - params.compressed = false; - - - // serialize - std::stringstream stream; - { - boost::archive::binary_oarchive oa( stream ); - oa << params; - } - - // deserialize - deflect::SegmentParameters paramsDeserialized; - { - boost::archive::binary_iarchive ia( stream ); - ia >> paramsDeserialized; - } - - BOOST_CHECK_EQUAL( params.x, paramsDeserialized.x ); - BOOST_CHECK_EQUAL( params.y, paramsDeserialized.y ); - BOOST_CHECK_EQUAL( params.height, paramsDeserialized.height ); - BOOST_CHECK_EQUAL( params.width, paramsDeserialized.width ); - BOOST_CHECK_EQUAL( params.compressed, paramsDeserialized.compressed ); -} -