The bytestream class provides a container for data to be serialised, and subsequently unpacked.
More...
#include <bytestreamC.h>
|
| bytestream () |
| Construct an empty bytestream object. More...
|
|
| bytestream (const char *buffer) |
| Construct a bytestream object to contain the raw data of a previous bytestream construction. More...
|
|
| ~bytestream () |
|
molpro::array< double > | doubles () |
| Interpret the next array in the object as an array of doubles, advance the pointer to the following object, and return the array. More...
|
|
molpro::array< fint > | ints () |
| Interpret the next array in the object as an array of integers, advance the pointer to the following object, and return the array. More...
|
|
molpro::array< char > | chars () |
| Interpret the next array in the object as an array of characters, advance the pointer to the following object, and return the array. More...
|
|
bytestream | byteStream () |
| Interpret the next item in the object as a bytestream, advance the pointer to the following object, and return the item. More...
|
|
void | reset () |
| Reset the pointer to the beginning of the buffer. More...
|
|
void | append (const double *array, size_t length=1) |
| Add a double array to the bytestream. More...
|
|
void | append (const fint *array, size_t length=1) |
| Add an integer array to the bytestream. More...
|
|
void | append (const char *array, size_t length=1) |
| Add a char array to the bytestream. More...
|
|
void | append (const bytestream &bs) |
|
void | append (size_t i) |
|
template<class T > |
void | append (const T *array, size_t length=1) |
|
template<class T > |
void | append (const std::vector< T > array) |
|
size_t | size () const |
| The size of the bytestream data. More...
|
|
size_t | position () const |
| The current position in the bytestream data during unpacking through successive calls to doubles(), ints() or chars(). More...
|
|
const std::vector< char > & | data () const |
| The raw data of the object. More...
|
|
void | dump () |
|
size_t | hash () const |
|
size_t | position () |
|
The bytestream class provides a container for data to be serialised, and subsequently unpacked.
◆ bytestream() [1/2]
bytestream::bytestream |
( |
| ) |
|
Construct an empty bytestream object.
◆ bytestream() [2/2]
bytestream::bytestream |
( |
const char * |
buffer | ) |
|
Construct a bytestream object to contain the raw data of a previous bytestream construction.
- Parameters
-
buffer | The data obtained from a previous construction of a bytestream. |
◆ ~bytestream()
bytestream::~bytestream |
( |
| ) |
|
◆ append() [1/7]
◆ append() [2/7]
void bytestream::append |
( |
const char * |
array, |
|
|
size_t |
length = 1 |
|
) |
| |
Add a char array to the bytestream.
- Parameters
-
array | Source of data. |
length | Length of data. |
◆ append() [3/7]
void bytestream::append |
( |
const double * |
array, |
|
|
size_t |
length = 1 |
|
) |
| |
Add a double array to the bytestream.
- Parameters
-
array | Source of data. |
length | Length of data. |
◆ append() [4/7]
void bytestream::append |
( |
const fint * |
array, |
|
|
size_t |
length = 1 |
|
) |
| |
Add an integer array to the bytestream.
- Parameters
-
array | Source of data. The integers should be of type fint; however, there is also a template function that copies to fint from other integer types, and then calls this function. |
length | Length of data. |
◆ append() [5/7]
template<class T >
void molpro::bytestream::append |
( |
const std::vector< T > |
array | ) |
|
|
inline |
◆ append() [6/7]
template<class T >
void molpro::bytestream::append |
( |
const T * |
array, |
|
|
size_t |
length = 1 |
|
) |
| |
|
inline |
◆ append() [7/7]
void molpro::bytestream::append |
( |
size_t |
i | ) |
|
|
inline |
◆ byteStream()
Interpret the next item in the object as a bytestream, advance the pointer to the following object, and return the item.
- Returns
◆ chars()
Interpret the next array in the object as an array of characters, advance the pointer to the following object, and return the array.
- Returns
◆ data()
const std::vector<char>& molpro::bytestream::data |
( |
| ) |
const |
|
inline |
The raw data of the object.
- Returns
◆ doubles()
Interpret the next array in the object as an array of doubles, advance the pointer to the following object, and return the array.
- Returns
◆ dump()
void bytestream::dump |
( |
| ) |
|
◆ hash()
size_t bytestream::hash |
( |
| ) |
const |
◆ ints()
Interpret the next array in the object as an array of integers, advance the pointer to the following object, and return the array.
- Returns
◆ position() [1/2]
size_t molpro::bytestream::position |
( |
| ) |
|
|
inline |
◆ position() [2/2]
size_t bytestream::position |
( |
| ) |
const |
The current position in the bytestream data during unpacking through successive calls to doubles(), ints() or chars().
- Returns
◆ reset()
void bytestream::reset |
( |
| ) |
|
Reset the pointer to the beginning of the buffer.
◆ size()
size_t bytestream::size |
( |
| ) |
const |
The size of the bytestream data.
- Returns
The documentation for this class was generated from the following files: