16 #ifndef IOX_UTILS_CXX_SERIALIZATION_HPP
17 #define IOX_UTILS_CXX_SERIALIZATION_HPP
19 #include "iceoryx_utils/cxx/convert.hpp"
73 std::string
toString()
const noexcept;
77 operator std::string()
const noexcept;
84 template <
typename... Targs>
95 template <
typename T,
typename... Targs>
96 bool extract(T& t, Targs&... args)
const noexcept;
105 template <
typename T>
106 bool getNth(
const unsigned int index, T& t)
const noexcept;
110 static constexpr
char separator =
':';
113 static std::string serializer() noexcept;
115 static bool removeFirstEntry(std::string& firstEntry, std::string& remainder) noexcept;
117 template <
typename T>
118 static typename std::enable_if<std::is_convertible<T, Serialization>::value, std::string>::type
119 getString(
const T& t) noexcept;
120 template <
typename T>
121 static typename std::enable_if<!std::is_convertible<T, Serialization>::value, std::string>::type
122 getString(
const T& t) noexcept;
123 template <
typename T,
typename... Targs>
124 static std::string serializer(
const T& t,
const Targs&... args) noexcept;
126 static bool deserialize(
const std::string& serializedString) noexcept;
128 template <
typename T,
typename... Targs>
129 static bool deserialize(
const std::string& serializedString, T& t, Targs&... args) noexcept;
135 #include "iceoryx_utils/internal/cxx/serialization.inl"
Simple serializer which serials every given type into the following format: (The type needs to be con...
Definition: serialization.hpp:65
bool getNth(const unsigned int index, T &t) const noexcept
Extracts the value at index and writes it into t. If the conversion failed it returns false It also r...
Definition: serialization.inl:136
Serialization(const std::string &value) noexcept
Creates a serialization object from a given raw serialization.
Definition: serialization.inl:45
bool extract(T &t, Targs &... args) const noexcept
Extracts the values from the serialization and writes them into the the given args,...
Definition: serialization.inl:40
std::string toString() const noexcept
string conversion operator, returns the raw serialized string
Definition: serialization.inl:28
static Serialization create(const Targs &... args) noexcept
Create Serialization if every arguments is convertable to string via cxx::convert::toString,...
Definition: serialization.inl:34
building block to easily create free function for logging in a library context
Definition: lockfree_queue.hpp:28