7 #ifndef MATIOCPP_EXOGENOUSCONVERSIONS_TPP
8 #define MATIOCPP_EXOGENOUSCONVERSIONS_TPP
10 template <
class Vector,
typename>
17 template<
typename type,
typename>
23 template<
typename Struct,
typename>
28 visit_struct::for_each(input,
29 [& matioStruct](
const char * name,
const auto & value) {
38 template<
class iterator,
43 for (iterator it = begin; it != end; it++)
53 template<
class iterator,
54 typename std::enable_if_t<matioCpp::is_pair_iterator_string<iterator>::value>*>
63 bool ok = matioCellArray.setElement(index,
make_variable(it->first, it->second));
70 return matioCellArray;
73 template<
class iterator,
74 typename std::enable_if_t<!matioCpp::is_pair<decltype(*std::declval<iterator>())>::value>*>
90 return matioCellArray;
CellArray is a particular type of Variable specialized for cell arrays.
Element allows having a 1x1 variable (like double, int,..) castable to a primitive type.
Struct is a particular type of Variable specialized for structs.
bool setField(index_type index, const Variable &newValue)
Set the field at the specified position.
Vector is a particular type of Variable specialized for 1-D arrays of a generic type T.
matioCpp::Struct make_struct(const std::string &name, iterator begin, iterator end)
Create a matioCpp::Struct starting from the begin and end iterators of a map-like container The deref...
matioCpp::CellArray make_cell_array(const std::string &name, const iterator &begin, const iterator &end)
Create a matioCpp::CellArray starting from the begin and end iterators of a container.
MATIOCPP_CONSTEXPR Span< ElementType > make_span(ElementType *ptr, typename Span< ElementType >::index_type count)
void unused(Args &&...)
Utility metafunction to avoid compiler warnings about unused variables.
matioCpp::Vector< typename std::remove_cv_t< typename matioCpp::SpanUtils::container_data< Vector >::type > > make_variable(const std::string &name, const Vector &input)
Conversion from a generic vector to a matioCpp::Vector.
is_make_variable_callable is a template utility to check if the make_variable works for a give type