1 #ifndef MATIOCPP_STRUCTARRAYELEMENT_H
2 #define MATIOCPP_STRUCTARRAYELEMENT_H
15 template <
bool isConst>
23 using input_vector_type = std::conditional_t<isConst, const matioCpp::StructArray, matioCpp::StructArray>;
27 using output_struct_type = std::conditional_t<isConst, const matioCpp::Struct, matioCpp::Struct>;
53 template<
bool B,
typename =
typename std::enable_if_t<!B && isConst>>
68 template<
bool B,
typename =
typename std::enable_if_t<!B && isConst>>
90 template<
bool B,
typename =
typename std::enable_if_t<!B && isConst>>
99 template<
bool B = isConst,
typename =
typename std::enable_if_t<(B == isConst) && !B>>
108 template<
bool B = isConst,
typename =
typename std::enable_if_t<(B == isConst) && !B>>
145 template<
bool B = isConst,
typename =
typename std::enable_if_t<(B == isConst) && !B>>
154 template<
bool B = isConst,
typename =
typename std::enable_if_t<(B == isConst) && !B>>
162 template<
bool B = isConst,
typename =
typename std::enable_if_t<(B == isConst) && !B>>
StructArrayElement & operator=(const matioCpp::Struct &other) const
Assignement operator from a struct.
StructArrayElement< isConst > & operator=(StructArrayElement< B > &&other)
Move assignement (from non-const to const)
output_variable_type operator()(index_type el) const
Access field at a specific index.
index_type numberOfFields() const
Get the total number of fields in the struct.
bool isFieldExisting(const std::string &field) const
Check if a field is existing It performs a linear search over the output of fields().
bool fromVectorOfVariables(const std::vector< Variable > &elements) const
Set from a vector of Variables.
output_struct_type asStruct() const
Get the element as a Struct.
std::conditional_t< isConst, const matioCpp::Struct, matioCpp::Struct > output_struct_type
bool setField(index_type index, const Variable &newValue) const
Set the field at the specified position.
output_variable_type operator[](index_type el) const
Access field at a specific index.
StructArrayElement & operator=(const StructArrayElement &other)=delete
Deleted copy assignement since it is not clear whether the index or the content have to be copied.
StructArrayElement()=delete
Deleted default constructor.
std::conditional_t< isConst, const matioCpp::StructArray, matioCpp::StructArray > input_vector_type
The type used for indices.
std::vector< std::string > fields() const
Get the list of fields.
std::conditional_t< isConst, const matioCpp::Variable, matioCpp::Variable > output_variable_type
size_t getFieldIndex(const std::string &field) const
Get the index of the specified field in the struct by performing a linear search.
Struct is a particular type of Variable specialized for structs.
The matioCpp::Variable class is the equivalent of matvar_t in matio.