3 // This file was modified by Oracle on 2018.
4 // Modifications copyright (c) 2018, Oracle and/or its affiliates.
5 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
7 // Use, modification and distribution is subject to the Boost Software License,
8 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt)
11 #ifndef BOOST_GEOMETRY_SRS_PROJECTIONS_SHARED_GRIDS_HPP
12 #define BOOST_GEOMETRY_SRS_PROJECTIONS_SHARED_GRIDS_HPP
15 #include <boost/geometry/srs/projections/impl/pj_gridinfo.hpp>
17 #include <boost/thread.hpp>
22 namespace boost { namespace geometry
26 namespace projections { namespace detail
29 // Forward declaration for functions declarations below
32 // Forward declaratios of shared_grids friends
33 template <typename StreamPolicy>
34 inline bool pj_gridlist_merge_gridfile(std::string const& gridname,
35 StreamPolicy const& stream_policy,
37 std::vector<std::size_t> & gridindexes);
38 template <bool Inverse, typename CalcT, typename StreamPolicy, typename Range>
39 inline bool pj_apply_gridshift_3(StreamPolicy const& stream_policy,
42 std::vector<std::size_t> const& gridindexes);
48 std::size_t size() const
50 boost::shared_lock<boost::shared_mutex> lock(mutex);
51 return gridinfo.size();
56 boost::shared_lock<boost::shared_mutex> lock(mutex);
57 return gridinfo.empty();
61 template <typename StreamPolicy>
62 friend inline bool projections::detail::pj_gridlist_merge_gridfile(
63 std::string const& gridname,
64 StreamPolicy const& stream_policy,
66 std::vector<std::size_t> & gridindexes);
67 template <bool Inverse, typename CalcT, typename StreamPolicy, typename Range>
68 friend inline bool projections::detail::pj_apply_gridshift_3(
69 StreamPolicy const& stream_policy,
72 std::vector<std::size_t> const& gridindexes);
74 projections::detail::pj_gridinfo gridinfo;
75 mutable boost::shared_mutex mutex;
78 }} // namespace projections::detail
81 }} // namespace boost::geometry
84 #endif // BOOST_GEOMETRY_SRS_PROJECTIONS_SHARED_GRIDS_HPP