ALPSCore reference
Classes | Namespaces | Macros | Functions
archive.hpp File Reference
#include <alps/hdf5/config.hpp>
#include <alps/utilities/stacktrace.hpp>
#include <alps/hdf5/errors.hpp>
#include <alps/utilities/remove_cvr.hpp>
#include <alps/utilities/type_wrapper.hpp>
#include <boost/thread.hpp>
#include <map>
#include <vector>
#include <string>
#include <type_traits>
#include <numeric>
Include dependency graph for archive.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  alps::hdf5::is_native_type< T >
 Inherits from true_type if T is a native type, from false_type otherwise. More...
 
struct  alps::hdf5::is_native_type< char >
 
struct  alps::hdf5::is_native_type< signed char >
 
struct  alps::hdf5::is_native_type< unsigned char >
 
struct  alps::hdf5::is_native_type< short >
 
struct  alps::hdf5::is_native_type< unsigned short >
 
struct  alps::hdf5::is_native_type< int >
 
struct  alps::hdf5::is_native_type< unsigned >
 
struct  alps::hdf5::is_native_type< long >
 
struct  alps::hdf5::is_native_type< unsigned long >
 
struct  alps::hdf5::is_native_type< long long >
 
struct  alps::hdf5::is_native_type< unsigned long long >
 
struct  alps::hdf5::is_native_type< float >
 
struct  alps::hdf5::is_native_type< double >
 
struct  alps::hdf5::is_native_type< long double >
 
struct  alps::hdf5::is_native_type< bool >
 
struct  alps::hdf5::is_native_type< std::string >
 
class  alps::hdf5::archive
 
struct  alps::hdf5::is_continuous< T >
 
struct  alps::hdf5::is_content_continuous< T >
 
struct  alps::hdf5::has_complex_elements< T >
 
struct  alps::hdf5::scalar_type< T >
 
struct  alps::hdf5::is_continuous< char >
 
struct  alps::hdf5::is_continuous< charconst >
 
struct  alps::hdf5::is_continuous< signed char >
 
struct  alps::hdf5::is_continuous< signed charconst >
 
struct  alps::hdf5::is_continuous< unsigned char >
 
struct  alps::hdf5::is_continuous< unsigned charconst >
 
struct  alps::hdf5::is_continuous< short >
 
struct  alps::hdf5::is_continuous< shortconst >
 
struct  alps::hdf5::is_continuous< unsigned short >
 
struct  alps::hdf5::is_continuous< unsigned shortconst >
 
struct  alps::hdf5::is_continuous< int >
 
struct  alps::hdf5::is_continuous< intconst >
 
struct  alps::hdf5::is_continuous< unsigned >
 
struct  alps::hdf5::is_continuous< unsignedconst >
 
struct  alps::hdf5::is_continuous< long >
 
struct  alps::hdf5::is_continuous< longconst >
 
struct  alps::hdf5::is_continuous< unsigned long >
 
struct  alps::hdf5::is_continuous< unsigned longconst >
 
struct  alps::hdf5::is_continuous< long long >
 
struct  alps::hdf5::is_continuous< long longconst >
 
struct  alps::hdf5::is_continuous< unsigned long long >
 
struct  alps::hdf5::is_continuous< unsigned long longconst >
 
struct  alps::hdf5::is_continuous< float >
 
struct  alps::hdf5::is_continuous< floatconst >
 
struct  alps::hdf5::is_continuous< double >
 
struct  alps::hdf5::is_continuous< doubleconst >
 
struct  alps::hdf5::is_continuous< long double >
 
struct  alps::hdf5::is_continuous< long doubleconst >
 
struct  alps::hdf5::is_continuous< bool >
 
struct  alps::hdf5::is_continuous< boolconst >
 
struct  alps::hdf5::is_continuous< std::string >
 
struct  alps::hdf5::is_continuous< std::stringconst >
 

Namespaces

 alps
 
 alps::hdf5
 

