ALPSCore reference
pointer.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_POINTER_HPP
8 #define ALPS_HDF5_POINTER_HPP
9 
10 #include <alps/hdf5/pair.hpp>
11 
12 namespace alps {
13 
14  template <typename T> hdf5::detail::make_pvp_proxy<std::pair<T *, std::vector<std::size_t> > > make_pvp(
15  std::string const & path
16  , T * value
17  , std::size_t size
18  ) {
19  return hdf5::detail::make_pvp_proxy<std::pair<T *, std::vector<std::size_t> > >(
20  path
21  , std::make_pair(value, size > 0
22  ? std::vector<std::size_t>(1, size)
23  : std::vector<std::size_t>()
24  )
25  );
26  }
27 
28  template <typename T> hdf5::detail::make_pvp_proxy<std::pair<T *, std::vector<std::size_t> > > make_pvp(
29  std::string const & path
30  , T * value
31  , std::vector<std::size_t> const & size
32  ) {
33  return hdf5::detail::make_pvp_proxy<std::pair<T *, std::vector<std::size_t> > >(
34  path
35  , std::make_pair(value, size)
36  );
37  }
38 
39 }
40 
41 #endif
std::enable_if<!is_sequence< T >::value, std::size_t >::type size(T const &)
Definition: size.hpp:20
std::enable_if<!(std::is_same< typename alps::detail::remove_cvr< typename std::remove_all_extents< T >::type >::type, char >::value &&std::is_array< T >::value), hdf5::detail::make_pvp_proxy< T & > >::type make_pvp(std::string const &path, T &value)
Definition: archive.hpp:411