libcamera: Rename YamlObject to ValueNode

The YamlObject class is now a generic data container to model trees of
values. Rename it to ValueNode and expand the class documentation.

While at it, drop the unneeded libcamera:: namespace prefix when using
the ValueNode class.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
This commit is contained in:
Laurent Pinchart
2025-10-19 15:28:34 +03:00
parent 9be3ed8104
commit 554c5c7fa1
134 changed files with 813 additions and 800 deletions
+5 -5
View File
@@ -19,7 +19,7 @@
#include <libcamera/base/span.h>
#include "libcamera/internal/matrix.h"
#include "libcamera/internal/yaml_object.h"
#include "libcamera/internal/value_node.h"
namespace libcamera {
@@ -329,7 +329,7 @@ bool operator!=(const Vector<T, Rows> &lhs, const Vector<T, Rows> &rhs)
}
#ifndef __DOXYGEN__
bool vectorValidateYaml(const YamlObject &obj, unsigned int size);
bool vectorValidateYaml(const ValueNode &obj, unsigned int size);
#endif /* __DOXYGEN__ */
#ifndef __DOXYGEN__
@@ -347,8 +347,8 @@ std::ostream &operator<<(std::ostream &out, const Vector<T, Rows> &v)
}
template<typename T, unsigned int Rows>
struct YamlObject::Accessor<Vector<T, Rows>> {
std::optional<Vector<T, Rows>> get(const YamlObject &obj) const
struct ValueNode::Accessor<Vector<T, Rows>> {
std::optional<Vector<T, Rows>> get(const ValueNode &obj) const
{
if (!vectorValidateYaml(obj, Rows))
return std::nullopt;
@@ -356,7 +356,7 @@ struct YamlObject::Accessor<Vector<T, Rows>> {
Vector<T, Rows> vector;
unsigned int i = 0;
for (const YamlObject &entry : obj.asList()) {
for (const ValueNode &entry : obj.asList()) {
const auto value = entry.get<T>();
if (!value)
return std::nullopt;