Skip to content

Commit

Permalink
Drop dependencies, replace boost with std, remove includes
Browse files Browse the repository at this point in the history
Drop Boost.SmartPtr dependency
Drop Boost.Utility (Call Traits) dependency
Replace boost::array with std::array
Replace boost::minmax_element with std::minmax_element
Remove unneeded headers of Boost.Tuple and Boost.Algorithm
Include specific headers from Boost.StringAlgo and Boost.Thread
Use auto for iterator types
  • Loading branch information
awulkiew committed Apr 24, 2023
1 parent b1bebca commit 13de371
Show file tree
Hide file tree
Showing 26 changed files with 91 additions and 136 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)

// Copyright (c) 2020-2021 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2023 Adam Wulkiewicz, Lodz, Poland.

// This file was modified by Oracle on 2020-2022.
// Modifications copyright (c) 2020-2022, Oracle and/or its affiliates.
Expand All @@ -14,7 +15,8 @@
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_BUFFER_PIECE_BORDER_HPP


#include <boost/array.hpp>
#include <array>

#include <boost/core/addressof.hpp>

#include <boost/geometry/core/assert.hpp>
Expand Down Expand Up @@ -115,7 +117,7 @@ struct piece_border
// Points from the original (one or two, depending on piece shape)
// Note, if there are 2 points, they are REVERSED w.r.t. the original
// Therefore here we can walk in its order.
boost::array<Point, 2> m_originals;
std::array<Point, 2> m_originals;
std::size_t m_original_size;

geometry::model::box<Point> m_envelope;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)

// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2023 Adam Wulkiewicz, Lodz, Poland.

// This file was modified by Oracle on 2020-2021.
// Modifications copyright (c) 2020-2021, Oracle and/or its affiliates.
Expand All @@ -14,7 +15,8 @@
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_COPY_SEGMENT_POINT_HPP


#include <boost/array.hpp>
#include <array>

#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/size.hpp>
Expand Down Expand Up @@ -113,7 +115,7 @@ struct copy_segment_point_box
SegmentIdentifier const& seg_id, signed_size_type offset,
PointOut& point)
{
boost::array<typename point_type<Box>::type, 4> bp;
std::array<typename point_type<Box>::type, 4> bp;
assign_box_corners_oriented<Reverse>(box, bp);

signed_size_type const target = circular_offset(4, seg_id.segment_index, offset);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)

// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2023 Adam Wulkiewicz, Lodz, Poland.

// This file was modified by Oracle on 2014-2021.
// Modifications copyright (c) 2014-2021 Oracle and/or its affiliates.
Expand All @@ -15,10 +16,10 @@
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_COPY_SEGMENTS_HPP


#include <array>
#include <type_traits>
#include <vector>

#include <boost/array.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/size.hpp>
Expand Down Expand Up @@ -238,7 +239,7 @@ struct copy_segments_box
: 5 - index + to_index + 1;

// Create array of points, the fifth one closes it
boost::array<typename point_type<Box>::type, 5> bp;
std::array<typename point_type<Box>::type, 5> bp;
assign_box_corners_oriented<Reverse>(box, bp);
bp[4] = bp[0];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)

// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2014-2017 Adam Wulkiewicz, Lodz, Poland.
// Copyright (c) 2014-2023 Adam Wulkiewicz, Lodz, Poland.

// This file was modified by Oracle on 2014-2021.
// Modifications copyright (c) 2014-2021 Oracle and/or its affiliates.

// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle

// Use, modification and distribution is subject to the Boost Software License,
Expand All @@ -16,10 +15,10 @@
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_GET_TURNS_HPP


#include <array>
#include <cstddef>
#include <map>

#include <boost/array.hpp>
#include <boost/concept_check.hpp>
#include <boost/core/ignore_unused.hpp>
#include <boost/range/begin.hpp>
Expand Down Expand Up @@ -570,7 +569,7 @@ struct get_turns_cs
{
typedef typename geometry::point_type<Range>::type range_point_type;
typedef typename geometry::point_type<Box>::type box_point_type;
typedef boost::array<box_point_type, 4> box_array;
typedef std::array<box_point_type, 4> box_array;

using view_type = detail::closed_clockwise_view
<
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)

// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2023 Adam Wulkiewicz, Lodz, Poland.

// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
Expand All @@ -10,7 +11,7 @@
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_TURN_INFO_HPP


#include <boost/array.hpp>
#include <array>

