blob: 045ecb18c05433c8cbf75f16c77c5573f9e84051 [file] [log] [blame] [edit]
// Copyright 2023 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef LIB_DRIVER_DEVICETREE_VISITOR_H_
#define LIB_DRIVER_DEVICETREE_VISITOR_H_
#include <lib/devicetree/devicetree.h>
#include <lib/zx/result.h>
namespace fdf_devicetree {
class Node;
// A visitor is a class that visits nodes in the devicetree.
// See |Manager::Walk()| for more information.
class Visitor {
public:
explicit Visitor() = default;
virtual ~Visitor() = default;
virtual zx::result<> Visit(Node& node, const devicetree::PropertyDecoder& decoder) = 0;
};
} // namespace fdf_devicetree
#endif // LIB_DRIVER_DEVICETREE_VISITOR_H_