Macros

#define ALPS_FOREACH_NATIVE_HDF5_TYPE(CALLBACK)
 
#define ALPS_HDF5_IS_NATIVE_TYPE_CALLER(__type__)   template <> struct is_native_type<__type__> : public std::true_type {};
 
#define ONLY_NATIVE(T, R)   typename std::enable_if<is_native_type<T>::value, R>::type
 
#define ONLY_NOT_NATIVE(T, R)   typename std::enable_if<!is_native_type<T>::value, R>::type
 
#define ALPS_HDF5_IS_DATATYPE_CALLER(T)
 
#define ALPS_HDF5_DEFINE_SET_EXTENT(T)
 
#define ALPS_HDF5_DEFINE_FREE_FUNCTIONS(T)
 

Functions

template<typename T >
scalar_type< T >::type * alps::hdf5::get_pointer (T &value)
 
template<typename T >
scalar_type< T >::type const * alps::hdf5::get_pointer (T const &value)
 
template<typename T >
std::vector< std::size_t > alps::hdf5::get_extent (T const &value)
 
template<typename T >
void alps::hdf5::set_extent (T &value, std::vector< std::size_t > const &size)
 
template<typename T >
bool alps::hdf5::is_vectorizable (T const &value)
 
template<typename T >
void alps::hdf5::save (archive &ar, std::string const &path, T const &value, std::vector< std::size_t >=std::vector< std::size_t >(), std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t >=std::vector< std::size_t >())
 
template<typename T >
void alps::hdf5::load (archive &ar, std::string const &path, T &value, std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t >=std::vector< std::size_t >())
 
