ALPSCore reference
shared_array.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1998-2018 ALPS Collaboration. See COPYRIGHT.TXT
3  * All rights reserved. Use is subject to license terms. See LICENSE.TXT
4  * For use in publications, see ACKNOWLEDGE.TXT
5  */
6 
7 #ifndef ALPS_HDF5_BOOST_SHARED_ARRAY_HPP
8 #define ALPS_HDF5_BOOST_SHARED_ARRAY_HPP
9 
10 #include <alps/hdf5/archive.hpp>
11 
12 #include <boost/shared_array.hpp>
13 
14 namespace alps {
15 
16  #define ALPS_HDF5_BOOST_SHARED_ARRAY_MAKE_PVP(ptr_type, arg_type) \
17  template <typename T> hdf5::detail::make_pvp_proxy<std::pair<ptr_type, std::vector<std::size_t> > > make_pvp( \
18  std::string const & path \
19  , arg_type value \
20  , std::size_t size \
21  ) { \
22  return hdf5::detail::make_pvp_proxy<std::pair<ptr_type, std::vector<std::size_t> > >( \
23  path \
24  , std::make_pair(value.get(), std::vector<std::size_t>(1, size)) \
25  ); \
26  } \
27  \
28  template <typename T> hdf5::detail::make_pvp_proxy<std::pair<ptr_type, std::vector<std::size_t> > > make_pvp( \
29  std::string const & path \
30  , arg_type value \
31  , std::vector<std::size_t> const & size \
32  ) { \
33  return hdf5::detail::make_pvp_proxy<std::pair<ptr_type, std::vector<std::size_t> > >(path, std::make_pair(value.get(), size)); \
34  }
35  ALPS_HDF5_BOOST_SHARED_ARRAY_MAKE_PVP(T *, boost::shared_array<T> &)
36  ALPS_HDF5_BOOST_SHARED_ARRAY_MAKE_PVP(T const *, boost::shared_array<T> const &)
37  #undef ALPS_HDF5_BOOST_SHARED_ARRAY_MAKE_PVP
38 
39 }
40 
41 #endif
#define ALPS_HDF5_BOOST_SHARED_ARRAY_MAKE_PVP(ptr_type, arg_type)