4 #include "ObjectInfo.h"
39 mDesc.extFlags |= ExtInfo;
50 mDesc.extFlags |= Minimum;
62 mDesc.extFlags |= Maximum;
74 mDesc.extFlags |= Default;
86 m_step =
new T(value);
87 mDesc.extFlags |= Step;
101 return min(minValue).max(maxValue).def(defValue);
117 mDesc.extFlags |= MimeType;
134 mDesc.extFlags |= Hint;
149 mDesc.extFlags |= Unit;
160 mDesc.extFlags |= Options;
174 m_extInfo.RMIP = value.count();
175 m_extInfo.needTimestamp = m_extInfo.RMIP > 0;
191 template<
typename... Args>
195 return enumeration(a...);
203 template<
typename... Args>
206 for (
auto item: list)
208 return enumeration();
213 virtual bool readMeta(QByteArray &ba, MetaValue
id)
const override
217 case MV_Min:
return doRead(ba, m_min);
218 case MV_Max:
return doRead(ba, m_max);
219 case MV_Def:
return doRead(ba, m_def);
220 case MV_Step:
return doRead(ba, m_step);
221 case MV_Mime: ba.append(m_mimeType.toUtf8());
return true;
222 case MV_Hint: ba.append(m_hint.toUtf8());
return true;
223 case MV_Unit: ba.append(m_unit.toUtf8());
return true;
224 case MV_Options: ba.append(m_options.toUtf8());
return true;
225 case MV_ExtInfo: ba.append(reinterpret_cast<const char*>(&m_extInfo),
sizeof(ExtendedInfo));
return true;
226 case MV_Enum: ba.append(m_enum.join(
",").toUtf8());
return true;
247 min(static_cast<T>(0));
248 max(static_cast<T>(m_enum.count() - 1));
249 mDesc.extFlags |= Enum;
254 #endif // ONBOBJECT_H
ONBObject< T > & sampling(std::chrono::milliseconds value)
Set the default sampling interval of the object.
Definition: onbobject.h:172
ONBObject< T > & enumeration(QString s, Args...a)
Specify the list of the enumeration object values.
Definition: onbobject.h:192
ONBObject< T > & def(const T &value)
Set the default value of the object.
Definition: onbobject.h:70
Component-side ONB Object.
Definition: ObjectInfo.h:9
ONBObject< T > & mime(const QString &value)
Set the mime-type of the object.
Definition: onbobject.h:114
ONBObject< T > & min(const T &value)
Set the minimum value of the object.
Definition: onbobject.h:46
ONB Object base interface.
Definition: ObjectInfo.h:16
ONBObject< T > & enumeration(QStringList list)
Specify the names of the enumeration object with given string list.
Definition: onbobject.h:204
ONBObject()
Default constructor.
Definition: onbobject.h:37
ONBObject< T > & max(const T &value)
Set the maximum value of the object.
Definition: onbobject.h:58
ONBObject< T > & step(const T &value)
Set the step value of the object.
Definition: onbobject.h:83
ONBObject< T > & hint(const QString &value)
Set the human-readable description of the object.
Definition: onbobject.h:131
ONBObject< T > & MMD(const T &minValue, const T &maxValue, const T &defValue)
Set the minimum, maximum and default value of the object.
Definition: onbobject.h:99
ONBObject< T > & unit(const QString &value)
Set the unit of the object.
Definition: onbobject.h:146
ONBObject< T > & opt(const QString &value)
Set the optional text associated to the object.
Definition: onbobject.h:157