#include <boost/geometry/core/coordinate_type.hpp>
#include <boost/geometry/algorithms/detail/signed_size_type.hpp>
Expand Down Expand Up @@ -80,7 +81,7 @@ template
typename Point,
typename SegmentRatio = geometry::segment_ratio<typename coordinate_type<Point>::type>,
typename Operation = turn_operation<Point, SegmentRatio>,
typename Container = boost::array<Operation, 2>
typename Container = std::array<Operation, 2>
>
struct turn_info
{
Expand Down
5 changes: 2 additions & 3 deletions include/boost/geometry/algorithms/detail/relate/result.hpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)

// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
// Copyright (c) 2017-2023 Adam Wulkiewicz, Lodz, Poland.

// This file was modified by Oracle on 2013-2022.
// Modifications copyright (c) 2013-2022 Oracle and/or its affiliates.

// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle

// Use, modification and distribution is subject to the Boost Software License,
Expand All @@ -19,10 +18,10 @@
#include <cstddef>
#include <cstring>
#include <string>
#include <tuple>
#include <type_traits>

#include <boost/throw_exception.hpp>
#include <boost/tuple/tuple.hpp>

#include <boost/geometry/core/assert.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp>
Expand Down
30 changes: 6 additions & 24 deletions include/boost/geometry/arithmetic/arithmetic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// Copyright (c) 2023 Adam Wulkiewicz, Lodz, Poland.

// This file was modified by Oracle on 2021.
// Modifications copyright (c) 2021 Oracle and/or its affiliates.
Expand All @@ -20,7 +21,6 @@

#include <functional>

#include <boost/call_traits.hpp>
#include <boost/concept/requires.hpp>