void alps::hdf5::save (archive &ar, std::string const &path, char const &value, std::vector< std::size_t > size=std::vector< std::size_t >(), std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::load (archive &ar, std::string const &path, char &value, std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::save (archive &ar, std::string const &path, signed char const &value, std::vector< std::size_t > size=std::vector< std::size_t >(), std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::load (archive &ar, std::string const &path, signed char &value, std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::save (archive &ar, std::string const &path, unsigned char const &value, std::vector< std::size_t > size=std::vector< std::size_t >(), std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::load (archive &ar, std::string const &path, unsigned char &value, std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::save (archive &ar, std::string const &path, short const &value, std::vector< std::size_t > size=std::vector< std::size_t >(), std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::load (archive &ar, std::string const &path, short &value, std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::save (archive &ar, std::string const &path, unsigned short const &value, std::vector< std::size_t > size=std::vector< std::size_t >(), std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::load (archive &ar, std::string const &path, unsigned short &value, std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::save (archive &ar, std::string const &path, int const &value, std::vector< std::size_t > size=std::vector< std::size_t >(), std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::load (archive &ar, std::string const &path, int &value, std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::save (archive &ar, std::string const &path, unsigned const &value, std::vector< std::size_t > size=std::vector< std::size_t >(), std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::load (archive &ar, std::string const &path, unsigned &value, std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::save (archive &ar, std::string const &path, long const &value, std::vector< std::size_t > size=std::vector< std::size_t >(), std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::load (archive &ar, std::string const &path, long &value, std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::save (archive &ar, std::string const &path, unsigned long const &value, std::vector< std::size_t > size=std::vector< std::size_t >(), std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::load (archive &ar, std::string const &path, unsigned long &value, std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::save (archive &ar, std::string const &path, long long const &value, std::vector< std::size_t > size=std::vector< std::size_t >(), std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::load (archive &ar, std::string const &path, long long &value, std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::save (archive &ar, std::string const &path, unsigned long long const &value, std::vector< std::size_t > size=std::vector< std::size_t >(), std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::load (archive &ar, std::string const &path, unsigned long long &value, std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::save (archive &ar, std::string const &path, float const &value, std::vector< std::size_t > size=std::vector< std::size_t >(), std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::load (archive &ar, std::string const &path, float &value, std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::save (archive &ar, std::string const &path, double const &value, std::vector< std::size_t > size=std::vector< std::size_t >(), std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::load (archive &ar, std::string const &path, double &value, std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::save (archive &ar, std::string const &path, long double const &value, std::vector< std::size_t > size=std::vector< std::size_t >(), std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::load (archive &ar, std::string const &path, long double &value, std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::save (archive &ar, std::string const &path, bool const &value, std::vector< std::size_t > size=std::vector< std::size_t >(), std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::load (archive &ar, std::string const &path, bool &value, std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::save (archive &ar, std::string const &path, std::string const &value, std::vector< std::size_t > size=std::vector< std::size_t >(), std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void alps::hdf5::load (archive &ar, std::string const &path, std::string &value, std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
template<typename T >
std::enable_if< has_complex_elements< typename alps::detail::remove_cvr< T >::type >::value, archive & >::type alps::hdf5::operator<< (archive &ar, detail::make_pvp_proxy< T > const &proxy)
 
template<typename T >
std::enable_if< !has_complex_elements< typename alps::detail::remove_cvr< T >::type >::value, archive & >::type alps::hdf5::operator<< (archive &ar, detail::make_pvp_proxy< T > const &proxy)
 
template<typename T >
archive & alps::hdf5::operator>> (archive &ar, detail::make_pvp_proxy< T > proxy)
 
template<typename T >
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 alps::make_pvp (std::string const &path, T &value)
 
template<typename T >
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 const & > >::type alps::make_pvp (std::string const &path, T const &value)
 
template<typename T >
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< std::string const > >::type alps::make_pvp (std::string const &path, T const &value)
 

Macro Definition Documentation

#define ALPS_FOREACH_NATIVE_HDF5_TYPE (   CALLBACK)
Value:
CALLBACK(char) \
CALLBACK(signed char) \
CALLBACK(unsigned char) \
CALLBACK(short) \
CALLBACK(unsigned short) \
CALLBACK(int) \
CALLBACK(unsigned) \
CALLBACK(long) \
CALLBACK(unsigned long) \
CALLBACK(long long) \
CALLBACK(unsigned long long) \
CALLBACK(float) \
CALLBACK(double) \
CALLBACK(long double) \
CALLBACK(bool) \
CALLBACK(std::string)

Definition at line 28 of file archive.hpp.

#define ALPS_HDF5_DEFINE_FREE_FUNCTIONS (   T)

Definition at line 324 of file archive.hpp.

#define ALPS_HDF5_DEFINE_SET_EXTENT (   T)
Value:
template<> struct set_extent<T> { \
static void apply(T &, std::vector<std::size_t> const & extent) { \
if (extent.size() > 0) \
throw wrong_type("The extents do not match" + ALPS_STACKTRACE); \
} \
};
void set_extent(T &value, std::vector< std::size_t > const &size)
Definition: archive.hpp:284
#define ALPS_STACKTRACE
Definition: stacktrace.hpp:37

Definition at line 243 of file archive.hpp.

#define ALPS_HDF5_IS_DATATYPE_CALLER (   T)
Value:
template<typename A> struct is_datatype_caller<A, T > { \
static bool apply(A const & ar, std::string path, T unused = alps::detail::type_wrapper<T>::type()) { \
return ar.is_datatype_impl(path, unused); \
} \
};

Definition at line 69 of file archive.hpp.

#define ALPS_HDF5_IS_NATIVE_TYPE_CALLER (   __type__)    template <> struct is_native_type<__type__> : public std::true_type {};

Definition at line 52 of file archive.hpp.

#define ONLY_NATIVE (   T,
 
)    typename std::enable_if<is_native_type<T>::value, R>::type

Definition at line 56 of file archive.hpp.

#define ONLY_NOT_NATIVE (   T,
 
)    typename std::enable_if<!is_native_type<T>::value, R>::type

Definition at line 57 of file archive.hpp.