ATLAS Offline Software
|
Utility class (not a tool or so) to serialize strings into stream of 32bit integers. More...
#include <StringSerializer.h>
Public Member Functions | |
void | serialize (const std::vector< std::string > &strings, std::vector< uint32_t > &storage) |
Serializes vector of strings into vector of integers. More... | |
void | serialize (const std::string &str, std::vector< uint32_t > &storage) |
std::size_t | deserialize (std::vector< uint32_t >::const_iterator first, std::vector< uint32_t >::const_iterator last, std::vector< std::string > &strings) |
Deserialize vector into strings. More... | |
std::size_t | deserialize (const std::vector< uint32_t > &storage, std::vector< std::string > &strings) |
Same as above but with vector instead of iterators. More... | |
std::size_t | deserialize (std::vector< uint32_t >::const_iterator first, std::vector< uint32_t >::const_iterator last, std::string &str) |
Deserialize one single string. More... | |
std::size_t | deserialize (const std::vector< uint32_t > &storage, std::string &str) |
Deserialize one single string More... | |
unsigned int | inquireSize (const std::vector< uint32_t > &storage) |
Return number of strings serialized into 'storage'. More... | |
Private Member Functions | |
unsigned int | getPadding (unsigned int sizeToReserve) |
Get number of padding bytes needed to align with uint32_t. More... | |
Private Attributes | |
std::ostringstream | m_ostream |
sstream used in serialization More... | |
std::istringstream | m_istream |
sstream used in de-serialization More... | |
Static Private Attributes | |
static const char *const | s_delimiter = "\n" |
default delimeter which is put between strings from the input vector while serialization happens More... | |
Utility class (not a tool or so) to serialize strings into stream of 32bit integers.
Definition at line 22 of file TrigEvent/TrigSteeringEvent/TrigSteeringEvent/StringSerializer.h.
|
inline |
Deserialize one single string
Definition at line 62 of file TrigEvent/TrigSteeringEvent/TrigSteeringEvent/StringSerializer.h.
|
inline |
Same as above but with vector instead of iterators.
Definition at line 52 of file TrigEvent/TrigSteeringEvent/TrigSteeringEvent/StringSerializer.h.
std::size_t StringSerializer::deserialize | ( | std::vector< uint32_t >::const_iterator | first, |
std::vector< uint32_t >::const_iterator | last, | ||
std::string & | str | ||
) |
Deserialize one single string.
Definition at line 112 of file TrigEvent/TrigSteeringEvent/src/StringSerializer.cxx.
std::size_t StringSerializer::deserialize | ( | std::vector< uint32_t >::const_iterator | first, |
std::vector< uint32_t >::const_iterator | last, | ||
std::vector< std::string > & | strings | ||
) |
Deserialize vector into strings.
first | Beginning of 'byte-stream' |
last | End of 'byte-stream', i.e. vector::end() |
strings | Vector of strings to hold result |
Definition at line 67 of file TrigEvent/TrigSteeringEvent/src/StringSerializer.cxx.
|
inlineprivate |
Get number of padding bytes needed to align with uint32_t.
Definition at line 76 of file TrigEvent/TrigSteeringEvent/TrigSteeringEvent/StringSerializer.h.
unsigned int StringSerializer::inquireSize | ( | const std::vector< uint32_t > & | storage | ) |
Return number of strings serialized into 'storage'.
Definition at line 124 of file TrigEvent/TrigSteeringEvent/src/StringSerializer.cxx.
void StringSerializer::serialize | ( | const std::string & | str, |
std::vector< uint32_t > & | storage | ||
) |
void StringSerializer::serialize | ( | const std::vector< std::string > & | strings, |
std::vector< uint32_t > & | storage | ||
) |
Serializes vector of strings into vector of integers.
The number of strings (size of input vector) is put first into the stream. In case the strings is an empty vector the 0 is put into the storage.
strings | |
storage | is place where serizlized from of stings is appended to |
Definition at line 15 of file TrigEvent/TrigSteeringEvent/src/StringSerializer.cxx.
|
private |
sstream used in de-serialization
Definition at line 81 of file TrigEvent/TrigSteeringEvent/TrigSteeringEvent/StringSerializer.h.
|
private |
sstream used in serialization
Definition at line 80 of file TrigEvent/TrigSteeringEvent/TrigSteeringEvent/StringSerializer.h.
default delimeter which is put between strings from the input vector while serialization happens
Definition at line 82 of file TrigEvent/TrigSteeringEvent/TrigSteeringEvent/StringSerializer.h.