WarpX
|
Functions | |
template<typename T > | |
void | put_in (const T &val, std::vector< char > &vec) |
template<typename T > | |
void | put_in_vec (const std::vector< T > &val, std::vector< char > &vec) |
template<typename T > | |
T | get_out (std::vector< char >::const_iterator &it) |
template<typename T > | |
std::vector< T > | get_out_vec (std::vector< char >::const_iterator &it) |
T ablastr::utils::serialization::get_out | ( | std::vector< char >::const_iterator & | it | ) |
This function extracts a variable of type T from a byte vector, at the position given by a std::vector<char> iterator. The iterator is then advanced according to the number of bytes read from the byte vector. T must be either a trivially copyable type or an std::string.
T | the variable type (must be trivially copyable) |
[in,out] | it | the iterator to a byte vector |
std::vector<T> ablastr::utils::serialization::get_out_vec | ( | std::vector< char >::const_iterator & | it | ) |
This function extracts an std::vector<T> from a byte vector, at the position given by a std::vector<char> iterator. The iterator is then advanced according to the number of bytes read from the byte vector. T must be either a trivially copyable type or an std::string.
T | the variable type (must be trivially copyable) |
[in,out] | it | the iterator to a byte vector |
void ablastr::utils::serialization::put_in | ( | const T & | val, |
std::vector< char > & | vec | ||
) |
This function transforms a variable of type T into a vector of chars holding its byte representation and it appends this vector at the end of an existing vector of chars. T must be either a trivially copyable type or an std::string
T | the variable type |
[in] | val | a variable of type T to be serialized |
[in,out] | vec | a reference to the vector to which the byte representation of val is appended |
void ablastr::utils::serialization::put_in_vec | ( | const std::vector< T > & | val, |
std::vector< char > & | vec | ||
) |
This function transforms an std::vector<T> into a vector of chars holding its byte representation and it appends this vector at the end of an existing vector of chars. T must be either a trivially copyable type or an std::string. A specialization exists in case val is a vector of chars.
T | the variable type |
[in] | val | a variable of type T to be serialized |
[in,out] | vec | a reference to the vector to which the byte representation of val is appended |