32 #ifndef MADNESS_WORLD_BINARY_FSTREAM_ARCHIVE_H__INCLUDED
33 #define MADNESS_WORLD_BINARY_FSTREAM_ARCHIVE_H__INCLUDED
41 #include <type_traits>
56 mutable std::ofstream
os;
66 std::ios_base::openmode mode = std::ios_base::binary | \
67 std::ios_base::out | std::ios_base::trunc);
70 std::ios_base::openmode mode = std::ios_base::binary | \
71 std::ios_base::out | std::ios_base::trunc)
83 typename std::enable_if< is_trivially_serializable<T>::value,
void >
::type
85 os.write((
const char *) t, n*
sizeof(
T));
93 std::ios_base::openmode mode = std::ios_base::binary | \
94 std::ios_base::out | std::ios_base::trunc);
107 mutable std::ifstream
is;
125 std::ios_base::openmode mode = std::ios_base::binary | \
138 typename std::enable_if< is_trivially_serializable<T>::value,
void >
::type
140 is.read((
char *) t, n*
sizeof(
T));
147 void open(
const char*
filename, std::ios_base::openmode mode = std::ios_base::binary | std::ios_base::in);
Interface templates for the archives (serialization).
Base class for output archive classes.
Definition: archive.h:382
Wraps an archive around a binary filestream for output.
Definition: binary_fstream_archive.h:53
void close()
Close the filestream.
Definition: binary_fstream_archive.cc:62
std::shared_ptr< char > iobuf
Buffer.
Definition: binary_fstream_archive.h:55
std::ofstream os
The filestream.
Definition: binary_fstream_archive.h:56
static const std::size_t IOBUFSIZE
Buffer size.
Definition: binary_fstream_archive.h:54
void open(const char *filename, std::ios_base::openmode mode=std::ios_base::binary|std::ios_base::out|std::ios_base::trunc)
Open the filestream.
Definition: binary_fstream_archive.cc:52
void flush()
Flush the filestream.
Definition: binary_fstream_archive.cc:69
std::enable_if< is_trivially_serializable< T >::value, void >::type store(const T *t, long n) const
Write to the filestream.
Definition: binary_fstream_archive.h:84
BinaryFstreamOutputArchive(const char *filename=nullptr, std::ios_base::openmode mode=std::ios_base::binary|std::ios_base::out|std::ios_base::trunc)
Default constructor.
Definition: binary_fstream_archive.cc:46
BinaryFstreamOutputArchive(const std::string name, std::ios_base::openmode mode=std::ios_base::binary|std::ios_base::out|std::ios_base::trunc)
Definition: binary_fstream_archive.h:69
auto T(World &world, response_space &f) -> response_space
Definition: global_functions.cc:34
File holds all helper structures necessary for the CC_Operator and CC2 class.
Definition: DFParameters.h:10
static const char * filename
Definition: legendre.cc:96
std::string type(const PairType &n)
Definition: PNOParameters.h:18
std::string name(const FuncType &type, const int ex=-1)
Definition: ccpairfunction.h:28