libabigail
Loading...
Searching...
No Matches
abg-traverse.cc
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2// -*- Mode: C++ -*-
3//
4// Copyright (C) 2013-2026 Red Hat, Inc.
5
6/// @file
7
8#include <atomic>
9
10#include "abg-internal.h"
11// <headers defining libabigail's API go under here>
12ABG_BEGIN_EXPORT_DECLARATIONS
13
14#include "abg-traverse.h"
15
16ABG_END_EXPORT_DECLARATIONS
17// </headers defining libabigail's API>
18
19namespace abigail
20{
21
22namespace ir
23{
24
25/// Private data type of the @ref traversable_base type.
26struct traversable_base::priv
27{
28 std::atomic<bool> visiting_;
29
30 priv(bool visiting = false)
31 : visiting_(visiting)
32 {}
33}; // end struct traversable_base::priv
34
35/// Default constructor of the @ref traversable_base type.
37 :priv_(new priv)
38{}
39
40/// Destructor of the @ref traversable_base type.
43
44/// This should returns false before and after the node has been
45/// visiting. During the visiting of the node (and of its children)
46/// this should return true.
47///
48/// @return true if the current node is being visited.
49bool
51{return priv_->visiting_;}
52
53/// The traversing code should be responsible of calling this, not
54/// the user code.
55///
56/// This is the setter of the "visiting" flag of the node being
57/// visited. If set to yes, it means the node is being visited.
58/// False means either the node has not yet been visited, or it
59/// has already been visited.
60///
61/// @param f the new value of the "visiting" flag.
62void
64{priv_->visiting_.store(f);}
65
66}// end namaspace ir
67}// end namespace abigail
virtual ~traversable_base()
Destructor of the traversable_base type.
bool visiting() const
This should returns false before and after the node has been visiting. During the visiting of the nod...
traversable_base()
Default constructor of the traversable_base type.
Toplevel namespace for libabigail.