69 void append(
const double*
array,
size_t length = 1);
89 std::vector<fint> buffer(length);
90 for (
size_t i=0; i<length; i++)
92 append(buffer.data(),length);
104 std::vector<fint> o(length);
105 for (
size_t k = 0; k < length; k++) o[k] =
array[k];
112 for (
auto& i :
array) o.push_back(i);
131 const std::vector<char>&
data()
const {
return buffer; }
138 enum datatypes { datatype_char = 0, datatype_int = 1, datatype_double = 2, datatype_bool = 3 };
140 struct metadata {
size_t length;
enum datatypes datatype; };
144 bytestream::metadata get_metadata();
150 void put_metadata(
size_t length,
enum datatypes datatype);
151 std::vector<char> buffer;
size_t memory_bytestream_hash(const char *s, size_t n)
Definition: bytestreamC.cpp:272
A template for a container class like std::array<T> but with the following features.
Definition: memory.h:666
The bytestream class provides a container for data to be serialised, and subsequently unpacked.
Definition: bytestreamC.h:21
void append(const std::vector< T > array)
Definition: bytestreamC.h:110
molpro::array< fint > ints()
Interpret the next array in the object as an array of integers, advance the pointer to the following ...
Definition: bytestreamC.cpp:57
bytestream byteStream()
Interpret the next item in the object as a bytestream, advance the pointer to the following object,...
Definition: bytestreamC.cpp:84
size_t position() const
The current position in the bytestream data during unpacking through successive calls to doubles(),...
Definition: bytestreamC.cpp:262
molpro::array< char > chars()
Interpret the next array in the object as an array of characters, advance the pointer to the followin...
Definition: bytestreamC.cpp:71
size_t hash() const
Definition: bytestreamC.cpp:277
void append(size_t i)
Definition: bytestreamC.h:96
void reset()
Reset the pointer to the beginning of the buffer.
Definition: bytestreamC.cpp:257
size_t size() const
The size of the bytestream data.
Definition: bytestreamC.cpp:261
bytestream()
Construct an empty bytestream object.
Definition: bytestreamC.cpp:11
void dump()
Definition: bytestreamC.cpp:264
void append(const T *array, size_t length=1)
Definition: bytestreamC.h:103
void append(const double *array, size_t length=1)
Add a double array to the bytestream.
Definition: bytestreamC.cpp:182
const std::vector< char > & data() const
The raw data of the object.
Definition: bytestreamC.h:131
molpro::array< double > doubles()
Interpret the next array in the object as an array of doubles, advance the pointer to the following o...
Definition: bytestreamC.cpp:29
~bytestream()
Definition: bytestreamC.cpp:26
size_t position()
Definition: bytestreamC.h:154
Class that manages input options.
Definition: iostream.h:14
int32_t fint
Type for integers stored in a bytestream. The intention is that these should match the Fortran standa...
Definition: bytestreamC.h:15