ipa: libipa: vector: Specialize YamlObject getter
Implement a specialization of the YamlObject::Getter structure to support deserializing ipa::Vector objects from YAML data. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
This commit is contained in:
@@ -148,6 +148,23 @@ namespace ipa {
|
||||
* \return True if the two vectors are not equal, false otherwise
|
||||
*/
|
||||
|
||||
#ifndef __DOXYGEN__
|
||||
bool vectorValidateYaml(const YamlObject &obj, unsigned int size)
|
||||
{
|
||||
if (!obj.isList())
|
||||
return false;
|
||||
|
||||
if (obj.size() != size) {
|
||||
LOG(Vector, Error)
|
||||
<< "Wrong number of values in YAML vector: expected "
|
||||
<< size << ", got " << obj.size();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif /* __DOXYGEN__ */
|
||||
|
||||
} /* namespace ipa */
|
||||
|
||||
} /* namespace libcamera */
|
||||
|
||||
Reference in New Issue
Block a user