#include <boost/geometry/core/coordinate_type.hpp>
Expand All @@ -32,24 +32,6 @@
namespace boost { namespace geometry
{

#ifndef DOXYGEN_NO_DETAIL
namespace detail
{


template <typename Point>
struct param
{
typedef typename boost::call_traits
<
typename coordinate_type<Point>::type
>::param_type type;
};


} // namespace detail
#endif // DOXYGEN_NO_DETAIL

/*!
\brief Adds the same value to each coordinate of a point
\ingroup arithmetic
Expand All @@ -59,7 +41,7 @@ struct param
\param value value to add
*/
template <typename Point>
inline void add_value(Point& p, typename detail::param<Point>::type value)
inline void add_value(Point& p, typename coordinate_type<Point>::type const& value)
{
BOOST_CONCEPT_ASSERT( (concepts::Point<Point>) );

Expand Down Expand Up @@ -101,7 +83,7 @@ inline void add_point(Point1& p1, Point2 const& p2)
\param value value to subtract
*/
template <typename Point>
inline void subtract_value(Point& p, typename detail::param<Point>::type value)
inline void subtract_value(Point& p, typename coordinate_type<Point>::type const& value)
{
BOOST_CONCEPT_ASSERT( (concepts::Point<Point>) );

Expand Down Expand Up @@ -143,7 +125,7 @@ inline void subtract_point(Point1& p1, Point2 const& p2)
\param value value to multiply by
*/
template <typename Point>
inline void multiply_value(Point& p, typename detail::param<Point>::type value)
inline void multiply_value(Point& p, typename coordinate_type<Point>::type const& value)
{
BOOST_CONCEPT_ASSERT( (concepts::Point<Point>) );

Expand Down Expand Up @@ -186,7 +168,7 @@ inline void multiply_point(Point1& p1, Point2 const& p2)
\param value value to divide by
*/
template <typename Point>
inline void divide_value(Point& p, typename detail::param<Point>::type value)
inline void divide_value(Point& p, typename coordinate_type<Point>::type const& value)
{
BOOST_CONCEPT_ASSERT( (concepts::Point<Point>) );

Expand Down Expand Up @@ -228,7 +210,7 @@ inline void divide_point(Point1& p1, Point2 const& p2)
\param value value to assign
*/
template <typename Point>
inline void assign_value(Point& p, typename detail::param<Point>::type value)
inline void assign_value(Point& p, typename coordinate_type<Point>::type const& value)
{
BOOST_CONCEPT_ASSERT( (concepts::Point<Point>) );

Expand Down
3 changes: 1 addition & 2 deletions include/boost/geometry/formulas/karney_direct.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Boost.Geometry

// Copyright (c) 2018 Adeel Ahmad, Islamabad, Pakistan.
// Copyright (c) 2023 Adam Wulkiewicz, Lodz, Poland.

// Contributed and/or modified by Adeel Ahmad,
// as part of Google Summer of Code 2018 program.
Expand Down Expand Up @@ -31,8 +32,6 @@
#define BOOST_GEOMETRY_FORMULAS_KARNEY_DIRECT_HPP


#include <boost/array.hpp>

#include <boost/math/constants/constants.hpp>
#include <boost/math/special_functions/hypot.hpp>

Expand Down
6 changes: 3 additions & 3 deletions include/boost/geometry/index/detail/rtree/query_iterators.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// R-tree query iterators
//
// Copyright (c) 2011-2015 Adam Wulkiewicz, Lodz, Poland.
// Copyright (c) 2011-2023 Adam Wulkiewicz, Lodz, Poland.
//
// This file was modified by Oracle on 2019-2021.
// Modifications copyright (c) 2019-2021 Oracle and/or its affiliates.
Expand All @@ -15,7 +15,7 @@
#ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_QUERY_ITERATORS_HPP
#define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_QUERY_ITERATORS_HPP

#include <boost/scoped_ptr.hpp>
#include <memory>

#include <boost/geometry/index/detail/rtree/node/node_elements.hpp>
#include <boost/geometry/index/detail/rtree/visitors/distance_query.hpp>
Expand Down Expand Up @@ -261,7 +261,7 @@ template <typename Value, typename Allocators>
class query_iterator
{
typedef query_iterator_base<Value, Allocators> iterator_base;
typedef boost::scoped_ptr<iterator_base> iterator_ptr;
typedef std::unique_ptr<iterator_base> iterator_ptr;

public:
typedef std::forward_iterator_tag iterator_category;
Expand Down
5 changes: 3 additions & 2 deletions include/boost/geometry/io/svg/svg_mapper.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)

// Copyright (c) 2009-2015 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2023 Adam Wulkiewicz, Lodz, Poland.

// This file was modified by Oracle on 2015-2021.
// Modifications copyright (c) 2015-2020, Oracle and/or its affiliates.
Expand All @@ -18,14 +19,14 @@
#define BOOST_GEOMETRY_IO_SVG_MAPPER_HPP

#include <cstdio>
#include <memory>
#include <type_traits>
#include <vector>

#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/config.hpp>
#include <boost/noncopyable.hpp>
#include <boost/scoped_ptr.hpp>

#include <boost/geometry/core/static_assert.hpp>
#include <boost/geometry/core/tags.hpp>
Expand Down Expand Up @@ -290,7 +291,7 @@ class svg_mapper : boost::noncopyable
> transformer_type;

model::box<Point> m_bounding_box;
boost::scoped_ptr<transformer_type> m_matrix;
std::unique_ptr<transformer_type> m_matrix;
std::ostream& m_stream;

SvgCoordinateType const m_width;
Expand Down
8 changes: 3 additions & 5 deletions include/boost/geometry/io/wkt/read.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
// Copyright (c) 2007-2022 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
// Copyright (c) 2017-2023 Adam Wulkiewicz, Lodz, Poland.
// Copyright (c) 2020 Baidyanath Kundu, Haldia, India

// This file was modified by Oracle on 2014-2021.
// Modifications copyright (c) 2014-2021 Oracle and/or its affiliates.

// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle

// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
Expand All @@ -24,14 +23,13 @@
#include <cstddef>
#include <string>

#include <boost/algorithm/string/predicate.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/tokenizer.hpp>

#include <boost/algorithm/string.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/size.hpp>
#include <boost/range/value_type.hpp>
#include <boost/tokenizer.hpp>
#include <boost/throw_exception.hpp>

#include <boost/geometry/algorithms/assign.hpp>
Expand Down
7 changes: 3 additions & 4 deletions include/boost/geometry/io/wkt/write.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
// Copyright (c) 2007-2022 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2017 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2017 Mateusz Loskot, London, UK.
// Copyright (c) 2014-2017 Adam Wulkiewicz, Lodz, Poland.
// Copyright (c) 2014-2023 Adam Wulkiewicz, Lodz, Poland.
// Copyright (c) 2020 Baidyanath Kundu, Haldia, India.

// This file was modified by Oracle on 2015-2021.
// Modifications copyright (c) 2015-2021, Oracle and/or its affiliates.

// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle

Expand All @@ -22,10 +21,10 @@
#ifndef BOOST_GEOMETRY_IO_WKT_WRITE_HPP
#define BOOST_GEOMETRY_IO_WKT_WRITE_HPP

#include <array>
#include <ostream>
#include <string>

#include <boost/array.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/size.hpp>
Expand Down Expand Up @@ -305,7 +304,7 @@ struct wkt_segment
Segment const& segment, bool)
{
// Convert to two points, then stream
using sequence = boost::array<point_type, 2>;
using sequence = std::array<point_type, 2>;

sequence points;
geometry::detail::assign_point_from_index<0>(segment, points[0]);
Expand Down

0 comments on commit 13de371

Please sign in to comment.