25 #ifndef CARGO_FD_FROM_FDSTORE_VISITOR_HPP
26 #define CARGO_FD_FROM_FDSTORE_VISITOR_HPP
52 void visit(
const std::string&, T& value)
73 value =
new char[size + 1];
83 template<typename T, typename std::enable_if<std::is_arithmetic<T>::value,
int>::type = 0>
89 template<typename T, typename std::enable_if<isVisitable<T>::value,
int>::type = 0>
93 value.accept(visitor);
96 template<typename T, typename std::enable_if<std::is_enum<T>::value,
int>::type = 0>
99 readInternal(*
reinterpret_cast<typename std::underlying_type<T>::type*
>(&value));
107 values.resize(vectorSize);
109 for (T& value : values) {
114 template<
typename T, std::
size_t N>
117 for (T& value : values) {
128 for (
size_t i = 0; i < mapSize; ++i) {
129 std::pair<std::string, V> val;
131 values.insert(std::move(val));
135 template<typename T, typename std::enable_if<isLikeTuple<T>::value,
int>::type = 0>
144 #endif // CARGO_FD_FROM_FDSTORE_VISITOR_HPP
Definition: fdstore.hpp:36
void readInternal(char *&value)
Definition: from-fdstore-visitor.hpp:68
Internal configuration helper.
void visit(const std::string &, T &value)
Definition: from-fdstore-visitor.hpp:52
void readInternal(std::vector< T > &values)
Definition: from-fdstore-visitor.hpp:103
void readInternal(T &value)
Definition: from-fdstore-visitor.hpp:84
void readInternal(std::string &value)
Definition: from-fdstore-visitor.hpp:60
Whenever possible, this type will be serialized using Linux file descriptor passing.
Definition: types.hpp:33
Helper function for iterating tuples, pairs and arrays.
void readInternal(std::array< T, N > &values)
Definition: from-fdstore-visitor.hpp:115
void readInternal(cargo::FileDescriptor &fd)
Definition: from-fdstore-visitor.hpp:78
Definition: from-fdstore-visitor.hpp:40
void read(void *bufferPtr, const size_t size, const unsigned int timeoutMS=maxTimeout)
Reads a value of the given type.
Definition: fdstore.cpp:134
FDStore mStore
Definition: from-fdstore-visitor.hpp:58
void readInternal(T &values)
Definition: from-fdstore-visitor.hpp:136
FromFDStoreVisitor(int fd)
Definition: from-fdstore-visitor.hpp:42
void readInternal(std::map< std::string, V > &values)
Definition: from-fdstore-visitor.hpp:123
Declaration of a class for writing and reading data from a file descriptor.
int receiveFD(const unsigned int timeoutMS=maxTimeout)
Definition: fdstore.cpp:228
FromFDStoreVisitor & operator=(const FromFDStoreVisitor &)=delete
void visitFields(T &t, F f, A...args)
Definition: visit-fields.hpp:58