32#ifndef MADNESS_WORLD_BINARY_FSTREAM_ARCHIVE_H__INCLUDED
33#define MADNESS_WORLD_BINARY_FSTREAM_ARCHIVE_H__INCLUDED
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
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
void flush()
Flush the filestream.
Definition binary_fstream_archive.cc:69
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
Namespace for all elements and tools of MADNESS.
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