libcamera: yaml_parser: Rename Getter to Accessor
In preparation for support to set the value of a YamlObject, rename the Getter structure to Accessor. The structure will be extended with a set() function. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
This commit is contained in:
@@ -200,7 +200,7 @@ std::ostream &operator<<(std::ostream &out, const Matrix<T, Rows, Cols> &m)
|
||||
}
|
||||
|
||||
template<typename T, unsigned int Rows, unsigned int Cols>
|
||||
struct YamlObject::Getter<Matrix<T, Rows, Cols>> {
|
||||
struct YamlObject::Accessor<Matrix<T, Rows, Cols>> {
|
||||
std::optional<Matrix<T, Rows, Cols>> get(const YamlObject &obj) const
|
||||
{
|
||||
if (!matrixValidateYaml(obj, Rows * Cols))
|
||||
|
||||
@@ -347,7 +347,7 @@ std::ostream &operator<<(std::ostream &out, const Vector<T, Rows> &v)
|
||||
}
|
||||
|
||||
template<typename T, unsigned int Rows>
|
||||
struct YamlObject::Getter<Vector<T, Rows>> {
|
||||
struct YamlObject::Accessor<Vector<T, Rows>> {
|
||||
std::optional<Vector<T, Rows>> get(const YamlObject &obj) const
|
||||
{
|
||||
if (!vectorValidateYaml(obj, Rows))
|
||||
|
||||
@@ -173,7 +173,7 @@ public:
|
||||
template<typename T>
|
||||
std::optional<T> get() const
|
||||
{
|
||||
return Getter<T>{}.get(*this);
|
||||
return Accessor<T>{}.get(*this);
|
||||
}
|
||||
|
||||
template<typename T, typename U>
|
||||
@@ -213,7 +213,7 @@ private:
|
||||
LIBCAMERA_DISABLE_COPY_AND_MOVE(YamlObject)
|
||||
|
||||
template<typename T>
|
||||
friend struct Getter;
|
||||
friend struct Accessor;
|
||||
friend class YamlParserContext;
|
||||
|
||||
enum class Type {
|
||||
@@ -224,7 +224,7 @@ private:
|
||||
};
|
||||
|
||||
template<typename T, typename Enable = void>
|
||||
struct Getter {
|
||||
struct Accessor {
|
||||
std::optional<T> get(const YamlObject &obj) const;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user