13#ifndef ML_MULTI_FIELDS_H
14#define ML_MULTI_FIELDS_H
36template <
class DATATYPE>
inline std::ostream&
operator<<(std::ostream& s,
const std::vector<DATATYPE>& vec)
39 for (
size_t i = 0;
i < vec.size();
i++) {
48template <
class DATATYPE>
inline std::istream&
operator>>(std::istream& s, std::vector<DATATYPE>& vec)
83 std::istringstream
ist(value);
104 if (
nullptr == values) {
113 _fields[c] = values[c];
132 if (
nullptr == values) {
143 values[c] = _fields[c];
153 std::ostringstream
ost;
179 return _fields.size();
184 std::vector<DATATYPE> _fields;
191#if !defined(_WIN32) && !defined(WIN32)
196template class MultiField<MLdouble>;
197template class MultiField<MLfloat>;
198template class MultiField<MLint>;
199template class MultiField<MLint32>;
200template class MultiField<MLuint32>;
212#pragma warning(disable : 4275)
ML_CLASS_HEADER(DoubleMultiField)
Macro to implement the interface for the Runtime Type System and for the initialization of this class...
DoubleMultiField(const std::string &name="")
Constructor. See constructor of MultiField for documentation.
Base class for all fields used in the ML.
Class FloatMultiField. See MultiField for documentation.
FloatMultiField(const std::string &name="")
Constructor. See constructor of MultiField for documentation.
ML_CLASS_HEADER(FloatMultiField)
Macro to implement the interface for the Runtime Type System and for the initialization of this class...
Class Int32MultiField. See MultiField for documentation.
ML_CLASS_HEADER(Int32MultiField)
Macro to implement the interface for the Runtime Type System and for the initialization of this class...
Int32MultiField(const std::string &name="")
Constructor. See constructor of MultiField for documentation.
Class IntMultiField. See MultiField for documentation.
ML_CLASS_HEADER(IntMultiField)
Macro to implement the interface for the Runtime Type System and for the initialization of this class...
IntMultiField(const std::string &name="")
Constructor. See constructor of MultiField for documentation.
Field to represent a dynamic vector of DATATYPE values.
void setMultiField(const std::vector< DATATYPE > &value)
Set values of the field to value which is a std::vector.
std::vector< DATATYPE > & getNonConstMultiField()
Returns the vector of the field as modifiable reference.
void setMultiField(const DATATYPE values[], size_t numValues)
Set values of the field to values which is an array of values.
const std::vector< DATATYPE > & getMultiField() const
Returns the vector of the field.
void setStringValue(const std::string &value) override
Set value to value.
std::string getStringValue() const override
Return the value as string value.
size_t getSize() const
Returns number of entries in vector.
void getMultiField(DATATYPE values[], size_t numValues)
Get values from the field into values which is an array of values.
MultiField(const std::string &name="")
Empty Constructor: Create a field with name name.
Class UInt32MultiField. See MultiField for documentation.
UInt32MultiField(const std::string &name="")
Constructor. See constructor of MultiField for documentation.
ML_CLASS_HEADER(UInt32MultiField)
Macro to implement the interface for the Runtime Type System and for the initialization of this class...
#define ML_BAD_POINTER_OR_0
A pointer is NULL or a value is NULL or 0 where it should not be.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
std::ostream & operator<<(std::ostream &out, const ml::Variant &variant)
std::istream & operator>>(std::istream &in, ml::Variant &variant)
void ML_UTILS_EXPORT printTemplateFatalError(const char *location, MLErrorCode reason, const std::string_view &handling)